Skip to main content

Module ingest

Module ingest 

Source
Expand description

The deterministic ingest-orchestration surface.

Ingest today has two implementations that have drifted apart: a full orchestration (selection, backoff, change-detection, brief assembly, process-state lifecycle) living in the Claude-Code plugin’s Node.js, and a hard-coded natural-language charge in the macOS app that uses none of it. This module is the engine-side home the deterministic half is being ported into, so that the plugin skill and the macOS app both reduce to thin clients pulling the same rendered run-brief from the engine — honouring “every engine-reachable operation is reachable over UniFFI and CLI” and “the engine owns mem-repo state”.

The boundary is load-bearing: deterministic → engine (selection, backoff, change-detection, brief assembly, cursor/process-state); LLM-inherent → agent (reading sources, mutating the graph). The engine renders the brief and advances deterministic state — it never hosts the agent.

The deterministic half is ported and wired: the structural resolve layer (joins an ingest config to its projection, facets, and mediums), the change_detection primitives, the cursor driver that assembles a per-source changed slice across the git / graph / mtime strategies, and brief assembly — all reachable through memstead ingest brief (CLI) and the UniFFI surface, which the plugin skill and macOS app consume as thin clients.

Re-exports§

pub use advance::AdvanceError;
pub use advance::AdvanceOutcome;
pub use advance::AdvanceState;
pub use advance::DispositionInput;
pub use advance::EXCLUDED_VERDICT;
pub use advance::ExcludeError;
pub use advance::ExcludeOutcome;
pub use advance::advance_baseline;
pub use advance::advance_store_path;
pub use advance::delete_advance_store;
pub use advance::read_advance_store;
pub use advance::record_exclusions;
pub use advance::write_advance_store;
pub use brief::NoSignalNote;
pub use brief::PROCESS_MEM_SCHEMA;
pub use brief::ProcessMemInfo;
pub use brief::SourceCursor;
pub use brief::SyncCommand;
pub use brief::assemble_discovery_brief;
pub use brief::assemble_one_shot_brief;
pub use brief::render_changed_slice;
pub use brief::render_goal_and_avoid;
pub use brief::render_intent;
pub use brief::render_one_shot_lens;
pub use brief::render_operative_data;
pub use brief::render_situation;
pub use brief::render_sync_brief;
pub use brief::render_verify_brief;
pub use change_detection::Digest;
pub use change_detection::StatDiff;
pub use change_detection::StatEntry;
pub use change_detection::StatMap;
pub use change_detection::compute_stat_map;
pub use change_detection::diff_stat_maps;
pub use change_detection::digest_stat_map;
pub use change_detection::digests_equal;
pub use change_detection::parse_digest_token;
pub use change_detection::serialize_digest_token;
pub use cursor::compute_source_cursor;
pub use cursor::enumerate_facet_files;
pub use cursor::source_moved;
pub use cursor::write_active_deny_file;
pub use findings::FacetEnumerability;
pub use findings::Finding;
pub use findings::FindingClass;
pub use findings::FindingKey;
pub use findings::FindingTarget;
pub use findings::FindingsBatch;
pub use findings::FindingsError;
pub use findings::FindingsStore;
pub use findings::FullResyncDecision;
pub use findings::FullResyncRefusal;
pub use findings::VerifyOutcome;
pub use findings::adjudicate_anchor;
pub use findings::current_findings;
pub use findings::delete_findings_store;
pub use findings::findings_store_path;
pub use findings::read_findings_store;
pub use findings::schedule_full_resync;
pub use findings::verify_binding;
pub use findings::write_findings_store;
pub use guidance::GuidanceDefaults;
pub use guidance::MemGuidance;
pub use guidance::ResolvedGuidance;
pub use guidance::merge_guidance_block;
pub use guidance::resolve_writing_guidance;
pub use prune::PruneDisposition;
pub use prune::PruneMerge;
pub use prune::PruneMode;
pub use prune::PruneProposal;
pub use prune::classify_prune_candidate;
pub use prune::prune_proposals;
pub use refinement::Batch;
pub use refinement::ROTATION_ANCHOR_ADJUDICATION;
pub use refinement::ROTATION_UNCOVERED_FILES;
pub use refinement::bump_verify_runs;
pub use refinement::next_batch;
pub use refinement::next_rotation_batch;
pub use render::RenderBriefError;
pub use render::mode_name;
pub use render::render_ingest_brief;
pub use render::render_sync_brief_for;
pub use render::render_verify_brief_for;
pub use report::ALLOWED_REPORT_INCLUDE_KEYS;
pub use report::AnchorComposition;
pub use report::DEFAULT_REPORT_BUDGET;
pub use report::DenominatorBasis;
pub use report::FacetCapability;
pub use report::FacetFreshness;
pub use report::FidelityReport;
pub use report::GrainCoverage;
pub use report::RenderedFidelityReport;
pub use report::TreeFanout;
pub use report::compute_fidelity_report;
pub use report::render_fidelity_report;
pub use resolve::ChangeStrategy;
pub use resolve::ResolveError;
pub use resolve::ResolvedIngest;
pub use resolve::ResolvedPrimarySource;
pub use resolve::ResolvedSource;
pub use resolve::find_git_root;
pub use resolve::resolve_binding;
pub use resolve::resolve_binding_run;
pub use resolve::resolve_change_strategy;
pub use selection::BackoffEntry;
pub use selection::MAX_SKIP_LEVEL;
pub use selection::apply_backoff;
pub use selection::select_next_due;
pub use selection::should_skip;
pub use slice::Slice;
pub use slice::SliceOutcome;
pub use slice::graph_changes_to_slice;
pub use slice::graph_slice_outcome;
pub use slice::is_git_token;
pub use slice::mtime_slice_outcome;

