Expand description
Binding format v2 — one record per pipeline.
This is the live binding shape: crate::pipeline_store::load_pipeline_configs
reads it (version-gated), the projection CLI tree writes it, and the
resolve / brief / status / advance paths consume it. A v2 Binding
alone fully defines a pipeline: intent, inline sources (each carrying
what the retired standalone medium + facet records carried), reference
mems, destination, deny paths, coverage semantics, and operations. The
2026-07 consolidation (operator directive, 2026-07-18) removed the
three-file store: the engine reads only this format; memstead projection migrate converts prior generations, and there is no compatibility layer.
Three things live here:
Binding— the versioned record: one file per pipeline, collapsing the medium / facet / binding split into a single record with inlineSourceentries and anoperations { build, sync, verify }block.hash_binding—hash(D): the lowercase-hex SHA-256 of the canonical JSON of the binding’s content-defining projection. Scheduling knobs (trigger/batch_size/post_actions, the sync/verify blocks, prune) are excluded by construction; a source’s selection pattern or pointer changing — now inputs inside the one record — changes the hash.medium_capabilities+validate_binding— the medium-capability matrix (the medium half of a source description keeps the medium vocabulary) and the validation entry point: capability refusals, in-record source validation (empty / duplicate source names), and the preparation-registry check (a declaredpreparationmust be onecrate::preparationknows, over a medium it can apply to).
The findings store (memstead_projection::findings, the maintenance-loop crate above this one) keys on hash(D), so the
consolidation’s shape change invalidates prior findings by construction —
accepted and disclosed (findings are re-derivable measurements).
Structs§
- Binding
- A binding, format version 2 — one record per pipeline. The single
versioned file at
projections/<mem>/<name>.jsonthat alone fully defines the obligation:intent, inlineSourceentries (each carrying the medium and facet halves the retired standalone records held),reference_mems,destination_mem,deny_paths,coverage_semantics,rules,prune, and theoperations { build, sync, verify }block. - Build
Operation - The build operation — the only operation carrying a mode. Grows new
coverage (or runs a one-shot lens).
trigger/batch_size/post_actionsare scheduling attributes, excluded fromhash_binding. - Effective
Coverage - The effective coverage of a binding plus its provenance — whether the
value was declared by the author or resolved from the sources’ media.
The fidelity report renders the distinction; every other consumer
reads only
Self::value. - Medium
Capabilities - What a medium can support — the row of the capability matrix for a
MediumType(the medium half of a source description). Pure data;validate_bindingreads it to refuse operations a medium cannot support. - Operations
- The operations block of a
Binding: every operation is optional. An absentbuild/syncblock makes that mutating operation refuse at run time with aprojection enable <op>remedy; an absentverifyblock means engine defaults (verify has no mutating operation to gate — never a refusal).buildis optional in serde so an absent block yields the remedy-bearing refusal rather than a generic “missing field” parse error. - Prune
Config - The prune configuration of a
Binding— additive, optional. An absentpruneblock means prune is not enabled for the binding (no deletion proposals are produced); a present block enables it. Prune produces proposals only: the source no longer holds the artifacts an entity describes, both sides are shown in the sync brief, and the agent acting on the brief decides. Prune has no independent schedule: it rides the sync brief (the sole maintenance-writer channel), so it carries notrigger/batch_size, and it carries no guarantee level either: a source artifact and the agent-authored entity about it share no common ancestor a merge could compare, so there is nothing for the engine to decide on the entity’s behalf (see the prune module docs). Like thesync/verifyblocks it is excluded fromhash_binding: a maintenance policy never changes what the mem claims. The retiredguaranteekey of earlier records is ignored on read; every binding behaves asconflict-flagalways did. - Scaffold
Params - What a caller wants scaffolded: one binding over one source. Everything else — deny defaults, the capability-matrix filter, the prune block — is the engine’s to decide, so that every front door that scaffolds a binding scaffolds the same one.
- Scaffolded
Binding - A scaffolded binding, ready to write: the record, the operations it ended up declaring, and the warnings the caller must surface.
- Sync
Operation - The sync operation — the (future) sole maintenance writer. Optional: an
absent
syncblock makes that mutating operation refuse at run time. Carries no mode. - Verify
Operation - The verify operation — measurement. Optional: an absent
verifyblock means engine defaults, never a refusal (verify has no mutating operation to gate). Mutates no entity, but records findings, backfills observed anchor hashes and writes a#verifiedbaseline. Carries no mode.
Enums§
- Build
Mode - How a
BuildOperationengages its binding.refinementis deleted from the vocabulary — it is neither a variant here nor migrated, so deserializing"mode": "refinement"fails as an unknown value. - Capability
Error - A validation-time refusal: a capability the source’s medium half cannot support, or a malformed in-record source declaration. Every refusal names the offending source so it is diagnosable without re-reading the store.
- Coverage
Semantics - Coverage semantics — whether the binding claims to cover everything in
its declared scope (
exhaustive) or a deliberately partial slice (curated). - Operation
- A binding operation subject to capability validation.
- Operation
State Error - A binding refused for the operations it declares: an operation it lacks (and whether its medium could carry one), or one it already has.
Constants§
- BINDING_
VERSION - The current binding format version. A v2 binding carries
version: 2. - DEFAULT_
ADJUDICATION_ CAP - Default per-run tier-3 adjudication cap. Tuned against this project’s own
live
engine/graphbinding (524 source artifacts): a fully-drifted mem of that scale clears its adjudication backlog in ~11 verify runs while each run’s asserted-drift work stays bounded and its token cost predictable.0disables the cap (adjudicate every candidate). - DEFAULT_
FULL_ RESYNC_ EVERY - Default
full_resync_every: fire a guaranteed full-enumeration coverage sweep every N verify runs. Tuned against this project’s ownengine/graph(524 artifacts, sample batch 20 → a rotation completes in ~27 runs): a sweep every 20 runs guarantees a complete coverage picture without waiting on the rotation to happen to finish.0disables scheduled full walks (rotating sample only). - DEFAULT_
SCAFFOLD_ DENY_ PATHS - Default
deny_pathsscaffolded onto a fresh enumerable (codebase/filesystem) binding: ordinary platform/tooling debris that would otherwise flood a first denominator. A default, not an invariant — the scaffold materialises the list into the binding record, so an author who wants one of these in scope deletes the entry and gets the files back; bindings created before the default existed keep their recorded (empty) list. Engine state (.memstead/,.memstead.cache/, mount storage) is NOT on this list — its exclusion is unconditional in the strategy layer, never a deletable record entry. - PREPARATION_
IMPL_ VERSION - The engine’s current preparation-implementation version — the single source of truth for “which preparation implementation is live”.
Functions§
- effective_
coverage_ semantics - Resolve a binding’s effective coverage semantics. A declared value
wins (validation has already refused an illegal
exhaustive). An undeclared value resolves per binding, not per source: all sources on enumerable media →exhaustive; at least one non-enumerable source →curated— a mixed binding can only honestly claim the weaker of its parts, because coverage is an obligation of the binding as a whole (the artifact that is measured, reported, and keyed). - hash_
binding - Compute
hash(D)— the lowercase-hex SHA-256 of the canonical JSON of a binding’s content-defining projection. - hash_
binding_ at_ impl_ version hash_bindingunder an explicit preparation-implementation version. The live hash is alwaysPREPARATION_IMPL_VERSION’s; this exists so a caller can name the hash a prior engine generation keyed its findings on (the invalidation-by-construction pin, a migration report) without re-deriving the canonical projection.- medium_
capabilities - The capability-matrix row for a medium type. The single source of truth the fidelity report also renders.
- scaffold_
binding - Scaffold the default binding record for one source — the single
definition of “a fresh binding”, shared by every front door that creates
one (
memstead projection init, the guidedmemstead quickstartpath, any embedder). - validate_
binding - Validate a binding against the medium-capability matrix and the in-record
source rules, returning every refusal (empty
Errnever returned —Okmeans clean). The v2 record needs no external resolution: everything validated lives inside the one record.