Skip to content

Replace dead Michigan reference URLs - #9775

Merged
MaxGhenis merged 3 commits into
mainfrom
dead-urls-mi
Oct 5, 2026
Merged

MaxGhenis merged 3 commits into
mainfrom
dead-urls-mi

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 Michigan (Department of Treasury forms and instructions, Michigan Legislature).

  • 36 dead URLs, cited by 385 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/mi.toml lists 35 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
http://legislature.mi.gov/doc.aspx?mcl-206-272 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-272 1
http://legislature.mi.gov/doc.aspx?mcl-206-30 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-30 59
http://legislature.mi.gov/doc.aspx?mcl-206-508 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-508 4
http://legislature.mi.gov/doc.aspx?mcl-206-514 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-514 2
http://legislature.mi.gov/doc.aspx?mcl-206-520 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-520 8
http://legislature.mi.gov/doc.aspx?mcl-206-522 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-522 5
http://legislature.mi.gov/doc.aspx?mcl-206-527a 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-527a 11
http://www.legislature.mi.gov/(S(keapvg1h2vndkn25rtmpyyse))/mileg.aspx?page=getObject&objectName=mcl-206-527a 404 live https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-527a 2
http://www.legislature.mi.gov/documents/mcl/pdf/mcl-act-281-of-1967.pdf 404 live, fragment updated https://www.legislature.mi.gov/documents/mcl/pdf/mcl-act-281-of-1967.pdf 1
https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/BOOK_MI-1040CR-7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20220523104347/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/BOOK_MI-1040CR-7.pdf?rev=d7990c15e0034d768a43c47b6d3ba0ac 7
https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/Book_1040_Instructions_Only.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2021/Book-1040-Instructions-Only.pdf 4
https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf 404 Wayback, live, fragment updated https://web.archive.org/web/20220523121258/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2
https://www.michigan.gov/treasury/-/media/Project/Websites/treasury/Uncategorized/2023/Economic-Reports-and-Notices-2023/Home-Heating-Expenses-Reported-by-Home-Heating-Credit-Filers/rpt-text_2021data.pdf
8
https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2 404 Wayback https://web.archive.org/web/20220523121258/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2 2
https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/UNCAT/2019_Taxpayer_Assistance_Manual.pdf 404 Wayback, fragment kept https://web.archive.org/web/20240512165124/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/UNCAT/2019_Taxpayer_Assistance_Manual.pdf 29
https://www.michigan.gov/-/media/Project/Websites/taxes/Forms/2020/2020-IIT-Forms/Book_MI-1040_instructions_only.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2020/Book_MI-1040_instructions_only.pdf 1
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/4884.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/4884.pdf 4
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/BOOK_MI-1040.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/BOOK_MI-1040.pdf 58
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/Form-4884-Section-C-worksheet.pdf 404 live https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/Form-4884-Section-C-worksheet.pdf 1
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/MI-1040.pdf 5
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/MI-1040CR.pdf 14
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20230321124541/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR7.pdf 5
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/Schedule-1.pdf 404 live https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/Schedule-1.pdf 5
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/BOOK_MI-1040.pdf 45
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040CR-7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20240928005701/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040CR-7.pdf?rev=048b871ae3294dec8ca7761afb2d8f78&hash=C3FFD92D4D764FFFE75A88FE25F09C97 6
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/MI-1040.pdf 2
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR.pdf 404 live, fragment kept https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/MI-1040CR.pdf 6
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20240812191051/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR7.pdf 6
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2024/2024-IIT-Forms/4884.pdf 404 live, fragment updated https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/4884-Instructions.pdf 2
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/BOOK_MI-1040CR-7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20250202150154/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/BOOK_MI-1040CR-7.pdf 5
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/MI-1040CR-7.pdf 404 Wayback, fragment kept https://web.archive.org/web/20250202222033/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/MI-1040CR-7.pdf 5
https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/MISC/Tax-Professionals/Taxpayer_Assistance_Manual.pdf 404 Wayback, fragment kept https://web.archive.org/web/20240613004430/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/MISC/Tax-Professionals/Taxpayer_Assistance_Manual.pdf 23
https://www.michigan.gov/taxes/iit/accordion/credits/table-a-2022-home-heating-credit-mi-1040cr-7-standard-allowance 404 Wayback https://web.archive.org/web/20230926141111/https://www.michigan.gov/taxes/iit/accordion/credits/table-a-2022-home-heating-credit-mi-1040cr-7-standard-allowance 2
https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits 404 Wayback https://web.archive.org/web/20250202214915/https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits 26
https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits/michigan-standard-deduction 404 Wayback https://web.archive.org/web/20250202140014/https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits/michigan-standard-deduction 17
https://www.michigan.gov/treasury/reference/taxpayer-notices/2025-tax-year-income-tax-rate-for-individuals-and-fiduciaries 404 live https://www.michigan.gov/treasury/reference/taxpayer-notices/2025/05/01/2025-tax-year-income-tax-rate-for-individuals-and-fiduciaries 1
https://www.michigan.gov/treasury/reference/taxpayer-notices/notice-regarding-new-deductions-for-qualified-overtime-compensation-and-qualified-tips 404 live https://www.michigan.gov/treasury/reference/taxpayer-notices/2026/01/06/new-deductions-for-qualified-overtime-compensation-and-qualified-tips 3

