Track missing legal source for 42 U.S.C. § 12132
Browse files- source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov.json +23 -0
- source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov.patch +41 -0
- source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov_extraction_recipe.json +10 -0
- source_recovery/20260417_235737_42-u-s-c-12132/recovery_manifest.json +47 -0
source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "legal_source_recovery",
|
| 3 |
+
"applied": false,
|
| 4 |
+
"created_at": "2026-04-17T23:57:37.394988",
|
| 5 |
+
"description": "Scraper scaffold for recovered source host uscode.house.gov",
|
| 6 |
+
"diff_content": "diff --git a/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py b/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py\n--- a/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py\n+++ b/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py\n@@\n+from typing import Any\n+\n+def _extract_recovered_uscode_house_gov_text(document: Any) -> str:\n+ \"\"\"Extract text from a recovered legal source candidate.\n+\n+ Generated by the Bluebook self-healing recovery workflow after a\n+ Hugging Face corpus miss. Keep this host-specific and promote it into\n+ the surrounding scraper once validated against related corpus pages.\n+ \"\"\"\n+ metadata = dict(getattr(document, \"metadata\", {}) or {})\n+ text = str(getattr(document, \"text\", \"\") or \"\").strip()\n+ if text:\n+ return text\n+ html = str(getattr(document, \"html\", \"\") or metadata.get(\"html\", \"\") or \"\")\n+ if not html.strip():\n+ return \"\"\n+ try:\n+ from bs4 import BeautifulSoup\n+ except Exception:\n+ return html\n+ soup = BeautifulSoup(html, \"html.parser\")\n+ for selector in (\"main\", \"article\", \"#content\", \".content\", \".main-content\", \".document\", \".statute\", \".law\", \"pre\"):\n+ node = soup.select_one(selector)\n+ if node:\n+ extracted = node.get_text(\"\\n\", strip=True)\n+ if extracted:\n+ return extracted\n+ return soup.get_text(\"\\n\", strip=True)\n+\n+# Recovery notes for the scraper maintainer:\n+# citation: 42 U.S.C. \u00a7 12132\n+# host: uscode.house.gov\n+# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section12132\n+# preferred_fetch_path: UnifiedWebArchivingAPI.fetch(url, domain=\"legal\")\n+# fallback_fetch_path: UnifiedWebScraper.scrape_sync(url)\n+# blocked_fetch_fallback: CommonCrawlSearchEngine.search_domain(host, query=search_query)\n+# hf_common_crawl_fallback: Common Crawl integration falls back to Hugging Face indexes when local CC assets are unavailable.\n",
|
| 7 |
+
"ipfs_cid": null,
|
| 8 |
+
"metadata": {
|
| 9 |
+
"candidate_url": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section12132",
|
| 10 |
+
"citation_text": "42 U.S.C. \u00a7 12132",
|
| 11 |
+
"extraction_recipe_path": "/home/barberb/.ipfs_datasets/uscode/source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov_extraction_recipe.json",
|
| 12 |
+
"host": "uscode.house.gov",
|
| 13 |
+
"normalized_citation": "42 U.S.C. \u00a7 12132"
|
| 14 |
+
},
|
| 15 |
+
"parent_patches": [],
|
| 16 |
+
"patch_id": "recovery-42-u-s-c-12132-uscode-house-gov",
|
| 17 |
+
"target_files": [
|
| 18 |
+
"ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py"
|
| 19 |
+
],
|
| 20 |
+
"task_id": "citation-recovery:42-u-s-c-12132",
|
| 21 |
+
"validated": false,
|
| 22 |
+
"worktree_path": null
|
| 23 |
+
}
|
source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov.patch
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py b/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py
|
| 2 |
+
--- a/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py
|
| 3 |
+
+++ b/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py
|
| 4 |
+
@@
|
| 5 |
+
+from typing import Any
|
| 6 |
+
+
|
| 7 |
+
+def _extract_recovered_uscode_house_gov_text(document: Any) -> str:
|
| 8 |
+
+ """Extract text from a recovered legal source candidate.
|
| 9 |
+
+
|
| 10 |
+
+ Generated by the Bluebook self-healing recovery workflow after a
|
| 11 |
+
+ Hugging Face corpus miss. Keep this host-specific and promote it into
|
| 12 |
+
+ the surrounding scraper once validated against related corpus pages.
|
| 13 |
+
+ """
|
| 14 |
+
+ metadata = dict(getattr(document, "metadata", {}) or {})
|
| 15 |
+
+ text = str(getattr(document, "text", "") or "").strip()
|
| 16 |
+
+ if text:
|
| 17 |
+
+ return text
|
| 18 |
+
+ html = str(getattr(document, "html", "") or metadata.get("html", "") or "")
|
| 19 |
+
+ if not html.strip():
|
| 20 |
+
+ return ""
|
| 21 |
+
+ try:
|
| 22 |
+
+ from bs4 import BeautifulSoup
|
| 23 |
+
+ except Exception:
|
| 24 |
+
+ return html
|
| 25 |
+
+ soup = BeautifulSoup(html, "html.parser")
|
| 26 |
+
+ for selector in ("main", "article", "#content", ".content", ".main-content", ".document", ".statute", ".law", "pre"):
|
| 27 |
+
+ node = soup.select_one(selector)
|
| 28 |
+
+ if node:
|
| 29 |
+
+ extracted = node.get_text("\n", strip=True)
|
| 30 |
+
+ if extracted:
|
| 31 |
+
+ return extracted
|
| 32 |
+
+ return soup.get_text("\n", strip=True)
|
| 33 |
+
+
|
| 34 |
+
+# Recovery notes for the scraper maintainer:
|
| 35 |
+
+# citation: 42 U.S.C. § 12132
|
| 36 |
+
+# host: uscode.house.gov
|
| 37 |
+
+# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section12132
|
| 38 |
+
+# preferred_fetch_path: UnifiedWebArchivingAPI.fetch(url, domain="legal")
|
| 39 |
+
+# fallback_fetch_path: UnifiedWebScraper.scrape_sync(url)
|
| 40 |
+
+# blocked_fetch_fallback: CommonCrawlSearchEngine.search_domain(host, query=search_query)
|
| 41 |
+
+# hf_common_crawl_fallback: Common Crawl integration falls back to Hugging Face indexes when local CC assets are unavailable.
|
source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov_extraction_recipe.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"candidate_files": [],
|
| 3 |
+
"citation_text": "42 U.S.C. \u00a7 12132",
|
| 4 |
+
"common_crawl_fallback": "Use CommonCrawlSearchEngine.search_domain(host, query=search_query) when direct fetch is blocked by Cloudflare or similar anti-bot pages.",
|
| 5 |
+
"host": "uscode.house.gov",
|
| 6 |
+
"normalized_citation": "42 U.S.C. \u00a7 12132",
|
| 7 |
+
"patch_intent": "Add host-specific extraction/fetch support for a legal source recovered after a Hugging Face lookup miss.",
|
| 8 |
+
"source_url": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section12132",
|
| 9 |
+
"target_file": "ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py"
|
| 10 |
+
}
|
source_recovery/20260417_235737_42-u-s-c-12132/recovery_manifest.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"archived_sources": [],
|
| 3 |
+
"candidate_files": [],
|
| 4 |
+
"candidates": [
|
| 5 |
+
{
|
| 6 |
+
"score": 21,
|
| 7 |
+
"source": "citation_url_hint",
|
| 8 |
+
"source_type": "current",
|
| 9 |
+
"title": "42 U.S.C. section 12132",
|
| 10 |
+
"url": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section12132"
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"citation_text": "42 U.S.C. \u00a7 12132",
|
| 14 |
+
"corpus_key": "us_code",
|
| 15 |
+
"generated_at": "2026-04-17T23:57:37.394072",
|
| 16 |
+
"hf_dataset_id": "justicedao/ipfs_uscode",
|
| 17 |
+
"normalized_citation": "42 U.S.C. \u00a7 12132",
|
| 18 |
+
"scraper_patch": {
|
| 19 |
+
"extraction_recipe_path": "/home/barberb/.ipfs_datasets/uscode/source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov_extraction_recipe.json",
|
| 20 |
+
"host": "uscode.house.gov",
|
| 21 |
+
"patch_path": "/home/barberb/.ipfs_datasets/uscode/source_recovery/20260417_235737_42-u-s-c-12132/patches/recovery-42-u-s-c-12132-uscode-house-gov.patch",
|
| 22 |
+
"rationale": "Host-specific recovery scaffold generated from discovered candidate file.",
|
| 23 |
+
"target_file": "ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code_scraper.py"
|
| 24 |
+
},
|
| 25 |
+
"search_backend_status": {
|
| 26 |
+
"archive_search_available": false,
|
| 27 |
+
"archive_search_error": "archive_search_skipped",
|
| 28 |
+
"brave_api_key_env": "",
|
| 29 |
+
"brave_configured": false,
|
| 30 |
+
"common_crawl_available": false,
|
| 31 |
+
"common_crawl_domain_count": 0,
|
| 32 |
+
"common_crawl_domains": [],
|
| 33 |
+
"common_crawl_error": "common_crawl_disabled",
|
| 34 |
+
"common_crawl_result_count": 0,
|
| 35 |
+
"common_crawl_used": false,
|
| 36 |
+
"datasets_available": true,
|
| 37 |
+
"duckduckgo_configured": true,
|
| 38 |
+
"engines_attempted": [],
|
| 39 |
+
"live_search_available": false,
|
| 40 |
+
"live_search_error": "live_search_skipped",
|
| 41 |
+
"live_search_skipped": true,
|
| 42 |
+
"multi_engine_error": "multi_engine_skipped",
|
| 43 |
+
"multi_engine_used": false
|
| 44 |
+
},
|
| 45 |
+
"search_query": "42 U.S.C. \u00a7 12132 site:uscode.house.gov OR site:govinfo.gov OR site:law.cornell.edu",
|
| 46 |
+
"state_code": null
|
| 47 |
+
}
|