All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 43s
After the proceeding_type field landed, users started flipping cases to בל"מ via the edit dialog. But the case-header badge + cases-table filter were still gated on isBlamSubtype(appeal_subtype), so the badge didn't appear when only the proceeding_type changed. Now the badge shows when either proceeding_type === 'בל"מ' OR appeal_subtype is an extension_request_* variant — the legacy path stays so existing rows that never got a proceeding_type still render correctly. Also regen types.ts from prod (proceeding_type now in OpenAPI schema) and register the one-shot process_pending_blam.py script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
1.7 KiB
Python
54 lines
1.7 KiB
Python
"""One-shot: run pending metadata + halacha extraction on the 2 בל"מ
|
|
decisions uploaded today (8126/24 + 8047/23). Bypasses MCP because the
|
|
running MCP server has stale code; calls the services directly with the
|
|
updated local copy.
|
|
|
|
Run from /home/chaim/legal-ai with the venv:
|
|
POSTGRES_URL=... .venv/bin/python scripts/process_pending_blam.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 db
|
|
from legal_mcp.services import precedent_library
|
|
|
|
|
|
async def main():
|
|
# Queue metadata extraction too (ingest_internal_decision only queues
|
|
# halacha; metadata fills headnote/summary/key_quote and now also
|
|
# confirms proceeding_type via the new prompt field).
|
|
pool = await db.get_pool()
|
|
async with pool.acquire() as conn:
|
|
rows = await conn.fetch(
|
|
"SELECT id, case_number FROM case_law "
|
|
"WHERE case_number IN ('8126/24','8047/23') "
|
|
" AND source_kind = 'internal_committee'"
|
|
)
|
|
for r in rows:
|
|
await conn.execute(
|
|
"UPDATE case_law SET metadata_extraction_requested_at = NOW() "
|
|
"WHERE id = $1",
|
|
r["id"],
|
|
)
|
|
print(f"queued metadata for {r['case_number']} ({r['id']})")
|
|
|
|
print("\n→ running metadata extraction…")
|
|
meta_result = await precedent_library.process_pending_extractions(
|
|
kind="metadata", limit=10,
|
|
)
|
|
print(meta_result)
|
|
|
|
print("\n→ running halacha extraction…")
|
|
halacha_result = await precedent_library.process_pending_extractions(
|
|
kind="halacha", limit=10,
|
|
)
|
|
print(halacha_result)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|