feat(precedents): surface auto-detected incoming citations in the "ציטוטים מקושרים" panel #317

Merged
chaim merged 1 commits from worktree-incoming-citations-panel into main 2026-06-20 14:55:02 +00:00
Owner

בעיה

דף-התקדים מציג פאנל "ציטוטים מקושרים", אבל הוא רינדר רק קישורים ידניים (שרשרת-ערעור, case_law_relations). גרף-הציטוטים האוטומטי (precedent_internal_citations) — מי שמצטט את התקדים — מעולם לא הוצג. לכן הפאנל נשאר ריק גם כשהנתון קיים: לדוגמה עע"מ 317/10 (שפר) עם 12 ציטוטים נכנסים ב-DB, אף אחד לא הוצג.

פתרון (נתון/לוגיקה בלבד — פטור משער-העיצוב לפי web-ui/AGENTS.md)

ממלא את הפאנל הקיים מגרף-הציטוטים, בלי עיצוב חדש:

  • citation_extractor.list_citations_to_case_law — מחזיר גם precedent_level/court/date של ההחלטה-המצטטת (additive; שאילתה קנונית אחת, ללא מסלול-פתרון מקביל — G2).
  • precedent_library.get_precedent — מוסיף incoming_citations[] בצורת שורת-RelatedCase.
  • web-ui — מרנדר את הציטוטים-הנכנסים באותו סגנון-שורה, read-only (ללא הסרת-קישור), de-duped מול קישורים ידניים. הקישור-הידני ("קשר") נשמר לצידם.

אימות

  • בדיקה פונקציונלית מול ה-DB החי: get_precedent(שפר) → 12 incoming_citations בצורה תקינה.
  • tsc --noEmit + eslint על הקבצים שהשתנו — נקי.

Invariants

  • G2 — שימוש-חוזר בשאילתת-הציטוטים-הנכנסים הקנונית; אין מסלול מקביל.
  • G1 — הגרף מרפא-עצמו דרך relink_orphan_citations הקיים בקליטה.
  • ללא שינוי-סכמה. ללא endpoint חדש (שדה נוסף לתגובת /api/precedent-library/{id} שכבר מוחזרת כ-dict; ה-type ב-frontend hand-written, אין צורך ב-api:types).

🤖 Generated with Claude Code

## בעיה דף-התקדים מציג פאנל "ציטוטים מקושרים", אבל הוא רינדר **רק קישורים ידניים** (שרשרת-ערעור, `case_law_relations`). גרף-הציטוטים האוטומטי (`precedent_internal_citations`) — מי שמצטט את התקדים — מעולם לא הוצג. לכן הפאנל נשאר ריק גם כשהנתון קיים: לדוגמה **עע"מ 317/10 (שפר)** עם **12 ציטוטים נכנסים** ב-DB, אף אחד לא הוצג. ## פתרון (נתון/לוגיקה בלבד — פטור משער-העיצוב לפי `web-ui/AGENTS.md`) ממלא את הפאנל הקיים מגרף-הציטוטים, בלי עיצוב חדש: - `citation_extractor.list_citations_to_case_law` — מחזיר גם `precedent_level`/`court`/`date` של ההחלטה-המצטטת (additive; **שאילתה קנונית אחת**, ללא מסלול-פתרון מקביל — G2). - `precedent_library.get_precedent` — מוסיף `incoming_citations[]` בצורת שורת-`RelatedCase`. - `web-ui` — מרנדר את הציטוטים-הנכנסים באותו סגנון-שורה, **read-only** (ללא הסרת-קישור), de-duped מול קישורים ידניים. הקישור-הידני ("קשר") נשמר לצידם. ## אימות - בדיקה פונקציונלית מול ה-DB החי: `get_precedent(שפר)` → 12 `incoming_citations` בצורה תקינה. - `tsc --noEmit` + `eslint` על הקבצים שהשתנו — נקי. ## Invariants - **G2** — שימוש-חוזר בשאילתת-הציטוטים-הנכנסים הקנונית; אין מסלול מקביל. - **G1** — הגרף מרפא-עצמו דרך `relink_orphan_citations` הקיים בקליטה. - ללא שינוי-סכמה. ללא endpoint חדש (שדה נוסף לתגובת `/api/precedent-library/{id}` שכבר מוחזרת כ-dict; ה-type ב-frontend hand-written, אין צורך ב-`api:types`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-20 14:54:48 +00:00
feat(precedents): surface auto-detected incoming citations in the "ציטוטים מקושרים" panel
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 10s
91c521922f
The precedent-detail "ציטוטים מקושרים" panel rendered only MANUAL appeal-chain
links (case_law_relations), so it stayed empty even when decisions cite the
ruling — the automatic citation graph (precedent_internal_citations) was never
surfaced. e.g. עע"מ 317/10 (שפר) has 12 incoming citations in the DB, none shown.

Fills the existing panel from the citation graph (data/logic only, no new
visual design — gate-exempt per web-ui/AGENTS.md):
- citation_extractor.list_citations_to_case_law: return source precedent_level/
  court/date too (additive; reuses the one canonical incoming query — G2).
- precedent_library.get_precedent: add incoming_citations[], shaped like the
  RelatedCase row. No parallel resolution path.
- web-ui: render incoming citations in the same row style, read-only (no unlink),
  de-duped against manual links; manual "קשר" linking preserved alongside.

Invariants: G2 (single citation-resolution path, reused), G1 (graph self-heals
via existing relink_orphan_citations on upload). No schema change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 2c515966c5 into main 2026-06-20 14:55:02 +00:00
chaim deleted branch worktree-incoming-citations-panel 2026-06-20 14:55:02 +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#317