fix(nevo): strip preamble/mini-ratio from court rulings too (#86.1) #56

Merged
chaim merged 1 commits from fix/nevo-preamble-court-rulings into main 2026-06-03 16:56:02 +00:00
Owner

#86.1 — anti-contamination: חיתוך preamble/מיני-רציו גם מפסקי-דין

strip_nevo_preamble's _DECISION_START זיהה רק פתיחות ועדת-ערר (בפנינו / הערר שבנדון / ...), אז פסקי-דין מנבו — בדיוק אלה שיש להם מיני-רציו — לא נחתכו. המיני-רציו דלף לגוף ה-chunked, מה שמסכן את המחלץ בקריאת "התשובון" של נבו (זיהום) ומזהם את הקורפוס. הוכח על בג"ץ 1764/05: ה-full_text שלו עדיין הכיל את המיני-רציו.

תיקון

  • הרחבת _DECISION_START בפתיחות פסקי-דין: כותרת פסק-דין/פסק דין + שורת השופט המחבר (השופט/ת, כב' השופט, הנשיא, המשנה לנשיא). re.search בוחר את התאמת-תחילת-השורה המוקדמת ביותר → תחילת חוות-הדעת האמיתית, לא הרציו שמעליה.
  • הרחבת חלון זיהוי ה-markers 400→1500 תווים, כך שכותרת בית-משפט/צדדים ארוכה לא דוחפת את חקיקה שאוזכרה:/מיני-רציו: מחוץ לטווח.

אומת

על ה-full_text האמיתי של 1764/05: נחתכים 2702 תווים, הגוף מתחיל ב-השופט ס' ג'ובראן:, המיני-רציו נעלם. רגרסיה: פתיחות ועדת-ערר עדיין נחתכות; טקסט non-Nevo ללא שינוי; markers מעבר ל-400 מזוהים כעת. מערך 182 passed (6 חדשים).

זהו התנאי-מקדים (anti-contamination) ל-Nevo-ratio gold-set (#86.3/#81.7).

🤖 Generated with Claude Code

## #86.1 — anti-contamination: חיתוך preamble/מיני-רציו גם מפסקי-דין `strip_nevo_preamble`'s `_DECISION_START` זיהה רק פתיחות **ועדת-ערר** (בפנינו / הערר שבנדון / ...), אז **פסקי-דין מנבו — בדיוק אלה שיש להם מיני-רציו — לא נחתכו**. המיני-רציו דלף לגוף ה-chunked, מה שמסכן את המחלץ בקריאת "התשובון" של נבו (זיהום) ומזהם את הקורפוס. הוכח על **בג"ץ 1764/05**: ה-full_text שלו עדיין הכיל את המיני-רציו. ### תיקון - הרחבת `_DECISION_START` בפתיחות פסקי-דין: כותרת `פסק-דין`/`פסק דין` + שורת השופט המחבר (`השופט/ת`, `כב' השופט`, `הנשיא`, `המשנה לנשיא`). `re.search` בוחר את התאמת-תחילת-השורה המוקדמת ביותר → תחילת חוות-הדעת האמיתית, לא הרציו שמעליה. - הרחבת חלון זיהוי ה-markers 400→1500 תווים, כך שכותרת בית-משפט/צדדים ארוכה לא דוחפת את `חקיקה שאוזכרה:`/`מיני-רציו:` מחוץ לטווח. ### אומת על ה-full_text האמיתי של 1764/05: נחתכים 2702 תווים, הגוף מתחיל ב-`השופט ס' ג'ובראן:`, המיני-רציו **נעלם**. רגרסיה: פתיחות ועדת-ערר עדיין נחתכות; טקסט non-Nevo ללא שינוי; markers מעבר ל-400 מזוהים כעת. מערך **182 passed** (6 חדשים). זהו התנאי-מקדים (anti-contamination) ל-Nevo-ratio gold-set (#86.3/#81.7). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-03 16:55:55 +00:00
strip_nevo_preamble's _DECISION_START only matched ועדת-ערר openings (בפנינו /
הערר שבנדון / ...), so Nevo COURT judgments — exactly the ones carrying a
מיני-רציו — slipped through unstripped. The editorial mini-ratio then leaked into
the chunked body, risking that the halacha extractor reads Nevo's answer key
(contamination) and polluting the corpus. Proven on בג"ץ 1764/05: its full_text
still contained the מיני-רציו (unstripped).

Fix:
- Extend _DECISION_START with court-ruling openings: פסק-דין/פסק דין header and
  the authoring-judge line (השופט/ת, כב' השופט, הנשיא, המשנה לנשיא). re.search
  picks the earliest line-start match → the real opinion start, not the prose
  ratio above it.
- Widen the Nevo-marker detection window 400→1500 chars so a long court/parties
  header doesn't push חקיקה שאוזכרה:/מיני-רציו: out of range.

Verified on the real 1764/05 full_text: strips 2702 chars, body now starts at
'השופט ס' ג'ובראן:', מיני-רציו gone. Regression: ועדת-ערר openings still strip;
non-Nevo text untouched; markers-past-400 now detected. Suite 182 passed (6 new).

This is the anti-contamination prerequisite for the Nevo-ratio gold-set (#86.3/#81.7).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 6dd125c491 into main 2026-06-03 16:56:02 +00:00
chaim deleted branch fix/nevo-preamble-court-rulings 2026-06-03 16:56: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#56