<feed xmlns='http://www.w3.org/2005/Atom'>
<title>soryu/makima/frontend/src/hooks, branch drop-directive-goal</title>
<subtitle>soryu-co/soryu mirror</subtitle>
<id>http://src.eirin.xyz/soryu/atom?h=drop-directive-goal</id>
<link rel='self' href='http://src.eirin.xyz/soryu/atom?h=drop-directive-goal'/>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/'/>
<updated>2026-05-08T15:33:36+00:00</updated>
<entry>
<title>feat(directives): drop directives.goal — orchestration reads contract body</title>
<updated>2026-05-08T15:33:36+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-05-08T15:33:36+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=7af816032fbc54d5e0a8e94d4a000f307cd3b370'/>
<id>urn:sha1:7af816032fbc54d5e0a8e94d4a000f307cd3b370</id>
<content type='text'>
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 &amp; 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: &amp;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 &amp; 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) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat(doc-mode): unified surface — ephemeral tasks, tmp/, /exec redirect, palette, SWR (#117)</title>
<updated>2026-05-01T17:06:38+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-05-01T17:06:38+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=80085c7cfa9d679ed3e3fd54a7d55fa8ab1addef'/>
<id>urn:sha1:80085c7cfa9d679ed3e3fd54a7d55fa8ab1addef</id>
<content type='text'>
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/&lt;directiveId&gt;?task=&lt;taskId&gt;`. Otherwise renders the
  legacy `MeshPage` as before.
- New `/tmp/:taskId` route renders `DocumentTaskStream` standalone for
  orphan tasks, with the masthead and a `tmp / &lt;slug&gt;` breadcrumb.

Co-authored-by: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;</content>
</entry>
<entry>
<title>feat: document-mode directive UI proof of concept (Lexical) (#101)</title>
<updated>2026-04-29T00:10:11+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-04-29T00:10:11+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=4b1d608b839769052634b4facc345b891d468926'/>
<id>urn:sha1:4b1d608b839769052634b4facc345b891d468926</id>
<content type='text'>
* 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</content>
</entry>
<entry>
<title>feat: soryu-co/soryu - makima: Add DOG frontend types, API client, and hooks</title>
<updated>2026-03-07T02:27:41+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-03-05T23:14:01+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=b8ec238084d9d5b210a67bc8c8cbb9a293facf28'/>
<id>urn:sha1:b8ec238084d9d5b210a67bc8c8cbb9a293facf28</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: restore backfilledTasksRef and fix unused var in daemons route</title>
<updated>2026-02-22T15:29:28+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-22T15:29:28+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=0c00b6aa26baf49ba02164cd44aab16f9c804bbd'/>
<id>urn:sha1:0c00b6aa26baf49ba02164cd44aab16f9c804bbd</id>
<content type='text'>
- Re-add backfilledTasksRef declaration that was stripped
- Remove unused _response variable and RestartDaemonResponse import
  in daemons.tsx

Co-Authored-By: Claude Opus 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix: resolve frontend TypeScript build errors</title>
<updated>2026-02-22T15:26:46+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-22T15:23:24+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=28f69e923cb7ee711b56fad07fb2d5b5220ce127'/>
<id>urn:sha1:28f69e923cb7ee711b56fad07fb2d5b5220ce127</id>
<content type='text'>
- DirectiveDAG: fix layer rendering (afterSteps -&gt; 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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: Add daemon page with download binary and Cloudflare Agent setup (#77)</title>
<updated>2026-02-22T14:39:14+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-22T14:39:14+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=6a34a6f3c423a7c57616762eb4cea2b7da52eaf3'/>
<id>urn:sha1:6a34a6f3c423a7c57616762eb4cea2b7da52eaf3</id>
<content type='text'>
* feat: soryu-co/soryu - makima: Create DaemonList and DaemonDetail page components

* feat: soryu-co/soryu - makima: Add daemon page routes, CSS styles, and navigation

* feat: soryu-co/soryu - makima: Create daemon page with download and monitoring

* WIP: heartbeat checkpoint

* WIP: heartbeat checkpoint

* feat: soryu-co/soryu - makima: Integrate Cloudflare Agent setup into daemon page</content>
</entry>
<entry>
<title>feat: add directive ask command, log backfill &amp; specialized DAG steps (#75)</title>
<updated>2026-02-21T19:33:44+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-21T19:33:44+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=d670dcb72984cfa483063d161bb468704038895c'/>
<id>urn:sha1:d670dcb72984cfa483063d161bb468704038895c</id>
<content type='text'>
* 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</content>
</entry>
<entry>
<title>feat: smart cleanup, order linking, and improved PR titles (#69)</title>
<updated>2026-02-17T16:48:39+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-17T16:48:39+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=aee6cda5fc8c44ebc45b274d07a1ed64052e3699'/>
<id>urn:sha1:aee6cda5fc8c44ebc45b274d07a1ed64052e3699</id>
<content type='text'>
* 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)</content>
</entry>
<entry>
<title>Fix contracts page overflow, remove contract link from orders, add directive name (#65)</title>
<updated>2026-02-16T17:59:38+00:00</updated>
<author>
<name>soryu</name>
<email>soryu@soryu.co</email>
</author>
<published>2026-02-16T17:59:38+00:00</published>
<link rel='alternate' type='text/html' href='http://src.eirin.xyz/soryu/commit/?id=b3de779d87450033f1e0361144c621a1d5f1dbf8'/>
<id>urn:sha1:b3de779d87450033f1e0361144c621a1d5f1dbf8</id>
<content type='text'>
* feat: soryu-co/soryu - makima: Add frontend pick-up-orders button and API integration

* WIP: heartbeat checkpoint

* feat: soryu-co/soryu - makima: Remove contract link from orders and add directive name to order metadata (frontend)

* fix: contracts page overflow - use contained scrolling layout

Changed the contracts page to use contained scrolling matching the
orders/directives pages, preventing the page from growing beyond
viewport height.

Co-Authored-By: Claude Opus 4.6 &lt;noreply@anthropic.com&gt;

* fix: resolve completion_task_id FK violation and duplicate button

The completion_task_id column has an FK to tasks(id), but
claim_directive_for_completion was being called with a placeholder UUID
that did not exist in the tasks table, causing FK constraint violations.

Fix: Create the task FIRST via create_task_for_owner, then use the real
task.id when calling claim_directive_for_completion. Applied in all three
locations: phase_completion Part 1 (idle directives), Part 3 (verification
tasks), and trigger_completion_task (manual PR creation).

Also removes a duplicate "Pick Up Orders" button in DirectiveDetail.tsx.

* fix: restore Order type changes lost during rebase conflict resolution

Re-apply changes from the orders-refactor commit that were dropped when
resolving rebase conflicts with --ours:
- Replace contractId with directiveName in Order interface
- Make directiveId required in CreateOrderRequest
- Remove contractId from UpdateOrderRequest
- Change listOrders parameter from contractId to search
- Remove linkOrderToContract function
- Simplify convertOrderToStep to single argument

---------

Co-authored-by: Claude Opus 4.6 &lt;noreply@anthropic.com&gt;</content>
</entry>
</feed>
