Skip to content

Replace dead federal and miscellaneous reference URLs - #9764

Merged
MaxGhenis merged 4 commits into
mainfrom
dead-urls-federal
Oct 5, 2026
Merged

MaxGhenis merged 4 commits into
mainfrom
dead-urls-federal

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of the repo-wide audit of dead reference URLs outside tax.ny.gov (follow-up to #9711 and #9730). This PR covers federal agencies and miscellaneous non-state hosts (IRS, SSA, CMS, Medicare, Medicaid, USDA FNS, CBO, KFF, Justia, campaign and nonprofit sites).

  • 29 dead URLs, cited by 52 references, now point to a live copy of the same document, a live official page with the same content, or a pinned Wayback capture of the dead URL with the same #page.
  • Only URLs change. A script checked that every changed line under parameters/, variables/ and docs/ differs from the old line only inside URLs.
  • policyengine_us/tests/code_health/known_dead_reference_urls/federal.toml lists 27 of the dead prefixes, so the offline guard from Replace dead NY tax department reference URLs #9711 fails if they return.

How each URL was checked

  1. Dead: GET with curl -sL -A "Mozilla/5.0" on 2026-09-30, rechecked with a Chrome user agent. A 403, 429 or bot challenge counted as unknown, not dead, and was rechecked inside a real browser page; URLs still behind a bot wall were left unchanged. A 200 that landed on a home, search, login or not-found page counted as dead.
  2. Replacement: one research agent per batch looked for the same document on the agency's current site, then for an official page stating the same content for the same period, then for a pinned Wayback capture. Each mapping records the quoted content it checked.
  3. Independent verification: a second agent re-checked every live replacement and a sample of the Wayback ones against the values the citing file uses (pdftotext on the cited #page for PDFs). Disputed items went to an adjudicator under fixed rules: the agency's own site, then another official publisher, then a Wayback capture of the dead URL. Third-party mirrors (taxformfinder.org, NBER and the like) were not accepted for official citations.
  4. Mechanical: every replacement URL returned 200 with the expected content type. Wayback URLs use 14-digit timestamps and replay the same original URL, and every #page exists in its PDF. A few replacements behind bot walls were confirmed in a browser instead.

Changes

Dead URL Dead because Kind New target Refs
https://content.govdelivery.com/accounts/INOECOSL/bulletins/366774c 404 live https://www.in.gov/fssa/carefinder/system-updates-2023 2
https://content.govdelivery.com/accounts/INOECOSL/bulletins/3f4db24 404 live https://www.in.gov/fssa/carefinder/files/ReimbursementRateFAQs.pdf 1
https://fns-prod.azureedge.us/sites/default/files/resource-files/csfp-program-fact-sheet-2019.pdf 404 Wayback https://web.archive.org/web/20230422132035/https://fns-prod.azureedge.us/sites/default/files/resource-files/csfp-program-fact-sheet-2019.pdf 1
https://fns-prod.azureedge.us/sites/default/files/resource-files/csfp-revised-incomeGuidelines2024.pdf 404 Wayback https://web.archive.org/web/20250202034640/https://fns-prod.azureedge.us/sites/default/files/resource-files/csfp-revised-incomeGuidelines2024.pdf 1
https://fns-prod.azureedge.us/sites/default/files/resource-files/snap-covid-emergency-allotments-phase-3-guidance.pdf 404 Wayback, fragment kept https://web.archive.org/web/20220519071036/https://fns-prod.azureedge.us/sites/default/files/resource-files/snap-covid-emergency-allotments-phase-3-guidance.pdf 1
https://fns-prod.azureedge.us/sites/default/files/resource-files/snap-fy-2023-cola-adjustments.pdf 404 live, fragment kept https://www.usda.gov/sites/default/files/guidance-documents/fns.snap-COLAMemoFY23_0.pdf 1
https://kamalaharris.com/wp-content/uploads/2024/09/Policy_Book_Economic-Opportunity.pdf 404 live, fragment kept https://www.kamalaharris.com/wp-content/uploads/2024/09/Policy_Book_Economic-Opportunity.pdf 1
https://law.justia.com/codes/georgia/2022/title-48/chapter-7/article-2/section-48-7-20-2/ 404 (browser) live https://www.legis.ga.gov/api/legislation/document/20232024/217823 3
https://law.justia.com/codes/mississippi/2022/title-27/chapter-7/article-1/section-27-7-18/ 404 (browser) live, fragment updated https://billstatus.ls.state.ms.us/documents/2017/pdf/SB/2300-2399/SB2311SG.pdf 2
https://law.justia.com/codes/north-dakota/2022/title-57/chapter-57-38/section-57-38-30-3/ 404 (browser) live, fragment updated https://ndlegis.gov/cencode/t57c38.pdf 2
https://secure.ssa.gov/poms.nsf/lnx/0300605020 404 live https://secure.ssa.gov/poms.nsf/lnx/0300605018 1
https://squaremeals.org/Portals/8/FND%20Forms/Program%20Forms/H1666%202025%20Income%20Eligibility%20Guidelines%20for%20the%20Elderly_.pdf?ver=joHDl3vcgPiW3mdgaMM7vA%3d%3d 404 Wayback https://web.archive.org/web/20251104061444/https://squaremeals.org/Portals/8/FND%20Forms/Program%20Forms/H1666%202025%20Income%20Eligibility%20Guidelines%20for%20the%20Elderly_.pdf?ver=joHDl3vcgPiW3mdgaMM7vA%3d%3d 1
https://web.archive.org/web/20211129161302/https://www.kff.org/medicaid/state-indicator/total-medicaid-spending/?currentTimeframe=0&selectedRows=%7B%22states%22:%7B%22all%22:%7B%7D%7D%7D&sortModel=%7B%22colId%22:%22Location%22,%22sort%22:%22asc%22%7D 404 Wayback https://web.archive.org/web/20220810000951/https://www.kff.org/medicaid/state-indicator/total-medicaid-spending/?currentTimeframe=0&sortModel=%7B%22colId%22:%22Location%22,%22sort%22:%22asc%22%7D 1
https://woodacctservices.com/publications/PA%20Income%20Tax%20Forgiveness%20Chart.pdf 404 Wayback, live, fragment updated https://web.archive.org/web/20200927055656/https://woodacctservices.com/publications/PA%20Income%20Tax%20Forgiveness%20Chart.pdf
https://www.pa.gov/content/dam/copapwp-pagov/en/revenue/documents/formsandpublications/papersonalincometaxguide/documents/pitguide_taxforgiveness.pdf
5
https://www.acct.org/files/Advocacy/Factsheets%20and%20Summaries/pell%20grant%20eligibility%20changes%20website.pdf 404 live https://files.eric.ed.gov/fulltext/ED585399.pdf 1
https://www.atlantafed.org/-/media/documents/economic-mobility-and-resilience/advancing-careers-for-low-income-families/policy-rules-database/policy-rules-database-technical-manual.pdf 404 live, fragment updated https://github.com/Research-Division/policy-rules-database/blob/a806195682b7515f01b5739343b91201293dddb4/PRD%20Technical%20Manual.pdf 2
https://www.cbo.gov/system/files/2026-02/51138-2026-02-Revenue-Projections.xlsx missing (browser) live https://www.cbo.gov/system/files/2026-02/51138-2026-02-Revenue.xlsx 1
https://www.cms.gov/medicare 404 live https://www.cms.gov/about-cms/what-we-do/medicare 3
https://www.ecfr.gov/current/title-45/subtitle-B/chapter-IV/part-400/subpart-D/section-400.47 404 (browser) live https://www.ecfr.gov/current/title-45/subtitle-B/chapter-IV/part-400/subpart-E/section-400.53 1
https://www.fns.usda.gov/snap/covid-19-emergency-allotments-guidance 404 Wayback https://web.archive.org/web/20251117084030/https://www.fns.usda.gov/snap/covid-19-emergency-allotments-guidance 1
https://www.fns.usda.gov/snap/simplified-homeless-housing-cost-deduction-questions-and-answers 404 live, fragment updated https://www.usda.gov/sites/default/files/guidance-documents/fns.snap-FarmBill2018Section4004.pdf 1
https://www.irs.gov/pub/irs-drop/rp-19-45.pdf 404 live, fragment kept https://www.irs.gov/pub/irs-drop/rp-19-44.pdf 1
https://www.irs.gov/publications/p929 404 live https://www.irs.gov/pub/irs-prior/p929--2021.pdf 1
https://www.medicaid.gov/medicaid/national-medicaid-chip-program-information/medicaid-childrens-health-insurance-program-basic-health-program-eligibility-levels/index.html 404 (browser) live https://www.medicaid.gov/medicaid/national-medicaid-chip-program-information/medicaid-childrens-health-insurance-program-basic-health-program-eligibility-levels 6
https://www.medicare.gov/basics/costs/medicare-costs/part-a-costs 404 live https://www.cms.gov/newsroom/fact-sheets/2026-medicare-parts-b-premiums-deductibles 3
https://www.medicare.gov/your-medicare-costs/part-b-costs 404 live, fragment updated https://www.medicare.gov/basics/costs/medicare-costs 3
https://www.oecd.org/economy/growth/OECD-Note-EquivalenceScales.pdf 404 live, fragment updated https://www.oecd.org/content/dam/oecd/en/data/datasets/income-and-wealth-distribution-databases/idd-tor-2012-onwards.pdf 1
https://www.snapscreener.com/blog/pennsylvania-snap-increase 404 live http://services.dpw.state.pa.us/oimpolicymanuals/snap/512_Categorical_Eligibility/512_1_General_Policy.htm 1
https://www.ssa.gov/OACT/COLA/aime.html 404 (browser) live, fragment updated https://www.ssa.gov/OACT/COLA/Benefits.html 3

Left unchanged

These URLs are not changed here; each needs more than a URL swap or turned out not to be dead.

Not listed in the guard

  • https://kamalaharris.com/wp-content/uploads/2024/09/Policy_Book_Economic-Opportunity.pdf: replacement differs only in scheme or www., which the guard treats as the same URL.
  • https://www.cms.gov/medicare: still matches repo text after the rewrite (policyengine_us/variables/gov/hhs/medicare/eligibility/is_medicare_eligible.py: https://www.cms.gov/medicare).

Changes after review

An independent review (GPT-6.1 Sol) requested changes; this push addresses both blockers:

  • ERIC link. The old href ended in a stray period, which carried over and made the new link return 404. The period is removed.
  • Pennsylvania tax forgiveness. base, rate_increment, dependent_rate and tax_back now cite the live official PIT guide chapter on pa.gov (page 8 shows the $6,500 table; page 9 shows the $9,500 per-dependent increment) instead of an archived third-party copy. Their reference titles still name the old page numbers.

Not changed, with reasons:

  • Atlanta Fed manual. The GitHub link stays on the blob view at a pinned commit in the Atlanta Fed's own Research-Division repository. The raw URL downloads the file where the blob view displays it; neither honours #page=57.
  • KFF Medicaid spending. The old link was itself a Wayback capture that now returns 404. No 200 capture exists of that exact URL with its selectedRows parameter, so the replacement is a capture of the same KFF table without that parameter. This is the one exception to the same-URL archive rule.
  • Homeless shelter deduction dates. The reviewer noted the cited Q&A gives December 20, 2018 while available.yaml switches states on October 1. That is a policy question about the parameter, not the link, and is left for a separate look.

Split string literals (commit 490ef11)

A scan of every Python string constant with the literals joined found one federal dead URL that the line-based rewrite and guard both missed. cbo_net_business_income.py wrote the dead CBO workbook as two adjacent literals ("https://www.cbo.gov/system/files/2026-02/" + "51138-2026-02-Revenue-Projections.xlsx"). It now cites the replacement the federal list already records (51138-2026-02-Revenue.xlsx). Ruff collapses the now-single literal onto the assignment line; the AST is otherwise unchanged.

The guard now also scans each .py file with string literals that end one line and continue on the next joined back together, keeping line numbers. Before this commit the old file scanned clean; with the join it reports line 11. Two new tests cover the join and the line numbering. The guard file has 35 passed locally.

Verification

  • pytest policyengine_us/tests/code_health/test_known_dead_reference_urls.py passes locally, including the new entries.
  • ruff format --check . (locked ruff 0.15.5) passes.
  • No parameter values, dates, titles or labels change.

axiom: n/a: reference-only

🤖 Generated with Claude Code

Repoints 52 references in 51 files whose URLs no longer resolve to the
same document at a live official URL or a pinned Wayback capture of the
dead URL. Only URLs change. Lists 27 of the dead prefixes in
known_dead_reference_urls/federal.toml so the offline guard keeps them out.

Also makes parse_entries use re.fullmatch so a prefix cannot end in a
newline (nit from the #9730 review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.75%. Comparing base (909176a) to head (d065f95).
⚠️ Report is 177 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##              main    #9764       +/-   ##
============================================
- Coverage   100.00%   55.75%   -44.25%     
============================================
  Files            4       15       +11     
  Lines           76      278      +202     
  Branches         2        8        +6     
============================================
+ Hits            76      155       +79     
- Misses           0      123      +123     
Flag Coverage Δ
unittests 55.75% <100.00%> (-44.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Drop the stray period after the ERIC URL in automatic_zero.yaml; the old
  href carried it too, and with it the link returns 404.
- Point the four Pennsylvania tax forgiveness references at the live
  official PIT guide chapter (page 8 for the base and rate increment, page 9
  for the dependent increment and tax-back percentages) instead of an
  archived third-party copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard scanned line by line, so a URL written as two adjacent string
literals was invisible to it, and the line-based rewrite skipped it too.
cbo_net_business_income.py still cited the dead CBO revenue workbook
that way. Point it at the same replacement the federal list records, and
make the guard also scan Python files with literals that end one line
and continue the next joined back together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit 0970d75 into main Oct 5, 2026
37 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged by the US + core hub at head d065f95a1914b9ab74c3e5c600686cf03770f300 (squash, --admin --match-head-commit). The only block was the required approving review, which no one else can give on Max's PRs.

Gates:

  • Earlier review: an independent review approved the old head 490ef11e66.
  • Main merge: main then took Separate concatenated URLs in Variable reference and documentation strings #9786, which adds commas between concatenated reference URLs and a guard against them. The hub merged main into this branch and re-applied the comma fix. This PR had no conflicts.
  • Delta review: an independent Opus 5.5 batched delta review approved this exact head (~/reviews/us-hub/deadurl/batch-delta-review-r3.md). It confirmed:
    • the same multiset of URL changes as the approved head;
    • the history is the old head plus the merge of main;
    • no non-attribute AST change in any touched .py file;
    • none of main's edits is lost in any conflicted file;
    • both URL guard tests pass.
  • CI: gh pr checks exits 0, with every check run on d065f95a1914b9ab74c3e5c600686cf03770f300 successful.
  • State: MERGEABLE against current main, not a draft, no CHANGES_REQUESTED review.
  • Impact: reference URLs only, with no formula or value change.

@MaxGhenis
MaxGhenis deleted the dead-urls-federal branch October 5, 2026 01:18
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
* Skip Quick Feedback coverage when the test scope is narrowed

When a change maps to too many test targets, limit_test_paths narrows
the run to the directly changed tests. run_tests still passed every
changed .py file to coverage --include, so the uploaded report counted
lines in those files that the narrowed tests never exercise. On the
reference-only PRs #9764 and #9766 that sent codecov/project to 54% and
69% while codecov/patch was 100%.

A narrowed run now skips coverage, like the existing path for changes
with no Python source. Codecov then gets no partial report and posts
no project status, matching PRs that Quick Feedback defers entirely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Leave only the untested changed sources out of coverage

Narrowing is one of two ways Quick Feedback drops a changed file's
tests; deferring slow directories (gov/ssa, household, reform, ...) is
the other, and it produced the same partial report. Replace the
narrowed-scope flag with a per-file rule: a changed source is measured
unless it maps to tests and none of them are in this run. Files with
no mapped tests keep today's behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant