diff --git a/docs/operations.md b/docs/operations.md index ff96e6c..ad504b3 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -313,7 +313,7 @@ A workflow is a named graph of stages, each a stage name, the stages it comes af - **Starting.** The lead's `create_task` and `start_todo` take an optional `workflow` (404 when there is none of that name) and then start a run of it instead of an agent on the prompt (`Manager.StartWorkflow`); `model` together with `workflow` is refused, since each stage names its own. `POST /api/projects/{id}/tasks` takes the same optional `workflow`, with the title as the run's brief, and returns the run's first stage task. The task switcher (`web/src/switcher.ts`) offers it as a "Start workflow…" row after each "New task in …" row: picking that lists `GET /api/workflows`, filtered by what is typed next (Esc goes back to the task list), and picking a workflow starts the run with the typed title and opens its first stage task. A run gets a new id and creates a task for every stage with no `after` stages, branched from the default branch, or for a stage with `base: parent`, from the lead's `from_task_id` HEAD when given. Each stage task copies the workflow's name and definition as they are when the run starts into `tasks.workflow_name` and `tasks.workflow_definition`, so later saves or deletes don't change it; its brief into `tasks.workflow_brief` (the lead's `create_task` `prompt`, optional with a workflow and may be empty, or for `start_todo` the TODO item as `todoPrompt` words it); the run's title into `tasks.workflow_title`; the run id into `tasks.workflow_run`; and its stage's name into `tasks.workflow_stage`. Stage tasks are titled `: <stage>`, with the run's title as their merge title, and carry the run's TODO item. The Task's `workflow`, `workflow_run` and `workflow_stage` are those; `GET /api/tasks/{id}/workflow` returns the copy as `{name, definition}` with the definition as YAML (404 for a task without one). A task agent's `create_subtask`, `POST /api/projects/{id}/tasks` without `workflow` and the Project tab's Start create tasks without one. A fork of a stage task copies its frozen workflow, brief, title, run and stage, so it is another attempt at the same stage of the same run. `sqlite3 byre.db "SELECT id, status, workflow_stage, stage_output != '' FROM tasks WHERE workflow_run = '<run>'"` lists a run's tasks and which have finished. - **Stages.** A stage task's agent is an implementer session on the stage's model, created by the user who started the run; any later session of the task (a Compact handoff's, one started by a message) runs the same stage, since the stage belongs to the task. Starting a stage records a `task.workflow_stage` event on its task (`workflow`, `run`, `stage` the name, `after` the ids of the tasks whose outputs it gets; actor the lead for the stages a run starts with, `byre` after) and sends the session its first message, actor `byre`, so the transcript shows it collapsed under its first line: `Workflow "<name>", stage "<stage>"`, then the stage's prompt, a `## Brief` section when the brief isn't empty, a `## From stage "<stage>" (task <id>, branch <branch>)` section with each `after` stage's output, and a line saying where the task starts: from the default branch, with the branches above to `git merge` or read as it needs, or from the commit its one `after` stage finished at. Nothing else of earlier stages is passed on; their branches carry their work. - **Advancing.** A stage session gets the `finish_stage` tool (`output`, required) and a guidance line naming the workflow, its stage and the stages after it. The call stores the output in `agent_sessions.stage_output`, replacing any earlier one; it is refused once the task's stage has finished. When a turn of that session ends normally (not an error or interrupt, not a handoff, not a Merge turn that squashes) with an output stored, byre sets `agent_sessions.stage_finished` before marking the session idle, and then advances (`nextStage`): it records the output and the worktree's HEAD in `tasks.stage_output` and `tasks.stage_commit`, then, holding `workflowMu` so two stages finishing at once can't both start the one after them, goes through each stage after this one. A stage starts once every stage it comes after has a finished task in the run (the latest one, when a fork made several); its task branches from that task's `stage_commit` for `base: parent` with one `after` stage, else from the default branch. Once every stage after it has been dealt with, byre clears `stage_output` and `stage_finished` on the session. The session stays idle in its task for more messages, and queued messages and held answers are delivered to it once advancing is done. When the final stage finishes, byre starts discarding every other active task of the run (as `byre`, through the same `Discard` as the button, so each gets its summary turn first and closes when that turn ends; one already merging or being discarded is skipped and logged as `stage task not discarded`), then records `task.workflow_finished` (`workflow`, `output`) on the final task and clears the flags in the same transaction, leaving the final task for the human to merge. A turn that ends without the call leaves the task in its stage. The output belongs to the turn that stored it: when that turn ends any other way (an error, an interrupt, a handoff, a Merge turn that squashes, an agent process that exits mid-turn, or a session that can't be resumed after a restart), byre clears `stage_output` before marking the session idle, so a later turn can't hand off a stale output; the agent calls `finish_stage` again. A turn cut off by a byre restart and resumed keeps it. If a stage can't start, byre logs `advance workflow stage` and files the error in the finishing task's inbox, and the flag stays set. On startup, before resuming running sessions, `recoverStages` advances every session with `stage_finished` set, skipping the steps already done: the recorded output isn't overwritten; a stage that already has a task in the run isn't created again, but when that task is active and has no session, its session is started, and when its session never got a message (`SessionStarted`), it is sent the stage's first message, and the restart notice isn't sent to it. `sqlite3 byre.db 'SELECT id, task_id FROM agent_sessions WHERE stage_finished = 1'` lists stages waiting to advance. `list_tasks` shows each stage task's workflow and `stage "<name>"`, with `(finished)` once its stage has finished and `workflow finished` once any task of the run has a `task.workflow_finished` event. Nothing reads or writes `agent_sessions.workflow_stage`; it stays in the schema so builds from older branches keep working against the same database. -- **Progress.** `GET /api/tasks/{id}/workflow/run` (`Manager.WorkflowRun`) returns the run of a stage task (404 for a task without one): the definition that task froze (typed, not YAML), name, title, brief, `finished` (any task of the run has `task.workflow_finished`), and per stage in definition order its resolved `after`, `waiting_on` (the `after` stages with no finished attempt), its `attempts` and a `state`. An attempt is every task of the run at that stage, closed ones included, oldest first (the first and its forks), with its `output` and `commit` once `tasks.stage_output` is set, `forked_from`, `discarded_by` (the `task.discarded` actor) and `inputs`: the tasks named in the `after` of its latest `task.workflow_stage` event, each with its stage, so it says which attempt fed it; a fork has no such event and takes its source's. An attempt's state is `merged`, `cleaned_up` (discarded after finishing; `byre` as `discarded_by` is the final stage's cleanup), `discarded` (before finishing), `finished`, `running` (a session is running) or `idle`. A stage is `waiting` with no attempts, else it takes the state of its latest finished attempt, or its latest attempt when none finished. The Workflow tab (`web/src/workflow.ts`) draws the graph once per run with the lazy-loaded Mermaid, then a card per stage with its state, its attempts linking to their tasks, each attempt's inputs ("started from") and the attempts it fed, and its output collapsed as Markdown. It refetches on any stored `task.*` or `session.*` event of a task in the run, and on a `task.created` whose payload carries the run, so a new stage or fork shows up. +- **Progress.** `GET /api/tasks/{id}/workflow/run` (`Manager.WorkflowRun`) returns the run of a stage task (404 for a task without one): the definition that task froze (typed, not YAML), name, title, brief, `finished` (any task of the run has `task.workflow_finished`), and per stage in definition order its resolved `after`, `waiting_on` (the `after` stages with no finished attempt), its `attempts` and a `state`. An attempt is every task of the run at that stage, closed ones included, oldest first (the first and its forks), with its `output` and `commit` once `tasks.stage_output` is set, `forked_from`, `discarded_by` (the `task.discarded` actor) and `inputs`: the tasks named in the `after` of its latest `task.workflow_stage` event, each with its stage, so it says which attempt fed it; a fork has no such event and takes its source's. An attempt's state is `merged`, `cleaned_up` (discarded after finishing; `byre` as `discarded_by` is the final stage's cleanup), `discarded` (before finishing), `finished`, `running` (a session is running) or `idle`. A stage is `waiting` with no attempts, else it takes the state of its latest finished attempt, or its latest attempt when none finished. The Workflow tab (`web/src/workflow.ts`) draws the graph with the lazy-loaded Mermaid, each stage's node coloured by its state (`stateColors`, from the palette's tint and accent pairs: waiting grey, running accent, idle warn, finished, merged and cleaned up ok, discarded danger) and redrawn in place, keeping the old drawing until the new one is ready, whenever a refetch changes a state; then a card per stage with its state, its attempts linking to their tasks, each attempt's inputs ("started from") and the attempts it fed, and its output collapsed as Markdown. It refetches on any stored `task.*` or `session.*` event of a task in the run, and on a `task.created` whose payload carries the run, so a new stage or fork shows up. ## Events diff --git a/web/dist/mermaid.js b/web/dist/mermaid.js index 3692a62..75b1f12 100644 --- a/web/dist/mermaid.js +++ b/web/dist/mermaid.js @@ -42,6 +42,24 @@ export function diagram(src) { void render(el, src); return el; } +const latest = new WeakMap(); +export async function redraw(el, src) { + const id = next++; + latest.set(el, id); + try { + const m = await load(); + const { svg } = await m.render(`mermaid-${id}`, src); + if (latest.get(el) === id) { + el.innerHTML = svg; + } + } + catch (err) { + if (latest.get(el) !== id) { + return; + } + el.replaceChildren(h("pre", { class: "mermaid-source" }, src), h("div", { class: "mermaid-error" }, `diagram not rendered: ${errorText(err)}`)); + } +} async function render(el, src) { try { const m = await load(); diff --git a/web/dist/mermaid.js.map b/web/dist/mermaid.js.map index dcb482c..3dbda5d 100644 --- a/web/dist/mermaid.js.map +++ b/web/dist/mermaid.js.map @@ -1 +1 @@ -{"version":3,"file":"mermaid.js","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,E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;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QACD,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,yBAAyB,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAClJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,EAAe,EAAE,GAAW;IAChD,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QACzD,EAAE,CAAC,SAAS,GAAG,GAAG,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,yBAAyB,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/web/dist/workflow.js b/web/dist/workflow.js index 18fbf9d..fb317c0 100644 --- a/web/dist/workflow.js +++ b/web/dist/workflow.js @@ -1,13 +1,27 @@ import { get } from "./api.js"; import { errorText, h, replace } from "./dom.js"; import { markdown } from "./markdown.js"; -import { diagram } from "./mermaid.js"; +import { diagram, redraw } from "./mermaid.js"; import { findTask, focusTask, onEach, state } from "./state.js"; +const stateColors = { + waiting: ["--surface", "--border", "--muted"], + running: ["--accent-tint", "--accent", "--text"], + idle: ["--warn-tint", "--warn", "--text"], + finished: ["--ok-tint", "--ok", "--text"], + merged: ["--ok-tint", "--ok", "--text"], + cleaned_up: ["--ok-tint", "--ok", "--text"], + discarded: ["--danger-tint", "--danger", "--text"], +}; function graph(run) { + const css = getComputedStyle(document.documentElement); + const v = (name) => css.getPropertyValue(name).trim(); const id = new Map(run.stages.map((s, i) => [s.name, `s${i}`])); const lines = ["flowchart TD"]; + for (const [state, [fill, stroke, text]] of Object.entries(stateColors)) { + lines.push(` classDef ${state} fill:${v(fill)},stroke:${v(stroke)},color:${v(text)}`); + } for (const s of run.stages) { - lines.push(` ${id.get(s.name)}["${s.name.replaceAll('"', "#quot;")}"]`); + lines.push(` ${id.get(s.name)}["${s.name.replaceAll('"', "#quot;")}"]:::${s.state}`); } for (const s of run.stages) { for (const a of s.after) { @@ -75,6 +89,8 @@ export function mountWorkflow(root) { const list = h("div", { class: "workflow-body" }); let run; let drawnRun = ""; + let drawnSrc = ""; + let drawn; let error = ""; let target = 0; let loading = false; @@ -122,6 +138,7 @@ export function mountWorkflow(root) { replace(head); replace(graphBox); drawnRun = ""; + drawn = undefined; replace(list, h("div", { class: "empty" }, task ? "This task isn't part of a workflow run." : "No task selected.")); return; } @@ -134,9 +151,16 @@ export function mountWorkflow(root) { return; } replace(head, h("span", { class: "workflow-name" }, run.name), h("span", { class: "workflow-title" }, run.title), h("span", { class: `workflow-state ${run.finished ? "finished" : "running"}` }, run.finished ? "workflow finished" : "in progress")); - if (drawnRun !== run.run) { + const src = graph(run); + if (drawnRun !== run.run || !drawn) { drawnRun = run.run; - replace(graphBox, diagram(graph(run))); + drawnSrc = src; + drawn = diagram(src); + replace(graphBox, drawn); + } + else if (drawnSrc !== src) { + drawnSrc = src; + void redraw(drawn, src); } replace(list, run.brief.trim() ? h("details", { class: "workflow-brief" }, h("summary", {}, "Brief"), markdown(run.brief, "md", { taskId: task.id })) : null, h("ol", { class: "workflow-stages" }, ...run.stages.map((s) => stageCard(run, s)))); }; diff --git a/web/dist/workflow.js.map b/web/dist/workflow.js.map index 6726da2..7129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,GAAG,EAAE,CAAC;YACX,MAAM,EAAE,CAAC;YACT,KAAK,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;QACF,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE;YACrB,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC/B,KAAK,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC,CAAC;QACF,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;YACvB,IAAI,QAAQ,CAAC,EAAe,CAAC,EAAE,CAAC;gBAC9B,KAAK,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC,CAAC;KACH,CAAC;IAEF,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAClH,MAAM,EAAE,CAAC;IACT,KAAK,IAAI,EAAE,CAAC;IACZ,OAAO,GAAG,EAAE;QACV,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,GAAG,EAAE,CAAC;QACR,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/web/src/mermaid.ts b/web/src/mermaid.ts index 1da3d2a..defbaa0 100644 --- a/web/src/mermaid.ts +++ b/web/src/mermaid.ts @@ -57,6 +57,25 @@ export function diagram(src: string): HTMLElement { return el; } +const latest = new WeakMap<HTMLElement, number>(); + +export async function redraw(el: HTMLElement, src: string) { + const id = next++; + latest.set(el, id); + try { + const m = await load(); + const { svg } = await m.render(`mermaid-${id}`, src); + if (latest.get(el) === id) { + el.innerHTML = svg; + } + } catch (err) { + if (latest.get(el) !== id) { + return; + } + el.replaceChildren(h("pre", { class: "mermaid-source" }, src), h("div", { class: "mermaid-error" }, `diagram not rendered: ${errorText(err)}`)); + } +} + async function render(el: HTMLElement, src: string) { try { const m = await load(); diff --git a/web/src/workflow.ts b/web/src/workflow.ts index e743927..ed5624f 100644 --- a/web/src/workflow.ts +++ b/web/src/workflow.ts @@ -1,18 +1,33 @@ import { get, type ByreEvent, type Schemas } from "./api.js"; import { errorText, h, replace } from "./dom.js"; import { markdown } from "./markdown.js"; -import { diagram } from "./mermaid.js"; +import { diagram, redraw } from "./mermaid.js"; import { findTask, focusTask, onEach, state } from "./state.js"; type WorkflowRun = Schemas["WorkflowRun"]; type RunStage = Schemas["WorkflowRunStage"]; type Attempt = Schemas["StageAttempt"]; +const stateColors: Record<RunStage["state"], [fill: string, stroke: string, text: string]> = { + waiting: ["--surface", "--border", "--muted"], + running: ["--accent-tint", "--accent", "--text"], + idle: ["--warn-tint", "--warn", "--text"], + finished: ["--ok-tint", "--ok", "--text"], + merged: ["--ok-tint", "--ok", "--text"], + cleaned_up: ["--ok-tint", "--ok", "--text"], + discarded: ["--danger-tint", "--danger", "--text"], +}; + function graph(run: WorkflowRun): string { + const css = getComputedStyle(document.documentElement); + const v = (name: string) => css.getPropertyValue(name).trim(); const id = new Map(run.stages.map((s, i) => [s.name, `s${i}`])); const lines = ["flowchart TD"]; + for (const [state, [fill, stroke, text]] of Object.entries(stateColors)) { + lines.push(` classDef ${state} fill:${v(fill)},stroke:${v(stroke)},color:${v(text)}`); + } for (const s of run.stages) { - lines.push(` ${id.get(s.name)}["${s.name.replaceAll('"', "#quot;")}"]`); + lines.push(` ${id.get(s.name)}["${s.name.replaceAll('"', "#quot;")}"]:::${s.state}`); } for (const s of run.stages) { for (const a of s.after) { @@ -113,6 +128,8 @@ export function mountWorkflow(root: HTMLElement): () => void { const list = h("div", { class: "workflow-body" }); let run: WorkflowRun | undefined; let drawnRun = ""; + let drawnSrc = ""; + let drawn: HTMLElement | undefined; let error = ""; let target = 0; let loading = false; @@ -161,6 +178,7 @@ export function mountWorkflow(root: HTMLElement): () => void { replace(head); replace(graphBox); drawnRun = ""; + drawn = undefined; replace(list, h("div", { class: "empty" }, task ? "This task isn't part of a workflow run." : "No task selected.")); return; } @@ -178,9 +196,15 @@ export function mountWorkflow(root: HTMLElement): () => void { h("span", { class: "workflow-title" }, run.title), h("span", { class: `workflow-state ${run.finished ? "finished" : "running"}` }, run.finished ? "workflow finished" : "in progress"), ); - if (drawnRun !== run.run) { + const src = graph(run); + if (drawnRun !== run.run || !drawn) { drawnRun = run.run; - replace(graphBox, diagram(graph(run))); + drawnSrc = src; + drawn = diagram(src); + replace(graphBox, drawn); + } else if (drawnSrc !== src) { + drawnSrc = src; + void redraw(drawn, src); } replace( list, diff --git a/web/style.css b/web/style.css index ea07fc2..9d0ebfd 100644 --- a/web/style.css +++ b/web/style.css @@ -49,6 +49,7 @@ --warn: #855600; --warn-tint: #fdf3dc; --ok: #1a7f37; + --ok-tint: #e5f4e9; --task-0: #a4273f; --task-1: #9f3501; --task-2: #376e00; @@ -81,6 +82,7 @@ --warn: #f2c66d; --warn-tint: #352a14; --ok: #7fd88f; + --ok-tint: #1b3322; --task-0: #fe9fa6; --task-1: #ffa383; --task-2: #99d079;