wizard: the 8h founding-prefix wedge was waitForGuestBanner's missing socket close resolver — already fixed at HEAD (17ae2fb4); the rail's one remaining unbounded await is the capture's CDP getCredentials #1289

Closed
opened 2026-09-07 13:34:23 +00:00 by matou-build-agent · 3 comments

The failure

Drive 20260907T052357Z (run dir test-results/private-path/20260907T052357Z, commit 48b6f5ca) went red at the founding leg. The harness reported it as wizard — the wizard died before any leg ran; the drive's own records say founding-prefix. Both readings are consistent: artifacts/legs.json holds exactly one row, {"leg":"founding-prefix","status":"running"}, and artifacts/verdict.json has firstRedLeg: founding-prefix with legs.total: 0 — no leg ever completed, so the harness saw an empty leg list.

The run spanned 05:28:44.845Z → 13:28:45.163Z — exactly 8h — and ended on Playwright's whole-test ceiling: Test timeout of 28800000ms exceeded (artifacts/provision-brands.live-bran-08f5b-.../error-context.md).

The evidence: the product was fine, the harness hung

The founding ceremony completed. logs/founding-state.log ends founded: true, draft.step: created, standup.step: hand-off, with the trail gateway deploy complete — the control plane is live (2026-09-07T05:37:28.671Z) and credential committed — the person authenticates to the dashboard. The captured page snapshot in error-context.md shows the finished hand-off screen ("E2E Drive is alive.", recovery-kit prompt, portal link). helper-opened-urls records the portal was opened.

The snapshot rail then ran its capture. logs/guest-journal.log:

  • Sep 07 05:37:54 — guest stopped (idss-guest.service: Consumed 6min 29.625s CPU time…)
  • Sep 07 05:38:49 — Started idss-guest.service, qemu boots, GRUB loads

And the guest came back healthy within ten seconds — logs/guest-caddy.log has Sep 07 05:38:58 gateway systemd[1]: Started Caddy., and logs/guest-control-plane.log ends Sep 07 05:38:59 … msg="control-plane serving the OpenAPI API" component=control-plane addr=:8080.

So from 05:38:59 the guest was fully serving, and the harness sat idle for 7h49m without printing the rail's guest back after capture line.

The defect

captureFoundedSnapshot's finally block restarts the guest and waits for it (app/tests/e2e/fixtures/snapshotRail.ts:393-404). The wait it hung in is waitForGuestBanner (app/tests/e2e/fixtures/evidence.ts:186-220), whose per-probe socket promise (evidence.ts:193-210) registered handlers for data, timeout and error — but not close.

That is the exact shape qemu's hostfwd produces during a boot: the forward accepts the connection the instant qemu starts (the trap the function's own doc comment at evidence.ts:183-184 names), then — with the guest's sshd not yet listening — FINs cleanly. No data, no error, and Node clears the socket's inactivity timer on close. The await new Promise(...) at evidence.ts:193 lost its resolver and never settled. Nothing above it was bounded, so only Playwright's 480m whole-test ceiling could ever fire.

This matches the event-loop forensics recorded on the wedged worker (no pending timers, no child processes, two healthy CDP sockets): a lost socket resolver leaves no timer and no handle behind, and the CDP sockets alone held the loop open.

Status: the root cause is ALREADY FIXED on main

Commit 17ae2fb4 ("fix(e2e): every snapshot-rail await gets a labelled deadline; the banner wait resolves on socket close", jamin, 2026-09-07 07:57 -0500 — landed while this very drive was still hanging) is now HEAD and carries:

  1. sock.on('close', () => finish(null)) at app/tests/e2e/fixtures/evidence.ts:209 — the precise plug for the path above.
  2. withDeadline(label, ms, work) at app/tests/e2e/fixtures/snapshotRail.ts:193, wrapping every rail step that awaits the outside world (snapshotRail.ts:248-254, 369-371, 396-402), so any future lost resolver in the rail reds loudly and labelled within minutes instead of silently for hours.
  3. node:net promoted to a static import (evidence.ts:2).

Verified at HEAD 17ae2fb4: pnpm --filter app exec vitest run tests/e2e/fixtures/ → 360 passed (17 files). waitForControlPlaneServing (evidence.ts:251-281) already had its close handler, so both socket promises in the rail are now sound.

No code change is needed for this red. The drive is armed against it and the next tick re-drives. I made no commit and the working tree is clean at 17ae2fb4.

The one thing left to do

17ae2fb4's stated invariant is that every rail step awaiting the outside world gets a labelled deadline. One await inside the same try block still escapes it:

  • app/tests/e2e/fixtures/snapshotRail.ts:340-342 — await prefix.session.cdp.send('WebAuthn.getCredentials', { authenticatorId }) is a bare CDP round-trip with no deadline.

