connect-dial-in: drive awaits the enroll PTY's exit before clicking Continue — deadlock against ADR 0209's AwaitAndLand #1634

Closed
opened 2026-09-19 14:49:53 +00:00 by matou-build-agent · 2 comments

The failure

connect-dial-in red after 304545 ms; verdict.json names it firstRedLeg, at commit 4091563e. The leg killed an ssh -tt PTY that was blocked waiting for an operator decision the drive had not yet made — while the operator screen was sitting on that very decision with the button unclicked.

This is not the KNOWN frontier. legs.json records "skip": 0 and carries no skip reasons at all; the named own-VPS carrier issue ("pairing never flips") is not what stopped this drive. Pairing did flip — the screen has the machine's real probed facts. The drive died on the self-hosted dial-in carrier, before reaching anything the frontier covers.

The evidence

The device transcript (artifacts/legs.json, journey.json) ends exactly at the await:

✓ consent recorded — the wipe runs at first deploy
probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk
✓ connection request sent to 
waiting for the operator's decision…

The Playwright page snapshot at that same moment (artifacts/journey.idip-*/error-context.md) shows the product did its whole job:

- paragraph [ref=f1e204]:
  - generic [ref=f1e205]: ✓
  - text: Connected to clan-lab-rehearsal-4e7530ac
...
- listitem: ✓ The machine answers…  ✓ Visitors can reach it…  ✓ Enough memory…  ✓ Enough room on disk…
- paragraph [ref=f1e234]: All checks passed — this machine is ready to carry services.
- generic [ref=f1e235]:
  - button "Back" [ref=f1e236]
  - button "Continue" [ref=f1e237]

The request landed, the pre-checks ran on the box and passed, and Continue was rendered and never clicked.

Why it can never be clicked

