journals: page map is the structure authority, not marker re-detection

↗ view on GitHub · Eli Ziff · 2026-07-30 · c824f2b4

The [page N] markers in article text are rendered by the journals
database export from its own page map (article_pages, in page_order).
journalSourceDoc now walks that map and locates each known label's
marker line, instead of regex-discovering numeric-looking markers and
joining anchors through a label-keyed Map.

What the ordered walk carries that discovery could not, verified by an
old-vs-new differential over all 18,595 articles in the real database
(18,574 byte-identical; 21 differ, every difference an addition or
anchor correction, zero blocks lost):

- 40 non-numeric page rows across 17 articles ("PDF 1", "-5".."-1"
  front-matter) now produce page blocks; the \d{1,5} regex dropped
  them.
- Repeated labels (4 articles) get their own per-row anchors; the Map
  collapsed both page38 blocks of article 9202 onto pdf page 2.

lookupLegalSourceDoc gains a final alias pass-through: a locator no
grammar recognizes resolves through block aliases ("PDF 1" -> found,
anchor page=1), while numeric locators keep their normalized
requestedLabel bytes (receipt hashes unchanged; the frozen
legacy-structure.json recording still passes byte-identical).
Duplicate labels answer ambiguous, not a guess.

Suites: journalArticles, sourceDocNativeMarkup, sourceDocA2AJ,
localAssistantTools, legalSourceLinks, providerPdfConsumers,
localDocumentsEvidence all green.

Integration plan item 1 (task #28).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AgUm5EcRKbT3duVFMbrQD
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 7ce2636f
Stats 2 files changed , +62 , -27
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-c824f2b4.md from inside the repo you want the change in.

⬇ Download capture-commit-c824f2b4.md