chore(#57): re-chunk+re-embed legacy precedents (pre-#55 remediation) #43

Merged
chaim merged 1 commits from chore/57-rechunk-legacy-precedents into main 2026-06-03 07:56:12 +00:00
Owner

סוגר את #57 — רמדיאציה מלאה של פסיקה שהוטמעה לפני תיקון ה-chunker (#55).

מה

סקריפט scripts/rechunk_legacy_precedents.py: בוחר כל case_law עם chunk זעיר (content<50 — טביעת-האצבע של ה-chunker הישן) ומריץ ingest.reindex_case_law (re-chunk+re-embed מ-full_text שמור בלבד — ללא re-OCR/LLM, feedback_no_reocr_retrofit; idempotent).

תוצאת הרצה (2026-06-03)

  • 73 תקדימים reindexed, 0 כשלונות
  • chunks זעירים: 483 → 4 (99.2%)
  • סך precedent_chunks: 5019 → 3115 (fragments מוזגו)
  • חיפוש אומת תקין (passages מהותיים וקוהרנטיים, ללא שגיאות)
  • מודל: voyage-law-2, עלות בפועל זניחה (~$0.20)

4 השאריות

כותרות-סעיף מבודדות ("דיון", "טענות המשיבים"...) שה-chunker הנוכחי מייצר — לא שאריות legacy — ומסוננות ב-query-time (≥50, #55). קצה-מקרה מינורי, מועמד ל-follow-up של #55.

מיגרציית ה-DB כבר הוחלה על prod; ה-PR הוא הסקריפט + SCRIPTS.md בלבד (אין שינוי קוד-אפליקציה, אין deploy).

🤖 Generated with Claude Code

סוגר את #57 — רמדיאציה מלאה של פסיקה שהוטמעה לפני תיקון ה-chunker (#55). ## מה סקריפט `scripts/rechunk_legacy_precedents.py`: בוחר כל `case_law` עם chunk זעיר (`content<50` — טביעת-האצבע של ה-chunker הישן) ומריץ `ingest.reindex_case_law` (re-chunk+re-embed מ-`full_text` שמור בלבד — ללא re-OCR/LLM, `feedback_no_reocr_retrofit`; idempotent). ## תוצאת הרצה (2026-06-03) - **73 תקדימים reindexed, 0 כשלונות** - chunks זעירים: **483 → 4** (99.2%) - סך `precedent_chunks`: **5019 → 3115** (fragments מוזגו) - חיפוש אומת תקין (passages מהותיים וקוהרנטיים, ללא שגיאות) - מודל: voyage-law-2, עלות בפועל זניחה (~$0.20) ## 4 השאריות כותרות-סעיף מבודדות ("דיון", "טענות המשיבים"...) שה-chunker **הנוכחי** מייצר — לא שאריות legacy — ומסוננות ב-query-time (≥50, #55). קצה-מקרה מינורי, מועמד ל-follow-up של #55. מיגרציית ה-DB כבר הוחלה על prod; ה-PR הוא הסקריפט + SCRIPTS.md בלבד (אין שינוי קוד-אפליקציה, אין deploy). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-03 07:56:03 +00:00
Adds scripts/rechunk_legacy_precedents.py: selects every case_law with a tiny
chunk (content<50 — the pre-fix chunker fingerprint) and runs
ingest.reindex_case_law (re-chunk+re-embed from stored full_text only, no
re-OCR/LLM, idempotent). Batch-idempotent (re-queries the affected set).

Run result (2026-06-03): 73 precedents reindexed, 0 failed. Tiny chunks
483 -> 4 (99.2%); total precedent_chunks 5019 -> 3115 (fragments merged).
Search verified healthy (substantial coherent passages, no errors).

The 4 residual tiny chunks are isolated section headings ('דיון',
'טענות המשיבים', ...) emitted by the CURRENT (fixed) chunker — not legacy
fragments — and are already filtered at query time (>=50, #55). Minor
chunker edge case, candidate #55 follow-up.

The DB chunk migration is already applied to prod; this commit is the script
+ SCRIPTS.md entry only (no app code change, no deploy needed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit f74fa13146 into main 2026-06-03 07:56:12 +00:00
chaim deleted branch chore/57-rechunk-legacy-precedents 2026-06-03 07:56:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ezer-mishpati/legal-ai#43