Modules§

advance
projection advance — the disposition-gated, resumable baseline advance (bundle plan 03-projection-promotion, decision D7).
brief
Run-brief rendering — the engine-side assembly of the Markdown brief an ingest agent consumes as its prompt.
change_detection
Source-change targeting primitives for the ingest loop’s filesystem (mtime) strategy.
cursor
Source-cursor driver — assemble a SourceCursor from live workspace state, so the brief’s changed-slice preface can steer a pass at what moved.
findings
The engine-owned durable findings store and the thin projection verify write path that populates it (bundle plan 05-verify-sync-engine, group A).
guidance
Writing-guidance resolution — merge a schema’s default_writing_guidance with a mem’s per-mem writeGuidance into the goal/avoid prose the run brief renders.
prune
Prune — deletion proposal machinery (bundle plan 05-verify-sync-engine, group F).
refinement
Rotation / batch-order scheduling — the deterministic substrate the verify sampler (E3b) reuses. The refinement-as-writer brief (the scout/writer two-phase flow and its temp findings file) is deleted (D1/D9/AC10): refinement mode is gone from the vocabulary and no renderer remains. What survives, unrendered, is the rotation machinery — a batch_size-at-a-time walk over a source facet’s files in a reproducibly-shuffled order that resets each rotation.
render
Top-level run-brief rendering — the one engine entry point that both the CLI (memstead ingest brief) and UniFFI (macOS app) call, so the brief a client emits is byte-identical to the CLI’s by construction (a single code path), not by parallel re-implementation.
report
The tier-1 fidelity report (bundle plan 05-verify-sync-engine, group B) — deterministic, engine-rendered, token-budgeted.
resolve
Ingest runtime resolution — turn a stored [Ingest] config plus the rest of the four-primitive PipelineConfigs into a ResolvedIngest: the ingest joined to its projection, and the projection’s source facets joined to the mediums they engage, in the shape the selection, backoff, change-detection, and brief-assembly stages all read.
selection
Ingest selection + backoff — pick the next due ingest in a --all rotation, skipping ones whose destination is unchanged and whose sources have not moved. Engine-side port of the plugin’s nextIngest / shouldSkip / backoff state.
slice
Changed-slice computation — the deterministic core of the ingest source-cursor: given a source’s stored baseline and its current state, classify the pass as reseed / unchanged / changed, and for a changed pass compute the added / modified / deleted Slice.
status
memstead status projection view (bundle plan 03-projection-promotion, decision D11).