FU-3: re-index on content change (GAP-09) #14

Merged
chaim merged 11 commits from fix/fu3-reindex-on-change into main 2026-05-30 22:13:54 +00:00
Owner

Summary

אוכף re-index בשינוי-תוכן (INV-DM3/G6/ING4) שם ש-embedding לא יכול להיות GENERATED. מאמת מול 3+ מקורות (content-hash change detection > timestamp; RAG re-embed-on-edit).

  • גילוי שינוי: content_hash (SHA-256 של full_text, נכתב בכניסת create של case_law) + indexed_hash (ה-hash שעליו נבנו ה-embeddings הנוכחיים). stale ⇔ השניים שונים.
  • reindex_case_law(id) — re-chunk+re-embed מ-full_text שמור (בלי re-OCR — feedback_no_reocr_retrofit; בלי LLM/CLI — voyage בלבד). idempotent. מאפשר תיקון drift בלי הקובץ המקורי (42 רשומות אין להן קובץ).
  • mark_indexed מסמן indexed_hash=content_hash אחרי כל store מוצלח (בקליטה + ב-reindex).
  • drift health-check stale_embedding_case_law (אחות ל-non_searchable/stale_blocks מ-FU-2a/FU-7).
  • MCP tool precedent_reindex.
  • V23 additive (2 עמודות-hash); backfill = hash בלבד (129 רשומות, אפס re-embed, אפס עלות-API).

Boundary / scope

  • case_law בלבד (לא טבלת cases — אין לה embeddings).
  • #61.2 (multimodal backfill) נסגר כלא-ישים: 42 ההחלטות text-ingested (document_id=NULL, אין PDF בדיסק) → page-images דורשים רינדור PDF → בלתי-אפשרי.

Test Plan

  • 7 בדיקות offline (content_hash, mark_indexed, reindex wiring, missing/empty raises)
  • כל החבילה ירוקה — 100+ passed
  • smoke מול DB אמיתי: V23 (2 עמודות) + backfill (129) + 0 stale (בריא)
  • סקירת-קוד סופית: 0 Critical/Important; param-counts של ה-upserts אומתו (16→17, 14→15); reindex מאומת ללא OCR/LLM

🤖 Generated with Claude Code

## Summary אוכף re-index בשינוי-תוכן (INV-DM3/G6/ING4) שם ש-embedding לא יכול להיות GENERATED. מאמת מול 3+ מקורות (content-hash change detection > timestamp; RAG re-embed-on-edit). - **גילוי שינוי:** `content_hash` (SHA-256 של full_text, נכתב בכניסת create של case_law) + `indexed_hash` (ה-hash שעליו נבנו ה-embeddings הנוכחיים). stale ⇔ השניים שונים. - **`reindex_case_law(id)`** — re-chunk+re-embed מ-**full_text שמור** (בלי re-OCR — feedback_no_reocr_retrofit; בלי LLM/CLI — voyage בלבד). idempotent. מאפשר תיקון drift בלי הקובץ המקורי (42 רשומות אין להן קובץ). - **`mark_indexed`** מסמן indexed_hash=content_hash אחרי כל store מוצלח (בקליטה + ב-reindex). - **drift health-check** `stale_embedding_case_law` (אחות ל-non_searchable/stale_blocks מ-FU-2a/FU-7). - **MCP tool** `precedent_reindex`. - **V23** additive (2 עמודות-hash); **backfill = hash בלבד** (129 רשומות, אפס re-embed, אפס עלות-API). ## Boundary / scope - `case_law` בלבד (לא טבלת `cases` — אין לה embeddings). - **#61.2 (multimodal backfill) נסגר כלא-ישים**: 42 ההחלטות text-ingested (document_id=NULL, אין PDF בדיסק) → page-images דורשים רינדור PDF → בלתי-אפשרי. ## Test Plan - [x] 7 בדיקות offline (content_hash, mark_indexed, reindex wiring, missing/empty raises) - [x] כל החבילה ירוקה — 100+ passed - [x] smoke מול DB אמיתי: V23 (2 עמודות) + backfill (129) + 0 stale (בריא) - [x] סקירת-קוד סופית: 0 Critical/Important; param-counts של ה-upserts אומתו (16→17, 14→15); reindex מאומת ללא OCR/LLM 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 11 commits 2026-05-30 22:13:54 +00:00
content_hash/indexed_hash change detection + reindex_case_law from stored
full_text (no re-OCR) + drift health-check. Verified vs 3+ sources (content-
hash change detection, RAG re-embed-on-edit). #61.2 multimodal backfill closed:
42 rows are text-ingested (document_id NULL, no source PDF) — page-images
impossible without a PDF to render.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit fc502a6441 into main 2026-05-30 22:13:54 +00:00
chaim deleted branch fix/fu3-reindex-on-change 2026-05-30 22:13:54 +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#14