diff --git a/mcp-server/src/legal_mcp/services/db.py b/mcp-server/src/legal_mcp/services/db.py index e845f81..3d4c3bc 100644 --- a/mcp-server/src/legal_mcp/services/db.py +++ b/mcp-server/src/legal_mcp/services/db.py @@ -2655,7 +2655,7 @@ async def list_decision_lessons(corpus_id: UUID) -> list[dict]: # review_status is the single writer gate). rows = await conn.fetch( "SELECT id, style_corpus_id, lesson_text, category, source, " - " review_status, created_by, created_at, updated_at " + " review_status, created_by, created_at, updated_at, synthesized_from " "FROM decision_lessons WHERE style_corpus_id = $1 " "ORDER BY created_at DESC", corpus_id, diff --git a/web-ui/src/components/training/lessons-tab.tsx b/web-ui/src/components/training/lessons-tab.tsx index fe48bb1..10d3c90 100644 --- a/web-ui/src/components/training/lessons-tab.tsx +++ b/web-ui/src/components/training/lessons-tab.tsx @@ -54,6 +54,9 @@ const SOURCE_BADGE: Record = { curator: { label: "הרמס (סקירה)", cls: "bg-info-bg text-info" }, style_analyzer: { label: "מנתח-סגנון", cls: "bg-success-bg text-success" }, "panel:deepseek+gemini": { label: "פאנל: דיפסיק+גמיני", cls: "bg-gold-wash text-gold-deep" }, + // #158/INV-LRN8 — a super-lesson merging overlapping lessons; navy-filled so it + // reads as the consolidated/elevated one. + synthesis: { label: "סינתזה", cls: "bg-navy text-parchment" }, }; const SOURCE_BADGE_FALLBACK = { label: "פאנל", cls: "bg-rule-soft text-ink-soft" }; @@ -63,6 +66,9 @@ const REVIEW_BADGE: Record = { proposed: { label: "ממתין לאישור", cls: "bg-gold-wash text-gold-deep border-gold/40" }, approved: { label: "מאושר · זורם לכותב", cls: "bg-success-bg text-success border-success/40" }, rejected: { label: "נדחה", cls: "bg-rule-soft text-ink-muted line-through" }, + // #158/INV-LRN8 — merged into a synthesis super-lesson; kept as provenance, no + // longer fed to the writer. Muted (not struck — it wasn't rejected). + superseded: { label: "מוזג", cls: "bg-rule-soft text-ink-muted" }, }; export function LessonsTab({ corpusId }: { corpusId: string }) { @@ -201,8 +207,10 @@ function LessonItem({ } }; + const mergedCount = lesson.source === "synthesis" ? (lesson.synthesized_from?.length ?? 0) : 0; + return ( - +
+ {mergedCount > 0 && ( +
+ ⤷ מוזג מ-{mergedCount} לקחים · דחייה תשחזר אותם +
+ )} + {editing ? ( <>