feat(halacha): #86.2 nevo-leak audit + safe ratio backfill · #86.3 ratio-coverage benchmark
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 5s
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 5s
#86.2 — scripts/nevo_corpus_audit.py leak: סורק chunks+הלכות למרקרי-preamble של נבו (מיובאים מ-extractor._NEVO_MARKERS — מקור-אמת יחיד), מבחין בין הווקטור המזיק (מרקר בתוך הלכה = רציו-עריכה שזוהה כהלכה) ל-benign (chunk עם רשימת-ציטוטים). **ממצא חי: 0/~1650 הלכות מזוהמות** — שכבת-הידע נקייה (שערי-האיכות של #81 מנעו זאת). לכן **אין purge/re-ingest** (גם כי re-OCR retrofit נוגד-עיקרון, feedback_no_reocr_retrofit; וצ'אנקי-ציטוטים benign). `leak --apply` עושה backfill **אדיטיבי** של case_law.nevo_ratio מ-full_text השמור (extract_nevo_ratio, דטרמיניסטי, ללא re-OCR, לא נוגע בצ'אנקים/הלכות) — "לשמור במקום למחוק". הורץ: 16→32 פסקים עם רציו שמור. #86.3 — benchmark: לפסקים עם nevo_ratio, הפאנל התלת-מודלי שופט אילו עקרונות-רציו מכוסים ע"י ההלכות שלנו → recall. smoke: 1110-20 (13 הלכות) recall=1.0 (כיסוי מלא); פסקים עם 0 הלכות → recall=0 (אות-פער-חילוץ אמיתי, לא כשל-כיסוי). מזין את אות-האיכות של #81.7. invariants: G2 (מרקרים+strip מיובאים מ-extractor; פאנל מ-halacha_panel_approve) · INV-G10 (read-only/אדיטיבי; אין מחיקה) · no-reocr (backfill מטקסט שמור, לא חילוץ-מחדש). tests: 6 offline (_has_marker/_has_editorial) + nevo_preamble קיים. אומת חי. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
29
mcp-server/tests/test_nevo_corpus_audit.py
Normal file
29
mcp-server/tests/test_nevo_corpus_audit.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Tests for #86.2 — pure marker classifiers in scripts/nevo_corpus_audit.py.
|
||||
|
||||
Distinguishes the harmful editorial-ratio markers (מיני-רציו / מבזק) from benign
|
||||
Nevo citation-list markers (חקיקה שאוזכרה / ספרות). Offline.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "scripts"))
|
||||
import nevo_corpus_audit as n # noqa: E402
|
||||
|
||||
|
||||
def test_has_marker_detects_any_nevo_marker():
|
||||
assert n._has_marker("חקיקה שאוזכרה: חוק התכנון והבניה")
|
||||
assert n._has_marker("מיני-רציו: העותר לא הוכיח")
|
||||
assert not n._has_marker("פסק-דין רגיל ללא מטא-דאטה של נבו")
|
||||
|
||||
|
||||
def test_has_editorial_only_for_holdings_markers():
|
||||
# editorial = the harmful family (a holdings summary that could be mistaken
|
||||
# for our own extracted holding)
|
||||
assert n._has_editorial("מיני-רציו: ...")
|
||||
assert n._has_editorial("מבזק: בית המשפט קבע")
|
||||
# a bare citation list is NOT editorial — benign
|
||||
assert not n._has_editorial("חקיקה שאוזכרה: חוק התכנון והבניה, סע' 197")
|
||||
assert not n._has_editorial("פסקי דין שאוזכרו: בר\"מ 2340/02")
|
||||
Reference in New Issue
Block a user