feat(proceeding-type): explicit ערר/בל"מ field for cases + corpus
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m40s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m40s
Same case_number can exist as both a regular appeal (ערר) and an extension-of-time request (בל"מ), and we were inferring the difference from appeal_subtype prefixes — fragile, and case-number lookups weren't disambiguated. Now stored as a first-class field on both case_law (corpus) and cases (live cases), with partial unique indexes on (case_number, proceeding_type). - SCHEMA_V15: column + CHECK constraints + backfill from appeal_subtype LIKE 'extension_request_%' + partial unique indexes replace the old global UNIQUE(case_number). - derive_proceeding_type() centralizes the inference rule (extension_request_* → בל"מ; subject regex fallback; default ערר). - Metadata extractor prompt asks Claude to populate the new field explicitly; apply_to_record writes it for internal_committee rows. - internal_decision_upload, case_create, case_update accept an optional proceeding_type; FastAPI request models expose it. - Wizard + edit dialog get a sided Select; case header renders the resolved label (ערר / בל"מ). - Uploaded the 2 staged בל"מ decisions on betterment levy: 8126/24 (סופר נוח, 13 chunks), 8047/23 (הרנון, 48 chunks). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
| `multimodal_backfill.py` | python | Backfill voyage-multimodal-3 page embeddings על מסמכי תיקים קיימים. idempotent (skips by default), forces `MULTIMODAL_ENABLED=true` ל-run, רץ מהקונטיינר. שלב C — ראה `docs/voyage-upgrades-plan.md` | ידני per-case (`python multimodal_backfill.py 8174-24 8137-24`) |
|
||||
| `backfill_chunk_pages.py` | python | Backfill `page_number` ב-`document_chunks` קיימים. legacy chunker לא tracked עמודים → `page_number=NULL` חוסם boost של multimodal hybrid (text+image join על אותו עמוד). re-extracts כל PDF (re-OCR אם צריך, ~$0.0015/page), מחשב page_offsets, ומעדכן chunks. idempotent | ידני per-case (`python backfill_chunk_pages.py 8174-24 8137-24`) |
|
||||
| `backfill_legal_arguments.py` | python | Backfill `legal_arguments` לתיקים עם `claims` קיימים (TaskMaster #36). מקבץ פרופוזיציות גולמיות לטיעונים משפטיים מובחנים (~6-12 לכל צד) דרך `argument_aggregator.aggregate_claims_to_arguments` (Claude CLI). תומך `--dry-run`/`--apply`/`--force`/`--case <num>...`. **חייב לרוץ מהמכונה המקומית** (לא קונטיינר) — `claude_session` דורש Claude CLI | ידני per-case (`python scripts/backfill_legal_arguments.py --apply --case 1017-03-26`) |
|
||||
| `upload_blam_decisions.py` | python | חד-פעמי (2026-05-26) — העלאת 2 החלטות בל"מ ל-`case_law` (8126/24 סופר נוח, 8047/23 הרנון) דרך `ingest_internal_decision` ישיר, עוקף MCP server שטרם נטען מחדש אחרי הוספת `proceeding_type`. **לא להריץ שוב** | חד-פעמי — להעביר ל-`.archive/` בהזדמנות |
|
||||
|
||||
## תיקיית `.archive/` — סקריפטים שהושלמו
|
||||
|
||||
|
||||
60
scripts/upload_blam_decisions.py
Normal file
60
scripts/upload_blam_decisions.py
Normal file
@@ -0,0 +1,60 @@
|
||||
"""One-shot uploader for the 2 new בל"מ decisions Chaim staged in
|
||||
data/precedents/incoming/. Bypasses MCP because the running MCP server
|
||||
was started before SCHEMA_V15 + proceeding_type wiring landed.
|
||||
|
||||
Run from /home/chaim/legal-ai with the venv:
|
||||
POSTGRES_URL=... .venv/bin/python scripts/upload_blam_decisions.py
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "mcp-server", "src"))
|
||||
|
||||
from legal_mcp.services import internal_decisions as svc
|
||||
|
||||
DECISIONS = [
|
||||
{
|
||||
"file_path": "/home/chaim/legal-ai/data/precedents/incoming/ARAR-24-8126.pdf",
|
||||
"case_number": "8126/24",
|
||||
"chair_name": "דפנה תמיר",
|
||||
"district": "ירושלים",
|
||||
"case_name": "הוועדה המקומית ירושלים נ' סופר נוח",
|
||||
"court": "ועדת הערר לתכנון ובנייה — מחוז ירושלים",
|
||||
"decision_date": "2024-07-07",
|
||||
"practice_area": "betterment_levy",
|
||||
"appeal_subtype": "extension_request_betterment_levy",
|
||||
"proceeding_type": 'בל"מ',
|
||||
"subject_tags": ["בקשה_להארכת_מועד", "היטל_השבחה"],
|
||||
"summary": "",
|
||||
"is_binding": False,
|
||||
},
|
||||
{
|
||||
"file_path": "/home/chaim/legal-ai/data/precedents/incoming/ARAR-23-8047-3.docx",
|
||||
"case_number": "8047/23",
|
||||
"chair_name": "דפנה תמיר",
|
||||
"district": "ירושלים",
|
||||
"case_name": 'עזבון אליהו הרנון ז"ל נ\' הוועדה המקומית ירושלים',
|
||||
"court": "ועדת הערר לתכנון ובנייה — מחוז ירושלים",
|
||||
"decision_date": "2025-09-29",
|
||||
"practice_area": "betterment_levy",
|
||||
"appeal_subtype": "extension_request_betterment_levy",
|
||||
"proceeding_type": 'בל"מ',
|
||||
"subject_tags": ["בקשה_להארכת_מועד", "היטל_השבחה"],
|
||||
"summary": "",
|
||||
"is_binding": False,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
async def main():
|
||||
for d in DECISIONS:
|
||||
print(f"→ uploading {d['case_number']} ({d['proceeding_type']})")
|
||||
result = await svc.ingest_internal_decision(**d)
|
||||
print(f" ✓ case_law_id={result.get('case_law_id')} chunks={result.get('chunks')}")
|
||||
print("done.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user