Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript
28.2 KB
Raw Blame

Recall quality wave 2 - iterative recall loop, coverage-first session recall, graded channel-aware surfacing with a replay harness, and a LongMemEval bench lane

Status: draft Author: feature-release-playbook orchestrator Audience: implementation

Problem statement

Four verified cards in this wave share one defect family: recall quality is bounded by how many retrieval rounds run, by how session threads are selected, and by how surfacing decisions are made and measured. Hard multi-hop queries get at most one deterministic self-correcting second pass, so residual coverage gaps after that retry are never closed; session recall scores records by a one-line keyword count with no notion of thread coverage, topic budget or ranked chronological evidence, and silently drops what the budget cannot hold; the surfacing gate is a binary prompt-structural predicate with no graded admission key and no way to replay and score surfacing decisions against recorded sessions; and the bench has no LongMemEval suite, so Open Second Brain cannot produce like-for-like recall_all@5 receipts on the benchmark the memory field actually reports. All four residues are extensions of proven in-tree subsystems, verified anchor by anchor by the recon node.

Scope

  • t_6b943fc7 (lane A) - the corrected residue: generalize the single-fire second pass into a bounded N-round loop over the same pool-merging discipline, with deterministic k-group sub-query generation, a caller-executed decider envelope (needs-llm-step plan plus validating commit, mirroring the extract-signals pattern), a composed stop condition (round cap + composite deadline + coverage completeness + adapted marginal-value stop), a default-off config knob pair, per-round outcome observability, and a brain_search plan/commit round-trip that leaves the default response and cache keys byte-identical.
  • t_2c2a883c (lane B) - the corrected residue: coverage-first retrieve-wide-then-compress over the existing lineage-scoped session-recall record set, an adaptive topic budget (corpus-shaped clamp with floor 12 and cap 16), relevance-ranked evidence selection re-emitted chronologically with recomputable diagnostics, a typed infeasibility error on floor violation, and entity-thread wiring that resolves a mined entity key to its mention rows to seed coverage - shipped as a new operation on brain_session_grep plus CLI parity, never a new tool.
  • t_107a3249 (lane C) - the corrected residue: one shared graded surfacing key ({key, tier, admit, reason}: admission from channel-calibrated absolute match quality, order from the existing fused composite) consumed by both brain_recall_gate and decideRecallInject with the pure prompt-structural gate kept as the structural pre-tier and its binary decision projected for compatibility; extended gate telemetry (key, tier, channel) under the existing opt-in; and a recorded-session replay bench suite scoring know_to_ask / false_fire, closing the failure-modes "not scoreable" caveat.
  • t_607d429d (lane D) - the corrected residue: a LongMemEval suite adapter beside locomo (parser with named errors, converter to BenchFixture, abstention exclusion with recorded count, direct gold-session-id join), a committed tiny sample fixture with the full dataset operator-supplied, a per-suite capability declaration ({embeddings: boolean}) delivered by a suite registry in the bench verb, run-identity knob pinning folded into the checkpoint hash, a shared embedding cache so arms compare byte-identical vectors, a strict recall_all@5 named report family, and judge glue reusing bench_judge_cmd with an extended stdin payload.
  • Integration lane - census reconciliation, docs (mcp, cli-reference), CHANGELOG entry and the minor version bump with manifest sync inside this pull request, and the full local gate run.

