device drive: a drive that reds after approve orphans its landed node in the standing fleet — the droplet is reaped, the placed node is not #1044

Closed
opened 2026-08-30 17:35:50 +00:00 by matou-build-agent · 3 comments

Failure

journey.device.spec.ts's afterAll destroys the member droplet on every drive (the standing-drive rule) but never removes the node that drive landed in the standing community's fleet. Any drive that reds after the approve leg therefore leaves a placed member node whose box no longer exists in rehearsal-e's fleet, permanently. Only the happy-path remove-device leg (leg 13) takes it back out.

This is what produced the stray that caused drive 20260830T172147Z's red, and drive 20260830T172147Z has just done it again — it red at assess (after approve), so node-req-0005 is now a second orphan.

Evidence

  • GET /api/v1/fleet @17:23:17.171 (run 20260830T172147Z, trace report/data/a464f2da….zip, resource 970e1f28….json) — at the standing baseline the fleet already carried node-req-0003, role: "helper", provisioned: true, beside the gateway.
  • GET /api/v1/enroll/codes (resource 46639e20….json) — SENF-BNR4-9394-Z6BP-V8TK consumed 16:47:07, i.e. req-0003 belongs to a drive ~36 min before this one. artifacts/device-do-forensics.txt shows only the current box (droplet 596387857, created 17:22:15); no droplet backs node-req-0003.
  • GET /api/v1/fleet @17:24:14 (resource 896d7acb….json) — this drive's node-req-0005 placed, provisioned: false. The drive then red at assess (artifacts/legs.json), so leg 13 never ran and afterAll reaped its droplet.
  • app/tests/e2e/journey.device.spec.ts:221-247 — afterAll runs declineOwnPending (pending strip) and runDeviceTeardown (the droplet). Neither touches the fleet.
  • app/tests/e2e/journey.device.spec.ts:762-767 — the only removal is inside leg 13, unreachable on a red.

Suspected layer

The drive harness's teardown contract (app/tests/e2e/journey.device.spec.ts), not the product. enroll's admission placing node-<requestID> at landing (ADR 0209 §4) is correct; nothing revokes it when the drive dies mid-journey.

Why this now matters more, not less

Commit b96e3987 fixed the racing standing baseline, so assertFleetGatewayOnly will from the next drive on actually see these orphans and try to walk each one off through a real remove-and-deploy — against nodes whose hosts are gone. Two are waiting. Note also that the walk-off calls openDeviceSetup(strayId) (journey.device.spec.ts:869), which for a provisioned stray can never find set-up-<id> and burns its full 60s DRILL_IN_TIMEOUT_MS (fixtures/deviceProvision.ts:66-74) before falling back to the change-node- click — 60s of dead time per stray.

What plugging it needs

  1. Extend afterAll's best-effort cleanup to remove the node this drive landed (deviceId, when set) through the same LOSES removal path leg 13 uses — guarded and non-fatal, like declineOwnPending, so teardown can never mask a leg's real fault.
  2. Decide and encode what removal means for a node whose host is already destroyed (afterAll reaps the droplet; ordering matters — remove the node before the teardown, or make the removal tolerate an unreachable host). This is the part that needs a ruling: a remove-and-deploy against a dead box may not converge.
  3. Give assertFleetGatewayOnly's walk-off the right control directly (change-node- for a provisioned stray) instead of paying the 60s openDeviceSetup miss.
  4. Clear the two orphans (node-req-0003, node-req-0005) from the standing community's fleet, or let the repaired baseline walk them off once step 2 is settled.

