feat(halachot): חיפוש/איתור בתור-ההלכות + הערת חלון-תצוגה (פסיקה מחוץ ל-500 נגישה)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 3s
Lint — undefined names / undefined-names (pull_request) Successful in 10s

תור-ההלכות שלף רק 500 ממתינות בעלות-עדיפות מתוך ~1,372, בלי שום דרך
לאתר פס"ד מסוים. הלכה מדורגת מתחת לחלון (למשל 1180-11-25, מקומות 921/1305)
פשוט נעלמה — הספירה בספרייה הציגה "2 ממתינות" אך התור לא הראה אותן.

- list_halachot: פרמטר search (case_number/case_name/rule_statement, ILIKE)
  — סינון בצד-השרת כך שפריט מתחת לחלון נשאר נגיש. מרחיב את מסלול-השליפה
  היחיד, לא יוצר מסלול מקביל (G2).
- count_halachot: ספירה מלאה לאותו פילטר (ל-"N מתוך TOTAL").
- /api/halachot: search + with_total (ברירת-מחדל off; קוראים קיימים לא מושפעים).
- UI (תור-הלכות): שורת-חיפוש מהוקצבת (debounce 300ms), הערת "חלון התצוגה"
  (500 מתוך הסך), ושורת-הקשר-תוצאה עם ניקוי. בחיפוש — כל הקבוצות התואמות
  נפתחות; הניווט המקלדתי והשערים (G10) ללא שינוי.

מאומת מול ה-DB: search='1180-11-25' → 2 הממתינות (index 20 נקייה→להכרעתך,
index 23 nli_unsupported→דורש תיקון-חילוץ); count=2.

עיצוב: עבר שער Claude Design (X17, כרטיס 19-halacha-queue-unified) ואושר.
Invariants: מקיים G2 (מסלול-שליפה יחיד), INV-G10 (שער-יו"ר ללא שינוי),
INV-IA (מקור-אמת יחיד לתור). ללא בליעת-שגיאות.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 03:58:46 +00:00
parent b4cb0a69c3
commit 896df0cb8c
4 changed files with 165 additions and 15 deletions

View File

@@ -7292,14 +7292,19 @@ async def halachot_list(
cluster: bool = False,
include_equivalents: bool = False,
include_panel_round: bool = False,
search: str = "",
with_total: bool = False,
):
"""List halachot. ``exclude_low_quality`` hides flagged items (#84.1),
``order_by_priority`` switches to the active-learning order (#84.3),
``cluster`` annotates near-duplicate groups for one-card review (#84.2),
``include_equivalents`` attaches cross-precedent parallel-authority links, and
``include_panel_round`` attaches the latest 3-judge panel deliberation so the
chair sees why the panel split (#133/FU-2). All default off so existing callers
are unaffected; the review queue opts in."""
chair sees why the panel split (#133/FU-2). ``search`` locates a pending
halacha by case_number / case_name / rule text server-side (so an item below
the display window stays reachable); ``with_total`` adds the full filter count
so the UI can show "N of TOTAL". All default off so existing callers are
unaffected; the review queue opts in."""
cid: UUID | None = None
if case_law_id:
try:
@@ -7316,8 +7321,17 @@ async def halachot_list(
cluster=cluster,
include_equivalents=include_equivalents,
include_panel_round=include_panel_round,
search=search or None,
)
return {"items": rows, "count": len(rows)}
resp: dict = {"items": rows, "count": len(rows)}
if with_total:
resp["total"] = await db.count_halachot(
review_status=review_status or None,
practice_area=practice_area or None,
exclude_low_quality=exclude_low_quality,
search=search or None,
)
return resp
class EquivalentLinkRequest(BaseModel):