fix(ia): IA גל-1 — סנכרון-cache + נתונים-שגויים + מחיקת-מתים (#130, X17)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 13s
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 13s
גל-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) <noreply@anthropic.com>
This commit is contained in:
@@ -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<string, string> = {
|
||||
licensing_substantive: "ברירת-מחדל — כל ערר רישוי שאינו נופל לקטגוריה אחרת",
|
||||
licensing_threshold: "עררי רישוי בנושא סמכות / סף / סילוק-על-הסף / זכות-ערר",
|
||||
licensing_property: "עררי רישוי בנושא תימוכין קנייניים / בעלות / הסכמת-דיירים",
|
||||
tama38: 'עררים בנושא תמ"א 38 / חיזוק',
|
||||
betterment_levy: "תיקי היטל השבחה (8xxx)",
|
||||
};
|
||||
|
||||
type ChecklistItem = {
|
||||
key: string;
|
||||
label: string;
|
||||
@@ -131,12 +142,19 @@ export function ContentChecklistsPanel() {
|
||||
<Card className="border-rule">
|
||||
<CardContent className="px-5 py-4 space-y-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-navy">{current.label}</h3>
|
||||
<div className="min-w-0">
|
||||
<h3 className="text-sm font-semibold text-navy">{current.label}</h3>
|
||||
{CHECKLIST_APPLIES[current.key] && (
|
||||
<p className="text-[0.72rem] text-ink-muted mt-0.5">
|
||||
חל על: {CHECKLIST_APPLIES[current.key]}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => setPreview(!preview)}
|
||||
className="text-xs"
|
||||
className="text-xs shrink-0"
|
||||
>
|
||||
{preview ? <EyeOff className="w-3.5 h-3.5 ml-1" /> : <Eye className="w-3.5 h-3.5 ml-1" />}
|
||||
{preview ? "עריכה" : "תצוגה מקדימה"}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
useLibrarySearch, type PracticeArea, type SearchHit,
|
||||
} from "@/lib/api/precedent-library";
|
||||
import { PRACTICE_AREAS, PRECEDENT_LEVELS } from "./practice-area";
|
||||
import { AuthorityBadge } from "./halacha-meta";
|
||||
|
||||
function formatDate(iso: string | null) {
|
||||
if (!iso) return "—";
|
||||
@@ -32,6 +33,10 @@ function HalachaCard({ hit }: { hit: Extract<SearchHit, { type: "halacha" }> })
|
||||
{hit.court && <span>· {hit.court}</span>}
|
||||
{hit.decision_date && <span>· {formatDate(hit.decision_date)}</span>}
|
||||
{hit.precedent_level && <span>· {hit.precedent_level}</span>}
|
||||
{/* PRE-3/PRE-5 (INV-IA5): the derived authority (binding/persuasive)
|
||||
rides on the wire but was dropped here — render it as in the review
|
||||
tab so search shows the same provenance everywhere. */}
|
||||
<AuthorityBadge authority={hit.authority} />
|
||||
<span className="ms-auto tabular-nums">דירוג {hit.score.toFixed(2)}</span>
|
||||
</div>
|
||||
<p className="text-navy font-medium text-[0.95rem]" dir="rtl">
|
||||
|
||||
@@ -118,7 +118,15 @@ export function ComparePanel() {
|
||||
const { data: corpus, isPending } = useCorpus();
|
||||
const [a, setA] = useState<string | null>(null);
|
||||
const [b, setB] = useState<string | null>(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 (
|
||||
<div className="space-y-6">
|
||||
@@ -133,7 +141,7 @@ export function ComparePanel() {
|
||||
</label>
|
||||
<Select
|
||||
disabled={isPending}
|
||||
value={(slot === "a" ? a : b) ?? ""}
|
||||
value={(slot === "a" ? validA : validB) ?? ""}
|
||||
onValueChange={(v) => (slot === "a" ? setA(v) : setB(v))}
|
||||
dir="rtl"
|
||||
>
|
||||
@@ -155,7 +163,7 @@ export function ComparePanel() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{a && b && a === b && (
|
||||
{validA && validB && validA === validB && (
|
||||
<p className="text-ink-muted text-sm text-center">בחר שתי החלטות שונות</p>
|
||||
)}
|
||||
|
||||
@@ -167,7 +175,7 @@ export function ComparePanel() {
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{cmp.isPending && a && b && a !== b && (
|
||||
{cmp.isPending && validA && validB && validA !== validB && (
|
||||
<Skeleton className="h-60 w-full" />
|
||||
)}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ function StatsCard() {
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
|
||||
<Kpi label="ממצאי curator" value={data.total_findings} icon={<Sparkles className="w-4 h-4" />} />
|
||||
<Kpi label="החלטות שנסקרו" value={`${data.decisions_with_findings}/${data.decisions_total}`} icon={<FileText className="w-4 h-4" />} />
|
||||
<Kpi label="ממצאים שאומצו ל-SKILL" value={data.findings_applied} icon={<CheckCircle2 className="w-4 h-4" />} />
|
||||
<Kpi label="ממצאים מאושרים (זורמים לכותב)" value={data.findings_approved} icon={<CheckCircle2 className="w-4 h-4" />} />
|
||||
<Kpi label="ממוצע ממצאים להחלטה"
|
||||
value={
|
||||
data.decisions_with_findings > 0
|
||||
|
||||
@@ -83,10 +83,13 @@ export function StyleReportPanel() {
|
||||
label="ממוצע להחלטה"
|
||||
value={`${(c.avg_chars / 1000).toFixed(1)}K`}
|
||||
/>
|
||||
{/* LRN-4 (INV-IA5): items.length (style_patterns freq>0) and
|
||||
contribution.total_patterns are independent queries — the old
|
||||
"X מתוך Y" framed a false subset. Show the surfaced count alone. */}
|
||||
<KPICard
|
||||
label="דפוסי סגנון"
|
||||
value={String(data.signature_phrases.items.length)}
|
||||
caption={`מתוך ${data.contribution.total_patterns} שחולצו`}
|
||||
caption="דפוסים חוזרים שזוהו"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user