device-add: an approved device never lands — the install one-liner's await dies at the Pending frontier and nothing resumes the join (drive approve, sig c1ac37bc5a0d) #952
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#952
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failure
The
20260828T185311Zdevice drive reds at theapproveleg after burning the full 300s ceiling (artifacts/legs.json,"leg":"approve","status":"red","ms":300382; 23 of 24 legs green,artifacts/verdict.jsonfirstRedLeg: approve). The bare message is a locator miss:The Playwright ARIA snapshot in
artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.mdnames what the strip actually held for those five minutes:That is
data-status="approved-joining"(dashboard/src/components/device-add/PendingDevicesSurface.vue:20-29). So the Approve verb landed cleanly — the control plane minted the grant, the row movedpending→approved, nopending-device-error. The row simply never reachedenrolled, andConnectedScreenonly renders atphase === 'enrolled'(PendingDevicesSurface.vue:31-35). The drive's.or()race (app/tests/e2e/fixtures/deviceAdd.ts:202-209) has no third arm for "approved but never confirmed", so it waited out the ceiling and reported "element not found".Why it never confirmed: the awaiting process was already dead
The device journal shows the join PTY (
session-12, which ran thecurl … /get | sh -s -- <code>one-liner) exit cleanly, client-initiated, at 19:10:16 — one second before theapproveleg began (logs/device-journal.txt):The
joinleg is green at 46315ms, i.e. it broke on thewaiting for the operatorfrontier at ~19:10:15-16 — the same second the process exited.join.RunInstallCommandis supposed to be structurally unable to exit before the decision lands (internal/join/cli.go:296-307, folding inAwaitAndLandatcli.go:227-252, per #939), andAwaitDecisionloops forever on an unchanged view. But it returns on the firstPollerror with no retry:internal/join/join.go:266-269—view, err := o.cfg.ControlPlane.Poll(ctx, id, wait); if err != nil { return Decision{}, err }internal/enrollwire/client.go:71-80), so one transport blip on a public path ends a wait that is meant to run minutes.A prompt exit ~1s after the frontier line fits an immediate
Pollfailure. The exact error is not recoverable from this run — see the evidence gap below.Nothing resumes a join whose terminal died
This is the part that makes it terminal rather than transient. The standing
idss-agent.servicewas up the whole time (join socket listening, 19:09:32) and logged nothing for the remaining six minutes.join.Orchestrator.Resume(internal/join/resume.go:35) — written for exactly this ("a crash or reboot mid-join must never … strand the device", #68) — has no production caller:grep -rn '\.Resume(' --include=*.gooutside_test.gohitsfounding,clan,backup,monitorand neverinternal/join. So once the foregroundinstallprocess is gone, the operator's approval is stranded permanently: the grant is minted, the code is spent, and the strip sits at "approved — joining now" forever with no path toEnrolledand no error. A real operator hits the identical dead end.Suspected layer
Agent /
internal/join(Go), on the device end. Not the dashboard (it rendered the honest Approved→Enrolled split correctly), not the control plane (the approve succeeded,community CA wiredatlogs/gateway-journal.txt19:08:54, no refusal), not the drive fixture (its locators are right; it just has no arm for this state).What plugging it needs
app/tests/e2e/journey.device.spec.ts:569-571writesjoin-transcript.txtonly afterapprovePendingreturns — so on an approve red the held PTY's transcript and exit code, the single most causative record, are never written.artifacts/join-transcript.txtis absent from this run for exactly that reason. Theapproveleg should raceapprovePendingagainstjoinPty.doneand red at once with the agent's own words and exit code, the way #945 taught it to race the refusal state. Related:app/tests/e2e/fixtures/legframe.ts:48-64only screenshotsapp.windows()(Electron), so every dashboard-era leg frame is byte-identical (md5sum artifacts/legs/*-w1.png— one hash acrossstanding,mint,device-create,agent-install,decline-resume,join,approve); thedashCDP page is never captured. Only Playwright's ownerror-context.mdsaved this diagnosis.AwaitDecision(internal/join/join.go:264-282) should survive a transientPolltransport fault — retry with backoff against the caller's context — rather than ending the join on the first one. A permanent/typed enroll error should still fail loud (ADR 0100).Resumeneeds the code, so this requires deciding what the agent persists about an in-flight request — that is the ruling this ticket is blocked on (ADR 0209 territory). Until it exists, a lost terminal = a permanently stranded approval, which is the operator-visible bug here.Minor, non-causative
artifacts/enrollment-code.txtandartifacts/install-command.txtstill hold the first, declined-and-spent code (BL97-SAM7-Z8PJ-JAH9-M2CS, seeartifacts/decline-transcript.txt). Thedecline-resumeleg re-mints atjourney.device.spec.ts:481-483but never rewrites those artifacts, so the run's headline evidence names a code the failing legs did not use.drive
20260828T185311Zred atapprove:expect(locator).toBeVisible() failed Locator: locator('[data-field="connected-device"]').or(locator('[data-status="pending-device-error"]')).first() Expected: visible Timeout: 300000ms Error: element(evidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T185311Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedClose-report — ruled by agent under ADR 0174 (veto anytime).
What landed (two-way doors, proven offline)
The causative fix —
587ad445(internal/join/join.go). The reported red wasAwaitDecisionreturning on the firstControlPlane.Pollerror. On this drive that first error was a transport blip on the minutes-long HTTPS long-poll to the community apex through Caddy; the install one-liner's foreground process exited ~1s past the waiting-for-operator frontier (matching the19:10:16client-initiatedsession-12.scopedeactivation in the device journal), the row stayedapproved-joining, and nothing drove it toEnrolled.AwaitDecisionnow classifies a Poll failure rather than ending on it:enroll.DeviceScreenForok) still fails loud (ADR 0100) — a decision is never retried;Config.PollBackofffloor 2s, doubling to a 30s cap) and re-polls — a blip no longer ends a join the operator may still be deciding.Proof (red-first):
TestAwait_SurvivesTransientPollFault— three transient Poll faults, then the await survives and lands the since-approved request (asserts it polled past the faults);TestAwait_FailsLoudOnTypedEnrollFault— a typed verdict returns at once, exactly one poll, no retry.go build/go vetclean; theinternal/join+internal/enroll+internal/enrollwiresuites pass.Diagnostics —
7f0f7875(the drive's own evidence).legframe.ts: the per-leg capturer now screenshots the dashboard ceremony page (<name>-dash.png), not just the byte-identical Electron shell — the dashboard renders in a CDP-attached pageapp.windows()never held, which is why only Playwright'serror-context.mdsaved the original diagnosis. Read lazily (the dash page is assigned mid-leg-1, after the capturer is installed); best-effort/swallowed as before. Typecheck (vue-tsc) + thelegframeunit test green.journey.device.spec.ts: the decline-resume re-mint now rewritesenrollment-code.txt/install-command.txtto the re-minted code the join/approve legs actually run — the mint-leg copies named the declined-and-spent code.The prior session's held-PTY harvest on an approve red (
81823664) stands — a future approve red now writesjoin-transcript.txt+join-exit.txtwith the agent's own words and exit code before the wait can red.What is deliberately NOT in this ticket — split to #953
The other root cause the diagnosis named — a join whose terminal truly dies (crash / reboot / lost SSH) has no resumer, because
join.Orchestrator.Resumehas no production caller — is genuine defense-in-depth but is blocked on a ruling: what does the agent persist about an in-flight request so a standing agent canResumeit (ADR 0209 territory). That is not a cheap two-way door to improvise unattended, so it is filed as #953 (ready-for-session) carrying a concrete proposed default ruling (persist a{code, requestID}anchor beside the durable device key; resume-loop it at agent startup; proven by a seam test) that a future session can adopt under ADR 0174. #952's own reported red — the transient-blip strand — is fixed here and does not wait on #953.STATUS.md
Updated in
587ad445(header lead + the #945 demotion).Closing: the causative await-strand is fixed and proven at the seam, the drive's diagnostics are in place, and the residual resume-resilience is tracked in #953. Integration confirmation is the next standing device drive.