bib: fr_anchors schema + grabber — persist FR web anchor maps per rule (fr-grab CLI + backfill) #634
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
New
src/bib/frlink.pygrabber + three tables inbib/schema.sql(auto-applied on Store init):fr_anchors(item_key, p_id, page, ordinal, text)— one row perid="p-N"paragraph anchor from the FRbody_html_url, with printed page from the explicitdata-pageattribute and 1-based ordinal-on-page; text entity-decoded/tag-stripped for quote search. UNIQUE(item_key, p_id).fr_anchor_docs(item_key PK, document_number, html_url, body_html_url, start_page, end_page, fr_volume, fetched_at, sha256, n_paragraphs, n_pages)fr_links(item_key, p_id, page, label, url, created_at)UNIQUE(item_key, url) — placed links (consumed by #637)grab(store, item_key, force=False): resolve document_number from the rule item's extra_json (fallback: parse the FR URL), fetch body_html_url via the FR API,parse_anchors(html)pure function, replace that item's partition.stack bib fr-grab [--all|--key K] [--force]backfills every item_type='rule' with a federalregister.gov URL (~30 rules).Verified ground truth: CMS-1848-P body HTML = 4.2 MB, 5,079
p-Nanchors, 716page-Nanchors,data-pageon every paragraph.Tests: synthetic-HTML parser fixture (entities, ordinals), partition-replace idempotency, real-file smoke against the downloaded CY2027 body.
Spec: docs/superpowers/specs/2026-08-17-fr-jump-links-design.md.