Repository navigation
Replace dead Michigan reference URLs - #9775
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# 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
Contributor
Author
|
Merged by the US + core hub at head Gates:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
#page.parameters/,variables/anddocs/differs from the old line only inside URLs.policyengine_us/tests/code_health/known_dead_reference_urls/mi.tomllists 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
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.pdftotexton the cited#pagefor 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.#pageexists in its PDF. A few replacements behind bot walls were confirmed in a browser instead.Changes
http://legislature.mi.gov/doc.aspx?mcl-206-272https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-272http://legislature.mi.gov/doc.aspx?mcl-206-30https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-30http://legislature.mi.gov/doc.aspx?mcl-206-508https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-508http://legislature.mi.gov/doc.aspx?mcl-206-514https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-514http://legislature.mi.gov/doc.aspx?mcl-206-520https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-520http://legislature.mi.gov/doc.aspx?mcl-206-522https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-522http://legislature.mi.gov/doc.aspx?mcl-206-527ahttps://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-527ahttp://www.legislature.mi.gov/(S(keapvg1h2vndkn25rtmpyyse))/mileg.aspx?page=getObject&objectName=mcl-206-527ahttps://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-527ahttp://www.legislature.mi.gov/documents/mcl/pdf/mcl-act-281-of-1967.pdfhttps://www.legislature.mi.gov/documents/mcl/pdf/mcl-act-281-of-1967.pdfhttps://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/BOOK_MI-1040CR-7.pdfhttps://web.archive.org/web/20220523104347/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/BOOK_MI-1040CR-7.pdf?rev=d7990c15e0034d768a43c47b6d3ba0achttps://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/Book_1040_Instructions_Only.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2021/Book-1040-Instructions-Only.pdfhttps://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdfhttps://web.archive.org/web/20220523121258/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2https://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.pdfhttps://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2https://web.archive.org/web/20220523121258/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/IIT/MI-1040CR7.pdf?rev=84f72df3f8664b96903aa6b655dc34d2https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/UNCAT/2019_Taxpayer_Assistance_Manual.pdfhttps://web.archive.org/web/20240512165124/https://www.michigan.gov/-/media/Project/Websites/taxes/2022RM/UNCAT/2019_Taxpayer_Assistance_Manual.pdfhttps://www.michigan.gov/-/media/Project/Websites/taxes/Forms/2020/2020-IIT-Forms/Book_MI-1040_instructions_only.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2020/Book_MI-1040_instructions_only.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/4884.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/4884.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/BOOK_MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/BOOK_MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/Form-4884-Section-C-worksheet.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/Form-4884-Section-C-worksheet.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/MI-1040CR.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR7.pdfhttps://web.archive.org/web/20230321124541/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/MI-1040CR7.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2022/2022-IIT-Forms/Schedule-1.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2022/Schedule-1.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/BOOK_MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/BOOK_MI-1040CR-7.pdfhttps://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=C3FFD92D4D764FFFE75A88FE25F09C97https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/MI-1040.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2023/MI-1040CR.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR7.pdfhttps://web.archive.org/web/20240812191051/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2023/2023-IIT-Forms/MI-1040CR7.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/2024/2024-IIT-Forms/4884.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/4884-Instructions.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/BOOK_MI-1040CR-7.pdfhttps://web.archive.org/web/20250202150154/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/BOOK_MI-1040CR-7.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/MI-1040CR-7.pdfhttps://web.archive.org/web/20250202222033/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/MI-1040CR-7.pdfhttps://www.michigan.gov/taxes/-/media/Project/Websites/taxes/MISC/Tax-Professionals/Taxpayer_Assistance_Manual.pdfhttps://web.archive.org/web/20240613004430/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/MISC/Tax-Professionals/Taxpayer_Assistance_Manual.pdfhttps://www.michigan.gov/taxes/iit/accordion/credits/table-a-2022-home-heating-credit-mi-1040cr-7-standard-allowancehttps://web.archive.org/web/20230926141111/https://www.michigan.gov/taxes/iit/accordion/credits/table-a-2022-home-heating-credit-mi-1040cr-7-standard-allowancehttps://www.michigan.gov/taxes/iit/retirement-and-pension-benefitshttps://web.archive.org/web/20250202214915/https://www.michigan.gov/taxes/iit/retirement-and-pension-benefitshttps://www.michigan.gov/taxes/iit/retirement-and-pension-benefits/michigan-standard-deductionhttps://web.archive.org/web/20250202140014/https://www.michigan.gov/taxes/iit/retirement-and-pension-benefits/michigan-standard-deductionhttps://www.michigan.gov/treasury/reference/taxpayer-notices/2025-tax-year-income-tax-rate-for-individuals-and-fiduciarieshttps://www.michigan.gov/treasury/reference/taxpayer-notices/2025/05/01/2025-tax-year-income-tax-rate-for-individuals-and-fiduciarieshttps://www.michigan.gov/treasury/reference/taxpayer-notices/notice-regarding-new-deductions-for-qualified-overtime-compensation-and-qualified-tipshttps://www.michigan.gov/treasury/reference/taxpayer-notices/2026/01/06/new-deductions-for-qualified-overtime-compensation-and-qualified-tipsLeft 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
2f39f21abcwith one nonblocking should_fix. That fix is commitf982a7fa0d:mi_household_resources.pycited 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.pypasses locally, including the new entries.ruff format --check .(locked ruff 0.15.5) passes.axiom: n/a: reference-only
🤖 Generated with Claude Code