Score the paragraph spine as a global monotone chain

↗ view on GitHub · Eli Ziff · 2026-08-06 · 2c1eb539

The spine was picked by walking line-start markers and accepting the first
monotone run, so a marker joined onto the end of a heading line
("II. Analysis [12] The appellant argues...") was invisible: the run
stopped one short, or started partway down at whatever number appeared
first.

Replaces the walk with the mechanism the footnote pairer already uses:
enumerate every candidate for every number, price each by the evidence
behind it (line start, heading-joined, adjacent to a confirmed link), and
take the highest-scoring increase-by-one chain over the document as a
whole. Evidence is priced, not gated. The chain must root at 1 and have no
gaps, and endnote ladders are detected and declined - a numbered reference
list in the last quarter of a judgment reads as a perfect 1..N ladder and
is not paragraphs.

The heading grammar stops rejecting enumerated levels on length alone: an
author who numbered a level has already said it is a heading, so it keeps
the long word cap rather than the short one meant for levels with nothing
but brevity to recommend them.

Over all 224,972 A2AJ case documents: 2,090 gain a spine, 2,709 lose one,
29,899 relabelled, net +562,044 paragraphs. Of the losses, 2,103 were
never rooted at 1 and 563 were endnote ladders. Legislation is
byte-identical; CourtListener over its own 55,504 opinions is 55,489
identical, 8 gained, 2 lost. Heading recall, scored against labels derived
from document position rather than from the grammar, rises 73.70% to
90.94% with the strict negative set still at exactly zero false accepts.

Four sourcedoc fixtures were mid-decision excerpts - one opening 44,435
characters into Sattva - that no chain rooted at paragraph 1 could match;
they are replaced with the full A2AJ records, so the beaver-can manifests
pinning their hashes are refreshed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VyTUeXhYSK9awyArAtm83c
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 6335ebc5
Stats 9 files changed , +560 , -141
Part of Legal agent-surface and context-compaction experiments

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

⬇ Download capture-commit-2c1eb539.md