endomorphosis commited on
Commit
db6dfd8
·
verified ·
1 Parent(s): 4129931

Track missing legal source for 42 U.S.C. § 1983

Browse files
source_recovery/20260418_012029_42-u-s-c-1983/patches/recovery-42-u-s-c-1983-uscode-house-gov.json CHANGED
@@ -1,13 +1,13 @@
1
  {
2
  "agent_id": "legal_source_recovery",
3
  "applied": false,
4
- "created_at": "2026-04-18T01:20:29.278449",
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 USC 1983\n+# host: uscode.house.gov\n+# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983\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-section1983",
10
- "citation_text": "42 USC 1983",
11
  "extraction_recipe_path": "/home/barberb/.ipfs_datasets/uscode/source_recovery/20260418_012029_42-u-s-c-1983/patches/recovery-42-u-s-c-1983-uscode-house-gov_extraction_recipe.json",
12
  "host": "uscode.house.gov",
13
  "normalized_citation": "42 U.S.C. \u00a7 1983"
 
1
  {
2
  "agent_id": "legal_source_recovery",
3
  "applied": false,
4
+ "created_at": "2026-04-18T01:20:29.950018",
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.A. \u00a7 1983\n+# host: uscode.house.gov\n+# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983\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-section1983",
10
+ "citation_text": "42 U.S.C.A. \u00a7 1983",
11
  "extraction_recipe_path": "/home/barberb/.ipfs_datasets/uscode/source_recovery/20260418_012029_42-u-s-c-1983/patches/recovery-42-u-s-c-1983-uscode-house-gov_extraction_recipe.json",
12
  "host": "uscode.house.gov",
13
  "normalized_citation": "42 U.S.C. \u00a7 1983"
source_recovery/20260418_012029_42-u-s-c-1983/patches/recovery-42-u-s-c-1983-uscode-house-gov.patch CHANGED
@@ -32,7 +32,7 @@ diff --git a/ipfs_datasets_py/processors/legal_scrapers/federal_scrapers/us_code
32
  + return soup.get_text("\n", strip=True)
33
  +
34
  +# Recovery notes for the scraper maintainer:
35
- +# citation: 42 USC 1983
36
  +# host: uscode.house.gov
37
  +# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983
38
  +# preferred_fetch_path: UnifiedWebArchivingAPI.fetch(url, domain="legal")
 
32
  + return soup.get_text("\n", strip=True)
33
  +
34
  +# Recovery notes for the scraper maintainer:
35
+ +# citation: 42 U.S.C.A. § 1983
36
  +# host: uscode.house.gov
37
  +# candidate_url: https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983
38
  +# preferred_fetch_path: UnifiedWebArchivingAPI.fetch(url, domain="legal")
source_recovery/20260418_012029_42-u-s-c-1983/patches/recovery-42-u-s-c-1983-uscode-house-gov_extraction_recipe.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "candidate_files": [],
3
- "citation_text": "42 USC 1983",
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 1983",
 
1
  {
2
  "candidate_files": [],
3
+ "citation_text": "42 U.S.C.A. \u00a7 1983",
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 1983",
source_recovery/20260418_012029_42-u-s-c-1983/recovery_manifest.json CHANGED
@@ -10,9 +10,9 @@
10
  "url": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983"
11
  }
12
  ],
13
- "citation_text": "42 USC 1983",
14
  "corpus_key": "us_code",
15
- "generated_at": "2026-04-18T01:20:29.276243",
16
  "hf_dataset_id": "justicedao/ipfs_uscode",
17
  "normalized_citation": "42 U.S.C. \u00a7 1983",
18
  "scraper_patch": {
@@ -42,6 +42,6 @@
42
  "multi_engine_error": "multi_engine_skipped",
43
  "multi_engine_used": false
44
  },
45
- "search_query": "42 USC 1983 site:uscode.house.gov OR site:govinfo.gov OR site:law.cornell.edu",
46
  "state_code": null
47
  }
 
10
  "url": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title42-section1983"
11
  }
12
  ],
13
+ "citation_text": "42 U.S.C.A. \u00a7 1983",
14
  "corpus_key": "us_code",
15
+ "generated_at": "2026-04-18T01:20:29.948854",
16
  "hf_dataset_id": "justicedao/ipfs_uscode",
17
  "normalized_citation": "42 U.S.C. \u00a7 1983",
18
  "scraper_patch": {
 
42
  "multi_engine_error": "multi_engine_skipped",
43
  "multi_engine_used": false
44
  },
45
+ "search_query": "42 U.S.C.A. \u00a7 1983 site:uscode.house.gov OR site:govinfo.gov OR site:law.cornell.edu",
46
  "state_code": null
47
  }