Align skeleton statute grammar with the corpus-proven reference

↗ view on GitHub · Eli Ziff · 2026-07-28 · 59cf82e0

The TS skeleton could not see the head style the A2AJ corpus actually
prints: dotless "164 (1)" (and NT/PE dot-terminated "2. (1)") heads were
invisible, so the skeleton/ledger machinery was blind to most local
statutes. Measured on a stratified 431-text sample across all 24 law
datasets: 11.6% label-level recall against the reference grammar
(verifier_core/a2aj_structure.py, used strictly as a read-only test-time
oracle), 185 of 296 structured texts fully unindexed.

statuteSpine.ts ports the reference design: bare-number marks join
strictly-increasing same-arity scopes, and only a scope with >= 3
members spanning >= 10% of the document becomes the section spine -
document-level competition instead of per-line guards, because a year, a
price, and a section head are indistinguishable line-locally. Two
corpus-measured departures from the oracle: dot-terminated heads compete
as a fallback family (indexes the NT/PE style the oracle misses;
precedence, not length, because Ontario-drafting paragraph lists are
dot-terminated and nested inside bare sections), and a lone dotless
provision excerpt is indexed via a bare-number-then-"(digit" guard
(single excerpts cannot form a spine).

After: 296/296 sampled structured texts exact-match, 100.0% label
recall (9847/9847), plus 71 NT/PE dotterm texts indexed beyond the
oracle. Probe + diff scripts included; amendops chapeau fixture flipped
to the true dotless consolidation form.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018bhP89cYSdEEjHNPnxacns
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents ed15c59d
Stats 7 files changed , +650 , -5
Part of Deterministic legal-text tools ("SLA audit organs")

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

⬇ Download capture-commit-59cf82e0.md