fabro/docs/superpowers/plans
fabro-sh-0530[bot] f73f2a53f3
Replace queued with pending/runnable and add approval flow (web + API s… (#371)
## Summary

Replaces the single `queued` pre-execution state with explicit `pending`
and `runnable` states, and wires approve/deny actions for
parent-generated child runs that require human approval before they can
execute. This diff covers the web UI and OpenAPI spec layers of that
change.

## What changed

**Run status model**
- `queued` is removed from all TypeScript types, display maps, column
routing, and tests.
- `pending` (awaiting approval) and `runnable` (eligible for the
scheduler) replace it as distinct board columns and `RunStatus` variants
with their own labels and colors (`runnable` gets cyan; `pending` stays
muted).

**Approval actions**
- New `approveRun` / `denyRun` API calls in `run-actions.ts` invoke the
new `POST /runs/{id}/approve` and `POST /runs/{id}/deny` endpoints.
- `canApprove` predicate requires both `status.kind === "pending"` and
`lifecycle.approval?.state === "pending"` — a run whose status is
pending but has no approval record does not expose the action.
- `useApproveRun` / `useDenyRun` mutations in `mutations.ts` follow the
same pattern as `useCancelRun`.
- `ActionsMenu` in `run-detail.tsx` gains Approve (lifecycle group) and
Deny (destructive group) menu items.

**Board and event plumbing**
- `columnForStatus` now routes `pending → pending column` and `runnable
→ runnable column`; `submitted` stays in the pending column.
- `BOARD_STATUS_EVENTS` and `RUN_SUMMARY_EVENTS` replace `run.queued`
with `run.start_requested`, `run.pending`, `run.approved`, `run.denied`,
and `run.runnable`.
- The `pending` column is hidden when empty (same behaviour the old
`queued` column had).

**Waterfall phases (`run-phases.ts`)**
- `queued` phase is removed; `pending` and `runnable` phases are added
in order.
- The submitted phase closes at `run.start_requested` rather than
`run.queued`.
- Each phase derives its timestamps from its own event rather than a
single `firstTs` lookup, making multi-phase pre-execution timelines
accurate.

**OpenAPI spec**
- `POST /api/v1/runs/{id}/approve` and `POST /api/v1/runs/{id}/deny`
endpoints added with 200/404/409 responses.
- `startRun` description updated to describe the pending/runnable
branching behaviour.
- `cancelRun` description updated to reference `pending`/`runnable`
instead of `queued`.

### Plan Summary

- **Task 3** (OpenAPI schema additions for approve/deny endpoints) —
complete in this diff.
- **Task 6** (Web UI surfaces: board columns, run-detail actions,
waterfall phases, event subscriptions) — complete in this diff.
- **Task 7** (doc cleanup: references to `queued` replaced in plans,
brainstorms, and QA docs) — complete in this diff.


### Fabro Details

<details>
<summary>Ran 9 stages in 127m 37s for $104.98</summary>

| Stage | Duration | Cost | Retries |
|---|---|---|---|
| start | 0s | – | 0 |
| toolchain | 2s | – | 0 |
| preflight_compile | 2m 15s | – | 0 |
| preflight_lint | 2m 29s | – | 0 |
| implement | 92m 10s | $91.53 | 0 |
| simplify_opus | 18m 35s | $10.65 | 0 |
| simplify_gpt | 7m 36s | $2.81 | 0 |
| verify | 3m 42s | – | 0 |
| fmt | 3s | – | 0 |
| **Total** | **127m 37s** | **$104.98** | **0** |

</details>

<details>
<summary>Ran <code>ImplementPlan.fabro</code> (12 nodes and 15
edges)</summary>

```dot
digraph ImplementPlan {
    graph [
        goal="Implement and simplify",
        model_stylesheet="
            * { model: claude-opus-4-7; }
        "
    ]
    rankdir=LR

    start [shape=Mdiamond, label="Start"]
    exit  [shape=Msquare, label="Exit"]

    toolchain         [label="Toolchain", shape=parallelogram, script="command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", max_retries=0]
    preflight_compile [label="Preflight Compile", shape=parallelogram, script="cargo check -q --workspace 2>&1", max_retries=0]
    preflight_lint    [label="Preflight Lint", shape=parallelogram, script="cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1", max_retries=0]
    fix_lints         [label="Fix Lints", prompt="The preflight lint step failed. Read the build output from context and fix all clippy lint warnings.", max_visits=3]
    implement         [label="Implement", prompt="Read the plan file referenced in the goal and implement every step. Make all the code changes described in the plan. Use red/green TDD.", model="gpt-55", reasoning_effort="xhigh"]
    simplify_opus     [label="Simplify (Opus)", prompt="@prompts/simplify.md"]
    simplify_gpt      [label="Simplify (GPT-55)", prompt="@prompts/simplify.md", model="gpt-55"]
    verify            [label="Verify", shape=parallelogram, script="cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1 && cargo nextest run --cargo-quiet --workspace --status-level fail 2>&1 && cargo dev docs refresh 2>&1 && cargo dev docs check 2>&1", goal_gate=true, retry_target="fixup"]
    fixup             [label="Fixup", prompt="The verify step failed. Read the build output from context and fix all clippy lint warnings, test failures, and generated docs errors.", max_visits=3]
    fmt               [label="Format", shape=parallelogram, script="cargo +nightly-2026-04-14 fmt --all 2>&1", max_retries=0]

    start -> toolchain
    toolchain -> preflight_compile [condition="outcome=succeeded"]
    toolchain -> exit
    preflight_compile -> preflight_lint [condition="outcome=succeeded"]
    preflight_compile -> exit
    preflight_lint -> implement [condition="outcome=succeeded"]
    preflight_lint -> fix_lints
    fix_lints -> preflight_lint
    implement -> simplify_opus -> simplify_gpt -> verify
    verify -> fmt   [condition="outcome=succeeded"]
    verify -> fixup
    fixup -> verify
    fmt -> exit
}

```

</details>

⚒️ Generated with [Fabro](https://fabro.sh)

---------

Co-authored-by: Fabro <noreply@fabro.sh>
Co-authored-by: fabro <fabro@anthropic.com>
Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
2026-05-23 15:34:33 -04:00
..
2026-04-29-metadata-snapshot-events.md feat(workflow): emit metadata snapshot events 2026-04-29 19:31:13 -04:00
2026-04-30-duplicate-type-unification.md docs(plans): add command output streaming and type unification plans 2026-04-30 08:36:00 -04:00
2026-04-30-preserve-exec-failure-diagnostics.md fix(workflow): preserve exec failure diagnostics 2026-05-01 08:45:50 -04:00
2026-05-02-event-module-split.md refactor(workflow): split event module by responsibility 2026-05-02 14:52:10 -04:00
2026-05-02-server-readiness-timeouts.md fix(cli): bound server readiness probes 2026-05-02 20:13:18 -04:00
2026-05-02-settings-driven-llm-providers-models.md docs(llm): finish configurable provider cleanup (#260) 2026-05-13 17:17:54 -04:00
2026-05-04-cross-tab-sse-coordination.md chore: add plan 2026-05-04 16:09:12 -04:00
2026-05-04-model-test-bounded-concurrency.md chore: update plan 2026-05-04 12:55:19 -04:00
2026-05-04-unique-git-checkpoint-commit-message-path.md chore: add plan 2026-05-04 11:12:40 -04:00
2026-05-05-clean-pierre-virtualizer-integration.md chore: plan 2026-05-06 07:15:18 -04:00
2026-05-05-decouple-interrupts-from-steering.md Wire end-to-end steering for running agents (#209) 2026-05-05 15:34:16 -04:00
2026-05-06-cli-input-overrides.md feat(cli): support sparse input overrides (#222) 2026-05-09 10:00:35 -04:00
2026-05-06-improve-cli-api-error-display.md fix(cli): preserve API error details 2026-05-06 14:03:12 -04:00
2026-05-06-polished-foreground-tty-logging.md feat(cli): polish foreground TTY logs 2026-05-06 15:31:25 -04:00
2026-05-08-generated-typescript-api-client-migration.md feat(web): migrate to generated API client 2026-05-08 07:44:33 -07:00
2026-05-08-run-owned-sandbox-lifecycle.md chore: plan run-owned sandbox lifecycle 2026-05-08 14:45:56 -07:00
2026-05-09-daytona-run-terminal.md chore: plan 2026-05-09 19:02:03 -04:00
2026-05-09-fixed-project-workflow-directory.md fix(workflow): ignore deprecated project directory 2026-05-09 10:55:56 -04:00
2026-05-09-inline-markdown-run-titles.md chore: plans 2026-05-08 18:59:49 -07:00
2026-05-09-live-stage-token-projection.md feat(billing): project live stage token usage 2026-05-09 15:25:51 -04:00
2026-05-09-remove-local-worktree-mode.md refactor(workflow): remove local worktree mode 2026-05-09 11:04:23 -04:00
2026-05-09-run-files-diff-scope-picker.md feat(run-files): add sandbox diff scopes 2026-05-09 13:00:14 -04:00
2026-05-10-auth-sessions-backend.md feat(auth): add unified session API 2026-05-10 14:16:23 -04:00
2026-05-10-auth-sessions-frontend.md chore: plans 2026-05-10 23:40:02 -04:00
2026-05-10-live-events-page.md feat(web): build live events page in settings 2026-05-10 14:05:10 -04:00
2026-05-10-sandbox-services-backend.md feat(server): list sandbox services 2026-05-10 11:24:39 -04:00
2026-05-10-sandbox-services-frontend.md feat(web): add Services tab to sandbox page 2026-05-10 11:56:05 -04:00
2026-05-11-automations-end-to-end.md Replace queued with pending/runnable and add approval flow (web + API s… (#371) 2026-05-23 15:34:33 -04:00
2026-05-13-path-based-daytona-dockerfiles.md feat(manifest): support path-based Daytona Dockerfiles (#258) 2026-05-13 12:32:15 -04:00
2026-05-13-sandbox-repo-layout-plan.md feat(sandbox): prepare clone layout for multi-repo runs (#250) 2026-05-14 09:38:20 -04:00
2026-05-14-optional-llm-install.md feat(install): make LLM setup optional in web installer and CLI (#265) 2026-05-14 22:34:39 -04:00
2026-05-15-sandbox-network-details.md feat(sandbox): surface provider links and network policy (#275) 2026-05-16 10:16:18 -04:00
2026-05-16-chats-new-fabro-web-port.md feat(fabro-web): port /chats/new + /chats/:id from prototype (#289) 2026-05-16 17:10:16 -04:00
2026-05-16-source-aware-template-diagnostics.md feat(template): add source-aware diagnostics (#292) 2026-05-16 18:47:37 -04:00
2026-05-16-static-workflow-structure-rendering.md feat(web): show creator avatar on run "Created by" cell (#319) 2026-05-20 09:11:57 -04:00
2026-05-17-live-provider-workflow-testing.md feat(web): show creator avatar on run "Created by" cell (#319) 2026-05-20 09:11:57 -04:00
2026-05-17-provider-adapter-boundary-cleanup.md feat(web): show creator avatar on run "Created by" cell (#319) 2026-05-20 09:11:57 -04:00
2026-05-18-server-side-run-pairing-api-events.md feat(server): add run pairing API (#312) 2026-05-20 18:58:38 -04:00
2026-05-18-vault-and-credential-source-cleanup.md refactor(auth): split credential sources and vault schemas (#306) 2026-05-18 11:07:42 -04:00
2026-05-20-daytona-managed-sandbox-labels.md feat(sandbox): label Daytona sandboxes as managed (#326) 2026-05-20 17:22:12 -04:00
2026-05-22-agent-context-observability-events.md refactor(agent): simplify reviewed changes 2026-05-22 21:51:45 -04:00
2026-05-22-run-agent-fabro-tools-opt-in.md refactor(agent): simplify reviewed changes 2026-05-22 21:51:45 -04:00
2026-05-22-unified-agent-transcript-events.md refactor(agent): simplify reviewed changes 2026-05-22 21:51:45 -04:00
2026-05-23-llm-input-token-counting.md refactor(agent): simplify reviewed changes 2026-05-22 21:51:45 -04:00