fix(bib): fetch-pfs-comments --docket; scope the CMS-2026-2377 re-farm to its own docket (refs #615)
The re-farm script's first step walked all 12 PFS dockets (~93k comments, ~5 h of API budget) before reaching CMS-2026-2377. fetch-docket-comments is not a substitute: it omits the reg-docket:<id> tag that backfill-comments --docket filters on. Add --docket to fetch-pfs-comments so tagging stays identical and the other dockets are skipped.
This commit is contained in:
@@ -16,7 +16,7 @@ echo "=== re-farm run $(date -Is) ==="
|
|||||||
|
|
||||||
FAILURES=0
|
FAILURES=0
|
||||||
|
|
||||||
uv run stack bib fetch-pfs-comments || { echo "WARN: fetch-pfs-comments rc=$?"; FAILURES=$((FAILURES+1)); }
|
uv run stack bib fetch-pfs-comments --docket CMS-2026-2377 || { echo "WARN: fetch-pfs-comments rc=$?"; FAILURES=$((FAILURES+1)); }
|
||||||
uv run stack bib backfill-comments --docket CMS-2026-2377 || { echo "WARN: backfill rc=$?"; FAILURES=$((FAILURES+1)); }
|
uv run stack bib backfill-comments --docket CMS-2026-2377 || { echo "WARN: backfill rc=$?"; FAILURES=$((FAILURES+1)); }
|
||||||
uv run stack comments extract --docket CMS-2026-2377 || { echo "WARN: extract rc=$?"; FAILURES=$((FAILURES+1)); }
|
uv run stack comments extract --docket CMS-2026-2377 || { echo "WARN: extract rc=$?"; FAILURES=$((FAILURES+1)); }
|
||||||
# extract-ocr is a phase-2 stub (always exits 2, no --docket) — see #253.
|
# extract-ocr is a phase-2 stub (always exits 2, no --docket) — see #253.
|
||||||
|
|||||||
@@ -197,6 +197,12 @@ def fetch_pfs_comments(
|
|||||||
help="Cap comments fetched per docket. 0 = unlimited.",
|
help="Cap comments fetched per docket. 0 = unlimited.",
|
||||||
),
|
),
|
||||||
sleep: float = typer.Option(1.3, "--sleep"),
|
sleep: float = typer.Option(1.3, "--sleep"),
|
||||||
|
docket: str = typer.Option(
|
||||||
|
"",
|
||||||
|
"--docket",
|
||||||
|
help="Only pull this reg.gov docket (e.g. CMS-2026-2377); "
|
||||||
|
"the other PFS dockets are skipped without any API calls.",
|
||||||
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""One-shot: discover every PFS rule since *since* and pull every
|
"""One-shot: discover every PFS rule since *since* and pull every
|
||||||
comment on each of their dockets.
|
comment on each of their dockets.
|
||||||
@@ -246,6 +252,8 @@ def fetch_pfs_comments(
|
|||||||
if not reg_docket:
|
if not reg_docket:
|
||||||
typer.echo(f" skip {cms_id}: no reg.gov docket found")
|
typer.echo(f" skip {cms_id}: no reg.gov docket found")
|
||||||
continue
|
continue
|
||||||
|
if docket and reg_docket != docket:
|
||||||
|
continue
|
||||||
typer.echo(f" {cms_id} → {reg_docket} ({doc.publication_date})")
|
typer.echo(f" {cms_id} → {reg_docket} ({doc.publication_date})")
|
||||||
rule.add_tag(f"reg-docket:{reg_docket}")
|
rule.add_tag(f"reg-docket:{reg_docket}")
|
||||||
store.upsert(rule)
|
store.upsert(rule)
|
||||||
|
|||||||
Reference in New Issue
Block a user