From a6677bafe52d9988c9948df34c1635e4411c9591 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 13 Feb 2026 19:19:39 +0000 Subject: Fix worktree branching for directive tasks and remove memories --- .../src/components/directives/DirectiveDetail.tsx | 230 +----------- makima/frontend/src/hooks/useDirectiveMemories.ts | 86 ----- makima/frontend/src/lib/api.ts | 176 --------- makima/frontend/tsconfig.tsbuildinfo | 2 +- .../20260213000000_drop_directive_memories.sql | 3 + makima/src/bin/makima.rs | 44 --- makima/src/daemon/api/directive.rs | 199 ----------- makima/src/daemon/cli/directive.rs | 47 --- makima/src/daemon/cli/mod.rs | 18 - makima/src/daemon/task/manager.rs | 144 +++++--- makima/src/daemon/worktree/manager.rs | 79 +++++ makima/src/db/models.rs | 45 --- makima/src/db/repository.rs | 143 +------- makima/src/orchestration/directive.rs | 84 +---- makima/src/server/handlers/directives.rs | 394 +-------------------- makima/src/server/mod.rs | 4 - makima/src/server/openapi.rs | 19 +- 17 files changed, 199 insertions(+), 1518 deletions(-) delete mode 100644 makima/frontend/src/hooks/useDirectiveMemories.ts create mode 100644 makima/migrations/20260213000000_drop_directive_memories.sql diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx index 369cdaa..f9e7eed 100644 --- a/makima/frontend/src/components/directives/DirectiveDetail.tsx +++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx @@ -1,8 +1,7 @@ import { useState, useMemo, useEffect, useRef } from "react"; -import type { DirectiveWithSteps, DirectiveStatus, MemoryCategory } from "../../lib/api"; +import type { DirectiveWithSteps, DirectiveStatus } from "../../lib/api"; import { DirectiveDAG } from "./DirectiveDAG"; import { DirectiveLogStream } from "./DirectiveLogStream"; -import { useDirectiveMemories } from "../../hooks/useDirectiveMemories"; import { useMultiTaskSubscription } from "../../hooks/useMultiTaskSubscription"; const STATUS_BADGE: Record = { @@ -13,18 +12,6 @@ const STATUS_BADGE: Record = archived: { color: "text-[#556677] border-[#2a3a5a]", label: "ARCHIVED" }, }; -const CATEGORY_COLORS: Record = { - decision: { text: "text-amber-400", border: "border-amber-800", bg: "bg-amber-900/20", label: "Decision" }, - context: { text: "text-cyan-400", border: "border-cyan-800", bg: "bg-cyan-900/20", label: "Context" }, - preference: { text: "text-violet-400", border: "border-violet-800", bg: "bg-violet-900/20", label: "Preference" }, - learning: { text: "text-emerald-400", border: "border-emerald-800", bg: "bg-emerald-900/20", label: "Learning" }, - issue: { text: "text-red-400", border: "border-red-800", bg: "bg-red-900/20", label: "Issue" }, - progress: { text: "text-blue-400", border: "border-blue-800", bg: "bg-blue-900/20", label: "Progress" }, - other: { text: "text-[#7788aa]", border: "border-[#2a3a5a]", bg: "bg-[#1a2540]", label: "Other" }, -}; - -const ALL_CATEGORIES: MemoryCategory[] = ["decision", "context", "preference", "learning", "issue", "progress", "other"]; - interface DirectiveDetailProps { directive: DirectiveWithSteps; onStart: () => void; @@ -66,25 +53,6 @@ export function DirectiveDetail({ const terminalStatuses = new Set(["completed", "failed", "skipped"]); const hasTerminalTasks = directive.steps.some((s) => s.taskId && terminalStatuses.has(s.status)); - // Memory panel state - const [memoryOpen, setMemoryOpen] = useState(false); - const [addingMemory, setAddingMemory] = useState(false); - const [newCategory, setNewCategory] = useState("context"); - const [newContent, setNewContent] = useState(""); - const [confirmClear, setConfirmClear] = useState(false); - - const { - grouped, - loading: memoryLoading, - error: memoryError, - add: addMemory, - remove: removeMemory, - clearAll: clearMemories, - refresh: refreshMemories, - } = useDirectiveMemories(directive.id); - - const totalMemories = Object.values(grouped).reduce((sum, arr) => sum + arr.length, 0); - // Build task map from directive steps and orchestrator const taskMap = useMemo(() => { const map = new Map(); @@ -123,21 +91,6 @@ export function DirectiveDetail({ setEditingGoal(false); }; - const handleAddMemory = async () => { - if (!newContent.trim()) return; - await addMemory({ - category: newCategory, - content: newContent.trim(), - }); - setNewContent(""); - setAddingMemory(false); - }; - - const handleClearAll = async () => { - await clearMemories(); - setConfirmClear(false); - }; - return (
{/* Header */} @@ -346,187 +299,6 @@ export function DirectiveDetail({ )}
- {/* Memory Panel */} -
- {/* Memory header — always visible */} -
- -
-
- - {/* Collapsible content */} - {memoryOpen && ( -
- {memoryError && ( -
- {memoryError} -
- )} - - {memoryLoading ? ( -
Loading...
- ) : totalMemories === 0 ? ( -
- No memory entries yet. -
- ) : ( - /* Grouped entries */ -
- {ALL_CATEGORIES.map((cat) => { - const entries = grouped[cat]; - if (entries.length === 0) return null; - const style = CATEGORY_COLORS[cat]; - return ( -
-
- - {style.label} - - - ({entries.length}) - -
-
- {entries.map((entry) => ( -
-
-

- {entry.content} -

-
- -
- ))} -
-
- ); - })} -
- )} - - {/* Action bar: Add + Clear */} -
- - {totalMemories > 0 && ( - <> - {confirmClear ? ( -
- Clear all? - - -
- ) : ( - - )} - - )} - -
- - {/* Add form */} - {addingMemory && ( -
-
- - -
-