diff --git a/changelog.d/casetext-known-dead.changed.md b/changelog.d/casetext-known-dead.changed.md new file mode 100644 index 00000000000..4eb5cf2f5fc --- /dev/null +++ b/changelog.d/casetext-known-dead.changed.md @@ -0,0 +1 @@ +List casetext.com in the known-dead reference URL guard so its links cannot return. diff --git a/policyengine_us/tests/code_health/known_dead_reference_urls/casetext_com.toml b/policyengine_us/tests/code_health/known_dead_reference_urls/casetext_com.toml new file mode 100644 index 00000000000..b18fa694ce5 --- /dev/null +++ b/policyengine_us/tests/code_health/known_dead_reference_urls/casetext_com.toml @@ -0,0 +1,16 @@ +# Dead casetext.com reference URLs. +# casetext.com shut down. Statute, regulation and case pages, and every other +# path tried except the root, return HTTP 410 Gone to a GET request with a +# "This service is no longer available" notice; the root redirects to a +# Thomson Reuters product page with no legal text. #9627 removed all 197 +# links (55 distinct URLs). +# See test_known_dead_reference_urls.py for the format. + +[[dead]] +prefix = "https://casetext.com/" +verified = "2026-10-06" +replacement = """\ +the same section on the official legislature or code site, or \ +law.justia.com where the state has no free official per-section code; \ +Cornell LII (law.cornell.edu/regulations//...) for state \ +regulations without a usable official deep link.""" diff --git a/policyengine_us/tests/code_health/test_known_dead_reference_urls.py b/policyengine_us/tests/code_health/test_known_dead_reference_urls.py index ae4fae3d7cc..aa2483f3ab5 100644 --- a/policyengine_us/tests/code_health/test_known_dead_reference_urls.py +++ b/policyengine_us/tests/code_health/test_known_dead_reference_urls.py @@ -235,6 +235,11 @@ def test_known_dead_url_entries_are_well_formed(): "# https://www.tax.ny.gov/pdf/current_forms/it/it558i.pdf", "href: HTTPS://WWW.TAX.NY.GOV/pit/child-earned-payments.htm#amount", '"[IT-201-I](https://www.tax.ny.gov/pdf/2023/printable-pdfs/inc/it201i-2023.pdf)"', + # casetext.com is listed as a whole host: statute, regulation and case + # pages are all flagged. + "# http://www.casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32121-kansas-exemption-for-an-individual", + "href: https://casetext.com/regulation/new-jersey-administrative-code/title-18-treasury-taxation/chapter-35-new-jersey-gross-income-tax/subchapter-2-exclusions-and-deductions/section-1835-29-medical-expenses-deduction", + '"[Marbury v. Madison](https://casetext.com/case/marbury-v-madison)"', ], ) def test_dead_urls_are_flagged(text): @@ -252,6 +257,7 @@ def test_dead_urls_are_flagged(text): "href: https://www.tax.ny.gov/pdf/current_forms/it/it201i.pdf#page=25", "href: https://www.tax.ny.gov/pdf/current_forms/it/it558i.pdfx", "href: https://www.tax.ny.gov/pit/inflation-refund-checks-faq.htm", + "href: https://web.archive.org/web/2023/https://casetext.com/case/marbury-v-madison", ], ) def test_archived_and_live_urls_are_not_flagged(text):