Expand description
Edit operations over the v2 single-record pipeline store.
Sits above the dumb file ops in crate::pipeline_store: each function
loads the current store, enforces identity rules (no clobber, no silent
overwrite), validates the candidate record in-place, then writes. The
engine’s in-memory pipeline_configs cache is refreshed by the Engine
wrapper methods that call these — not here — so these functions stay pure
disk ops that unit-test with a bare TempDir.
One record kind, four verbs: a binding is created / patched / deleted /
renamed under its (mem, name) file identity. The cross-record
referential-integrity machinery of the three-file era (dangling facet /
medium refs, delete-blocked-by-referrer, rename repointing) is gone with
the references — in-record source validation
(crate::binding::validate_binding) covers what remains: source name
rules plus the medium-capability matrix.
The JSON entry points (add_binding_json / update_binding_json)
accept a BindingPatch over the full author-editable record —
sources, operations block, deny_paths, coverage_semantics, rules
(clearable via explicit null), prune — with version engine-managed.
A field absent from the payload is preserved from the stored record (the
tail-preservation contract): edits merge over the stored record, never
rebuild it from form fields.
Structs§
- Binding
Patch - A partial edit of a binding record, decoded from the JSON edit entry
points (
update_binding_json/add_binding_json).
Enums§
- Pipeline
Edit Error - Failure modes of a pipeline edit. Distinct from the entity-centric
crate::engine::EngineError— these describe binding-store edits.keyis the display identity:"<mem>/<name>".
Functions§
- add_
binding_ json - Create a binding from a JSON
BindingPatchapplied to the default scaffold. Refuses when(mem, name)already holds a record (PipelineEditError::AlreadyExists), when the patch leavesdestination_memempty (PipelineEditError::InvalidJson), or when the candidate fails in-record validation (PipelineEditError::Capability— every refusal blocks; a fresh record has no pre-existing state to grandfather). Returns the written record. - delete_
binding - Delete a binding. Refuses if
(mem, name)does not exist. Nothing references a binding record, so there is no referential gate — the binding’s own state files (advance / findings / watermarks) simply stop being consulted. - rename_
binding - Rename a binding within its mem (
old→new, same<mem>tier). A binding has no embedded name, so a file move is its whole rename. Refuses a missing source or an existing target. No-op whenold == new. - update_
binding_ json - Patch an existing binding from a JSON
BindingPatch— the update path over the full author-editable record (sources, operations,deny_paths,coverage_semantics,rulesincluding clearing,prune). Absent fields are preserved (the tail-preservation contract); explicitnullclearsintent/rules/prune; a presentsourcesoroperationsblock replaces that whole block;versionstays engine-managed.