This drive got past that line (the poweroff at snapshotRail.ts:346 and the 05:37:54 guest stop both happened), so it is not what caused this red — but it is the remaining hole in the file's own invariant, and it is the one shape that reproduces the observed corpse most exactly: a CDP send that never gets its reply leaves no timer, no child, and only the CDP socket holding the loop open.

The fix is mechanical and harness-only (a test file — no assertion, leg or product surface touched): wrap it as await withDeadline('webauthn credentials', 60_000, prefix.session.cdp.send(...)), matching lines 248-254 and 396-402, and extend snapshotRail.test.ts's withDeadline coverage. I deliberately did not land this as a heal, because it would not have fixed this red and committing it under a rehearsal healer: message would misreport what did.

Suspected layer

Harness / e2e fixtures (app/tests/e2e/fixtures/). Nothing in internal/, control-plane/ or the dashboard is implicated: the gateway founded, deployed, powered down and came back serving on :8080 in ten seconds.

Refusal rules

None fired. I refused nothing — there was simply nothing left to heal for this signature, the root cause having been fixed on main before I was invoked.

drive 20260907T052357Z red at wizard: drive red at wizard — the wizard died before any leg ran
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260907T052357Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Drive `20260907T052357Z` (run dir `test-results/private-path/20260907T052357Z`, commit `48b6f5ca`) went red at the founding leg. The harness reported it as `wizard — the wizard died before any leg ran`; the drive's own records say `founding-prefix`. Both readings are consistent: `artifacts/legs.json` holds exactly one row, `{"leg":"founding-prefix","status":"running"}`, and `artifacts/verdict.json` has `firstRedLeg: founding-prefix` with `legs.total: 0` — no leg ever completed, so the harness saw an empty leg list. The run spanned `05:28:44.845Z → 13:28:45.163Z` — exactly 8h — and ended on Playwright's whole-test ceiling: `Test timeout of 28800000ms exceeded` (`artifacts/provision-brands.live-bran-08f5b-.../error-context.md`). ## The evidence: the product was fine, the harness hung The founding ceremony completed. `logs/founding-state.log` ends `founded: true`, `draft.step: created`, `standup.step: hand-off`, with the trail `gateway deploy complete — the control plane is live` (2026-09-07T05:37:28.671Z) and `credential committed — the person authenticates to the dashboard`. The captured page snapshot in `error-context.md` shows the finished hand-off screen ("E2E Drive is alive.", recovery-kit prompt, portal link). `helper-opened-urls` records the portal was opened. The snapshot rail then ran its capture. `logs/guest-journal.log`: - `Sep 07 05:37:54` — guest stopped (`idss-guest.service: Consumed 6min 29.625s CPU time…`) - `Sep 07 05:38:49` — `Started idss-guest.service`, qemu boots, GRUB loads And the guest came back **healthy within ten seconds** — `logs/guest-caddy.log` has `Sep 07 05:38:58 gateway systemd[1]: Started Caddy.`, and `logs/guest-control-plane.log` ends `Sep 07 05:38:59 … msg="control-plane serving the OpenAPI API" component=control-plane addr=:8080`. So from 05:38:59 the guest was fully serving, and the harness sat idle for **7h49m** without printing the rail's `guest back after capture` line. ## The defect `captureFoundedSnapshot`'s `finally` block restarts the guest and waits for it (`app/tests/e2e/fixtures/snapshotRail.ts:393-404`). The wait it hung in is `waitForGuestBanner` (`app/tests/e2e/fixtures/evidence.ts:186-220`), whose per-probe socket promise (`evidence.ts:193-210`) registered handlers for `data`, `timeout` and `error` — but **not `close`**. That is the exact shape qemu's hostfwd produces during a boot: the forward accepts the connection the instant qemu starts (the trap the function's own doc comment at `evidence.ts:183-184` names), then — with the guest's sshd not yet listening — FINs cleanly. No data, no error, and Node clears the socket's inactivity timer on close. The `await new Promise(...)` at `evidence.ts:193` lost its resolver and never settled. Nothing above it was bounded, so only Playwright's 480m whole-test ceiling could ever fire. This matches the event-loop forensics recorded on the wedged worker (no pending timers, no child processes, two healthy CDP sockets): a lost socket resolver leaves no timer and no handle behind, and the CDP sockets alone held the loop open. ## Status: the root cause is ALREADY FIXED on main Commit `17ae2fb4` ("fix(e2e): every snapshot-rail await gets a labelled deadline; the banner wait resolves on socket close", jamin, 2026-09-07 07:57 -0500 — landed while this very drive was still hanging) is now HEAD and carries: 1. `sock.on('close', () => finish(null))` at `app/tests/e2e/fixtures/evidence.ts:209` — the precise plug for the path above. 2. `withDeadline(label, ms, work)` at `app/tests/e2e/fixtures/snapshotRail.ts:193`, wrapping every rail step that awaits the outside world (`snapshotRail.ts:248-254`, `369-371`, `396-402`), so any future lost resolver in the rail reds loudly and labelled within minutes instead of silently for hours. 3. `node:net` promoted to a static import (`evidence.ts:2`). Verified at HEAD `17ae2fb4`: `pnpm --filter app exec vitest run tests/e2e/fixtures/` → **360 passed (17 files)**. `waitForControlPlaneServing` (`evidence.ts:251-281`) already had its `close` handler, so both socket promises in the rail are now sound. **No code change is needed for this red.** The drive is armed against it and the next tick re-drives. I made no commit and the working tree is clean at `17ae2fb4`. ## The one thing left to do `17ae2fb4`'s stated invariant is that *every* rail step awaiting the outside world gets a labelled deadline. One await inside the same `try` block still escapes it: - `app/tests/e2e/fixtures/snapshotRail.ts:340-342` — `await prefix.session.cdp.send('WebAuthn.getCredentials', { authenticatorId })` is a bare CDP round-trip with no deadline. This drive got *past* that line (the poweroff at `snapshotRail.ts:346` and the 05:37:54 guest stop both happened), so it is **not** what caused this red — but it is the remaining hole in the file's own invariant, and it is the one shape that reproduces the observed corpse most exactly: a CDP send that never gets its reply leaves no timer, no child, and only the CDP socket holding the loop open. The fix is mechanical and harness-only (a test file — no assertion, leg or product surface touched): wrap it as `await withDeadline('webauthn credentials', 60_000, prefix.session.cdp.send(...))`, matching lines 248-254 and 396-402, and extend `snapshotRail.test.ts`'s `withDeadline` coverage. I deliberately did not land this as a heal, because it would not have fixed this red and committing it under a `rehearsal healer:` message would misreport what did. ## Suspected layer Harness / e2e fixtures (`app/tests/e2e/fixtures/`). Nothing in `internal/`, `control-plane/` or the dashboard is implicated: the gateway founded, deployed, powered down and came back serving on `:8080` in ten seconds. ## Refusal rules None fired. I refused nothing — there was simply nothing left to heal for this signature, the root cause having been fixed on main before I was invoked. drive `20260907T052357Z` red at `wizard`: `drive red at wizard — the wizard died before any leg ran` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260907T052357Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: dcf630511b50 -->
Author
Member

