feat(learning): FU-3 — uncertainty-sampling של תור-האישור לפי מחלוקת-הפאנל (#133)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 6s
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 6s
תור-אישור-ההלכות הקיים (order_by_priority, #84.3) מקדם עכשיו את ההלכות שהפאנל התלבט עליהן: split קודם, אחר-כך incomplete — התוויות בעלות-הערך הגבוה ביותר ללולאת-הלמידה (הכרעת-היו"ר מפרקת אי-ודאות אמיתית ומזינה את זיקוק-ה-rubric ב-FU-4). uncertainty-sampling על סיגנל-המחלוקת האמיתי של הפאנל, לא רק confidence-החילוץ. - list_halachot: LEFT JOIN לאחרון-הסבבים (DISTINCT ON latest round_ts מ- halacha_panel_rounds) + מפתח-מיון ראשי CASE verdict split→0/incomplete→1/ else→2, לפני מפתחות #84.3 (corroboration→confidence→age). סבבים פה-אחד ופריטים-ללא-סבב נשארים בזנב עם הסדר הקיים. - panel_verdict נחשף בכל שורה (UI יכול לתייג "פיצול" + ביקורת-סדר). - שימוש חוזר בדגל order_by_priority הקיים ובטאב הקיים — בלי מסלול/דגל מקביל (G2). ה-UI כבר מבקש order_by_priority=true → אפס שינוי-UI, אין צורך בשער-עיצוב. - test_halacha_priority_panel_order.py: 3 בדיקות offline (SQL-capture) — מפתח-מחלוקת ראשי בעדיפות, FIFO ללא דליפת-CASE, panel_verdict נבחר. Invariants: INV-G10 (capture-only, לא משנה review_status) · G1/G2 · INV-IA (אותו שער/טאב). רגרסיה: 76 בדיקות עברו. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4474,9 +4474,12 @@ async def list_halachot(
|
||||
truncated_quote / quote_unverified / non_decision / thin_restatement /
|
||||
nli_unsupported / near_duplicate). These belong in a 'needs extraction
|
||||
fix' bucket, not the chair's approve queue (#84.1).
|
||||
order_by_priority — replace FIFO with an active-learning order (#84.3):
|
||||
negatively-treated first, then most-uncertain (lowest confidence), then
|
||||
oldest — so the chair sees the highest-value decisions first.
|
||||
order_by_priority — replace FIFO with an active-learning order (#84.3, #133/FU-3):
|
||||
panel-disagreement first (the panel SPLIT, then ran INCOMPLETE — the
|
||||
labels of highest learning value: the chair's call resolves a genuine
|
||||
ambiguity and feeds rubric distillation, FU-4), then negatively-treated,
|
||||
then most-uncertain (lowest confidence), then oldest. Uncertainty-sampling
|
||||
on the panel's real disagreement signal, not just extraction confidence.
|
||||
cluster — annotate each row with ``cluster_id`` + ``cluster_size`` (#84.2):
|
||||
same-precedent halachot within HALACHA_CLUSTER_COSINE form one group so
|
||||
the UI can collapse near-identical principles into a single review card.
|
||||
@@ -4501,9 +4504,15 @@ async def list_halachot(
|
||||
# a clean item has an empty/NULL quality_flags array
|
||||
conditions.append("COALESCE(array_length(h.quality_flags, 1), 0) = 0")
|
||||
where_sql = f"WHERE {' AND '.join(conditions)}" if conditions else ""
|
||||
# #133/FU-3: rank the panel's latest verdict so splits/incompletes — the
|
||||
# highest-value active-learning labels — float to the top of the queue.
|
||||
# 'split' (genuine 1-1 disagreement) before 'incomplete' (a judge failed,
|
||||
# less informative); unanimous rounds and not-yet-judged items share the
|
||||
# tail and keep the #84.3 ordering among themselves.
|
||||
order_sql = (
|
||||
"ORDER BY corroboration_negative DESC, h.confidence ASC NULLS LAST, "
|
||||
"h.created_at ASC"
|
||||
"ORDER BY (CASE pr.verdict WHEN 'split' THEN 0 WHEN 'incomplete' THEN 1 "
|
||||
"ELSE 2 END) ASC, corroboration_negative DESC, "
|
||||
"h.confidence ASC NULLS LAST, h.created_at ASC"
|
||||
if order_by_priority
|
||||
else "ORDER BY h.case_law_id, h.halacha_index"
|
||||
)
|
||||
@@ -4518,7 +4527,8 @@ async def list_halachot(
|
||||
cl.case_number, cl.case_name, cl.court, cl.date AS decision_date,
|
||||
cl.precedent_level,
|
||||
COALESCE(cor.corroboration_count, 0)::int AS corroboration_count,
|
||||
COALESCE(cor.corroboration_negative, false) AS corroboration_negative
|
||||
COALESCE(cor.corroboration_negative, false) AS corroboration_negative,
|
||||
pr.verdict AS panel_verdict
|
||||
FROM halachot h
|
||||
LEFT JOIN case_law cl ON cl.id = h.case_law_id
|
||||
LEFT JOIN (
|
||||
@@ -4533,6 +4543,11 @@ async def list_halachot(
|
||||
FROM halacha_citation_corroboration
|
||||
GROUP BY halacha_id
|
||||
) cor ON cor.halacha_id = h.id
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (halacha_id) halacha_id, verdict
|
||||
FROM halacha_panel_rounds
|
||||
ORDER BY halacha_id, round_ts DESC
|
||||
) pr ON pr.halacha_id = h.id
|
||||
{where_sql}
|
||||
{order_sql}
|
||||
LIMIT ${idx} OFFSET ${idx + 1}
|
||||
|
||||
Reference in New Issue
Block a user