Skip to content

docs: the PRD reflects the first end-to-end headless run, and the three bugs it took - #49

Merged
linhdmn merged 1 commit into
mainfrom
docs/prd-headless-run
Oct 7, 2026
Merged

linhdmn merged 1 commit into
mainfrom
docs/prd-headless-run

Conversation

@linhdmn

@linhdmn linhdmn commented Oct 7, 2026

Copy link
Copy Markdown
Member

Summary

The PRD said Last updated: 2026-10-05 and nothing in it recorded that the 0→1 pipeline had ever run through the web UI. It has now, headless, and getting there took three fixes (#46, #47, #48). Per the repo's own rule — a change that lands without the PRD reflecting it is incomplete — this brings it current.

Docs only. No source, no tests.

What changed

Header stamp → 2026-10-07. Names the run (goal-met, 30 steps, $0.1648, five phases, an artifact that builds) and the three fixes in one line each, so a reader who stops at the top knows the pipeline has now run for real.

New §7.3 — the headless run, and the three bugs it took to get one. Each bug with its measurement and the test that fails when it is reverted:

Bug The measurement The test
The SSE ping never refreshed the watcher flag approval/asked in the log, SSE connection ESTABLISHED, GET /api/state → pending: [] for 10+ minutes, every settle POST 409 test/dashboard.test.ts fails on the old code and on a 25s TTL
/product and /loop never started a turn command/run + command/done, no turn/start test/loop-command.test.ts fails with the handler reverted
Every subagent ran its own phase machine four subagents, each stopped at exactly 24 steps, all stopReason: 'refusal', parent told "declined the task", run blocked at 2% of budget test/subagent.test.ts fails with the policyFor branch reverted

It closes on the method, because that is the finding: all three were found by driving the real thing and reading what it actually did, and all three survived a suite of 800+ passing tests. §7.1 and §7.2 already made that point about wiring bugs found by reading; this is the same lesson from the other direction.

§8 — three limits this session established:

  • "Is a front end watching?" is still a heartbeat window, not a connection count. Both halves are now TTLs checked against each other by a test — which is what caught the bug — but a tab that is open and wedged still reads as watching for up to one TTL.
  • The fl-live verify.sh is weaker than a build. It asserts a page exists and references assistant-ui, and the first run passed it with a page that would not compile (layout.tsx imported ./globals.css; no CSS was written). Deployment configuration rather than plugin code, but the lesson generalises: a gate that checks shape rather than a successful build can pass work that does not run.
  • A 10% research share of a 240-step budget is tight — both live runs spent 23–24 of their 24 steps. Recorded as configuration to tune from a measurement, not as a defect.

§9.4 — the plugin-wiring item is no longer "nothing is covered." Three wirings gained source-shape assertions; the item says plainly that this is a weaker instrument than the fake-context harness it still asks for, and keeps that harness as the highest-value remaining work.

Verification

Docs-only, so the check is that the document is internally true:

  • every markdown link resolves to a real file (KNOWN-ISSUES.md, PLAN-close-open-issues.md)
  • every §-reference names a heading that exists (1, 7, 7.1, 7.2, 7.3, 8, 9.4)
  • every test and source path the file names is real (test/dashboard.test.ts, test/loop-command.test.ts, test/subagent.test.ts, src/subagent.ts, src/watcher-ttl.ts)

All three checked programmatically, not by eye. Full suite and CI are untouched by this change and were green at 808f398.

…ee bugs it took

The PRD's status stamp said 2026-10-05 and nothing in it mentioned the 0→1
pipeline ever having run through the web UI. It has now, headless, and the
road there took three fixes. A change that lands without the PRD reflecting it
is incomplete.

- Header stamp: 2026-10-07, naming the run (`goal-met`, 30 steps, $0.1648,
  five phases, an artifact that builds) and the three fixes in one line each.
- New §7.3: the run, and each bug with its measurement — the SSE ping that
  never refreshed the watcher flag (ask hung 10+ minutes with the connection
  demonstrably open), the command handler that returned text where a turn was
  needed (`command/run` + `command/done`, no `turn/start`), and the per-agent
  phase machine that made four research subagents burn the research ceiling and
  report "declined the task". Each says which test fails when reverted.
- §8: three limits this session established — "is a front end watching" is
  still a heartbeat window; the `fl-live` `verify.sh` is weaker than a build
  (it passed a page that would not compile); and a 10% research share of 240
  steps is tight, recorded as configuration rather than a defect.
- §9.4: the plugin-wiring item is no longer "nothing is covered". Three wirings
  now have source-shape assertions, and the item says plainly that this is a
  weaker instrument than the fake-context harness it still asks for.

Checked before committing: every markdown link resolves, every §-reference names
a heading that exists, and every test/source path named in the file is real.
@linhdmn
linhdmn merged commit c0855e4 into main Oct 7, 2026
3 checks passed
@linhdmn
linhdmn deleted the docs/prd-headless-run branch October 7, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant