fix(citations): extract internal citations from discussion sections only (G1/G2) #313

Merged
chaim merged 1 commits from worktree-citation-sections into main 2026-06-20 13:29:42 +00:00
Owner

הבעיה

extract_and_store קרא את כל ה-full_text, כך שפסיקה שצד ציטט בטיעוניו (בלוק ז / appellant_claims / parties_claims) נרשמה כאילו הוועדה המכריעה מצטטת אותה — והופיעה כ"צוטט ע"י דפנה". דוגמה: ערר 130/10 מופיע רק בצ'אנק appellant_claims של החלטה 1200-12-25, אך יוחס לדפנה.

התיקון

בניית טקסט-החילוץ מצ'אנקי דיון/הכרעה דרך _select_extractable_chunks של מחלץ-ההלכות (G2 — הגדרה אחת של "פרקי-נימוק": legal_analysis/ruling/conclusion + עוגן-דיון, ללא facts/claims/intro). fallback ל-full_text רק לרשומות לא-מחולקות. כעת ציטוט משקף הסתמכות של הגוף-המכריע, לא טענת-צד.

נתונים קיימים (reconcile, גיבוי data/audit/citation-edges-backup-*.csv)

לכל החלטת-מקור — נמחקו קצוות שמספרם נעדר מקבוצת-הדיון: 82 מתוך 398 הוסרו (כולל ערר 130/10 ↔ 1200-12-25); 316 קצוות-אמת נשמרו.

Invariants

G1 (תיקון-במקור) · G2 (בורר-פרקי-נימוק יחיד, משותף עם חילוץ-ההלכות) · INV-LRN2 (איכות-במקור).

🤖 Generated with Claude Code

## הבעיה `extract_and_store` קרא את **כל** ה-`full_text`, כך שפסיקה שצד ציטט ב**טיעוניו** (בלוק ז / `appellant_claims` / `parties_claims`) נרשמה כאילו הוועדה המכריעה מצטטת אותה — והופיעה כ"צוטט ע"י דפנה". דוגמה: **ערר 130/10** מופיע רק בצ'אנק `appellant_claims` של החלטה **1200-12-25**, אך יוחס לדפנה. ## התיקון בניית טקסט-החילוץ מצ'אנקי **דיון/הכרעה** דרך `_select_extractable_chunks` של מחלץ-ההלכות (G2 — הגדרה אחת של "פרקי-נימוק": legal_analysis/ruling/conclusion + עוגן-דיון, ללא facts/claims/intro). fallback ל-full_text רק לרשומות לא-מחולקות. כעת ציטוט משקף הסתמכות של הגוף-המכריע, לא טענת-צד. ## נתונים קיימים (reconcile, גיבוי `data/audit/citation-edges-backup-*.csv`) לכל החלטת-מקור — נמחקו קצוות שמספרם נעדר מקבוצת-הדיון: **82 מתוך 398** הוסרו (כולל ערר 130/10 ↔ 1200-12-25); **316** קצוות-אמת נשמרו. ## Invariants G1 (תיקון-במקור) · G2 (בורר-פרקי-נימוק יחיד, משותף עם חילוץ-ההלכות) · INV-LRN2 (איכות-במקור). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-20 13:29:35 +00:00
fix(citations): extract internal citations from discussion sections only (G1/G2)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 10s
f63bd4df0f
extract_and_store read the WHOLE full_text, so a ruling a party cited in its
own arguments (block ז / appellant_claims / parties_claims) was recorded as the
deciding committee citing it — and surfaced as "צוטט ע״י דפנה". Example: ערר
130/10 appears only in the appellant_claims chunk of decision 1200-12-25, yet
was attributed to the chair.

Fix: build the extraction text from the discussion/ruling chunks via the
halacha extractor's _select_extractable_chunks (G2 — one definition of
"reasoning sections": legal_analysis/ruling/conclusion + discussion-anchor,
excluding facts/claims/intro). Falls back to full_text only for un-chunked rows.
A citation now reflects the deciding body's reliance, not a party's argument.

Existing data reconciled via a one-off (backup
data/audit/citation-edges-backup-*.csv): per source decision, dropped edges
whose cited number is absent from the discussion-only set — 82 of 398 removed
(incl. ערר 130/10 ↔ 1200-12-25); 316 genuine edges kept.

Invariants: G1 (correct at the source) · G2 (single reasoning-section selector,
shared with halacha extraction) · INV-LRN2 (quality-at-source).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit eaf80dbe9a into main 2026-06-20 13:29:42 +00:00
chaim deleted branch worktree-citation-sections 2026-06-20 13:29:42 +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#313