Expand description
M6: content-addressed store. Spec §4.
Filesystem layout (§4.2):
<root>/
├── stages/
│ └── <SigId>/
│ ├── implementations/
│ │ ├── <StageId>.ast.json
│ │ └── <StageId>.metadata.json
│ ├── tests/
│ │ └── <test_id>.json
│ ├── specs/
│ │ └── <spec_id>.json
│ └── lifecycle.json
└── traces/
└── <run_id>/
└── trace.jsonThe filesystem is canonical. We don’t ship index.db (the spec calls
it a cache); the in-memory index is rebuilt on Store::open by
scanning the filesystem. Acceptance §4.6 requires that this rebuild
produces identical results regardless of cache state — the obvious way
to honor that is to keep the cache trivially derivable.
Modules§
- policy
<store>/policy.json— local trust policy (#181, originally called out in the v3 acceptance criteria for #172).- users
<store>/users.json— actor identity (lex-tea v3d, #172).
Structs§
- Branch
- Lifecycle
- Per-
SigIdlifecycle log: append-only list of state transitions for every implementation that’s ever been published under this signature. - Merge
Conflict - Merge
Entry - Merge
Record - Merge
Report - Merge
Summary - Metadata
- Per-implementation metadata (
<StageId>.metadata.json). - Operation
- The operation as a whole — its kind and the causal predecessors
it assumes. The
OpIdis computed from this plus a sorted view ofparents. - Operation
Record - An operation paired with its computed
OpIdand the resulting stage transition. This is what gets persisted under<root>/ops/<OpId>.jsononceapply.rs(next slice of #129) lands. - Publish
Op - One applied operation within a
PublishOutcome. - Publish
Outcome - The outcome returned by
Store::publish_program. - Spec
- A spec attached to a SigId (spec §4.4). Kept opaque here — the spec-checker (M10) interprets its body.
- Stage
History Entry - One entry in the per-
SigIdstage history surfaced byStore::sig_history. Newest-first ordering is the responsibility of the producer. - Store
- Test
- A test attached to a SigId (spec §4.4).
- Transition
Enums§
- Operation
Kind - The kinds of operations that produce stage transitions. Mirrors
the initial set in #129; new kinds (
MoveBetweenFiles,SplitFunction,ExtractType) can be added later as long as they’re appended at the end of this enum or use explicit#[serde(rename = "...")]tags so existingOpIds stay stable. - Stage
Status - Stage
Transition - Effect of applying an operation on a stage’s content-addressed
identity. Used as the
producesfield of anOperationRecordso consumers can answer “after this op, what’s the head stage for this SigId?” without rerunning the apply step. - Store
Error
Constants§
Type Aliases§
- OpId
- Identity of an operation.
(kind, payload, parents)SHA-256 in lowercase hex (64 chars). Two operations with identical payloads and parent sets produce identicalOpIds; the store dedupes on this.