docs(ultra): design planned work visibility
b2fd0e8b326e7ab19a3507b1ebea65f7410f2534
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 3ce30eaafcde
bugabingas pi extensions
b2fd0e8b326e7ab19a3507b1ebea65f7410f2534
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+130 / −0 text lines
new file mode 100644+11 / −0 text lines
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Icon-led agent ledger</title></head><body><style>.u{background:#111;color:#ddd;font:14px/1.55 'JetBrainsMono Nerd Font','Symbols Nerd Font Mono',ui-monospace,SFMono-Regular,Consolas,monospace;padding:18px 20px;border:1px solid #444;max-width:840px}.dim{color:#777}.run{color:#ffd166}.queue{color:#aeb6c2}.later{color:#82aaff}.cond{color:#c792ea}.ok{color:#7fca8a}.bad{color:#ef6f6c}.title{color:#fff;font-weight:700}.row{margin-top:8px}.icon{display:inline-block;width:20px;text-align:center}.meta{padding-left:24px;color:#777}.sep{height:1px;background:#292929;margin:12px 0}.legend{display:grid;grid-template-columns:repeat(3,max-content);gap:5px 22px;margin-top:17px;padding-top:11px;border-top:1px solid #292929;color:#888}.legend span{white-space:nowrap}</style><div class="u"><div class="title">⏳ ultra · workflow-name · 1 active · 2 queued · 2 later phases</div><div class="sep"></div><div class="row"><span class="icon ok"></span> research#0 · done</div><div class="row"><span class="icon run"></span> audit#0 · running</div><div class="meta">└ action read phase-1-plan.md</div><div class="row"><span class="icon queue"></span> audit#1 · queued <span class="dim">· waiting for concurrency slot</span></div><div class="row"><span class="icon queue"></span> repair#0 · queued <span class="dim">· starts after audit</span></div><div class="row"><span class="icon later"></span> verify · agents not planned yet</div><div class="meta">└ earlier results determine which agents are needed</div><div class="row"><span class="icon cond"></span> publish · conditional</div><div class="meta">└ earlier results determine whether this phase runs</div><div class="row"><span class="icon bad"></span> cleanup#0 · dropped <span class="dim">· provider error</span></div><div class="legend"><span><b class="ok"></b> done</span><span><b class="run"></b> running</span><span><b class="queue"></b> queued</span><span><b class="later"></b> agents pending</span><span><b class="cond"></b> conditional</span><span><b class="bad"></b> dropped</span></div></div></body></html>new file mode 100644+119 / −0 text lines
# Ultra Planned Work Visibility Design## GoalShow every workflow phase before execution and distinguish known queued agents from work whose agent count or run decision depends on earlier results.Keep the collapsed tool view compact and preserve current orchestration semantics.## Mockups- [Icon-led agent ledger](./2026-07-13-ultra-planned-work-visibility-design-mockup-agent-ledger-icons.html)## PrinciplesThe workflow specification defines every phase at run start.A phase without `when` has a known run decision.A `single` phase has one known agent.A `fanout` with a literal `over` array has a known agent count.A `fanout` with an interpolated `over` has an unknown agent count until that phase resolves.A phase with `when` has an unknown run decision until that phase resolves.Planning visibility does not alter phase ordering, interpolation, concurrency, journaling, cancellation, or results.## Progress Model`UltraProgressEvent` becomes a discriminated union with three event families.An agent event retains the existing `start`, `action`, `delta`, and `end` kinds and requires `agentId`.A workflow plan event carries all phases once at run start.A phase event updates one phase when its condition and fan-out resolve or when it finishes.Each planned phase has:- `phase`: phase id.- `status`: `resolved`, `agents-pending`, `condition-pending`, `done`, or `skipped`.- `agentIds`: known agent ids when status is `resolved` or `done`.Each agent row has status `queued`, `running`, `done`, or `dropped`.## Initial PlanningBefore the first phase executes, the engine emits one workflow plan event in specification order.For a phase with `when`, initial status is `condition-pending` and no agent rows exist.For an unconditional `single` phase, initial status is `resolved` with `<phase>#0` queued.For an unconditional literal `fanout`, initial status is `resolved` with one queued row per array item.For an unconditional interpolated `fanout`, initial status is `agents-pending` and no agent rows exist.The engine does not speculate by partially evaluating interpolated selectors early.This keeps planning independent of selector internals and reliable for every valid workflow.## State TransitionsWhen the engine reaches a phase, it evaluates `when` using the existing selector resolver.A false condition emits `skipped` and runs no agents.A true or absent condition resolves the phase's items and emits `resolved` with exact agent ids before the concurrency pool launches workers.A queued agent becomes `running` on its existing `start` event.It becomes `done` or `dropped` on its existing `end` event.A journal hit still transitions queued to running to done through the engine's synthetic events.After all slots settle, the engine emits phase `done`.If cancellation leaves queued items unlaunched, the engine emits dropped end events for those planned agent ids so no row remains falsely queued.## Reducer`ReducerState.phases` stores planned phase records in specification order instead of phase ids discovered from agent events.The reducer seeds queued agent rows from the workflow plan event.A phase `resolved` event replaces that phase's planned agent set while preserving matching rows.A phase `skipped` event removes any provisional agent rows for that phase.Agent events continue to upsert rows by `agentId` and retain metadata, controls, usage, actions, and transcripts.Derived counts include:- `queued`: agent rows waiting to launch.- `running`: active agent rows.- `done`: successful terminal rows.- `dropped`: failed terminal rows.- `later`: phases with `agents-pending` or `condition-pending` status.The current phase changes only when the engine emits the phase-resolution event, not when the initial plan is seeded.## RenderingCollapsed workflow tool output remains counts-only and keeps the configured expand hint.Its header adds active, queued, and later counts without showing per-agent content.Expanded tool output and the command overlay render phases in specification order.Resolved phases render their agent rows.`agents-pending`, `condition-pending`, and `skipped` phases render one explanatory phase row.A resolved phase with zero agents renders one `done · no agents` phase row after completion.State icons use verified Nerd Font glyphs plus textual labels:- `` done.- `` running.- `` queued.- `` agents pending.- `` conditional.- `` dropped.Labels remain mandatory so missing glyph support never hides meaning.Skipped phases use a plain Unicode minus marker and the `skipped` label.The overlay focuses only agent rows.Planning placeholders are visible but not focusable, steerable, or abortable.## CompatibilityWorkflow specifications and result JSON do not change.The change affects only in-process progress events and reducer details stored in tool updates.`renderUltraResult()` continues to reject foreign or stale detail shapes and falls back to an empty board.## TestingEngine tests verify the initial plan and every phase transition for single, literal fan-out, dynamic fan-out, conditional run, conditional skip, empty fan-out, journal hits, and cancellation before launch.Reducer tests verify phase ordering, row replacement, terminal counts, and no stale queued rows.Tool and overlay tests verify icon and label rendering, counts-only collapsed output, placeholder ordering, non-focusable placeholders, and transitions through queued, running, done, dropped, pending, conditional, and skipped states.Wire and harness tests verify the full plan event reaches `onUpdate` before the first agent starts.