feat(analysis): analyze_protocol — comparative hearing-protocol analysis (WS4 #203)
מנתח פרוטוקול-דיון מול כתבי-הטענות: אילו טענות ירדו/חוזקו/עלו-חדשות + חידוד שאלות משפטיות, ומחלץ נתוני כותרת (א–ד). התוצאה נכנסת לידע-התיק. - protocol_analyzer.py — ניתוח השוואתי דרך claude_session (Opus 4.8, effort=high, מקומי בלבד); שער anti-hallucination (quote-or-retract) ב-_normalize_change; חילוץ א–ד + הזנת hearing_date חזרה ל-cases (לא דורס קלט-יו"ר). - claims_extractor: protocol → claim_type='protocol'; extract_claims קולט protocol. - block_writer._build_claims_context מחריג claim_type='protocol' מבלוק ז (INV-WR4). - db: טבלת protocol_analysis (V47, idempotent per-doc) + replace/list helpers. - tools/drafting + server: analyze_protocol + get_protocol_analysis (extract/get). - ספ 04-analysis-writing §1.3 + 15 בדיקות. Invariants: G1 (נרמול-במקור: hearing_date לעמודה הקנונית), G2 (ידע-תיק נגזר ממקור-האמת protocol+legal_arguments, לא מסלול מקביל), INV-TOOL3 (idempotent per document_id), INV-TOOL4 (extract/get symmetry), INV-AH (quote-or-retract), INV-WR4 (בלוק ז = טענות-כתב מקוריות בלבד), claude_session local-only, G12 (נקי מ-Paperclip — leak-guard עובר). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -744,6 +744,27 @@ async def get_appraiser_facts(case_number: str) -> str:
|
||||
return await drafting.get_appraiser_facts(case_number)
|
||||
|
||||
|
||||
# ── Protocol comparative analysis (WS4 / #203) — ניתוח פרוטוקול ────
|
||||
|
||||
@mcp.tool()
|
||||
async def analyze_protocol(case_number: str) -> str:
|
||||
"""ניתוח השוואתי של פרוטוקול-דיון מול כתבי-הטענות: אילו טענות ירדו/חוזקו/עלו-חדשות + חידוד-שאלות + חילוץ א–ד.
|
||||
|
||||
מזין ל"ידע-התיק" (protocol_analysis); דורש פרוטוקול doc_type='protocol' +
|
||||
טיעונים מאוגדים. Claude מקומי Opus 4.8 effort=high; re-run מחליף (idempotent).
|
||||
"""
|
||||
return await drafting.analyze_protocol(case_number)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
async def get_protocol_analysis(case_number: str, change_type: str = "") -> str:
|
||||
"""קריאת ניתוח-הפרוטוקול שכבר חולץ — ללא ניתוח-מחדש. ה-get המקביל ל-analyze_protocol.
|
||||
|
||||
change_type: dropped/strengthened/newly_raised (ריק=הכל).
|
||||
"""
|
||||
return await drafting.get_protocol_analysis(case_number, change_type)
|
||||
|
||||
|
||||
# ── Planning-schemes registry (V38) — מרשם-התכניות ─────────────────
|
||||
# SSOT לזהות+תוקף של תכנית, נעשה שימוש חוזר בין תיקים (G2). פלט-LLM נכנס
|
||||
# pending_review וממתין לאישור-יו"ר (plan_review, G10) לפני שמשמש בבלוק ט.
|
||||
|
||||
Reference in New Issue
Block a user