From 5e32e226d32e58f4d549c432753d5411a2727bb5 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 3 Oct 2026 08:12:39 -0400 Subject: [PATCH 1/4] List casetext.com in the known-dead reference URL guard casetext.com shut down: statute, regulation and case pages return HTTP 410 Gone, and the home page redirects to a Thomson Reuters product page. #9627 replaced all 199 references; this entry keeps new ones out of the package and docs. Co-Authored-By: Claude Opus 5.5 --- changelog.d/casetext-known-dead.changed.md | 1 + .../known_dead_reference_urls/casetext_com.toml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 changelog.d/casetext-known-dead.changed.md create mode 100644 policyengine_us/tests/code_health/known_dead_reference_urls/casetext_com.toml 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..2354d3135e7 --- /dev/null +++ b/policyengine_us/tests/code_health/known_dead_reference_urls/casetext_com.toml @@ -0,0 +1,14 @@ +# Dead casetext.com reference URLs. +# casetext.com shut down: every statute, regulation and case page returns +# HTTP 410 Gone to a GET request, and the home page redirects to a Thomson +# Reuters product page with no legal text. #9627 replaced all 199 references. +# See test_known_dead_reference_urls.py for the format. + +[[dead]] +prefix = "https://casetext.com/" +verified = "2026-10-03" +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.""" From 44119e185c62cc7fcff49aa3d79ecc3a7d270911 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 6 Oct 2026 00:00:15 -0400 Subject: [PATCH 2/4] Test that the casetext.com entry flags statute, regulation and case URLs The casetext.com entry is the guard's only whole-host prefix. Pin what it covers: a statute URL over http with www., a regulation URL and a case URL in a markdown link are each flagged once, and a Wayback copy of a casetext page is not. Without the entry the three flagged examples fail. Co-Authored-By: Claude Opus 5.5 --- .../tests/code_health/test_known_dead_reference_urls.py | 6 ++++++ 1 file changed, 6 insertions(+) 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): From 9ac1fc8cc2af75c68981cb1c3feacedd841d6a85 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 6 Oct 2026 00:06:40 -0400 Subject: [PATCH 3/4] Record the 2026-10-06 casetext.com check and the verified link count A redirect-following GET of every casetext.com URL #9627 removed (46 statute, 9 regulation), four case pages, three index pages and four made-up paths returned HTTP 410 with the same shutdown notice; only the root redirects, to a Thomson Reuters product page. Update `verified` to that check. #9627's base had 197 casetext.com links (55 distinct URLs), not 199, by git grep. Co-Authored-By: Claude Opus 5.5 --- .../known_dead_reference_urls/casetext_com.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 index 2354d3135e7..f38c715cdb1 100644 --- 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 @@ -1,12 +1,14 @@ # Dead casetext.com reference URLs. -# casetext.com shut down: every statute, regulation and case page returns -# HTTP 410 Gone to a GET request, and the home page redirects to a Thomson -# Reuters product page with no legal text. #9627 replaced all 199 references. +# 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 replaced all 197 +# links (55 distinct URLs). # See test_known_dead_reference_urls.py for the format. [[dead]] prefix = "https://casetext.com/" -verified = "2026-10-03" +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; \ From 864967ee9d93470d880301171c055f12f6e180b5 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 6 Oct 2026 02:16:21 -0400 Subject: [PATCH 4/4] Say #9627 removed the 197 casetext.com links, not replaced them #9627 deleted one duplicate North Dakota entry instead of replacing it, so "removed" is the accurate verb. The 197 links and 55 distinct URLs are the casetext.com URLs on the removed lines of #9627's diff. Co-Authored-By: Claude Opus 5.5 --- .../code_health/known_dead_reference_urls/casetext_com.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index f38c715cdb1..b18fa694ce5 100644 --- 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 @@ -2,7 +2,7 @@ # 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 replaced all 197 +# 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.