Scope the segmentation recovery out of the A2AJ lane by construction

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

Inert-by-measurement is not scoped. Two independent differentials say the
recoveries do not move legislation - 23,531 statutes / 2,924,267 nodes
byte-identical, and a 6,129-document sweep whose 114 skeleton changes are
ALL LegalBench-RAG (cuad 79, maud 35), zero in statutes, cases, amending
acts or DOCX - but a measurement is evidence about today's corpus, not a
guarantee about tomorrow's.

`sourceDocA2AJ` never calls `compileAgreementSkeleton`, so the bulk
legislation compiler was always out of reach. The live path that is not is
`passageRetrieval.ts` in clause mode, where `ensurePassageIndex` feeds A2AJ
`unofficial_text_en/fr` for doc_type laws straight in. That call now passes
`recoverExtraction: false`.

A2AJ ships the publisher's line breaks, so there is no extraction damage to
recover there and nothing to compete: legislation and case law keep the
structure the hardened statute and paragraph work gives them, because the
new code does not run at all. The option defaults to true for the Library
lane, which compiles PDF- and DOCX-derived agreements and is what the
recoveries exist for. Contract numbers are unchanged: mini 16 refused /
4,414 resolved / 9.1% missing.

Also recorded from the same sweep, the soundness invariant of the space-run
recovery: zero of 6,129 documents changed skeleton output without containing
an internal run of 2+ spaces, and 5,516 of them contain none.

Rejected on the way, with its cost, so it is not retried: gating instead on
"a statute spine wins" is blunt and charges contracts whose page-number runs
fake a spine (mini 16 -> 21 refused, holdout 9 -> 13); conditioning that on
the spine reading also addressing 50% of the document's own references gets
the cost down to 5 and 85 resolved but is a heuristic, not a scope, and
Eli asked for a scope.

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 cfc15494
Stats 2 files changed , +29 , -3
Part of A2AJ / CourtListener Canadian legal-source integration

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

⬇ Download capture-commit-05917012.md