swarm-claim host=matou-dev-server-01 run=19569
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=19569 (automated multi-host claim — lowest live claim id works this ticket)
Owner

Closing — root cause fixed at 17ae2fb4, and the one remaining hole this ticket names is now landed at e38097f4.

The autopsy above is confirmed end to end: the 8h wedge was waitForGuestBanner's per-probe socket promise losing its resolver on qemu's accept-then-FIN hostfwd shape (no data, no error, timer cleared on close). 17ae2fb4 plugged exactly that (sock.on('close', …)) and bounded every rail step with withDeadline — landed while this drive was still hanging, so run 9 never saw it. The next fire runs on the hardened bits.

e38097f4 completes the invariant this ticket flagged: all three WebAuthn CDP round-trips (capture getCredentials — the shape that most exactly reproduces this corpse — plus the adopt path's addCredential/getCredentials) now ride withDeadline(60s). withDeadline is exported and pinned (passthrough / labelled loud red on a lost resolver / the work's own rejection wins). Fixtures 363/363, vue-tsc clean. Harness-only.

Ruled and landed under ADR 0174 (two-way door — a revert is one commit; no product surface touched). Ben: veto anytime.

Drive re-fires on the next executor tick.

**Closing — root cause fixed at `17ae2fb4`, and the one remaining hole this ticket names is now landed at `e38097f4`.** The autopsy above is confirmed end to end: the 8h wedge was `waitForGuestBanner`'s per-probe socket promise losing its resolver on qemu's accept-then-FIN hostfwd shape (no `data`, no `error`, timer cleared on `close`). `17ae2fb4` plugged exactly that (`sock.on('close', …)`) and bounded every rail step with `withDeadline` — landed while this drive was still hanging, so run 9 never saw it. The next fire runs on the hardened bits. `e38097f4` completes the invariant this ticket flagged: all three WebAuthn CDP round-trips (capture `getCredentials` — the shape that most exactly reproduces this corpse — plus the adopt path's `addCredential`/`getCredentials`) now ride `withDeadline(60s)`. `withDeadline` is exported and pinned (passthrough / labelled loud red on a lost resolver / the work's own rejection wins). Fixtures 363/363, vue-tsc clean. Harness-only. Ruled and landed under ADR 0174 (two-way door — a revert is one commit; no product surface touched). Ben: veto anytime. Drive re-fires on the next executor tick.
ben closed this issue 2026-09-07 13:37:09 +00:00
Author
Member

