feat(learning): FU-2 UI — התלבטות-הפאנל במסך-אישור היו"ר (#133)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 6s

מציג את התלבטות 3-השופטים (הצבעה+נימוק לכל לינאז' + ה-verdict)
בתוך כרטיס-האישור הקיים של דפנה ב-/precedents → "ממתין לאישור",
כדי שהכרעתה — תווית-הזהב שהלולאה לומדת ממנה — תהיה מיודעת ב*למה*
הפאנל נחלק. אושר ב-Claude Design (כרטיס 18-halacha-deliberation).

Backend (opt-in, ברירת-מחדל off — קוראים קיימים לא מושפעים):
- db.list_halachot(include_panel_round=True) → _annotate_panel_rounds
  מצרף את הסבב האחרון מ-halacha_panel_rounds (DISTINCT ON, latest).
- GET /api/halachot?include_panel_round=true.

Frontend:
- Halacha.panel_round (טיפוס ידני; ה-endpoint מחזיר dict).
- תור-הסקירה (useHalachotPending) מבקש include_panel_round בשני
  הדליים (clean=keep, needsFix=nli/entailed).
- רכיב PanelDeliberation: טבלת 3-שופטים (✓נתמך/✗הכלל-חורג + נימוק),
  תג-ורדיקט "פיצול 2:1", ושורת "שורש המחלוקת" (קפדני↔תמצית) רק
  בפיצול-entailment. מוזרק אחרי רשת הכלל/ציטוט.

שער יחיד — אין עמוד/שער חדש (INV-IA/G10); display-only, לא נוגע
ב-review_status. ולידציה: py_compile + tsc --noEmit + eslint נקיים;
בדיקה פונקציונלית: panel_round מצורף ל-6 שיש להן סבב, 1994 בלי.

חלק מ-#133 (FU-2). דורש deploy + (אופ') npm run api:types אחרי.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 06:19:15 +00:00
parent 9cd290e08e
commit 9c6896df90
4 changed files with 147 additions and 6 deletions

View File

@@ -111,6 +111,21 @@ export type Halacha = {
rule_statement: string;
cosine: number | null;
}[];
/* #133/FU-2 — the latest 3-judge panel deliberation (present only when fetched
* with include_panel_round). Surfaced in the review card so the chair sees WHY
* the panel split before she decides; her decision is the gold label the
* active-learning loop learns from. Capture-only — does not affect review_status. */
panel_round?: {
question: "keep" | "entailed";
verdict: "unanimous_yes" | "unanimous_no" | "split" | "incomplete";
applied_action: string;
round_ts: string | null;
judges: {
model: "claude" | "deepseek" | "gemini";
vote: boolean | null;
reason: string;
}[];
};
};
export type RelatedCase = {
@@ -597,9 +612,11 @@ export function useHalachotPending(
) {
const { limit = 200, needsFix = false } = opts;
const qs = needsFix
? `review_status=pending_review&exclude_low_quality=false&limit=${limit}`
? `review_status=pending_review&exclude_low_quality=false`
+ `&include_panel_round=true&limit=${limit}`
: `review_status=pending_review&exclude_low_quality=true`
+ `&order_by_priority=true&cluster=true&include_equivalents=true&limit=${limit}`;
+ `&order_by_priority=true&cluster=true&include_equivalents=true`
+ `&include_panel_round=true&limit=${limit}`;
return useQuery({
queryKey: [...libraryKeys.halachotPending(), needsFix ? "needsfix" : "clean"],
queryFn: async ({ signal }) => {