comments: finish the detail scrape — 160.5k unenriched stubs cap every text-based exhibit #662
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?
Section 4 of the palliative RFI notebook disclosed that only 28.4k of 166.9k docketed PFS comments have locally retrievable text. Diagnosis (2026-08-19):
enriched:okon only 6,418;enriched:gone0): the initial farm captured list-level metadata only (extra_json = {"doc_type": "Public Comment"}— no inline text, no attachment manifest). It is NOT a case of downloaded-but-unextracted PDFs.stack bib backfill-commentshits/v4/comments/{id}?include=attachmentsat ~970 req/h (reg.gov hourly cap), downloads attachments to.state/comments/, tagsenriched:ok|gone. 160.5k pending ≈ 165 hours ≈ 7 days of continuous crawl on the one configured API key.ocr_neededattachments (image-only PDFs/JPGs);stack comments extract-ocris still the phase-2 stub (#253 follow-up). That gap persists after the backfill and grows with it.Plan:
stack comments extract --docket <D>, then re-rundev/scripts/tag_palliative_comments.py(idempotent) so notebook Section 4 tracks coverage as it improves.Related: #615 (post-close re-farm of CMS-2026-2377), #660 (the exhibit this feeds).
Backfill launched 2026-08-19 ~14:45 ET (pid on rack, nohup loop): docket order CMS-2018-0076 → 2023 → 2024 → 2025 → 2019 → 2021 → 2022 → 2020, each followed by
stack comments extract --docketand an idempotent re-run of the palliative sweep so #660's notebook section improves as dockets land. First docket: 11,143 pending, enriching at ~970/hr (≈11.5 h). Total ≈ 165 h ≈ 7 days. Progress:tail .state/comments/backfill.log. Gotcha fixed at launch: the CLI needs REGULATIONS_GOV_API_KEY exported — a bare nohup shell doesn't source .env; the loop now doesset -a; . .env.Superseded the API crawl with a bulk route (
e5c00bd):stack bib backfill-comments --docket D --mirrorpulls from the Mirrulations public S3 mirror (AWS Open Data,s3://mirrulations) — comment detail JSON is the v4 API response verbatim (raw-data/CMS/{D}/text-{D}/comments/{cid}.json), attachments sit beside it in the binary tree. No API key, no rate cap, and the mirror is a superset of our farm (15,368 vs 13,245 for CMS-2018-0076; 3,433 vs 2,728 for the live docket) so mirror-only comments get created with the standard tag set.The API loop was killed at 425/11,143 (~40 min) and the mirror loop launched over all ten dockets (including CMS-2017-0092 and CMS-2026-2377 — mirror is fresher everywhere): 1,800 comments enriched in the first ~90 seconds. The ~7-day crawl is now a same-day job. Each docket is still followed by
stack comments extract+ the palliative sweep, so #660's exhibit updates as dockets land.Note on the "many droplets" idea that prompted this: reg.gov's cap is per API key, not per IP, so a VM fleet wouldn't have helped — the mirror sidesteps the API entirely. The reg.gov API remains for freshness gap-fill on the live docket (#615).
Complete (2026-08-19 16:27 ET, ~90 min wall clock, 0 errors on all ten dockets):
stack comments extractran inside the loop.topic:palliativegrew 278 → 417 (+50%); biggest gains CMS-2018-0076 78→129, CMS-2025-0304 28→69, CMS-2023-0121 44→57. Notebook Section 4 reads all of this live.