repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

docs(ultra): design planned work visibility

b2fd0e8b326e7ab19a3507b1ebea65f7410f2534

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

+130 / −0 text lines

Diff layout

docs/super/specs/2026-07-13-ultra-planned-work-visibility-design-mockup-agent-ledger-icons.html

Added
new file mode 100644

+11 / −0 text lines

1<!doctype html>
2<html lang="en">
3<head>
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>Icon-led agent ledger</title>
7</head>
8<body>
9<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>
10</body>
11</html>

docs/super/specs/2026-07-13-ultra-planned-work-visibility-design.md

Added
new file mode 100644

+119 / −0 text lines

1# Ultra Planned Work Visibility Design
2
3## Goal
4
5Show every workflow phase before execution and distinguish known queued agents from work whose agent count or run decision depends on earlier results.
6Keep the collapsed tool view compact and preserve current orchestration semantics.
7
8## Mockups
9
10- [Icon-led agent ledger](./2026-07-13-ultra-planned-work-visibility-design-mockup-agent-ledger-icons.html)
12## Principles
14The workflow specification defines every phase at run start.
15A phase without `when` has a known run decision.
16A `single` phase has one known agent.
17A `fanout` with a literal `over` array has a known agent count.
18A `fanout` with an interpolated `over` has an unknown agent count until that phase resolves.
19A phase with `when` has an unknown run decision until that phase resolves.
21Planning visibility does not alter phase ordering, interpolation, concurrency, journaling, cancellation, or results.
23## Progress Model
25`UltraProgressEvent` becomes a discriminated union with three event families.
27An agent event retains the existing `start`, `action`, `delta`, and `end` kinds and requires `agentId`.
28A workflow plan event carries all phases once at run start.
29A phase event updates one phase when its condition and fan-out resolve or when it finishes.
31Each planned phase has:
33- `phase`: phase id.
34- `status`: `resolved`, `agents-pending`, `condition-pending`, `done`, or `skipped`.
35- `agentIds`: known agent ids when status is `resolved` or `done`.
37Each agent row has status `queued`, `running`, `done`, or `dropped`.
39## Initial Planning
41Before the first phase executes, the engine emits one workflow plan event in specification order.
43For a phase with `when`, initial status is `condition-pending` and no agent rows exist.
44For an unconditional `single` phase, initial status is `resolved` with `<phase>#0` queued.
45For an unconditional literal `fanout`, initial status is `resolved` with one queued row per array item.
46For an unconditional interpolated `fanout`, initial status is `agents-pending` and no agent rows exist.
48The engine does not speculate by partially evaluating interpolated selectors early.
49This keeps planning independent of selector internals and reliable for every valid workflow.
51## State Transitions
53When the engine reaches a phase, it evaluates `when` using the existing selector resolver.
55A false condition emits `skipped` and runs no agents.
56A true or absent condition resolves the phase's items and emits `resolved` with exact agent ids before the concurrency pool launches workers.
58A queued agent becomes `running` on its existing `start` event.
59It becomes `done` or `dropped` on its existing `end` event.
60A journal hit still transitions queued to running to done through the engine's synthetic events.
62After all slots settle, the engine emits phase `done`.
63If cancellation leaves queued items unlaunched, the engine emits dropped end events for those planned agent ids so no row remains falsely queued.
65## Reducer
67`ReducerState.phases` stores planned phase records in specification order instead of phase ids discovered from agent events.
68The reducer seeds queued agent rows from the workflow plan event.
69A phase `resolved` event replaces that phase's planned agent set while preserving matching rows.
70A phase `skipped` event removes any provisional agent rows for that phase.
71Agent events continue to upsert rows by `agentId` and retain metadata, controls, usage, actions, and transcripts.
73Derived counts include:
75- `queued`: agent rows waiting to launch.
76- `running`: active agent rows.
77- `done`: successful terminal rows.
78- `dropped`: failed terminal rows.
79- `later`: phases with `agents-pending` or `condition-pending` status.
81The current phase changes only when the engine emits the phase-resolution event, not when the initial plan is seeded.
83## Rendering
85Collapsed workflow tool output remains counts-only and keeps the configured expand hint.
86Its header adds active, queued, and later counts without showing per-agent content.
88Expanded tool output and the command overlay render phases in specification order.
89Resolved phases render their agent rows.
90`agents-pending`, `condition-pending`, and `skipped` phases render one explanatory phase row.
91A resolved phase with zero agents renders one `done · no agents` phase row after completion.
93State icons use verified Nerd Font glyphs plus textual labels:
95- `󰗠` done.
96- `󰐌` running.
97- `󰅐` queued.
98- `󰭙` agents pending.
99- `󰘬` conditional.
100- `󰅙` dropped.
102Labels remain mandatory so missing glyph support never hides meaning.
103Skipped phases use a plain Unicode minus marker and the `skipped` label.
105The overlay focuses only agent rows.
106Planning placeholders are visible but not focusable, steerable, or abortable.
108## Compatibility
110Workflow specifications and result JSON do not change.
111The change affects only in-process progress events and reducer details stored in tool updates.
112`renderUltraResult()` continues to reject foreign or stale detail shapes and falls back to an empty board.
114## Testing
116Engine 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.
117Reducer tests verify phase ordering, row replacement, terminal counts, and no stale queued rows.
118Tool 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.
119Wire and harness tests verify the full plan event reaches `onUpdate` before the first agent starts.