Skip to content

Binding format

A binding (stored as a projection file at .memstead/projections/<mem>/<name>.json) is one versioned record per source→mem obligation: the declaration plus an operations { build, sync, verify } block. It collapses the retired projection + ingest pair into a single file.

This page is generated from the v1 binding JSON Schema and the engine’s medium-capability matrix. Do not edit it by hand — regenerate with cargo run -p xtask -- generate-docs.

FieldTypeRequiredAllowed valuesDescription
versionintegeryes2Binding format version. v2 bindings carry the integer 2; a file without it (or with a prior version) is refused by the loader, which names memstead projection migrate.
intentstringnoWhat the binding is trying to accomplish — prose for the agent. Optional.
reference_memsarraynoRead-only reference mems (by name) that supply cross-mem context.
destination_memstringyesThe mem this binding writes into.
deny_pathsarraynoPaths excluded from the binding’s scope (workspace-relative globs). Strategy-invariant — moved up from the per-ingest record. A glob deny list is legal only over a path-shaped medium namespace (codebase / filesystem / git); the engine refuses it at binding-validation time over a graph or web medium.
coverage_semanticsstringnoexhaustive, curatedWhether the binding claims to cover everything in its declared scope (exhaustive) or a deliberately partial slice (curated). Defaults to exhaustive when absent.
rulesobjectnoFree-form binding rules (e.g. a one-shot lens routing string). Opaque to the engine — consumed only by the one-shot brief renderer.
pruneobjectnoPrune policy — additive, optional. Absent means prune is disabled (no deletion proposals). Present means prune produces deletion proposals in the sync brief under the requested guarantee. Prune has no independent schedule: it rides the sync brief, so it carries no trigger/batch_size.
operationsobjectyesThe operations this binding declares. Every operation is optional; an absent mutating operation (build/sync) refuses at run time with a remedy, an absent verify means engine defaults.
sourcesarraynoThe inline sources the binding consumes, in declaration order. Each name is unique within the record.

Each operation under operations is optional. An absent build or sync makes that mutating operation refuse at run time with a projection enable <op> remedy; an absent verify means engine defaults (verify is read-only, never a refusal).

The build operation — the only operation carrying a mode. Grows new coverage (discovery) or runs a single bounded pass (one-shot). trigger / batch_size / post_actions are scheduling attributes.

FieldTypeRequiredAllowed valuesDescription
batch_sizeintegeryes≥ 1How many artifacts a single run processes.
modestringyesdiscovery, one-shotdiscovery builds out new coverage; one-shot runs a single bounded pass. The retired refinement value is not accepted.
post_actionsobjectnoFree-form post-run actions (e.g. a one-shot archive_source flag). Opaque to the engine — consumed only by the one-shot brief renderer.
triggerstringyesloop, manual, on-eventWhat sets an operation running. loop runs continuously under /loop; manual runs only when invoked; on-event is reserved for event-driven hooks.

The sync operation — the sole maintenance writer. Carries no mode. An absent sync block makes that mutating operation refuse at run time.

FieldTypeRequiredAllowed valuesDescription
batch_sizeintegeryes≥ 1How many artifacts a single run processes.
triggerstringyesloop, manual, on-eventWhat sets an operation running. loop runs continuously under /loop; manual runs only when invoked; on-event is reserved for event-driven hooks.

The verify operation — read-only measurement. Carries no mode. adjudication_cap and full_resync_every are additive tier-3 scheduling knobs that default to the engine’s dogfood-tuned values when absent.

FieldTypeRequiredAllowed valuesDescription
adjudication_capintegerno≥ 0The maximum number of hash-drift adjudications a single verify run asserts before queueing the remainder as backlog. 0 disables the cap.
batch_sizeintegeryes≥ 1How many artifacts a single run processes.
full_resync_everyintegerno≥ 0Every N verify runs, a full-enumeration coverage sweep runs (for enumerable mediums). 0 disables scheduled full walks.
triggerstringyesloop, manual, on-eventWhat sets an operation running. loop runs continuously under /loop; manual runs only when invoked; on-event is reserved for event-driven hooks.

Which fields and operations a binding may legally declare depends on the medium its source facets resolve to. The engine derives this from the capability matrix below and refuses an illegal combination at binding-validation time (never at run time).

MediumEnumerableChange signalBase retrievableAnchor namespaceGlob deny_pathsPrune guarantee
codebaseyesyesyespathyesnever-clobber
filesystemyesyesyespathyesnever-clobber
gityesyesyespath+commityesnever-clobber
graphyesyesyesentitynonever-clobber
webnononourlnoconflict-flag
  • Glob deny_paths are legal only over a path-shaped namespace — declaring them over a medium whose Glob deny_paths column is no is refused at binding validation.
  • The Prune guarantee column is the strongest guarantee the medium can support: never-clobber (full three-way merge) only where a base version is retrievable, otherwise conflict-flag. Requesting a stronger guarantee than the medium supports is refused at binding validation.