feat(graph): halacha (rule) layer — closes Phase 2 #137

Merged
chaim merged 1 commits from worktree-graph-halacha into main 2026-06-08 05:13:35 +00:00
Owner

סוגר את שכבת ההלכות — מפעיל את ה-toggle "הלכות" שהיה מושבת ("שלב ב׳").

כל הלכה approved/published של פסיקה בתצוגה הופכת לנקודת hal:<id> מחוברת לפסיקת-המקור (extracted_from). שתי קשתות בין-כללים כששני הקצוות בתצוגה: corroborates (פסיקה מאוחרת מאזכרת את הכלל — halacha_citation_corroboration) ו-equivalent (אותו עיקרון מוועדה אחרת — equivalent_halachot). גודל נקודה = מספר אזכורים.

Backend (read-only, G2):

  • _halacha_nodes_and_edges(): halachot WHERE case_law_id בתצוגה AND review_status IN (approved,published), LIMIT 600. rule_type ב-slot של source_kind, rule_statement ב-note. מחובר לשתי פונקציות הבנייה (מגודר ב-node_types). מטריקות עדיין מתעלמות מקשתות-הלכה. אומת: 185 הלכות על 30 הפסיקות המצוטטות; 20 corroboration + 5 equivalent בקורפוס.

Frontend:

  • toggle "הלכות" מופעל.
  • graph-canvas: נקודות-הלכה ענבר; צבעי-קשת — extracted_from (ענבר חיוור), corroborates (ענבר), equivalent (סגול).
  • graph-node-panel: ענף הלכה — אזכורים + סוג כלל + טקסט-הכלל; "פתח בספרייה" → פסיקת-המקור.
  • מקרא נקודות+קשתות עודכן.

build+lint עוברים. Invariants: G2 · UI2 (ללא שינוי מודל — שימוש חוזר ב-slots note/source_kind/case_law_id).

🤖 Generated with Claude Code

סוגר את **שכבת ההלכות** — מפעיל את ה-toggle "הלכות" שהיה מושבת ("שלב ב׳"). כל הלכה approved/published של פסיקה בתצוגה הופכת לנקודת `hal:<id>` מחוברת לפסיקת-המקור (`extracted_from`). שתי קשתות בין-כללים כששני הקצוות בתצוגה: **`corroborates`** (פסיקה מאוחרת מאזכרת את הכלל — `halacha_citation_corroboration`) ו-**`equivalent`** (אותו עיקרון מוועדה אחרת — `equivalent_halachot`). גודל נקודה = מספר אזכורים. **Backend (read-only, G2):** - `_halacha_nodes_and_edges()`: halachot WHERE case_law_id בתצוגה AND review_status IN (approved,published), LIMIT 600. rule_type ב-slot של source_kind, rule_statement ב-note. מחובר לשתי פונקציות הבנייה (מגודר ב-node_types). מטריקות עדיין מתעלמות מקשתות-הלכה. **אומת: 185 הלכות על 30 הפסיקות המצוטטות; 20 corroboration + 5 equivalent בקורפוס.** **Frontend:** - toggle "הלכות" מופעל. - `graph-canvas`: נקודות-הלכה ענבר; צבעי-קשת — extracted_from (ענבר חיוור), corroborates (ענבר), equivalent (סגול). - `graph-node-panel`: ענף הלכה — אזכורים + סוג כלל + טקסט-הכלל; "פתח בספרייה" → פסיקת-המקור. - מקרא נקודות+קשתות עודכן. build+lint עוברים. Invariants: G2 · UI2 (ללא שינוי מודל — שימוש חוזר ב-slots note/source_kind/case_law_id). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-08 05:13:29 +00:00
Enables the previously-disabled "הלכות" toggle. Each approved/published halacha
of a displayed precedent becomes a hal:<id> node linked to its parent
precedent (extracted_from); two cross-rule edges when both endpoints are in
view: corroborates (a later ruling cites the rule —
halacha_citation_corroboration) and equivalent (same principle from another
committee — equivalent_halachot). Node size = corroboration in-degree.

Backend (web/graph_api.py — read-only, G2):
- _halacha_nodes_and_edges(): halachot WHERE case_law_id in view AND
  review_status IN (approved, published), LIMIT 600; rule_type carried in the
  source_kind slot, rule_statement in note. Wired into both build functions
  (gated via node_types). Metrics still exclude halacha edges (only cites/
  precedent-typed feed PageRank). Validated: 185 halachot on the top-30
  precedents; 20 corroboration + 5 equivalent edges in the corpus.

Frontend:
- graph.ts: GraphEdgeType += extracted_from.
- graph-filter-panel: "הלכות" toggle enabled (was disabled "שלב ב׳").
- graph-canvas: amber halacha nodes; edge colours — extracted_from (faint
  amber), corroborates (amber), equivalent (violet).
- graph-node-panel: halacha branch — אזכורים + סוג כלל + rule text; "open in
  library" deep-links to the parent precedent.
- graph-view: halacha added to node + edge legends.

web-ui build + lint pass. Invariants: G2 (SELECT-only), UI2 (no model change —
reuses note/source_kind/case_law_id slots).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit de56d3b39d into main 2026-06-08 05:13:35 +00:00
chaim deleted branch worktree-graph-halacha 2026-06-08 05:13:35 +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#137