FU-1: איחוד מסלול-הקליטה למסלול קנוני אחד (GAP-01/02/04/05) #11

Merged
chaim merged 9 commits from fix/fu1-unified-ingest into main 2026-05-30 19:37:34 +00:00
Owner

Summary

מאחד את שני מסלולי ה-ingest המקבילים (ingest_precedent / ingest_internal_decision) למסלול קנוני יחיד services/ingest.py.

  • GAP-01 — פייפליין קנוני יחיד ingest_document(spec, ...) (Template Method); וריאציה לפי-סוג ב-IntakeSpec. שתי הפונקציות הציבוריות נשארות wrappers דקים — חתימות נשמרו, אפס שינוי לקוראים.
  • GAP-02 — המסלול הפנימי מתזמן עכשיו גם metadata extraction; צעד-חסר נעשה בלתי-אפשרי מבנית.
  • GAP-04 — ולידציית enums אחידה לשני הסוגים.
  • GAP-05 — staging/derivation/citation-guard/multimodal/fallback מאוחדים.

מספק INV-ING1/ING3/G2/G4.

גבולות

  • גבול FU-2 נקי: ה-DB-create נשאר נפרד (מנותב דרך spec.create_record). אין מיגרציה (0/56 internal חסרי-metadata).
  • אילוץ claude_session נשמר (אין import של מחלצי-LLM).
  • ההכרעה האדריכלית אומתה מול ≥3 מקורות. ספק: docs/superpowers/specs/2026-05-30-fu1-unified-ingest-design.md
  • 42 החלטות-ועדה חסרות multimodal → TaskMaster #61.2 (FU-3).

Security

path-traversal שסומן ב-review: לא רגרסיה (verbatim מהישן), לא נצפה (file_path הוא server-controlled), תיקון ALLOWED_ROOT היה שובר workflow — מחוץ להיקף.

Test Plan

  • 9 בדיקות offline חדשות (כולל regression GAP-02)
  • כל החבילה ירוקה — 77 passed
  • smoke-import, חתימות ציבוריות נשמרו
  • סקירת-קוד סופית עברה; 2 הערות תוקנו

🤖 Generated with Claude Code

## Summary מאחד את שני מסלולי ה-ingest המקבילים (`ingest_precedent` / `ingest_internal_decision`) למסלול קנוני יחיד `services/ingest.py`. - **GAP-01** — פייפליין קנוני יחיד `ingest_document(spec, ...)` (Template Method); וריאציה לפי-סוג ב-`IntakeSpec`. שתי הפונקציות הציבוריות נשארות wrappers דקים — חתימות נשמרו, אפס שינוי לקוראים. - **GAP-02** — המסלול הפנימי מתזמן עכשיו גם metadata extraction; צעד-חסר נעשה בלתי-אפשרי מבנית. - **GAP-04** — ולידציית enums אחידה לשני הסוגים. - **GAP-05** — staging/derivation/citation-guard/multimodal/fallback מאוחדים. מספק INV-ING1/ING3/G2/G4. ## גבולות - גבול FU-2 נקי: ה-DB-create נשאר נפרד (מנותב דרך `spec.create_record`). אין מיגרציה (0/56 internal חסרי-metadata). - אילוץ claude_session נשמר (אין import של מחלצי-LLM). - ההכרעה האדריכלית אומתה מול ≥3 מקורות. ספק: docs/superpowers/specs/2026-05-30-fu1-unified-ingest-design.md - 42 החלטות-ועדה חסרות multimodal → TaskMaster #61.2 (FU-3). ## Security path-traversal שסומן ב-review: לא רגרסיה (verbatim מהישן), לא נצפה (file_path הוא server-controlled), תיקון ALLOWED_ROOT היה שובר workflow — מחוץ להיקף. ## Test Plan - [x] 9 בדיקות offline חדשות (כולל regression GAP-02) - [x] כל החבילה ירוקה — 77 passed - [x] smoke-import, חתימות ציבוריות נשמרו - [x] סקירת-קוד סופית עברה; 2 הערות תוקנו 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 9 commits 2026-05-30 19:30:50 +00:00
Design for unifying the two parallel ingest paths (ingest_precedent /
ingest_internal_decision) into one canonical pipeline parameterized by an
IntakeSpec config object — Template Method skeleton + Strategy injection.
Closes the GAP-02 root cause (missing metadata queue on internal path) by
making a skipped step structurally impossible.

Architecture choice verified against 3+ authoritative sources (refactoring.guru
Template-Method/Replace-Conditional, Fowler FlagArgument, Strategy pattern).
DB check (2026-05-30): no migration needed — 0/56 internal rows lack metadata,
0 invalid enums; multimodal backfill (42 rows) tracked as TaskMaster #61.2 / FU-3.

Covers GAP-01/02/04/05 · provides INV-ING1/ING3/G2/G4 · TaskMaster #59.

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>
pipeline always queues both extraction kinds (INV-ING3); remove the
now-meaningless queue_halachot param from ingest_internal_decision and
migrate_from_style_corpus. Also trim chunker/extractor/rerank from the
precedent_library module-top import (chunking/extraction moved to ingest.py).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 44ae739031 into main 2026-05-30 19:37:34 +00:00
chaim deleted branch fix/fu1-unified-ingest 2026-05-30 19:37:34 +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#11