bib: cfrlink core — parse_cite / url / cite_of with round-trip law #639

Closed
opened 2026-08-17 18:50:41 +00:00 by kert · 0 comments
Owner

src/bib/cfrlink.py: CfrCite(title, part, section, paras, date); parse_cite accepting 42 CFR 425.400(c)(1)(iv), 42 C.F.R. § 425.400, 42 CFR Part 425 spellings (title REQUIRED — bare § raises); url() emitting the server-resolved short form https://www.ecfr.gov/current/title-{t}/section-{s} + semantic #p-{s}(c)(1)(iv) fragment (verified: eCFR paragraph ids ARE the cite paths; short URLs 302 to canonical; fragments survive), /on/{date}/ pinning; cite_of(url) inverting short/canonical/dated/fragmented URL forms.

Round-trip law tested both ways: cite→URL→cite is the canonical spelling; URL→cite→URL reproduces the short form. Pure functions, no network, no store.

Spec: docs/superpowers/specs/2026-08-17-ecfr-jump-links-design.md.

`src/bib/cfrlink.py`: `CfrCite(title, part, section, paras, date)`; `parse_cite` accepting `42 CFR 425.400(c)(1)(iv)`, `42 C.F.R. § 425.400`, `42 CFR Part 425` spellings (title REQUIRED — bare § raises); `url()` emitting the server-resolved short form `https://www.ecfr.gov/current/title-{t}/section-{s}` + semantic `#p-{s}(c)(1)(iv)` fragment (verified: eCFR paragraph ids ARE the cite paths; short URLs 302 to canonical; fragments survive), `/on/{date}/` pinning; `cite_of(url)` inverting short/canonical/dated/fragmented URL forms. **Round-trip law tested both ways**: cite→URL→cite is the canonical spelling; URL→cite→URL reproduces the short form. Pure functions, no network, no store. Spec: docs/superpowers/specs/2026-08-17-ecfr-jump-links-design.md.
kert added this to the P41: eCFR Jump Links — bidirectional CFR cite ↔ URL milestone 2026-08-17 18:50:41 +00:00
kert added the bibcli labels 2026-08-17 18:50:41 +00:00
kert closed this issue 2026-08-17 19:08:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#639