feat(halacha): equivalent-halacha (parallel-authority) links across precedents #100

Merged
chaim merged 1 commits from worktree-equivalent-halachot into main 2026-06-06 21:30:22 +00:00
Owner

מה ולמה

המשך ל-#84.2 — סקירת 5 הזוגות הכפולים חוצי-הפסקים העלתה שהם הישנות לגיטימית של עקרונות מבוססים, לא כפילות-שגיאה. החלטת היו"ר: להשאיר הכל + לקשר כ-parallel authority.

הממצא הקריטי: אין ולו ציטוט אחד בין הפסקים → מערכת ה-corroboration (X11) מבוססת-ציטוט בלבד; רישום שם היה מזייף נתוני-ציטוט ומנפח את corroboration_count. לכן נבנה קישור נפרד ברמת-הלכה ל-parallel authority.

  • Schema (V28): equivalent_halachot — סימטרי (halacha_a < halacha_b עם CHECK+UNIQUE), לא-ציטוט, חוצה-פסקים בלבד, ON DELETE CASCADE.
  • db.py: link_equivalent_halachot (idempotent; דוחה אותו-id ואותו-פסק), unlink, list_equivalent_for_halacha; list_halachot(include_equivalents=True)_annotate_equivalents מצרף equivalents לכל שורה (שני הכיוונים).
  • API: include_equivalents ב-GET /api/halachot; GET/POST/DELETE /api/halachot/{id}/equivalents לקישור/ביטול ידני ע"י היו"ר.
  • scripts/halacha_batch_reconcile.py: --link רושם זוגות שנמצאו כ-equivalent_halachot (לא-הרסני, idempotent).
  • web-ui: טיפוס equivalents; התור הנקי שולף include_equivalents; הכרטיס מציג תג-זהב "עיקרון מקביל ב-N" + רשימה הניתנת להרחבה (תיק + כלל + דמיון), מתויג "אסמכתה מקבילה — לא ציטוט".

אוכלסו 5 הזוגות שנסקרו (החלטת היו"ר).

Invariants — הצהרה

  • נוגע / מקיים: G1 (מידול ההישנות במקור בטבלה ייעודית, לא שימוש-לרעה בציטטור); G2 (אין מסלול מקביל — הרחבת list_halachot); שלמות הציטטור נשמרת (corroboration נשאר ציטוט-בלבד).

אימות

  • 5 שורות ב-equivalent_halachot; ה-hub 1023-20 מצרף equivalents ל-3 מהלכותיו.
  • tsc --noEmit exit 0; same-precedent guard + idempotency נבדקו.
  • build מקומי של Turbopack נחסם ע"י symlink ה-worktree — CI בונה ב-checkout נקי.

🤖 Generated with Claude Code

## מה ולמה המשך ל-#84.2 — סקירת 5 הזוגות הכפולים חוצי-הפסקים העלתה שהם **הישנות לגיטימית** של עקרונות מבוססים, **לא** כפילות-שגיאה. החלטת היו"ר: להשאיר הכל + לקשר כ-parallel authority. **הממצא הקריטי:** אין ולו ציטוט אחד בין הפסקים → מערכת ה-corroboration (X11) מבוססת-ציטוט בלבד; רישום שם היה **מזייף נתוני-ציטוט** ומנפח את `corroboration_count`. לכן נבנה קישור **נפרד** ברמת-הלכה ל-parallel authority. - **Schema (V28):** `equivalent_halachot` — סימטרי (`halacha_a < halacha_b` עם CHECK+UNIQUE), לא-ציטוט, חוצה-פסקים בלבד, ON DELETE CASCADE. - **db.py:** `link_equivalent_halachot` (idempotent; דוחה אותו-id ואותו-פסק), `unlink`, `list_equivalent_for_halacha`; `list_halachot(include_equivalents=True)` → `_annotate_equivalents` מצרף `equivalents` לכל שורה (שני הכיוונים). - **API:** `include_equivalents` ב-GET /api/halachot; GET/POST/DELETE `/api/halachot/{id}/equivalents` לקישור/ביטול ידני ע"י היו"ר. - **scripts/halacha_batch_reconcile.py:** `--link` רושם זוגות שנמצאו כ-`equivalent_halachot` (לא-הרסני, idempotent). - **web-ui:** טיפוס `equivalents`; התור הנקי שולף `include_equivalents`; הכרטיס מציג תג-זהב **"עיקרון מקביל ב-N"** + רשימה הניתנת להרחבה (תיק + כלל + דמיון), מתויג **"אסמכתה מקבילה — לא ציטוט"**. **אוכלסו 5 הזוגות שנסקרו** (החלטת היו"ר). ## Invariants — הצהרה - **נוגע / מקיים:** G1 (מידול ההישנות במקור בטבלה ייעודית, לא שימוש-לרעה בציטטור); G2 (אין מסלול מקביל — הרחבת `list_halachot`); **שלמות הציטטור נשמרת** (corroboration נשאר ציטוט-בלבד). ## אימות - 5 שורות ב-`equivalent_halachot`; ה-hub 1023-20 מצרף `equivalents` ל-3 מהלכותיו. - `tsc --noEmit` exit 0; same-precedent guard + idempotency נבדקו. - build מקומי של Turbopack נחסם ע"י symlink ה-worktree — CI בונה ב-checkout נקי. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-06 21:30:16 +00:00
Cross-precedent recurrence of a principle is real but is NOT citation
corroboration (X11) — the 5 candidate pairs have ZERO citations between their
precedents. Recording them in halacha_citation_corroboration would fabricate
citation data and inflate corroboration_count. This adds a proper, separate
halacha-level link for parallel authority.

Schema (V28): equivalent_halachot — symmetric (halacha_a < halacha_b, CHECK +
UNIQUE), non-citation, cross-precedent-only. ON DELETE CASCADE.

db.py:
- link_equivalent_halachot (idempotent; rejects same-id and SAME-precedent pairs
  — parallel authority is cross-precedent by definition), unlink, and
  list_equivalent_for_halacha.
- list_halachot gains include_equivalents → _annotate_equivalents attaches an
  `equivalents` list (both directions) per row.

API: include_equivalents on GET /api/halachot; GET/POST/DELETE
/api/halachot/{id}/equivalents for the chair to view/link/unlink manually.

scripts/halacha_batch_reconcile.py: --link records found cross-precedent pairs
as equivalent_halachot (non-destructive, idempotent).

web-ui: Halacha.equivalents type; the clean review queue fetches
include_equivalents; the review card shows a gold "עיקרון מקביל ב-N" badge + an
expandable list (case + rule + similarity) labeled "אסמכתה מקבילה — לא ציטוט".

Populated the 5 reviewed pairs (chair decision: keep all + link as parallel
authority). Verified: 5 rows; the 1023-20 hub annotates 3 of its halachot with
equivalents; tsc --noEmit exits 0.

Invariants: G1 (model recurrence at source in its own table, not by abusing the
citator); G2 (no parallel path — extends list_halachot); citator integrity
preserved (corroboration stays citation-only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 9bd247c421 into main 2026-06-06 21:30:22 +00:00
chaim deleted branch worktree-equivalent-halachot 2026-06-06 21:30:22 +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#100