feat(halachot): canonical principles model — V41 schema + backfill (Phase 1+2) #298
Reference in New Issue
Block a user
Delete Branch "worktree-canonical-halachot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
סיכום
מימוש Phase 1+2 של מודל ההלכות הקנוניות: במקום שורת
halachotלכל (פסיקה × עיקרון), עיקרון משפטי מוגדר פעם אחת ב-canonical_halachotופסיקות שמאזכרות אותו נקשרות כ-instances.שינויים
Schema V41 (
mcp-server/src/legal_mcp/services/db.py)טבלה חדשה
canonical_halachot:canonical_statement— ניסוח קנוני (LLM-synthesized, pending_synthesis עד אישור יו"ר)rule_type,practice_areas,subject_tags,embedding(ivfflat לחיפוש similarity)review_status:pending_synthesis → pending_review → approved → publishedfirst_established_inFK → case_law (מאיזו פסיקה הוגדר העיקרון לראשונה)instance_count(denormalized)שינויים ב-
halachot:+canonical_id UUID FK → canonical_halachot(NULL עד backfill)+instance_type:original|citation|application+treatment: כיצד פסיקה זו מתייחסת לעיקרוןrule_statement+embedding→ nullable (citation instances יורשים מהקנונית)שינויים ב-
halacha_citation_corroboration(X11):+canonical_id FK → canonical_halachot— X11 יצבור ברמת-העיקרון, לא ברמת-האינסטנסstore_corroborationמאכלסcanonical_idאוטומטית דרךINSERT...SELECTפונקציות DB חדשות:
create_canonical_halacha(...)— לחילוץ Phase 3nearest_canonical_halacha(vec, threshold=0.85)— lookup-before-insert Phase 3refresh_canonical_instance_count(canonical_id)get_canonical_halacha(canonical_id)— עיקרון + רשימת instancesBackfill (
scripts/backfill_canonical_halachot.py)--applyלביצועequivalent_halachot→ connected componentshalacha_citation_corroboration.canonical_idscripts/SCRIPTS.mdbackfill_canonical_halachot.pyhalacha_batch_reconcile.py→ deprecated post-V41Invariants
equivalent_halachotdeprecated post-backfillcanonical_halachot.review_status— שער חדש לאישור עיקרוןfirst_established_in.precedent_level, לא מאוחסןcanonical_statementgrounded,pending_synthesisעד אישורתוכנית ביצוע אחרי merge
PRs הבאים
canonical_halacha_list,canonical_halacha_get)🤖 Generated with Claude Code