drive 20260830T172147Z red at assess: device node-req-0003's row offers no "set up" control — a connected, not-yet-provisioned device must (dashboard/src/lib/fleet.ts nodeSurfaceRoute) expect(locator).toBeVisible() failed Locator: locat
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T172147Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure `journey.device.spec.ts`'s `afterAll` destroys the member droplet on every drive (the standing-drive rule) but never removes the node that drive landed in the standing community's fleet. Any drive that reds after the `approve` leg therefore leaves a **placed member node whose box no longer exists** in `rehearsal-e`'s fleet, permanently. Only the happy-path `remove-device` leg (leg 13) takes it back out. This is what produced the stray that caused drive `20260830T172147Z`'s red, and drive `20260830T172147Z` has just done it again — it red at `assess` (after approve), so `node-req-0005` is now a second orphan. ## Evidence - `GET /api/v1/fleet` @17:23:17.171 (run `20260830T172147Z`, trace `report/data/a464f2da….zip`, resource `970e1f28….json`) — at the standing baseline the fleet already carried `node-req-0003`, `role: "helper"`, `provisioned: true`, beside the gateway. - `GET /api/v1/enroll/codes` (resource `46639e20….json`) — `SENF-BNR4-9394-Z6BP-V8TK` consumed `16:47:07`, i.e. req-0003 belongs to a drive ~36 min before this one. `artifacts/device-do-forensics.txt` shows only the current box (droplet 596387857, created 17:22:15); no droplet backs node-req-0003. - `GET /api/v1/fleet` @17:24:14 (resource `896d7acb….json`) — this drive's `node-req-0005` placed, `provisioned: false`. The drive then red at `assess` (`artifacts/legs.json`), so leg 13 never ran and `afterAll` reaped its droplet. - `app/tests/e2e/journey.device.spec.ts:221-247` — `afterAll` runs `declineOwnPending` (pending strip) and `runDeviceTeardown` (the droplet). Neither touches the fleet. - `app/tests/e2e/journey.device.spec.ts:762-767` — the only removal is inside leg 13, unreachable on a red. ## Suspected layer The drive harness's teardown contract (`app/tests/e2e/journey.device.spec.ts`), not the product. `enroll`'s admission placing `node-<requestID>` at landing (ADR 0209 §4) is correct; nothing revokes it when the drive dies mid-journey. ## Why this now matters more, not less Commit `b96e3987` fixed the racing standing baseline, so `assertFleetGatewayOnly` will from the next drive on actually **see** these orphans and try to walk each one off through a real remove-and-deploy — against nodes whose hosts are gone. Two are waiting. Note also that the walk-off calls `openDeviceSetup(strayId)` (journey.device.spec.ts:869), which for a *provisioned* stray can never find `set-up-<id>` and burns its full 60s `DRILL_IN_TIMEOUT_MS` (`fixtures/deviceProvision.ts:66-74`) before falling back to the `change-node-` click — 60s of dead time per stray. ## What plugging it needs 1. Extend `afterAll`'s best-effort cleanup to remove the node this drive landed (`deviceId`, when set) through the same LOSES removal path leg 13 uses — guarded and non-fatal, like `declineOwnPending`, so teardown can never mask a leg's real fault. 2. Decide and encode what removal means for a node whose host is already destroyed (afterAll reaps the droplet; ordering matters — remove the node *before* the teardown, or make the removal tolerate an unreachable host). This is the part that needs a ruling: a remove-and-deploy against a dead box may not converge. 3. Give `assertFleetGatewayOnly`'s walk-off the right control directly (`change-node-` for a provisioned stray) instead of paying the 60s `openDeviceSetup` miss. 4. Clear the two orphans (`node-req-0003`, `node-req-0005`) from the standing community's fleet, or let the repaired baseline walk them off once step 2 is settled. drive `20260830T172147Z` red at `assess`: `device node-req-0003's row offers no "set up" control — a connected, not-yet-provisioned device must (dashboard/src/lib/fleet.ts nodeSurfaceRoute) expect(locator).toBeVisible() failed Locator: locat` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T172147Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 457bd1d5a8c2 -->
Author
Member

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

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

Ruled by agent under ADR 0174 — veto anytime.

Step 2 ("decide and encode what removal means for a node whose host is already destroyed; a remove-and-deploy against a dead box may not converge") is the ruling this ticket needs. Here it is.

Ruling: afterAll reaps the member droplet FIRST, then walks the landed node off; the removal runs against a host that is already gone, and that is not just tolerable but required by the UI's own shape.