Left unchanged

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

  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/: unresolved (Extraction artifact, not a real citation. In policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py lines 15-16, the reference is a split )

Not listed in the guard

  • http://www.legislature.mi.gov/documents/mcl/pdf/mcl-act-281-of-1967.pdf: replacement differs only in scheme or www., which the guard treats as the same URL.

Pre-existing citation gaps (not fixed here)

The replacement keeps the original document and page, but the cited page does not show every value the file uses. These need a separate look because one URL is shared by files that cite different pages.

  • http://legislature.mi.gov/doc.aspx?mcl-206-30: Same section at the legislature's own redirect target; gaps predate the URL: 2017 tier-three values vs (9)(c) 2018 start, and plan_529 cap.yaml titled (1)(bb) (now wagering losses) though the cap is (
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR.pdf#page=1: Byte-identical relocation, same page. The $63,000 resource limit used by mi_homestead_property_tax_credit_eligible.py is on p2; that gap was already in the original citation.
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR.pdf#page=2: Byte-identical relocation, same page. The 40% alternate senior rate is in Worksheet 5 (MI-1040 book p34, already cited separately), never on this page.
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdf#page=10: Same 2023 booklet (cited page text identical to the Feb 2024 edition at the dead URL). The JOINT $3,000 in dependent_on_other_return.yaml was never on p10.
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdf#page=13: Same 2023 booklet, same page. Subtraction instructions start on p14, a gap already in the original. Schedule-1.pdf is a different document (rule 3).
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdf#page=31: Same 2023 booklet, same page. The household-resource list continues onto p32, a gap already in the original. A 2023 MI-1040CR form would be a different document (rule 3).
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdf#page=47: Same 2023 booklet, same page. Subtraction lines 24-28 are on p48, a gap already in the original.
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040.pdf#page=2: Byte-identical relocation, same page. The home heating credit in refundable.yaml was never on the MI-1040 form.
  • https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR.pdf#page=2: Byte-identical relocation, same page. The 40% alternate senior rate (Worksheet 5) was never on this page and is already cited via MI-1040 book p34.
  • https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits: Verifier's pin: the last capture with tiers and phase-in (stripped by 2025-05; live moved page lacks tiers). $20k/$40k, $35k/$55k were never on this page.

Changes after review

The independent review (GPT-6.1 Sol, tier hard) approved at 2f39f21abc with one nonblocking should_fix. That fix is commit f982a7fa0d: mi_household_resources.py cited the dead TY2024 MI-1040CR-7 booklet as two adjacent string literals, so the line-based rewrite missed it. It now cites the pinned capture the Michigan guard entry already records (web.archive.org/web/20250202150154/...TY2024/BOOK_MI-1040CR-7.pdf, GET 200 application/pdf), on one line. #9764 extends the guard to join split literals, so this pattern is caught from then on.

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

MaxGhenis and others added 2 commits October 3, 2026 14:52
Repoints dead reference URLs to the same document at a live official URL, an official page with the same content, or a pinned Wayback capture of the dead URL. Only URLs change. Lists the dead prefixes in known_dead_reference_urls/mi.toml for the offline guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mi_household_resources.py cited the dead TY2024 MI-1040CR-7 booklet as
two adjacent string literals, so the line-based rewrite missed it. Use
the same pinned capture the Michigan guard entry records, on one line.

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 100.00%. Comparing base (909176a) to head (ea90030).
⚠️ Report is 177 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #9775    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            4        44    +40     
  Lines           76       730   +654     
  Branches         2         6     +4     
==========================================
+ Hits            76       730   +654     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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.

# Conflicts:
#	policyengine_us/variables/gov/states/mi/tax/income/credits/home_heating/alternate/mi_alternate_home_heating_credit.py
#	policyengine_us/variables/gov/states/mi/tax/income/credits/home_heating/mi_home_heating_credit.py
@MaxGhenis
MaxGhenis merged commit 0b50f20 into main Oct 5, 2026
37 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged by the US + core hub at head ea90030c3b2e673c4f0cbd35367ceee99e94dbb7 (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 f982a7fa0d.
  • 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.
  • 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 ea90030c3b2e673c4f0cbd35367ceee99e94dbb7 successful.
  • State: MERGEABLE against current main, not a draft, no CHANGES_REQUESTED review.
  • Impact: reference URLs only, with no formula or value change.

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