Skip to main content

Module binding_run

Module binding_run 

Source
Expand description

Binding-run resolution — turning a declared binding into the resolved form a run works from (sources with their bases and change strategies, the process mem a binding writes into), with the typed refusals a malformed declaration earns.

Kernel, not loop: the health surface resolves the process mem for its projection axis and the read surface resolves a binding run before it reports findings, so the resolution lives beside the binding store it reads. Moved here from ingest::resolve on 2026-09-10; the loop and every consumer path reach it through ingest::resolve.

Re-exports§

pub use crate::pipeline::Source;

Structs§

ProcessMemResolution
How a destination mem’s process mem was resolved: by explicit declaration (MemConfig.process_mem on the destination — wins where present) or by the binding-name convention (the fallback, byte-identical to the pre-declaration behaviour). One resolution function for every consumer — the brief renderer and the open-questions health axis read this and nothing else, so pairing can never drift between surfaces.
ResolvedIngest
A v2 binding unpacked into the runtime shape the orchestration stages (cursor, brief, selection) consume.

Enums§

ChangeStrategy
A primary source’s resolved change-detection strategy — how “what changed since the last synced pass” is computed for it.
ResolveError
Why a binding could not be resolved. With inline sources the only structural failures left are identity-level: an unknown binding id, or a malformed one.
ResolvedSource
A binding source resolved to what the run needs: a primary inline source (the territory to read and write back), or a read-only reference mem supplying cross-mem context.

Constants§

PROCESS_MEM_SCHEMA_NAME
The schema family every process mem pins: a declared process mem must carry an ingest@* pin, whatever its version.

Functions§

derived_process_mem_name
The convention-derived process mem name for a binding, the fallback where the destination declares none. For a single-component destination it is the binding id itself (engine/graph), unchanged since the convention was set. For a nested destination (library/sample) the id’s last separator becomes a hyphen (library/sample-notes): a sibling of the destination in the same namespace directory, because git keeps refs as files in directories and cannot hold library/sample/notes beside the branch library/sample. The one derivation every consumer uses (the brief renderer, the open-questions health axis), so the two cannot pair differently. A malformed id passes through unchanged.
find_git_root
Walk up from start looking for a .git entry (a directory or a file — a submodule/worktree gitlink is a file), returning the directory that contains it (the git work-tree root), or None. Bounded to 64 ancestors. Pure filesystem, no subprocess — deterministic for tests.
resolve_binding_run
Unpack a v2 binding (by canonical id) into the runtime ResolvedIngest shape the orchestration stages (cursor, brief, selection) consume.
resolve_change_strategy
Resolve a primary source’s ChangeStrategy. A graph-typed source always uses Graph (its signal is the source mem’s snapshot token, which the engine provides). Otherwise the source’s declared strategy wins (none/git/mtime); auto — the default when unset, and any unrecognized value — probes for a git work tree over the source pointer (resolved against workspace_root): present → Git, absent → Mtime.
resolve_process_mem
Resolve the process mem for destination_mem. derived_name is the convention-derived candidate (derived_process_mem_name of the binding id); pass it even when a declaration might exist — the declaration wins, the derivation remains the fallback.
source_base_path
The on-disk base directory a path-based primary source resolves to: the source pointer joined onto the workspace root (Path::join yields the pointer verbatim when it is absolute), or the workspace root itself for an empty pointer. Only meaningful for path-namespaced mediums (codebase / filesystem / git) — a graph pointer is a mem id and a web pointer a URL.