Why this ordering, not remove-before-reap:

  • remove-device is only offered on two provisioning views: S1x (Assess — nothing available / out-of-reach) and the Active view. A fresh drill-in from a fleet row (set-up-<id> or change-node-<id>) lands on the plain assess/change setup view, which carries no remove control. The only fresh drill-in that reaches a remove control is one whose assess/change-setup re-reads the node out-of-reach → routes to S1x → remove-device.
  • So the node must be unreachable for the walk-off to reach its remove control. Reaping the droplet first makes it so: an un-provisioned landed node's assess and a provisioned one's changeSetup both re-read out-of-reach → S1x → remove-device → the deliberate remove-and-deploy.
  • remove-and-deploy is a gateway-side empty-selection deploy that returns the fleet to gateway-only (SetupSurface runRemoval → the seam's removeDevice, which revokes the grant and re-renders the front door). It never reaches the member box, so it converges even though the box is gone. That answers the "may not converge" worry: the removal is a gateway operation, not a member one.

This is the same posture the standing baseline's assertFleetGatewayOnly walk-off already relies on (it runs at the next drive's leg 1, when the orphan's box is long dead) — so the two paths are now consistent.

Why this is a two-way door: it is entirely test-harness code (app/tests/e2e/journey.device.spec.ts + fixtures/deviceProvision.ts), revertible by a later commit; it is not on the one-way-door list (no credentials, no security widening, no member-facing trust accept, no data destruction, no spend). What proves it: the next device drive's afterAll clears the node it landed, and its leg-1 baseline walks off the two waiting orphans (node-req-0003, node-req-0005) without burning the 60s set-up- miss — a red there refutes the ruling and reverts it.

Steps 1, 3, 4 are shipped alongside:

  • 1 — afterAll now removes deviceId (when set) through the shape-correct removal, guarded/non-fatal like declineOwnPending.
  • 3 — the walk-off (and the new afterAll cleanup) drill a provisioned stray through change-node-<id> directly (strayDrillInFromAction + openNodeSurface), never the 60s set-up-<id> miss. Proven offline in deviceProvision.test.ts.
  • 4 — the two existing orphans are left for the repaired baseline to walk off (both boxes are gone → both route to S1x → remove), per the "or let the repaired baseline walk them off" option.
**Ruled by agent under [ADR 0174](../src/branch/main/docs/adr/0174-two-way-door-rulings-default-to-the-agent.md) — veto anytime.** Step 2 ("decide and encode what removal means for a node whose host is already destroyed; a remove-and-deploy against a dead box may not converge") is the ruling this ticket needs. Here it is. **Ruling: `afterAll` reaps the member droplet FIRST, then walks the landed node off; the removal runs against a host that is already gone, and that is not just tolerable but required by the UI's own shape.** Why this ordering, not remove-before-reap: - `remove-device` is only offered on two provisioning views: S1x (Assess — *nothing available* / out-of-reach) and the Active view. A *fresh* drill-in from a fleet row (`set-up-<id>` or `change-node-<id>`) lands on the plain assess/change **setup** view, which carries **no** remove control. The only fresh drill-in that reaches a remove control is one whose assess/change-setup re-reads the node **out-of-reach** → routes to S1x → `remove-device`. - So the node must be unreachable for the walk-off to reach its remove control. Reaping the droplet first makes it so: an un-provisioned landed node's `assess` and a provisioned one's `changeSetup` both re-read out-of-reach → S1x → `remove-device` → the deliberate `remove-and-deploy`. - `remove-and-deploy` is a **gateway-side empty-selection deploy** that returns the fleet to gateway-only (SetupSurface `runRemoval` → the seam's `removeDevice`, which revokes the grant and re-renders the front door). It never reaches the member box, so it converges even though the box is gone. That answers the "may not converge" worry: the removal is a gateway operation, not a member one. This is the same posture the standing baseline's `assertFleetGatewayOnly` walk-off already relies on (it runs at the *next* drive's leg 1, when the orphan's box is long dead) — so the two paths are now consistent. **Why this is a two-way door:** it is entirely test-harness code (`app/tests/e2e/journey.device.spec.ts` + `fixtures/deviceProvision.ts`), revertible by a later commit; it is not on the one-way-door list (no credentials, no security widening, no member-facing trust accept, no data destruction, no spend). **What proves it:** the next device drive's `afterAll` clears the node it landed, and its leg-1 baseline walks off the two waiting orphans (`node-req-0003`, `node-req-0005`) without burning the 60s `set-up-` miss — a red there refutes the ruling and reverts it. Steps 1, 3, 4 are shipped alongside: - **1** — `afterAll` now removes `deviceId` (when set) through the shape-correct removal, guarded/non-fatal like `declineOwnPending`. - **3** — the walk-off (and the new `afterAll` cleanup) drill a provisioned stray through `change-node-<id>` directly (`strayDrillInFromAction` + `openNodeSurface`), never the 60s `set-up-<id>` miss. Proven offline in `deviceProvision.test.ts`. - **4** — the two existing orphans are left for the repaired baseline to walk off (both boxes are gone → both route to S1x → remove), per the "or let the repaired baseline walk them off" option.
Author
Member

close-report for #1044 — status success

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

