summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/directives
Commit message (Collapse)AuthorAgeFilesLines
* feat(directives): strict orchestration flow + sidebar overhaul + task page ↵soryu5 days3-767/+651
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rewrite (#134) End-to-end rewrite addressing the issues from the user's UX review. The system now feels like a daemon-orchestration tool: lock a contract and the orchestrator just goes; PR raised → auto-ship → reopen for amendments. The sidebar tree shows real entities only (no duplicates, no inline action buttons polluting the file list), and every entity gets a right-click context menu. Task page matches the old /exec layout (diff on the left, feed + composer on the right). ## Backend — strict lifecycle (the orchestrator-never-spawned bug) Root cause: `phase_planning()` gates on `directive.status='active'`, but `start_contract()` only flipped the contract row — the parent directive stayed in whatever state it was. So locking a contract did nothing visible. Fix: contract lifecycle now drives directive status in the same transaction. start_contract → if contract becomes active, flip directive draft|paused|idle|inactive → active pause_contract → after promote, if no active contract left, directive → paused complete_contract→ after promote, if no active left, directive → inactive (also fires on auto-ship from PR detect) unlock_contract → if was active and no active left, directive → paused reopen_contract → NEW. shipped → active. Directive → active, orchestrator_task_id/pr_url/pr_branch cleared so the reconciler spawns a fresh planner. The planner reads get_latest_merged_revision and frames the new plan as an amendment. handlers::directive_documents lifts state.kick_directive_reconciler() into run_contract_transition so every successful transition wakes the reconciler immediately (no 15s wait). handlers::directives `update_directive` (PR-detection branch) calls `complete_contract(active_contract_id, pr_url, pr_branch)` instead of `set_directive_inactive`. The contract auto-ships; the directive follows via the sync above. No more manual "Mark complete" click. POST /api/v1/contracts/{id}/reopen added + wired through openapi. Spawn task names dropped the directive-title prefix that looked redundant in the sidebar: "Plan: <title>" → "orchestrator" "Re-plan: <title>" → "orchestrator (re-plan)" "PR: <title>" → "completion" "Update PR: <title>" → "completion (update)" ## Frontend — sidebar * De-dupe: DocumentTasksFolder filters tasks[] to exclude any task whose id already appears in steps[].taskId. Single row per task, single highlight on click. * Generic SidebarContextMenu (new) replaces the directive-only DirectiveContextMenu (deleted). Per-entity item arrays built at the page level — directive, contract, step, task each have their own contextual actions. * Right-click works on every sidebar entity now (was directive-only). * `+ New document` / `+ New ephemeral task` inline buttons removed. Reachable via the directive folder right-click OR the hover-only `+` button on the directive folder row. * ContractHeader: dropped "Mark complete" button (auto-fires on PR). Added "Reopen for amendment" button when contract is shipped. ## Frontend — task page rewrite TaskPage.tsx replaces DocumentTaskStream.tsx (deleted). Two-column layout matches the old /exec page that the user preferred: ┌────────────────────────┬──────────────────────────────────┐ │ Changed files (~30%) │ Transcript feed (scrollable) │ │ ────────────────── │ ────────────────────── │ │ src/foo.rs │ [user] do thing │ │ src/bar.rs │ [tool] Read foo.rs │ │ │ │ │ Diff (selected file) │ │ │ ├──────────────────────────────────┤ │ │ Composer (sticky bottom) │ └────────────────────────┴──────────────────────────────────┘ Diff comes from getTaskDiff(); parseDiff + DiffFileView exported from OverlayDiffViewer for reuse (no duplication). Diff auto-refreshes when the task transitions to a terminal state. Transcript styling + sticky composer keep the parts the user liked. "Open in task page" button removed — the right pane IS the task page. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(directives): tasks folder visibility, circular auto-save timer, ↵soryu5 days1-46/+236
| | | | | | | | | unlock-to-edit (#133) * feat: soryu - makima: Fix tasks/ folder visibility and rename for multi-contract directives * feat: soryu - makima: Replace auto-save countdown text/bar with a circular timer * feat: soryu - makima: Require Unlock before editing a locked contract body
* feat(directives): drop directives.goal — orchestration reads contract body ↵soryu13 days2-743/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#132) Hard cut. The unified contracts surface owns spec text now; the directive itself is just a folder. The orchestrator daemon reads the active contract's body when it spawns, replans, or runs completion. Schema (migration 20260510000000): - DROP TABLE directive_goal_history - ALTER TABLE directives DROP COLUMN goal - ALTER TABLE directives DROP COLUMN goal_updated_at New repo helper: - get_active_contract_body(directive_id) — picks the active|queued|draft contract (in that order), most-recent first. Backend cuts: - Directive / DirectiveSummary / CreateDirectiveRequest / UpdateDirectiveRequest lose goal & goalUpdatedAt. - CreateDirectiveRequest gains optional `contractBody` — when provided, create_directive_for_owner auto-creates a first contract with that body in the same transaction. - Removed: update_directive_goal, update_directive_goal_keep_orchestrator, save_directive_goal_history, get_directive_goal_history, DirectiveGoalHistory model, UpdateGoalRequest. - Removed handlers::directives::update_goal + the /directives/{id}/goal route. - orchestration::directive::build_planning_prompt / build_completion_prompt / build_order_pickup_prompt now take a `contract_body: &str` instead of `goal_history`. classify_goal_change + try_interrupt_planner_with_goal_edit + GoalChangeKind + GoalEditInterruptResult removed (they were only useful for the small-vs-large goal-edit interrupt cycle). CLI: - `makima directive update-goal` removed (UpdateGoalArgs deleted, Commands enum trimmed, ApiClient::directive_update_goal + UpdateGoalRequest deleted). Frontend: - Directive / DirectiveSummary / CreateDirectiveRequest types lose goal & goalUpdatedAt; CreateDirectiveRequest gains `contractBody`. - useDirective drops updateGoal helper. - api.ts updateDirectiveGoal removed. - Legacy DirectiveList + DirectiveDetail components deleted; the /directives route now always renders the document-mode page. The user-settings documentModeEnabled flag is no longer consulted at the route level. - NewContractModal passes body via contractBody. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(frontend): DocumentEditor takes explicit body/title/documentId ↵soryu13 days1-59/+88
| | | | | | | | | | | | | | | | | | | | | | | props (#131) Stops shadowing directive.goal with the contract body via a synthesised directive object. DocumentEditor now accepts: * documentId — scopes the localStorage draft key per contract so switching contracts under the same directive doesn't clobber the other's unsaved edits. * title — the contract title rendered as the H1. * body — the contract body, used to seed the editor. * onUpdateBody (was onUpdateGoal) The `directive` prop stays for orchestrator state + embedded steps panel. document-directives.tsx drops the directiveAsDocument synthesis hack and passes body/title from the contract directly. This is the prep-work for dropping `directives.goal` from the schema — once nothing reads it, the column can be dropped in a follow-up without touching the editor. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(doc-mode): unified surface — ephemeral tasks, tmp/, /exec redirect, ↵soryu2026-05-011-35/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | palette, SWR (#117) Phases 1-3 of the unified-surface plan, bundled per the user's request. The directive document/folder UI is now the canonical place to interact with makima; legacy /exec is subsumed by routing redirects, /contracts is already hidden in nav, and orphan tasks surface under a top-level tmp/ pseudo-folder. Phase 4 (porting contract-only features) was confirmed out of scope; Phase 5 (deleting the contracts code) is a follow-up. ## Backend - New migration `20260501000000_archive_existing_contracts.sql` flips every legacy contract to `archived` so /contracts is read-only history. - New endpoint `POST /api/v1/directives/{id}/tasks` creates an ephemeral task — `directive_id` set, `directive_step_id` NULL, repo/branch inherited from the directive. Reuses `create_task_for_owner`. - New endpoint `GET /api/v1/directives/{id}/tasks` lists ephemeral tasks attached to a directive (drives the per-folder ephemeral group). - `GET /api/v1/mesh/tasks?orphan=true` returns top-level tasks with no `directive_id` AND no `parent_task_id` — backs the sidebar's tmp/. - New repo helpers `list_ephemeral_directive_tasks_for_owner` and `list_orphan_tasks_for_owner`. - The existing `mesh_merge` endpoints are reused as-is for ephemeral task merge (no new merge logic needed). ## Frontend ### Sticky composer + auto-scroll fix (`DocumentTaskStream.tsx`) - Sticky comment composer pinned to viewport bottom; padding compensates so the last entry isn't hidden behind it. - `autoScroll` now resumes when the user scrolls back within 80px of the bottom (previously stuck off forever after a single scroll-up). - Floating "↓ Jump to latest" chip when the user has scrolled away. - Action header strip: explicit Stop / Send / Open-in-task-page + conditional "Merge to base ↗" button on ephemeral terminal tasks. - Module-level cache of historical entries by taskId so re-selecting a task you've viewed renders instantly while a fresh fetch runs. ### Sidebar (`document-directives.tsx`) - Top-level `tmp/` folder: orphan tasks, polled every 5s. - Per-directive `tasks/` subfolder now also surfaces ephemeral tasks (lazily fetched on folder open) with a distinct asterisk-on-terminal icon (`EphemeralTaskIcon`). - Inline hover-action chips on each directive folder header: Start / Pause / PR / +New task. Right-click menu still works as a power-user fallback. - "Now executing" amber strip in the editor pane: surfaces the live orchestrator/completion/running-step task with a one-click jump. - Inline `+ New task` modal (name + plan); on submit calls `createDirectiveTask` and navigates into the freshly-spawned task. - New `EphemeralAwareTaskStream` wrapper passes `ephemeral` and `status` to `DocumentTaskStream` so the merge button only shows when the selected task is genuinely an ephemeral spinoff in a terminal state. Step-spawned tasks merge via the directive's PR completion. ### SWR cache (`useDirectives.ts`) - Module-level `listCache` and per-id `detailCache` (mirrors the pattern in `useUserSettings.ts`). Mounting the hook renders the cache value immediately if present and kicks a background refresh; subscribers see the new value when it lands. Cuts perceived navigation latency to near-zero on warm cache hits. ### QuickSwitcher (`QuickSwitcher.tsx`, new) - IntelliJ-style double-Shift command palette mounted at app root. - Listens at the document level for two `Shift` keydowns within 300ms with no other key in between; ignores while focus is in an input/textarea so capitalising letters doesn't pop the palette. - Searches across directives + their tasks (orchestrator/completion/ steps/ephemerals) + orphan tmp tasks. Fuzzy matches on title. - Eagerly loads task details for the first 20 directives on open so searches don't block on per-directive fetches. ### Routing (`main.tsx` + `exec-redirect.tsx` + `tmp.tsx`) - New `ExecRedirect` wrapper at `/exec/:id`: when documentMode is on AND the task has a `directiveId`, replaces the URL with `/directives/<directiveId>?task=<taskId>`. Otherwise renders the legacy `MeshPage` as before. - New `/tmp/:taskId` route renders `DocumentTaskStream` standalone for orphan tasks, with the masthead and a `tmp / <slug>` breadcrumb. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(doc-mode): root-walk goal serializer + roundtrip-confirmed draft drop, ↵soryu2026-04-302-38/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | plus richer context menus (#114) ## The data-loss bug User reported "even after clicking Save now I have lost my doc". Two causes: 1. **GoalChangePlugin only read children[1]** — it captured edits to the single goal paragraph but silently dropped any typing that landed in the trailing paragraph below the StepsBlock (or in extra paragraphs the user had inserted). pendingGoalRef stayed at the persisted value, Save now fired empty/stale content, the doc was overwritten. 2. **fireSave dropped localStorage immediately on save success.** If the save persisted the wrong/empty content, the draft (which had the real content) was already gone — no recovery path. ## Fixes ### Capture all body content New `serializeGoalFromRoot` walks the entire root, skips only the H1 title and the StepsBlock decorator, and emits multi-paragraph markdown joined by blank lines. `GoalChangePlugin` and `fireSave` both call it now. Seed code splits an existing multi-paragraph goal back into ParagraphNodes on load. ### Read directly from the editor at save time `fireSave` now reads pendingGoalRef AND consults the live editor state via `editor.getEditorState().read()`. If anything went wrong with OnChangePlugin (which is rare, but possible — and was eating typing for many users), the save still picks up the actual document body. ### Defensive pre-save flush Before talking to the backend, `fireSave` writes the value to localStorage. If the network fails, the page closes mid-flight, or anything else goes sideways, the draft survives. ### Roundtrip-confirmed draft cleanup We no longer drop the localStorage draft inside `fireSave`. Instead a new effect watches `directive.goal` and clears the draft only when: lastSavedValueRef === directive.goal === pendingGoalRef.current i.e. only when the polled state confirms our save persisted AND the user hasn't typed anything new in the meantime. ## Question notifications respect document mode `SupervisorQuestionNotification` and `PhaseConfirmationToast` now route to `/directives/<id>?task=<taskId>` (the doc-mode surface) when the user has documentMode on AND the question carries a directiveId. Falls back to the old `/exec/:taskId` route for non-doc-mode users. ## Richer directive folder context menu In addition to start/pause/archive/delete/go-to-PR/new-draft we now expose: - Advance DAG - Plan orders - Clean up - Create / Update PR All optional callbacks; the legacy tabular UI is unaffected. ## Richer task row context menu In addition to interrupt/complete/fail/skip we now expose: - Send message — browser prompt → sendTaskMessage (same wire as the inline comment box) - Open in task page — navigates to /exec/:taskId for the full task UI (worktree diff viewer, checkpoint controls, etc.) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(directives): amendment lifecycle — inactive status, new draft, ↵soryu2026-04-303-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before/after diff (#113) Stage 4 of the doc-mode revamp. Closes the loop on living-spec contracts: once a contract ships (PR raised) it becomes 'inactive', editing it kicks off an amendment cycle, the planner sees the previously-merged content as context, and "New draft" lets users abandon amendment and start the next contract on a clean slate. ## inactive lifecycle - New status `'inactive'`. Set automatically when `update_directive` detects a `pr_url` transition None → Some, alongside the revision snapshot (set_directive_inactive: idempotent, only flips active/idle/paused). - `update_directive_goal` extends its CASE flip to include 'inactive', so editing a shipped contract's goal reactivates it for the planner. - Frontend: `DirectiveStatus` gains 'inactive'; STATUS_DOT and the legacy STATUS_BADGEs (DirectiveDetail, DirectiveList) get color/label entries. Sidebar sort puts inactive after draft / before archived. ## Amendment diff to the orchestrator `build_planning_prompt` takes a new `previous_merged_revision` parameter. When set, it prepends an "AMENDMENT TO A PREVIOUSLY-MERGED CONTRACT" header that shows the merged content and the amended content explicitly, with guidance to plan a delta rather than a from-scratch rebuild. Both the planning and replanning phases call `get_latest_merged_revision` and pass it through. ## "New draft" affordance - New `repository::reset_directive_for_new_draft`: clears goal to '', status → 'draft', detaches pr_url / pr_branch / orchestrator linkage. Past revisions stay in directive_revisions as history. - New `POST /api/v1/directives/{id}/new-draft` handler. - DirectiveContextMenu surfaces "New draft" only when status === 'inactive', via an optional onNewDraft callback (legacy tabular UI doesn't have to wire it up). After reset, the page navigates to the contract so the user starts typing the next iteration immediately. ## PR-state-aware updates The user's spec — "open ⇒ update, merged ⇒ new PR, closed ⇒ new PR" — is already implemented in `build_completion_prompt`'s `gh pr view` runtime check, so no code change was needed here. The amendment cycle naturally flows through it: inactive → goal save → status flips to active → phase_replanning spawns a planner → completion task picks up the existing pr_url, sees the GitHub state, and decides update vs new PR accordingly. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(doc-mode): rename surfaced label "Directive" → "Contract" (#109)soryu2026-04-301-4/+4
| | | | | | | | | | | | | | | | | | Stage 2: cosmetic UI rename only. Database tables, API paths, hook names, and CLI commands all stay as 'directive' for now — we'll phase out the existing standalone /contracts table later. Surface changes: - Sidebar header "Documents" → "Contracts"; root folder "directives/" → "contracts/"; empty state "No directives yet" → "No contracts yet". - Editor placeholders, breadcrumb header, "back to document" → "back to contract", right-click menu header. - NavStrip: when documentModeEnabled is on, the "Directives" link renders as "Contracts" (href stays /directives so links don't break). - Save bar message "saving will replan the directive" → "the contract". No backend changes — directive.goal etc. all still work the same. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(doc-mode): autosave robustness, draft→active flip, save-now, sidebar ↵soryu2026-04-301-32/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | context menus (#108) Stage 1 of the planned doc-mode revamp — bug fixes + UX polish ahead of the larger contract-revisioning architecture work. ## Backend: 'draft' included in goal-update status flip repository::update_directive_goal previously flipped only idle/paused → active on a goal save, leaving 'draft' alone. That meant brand-new directives got their goal persisted on save but never spawned a planner — exactly the "orchestrator never runs" report. Extended the CASE clause so 'draft' also flips to 'active' on save. The status remains visible to users; this just makes the implicit "first goal save = start" behaviour work end-to-end. ## Autosave robustness (DocumentEditor.tsx) The synchronous-write fix from the previous PR was correct in principle but not visible enough for users to confirm it was working, and could still drop the very last edit on an abrupt tab close. This change: - Adds beforeunload / pagehide / visibilitychange handlers that synchronously flush pendingGoalRef → localStorage (skipping if it matches the persisted value). Backed by a persistedGoalRef that tracks directive.goal in real time so the handler doesn't capture a stale closure. - Tracks the timestamp of every successful draft write (draftSavedAt) and surfaces it as a "Draft saved Ns ago" stamp in the bar — refreshed on a 1Hz ticker so users can SEE the autosave is alive. - Logs a console.warn on localStorage write failure (was silently swallowed) so quota / storage-disabled environments are diagnosable. ## Always-visible save bar + Save now button The bar now renders in every state (was hiding when idle/pending-with-time- remaining). Idle shows a quiet "Up to date." Pending outside the last 10s shows "Unsaved changes — auto-save soon." Save now is always present; disabled only when truly idle. ## EXEC and CONTRACTS hidden in document mode NavStrip filters Contracts and Exec links when settings.documentModeEnabled is true. Those areas are subsumed by the directive-document interface; the nav strip stops surfacing them so document mode users have one canonical place to work. ## Right-click context menus on sidebar Right-clicking a directive folder header opens DirectiveContextMenu with start / pause / archive / delete / Go-to-PR — same component the legacy list page uses. Right-clicking a task row inside the tasks/ subfolder opens a smaller TaskContextMenu with Interrupt (for orchestrator/completion/ running steps) and Mark complete / failed / skipped (for step rows). Step lifecycle calls require the directive_step.id, so FolderTaskRow now carries stepId alongside taskId. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(document-mode): folder layout v2, glow on pending, inline formatting, ↵soryu2026-04-301-30/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | autosave fix (#107) ## Autosave bug fix (top priority) The 250ms debounce on the localStorage draft write was racing the unmount cleanup: typing then navigating within 250ms cleared the pending timer *before* it flushed, which is exactly when we needed the draft saved. Drafts are now written synchronously on every keystroke. localStorage .setItem on a small string is sub-millisecond — the debounce was a premature optimisation. ## Sidebar v2 (document-directives.tsx) - Tasks now live in a `tasks/` subfolder inside each directive folder (orchestrator, completion, and started step tasks). The pinned `.md` document remains at the top of the directive folder. - Status circles moved to the RIGHT side only (previously rendered on both sides, which the user found noisy). - New `StatusDot` component composes the status colour with two optional modifiers: a "live" pulse when the orchestrator is running, and a GLOW (amber ring + pulse) when there is a pending user question for that directive or task. The glow is sourced from the existing SupervisorQuestionsContext, indexed by `directiveId` and `taskId`. - New `TaskIcon` (terminal) and `CompletionIcon` (PR-bracket) so orchestrator/step/completion entries look distinct from the .md file. ## Inline formatting in the editor (DocumentEditor.tsx) - New `MarkdownShortcutPlugin` (scoped to TEXT_FORMAT_TRANSFORMERS only) so typing `**foo**`, `*foo*`, `` `foo` ``, `~~foo~~` auto-formats inline. Block-level shortcuts (# heading, - list) are intentionally excluded so the document shape (H1 / goal / StepsBlock / trailing para) stays intact. - New `FloatingFormatToolbar` appears above any non-collapsed selection inside the goal paragraph, with B / I / U / S / </> buttons that dispatch FORMAT_TEXT_COMMAND. Buttons highlight when the corresponding format is active. Standard ⌘B / ⌘I / ⌘U keyboard shortcuts also work via the existing RichTextPlugin. - Round-trip via a small inline-only markdown serializer/parser so formatting persists across saves. Supported markers: `\``code\``, `***bold-italic***`, `**bold**`, `*italic* / _italic_`, `~~strike~~`. Underline survives within the editor session (toolbar / shortcut) but has no markdown syntax so it does not round-trip — by design. - No backend schema change: `directive.goal` is still a TEXT column, it just contains inline markdown now. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(document-mode): longer goal save countdown, per-directive folders, live ↵soryu2026-04-302-45/+559
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | task stream (#103) Three connected UX changes for the document-mode directive UI. ## Goal save UX (DocumentEditor.tsx) - Replace the old 3-second countdown with 60s when no orchestrator is running and 10s when one is, so editing a goal mid-flight does not feel rushed. - The countdown bar is hidden until the last 10 seconds; users see "Saved" / "Unsaved changes" indicators rather than a constantly-ticking clock. - Continuously persist work-in-progress to localStorage on every keystroke (debounced 250ms). On mount, if a draft for the directive exists in localStorage and differs from the persisted goal, restore it and put the editor in dirty/pending state — leaving the page no longer loses work. - localStorage-backed "Live start" toggle in the bar. When off, the editor stays in "dirty" instead of auto-firing; user clicks "Save now" to commit. - Discard button reverts the editor to the persisted goal and clears the draft. ## Sidebar restructure (document-directives.tsx) - Drop the active/idle/archived top-level grouping; show one folder per directive instead. Folders sort by lifecycle (active, paused, idle, draft, archived) then alphabetically. - Each folder header shows a colored status dot on BOTH sides (left as the primary status icon, right as a mirror plus a pulse when the orchestrator is live), replacing the previous "/active", "/idle" text labels. - Inside each open folder: the directive's document is pinned at the top (with a small star icon), then the orchestrator task (if running), then the completion task, then any step tasks that have started. - The currently-selected directive's folder is auto-opened so deep links always land somewhere visible. ## Live document task stream (DocumentTaskStream.tsx, new) - Selecting a task in a folder navigates to ?task=<id> and replaces the Lexical editor with a document-styled live transcript: assistant prose as flowing paragraphs, tool calls as marginalia, results as a closing block. No log/code box. - Comment textarea at the bottom calls sendTaskMessage on submit, the same wire the existing TaskOutput input bar uses for interrupts. ⌘/Ctrl-Enter submits. - Header breadcrumb gains a "back to document" affordance to return to the pinned doc view without reopening the sidebar. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat: document-mode directive UI proof of concept (Lexical) (#101)soryu2026-04-292-0/+945
| | | | | | | | | | | * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Backend: feature flag + goal-edit interrupt messaging * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Frontend: Lexical document editor with step blocks, context menu, countdown
* revert PRs #93-#98; enforce strict-linear-DAG + mandatory directive verify ↵soryu2026-04-281-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#100) * revert: roll back PRs #93-#98 to pre-Lexical baseline Reverts the entire chain of directive document UI work and the homepage redesign, restoring the working tree to the state at 3679ceb (before c8b169d / PR #93). PRs reverted: - #93 c8b169d feat: Document UI for directive orchestration with Lexical editor - #94 d6f01a6 fix: compilation error and warnings already merged via PR #93 - #95 5aa3faf fix: resolve compilation error and warnings in Rust backend - #97 d513f93 feat: document UI with contract blocks, expandable logs, and interaction controls - #96 6366941 feat: Redesign homepage with professional PC-98 styling - #98 d1fdfb1 feat: revert broken directive PRs, re-implement Lexical document orchestrator The directive Document UI experiments produced fragile output and merge artifacts; follow-up commits in this PR change orchestration to favor strictly linear DAGs and add goal/conflict verification so future runs do not require this kind of cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(directive): strict-linear-DAG planning + mandatory `directive verify` Tightens directive orchestration so the final PR almost never needs a hand-merge: 1. Planning prompts now strongly bias toward strictly linear DAGs. Parallel steps are reserved for genuinely independent work (e.g. disjoint modules); the default for "in doubt" is sequential. Linear chains inherit each previous step's worktree, so the final merge is typically just a rebase against the base branch. 2. New CLI command `makima directive verify` does a local in-memory `git merge-tree` of HEAD against `<remote>/<base>` and exits non-zero with a list of conflicting files if the PR would not merge cleanly. Pure-local — no API call, no working-tree mutation. 3. Completion / PR-creation prompts now mandate three pre-push checks: a. build (`cargo check` and/or `tsc --noEmit`), b. `makima directive verify --base <base_branch>` must exit 0, and c. an explicit goal-alignment self-check against the diff. The orchestrator is told NOT to push, create the PR, or call `makima directive update` until all three pass. Skipping any of them is documented as a directive failure. The combination means that with a linear DAG the final PR-creation task should almost never see a real conflict — when it does, that is treated as a planning bug to escalate rather than something to paper over with `-X theirs`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(frontend): TS errors pre-existing on master - TaskSlideOutPanel: declare missing `selectedFileDiff` / `selectedFilePath` state hooks that were referenced everywhere but never created, and re-balance the JSX so the `<>...</>` fragment in the non-diff branch is closed (the previous indentation/braces would not parse). - api.ts: add a `getWorktreeDiff` thin wrapper around `getTaskDiff` so TaskDetail's per-file click handler type-checks (the per-file slice is a future improvement; today both return the full task diff). - WorktreeFilesPanel: remove unused `isClickable` local; the gating already reads `onFileClick` directly inline. Run after revert: `npx tsc --noEmit` exits 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat: worktree diff/commit endpoints and frontend diff viewing (#88)soryu2026-03-091-23/+122
| | | | | | | | | | | | | * feat: soryu-co/soryu - makima: Fix worktree info failing when origin ref is missing * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add worktree commit endpoint and diff endpoint for regular users * feat: soryu-co/soryu - makima: Add frontend diff viewing with clickable worktree files
* fix: resolve merge conflicts with master (integrate DOG features into ↵makima/soryu-co-soryu---makima--resolve-merge-conflicts-i-f750d00dsoryu2026-03-092-13/+440
|\ | | | | | | | | | | | | | | | | | | | | | | | | compact header) - Resolved conflict in OrderDetail.tsx: kept PR compact header layout with inline badges while adding DOG badge from master - DOG selector in Actions section preserved from master - orders.tsx correctly passes dogs prop to OrderDetail (auto-merged correctly) - directives.tsx auto-merged correctly with DOG props for DirectiveDetail - Frontend builds successfully with no TypeScript errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| * WIP: heartbeat checkpointmakima/directive-soryu-co-soryu---makima-19fd3e1d-v1772803139soryu2026-03-072-13/+440
| |
* | feat: soryu-co/soryu - makima: Add right-click context menu to directives pagemakima/soryu-co-soryu---makima--add-right-click-context-m-6bf81c58soryu2026-03-072-2/+197
|/
* feat: task slide-out panel, 3-way reconcile toggle, daemon reauth fix (#85)soryu2026-03-044-27/+244
| | | | | | | | | | | * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Fix daemon reauth flow for new claude setup-token output format * feat: soryu-co/soryu - makima: Update frontend reconcile toggle to three-way switch * feat: soryu-co/soryu - makima: Add task slide-out panel to directive page
* feat: move daemon reauth to daemons page, add contract-backed directive ↵soryu2026-03-023-5/+24
| | | | | | | | | | | | | | | steps, rename Mesh to Exec (#84) * feat: soryu-co/soryu - makima: Rename Mesh to Exec in navigation * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add contract-backed steps to directive flow * WIP: heartbeat checkpoint
* fix: resolve frontend TypeScript build errorssoryu2026-02-222-45/+7
| | | | | | | | | | | | | - DirectiveDAG: fix layer rendering (afterSteps -> layer.steps with StepNode), remove unused imports (StepNode re-added, BEFORE_TYPES and OrchestratorStepNode removed) - DirectiveDetail: remove dead virtualSteps code superseded by specializedSteps - useMultiTaskSubscription: remove duplicate backfilledTasksRef declaration and dead backfillTask/convertTaskEventToEntry block referencing non-existent TaskEvent and listTaskEvents Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add directive ask command, log backfill & specialized DAG steps (#75)soryu2026-02-213-41/+325
| | | | | | | | | | | | | | | | | | | | | * feat: soryu-co/soryu - makima: Add makima directive ask CLI command * feat: soryu-co/soryu - makima: Update directive skill docs and planning prompt to support asking questions * feat: soryu-co/soryu - makima: Add log stream backfill for directive tasks * feat: soryu-co/soryu - makima: Update planning prompts to inform tasks they can ask questions * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add ask command to directive SKILL.md documentation * feat: soryu-co/soryu - makima: Add log stream backfill for directive task output history * feat: soryu-co/soryu - makima: Update planning prompt to tell planning tasks they can ask questions * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Show Planning, PR, and Cleanup tasks as specialized steps in DAG
* fix: reconcile:on blocking, pending question notifications, and infra ↵soryu2026-02-201-0/+17
| | | | | | | | | | | | | improvements (#73) * feat: soryu-co/soryu - makima: Fix contracts page overflow - constrain layout to viewport height * feat: soryu-co/soryu - makima: Add git fetch to create_worktree and improve completion prompt merge conflict handling * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add pending question notification badge to directive sidebar and nav * feat: soryu-co/soryu - makima: Fix reconcile:on blocking - make phaseguard poll indefinitely instead of returning immediately
* feat: smart cleanup, order linking, and improved PR titles (#69)soryu2026-02-171-15/+10
| | | | | | | | | | | | | * feat: soryu-co/soryu: Reorder navigation: move Orders before Contracts * feat: soryu-co/soryu: Generate PR titles from step content instead of directive title * feat: soryu-co/soryu: Add orderId field to step creation and link orders to steps * feat: soryu-co/soryu: Handle completed orders during plan-orders flow * WIP: heartbeat checkpoint * Merge origin/makima/soryu-co-soryu--handle-completed-orders-during-pla-5aa9a15b (resolved conflicts)
* soryu-co/soryu - makima (#66)soryu2026-02-161-1/+1
| | | | | | | | | | | * feat: soryu-co/soryu - makima: Fix contracts page scrolling overflow * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint
* Add PR button to directivessoryu2026-02-161-0/+16
|
* Add pick-up-orders feature for directives (#64)soryu2026-02-161-0/+35
| | | | | | | | | * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add frontend pick-up-orders button and API integration * feat: soryu-co/soryu - makima: Add pick-up-orders backend endpoint and repository functions
* Makima system improvements: Orders, directive questions, PR creation fix, ↵soryu2026-02-141-2/+137
| | | | | | | | | | | | | | | | | | | | | | | bug fixes (#62) * feat: soryu-co/soryu - makima: Fix directive goal update bug - stale closure issue * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Create Orders database schema and backend API * feat: soryu-co/soryu - makima: Fix task Claude instance not receiving user inputs from input box * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Build Orders frontend page replacing the Board page * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Fix directive PR creation system
* Directive page improvementssoryu2026-02-131-1/+11
|
* Fix worktree branching for directive tasks and remove memoriessoryu2026-02-131-229/+1
|
* Fix frontend buildsoryu2026-02-131-36/+5
|
* Add task cleanup and directive PR updatingsoryu2026-02-121-3/+16
|
* makima: Add an optional memory system for directives (#59)soryu2026-02-122-2/+683
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: makima: Add an optional memory system for directives: Add directive_memories database table and migration * feat: makima: Add an optional memory system for directives: Update directive skill documentation with memory commands * feat: makima: Add an optional memory system for directives: Add repository functions for directive memory CRUD * feat: makima: Add an optional memory system for directives: Add frontend API functions and types for directive memory * feat: makima: Add an optional memory system for directives: Add Rust models for directive memory * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: makima: Add an optional memory system for directives: Add memory panel to frontend DirectiveDetail component * Merge remote-tracking branch 'origin/makima/makima--add-an-optional-memory-system-for-directiv-5de1e06d' into combined branch * Merge remote-tracking branch 'origin/makima/makima--add-an-optional-memory-system-for-directiv-c8298c6c' into combined branch * feat: makima: Add an optional memory system for directives: Create useMultiTaskSubscription hook for multi-output WebSocket streaming * feat: makima: Add an optional memory system for directives: Create DirectiveLogStream component for stern-like multi-task output viewing * feat: makima: Add an optional memory system for directives: Integrate log stream panel into directive detail page
* Fix DAG orderingsoryu2026-02-111-29/+11
|
* Add auto-PR creation for remote repos in directivessoryu2026-02-101-0/+34
|
* Add directive initsoryu2026-02-092-0/+24
|
* Add new directive mechanism v3soryu2026-02-094-0/+472
|
* Remove directive mechanismsoryu2026-02-084-1029/+0
|
* Fix directive evaluation and add to frontendsoryu2026-02-082-3/+72
|
* Fix directive deletion and stop local only on contractssoryu2026-02-082-232/+237
|
* Fix directive page stylingsoryu2026-02-072-61/+78
|
* Change directive pagesoryu2026-02-071-7/+0
|
* Add directive monitor contractssoryu2026-02-073-105/+571
|
* Show directive init on frontendsoryu2026-02-071-24/+156
|
* Add directive init mechanismsoryu2026-02-071-8/+20
|
* Add new directive initial implementationsoryu2026-02-072-0/+335
|
* Remove directives for reimplementationsoryu2026-02-0712-1035/+0
|
* Fix: Cleanup old chain codesoryu2026-02-0612-0/+1035