idss-agent enroll <code> no longer exits at Pending — agent/cmd/agent/main.go:589-601 runs RunTerminal and then blocks in AwaitAndLand (ADR 0209, landed by 0ca9192c for #939):

res, err := o.RunTerminal(ctx, join.Terminal{...})
// Continue past Pending to the terminal outcome: await the operator's decision…
_, err = o.AwaitAndLand(ctx, os.Stdout, res.View.ID, enrollAwaitPoll)

But the drive waits for that process to exit before it will touch the screen. app/tests/e2e/journey.idip.spec.ts:322-327, inside the runOnBox callback:

const { code: rc, transcript } = await sshDropletInteractive(
  ip, `idss-agent enroll ${dialCode}`, fullInstallConsentAnswers(), CEILING.consent,
).done;

and app/tests/e2e/fixtures/wizard.ts only approves after that callback returns:

436:  await runOnBox(command, code);
...
450:  const passed = live.page.locator('[data-status="checks-passed"]');
459:  await live.page.click('[data-status="connect-device"] [data-action="continue"]');

PTY exit requires the decision; the decision requires the click; the click is gated on PTY exit. CEILING.consent (300 000 ms) expires, child.kill('SIGKILL') fires at fixtures/droplet.ts:427, leg reds.

The live box corroborates

SSH to 209.38.26.32 answered; systemctl --failed is empty and idss-agent.service is active — no product or infra fault. Its journal shows the request still un-decided, with the standing service retrying only because the ssh -R relay socket died with the killed session:

14:40:42 idss-agent[3176]: msg="join socket listening" component=agent path=/run/idss/agent.sock
14:46:43 idss-agent[3176]: level=ERROR msg="resumed join did not land" err="join: resume redeem: … read unix @->/run/idss/enroll-relay.sock: read: connection reset by peer"

Those resets are at 14:46:43/14:47:13 — after the 14:45:38 kill. They are the consequence, not the cause. logs/droplet-units.txt and droplet-stall.txt show a healthy, un-wiped box (correct — the wipe runs at first deploy).

Suspected layer

Harness. The spec was left behind by ADR 0209's product change. The correct pattern already exists in this repo — journey.device.spec.ts:744-797 holds the PTY open and polls the local accumulator for the frontier rather than awaiting exit:

let joinPty: ReturnType<typeof sshDropletInteractive> | undefined;
...
if (/waiting for the operator/i.test(session.peek())) break;

and fixtures/droplet.ts:352-359 documents peek()/settled() as existing precisely for a session "held open across legs (the join→approve walk)".

What plugging it needs

  1. In journey.idip.spec.ts:322, stop awaiting .done inside runOnBox. Spawn the session, hold it, poll session.peek() until /waiting for the operator/ (failing fast on session.settled(), as the device spec does), then return so the wizard body can run the pre-checks and click Continue.
  2. Give s4dConnectSelfHostedDialIn (fixtures/wizard.ts:408) a way to hand the held session back — either return it, or take an after-Continue hook — so the leg can await session.done, assert rc === 0, and still write connect-dial-in-transcript.txt (absent from this run dir: the callback threw before reaching the write at line 330).
  3. Same defect, same shape, at three more sites: journey.idip.spec.ts:454, journey.selfhosted.spec.ts:296 and :407. Fix them together or the next drive reds identically.

Secondary — not the red, worth its own ticket

The community name renders blank twice in the transcript: idss-agent unknown · joining and ✓ connection request sent to . Both are resp.Community.Name (internal/join/cli.go:170 and :227) coming back empty from redeem over the self-hosted relay, where the app knows the community as "E2E Drive" (snapshot: Community info → E2E Drive). unknown is likewise a blank t.Release. Cosmetic against ADR 0100's "every ✓ names a fact", and it did not cause this failure.

Absent from the run directory

  • artifacts/connect-dial-in-transcript.txt — never written; the callback threw first.
  • logs/broker-journal.txt — harvest denied (dev@100.98.48.68: Permission denied (publickey)), off-mesh by design per ADR 0208/#681; verdict does not depend on it.
  • logs/state-logs.log, clan-config-snapshot.log — both record ENOENT: the drive never built a clan config or state-log dir, expected for a drive that stopped at Connect.
  • logs/helper.log holds only GLX/EGL noise from headless Electron — no signal.

drive 20260919T143924Z red at connect-dial-in: ssh -tt root@209.38.26.32 timed out after 300000ms: idss-agent enroll 3P7L-R6SC-ADZ5-UVTK-6EJC --- transcript so far --- Warning: Permanently added '209.38.26.32' (ED25519) to the list of known hosts.
evidence: /home/swarm/session-runner/idss/test-results/drive-idip/20260919T143924Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `connect-dial-in` red after 304545 ms; `verdict.json` names it `firstRedLeg`, at commit `4091563e`. The leg killed an `ssh -tt` PTY that was blocked waiting for an operator decision the drive had not yet made — while the operator screen was sitting on that very decision with the button unclicked. **This is not the KNOWN frontier.** `legs.json` records `"skip": 0` and carries no skip reasons at all; the named own-VPS carrier issue ("pairing never flips") is not what stopped this drive. Pairing *did* flip — the screen has the machine's real probed facts. The drive died on the self-hosted dial-in carrier, before reaching anything the frontier covers. ## The evidence The device transcript (`artifacts/legs.json`, `journey.json`) ends exactly at the await: ``` ✓ consent recorded — the wipe runs at first deploy probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk ✓ connection request sent to waiting for the operator's decision… ``` The Playwright page snapshot at that same moment (`artifacts/journey.idip-*/error-context.md`) shows the product did its whole job: ```yaml - paragraph [ref=f1e204]: - generic [ref=f1e205]: ✓ - text: Connected to clan-lab-rehearsal-4e7530ac ... - listitem: ✓ The machine answers… ✓ Visitors can reach it… ✓ Enough memory… ✓ Enough room on disk… - paragraph [ref=f1e234]: All checks passed — this machine is ready to carry services. - generic [ref=f1e235]: - button "Back" [ref=f1e236] - button "Continue" [ref=f1e237] ``` The request landed, the pre-checks ran on the box and passed, and **Continue was rendered and never clicked**. ### Why it can never be clicked `idss-agent enroll <code>` no longer exits at Pending — `agent/cmd/agent/main.go:589-601` runs `RunTerminal` and then blocks in `AwaitAndLand` (ADR 0209, landed by `0ca9192c` for #939): ```go res, err := o.RunTerminal(ctx, join.Terminal{...}) // Continue past Pending to the terminal outcome: await the operator's decision… _, err = o.AwaitAndLand(ctx, os.Stdout, res.View.ID, enrollAwaitPoll) ``` But the drive waits for that process to **exit** before it will touch the screen. `app/tests/e2e/journey.idip.spec.ts:322-327`, inside the `runOnBox` callback: ```ts const { code: rc, transcript } = await sshDropletInteractive( ip, `idss-agent enroll ${dialCode}`, fullInstallConsentAnswers(), CEILING.consent, ).done; ``` and `app/tests/e2e/fixtures/wizard.ts` only approves *after* that callback returns: ```ts 436: await runOnBox(command, code); ... 450: const passed = live.page.locator('[data-status="checks-passed"]'); 459: await live.page.click('[data-status="connect-device"] [data-action="continue"]'); ``` PTY exit requires the decision; the decision requires the click; the click is gated on PTY exit. `CEILING.consent` (300 000 ms) expires, `child.kill('SIGKILL')` fires at `fixtures/droplet.ts:427`, leg reds. ### The live box corroborates SSH to 209.38.26.32 answered; `systemctl --failed` is empty and `idss-agent.service` is active — no product or infra fault. Its journal shows the request still un-decided, with the standing service retrying only because the `ssh -R` relay socket died with the killed session: ``` 14:40:42 idss-agent[3176]: msg="join socket listening" component=agent path=/run/idss/agent.sock 14:46:43 idss-agent[3176]: level=ERROR msg="resumed join did not land" err="join: resume redeem: … read unix @->/run/idss/enroll-relay.sock: read: connection reset by peer" ``` Those resets are at 14:46:43/14:47:13 — *after* the 14:45:38 kill. They are the consequence, not the cause. `logs/droplet-units.txt` and `droplet-stall.txt` show a healthy, un-wiped box (correct — the wipe runs at first deploy). ## Suspected layer **Harness.** The spec was left behind by ADR 0209's product change. The correct pattern already exists in this repo — `journey.device.spec.ts:744-797` holds the PTY open and polls the local accumulator for the frontier rather than awaiting exit: ```ts let joinPty: ReturnType<typeof sshDropletInteractive> | undefined; ... if (/waiting for the operator/i.test(session.peek())) break; ``` and `fixtures/droplet.ts:352-359` documents `peek()`/`settled()` as existing precisely for a session "held open across legs (the join→approve walk)". ## What plugging it needs 1. In `journey.idip.spec.ts:322`, stop awaiting `.done` inside `runOnBox`. Spawn the session, hold it, poll `session.peek()` until `/waiting for the operator/` (failing fast on `session.settled()`, as the device spec does), then return so the wizard body can run the pre-checks and click Continue. 2. Give `s4dConnectSelfHostedDialIn` (`fixtures/wizard.ts:408`) a way to hand the held session back — either return it, or take an after-Continue hook — so the leg can `await session.done`, assert `rc === 0`, and still write `connect-dial-in-transcript.txt` (absent from this run dir: the callback threw before reaching the write at line 330). 3. **Same defect, same shape, at three more sites:** `journey.idip.spec.ts:454`, `journey.selfhosted.spec.ts:296` and `:407`. Fix them together or the next drive reds identically. ## Secondary — not the red, worth its own ticket The community name renders blank twice in the transcript: `idss-agent unknown · joining ` and `✓ connection request sent to `. Both are `resp.Community.Name` (`internal/join/cli.go:170` and `:227`) coming back empty from redeem over the self-hosted relay, where the app knows the community as "E2E Drive" (snapshot: `Community info → E2E Drive`). `unknown` is likewise a blank `t.Release`. Cosmetic against ADR 0100's "every ✓ names a fact", and it did not cause this failure. ## Absent from the run directory - `artifacts/connect-dial-in-transcript.txt` — never written; the callback threw first. - `logs/broker-journal.txt` — harvest denied (`dev@100.98.48.68: Permission denied (publickey)`), off-mesh by design per ADR 0208/#681; verdict does not depend on it. - `logs/state-logs.log`, `clan-config-snapshot.log` — both record ENOENT: the drive never built a clan config or state-log dir, expected for a drive that stopped at Connect. - `logs/helper.log` holds only GLX/EGL noise from headless Electron — no signal. drive `20260919T143924Z` red at `connect-dial-in`: `ssh -tt root@209.38.26.32 timed out after 300000ms: idss-agent enroll 3P7L-R6SC-ADZ5-UVTK-6EJC --- transcript so far --- Warning: Permanently added '209.38.26.32' (ED25519) to the list of known hosts.` evidence: `/home/swarm/session-runner/idss/test-results/drive-idip/20260919T143924Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 61952685f971 -->
Author
Member

swarm-claim host=bens-mac-04 run=27582
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=27582 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1634 — status success

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

envelope
{
  "issue": 1634,
  "status": "success",
  "commits": [
    "929deaf0b09850fdd39eb6d57afcbd5ed10e9280"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/droplet.test.ts",
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/wizard.ts",
    "app/tests/e2e/journey.idip.spec.ts",
    "app/tests/e2e/journey.selfhosted.spec.ts",
    "app/tests/e2e/journey.v2-connect.spec.ts"
  ],
  "tests": [
    {
      "command": "node_modules/.bin/vitest run tests/e2e/fixtures/droplet.test.ts (in app/)",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vue-tsc -p tsconfig.json --noEmit (in app/)",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/eslint app/tests/e2e/{journey.idip,journey.selfhosted,journey.v2-connect}.spec.ts app/tests/e2e/fixtures/{wizard,droplet,droplet.test}.ts",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/prettier --check (my added lines, all changed files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "journey.idip.spec.ts:322 stops awaiting .done inside runOnBox; spawns+holds the session, polls session.peek() to /waiting for the operator/ failing fast on session.settled(), then returns": "app/tests/e2e/journey.idip.spec.ts connect-dial-in leg now calls holdEnrollToFrontier(s, CEILING.consent) inside the callback and returns the held session s (commit 929deaf0)",
    "s4dConnectSelfHostedDialIn hands the held session back so the leg can await session.done, assert rc === 0, and write connect-dial-in-transcript.txt": "app/tests/e2e/fixtures/wizard.ts s4dConnectSelfHostedDialIn is now generic and returns { command, code, onBox }; the connect-dial-in legs destructure onBox as the session, await session.done after Continue, assert rc===0 and write the transcript",
    "Same defect fixed at journey.idip.spec.ts:454, journey.selfhosted.spec.ts:296 and :407": "idip consent leg + selfhosted connect-dial-in and consent legs all hold to the frontier; the consent-path enroll is landed and awaited at the pair leg after S9 'paired and approved as node', before the deploy wipes the box (commit 929deaf0)",
    "The same latent deadlock is not left in the sibling live drive": "journey.v2-connect.spec.ts (the #1450 live drive) self-hosted-dial-in leg fixed identically — the fourth s4dConnectSelfHostedDialIn caller",
    "Test-first at the seam": "app/tests/e2e/fixtures/droplet.test.ts adds holdEnrollToFrontier coverage (3 cases: frontier reached, PTY dies first, ceiling never reached); droplet suite 29/29 green"
  },
  "summary": "The e2e drive now holds the enroll PTY to the waiting-on-operator frontier and lands the decision (Continue / approved-as-node) before awaiting exit, closing the ADR 0209 AwaitAndLand self-deadlock at all self-hosted enroll sites plus the #1450 v2-connect drive.",
  "reason": "",
  "blockers": []
}
**close-report** for #1634 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1634, "status": "success", "commits": [ "929deaf0b09850fdd39eb6d57afcbd5ed10e9280" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/droplet.test.ts", "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/wizard.ts", "app/tests/e2e/journey.idip.spec.ts", "app/tests/e2e/journey.selfhosted.spec.ts", "app/tests/e2e/journey.v2-connect.spec.ts" ], "tests": [ { "command": "node_modules/.bin/vitest run tests/e2e/fixtures/droplet.test.ts (in app/)", "exit_code": 0 }, { "command": "node_modules/.bin/vue-tsc -p tsconfig.json --noEmit (in app/)", "exit_code": 0 }, { "command": "node_modules/.bin/eslint app/tests/e2e/{journey.idip,journey.selfhosted,journey.v2-connect}.spec.ts app/tests/e2e/fixtures/{wizard,droplet,droplet.test}.ts", "exit_code": 0 }, { "command": "node_modules/.bin/prettier --check (my added lines, all changed files)", "exit_code": 0 } ], "criteria": { "journey.idip.spec.ts:322 stops awaiting .done inside runOnBox; spawns+holds the session, polls session.peek() to /waiting for the operator/ failing fast on session.settled(), then returns": "app/tests/e2e/journey.idip.spec.ts connect-dial-in leg now calls holdEnrollToFrontier(s, CEILING.consent) inside the callback and returns the held session s (commit 929deaf0)", "s4dConnectSelfHostedDialIn hands the held session back so the leg can await session.done, assert rc === 0, and write connect-dial-in-transcript.txt": "app/tests/e2e/fixtures/wizard.ts s4dConnectSelfHostedDialIn is now generic and returns { command, code, onBox }; the connect-dial-in legs destructure onBox as the session, await session.done after Continue, assert rc===0 and write the transcript", "Same defect fixed at journey.idip.spec.ts:454, journey.selfhosted.spec.ts:296 and :407": "idip consent leg + selfhosted connect-dial-in and consent legs all hold to the frontier; the consent-path enroll is landed and awaited at the pair leg after S9 'paired and approved as node', before the deploy wipes the box (commit 929deaf0)", "The same latent deadlock is not left in the sibling live drive": "journey.v2-connect.spec.ts (the #1450 live drive) self-hosted-dial-in leg fixed identically — the fourth s4dConnectSelfHostedDialIn caller", "Test-first at the seam": "app/tests/e2e/fixtures/droplet.test.ts adds holdEnrollToFrontier coverage (3 cases: frontier reached, PTY dies first, ceiling never reached); droplet suite 29/29 green" }, "summary": "The e2e drive now holds the enroll PTY to the waiting-on-operator frontier and lands the decision (Continue / approved-as-node) before awaiting exit, closing the ADR 0209 AwaitAndLand self-deadlock at all self-hosted enroll sites plus the #1450 v2-connect drive.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1634
No description provided.