Legislation scoping: the flag is not inert, so decide it per feed and thread it where a caller knows

↗ view on GitHub · Eli Ziff · 2026-07-31 · ecf89fde

Re-measured the differential the CompileSkeletonOptions docstring rested on:
compile every A2AJ English statute with the segmentation recovery on and off
and compare node inventories. It is NOT byte-identical. 45 of 23,531 statutes
read differently (2,923,700 nodes on, 2,924,267 off, 837 nodes of absolute
difference; the Criminal Code alone moves 10,861 -> 10,979). The docstring's
node total is exactly the OFF reading, so what it recorded as a differential
between constructions looks like two runs of the same one. Corrected in place:
scoping legislation out is load-bearing, not ceremony.

That also explains the frozen digest baseline: scratchpad/digest-head.txt IS
the recoverExtraction:false digest -- reproduced from this tree byte for byte
-- while the skel-digest.ts beside it compiles with the default. Same 45.

The flag does not mean "is this legislation". It means "may this text have
lost its line breaks to an extractor", so the question per consumer is which
FEED reaches it. An Act uploaded as a PDF is extraction output like any other;
an A2AJ consolidation is not.

  legalAmendOps.applyAmendOps (:740, :957)  THREADED. It serves the statute
    dialects and the contract dialect, and only the caller knows the source's
    provenance. ApplyAmendOptions.recoverExtraction now forwards to both
    compiles -- the applied text is the source with splices, so one flag
    governs both -- and through consolidateAmendment. Proven caller:
    scripts/ollama-amend-loop.ts, whose cases are A2AJ consolidation text,
    passes false. Contracts do not move: the default is prior behaviour, and
    two new tests pin both readings.

  chat/slaWorkflow.ts:84  LEFT ON. Its input is extractLocalDocument, the
    PDF/DOCX lane. Scoping recovery out there would degrade an uploaded Act
    exactly as it degrades an uploaded merger agreement.

  legalTermDrift:197, legalConflictScan:163, legalTemporalScan:178  LEFT ON.
    All take a {name,text} stack, and every production caller fills it from
    the local Library. No authoritative feed reaches them, so a flag with no
    caller would be speculative configuration; each call site now names the
    lane instead.

  legalCrossReference:190  SEAM ALREADY EXISTS. CrossReferenceOptions.skeleton
    is the threading point -- pass a skeleton compiled with
    recoverExtraction:false and the competition cannot run. Documented there;
    no second flag.

Finding, not changed: passageRetrieval:429 scopes the A2AJ clause lane out by
construction, but a2ajPassageWiring.test.ts verifies that lane's spans with
clauseChunkText, which still compiles with recovery on. Oracle and lane are
built differently; the test passes only because the fixture has no space runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H9ToHYJVDxfeJcJwdzrP2H
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 256b21dc
Stats 9 files changed , +95 , -8
Part of SourceDoc / DOCX engine: redlines, tracked changes, editing benchmark

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-ecf89fde.md from inside the repo you want the change in.

⬇ Download capture-commit-ecf89fde.md