endomorphosis commited on
Commit
844bee4
·
verified ·
1 Parent(s): 3fb1e10

Track missing legal source for ORS 659A.030

Browse files
source_recovery/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "agent_id": "legal_source_recovery",
3
+ "applied": false,
4
+ "created_at": "2026-04-18T00:05:11.902610",
5
+ "description": "Scraper scaffold for recovered source host oregon.public.law",
6
+ "diff_content": "diff --git a/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py b/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py\n--- a/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py\n+++ b/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py\n@@\n+from typing import Any\n+\n+def _extract_recovered_oregon_public_law_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: ORS 659A.030\n+# host: oregon.public.law\n+# candidate_url: https://oregon.public.law/statutes/ors_659A.030\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://oregon.public.law/statutes/ors_659A.030",
10
+ "citation_text": "ORS 659A.030",
11
+ "extraction_recipe_path": "/home/barberb/.ipfs_datasets/state_laws/source_recovery/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law_extraction_recipe.json",
12
+ "host": "oregon.public.law",
13
+ "normalized_citation": "ORS 659A.030"
14
+ },
15
+ "parent_patches": [],
16
+ "patch_id": "recovery-ors-659a-030-oregon-public-law",
17
+ "target_files": [
18
+ "ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py"
19
+ ],
20
+ "task_id": "citation-recovery:ors-659a-030",
21
+ "validated": false,
22
+ "worktree_path": null
23
+ }
source_recovery/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law.patch ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py b/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py
2
+ --- a/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py
3
+ +++ b/ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py
4
+ @@
5
+ +from typing import Any
6
+ +
7
+ +def _extract_recovered_oregon_public_law_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: ORS 659A.030
36
+ +# host: oregon.public.law
37
+ +# candidate_url: https://oregon.public.law/statutes/ors_659A.030
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/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law_extraction_recipe.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "candidate_files": [],
3
+ "citation_text": "ORS 659A.030",
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": "oregon.public.law",
6
+ "normalized_citation": "ORS 659A.030",
7
+ "patch_intent": "Add host-specific extraction/fetch support for a legal source recovered after a Hugging Face lookup miss.",
8
+ "source_url": "https://oregon.public.law/statutes/ors_659A.030",
9
+ "target_file": "ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py"
10
+ }
source_recovery/20260418_000511_ors-659a-030/recovery_manifest.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "archived_sources": [],
3
+ "candidate_files": [],
4
+ "candidates": [
5
+ {
6
+ "score": 24,
7
+ "source": "citation_url_hint",
8
+ "source_type": "current",
9
+ "title": "Oregon Revised Statutes 659A.030",
10
+ "url": "https://oregon.public.law/statutes/ors_659A.030"
11
+ },
12
+ {
13
+ "score": 22,
14
+ "source": "citation_url_hint",
15
+ "source_type": "current",
16
+ "title": "Oregon Revised Statutes chapter 659A",
17
+ "url": "https://www.oregonlegislature.gov/bills_laws/ors/ors659A.html"
18
+ }
19
+ ],
20
+ "citation_text": "ORS 659A.030",
21
+ "corpus_key": "state_laws",
22
+ "generated_at": "2026-04-18T00:05:11.900834",
23
+ "hf_dataset_id": "justicedao/ipfs_state_laws",
24
+ "normalized_citation": "ORS 659A.030",
25
+ "scraper_patch": {
26
+ "extraction_recipe_path": "/home/barberb/.ipfs_datasets/state_laws/source_recovery/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law_extraction_recipe.json",
27
+ "host": "oregon.public.law",
28
+ "patch_path": "/home/barberb/.ipfs_datasets/state_laws/source_recovery/20260418_000511_ors-659a-030/patches/recovery-ors-659a-030-oregon-public-law.patch",
29
+ "rationale": "Host-specific recovery scaffold generated from discovered candidate file.",
30
+ "target_file": "ipfs_datasets_py/processors/legal_scrapers/state_laws_scraper.py"
31
+ },
32
+ "search_backend_status": {
33
+ "archive_search_available": false,
34
+ "archive_search_error": "archive_search_skipped",
35
+ "brave_api_key_env": "",
36
+ "brave_configured": false,
37
+ "common_crawl_available": false,
38
+ "common_crawl_domain_count": 0,
39
+ "common_crawl_domains": [],
40
+ "common_crawl_error": "common_crawl_disabled",
41
+ "common_crawl_result_count": 0,
42
+ "common_crawl_used": false,
43
+ "datasets_available": true,
44
+ "duckduckgo_configured": true,
45
+ "engines_attempted": [],
46
+ "live_search_available": false,
47
+ "live_search_error": "live_search_skipped",
48
+ "live_search_skipped": true,
49
+ "multi_engine_error": "multi_engine_skipped",
50
+ "multi_engine_used": false
51
+ },
52
+ "search_query": "ORS 659A.030 OR Oregon official statutes code legislature site:.gov OR site:.us",
53
+ "state_code": "OR"
54
+ }