From b8d563d45f14a2b1db1f684aa0a8dcd7e5b6ad56 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 7 Feb 2026 00:01:50 +0000 Subject: Remove directives for reimplementation --- makima/frontend/src/components/NavStrip.tsx | 1 - .../src/components/directives/ApprovalsTab.tsx | 77 - .../src/components/directives/ChainTab.tsx | 212 -- .../components/directives/CreateDirectiveModal.tsx | 146 -- .../src/components/directives/DirectiveDetail.tsx | 160 -- .../src/components/directives/DirectiveList.tsx | 85 - .../components/directives/DirectiveListItem.tsx | 83 - .../src/components/directives/EvaluationsTab.tsx | 12 - .../src/components/directives/EventsTab.tsx | 77 - .../src/components/directives/OverviewTab.tsx | 73 - .../src/components/directives/StepNode.tsx | 87 - .../src/components/directives/VerifiersTab.tsx | 12 - makima/frontend/src/components/directives/index.ts | 11 - makima/frontend/src/hooks/useDirectiveDetail.ts | 125 -- makima/frontend/src/hooks/useDirectives.ts | 298 --- makima/frontend/src/lib/api.ts | 1283 ------------ makima/frontend/src/main.tsx | 17 - makima/frontend/src/routes/directives.tsx | 184 -- makima/frontend/tsconfig.tsbuildinfo | 2 +- .../20260207000000_directive_v2_wipe.sql | 331 +++ makima/src/bin/makima.rs | 151 +- makima/src/daemon/api/directive.rs | 447 ----- makima/src/daemon/api/mod.rs | 1 - makima/src/daemon/cli/directive.rs | 186 -- makima/src/daemon/cli/mod.rs | 56 - makima/src/daemon/skills/directive.md | 303 --- makima/src/daemon/skills/mod.rs | 4 - makima/src/db/models.rs | 666 ------ makima/src/db/repository.rs | 1169 ----------- makima/src/lib.rs | 1 - makima/src/orchestration/engine.rs | 1335 ------------ makima/src/orchestration/mod.rs | 26 - makima/src/orchestration/planner.rs | 848 -------- makima/src/orchestration/verifier.rs | 833 -------- makima/src/server/handlers/contracts.rs | 85 +- makima/src/server/handlers/directives.rs | 2116 -------------------- makima/src/server/handlers/mesh_daemon.rs | 15 +- makima/src/server/handlers/mod.rs | 2 - makima/src/server/mod.rs | 57 +- 39 files changed, 336 insertions(+), 11241 deletions(-) delete mode 100644 makima/frontend/src/components/directives/ApprovalsTab.tsx delete mode 100644 makima/frontend/src/components/directives/ChainTab.tsx delete mode 100644 makima/frontend/src/components/directives/CreateDirectiveModal.tsx delete mode 100644 makima/frontend/src/components/directives/DirectiveDetail.tsx delete mode 100644 makima/frontend/src/components/directives/DirectiveList.tsx delete mode 100644 makima/frontend/src/components/directives/DirectiveListItem.tsx delete mode 100644 makima/frontend/src/components/directives/EvaluationsTab.tsx delete mode 100644 makima/frontend/src/components/directives/EventsTab.tsx delete mode 100644 makima/frontend/src/components/directives/OverviewTab.tsx delete mode 100644 makima/frontend/src/components/directives/StepNode.tsx delete mode 100644 makima/frontend/src/components/directives/VerifiersTab.tsx delete mode 100644 makima/frontend/src/components/directives/index.ts delete mode 100644 makima/frontend/src/hooks/useDirectiveDetail.ts delete mode 100644 makima/frontend/src/hooks/useDirectives.ts delete mode 100644 makima/frontend/src/routes/directives.tsx create mode 100644 makima/migrations/20260207000000_directive_v2_wipe.sql delete mode 100644 makima/src/daemon/api/directive.rs delete mode 100644 makima/src/daemon/cli/directive.rs delete mode 100644 makima/src/daemon/skills/directive.md delete mode 100644 makima/src/orchestration/engine.rs delete mode 100644 makima/src/orchestration/mod.rs delete mode 100644 makima/src/orchestration/planner.rs delete mode 100644 makima/src/orchestration/verifier.rs delete mode 100644 makima/src/server/handlers/directives.rs diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx index 9bb7777..fb95c7f 100644 --- a/makima/frontend/src/components/NavStrip.tsx +++ b/makima/frontend/src/components/NavStrip.tsx @@ -10,7 +10,6 @@ interface NavLink { const NAV_LINKS: NavLink[] = [ { label: "Listen", href: "/listen" }, - { label: "Directives", href: "/directives", requiresAuth: true }, { label: "Contracts", href: "/contracts", requiresAuth: true }, { label: "Board", href: "/workflow", requiresAuth: true }, { label: "Mesh", href: "/mesh", requiresAuth: true }, diff --git a/makima/frontend/src/components/directives/ApprovalsTab.tsx b/makima/frontend/src/components/directives/ApprovalsTab.tsx deleted file mode 100644 index dca48df..0000000 --- a/makima/frontend/src/components/directives/ApprovalsTab.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import type { DirectiveWithProgress } from "../../lib/api"; - -export function ApprovalsTab({ directive, onRefresh }: { directive: DirectiveWithProgress; onRefresh: () => void }) { - if (directive.pendingApprovals.length === 0) { - return ( -
-

No pending approvals

-
- ); - } - - const handleApprove = async (approvalId: string) => { - try { - const { approveDirectiveRequest } = await import("../../lib/api"); - await approveDirectiveRequest(directive.id, approvalId); - onRefresh(); - } catch (err) { - console.error("Failed to approve:", err); - } - }; - - const handleDeny = async (approvalId: string) => { - try { - const { denyDirectiveRequest } = await import("../../lib/api"); - await denyDirectiveRequest(directive.id, approvalId); - onRefresh(); - } catch (err) { - console.error("Failed to deny:", err); - } - }; - - return ( -
- {directive.pendingApprovals.map((approval) => { - const urgencyColor = { - low: "text-[#556677]", - normal: "text-[#75aafc]", - high: "text-yellow-400", - critical: "text-red-400", - }[approval.urgency] || "text-[#556677]"; - - return ( -
-
-
-
- {approval.approvalType} - - {approval.urgency} - -
-

{approval.description}

-
-
- - -
-
-
- ); - })} -
- ); -} diff --git a/makima/frontend/src/components/directives/ChainTab.tsx b/makima/frontend/src/components/directives/ChainTab.tsx deleted file mode 100644 index ccefe81..0000000 --- a/makima/frontend/src/components/directives/ChainTab.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import { useState, useMemo } from "react"; -import { - ReactFlow, - Edge, - Controls, - Background, - BackgroundVariant, - MarkerType, -} from "@xyflow/react"; -import "@xyflow/react/dist/style.css"; -import type { DirectiveWithProgress, DirectiveGraphResponse } from "../../lib/api"; -import { StepNodeComponent, stepStatusStyles } from "./StepNode"; - -// Node types for React Flow -const nodeTypes = { - step: StepNodeComponent, -}; - -export function ChainTab({ directive, graph }: { directive: DirectiveWithProgress; graph: DirectiveGraphResponse | null }) { - const [viewMode, setViewMode] = useState<"dag" | "list">("dag"); - - // Convert graph to React Flow nodes and edges - const { nodes, edges } = useMemo(() => { - if (!graph || !graph.nodes.length) { - // Fallback: generate positions from directive.steps - const stepNodes = directive.steps.map((step, index) => ({ - id: step.id, - type: "step" as const, - position: { - x: (index % 3) * 220 + 50, - y: Math.floor(index / 3) * 120 + 50, - }, - data: { - id: step.id, - name: step.name, - stepType: step.stepType, - status: step.status, - confidenceScore: step.confidenceScore, - confidenceLevel: step.confidenceLevel, - contractId: step.contractId, - editorX: null, - editorY: null, - }, - })); - - // Build edges from dependencies - const stepEdges: Edge[] = []; - directive.steps.forEach((step) => { - (step.dependsOn ?? []).forEach((depName) => { - const depStep = directive.steps.find((s) => s.name === depName); - if (depStep) { - stepEdges.push({ - id: `${depStep.id}-${step.id}`, - source: depStep.id, - target: step.id, - type: "smoothstep", - markerEnd: { type: MarkerType.ArrowClosed, color: "#556677" }, - style: { stroke: "#556677", strokeWidth: 2 }, - }); - } - }); - }); - - return { nodes: stepNodes, edges: stepEdges }; - } - - // Use graph data - const graphNodes = graph.nodes.map((node) => ({ - id: node.id, - type: "step" as const, - position: { - x: node.editorX ?? 50, - y: node.editorY ?? 50, - }, - data: { ...node }, - })); - - const graphEdges: Edge[] = graph.edges.map((edge) => ({ - id: `${edge.source}-${edge.target}`, - source: edge.source, - target: edge.target, - type: "smoothstep", - markerEnd: { type: MarkerType.ArrowClosed, color: "#556677" }, - style: { stroke: "#556677", strokeWidth: 2 }, - })); - - return { nodes: graphNodes, edges: graphEdges }; - }, [graph, directive.steps]); - - if (!directive.chain) { - return ( -
-

- No chain generated yet. Start the directive to generate a chain. -

-
- ); - } - - return ( -
- {/* Chain info header */} -
-
-
{directive.chain.name}
-
Generation {directive.chain.generation}
-
-
-
- {directive.chain.completedSteps}/{directive.chain.totalSteps} steps -
- {/* View toggle */} -
- - -
-
-
- - {viewMode === "dag" ? ( - /* DAG visualization */ -
- {directive.steps.length === 0 ? ( -
-

No steps in chain

-
- ) : ( - - - - - )} -
- ) : ( - /* List view */ -
-

Steps

- {directive.steps.length === 0 ? ( -

No steps in chain

- ) : ( - directive.steps.map((step) => { - const styles = stepStatusStyles[step.status] || stepStatusStyles.pending; - - return ( -
-
-
- {step.name} - - {step.status} - - {step.confidenceScore !== null && ( - - ({Math.round(step.confidenceScore * 100)}%) - - )} -
-
{step.stepType}
-
- {step.description && ( -

{step.description}

- )} - {step.dependsOn?.length > 0 && ( -
- Depends on: {step.dependsOn.join(", ")} -
- )} -
- ); - }) - )} -
- )} -
- ); -} diff --git a/makima/frontend/src/components/directives/CreateDirectiveModal.tsx b/makima/frontend/src/components/directives/CreateDirectiveModal.tsx deleted file mode 100644 index 7f52a7e..0000000 --- a/makima/frontend/src/components/directives/CreateDirectiveModal.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { useState, useEffect } from "react"; -import type { AutonomyLevel, RepositoryHistoryEntry } from "../../lib/api"; -import { getRepositorySuggestions } from "../../lib/api"; - -interface CreateDirectiveModalProps { - onSubmit: (goal: string, repositoryUrl: string | undefined, autonomyLevel: AutonomyLevel) => void; - onCancel: () => void; -} - -export function CreateDirectiveModal({ onSubmit, onCancel }: CreateDirectiveModalProps) { - const [goal, setGoal] = useState(""); - const [repositoryUrl, setRepositoryUrl] = useState(""); - const [autonomyLevel, setAutonomyLevel] = useState("guardrails"); - const [suggestions, setSuggestions] = useState([]); - const [showSuggestions, setShowSuggestions] = useState(false); - - // Load suggestions - useEffect(() => { - getRepositorySuggestions("remote", undefined, 5) - .then((res) => { - setSuggestions(res.entries); - }) - .catch(() => { - setSuggestions([]); - }); - }, []); - - const handleSubmit = () => { - if (goal.trim()) { - onSubmit(goal.trim(), repositoryUrl.trim() || undefined, autonomyLevel); - } - }; - - return ( -
-
-

- Create Directive -

- -
- {/* Goal */} -
- -