envelope
{
  "issue": 1044,
  "status": "success",
  "commits": [
    "95b13a8b"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/deviceProvision.test.ts",
    "app/tests/e2e/fixtures/deviceProvision.ts",
    "app/tests/e2e/journey.device.spec.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/deviceProvision.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx eslint tests/e2e/fixtures/deviceProvision.ts tests/e2e/fixtures/deviceProvision.test.ts tests/e2e/journey.device.spec.ts",
      "exit_code": 0
    },
    {
      "command": "npx prettier --check (touched files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. afterAll removes the node this drive landed (deviceId, when set) through the same removal path leg 13 uses, guarded and non-fatal like declineOwnPending": "journey.device.spec.ts afterAll: the `if (dash && deviceId)` block reads the landed row's control, resolves its shape via strayDrillInFromAction, and calls walkOffNode inside a try/catch that only logs (non-fatal)",
    "2. Decide and encode what removal means for a node whose host is already destroyed (ordering / tolerate unreachable host)": "Ruled under ADR 0174 (comment on issue): reap the droplet FIRST, then walk the node off — out-of-reach routes to S1x's remove-device and remove-and-deploy is a gateway-side empty-selection deploy that converges without the box; encoded by placing the afterAll cleanup after runDeviceTeardown",
    "3. Give assertFleetGatewayOnly's walk-off the change-node- control for a provisioned stray instead of the 60s openDeviceSetup miss": "New pure seam strayDrillInFromAction + openNodeSurface/openDeviceChange (deviceProvision.ts); the walk-off loop now branches on the row's real control; proven offline in deviceProvision.test.ts (13/13, incl. the change-node- provisioned case)",
    "4. Clear the two orphans (node-req-0003, node-req-0005), or let the repaired baseline walk them off": "Left for the repaired baseline per the issue's 'or' option — both boxes are gone so both route to S1x -> remove; node-req-0003 (provisioned) via change-node-, node-req-0005 (unprovisioned) via set-up-, neither paying the 60s miss"
  },
  "summary": "afterAll now removes a device drive's landed node after the droplet reap and the standing walk-off drills a provisioned stray via change-node-, so mid-journey reds stop orphaning placed nodes in the standing fleet.",
  "blockers": []
}
**close-report** for #1044 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1044, "status": "success", "commits": [ "95b13a8b" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/deviceProvision.test.ts", "app/tests/e2e/fixtures/deviceProvision.ts", "app/tests/e2e/journey.device.spec.ts" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/deviceProvision.test.ts", "exit_code": 0 }, { "command": "npx eslint tests/e2e/fixtures/deviceProvision.ts tests/e2e/fixtures/deviceProvision.test.ts tests/e2e/journey.device.spec.ts", "exit_code": 0 }, { "command": "npx prettier --check (touched files)", "exit_code": 0 } ], "criteria": { "1. afterAll removes the node this drive landed (deviceId, when set) through the same removal path leg 13 uses, guarded and non-fatal like declineOwnPending": "journey.device.spec.ts afterAll: the `if (dash && deviceId)` block reads the landed row's control, resolves its shape via strayDrillInFromAction, and calls walkOffNode inside a try/catch that only logs (non-fatal)", "2. Decide and encode what removal means for a node whose host is already destroyed (ordering / tolerate unreachable host)": "Ruled under ADR 0174 (comment on issue): reap the droplet FIRST, then walk the node off — out-of-reach routes to S1x's remove-device and remove-and-deploy is a gateway-side empty-selection deploy that converges without the box; encoded by placing the afterAll cleanup after runDeviceTeardown", "3. Give assertFleetGatewayOnly's walk-off the change-node- control for a provisioned stray instead of the 60s openDeviceSetup miss": "New pure seam strayDrillInFromAction + openNodeSurface/openDeviceChange (deviceProvision.ts); the walk-off loop now branches on the row's real control; proven offline in deviceProvision.test.ts (13/13, incl. the change-node- provisioned case)", "4. Clear the two orphans (node-req-0003, node-req-0005), or let the repaired baseline walk them off": "Left for the repaired baseline per the issue's 'or' option — both boxes are gone so both route to S1x -> remove; node-req-0003 (provisioned) via change-node-, node-req-0005 (unprovisioned) via set-up-, neither paying the 60s miss" }, "summary": "afterAll now removes a device drive's landed node after the droplet reap and the standing walk-off drills a provisioned stray via change-node-, so mid-journey reds stop orphaning placed nodes in the standing fleet.", "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#1044
No description provided.