feat(halachot): canonical lookup-before-insert + MCP tools (Phase 3+4, V41)
store_halachot_for_chunk: לפני כל INSERT — חיפוש cosine ב-canonical_halachot (≥0.85). עיקרון קיים → instance_type='citation' (אין canonical חדש). עיקרון חדש → instance_type='original' + יצירת canonical אוטומטית + עדכון instance_count. config: HALACHA_CANONICAL_LOOKUP_ENABLED=true, HALACHA_CANONICAL_THRESHOLD=0.85. db.list_halachot: פרמטר instance_type חדש לסינון. db.list_canonical_halachot: שאילתת רשימה לפי practice_area/status. db.update_canonical_statement: עדכון ניסוח קנוני ע"י היו"ר. tools/precedent_library.py: halachot_pending: ברירת-מחדל instance_type='original' (תור ריאלי). halacha_review: פרמטר canonical_statement חדש (עריכת ניסוח העיקרון). canonical_halacha_list: כלי MCP חדש — רשימת עקרונות קנוניים. canonical_halacha_get: כלי MCP חדש — עיקרון + אינסטנסים. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -427,18 +427,42 @@ async def halacha_review(
|
||||
reasoning_summary: str = "",
|
||||
subject_tags: list[str] | None = None,
|
||||
practice_areas: list[str] | None = None,
|
||||
canonical_statement: str = "",
|
||||
) -> str:
|
||||
"""אישור / דחייה / עריכה של הלכה שחולצה אוטומטית. status: pending_review / approved / rejected / published."""
|
||||
"""אישור / דחייה / עריכה של הלכה שחולצה אוטומטית. status: pending_review / approved / rejected / published.
|
||||
canonical_statement: עריכת ניסוח העיקרון הקנוני הרחב (V41)."""
|
||||
return await plib.halacha_review(
|
||||
halacha_id, status, reviewer, rule_statement, reasoning_summary,
|
||||
subject_tags, practice_areas,
|
||||
subject_tags, practice_areas, canonical_statement,
|
||||
)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
async def halachot_pending(limit: int = 100) -> str:
|
||||
"""תור ההלכות הממתינות לאישור."""
|
||||
return await plib.halachot_pending(_clamp_limit(limit))
|
||||
async def halachot_pending(
|
||||
limit: int = 100,
|
||||
include_low_quality: bool = False,
|
||||
instance_type: str = "original",
|
||||
) -> str:
|
||||
"""תור ההלכות הממתינות לאישור. V41: ברירת-מחדל instance_type='original' (עקרונות חדשים בלבד, לא ציטוטים)."""
|
||||
return await plib.halachot_pending(_clamp_limit(limit), include_low_quality, instance_type)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
async def canonical_halacha_list(
|
||||
practice_area: str = "",
|
||||
review_status: str = "",
|
||||
limit: int = 50,
|
||||
offset: int = 0,
|
||||
) -> str:
|
||||
"""רשימת עקרונות קנוניים (canonical_halachot). V41.
|
||||
practice_area: סינון תחום עיסוק. review_status: pending_synthesis/pending_review/approved/published."""
|
||||
return await plib.canonical_halacha_list(practice_area, review_status, limit, offset)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
async def canonical_halacha_get(canonical_id: str) -> str:
|
||||
"""שלוף עיקרון קנוני + כל האינסטנסים שלו לפי פסיקה. V41."""
|
||||
return await plib.canonical_halacha_get(canonical_id)
|
||||
|
||||
|
||||
# Documents
|
||||
|
||||
Reference in New Issue
Block a user