# pdf-untangle — PDF provision extractor (design doc + build plan)
**Owner:** John (scraper-agent lane) · **Drafted:** 2026-07-02 · **Status:** FINAL — approved by John + reviewed/approved by the resolution agent (6 suggestions incorporated); ready to build, start at Phase 0
**Crate:** `pdf-untangle` (verified available on crates.io 2026-07-02; runner-up names also verified free: `pdf-reflow`, `pdf-unscramble`, `legible-pdf`)
**Repo:** `~/code/pdf-untangle` → `git@gitlab.com:john711/pdf-untangle.git` (new, standalone — NOT inside cite-check)
**License:** MIT OR Apache-2.0 (Rust convention; required for clean crates.io publication — no AGPL deps)
**Relationship to cite-check:** the ingester consumes pdf-untangle as a **library dependency** (git dep during development, crates.io version after publish). The CLI binary ships from the same crate for the world + debugging. This is the Wave-3 **PDF capability**; the headless-browser capability is a SEPARATE future tool (out of scope here).
## 1. Problem
~20 jurisdictions in the [state statutes & rules plan](2026-07-01-state-statutes-rules-plan.md) publish authoritative law only as PDFs: nearly all blocked court rules (ME, RI, CT, DE, NC-app, VA, TX, OH, WI-SCR, AL, FL, DC, MS, MI-MRE, WA, GA-Sup/USCR), Kentucky's statutes, and the territories (Guam, CNMI, USVI rules, PR rules). Character extraction from text-based PDFs is solved by existing crates; **what does not exist anywhere in open source is the layer that turns a legal PDF into structured provisions** — one record per rule/section with citation, heading, body, and effective date. That layer is this tool.
## 2. Goals / non-goals
**Goals (v1):**
- Text-based PDFs → structured provisions (JSONL/JSON), deterministic and testable.
- Profile-driven: all jurisdiction knowledge lives in **TOML profiles (data), not code**. Adding a new document family = writing a profile, not forking the engine.
- Library API (typed, in-process, used by the cite-check ingester) + CLI binary (`cargo install pdf-untangle`), same crate.
- Publishable quality: docs.rs docs, README with examples, golden-file test suite, semver discipline.
**Non-goals (v1) — explicitly deferred:**
- OCR / scanned-image PDFs (v2; all verified Wave-3 targets embed real text).
- Translation (Spanish PR/other text is extracted as published — controlling text stays controlling).
- Headless-browser fetching (separate tool), PDF *fetching* at all — pdf-untangle reads local files/bytes; the ingester's crawlers do the downloading.
- Annotations/forms/tables-as-data. Tables render as text lines in v1.
## 3. Architecture
```
pdf-untangle (crate)
├── src/lib.rs — public API
├── src/extract/ — Layer 1: PDF → positioned text runs (per page)
├── src/layout/ — Layer 2: runs → logical lines/blocks (reading order,
│ columns, header/footer strip, hyphenation & page-flow merge)
├── src/structure/ — Layer 3: blocks → provisions (profile-driven heading
│ detection, section splitting, history/date parsing)
├── src/profile.rs — TOML profile schema + loader (built-in + user-supplied)
├── src/output.rs — Provision model + JSON/JSONL serialization
├── src/bin/pdf-untangle.rs — CLI (thin wrapper over the library)
└── profiles/*.toml — built-in jurisdiction profiles (shipped with the crate)
```
**Layer 1 — extraction backend.** Primary: `pdfium-render` (Google PDFium, BSD-licensed, best-in-class text + position extraction; bundles or dlopens libpdfium). Fallback/pure-Rust: `lopdf`/`pdf-extract` behind a cargo feature (`backend-pdfium` default, `backend-pure` for no-native-dep builds). Both hide behind one internal `TextRun` trait so Layers 2-3 never know the backend. Decision gate in Phase 1: if pdfium's packaging friction is too high for a publishable crate, flip the default to pure-Rust and keep pdfium optional.
**Layer 2 — layout reconstruction (backend-agnostic, the hard 40%).**
Reading order from run positions; column detection; strip repeated page furniture (headers/footers/page numbers) by cross-page repetition + position; de-hyphenate line-break splits; merge paragraphs across page boundaries; preserve indentation levels (they carry meaning in rules: subdivisions (a)(1)(A)).
**Layer 3 — structure detection (profile-driven, the novel 40%).**
A profile declares, as data: **`jurisdiction` slug + `kind`** (the two resolution routing keys — e.g. `cnmi-rules` → `northern_mariana_islands` / `rule`; declared in the TOML so the mapping is data, never integration-code convention), heading patterns (regex + optional style hints like bold/size/centered), what starts a new provision, the **citation template** (`"Guam R. Civ. P. {num}"` — the single source of truth the resolution patterns must reproduce byte-for-byte; each PDF jurisdiction's template is **jointly signed off with the resolution agent before Phase 4**, since territory Bluebook abbreviations are non-obvious), history-line patterns and date formats (incl. Spanish month names for PR), stop markers (committee notes, appendices), skip blocks. The engine applies the profile to Layer-2 blocks and emits provisions. Unmatched-content accounting: every input line is either consumed or reported, so silent text loss is impossible.
**Output model** (superset of what cite-check's `load.rs` needs; ingester maps it to `ProvisionRec`):
```json
{"jurisdiction":"northern_mariana_islands","kind":"rule",
"citation":"NMI R. Civ. P. 12","number":"12","heading":"Defenses and Objections",
"text":"…","history":"…","effective_date":"2019-01-01","language":"en",
"confidence":0.93,"confidence_basis":"coverage=99.4%; citation+date parsed clean",
"source_file":"R05.pdf","pages":[11,14],"profile":"cnmi-rules","warnings":[]}
```
- `jurisdiction`/`kind` come from the profile (routing keys for `provisions` resolution — a wrong slug silently breaks resolution, hence declared data).
- `effective_date` is **never null**: real parsed date, else the document's stated adoption date, else the project's standard `1800-01-01` sentinel (matches the HTML scrapers; `provisions.effective_date` is NOT NULL and drives point-in-time lookups — the sentinel resolves as "in force now").
- `confidence`/`confidence_basis` map to the existing `provisions` columns (default 0.9): computed per provision from line-coverage %, clean-citation parse, and clean-date parse — so shakier PDF extractions surface as lower-confidence in the verifier instead of masquerading as clean HTML ones. (The example citation string is illustrative — the real form per jurisdiction is fixed at the Phase-4 template sign-off.)
**Library API (sketch):**
```rust
let profile = Profile::builtin("cnmi-rules")?; // or Profile::from_path(...)
let doc = pdf_untangle::extract(bytes_or_path, &profile)?; // -> Document
for p in doc.provisions { ... } // typed records
// low-level access: doc.pages (runs/blocks) for debugging + profile authoring
```
**CLI (sketch):**
```
pdf-untangle extract rules.pdf --profile cnmi-rules -o out.jsonl # structured provisions
pdf-untangle text rules.pdf # Layer-2 clean text (no profile)
pdf-untangle inspect rules.pdf --page 3 # runs/blocks dump for profile authoring
pdf-untangle profiles # list built-ins
pdf-untangle check rules.pdf --profile x # dry-run: coverage report, warnings, exit≠0 on loss
```
## 4. Testing strategy
- **Golden-file suite:** `tests/corpus/<profile>/{input.pdf, expected.jsonl}` — small real PDFs (or excerpted pages) committed to the repo; full-size PDFs cached by URL in CI. An `UPDATE_GOLDEN=1` regeneration flow.
- **Coverage invariant:** `pdf-untangle check` must report ≥98% line consumption on every corpus document; unconsumed lines listed.
- **Structure-integrity invariant** (complements coverage — catches mis-splitting that line-coverage can't see): `pdf-untangle check` also asserts citation-sequence sanity per document (monotonic rule/section numbering; flag gaps and duplicates, with a profile-declared allowlist for intentional gaps like HCR's reserved numbers) and, where the PDF has a TOC, cross-checks provision count + numbers against it.
- **Backend pinning:** the golden suite pins the exact extraction-backend version (pdfium build number / crate versions) in a committed manifest; pdfium run-ordering can shift across versions, so a dependency bump is a deliberate `UPDATE_GOLDEN` regen with a diff review, never a mystery CI failure.
- **Property tests** on Layer 2 (merge/hyphenation round-trips).
- **First corpus (in build order):** CNMI per-section PDFs (cleanest: one section per file, deterministic URLs) → Guam per-chapter GCA → Maine rules (`RULE N.pdf` per rule) → CT Practice Book (single 1.2MB book — stress test) → KY per-section statute PDFs → PR Spanish rules (language + Spanish dates).
## 5. Ingester integration (cite-check side, after v1)
Each blocked `rules_<state>.rs` / `statutes_kentucky.rs` stub becomes a real module: crawler downloads the PDFs (existing Pacer politeness), calls `pdf_untangle::extract` with that state's profile, maps `Provision` → `ProvisionRec`, writes the standard JSONL. Profiles for cite-check states live in pdf-untangle's built-ins (they're public-law knowledge — publishing them IS the point). Table cells flip ⛔ → 🧱 → 📥 per the normal pipeline; resolution agent gets the standard load-time pings.
## 6. Risks
- **pdfium packaging** (native lib) vs pure-Rust extraction quality — resolved by the Phase-1 decision gate + feature flags.
- **PDF diversity:** some court PDFs are Word-exports (clean), some are typeset (columns, odd run ordering). Layer 2 must be tuned against the real corpus early — hence corpus-first development.
- **Maintenance burden of a public crate** — keep the public API tiny (one entry point + types); profiles carry the churn.
- **Name/brand:** `pdf-untangle` reserved at first publish (Phase 0 does a `0.0.1` placeholder publish to hold the name).
## 7. Build phases
### Phase 0 — Scaffold & name (small)
- [ ] Create `~/code/pdf-untangle` repo (workspace: lib + bin in one crate), MIT/Apache-2.0 dual license files
- [ ] Push to `gitlab.com:john711/pdf-untangle`; basic CI (fmt, clippy, test)
- [ ] Publish `0.0.1` placeholder to crates.io to reserve `pdf-untangle` (needs `cargo login` — John's crates.io token)
- [ ] README skeleton: what/why, the profile concept, roadmap
### Phase 1 — Extraction core (Layer 1)
- [x] `TextRun` model (text, bbox, font size/weight flags, page) — plus font name and per-page dimensions; serde-serializable for `inspect --json`
- [x] `backend-pdfium` implementation (pdfium-render), feature-gated — libpdfium located via `PDFIUM_DYNAMIC_LIB_PATH` → `./.pdfium/` (see `scripts/fetch-pdfium.sh`) → system path; binding is process-global
- [x] `backend-pure` implementation (lopdf/pdf-extract), feature-gated — pdf-extract chosen over raw lopdf (its char-level `OutputDev` already solves encodings/CMaps); custom device assembles positioned runs
- [x] **Decision gate:** pick the default backend by comparing both on 3 corpus PDFs (CNMI section, Guam chapter, CT Practice Book); record the call here — **default = `backend-pure`** (2026-07-02). Comparison (release build, macOS arm64, pdfium 7f9dc7f / bblanchon prebuilt):
| PDF | backend | pages | runs | chars | bold/italic runs | fonts seen | time |
|---|---|---|---|---|---|---|---|
| CNMI T1 §2051 (131 KiB) | pdfium | 6 | 396 | 15,816 | 96 / 0 | 2 | 184 ms |
| | pure | 6 | 322 | 15,704 | — | — | 4 ms |
| Guam 1 GCA ch.1 (191 KiB) | pdfium | 5 | 438 | 16,414 | 125 / 6 | 4 | 286 ms |
| | pure | 5 | 281 | 16,307 | — | — | 4 ms |
| CT Practice Book (3.6 MiB, 699 pp) | pdfium | 699 | 81,478 | 3,083,204 | 4,163 / 477 | 8 | 38.5 s |
| | pure | 699 | 81,070 | 3,150,956 | — | — | 0.36 s |
Text completeness is equivalent (all spot-check phrases hit on both; char counts within ~2%). PDFium is higher fidelity — exact glyph-tight bboxes, font names, reliable bold/italic (with name-based fallback: real-world descriptors carry junk weights, e.g. CT declares 740 for regular Helvetica) — but needs a native library at runtime, which would break `cargo install pdf-untangle` out of the box; it is also ~50–100× slower through per-object FFI (still fine in absolute terms). The pure backend has two honest quality gaps: no style flags/font names at all, and mid-line x-positions drift when a font's width table is absent (pdf-extract falls back to 1000/em defaults — CNMI line ends read x≈722 vs true ≈485; line *starts* and baselines are exact). Verdict: per the §3 friction criterion, **`backend-pure` is the crate default** (zero-native-dep install, equivalent text), and `backend-pdfium` stays the recommended opt-in for profile authoring and any Layer-3 profile that leans on style hints; when both features are on, dispatch prefers PDFium at runtime and falls back with a logged warning. Revisit if Layer-2/3 tuning shows the pure backend's missing style flags or x-drift materially hurt provision detection on the wider corpus.
- [x] `pdf-untangle inspect` CLI subcommand (runs dump) — needed for everything after — table + `--json`; prints backend, page size, per-run bbox/size/style/font/text
### Phase 2 — Layout reconstruction (Layer 2)
- [x] Reading order + line assembly from runs; column detection — baseline rows (0.45 em tolerance, nearest-row assignment), two-column split via a persistent mid-page line-start x0 cluster with a width-estimate crossing test; pages segment vertically so full-width bands and column regions coexist (CT mixes both). Everything keys on line-start x0 + baselines — reported end-x is only trusted when plausible for the character count (pure-backend x1 drifts both directions)
- [x] Page-furniture stripping (repeated headers/footers/page numbers) — digit-masked (incl. attached letter suffixes, "27-4A" ≈ "27-6") cross-page repetition in top 12% / bottom 10% bands, plus standalone arabic/roman page numbers; stripped lines are returned on `Layout::furniture`, never silently dropped (feeds the Phase-3 coverage invariant)
- [x] De-hyphenation + paragraph merge across page breaks — document-driven cascade (fused word seen elsewhere → drop hyphen; intact compound seen elsewhere → keep; capitalized tail or compound prefix → keep; default drop), soft hyphens always drop; cross-break merge only when punctuation + flush indent + same size say the sentence continues; a trailing hyphen overrides gap/indent block breaks
- [x] Indentation-level preservation (subdivision structure) — line-start x0 quantized per page/column (3.5 pt clusters) into `Line::indent`; `centered`/dominant `font_size` carried per line, `bold` when the backend provides it (pdfium), degrading gracefully on the pure backend
- [x] `pdf-untangle text` subcommand; property tests; golden Layer-2 outputs for 3 corpus docs — `--keep-furniture` and `--json` flags; synthetic-run unit tests + a seeded word-stream round-trip property test; goldens in `tests/golden/layer2/` pinned to the pure backend (MANIFEST.toml, `UPDATE_GOLDEN=1` regen)
### Phase 3 — Profiles & structure (Layer 3)
- [x] Profile TOML schema + loader (+ `Profile::builtin` embedding via include_str) — schema includes `jurisdiction`, `kind`, `citation_template` as required fields; Phase-3 additive fields: `language`, `adoption_patterns`/`adoption_date` (document-level date), `title_patterns` (resolves the new optional `{title}` template placeholder for statute codes, validated: `{title}` requires a title source; unknown placeholders rejected), `monotonic_numbers`, `heading_x0_cluster`, `[heading_style]` hints
- [x] Heading/provision-start detection (regex + style hints); provision assembly — four-stage acceptance: heading regex (named captures `num`/`heading`/`title`) → x0 cluster (candidates > 1.25 em from the dominant heading left edge are body text; keys on `Line::x0`, works on every backend) → optional style hints (`bold` degrades gracefully when the backend reports no bold at all) → monotonic-number guard (rejects TOC entries and in-text cross-references). Skip regions run from a `skip_patterns` match to the next accepted heading and are recorded, never lost
- [x] History-line + effective-date parsing (multi-format incl. Spanish months; never-null fallback chain: parsed date → document adoption date → `1800-01-01` sentinel) — date finders are derived from the profile's strftime `date_formats`; Spanish month names normalize through a data table pre-pass (the PR-profile hook: adding a language = adding table rows); history lines inside skipped commentary still feed the date chain; LAST parsed date wins
- [x] Per-provision `confidence`/`confidence_basis` computation (coverage % + clean citation parse + clean date parse) — documented formula: coverage × citation factor (1.0/0.85) × date factor (1.0 parsed / 0.97 adoption / 0.9 sentinel)
- [x] Coverage accounting + structure-integrity checks (sequence sanity, TOC cross-check) + warnings (`pdf-untangle check`, `--json` for machine output; exits non-zero on coverage < 98%, zero provisions, or duplicate numbers; gaps minus `expected_gaps` are warnings) — TOC cross-check deferred to the Phase-4 backlog: the pure backend mangles dot-leader TOC pages (R05's TOC loses most entry text), so there is nothing reliable to cross-check against until a corpus document motivates it
- [x] `Provision` output model + JSON/JSONL; `pdf-untangle extract` subcommand (`-o` or stdout; `--profile` takes a built-in name or a .toml path); `Document` gained additive accounting fields (`lines_total/consumed/skipped/furniture`, `sequence_gaps`, `sequence_duplicates`); high-level `extract()`/`extract_bytes()` wired end-to-end
- [x] First two profiles green on goldens: `cnmi-rules` (R05.pdf: 97 provisions, Rules 1–86 + 11 dotted insertions, 100% line coverage, sequence clean, adoption date 2019-01-09 from the "Effective …" line), `cnmi-statutes` (T1/2051.pdf per-section shape: 1 provision, "1 CMC § 2051" with `{title}` resolved from the running head, history "Source: PL 1-8 …", effective 2002-02-13 parsed from the skipped Commission Comment, 100% coverage) — goldens in `tests/golden/layer3/` (MANIFEST.toml, `UPDATE_GOLDEN=1` regen), env-gated corpus tests assert the ≥98% coverage floor on both; both profiles stay `draft = true` pending the Phase-4 citation-template sign-off
### Phase 4 — Corpus profiles, wave 1 (prove generality)
- [x] **Citation-template sign-off with the resolution agent** for every wave-1 profile BEFORE building it (the one seam where the two halves can drift; territory abbreviations especially) — signed-off templates recorded in each profile TOML header — **signed off 2026-07-03**: `{title} CMC § {num}` / `NMI R. Civ. P. {num}` (CNMI drafts flipped to final), `{title} GCA § {num}` / `Guam R. Civ. P. {num}`, `M.R. Civ. P. {num}`, `Conn. Practice Book § {num}`, `KRS {num}`, `32 L.P.R.A. Ap. V, R. {num}` (sibling rule sets get their own profiles per set: NMI/Guam Crim. P. & Evid., M.R. Crim. P./Evid./App. P., PR evidence 32 Ap. VI + criminal 34 Ap. II). Templates pinned byte-for-byte in a profile unit test.
- [x] `guam-gca` (per-chapter statutes) + `guam-rules` — GCA: per-chapter files (1gc001, 07gc002), section list mirrors headings → `toc_restart`; `{title}` from the running head (pure backend fuses "1 GCA"→"1GCA…"); SOURCE credits parse (last date wins). Rules: the GRCP snapshot ("GRCP 20240401_Control.pdf", date-stamped filename recorded in the MANIFEST) — 98 rules; the Superior Court *local* rules PDFs on the same page (CVR/date-stamped "Civil-Rules_2025-10-13.pdf") are a separate family for a future profile
- [x] `maine-rules` (per-rule files) — one profile serves both shapes: per-rule `mr_civ_p_N_plus_<date>.pdf` (advisory/reporter notes skipped) and the consolidated set (TOC mirrors headings → `toc_restart`; centered body headings → x0 cluster off; abrogated 72-76B + never-existed 94-99 as `expected_gaps`)
- [x] `connecticut-practice-book` (single-book stress test) — 1530 sections at 100% coverage; two-column (x0 cluster off), multiple embedded rule sets skipped as front matter, chapter indexes interleaved with body text (`skip_block_patterns`), trailing renumbering table + forms appendix cut off by `stop_patterns`, chapters 45-59 as `expected_gaps`, "Sept." via a literal date format
- [x] `kentucky-krs` (per-section statute PDFs) — "Effective:" line is the per-section date; newest-first "History:" block skipped so its reverse-ordered dates stay out of the last-date-wins chain
- [x] `pr-rules` (Spanish; language tag + Spanish date parsing proven) — 334 provisions, `language = "es"`, adoption date parsed from "aprobada el 29 de diciembre de 2009" through the Spanish month table; dot-leader TOC handled by `toc_restart`
- [x] Golden tests all green; coverage ≥98% each; profile-authoring guide in README — 10 corpus documents, 100.00% line coverage on every one; goldens + source sha256 pins in `tests/golden/layer3/MANIFEST.toml`; README gained "Writing a profile"
**Phase-4 engine additions** (all data-driven, motivated by real corpus shapes): `toc_restart` (TOC entries typographically identical to headings — Guam GCA, Maine consolidated), `skip_block_patterns` (block-scoped skips for content interleaved with body text — CT chapter indexes), `stop_patterns` (trailing back matter whose credit lines would attach to the final provision — CT forms appendix), history blocks re-open on later hits (CT prints credits before AND after the body), and `num_key` now orders lettered/chapter-section numbering (Maine `4A`, CT `1-9A` < `1-10`, `32-12` < `32a-1`).
**Post-0.1 engine additions:** `empty_doc_patterns` (profile-declared recognition of intentionally-empty documents — North Dakota publishes a PDF for every Century Code chapter, and 602 of 1529 are whole-chapter "[Repealed by S.L. …]" disposition stubs with no sections; a provision-less document matching a declared pattern gets `Document::empty_doc_marker` set and PASSES `check` instead of failing "no provisions detected". Only consulted at zero provisions, so it can never mask content in a normal document. Motivated by the 2026-07-12 ND crawl, which looped for two days re-fetching all 1529 chapter PDFs because every stub failed `check` and blew the skip budget).
**Phase-4 honest limitations** (documented, not papered over):
- **Wrapped headings lose their tail to the text.** A heading that wraps ("Rule 12. Defenses and Objections– When and How Presented–…" in GRCP; "RULE 11. SIGNING OF PLEADINGS, …" in Maine) records only its first line in `heading`; the continuation line lands at the start of `text`. Affects a handful of long-titled rules per document.
- **Maine per-rule PDFs render word gaps as tabs** under the pure backend (pdf-extract's gap heuristic on these files). Patterns absorb them via `\s+`; the tabs remain in the emitted text as published-layout artifacts. The consolidated Maine set is unaffected.
- **CT chapter-index continuation blocks can leak.** The Practice Book's chapter-opening section indexes split across columns; a continuation block whose first line is a *wrapped entry tail* (deep-indented plain text) defeats the first-line `skip_block_patterns` match. 6 of 1530 sections (7-4, 13-1, 32-2, 32-8, 74-2A, 83-1) carry a few stray index lines in their text — a Layer-2 block-segmentation artifact; candidate Layer-2 fix noted for the backlog (index blocks are uniformly 8pt vs 10pt body).
- **CT sections whose only credit is date-less** ("(P.B. 1998.)" — 772 of 1530) fall to the 1800-01-01 sentinel at confidence 0.9: the book states no document-level adoption date. Honest, and visible in `confidence_basis`.
- **The 2018-era Maine per-rule file (Rule 14) predates the "Includes amendments effective" header** and so carries the sentinel date; the 2023-era files parse cleanly.
### Phase 5 — Publish v0.1
- [ ] API polish + rustdoc on all public items; examples/ dir
- [ ] README full: install, CLI walkthrough, library example, profile guide, corpus table
- [ ] CI release workflow (tag → test → `cargo publish`)
- [ ] Publish `pdf-untangle 0.1.0`; announce decision (blog/HN/r/rust) left to John
### Phase 6 — cite-check integration (in the cite-check repo, my lane)
- [ ] Add pdf-untangle dep to the ingester (git rev → crates.io version at 0.1)
- [ ] Flip CNMI + Guam: real `rules_*`/`statutes_*` modules (crawl PDFs → pdf-untangle → ProvisionRec) — first ⛔→🧱 conversions
- [ ] Flip the state-rules queue in corpus order: ME, RI, DE, VA, TX, OH, FL, AL, DC, NC-app, WI-SCR, MI-MRE, MS-rules, WA, GA-Sup/USCR, CT
- [ ] Flip `statutes_kentucky` (per-section KRS PDFs)
- [ ] PR rules (Spanish) — coordinate extractor patterns with the resolution agent (Spanish citation forms)
- [ ] Update the state plan table per state; loads + mirror pings per the normal handoff
### Phase 7 — v2 backlog (not scheduled)
- [ ] OCR feature (`backend-ocr`: tesseract or a Rust OCR) for scanned PDFs
- [ ] Table extraction as structured data
- [ ] USVI rules (needs the headless-browser tool first to enumerate the CMS ids — cross-tool dependency)
## 8. Coordination notes
- Lanes: pdf-untangle + its cite-check integration are **scraper-agent lane**. The resolution agent consumes the resulting provisions exactly as with HTML states (pattern from branch, mirror on ping). Relay this doc's existence + the Phase-6 state order to them so patterns can be pre-staged for the PDF states.
- **Reviewed by the resolution agent 2026-07-02 — approved**, with 6 suggestions all folded in above: profile-declared `jurisdiction`+`kind` routing keys (§3 Layer 3, output model), joint citation-template sign-off before Phase 4 (§3, Phase 4 gate), never-null effective_date with the corpus-standard 1800-01-01 sentinel (§3 output model, Phase 3), per-provision `confidence`/`confidence_basis` emission (§3 output model, Phase 3), structure-integrity checks beside line-coverage (§4, Phase 3), pinned extraction-backend version in the golden suite (§4).
- The **headless-browser capability** (unblocks MS/TN/AR/GA/PR/VI statutes, NM, LA rules, VT rules) remains a separate, undesigned tool — do not fold it into pdf-untangle.