close-report for #1289 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1289,
  "status": "success",
  "commits": [],
  "changed_files": [],
  "tests": [
    {
      "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The rail's one remaining unbounded await (capture's WebAuthn.getCredentials CDP send) gets a labelled deadline": "snapshotRail.ts:340 on origin/main wraps prefix.session.cdp.send('WebAuthn.getCredentials', ...) in withDeadline('webauthn credentials (capture)', 60_000, ...) — landed in commit e38097f4 (also bounds the adopt send at :289)",
    "withDeadline coverage extended in snapshotRail.test.ts": "snapshotRail.test.ts:67-82 on origin/main — pass-through, never-settles-reds-loudly, and work-rejection-propagates cases; suite green at 363 passed (17 files)",
    "harness-only, no product/leg/assertion surface touched, railKey unchanged": "changes confined to app/tests/e2e/fixtures/ (test harness); app/tests changes leave railKey inputs untouched"
  },
  "summary": "The rail's last unbounded await — the capture's WebAuthn.getCredentials CDP round-trip — is now wrapped in a labelled withDeadline on origin/main, with test coverage; the root-cause banner wedge was already fixed at 17ae2fb4.",
  "reason": "The exact fix this ticket's 'one thing left to do' describes was landed concurrently by another host in commit e38097f4 ('fix(e2e): the rail's last unbounded awaits — all three WebAuthn CDP round-trips get labelled deadlines (#1289)'), already reachable from origin/main. My identical commit became empty on rebase and was dropped, so I pushed nothing of my own.",
  "blockers": [],
  "no_code_change": "The ticket is fully satisfied on origin/main by e38097f4 (a concurrent host's commit): the capture's WebAuthn.getCredentials send at snapshotRail.ts:340 (and the adopt one at :289) are wrapped in labelled withDeadline calls, and snapshotRail.test.ts:67-82 adds the withDeadline coverage. I reproduced the identical fix independently but it rebased to empty; verified the suite green (363 passed) at HEAD == origin/main."
}
**close-report** for #1289 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1289, "status": "success", "commits": [], "changed_files": [], "tests": [ { "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/", "exit_code": 0 } ], "criteria": { "The rail's one remaining unbounded await (capture's WebAuthn.getCredentials CDP send) gets a labelled deadline": "snapshotRail.ts:340 on origin/main wraps prefix.session.cdp.send('WebAuthn.getCredentials', ...) in withDeadline('webauthn credentials (capture)', 60_000, ...) — landed in commit e38097f4 (also bounds the adopt send at :289)", "withDeadline coverage extended in snapshotRail.test.ts": "snapshotRail.test.ts:67-82 on origin/main — pass-through, never-settles-reds-loudly, and work-rejection-propagates cases; suite green at 363 passed (17 files)", "harness-only, no product/leg/assertion surface touched, railKey unchanged": "changes confined to app/tests/e2e/fixtures/ (test harness); app/tests changes leave railKey inputs untouched" }, "summary": "The rail's last unbounded await — the capture's WebAuthn.getCredentials CDP round-trip — is now wrapped in a labelled withDeadline on origin/main, with test coverage; the root-cause banner wedge was already fixed at 17ae2fb4.", "reason": "The exact fix this ticket's 'one thing left to do' describes was landed concurrently by another host in commit e38097f4 ('fix(e2e): the rail's last unbounded awaits — all three WebAuthn CDP round-trips get labelled deadlines (#1289)'), already reachable from origin/main. My identical commit became empty on rebase and was dropped, so I pushed nothing of my own.", "blockers": [], "no_code_change": "The ticket is fully satisfied on origin/main by e38097f4 (a concurrent host's commit): the capture's WebAuthn.getCredentials send at snapshotRail.ts:340 (and the adopt one at :289) are wrapped in labelled withDeadline calls, and snapshotRail.test.ts:67-82 adds the withDeadline coverage. I reproduced the identical fix independently but it rebased to empty; verified the suite green (363 passed) at HEAD == origin/main." } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1289
No description provided.