From 87fa8c4af66745bd30bc84b6c5ef657dd4dec002 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 8 Feb 2026 19:50:20 +0000 Subject: Fix directive evaluation and add to frontend --- .../directives/DirectiveContractsTab.tsx | 17 +++++++ .../src/components/directives/StepDiagram.tsx | 58 ++++++++++++++++++++-- makima/frontend/src/lib/api.ts | 7 +++ 3 files changed, 79 insertions(+), 3 deletions(-) (limited to 'makima/frontend') diff --git a/makima/frontend/src/components/directives/DirectiveContractsTab.tsx b/makima/frontend/src/components/directives/DirectiveContractsTab.tsx index 59ebfc8..28da117 100644 --- a/makima/frontend/src/components/directives/DirectiveContractsTab.tsx +++ b/makima/frontend/src/components/directives/DirectiveContractsTab.tsx @@ -100,6 +100,23 @@ export function DirectiveContractsTab({ label: step.name, }); } + // Show monitoring/evaluation contracts + if (step.monitoringContractId) { + contracts.push({ + summary: { + id: step.monitoringContractId, + name: `${step.name} - Evaluation`, + contractType: "monitoring", + status: step.status === "evaluating" ? "active" : "completed", + phase: "plan", + taskCount: 1, + tasksDone: step.status === "evaluating" ? 0 : 1, + tasksRunning: step.status === "evaluating" ? 1 : 0, + tasksFailed: 0, + }, + label: `${step.name} eval`, + }); + } } } diff --git a/makima/frontend/src/components/directives/StepDiagram.tsx b/makima/frontend/src/components/directives/StepDiagram.tsx index 91a3438..33892e0 100644 --- a/makima/frontend/src/components/directives/StepDiagram.tsx +++ b/makima/frontend/src/components/directives/StepDiagram.tsx @@ -41,10 +41,20 @@ const statusColors: Record = { pending: "Pending", + ready: "Ready", running: "Running", evaluating: "Evaluating", passed: "Passed", failed: "Failed", + rework: "Rework", + skipped: "Skipped", + blocked: "Blocked", +}; + +const confidenceColors: Record = { + green: "text-green-400", + yellow: "text-yellow-400", + red: "text-red-400", }; /** @@ -122,6 +132,44 @@ function StepCard({ step }: { step: ChainStep }) {

)} + {/* Evaluation info */} + {(step.confidenceScore != null || step.evaluationCount > 0 || step.reworkCount > 0) && ( +
+
+ {step.confidenceScore != null && ( + + {Math.round(step.confidenceScore * 100)}% confidence + + )} + {step.evaluationCount > 0 && ( + + eval #{step.evaluationCount} + + )} + {step.reworkCount > 0 && ( + + rework x{step.reworkCount} + + )} +
+
+ )} + + {/* Monitoring link (when evaluating) */} + {step.status === "evaluating" && step.monitoringContractId && ( +
+ { + e.stopPropagation(); + navigate(`/contracts/${step.monitoringContractId}`); + }} + > + evaluation contract → + +
+ )} + {/* Contract progress */} {summary && (
@@ -149,7 +197,7 @@ function StepCard({ step }: { step: ChainStep }) { )} {/* Contract link arrow */} - {hasContract && !summary && ( + {hasContract && !summary && step.status !== "evaluating" && (
view contract → @@ -200,7 +248,8 @@ export function StepDiagram({ steps }: StepDiagramProps) { // Compute overall progress const passedCount = steps.filter(s => s.status === "passed").length; const failedCount = steps.filter(s => s.status === "failed").length; - const runningCount = steps.filter(s => s.status === "running" || s.status === "evaluating").length; + const runningCount = steps.filter(s => s.status === "running").length; + const evaluatingCount = steps.filter(s => s.status === "evaluating").length; return (
@@ -213,7 +262,10 @@ export function StepDiagram({ steps }: StepDiagramProps) { {passedCount} passed )} {runningCount > 0 && ( - {runningCount} active + {runningCount} running + )} + {evaluatingCount > 0 && ( + {evaluatingCount} evaluating )} {failedCount > 0 && ( {failedCount} failed diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 9782a07..5080ee1 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3100,6 +3100,13 @@ export interface ChainStep { status: string; contractId: string | null; supervisorTaskId: string | null; + monitoringContractId: string | null; + monitoringTaskId: string | null; + confidenceScore: number | null; + confidenceLevel: string | null; + evaluationCount: number; + reworkCount: number; + lastEvaluationId: string | null; orderIndex: number; startedAt: string | null; completedAt: string | null; -- cgit v1.2.3