dr-store
Generic append-only content-addressed object store for the dr-* stack.
dr-store owns three things and nothing else:
- Immutable put — an absent typed
(schema, content_hash)key atomically accepts a verified complete canonical record value; replay of the same canonical value is idempotent success; different content at the same key is a typed conflict and never overwrites the stored value. - Verified get — every read recomputes and verifies the Content Hash
and schema declared by the
ObjectReference; missing, schema-mismatched, or corrupted content fails with a typed error. - Atomic key-to-reference binding — one generic compare-and-set that
binds an opaque caller-owned key to an
ObjectReference: an unbound key binds; the same reference replays idempotently; a different reference conflicts and never overwrites the winner. No overwrite path is exposed.
The Content Hash is the full 64-character lowercase SHA-256 digest of the
complete canonical persisted record, canonicalized through
dr-serialize's
canonical JSON. dr-store does not invent a second canonicalization
dialect, and a Content Hash is not an Identity Hash.
The vocabulary sheet
(source: .defs/vocab.html) is the authoritative statement of the
contracts this repo implements — the append-only content-addressed object
store and the Document Directory: the terms, the guarantees, what is in
and out of scope, and the mapping from each term to the exported names.
Document Directory
The Document Directory stores what a single immutable record cannot: one allocated directory with exactly one writer, one atomically-replaced canonical-JSON Manifest, and zero or more streamed binary Sidecars.
from dr_store import DocumentDirectory
directory = DocumentDirectory.allocate(
root, prefix="run", manifest_name="record.json"
)
directory.publish(manifest) # atomic durable replace
writer = directory.open_sidecar("stdout.bin", head_cap=..., tail_cap=...)
writer.write(chunk)
summary = writer.finalize() # -> SidecarSummary
directory.publish(final_manifest) # summaries embedded by caller
- Atomic durable publish — each
publish()writes the complete canonical JSON to a temp file in the same directory, flushes it (F_FULLFSYNCwhere available,os.fsyncotherwise), renames it onto the manifest name, and flushes the directory entry. After abrupt process death a reader sees either no Manifest or one complete previously published Manifest — never a partial one. The claim is scoped to local macOS filesystems; network mounts and cloud-synchronized directories are outside it. - Writer-owned truncation —
head_capbytes fill first and a ring buffer keeps the lasttail_capbytes of the remainder, stored as head segment then tail segment in one file. No caps is unbounded; an unsettail_capis head-only, so the tail buffer is bounded bytail_capand never by the stream. TheSidecarSummaryreports the stored segment lengths alongsideproducedanddroppedbyte counts, plus the Sidecar Digest: the full 64-character lowercase SHA-256 of the stored bytes. A Sidecar Digest is not a Content Hash — its input is raw bytes, not a canonical record. - Verified read-back —
read_manifest()accepts only strict canonical JSON;verify_sidecar()checks stored bytes against the digest and total segment length the caller extracted from its own Manifest. Every fault is a typed error underDocumentDirectoryError.
The component is domain-neutral in the same way the Object Store is, and narrower still: it knows no lifecycle state, never reads a field out of a Manifest payload, never computes a retention policy, and never owns threads or child processes. Concurrent allocation under one root is collision-free; each allocated directory has one writer by construction, not by locking. The vocabulary sheet's Document Directory section states its terms and guarantees.
Ecosystem
dr-store depends only on dr-serialize for canonical JSON and strict
finite-JSON validation. It carries no Whetstone, Rollout, workflow, retry,
or campaign vocabulary; the public contract is domain-neutral.
Backends
- in-memory (
MemoryBackend) — for tests and single-process use. - sqlite (
SqliteBackend) — durable and safe under concurrent cross-process use via serialized transactions.
Both satisfy the same backend-neutral contract, exercised by a shared concurrency test proving parallel binds of one unbound key produce exactly one winner.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dr_store-0.1.1.tar.gz.
File metadata
- Download URL: dr_store-0.1.1.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d981dabc3abb1f9f3ec1d19a6b62e933c1737f03d9d9ee69f64c068120aef58
|
|
| MD5 |
61fa88d299b3b89ad3016126dec68661
|
|
| BLAKE2b-256 |
797f52fc654cd893d0204a057086cd2081ee4843c58b6184428c38e7947a1b83
|
Provenance
The following attestation bundles were made for dr_store-0.1.1.tar.gz:
Publisher:
release.yml on danielle-rothermel/dr-store
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dr_store-0.1.1.tar.gz -
Subject digest:
9d981dabc3abb1f9f3ec1d19a6b62e933c1737f03d9d9ee69f64c068120aef58 - Sigstore transparency entry: 2342221560
- Sigstore integration time:
-
Permalink:
danielle-rothermel/dr-store@dce30432ef2780b88527bd8910cc35c4be7bf27f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/danielle-rothermel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dce30432ef2780b88527bd8910cc35c4be7bf27f -
Trigger Event:
push
-
Statement type:
File details
Details for the file dr_store-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dr_store-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee06652861ea0584772c6954d4e0ad9ad6899351af8818920f4ae54d3c3f605
|
|
| MD5 |
95e4255d2dcaadbea73a310aad101b06
|
|
| BLAKE2b-256 |
d38f2e08e64cbc37c704d9a26befd172066bf5cbe766bbacf12f0050eaa0bcdd
|
Provenance
The following attestation bundles were made for dr_store-0.1.1-py3-none-any.whl:
Publisher:
release.yml on danielle-rothermel/dr-store
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dr_store-0.1.1-py3-none-any.whl -
Subject digest:
2ee06652861ea0584772c6954d4e0ad9ad6899351af8818920f4ae54d3c3f605 - Sigstore transparency entry: 2342221595
- Sigstore integration time:
-
Permalink:
danielle-rothermel/dr-store@dce30432ef2780b88527bd8910cc35c4be7bf27f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/danielle-rothermel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dce30432ef2780b88527bd8910cc35c4be7bf27f -
Trigger Event:
push
-
Statement type: