feat: task decomposition view during execution (#5)
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
At the start of job execution, a Haiku call decomposes the user's request into 2-4 named sub-steps. Steps are broadcast via WebSocket as `job_steps` and `job_step_update` events. The Workshop renders a live checklist panel near Gamma that checks off steps as streaming progresses using a character-count heuristic, then collapses to "Done" on completion. Steps are stored with the job record. - agent.ts: add `decomposeRequest` (Haiku, stub-safe) - event-bus.ts: add `DecompositionEvent` types (job:steps, job:step_update) - jobs.ts: call decompose before streaming; advance steps heuristically - events.ts: translate new bus events to WS messages - websocket.js: handle job_steps / job_step_update / collapse on complete - ui.js: showJobSteps / updateJobStep / collapseJobSteps panel - jobs schema: decomposition_steps text column - migration 0010: add decomposition_steps column Fixes #5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
4
lib/db/migrations/0010_task_decomposition.sql
Normal file
4
lib/db/migrations/0010_task_decomposition.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Task decomposition view (#5)
|
||||
-- Stores the Haiku-generated step labels for a job execution as a JSON array.
|
||||
|
||||
ALTER TABLE jobs ADD COLUMN IF NOT EXISTS decomposition_steps TEXT;
|
||||
@@ -52,6 +52,10 @@ export const jobs = pgTable("jobs", {
|
||||
refundState: text("refund_state").$type<"not_applicable" | "pending" | "paid">(),
|
||||
refundPaymentHash: text("refund_payment_hash"),
|
||||
|
||||
// ── Task decomposition (#5) ──────────────────────────────────────────────
|
||||
// JSON array of 2-4 step labels generated by Haiku at execution start.
|
||||
decompositionSteps: text("decomposition_steps"),
|
||||
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user