Out of scope

  • New MCP tools: the tool census stays pinned at 115 (tests/core/install/tool-ceiling.test.ts:348). Every new surface rides an existing tool's operations, an existing CLI verb, or the bench suite registry.
  • Rerank auto-promotion: applying the rerank eval verdict to runtime config automatically was struck by the validator as a separate, larger ask; the operator-facing measured gate ships as-is.
  • Honest abstention and influence-gated rerank: both already ship (recall-adequacy actions; rerank-eval-gate verdict) and are not rebuilt.
  • A first thread-recall verb or a source_turn stamp: session recall with lineage stitching ships, and source_turn_ids already persist; lane B layers on the existing lane and writes no new record kinds and no new persisted fields.
  • Daemon-side hydrated-v1 projection: Open Second Brain has no daemon.
  • Full LongMemEval dataset vendoring or download-at-run: a tiny committed sample plus an operator-supplied full-dataset path only; the loader stays pure and network-free.
  • New config knobs for channel admission thresholds: per-channel thresholds ship as exported module constants this wave; operator tuning can layer later.
  • A CLI mirror of the iterative plan/commit round-trip: the decider protocol serves MCP agent callers (the card's stated audience); a CLI mirror is deferred.
  • Real-provider embedding calls in committed tests: CI certifies the LongMemEval lane on the deterministic local provider through the apply-gated path; real-provider scores remain a documented operator lane.

Chosen approach

Variant 1: bench-first contract substrate with four parallel disjoint lanes (consultant recommendation, orchestrator agrees; full text of all variants and the decision record in variants.md).

Lane D owns the bench framework files and lands two behavior-preserving contract commits first: the suite registry with per-suite capability declaration in the bench verb, and run-identity knob pinning folded into the checkpoint hash. Lanes A (iterative recall loop), B (coverage-first session recall) and C (graded surfacing key, shared admission, telemetry v2) then run in parallel over fully disjoint file sets; Lane C's replay-harness tasks are the wave's one declared dependency, waiting on Lane D's two contract commits and appending only the replay suite registration on top of the bench framework. Lane D finishes the LongMemEval suite; lane C finishes the replay harness. One integrator pass closes census reconciliation, docs, the CHANGELOG entry, the version bump via scripts/sync-version.ts, and the full local gate run in CI order.

Design decisions

  1. Delivery model: Variant 1, with bench file ownership pinned. The bench framework files (src/core/bench/phases.ts, src/core/bench/types.ts, src/cli/brain/verbs/bench.ts) are exclusively Lane D's, with Lane C granted append-only rights for its own suite-registration entries exercisable only after Lane D's two contract commits land; every commit stays single-owner at the file level. The two recall behavior lanes (A, B) depend on nothing and start immediately. The one shared source file (src/mcp/search-tools.ts) is split by append-only ownership: Lane C owns the file and the brain_recall_gate tool definition; Lane A holds append-only rights limited to the brain_search tool definition and handler.
  2. t_6b943fc7 - where the loop pauses: a resumable core outcome, surfaced as a brain_search one-tool-two-phases round-trip. The kernel never awaits a model: with the knob on and coverage gaps remaining after the deterministic rounds, search() returns a plan-phase outcome carrying the needs-llm-step envelope and an opaque single-use round token; the caller re-invokes with the token plus its decider payload, and the commit phase validates before the loop advances. Over MCP the round-trip rides brain_search itself - optional request fields (iterative flag, round token, decider payload), and a response phase discriminator (final | needs-llm-step) present only in the opt-in mode - mirroring the brain_extract_signals plan-when-payload-absent shape exactly. This resolves the recon's tension between "resumable outcome" and "brain_search response must not grow an envelope": the default response shape is untouched (byte-identical, fixture-pinned), the envelope exists only under the opt-in flag, and no new tool is needed. A second commit with an already-used token is refused with a typed error, never silently re-run.
  3. t_6b943fc7 - cache correctness: the new request fields join the brain_search cache key as a mode-on suffix. The query-cache key composition is a documented compatibility surface (cache-slot.ts header); appending the iterative fields unconditionally would orphan every existing cached row. The fields are folded into the key suffix only when the iterative mode is on, so off-mode keys stay byte-identical and only mode-on rows (new by definition) use the extended layout. Plan-phase and commit-phase responses are deterministic functions of their inputs (vault, query, token, payload hash), so caching stays sound.
  4. t_6b943fc7 - stop condition: composed. Round cap plus the existing composite deadline bound the loop; coverage completeness decides whether gaps remain; the advisor's marginal-value stop, extracted into a reusable predicate over an arbitrary density/latency curve, decides whether closing them is worth the latency. Adaptation rather than verbatim reuse: the advisor's curve is context-pack density, so the predicate is re-fed candidate-density and elapsed-time samples from the loop. The advisor's own buildRetrievalPlan output is pinned byte-identical by its existing tests.
  5. t_6b943fc7 - sub-query authorship: both lanes, deterministic floor first. The generalized coverage planner (k term groups generalizing planTargetedRetry) is the always-available floor and is today's round-2 behavior generalized - the mode is useful with no model in the loop. Validated decider sub-queries are the additive rounds the card asks for: the envelope is emitted only when gaps remain after a deterministic round and the round cap allows one more; a declined or absent commit finalizes the loop honestly rather than blocking.
  6. t_6b943fc7 - knob placement: a new knob pair, not extended twoPassEnabled semantics. iterativeRecallEnabled plus iterativeRecallMaxRounds (env-mirrored like its siblings) resolved alongside twoPassEnabled, default off. twoPassEnabled's documented "at most one retry" contract stays untouched, and the byte-identical-off invariant is trivially auditable with the two-pass kill-switch test as the exact precedent.
  7. t_6b943fc7 - decider module placement and validators: search-domain module over the brain envelope spine. New src/core/search/decider-step.ts imports buildNeedsLlmStep from src/core/brain/llm-step.ts (search modules already import brain modules; no import-direction ratchet exists). The commit phase mirrors commitExtractedSignals: a shape assert plus registered semantic checks - selected evidence ids must exist in the round's pool, sub-query count and length limits, single-use token enforcement - all typed named refusals.
  8. t_6b943fc7 - observability: a sibling optional field, not new reason strings. SearchOutcome gains an optional iterative rounds record (per-round counts and stop reasons) projected in the outcome pipeline; existing second_pass: attribution strings are unchanged, and the field is absent when the mode is off so serialization stays byte-identical.
  9. t_2c2a883c - adaptive topic budget semantics: corpus-shaped clamp. Facets are derived from the thread itself (distinct mined entity keys, summary-node clusters, role alternation) and the budget is clamp(distinct facets, floor 12, cap 16) with the floor, cap and facet-count logic exported like DEFAULT_GROUP_SIZE so operator config can layer later. Chosen over recall-pressure widening (two-pass, hard to keep deterministic and recomputable) and over per-vault config (operator-tuned, not adaptive). Diagnostics report the realized topic count honestly: a 3-facet thread floors at 12 and says 3 were realized.
  10. t_2c2a883c - typed infeasibility: floor violation only. When the character budget cannot hold the floor-weighted selection, a typed error names requested and kept topics plus required chars so the caller can retry with a larger budget; above the floor, drops are returned in diagnostics, never silent. Any-drop-raises was rejected (unusable on long threads, collides with applyCharBudget's contract used elsewhere); a truncation-flag-only result was rejected as exactly the silent degradation the v1.52.0 direction forbids. Over MCP the error maps to INVALID_PARAMS.
  11. t_2c2a883c - MCP surface: a new operation on brain_session_grep, never a new tool. The coverage view (topic budget, coverage selection, diagnostics) plus an optional topic report on brain_session_describe are schema additions to the existing tool definitions; the 115-tool equality pin must not move. CLI-first-only was rejected because it leaves the card's stated beneficiary - the MCP recall and context-pack path - unable to call the lane.
  12. t_2c2a883c - budget primitive: wrap, never fork or edit. src/core/brain/recall-budget.ts is frozen for this wave. Rank-then-reorder happens in the session-recall layer feeding applyCharBudget ranked-then-reordered; the typed infeasibility wraps the dropped outcome at the call site when the floor is violated. collectRawRecords and compareRecords provide the chronological re-emission.
  13. t_2c2a883c - entity dimension: read-side wiring only. An entity key resolves to its existing session_entity_mention rows (provenance-grade, already written by imports; no new mining, no new record kind), and a coverage call seeded by that key returns the establishing turns chronologically. Unknown keys raise the same typed error family - never an empty silent result. The continuity schema does not move.
  14. t_107a3249 - the ranked key: two-part, one graded shape. Admission uses channel-calibrated absolute match quality (idfWeightedCoverage - already produced by the pipeline, already threshold-proven by the hook floor, absolute across queries); order uses the existing fused composite, which is min-max normalized per pool and must never be a threshold basis (the exact defect recall-adequacy documents). Both surface as one {key, tier, admit, reason} decision. A prompt-prior scalar was rejected: it would break the gate's language-agnostic, keyword-free invariant that tests pin.
  15. t_107a3249 - computation site: one shared pure calculator, two consumers, gate stays pure. New src/core/search/surfacing-key.ts computes key and tier from a retrieval result plus channel; decideRecallInject's floor branches and brain_recall_gate both consume it, so hook and gate grade identically. evaluateSurfacingGate remains a pure prompt-structural pre-tier with its structural suppressions (empty, duplicate, slash_command, shell_command) as named short-circuits, and keeps projecting the binary {retrieve, reason} so the pinned gate contract tests stay green unchanged.
  16. t_107a3249 - channel means transport, thresholds are constants. RECALL_CHANNEL (mcp/cli/hook) is the admission-calibration axis because every telemetry record already carries it and the replay harness can therefore reproduce it; finer surface distinctions belong in metadata. Per-channel thresholds ship as exported module constants - the hook keeps RECALL_INJECT_CONFIDENCE_FLOOR 0.35, and the mcp/cli diagnostic channels default to the same floor this wave - with no new config knobs.
  17. t_107a3249 - replay corpus: fixture-first with a session-record adapter. Committed session-shaped fixtures (deterministic, network-free, the locomo pattern) drive the suite; a loader converts a vault's own session_turn records into the same fixture shape, giving regression proof against real sessions without committing raw prompts. Recorded gate_telemetry decisions are never re-executed - the module stores only prompt hashes by design, so replay always re-decides from source prompts.
  18. t_107a3249 - replay integration: a named suite through Lane D's registry, not a new category. The replay phase rides the suite registry and the existing checkpoint/resume machinery; scoring reuses scoreProactiveRecall (know_to_ask / false_fire) and reports injected_tokens per turn; the phases invariant that an abstain injects nothing and costs zero is asserted. This avoids co-owning the bench category union and keeps src/core/bench/types.ts single-owner except for the pinned registration types.
  19. t_107a3249 - telemetry v2: additive payload under the existing opt-in. gate_telemetry records gain optional key, tier and channel fields through the same lazily-evaluated gated thunk and recall_gate_telemetry opt-in; summary counts by tier; no new record kind, so the continuity reader and envelope censuses stay green. The opt-in-off path records nothing, unchanged.
  20. t_607d429d - dataset supply: committed sample plus operator path. A tiny committed longmemeval-sample.json follows the locomo fixture precedent; the full dataset arrives as an operator-supplied file path resolved by the existing literal-then-fixture-dir logic. Full vendoring (hundreds of megabytes) and download-at-run (network inside the verb) were rejected; the official download is documented once in the suite docblock.
  21. t_607d429d - judge: bench_judge_cmd reused, payload extended additively. The single external-judge contract stays; its stdin payload gains question, answer and gold when the suite provides them (absent for locomo, whose payload is unchanged), keeping the kernel model-free and the judge fail-open. Official LongMemEval prompt text lives in the module as constants pinned to a named upstream revision so the external command stays a dumb model call.
  22. t_607d429d - metric: a new named report family, never an overload. longmemeval: { recall_all_at_5, abstention_excluded } joins the report and CLI output while the quality, latency and context_cost families stay untouched (the MemScore rule: families stay separate and named). Overloading pass_rate would hide what was excluded; a second report file would break the one-report resume model. Per-question scoring already equals all-gold-in-top-5 in the retrieval branch, so the aggregate is a named roll-off, not new scoring.
  23. t_607d429d - capability declaration shape: an in-file suite registry on the verb. The two-line guard/dispatch in the bench verb becomes a registry mapping suite name to { loader, capabilities: { embeddings } }; capabilities ride BenchRunOptions set by the CLI from the registry, the guard remains the single gate, the fixture schema is unchanged for the default path, and omitting --suite stays byte-identical (locomo). "What a suite may do" is explicit in code rather than flag-implied, which is the validator's stated constraint.
  24. t_607d429d - knob pinning: SearchConfigOverrides-shaped, folded into run identity. A pinned-knobs record on BenchRunOptions is applied last via resolveSearchConfig (overrides win) and folded into the checkpoint hash input, so a resumed run that mixes configurations fails the hash guard loudly. The default pin equals today's hardcoded semantic-off override, so locomo report numbers stay identical; the one-time consequence is that in-flight runs started before the change no longer resume - the guard fails fast with a named error, documented in the suite docblock.
  25. t_607d429d - embedding caching: one signature-keyed cache file under the runs dir. Keyed by provider, model and text hash, written by the suite's index phase only when the embeddings capability is declared, so both arms compare byte-identical vectors without store-schema changes. Spend always surfaces the plan through the apply-gated path (indexer.ts embeddings option, spend gate); it is never silently bypassed.
  26. t_607d429d - abstention and the expected_text trap: handled at conversion. Abstention questions are dropped at conversion time with the exclusion count recorded in the suite receipt and report family (the fixture parser rejects unknown categories, so pass-through is not an option). Gold session ids join by direct set membership with unknown ids rejected, sanitized only at note-path materialization. The converter never sets or relies on expected_text for retrieval scoring, because evaluateQuestion ignores it for retrieval categories.
  27. Wave-wide house rules. Every opt-in surface ships default off with a byte-identical-off regression proof; typed explicit errors everywhere, no silent fallbacks; the tool census (115), continuity reader/envelope censuses, tool-probe catalogue and parity ratchets move only in the same commits as their schema growth; no new external dependencies; no new persisted continuity record kinds.

File changes

Lane A - iterative recall loop (t_6b943fc7):

  • new src/core/search/pipeline/iterative-recall.ts (round driver, stop composition, resume token, envelope build hook)
  • new src/core/search/decider-step.ts (needs-llm-step envelope content, commit validators, registered semantic checks)
  • modify src/core/search/coverage.ts (k-group gap signal generalizing planTargetedRetry)
  • modify src/core/search/pipeline/second-pass.ts (extract the shared gap-proposal half)
  • modify src/core/search/search.ts (mode gate and loop hook at the 435-456 seam)
  • modify src/core/search/index.ts (knob resolution, env mirror)
  • modify src/core/search/types.ts (resolved knobs, optional iterative outcome field, request fields)
  • modify src/core/search/pipeline/outcome.ts and src/core/search/pipeline/attribution.ts (per-round projection)
  • modify src/core/brain/retrieval-plan.ts (extract the marginal-value stop as a reusable predicate)
  • modify src/core/search/pipeline/cache-slot.ts (append the iterative request fields to the cache-key suffix, mode-on only)
  • modify src/mcp/search-tools.ts (append-only: brain_search tool definition and handler only)
  • new tests tests/core/search/iterative-recall.test.ts, tests/core/search/decider-step.test.ts
  • extend tests/core/search/two-pass.test.ts, tests/core/search/coverage-targeted-recall.test.ts, tests/core/search/coverage-unmeasurable.test.ts, tests/core/brain/retrieval-plan.test.ts, tests/mcp/search.test.ts, tests/mcp/brain-search-reasons.test.ts

Lane B - coverage-first session recall (t_2c2a883c):

  • modify src/core/brain/session-recall.ts (coverage selection, rank-then-reorder, diagnostics, typed error)
  • new src/core/brain/thread-topics.ts (pure facet detection and budget clamp)
  • modify src/mcp/brain/recall-tools.ts (coverage operation on brain_session_grep, optional topic report on brain_session_describe, INVALID_PARAMS mapping)
  • modify src/cli/brain/verbs/session-recall.ts (flag parity)
  • modify src/core/brain/entities/registry.ts (read-side entity-key to mention-rows resolution)
  • append-only src/cli/command-manifest.ts, src/cli/brain/help-text.ts
  • frozen src/core/brain/recall-budget.ts (wrapped at the call site, never edited)
  • new tests tests/core/brain/session-recall.coverage.test.ts, tests/core/brain/thread-topics.test.ts
  • extend tests/core/brain/session-recall.test.ts, tests/core/brain/session-recall.lineage.test.ts, tests/core/brain/session-recall-private.test.ts, tests/core/brain/link-graph/session-mining.test.ts, tests/mcp/session-recall-tool.test.ts, tests/mcp/brain-tools-parity.test.ts, tests/helpers/tool-probe-catalogue.ts, tests/cli/brain-session-recall.test.ts

Lane C - graded surfacing key and replay harness (t_107a3249):

  • new src/core/search/surfacing-key.ts (shared pure key/tier calculator)
  • modify src/core/search/surfacing-gate.ts (graded decision type, channel-aware input, binary projection retained)
  • modify src/core/brain/recall-inject.ts (floor branches routed through the calculator)
  • modify src/core/brain/gate-telemetry.ts (optional key/tier/channel payload, tier summary)
  • modify src/mcp/search-tools.ts (owner of the file; toolBrainRecallGate response and telemetry thunk)
  • new src/core/bench/replay-fixture.ts, src/core/bench/replay.ts
  • modify src/core/bench/failure-modes.ts (close the not-scoreable caveat)
  • append-only after Lane D's contract commits: src/core/bench/phases.ts (replay dispatch arm), src/core/bench/types.ts (suite registration types), src/cli/brain/verbs/bench.ts (registry entry)
  • new tests tests/core/bench/replay-fixture.test.ts, tests/core/bench/replay.test.ts
  • extend tests/core/search/surfacing-gate.test.ts, tests/core/brain/recall-inject.test.ts, tests/hooks/recall-inject.test.ts, tests/mcp/recall-gate-telemetry.test.ts, tests/mcp/recall-gate-contract.test.ts, tests/mcp/recall-gate-turn-id.test.ts, tests/core/bench/failure-modes-baseline.test.ts

Lane D - LongMemEval bench suite (t_607d429d):

  • new src/core/bench/longmemeval.ts (parser, converter, abstention filter, metric constants, suite receipt)
  • new tests/fixtures/bench/longmemeval-sample.json
  • modify src/cli/brain/verbs/bench.ts (suite registry with capabilities, usage line, report printing)
  • modify src/core/bench/types.ts (capabilities type, pinned-knobs type, report suite field)
  • modify src/core/bench/phases.ts (BenchRunOptions growth, pin-driven benchSearchConfig, optional embeddings index phase, report family)
  • modify src/core/bench/run-store.ts (pinned knobs folded into the checkpoint hash)
  • modify src/core/bench/judge.ts (extended stdin payload)
  • frozen src/core/bench/locomo.ts, tests/core/bench/locomo.test.ts, tests/core/bench/fixture.test.ts (fixture schema unchanged)
  • new tests tests/core/bench/longmemeval.test.ts
  • extend tests/core/bench/phases.test.ts, tests/core/bench/run-store.test.ts, tests/cli/brain-bench.test.ts

Integration lane:

  • modify docs/mcp.md, docs/cli-reference.md, CHANGELOG.md, package.json plus the manifests synced by scripts/sync-version.ts (minor bump)
  • census registration reconciliation across the ratchet tests listed above

Risks and open questions

  • brain_search schema growth. The tool is the primary agent-facing surface; the envelope exists only under the opt-in flag and the default response is fixture-pinned byte-identical. The append-only ownership split with Lane C (one file, two tool definitions) is mechanical but must be respected in every commit.
  • Query-cache compatibility. The cache-key composition is a documented compatibility surface; the mode-on suffix keeps off-mode keys stable, but a mode-on key layout change orphans stale rows once. Rows live in the rebuildable search index, so the cost is a cold cache, never a wrong result.
  • Resume identity break. Folding pinned knobs into the checkpoint hash means in-flight bench runs started before this change fail the resume guard. The failure is loud and named; the run is restarted, not silently mixed.
  • Census and ratchet drift. The tool-ceiling equality test (115), the continuity reader and envelope censuses, the tool-probe catalogue and the parity tests arbitrate every surface growth; each moves only in the commit that grows its schema, and the integrator reconciles any drift.
  • Local CI versus operator reality. LongMemEval numbers produced in CI come from the deterministic local provider through the apply-gated path; real-provider scores are an operator lane. The report carries the provider and model signature so numbers are never compared across signatures, and the embedding cache key includes that signature.
  • Threshold calibration. The replay suite doubles as the measurement instrument for the channel admission constants; the constants land with their measured justification recorded in the module docblock and can be re-measured by re-running the suite. If the measured mcp/cli calibration disagrees with the 0.35 floor default before release, the recorded measurement wins and the docblock states it.
  • Envelope payload size on very large pools. The plan-phase envelope lists candidate evidence ids and gaps; on very large pools it could grow. The round cap and the existing composite deadline bound the loop, and the envelope carries only ids and sub-queries, never hydrated content; if real fixtures still show oversized envelopes, the sub-query count limit tightens rather than the response shape growing a pagination axis.
  • Vector-cache arm isolation. The shared embedding cache must key strictly on provider, model and text hash so the two arms never share a partially written file; the cache is written once per completed index phase (atomic write) before either arm reads it. If review finds an isolation hole, the named fallback is a per-run index plus an embedding-signature receipt compared across arms, decided with the measurement in hand.