fix(lab): mike_markdown_e2e_index_v1 audit fixes F1-F7

↗ view on GitHub · Eli Ziff · 2026-08-04 · f1150a9d

Adversarial-audit fixes for the derived-section-index LAB arm.

F1 deepseek: restore per-round resolveTools (was snapshot-once, which broke
   the reveal-on-next-round contract every other adapter honors). Prefix-cache
   identity is on serialized bytes, so per-round resolution is cache-neutral.
F2 structureIndexExperiment: enum tokens and the heading-fragment fallback are
   now LINE-ANCHORED, so an unescaped (x) in body prose can never win over the
   real heading. Covenants docx: 5/174 bad subsection anchors -> 0; 8.01(e)(i)
   now anchored.
F3 localAssistantTools: read_document evidence segments are now body-relative
   (subtract bodyOffset), matching find_in_document's body plane so the harness
   unions one coordinate space instead of inflating exposure ~2x.
F4 prompts/schema/refusals: drop the unsatisfiable "read head: 20" guidance;
   orient by reading the WHOLE index (head: 200-400); index-arm read_document/
   fetch_documents schemas no longer claim unscoped reads return full text;
   the scoped-read refusal is conditional on an index actually being present.
F5 localAssistantTools: memoize servedDraftingText per (documentId, versionId)
   within a turn to avoid re-running docx extraction + skeleton + index render
   on every read/find call.
F6 structureIndexExperiment: require a heading-ish continuation after a
   top-level display, so "Section 2.01(a) provides..." never anchors the parent.
F7 structureIndexExperiment: per-display cursor so duplicate displays in
   amended/restated docs anchor at distinct occurrences.

No detector touched. Flag-gated on MIKE_STRUCTURE_INDEX=1; body byte-identical
with the flag off. tsc clean; deepseek 4/4, structureIndexExperiment 10/10,
localToolWiring pass; covenants anchor probe PASS.

Co-Authored-By: Claude <noreply@anthropic.com>
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 98f4f182
Stats 4 files changed , +214 , -78
Part of Evaluation harness: Beaver-CAN and LegalBench-RAG adapters

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-f1150a9d.md from inside the repo you want the change in.

⬇ Download capture-commit-f1150a9d.md