From 36bae6c5923e94ef59f1f25ba9f935ee4b2b547c Mon Sep 17 00:00:00 2001 From: Chaim Date: Thu, 11 Jun 2026 20:47:32 +0000 Subject: [PATCH] =?UTF-8?q?fix(ia):=20IA=20=D7=92=D7=9C-1=20=E2=80=94=20?= =?UTF-8?q?=D7=A1=D7=A0=D7=9B=D7=A8=D7=95=D7=9F-cache=20+=20=D7=A0=D7=AA?= =?UTF-8?q?=D7=95=D7=A0=D7=99=D7=9D-=D7=A9=D7=92=D7=95=D7=99=D7=99=D7=9D?= =?UTF-8?q?=20+=20=D7=9E=D7=97=D7=99=D7=A7=D7=AA-=D7=9E=D7=AA=D7=99=D7=9D?= =?UTF-8?q?=20(#130,=20X17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit גל-1 מבקלוג #127 (docs/ia-audit-redesign.md §4) — תיקון מקומי, ללא הגירת-IA. מקיים G2 בשכבת-ה-UI דרך INV-IA1/IA2/IA5/IA6 (docs/spec/X17). א) פערי-סנכרון (INV-IA2 — mutation מבטל כל קורא): - CAS-1/2: העלאת-DOCX/export מבטלים ['decision-blocks'] (מחוון source_of_truth) - APR-1/4: פתרון/יצירת-הערה מבטלים ['chair','pending'] (תיבה+תג-סרגל) - APR-5/ADM-2: אישור/batch הלכות מבטלים ['chair','pending']+['operations'] - APR-6/ADM-3: create/update/delete/upload פסיקה-חסרה מבטלים שניהם - LRN-6: ComparePanel גוזר בחירה מהקורפוס המרוענן (אין POST ל-id מחוק → 404) - LRN-8: מחיקת-קורפוס מבטלת רשימת-צ'אטים (chat שהתייתם לא נשאר עם קישור-קורפוס תקוע) - LRN-10/MET-1/MET-8: promote מבטל גם lessons וגם methodology (LessonsTab+/methodology) ב) נתונים-שגויים (INV-IA5 — סטטוס מגובה-צרכן): - LRN-4: KPI "דפוסי סגנון" — הוסר היחס-השקרי "מתוך total_patterns" (שאילתות עצמאיות) - LRN-5: findings_applied (דגל אינפורמטיבי-בלבד) → findings_approved (שער INV-LRN1 האמיתי) - ADM-1: halacha_backlog שהוחזר ונזרק → מרונדר ב-/diagnostics, מצביע ל-/approvals (INV-IA1) - ADM-6: מוני-סוכנים מסמנים "חלקי+" כשחברת-Paperclip לא נטענה - APR-3: מכוסה ע"י APR-1 (count+sample מאותה שאילתה; הבעיה היתה staleness-cache) - MET-6: עורך-צ'קליסטים מציג איזה case בוחר כל צ'קליסט (explainer-תחולה) - ADM-5: ערך-Container מסומן "ממתין ל-redeploy" כש-Coolify≠Container ג) מתים/jargon: - PRE-2: הוסר GET /api/precedent-library/queue/pending (אפס צרכני-frontend) - PRE-3/5: AuthorityBadge (binding/persuasive) מרונדר גם בחיפוש, לא רק בתור-הביקורת - MET-5: הוסר ז'רגון T7/T15 מטקסט-העזר ב-/methodology (INV-IA6) Invariants: מקיים INV-IA1/IA2/IA5/IA6 (X17), G2 (מקור-אמת יחיד בשכבת-UI), G10 (לא הוסר שום שער-אנושי — רק סנכרון/נתון/קוד-מת). שומר INV-LRN1. בדיקות: py_compile web/app.py ✓ · tsc --noEmit ✓ · eslint ✓ (לבד מ-learning-panel:109 unescaped-quote — קיים-מראש ב-main, מחוץ לסט-הממצאים). next build נכשל רק בגלל symlink node_modules ב-worktree (Turbopack) — ה-build ב-Docker/CI תקין. Co-Authored-By: Claude Opus 4.8 (1M context) --- web-ui/src/app/diagnostics/page.tsx | 51 +++++++++++++++++++ web-ui/src/app/methodology/page.tsx | 4 +- web-ui/src/app/operations/page.tsx | 19 ++++++- .../app/settings/_components/env-var-row.tsx | 14 ++++- .../methodology/content-checklists-panel.tsx | 22 +++++++- .../precedents/library-search-panel.tsx | 5 ++ .../src/components/training/compare-panel.tsx | 16 ++++-- .../training/curator-portrait-panel.tsx | 2 +- .../training/style-report-panel.tsx | 5 +- web-ui/src/lib/api/exports.ts | 7 +++ web-ui/src/lib/api/feedback.ts | 6 +++ web-ui/src/lib/api/learning.ts | 9 ++++ web-ui/src/lib/api/missing-precedents.ts | 16 ++++++ web-ui/src/lib/api/precedent-library.ts | 8 +++ web-ui/src/lib/api/system.ts | 19 +++++++ web-ui/src/lib/api/training.ts | 9 +++- web/app.py | 22 ++++---- 17 files changed, 209 insertions(+), 25 deletions(-) diff --git a/web-ui/src/app/diagnostics/page.tsx b/web-ui/src/app/diagnostics/page.tsx index 56ab867..9d2f6b6 100644 --- a/web-ui/src/app/diagnostics/page.tsx +++ b/web-ui/src/app/diagnostics/page.tsx @@ -129,6 +129,57 @@ export default function DiagnosticsPage() { + {/* Halacha review backlog (ADM-1, INV-IA5): render the human-gate + counter the backend returns; the action lives at /approvals + (INV-IA1 — this surface only points, never decides). */} + + +

+ + תור אישור הלכות + + {isPending ? "—" : (data?.halacha_backlog?.pending_review ?? 0)} + + + לאישור ← + +

+ {isPending ? ( + + ) : ( +
+
+
ממתינים (נקי)
+
+ {data?.halacha_backlog?.pending_clean ?? 0} +
+
+
+
דורש תיקון
+
+ {data?.halacha_backlog?.pending_flagged ?? 0} +
+
+
+
אושרו
+
+ {data?.halacha_backlog?.approved ?? 0} +
+
+
+
הוותיק ביותר
+
+ {formatRelativeTime(data?.halacha_backlog?.oldest_pending_at ?? null)} +
+
+
+ )} +
+
+ {/* Active tasks */} diff --git a/web-ui/src/app/methodology/page.tsx b/web-ui/src/app/methodology/page.tsx index 1374051..76e063e 100644 --- a/web-ui/src/app/methodology/page.tsx +++ b/web-ui/src/app/methodology/page.tsx @@ -45,14 +45,14 @@ export default function MethodologyPage() { diff --git a/web-ui/src/app/operations/page.tsx b/web-ui/src/app/operations/page.tsx index 3fc752f..78a239f 100644 --- a/web-ui/src/app/operations/page.tsx +++ b/web-ui/src/app/operations/page.tsx @@ -443,8 +443,23 @@ function LiveAgentsPanel() {

סוכנים פעילים

{data ? (
- רצים {data.running} - בתור {data.queued} + {/* ADM-6 (INV-IA5): counts sum only the companies that loaded. + When a company errored, mark the totals as a floor ("+") so + the operator isn't shown a shrunken depth as if complete. */} + + רצים {data.running}{data.errors.length > 0 ? "+" : ""} + + + בתור {data.queued}{data.errors.length > 0 ? "+" : ""} + + {data.errors.length > 0 ? ( + + ⚠ חלקי + + ) : null}
) : null} diff --git a/web-ui/src/app/settings/_components/env-var-row.tsx b/web-ui/src/app/settings/_components/env-var-row.tsx index 65c71eb..c570703 100644 --- a/web-ui/src/app/settings/_components/env-var-row.tsx +++ b/web-ui/src/app/settings/_components/env-var-row.tsx @@ -87,11 +87,23 @@ export function EnvVarRow({ )} -
+
Container: {spec.container_value ?? — לא מוגדר —} + {/* ADM-5 (INV-IA5/INV-IA6): when Coolify ≠ Container the container is + running a stale value until a redeploy — say so in plain Hebrew + right here, not only via the top "Drift" badge. */} + {coolifyAvailable && spec.drift && ( + + ממתין ל-redeploy + + )}
diff --git a/web-ui/src/components/methodology/content-checklists-panel.tsx b/web-ui/src/components/methodology/content-checklists-panel.tsx index bbd945d..9eb24ab 100644 --- a/web-ui/src/components/methodology/content-checklists-panel.tsx +++ b/web-ui/src/components/methodology/content-checklists-panel.tsx @@ -30,6 +30,17 @@ const CHECKLIST_ORDER = [ "betterment_levy", ]; +// MET-6 (INV-IA6/INV-IA5): which case selects each checklist — mirrors the +// server's get_content_checklist() routing (lessons.py:580-622) so the chair +// sees *when* a checklist is consumed, not five unlabelled types. +const CHECKLIST_APPLIES: Record = { + licensing_substantive: "ברירת-מחדל — כל ערר רישוי שאינו נופל לקטגוריה אחרת", + licensing_threshold: "עררי רישוי בנושא סמכות / סף / סילוק-על-הסף / זכות-ערר", + licensing_property: "עררי רישוי בנושא תימוכין קנייניים / בעלות / הסכמת-דיירים", + tama38: 'עררים בנושא תמ"א 38 / חיזוק', + betterment_levy: "תיקי היטל השבחה (8xxx)", +}; + type ChecklistItem = { key: string; label: string; @@ -131,12 +142,19 @@ export function ContentChecklistsPanel() {
-

{current.label}

+
+

{current.label}

+ {CHECKLIST_APPLIES[current.key] && ( +

+ חל על: {CHECKLIST_APPLIES[current.key]} +

+ )} +

diff --git a/web-ui/src/components/training/compare-panel.tsx b/web-ui/src/components/training/compare-panel.tsx index 6d78d77..11644cd 100644 --- a/web-ui/src/components/training/compare-panel.tsx +++ b/web-ui/src/components/training/compare-panel.tsx @@ -118,7 +118,15 @@ export function ComparePanel() { const { data: corpus, isPending } = useCorpus(); const [a, setA] = useState(null); const [b, setB] = useState(null); - const cmp = useCompare(a, b); + + // LRN-6 (INV-IA2): if a selected decision was deleted from the corpus on + // another surface, a cached selection would POST a stale id and 404. Derive + // the effective selection from the refreshed corpus instead of holding it in + // state — a deleted id resolves to null (no effect, no stale POST). + const ids = corpus ? new Set(corpus.map((c) => c.id)) : null; + const validA = a && (!ids || ids.has(a)) ? a : null; + const validB = b && (!ids || ids.has(b)) ? b : null; + const cmp = useCompare(validA, validB); return (

@@ -133,7 +141,7 @@ export function ComparePanel() {