remove-archive: a zero-service deploy outcome clones its service rows to nil, so the removal serves "services": null and the dashboard's provisioning surface throws into the display-fault boundary #1282

Closed
opened 2026-09-07 01:34:19 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260907T004410Z (provision-brands.live.spec.ts, commit d192cc9b) went green through eight legs and redded on its FIRST removal leg, remove-archive, after sitting out the whole 1200s SERVICE_REMOVE_CEILING_MS:

deploy did not reach active within 1200s — deploy bar: (no deploy-progress bar found); wire /api/v1/fleet: probe failed: apiRequestContext.get: getaddrinfo ENOTFOUND admin.e2e-drive.idss.internal

The evidence — the removal LANDED; the dashboard died on its outcome

From the run's Playwright trace (report/data/a9ae6ba8….zip, 1-trace.trace + 1-trace.network), all times UTC:

  • 01:00:55.573 — POST /api/v1/provision/deploy → 202. The untick, the REMOVES row and the plain-Deploy confirm all drove clean (app/tests/e2e/fixtures/brandreach.ts:217-275).
  • 01:01:16.675 — the last GET /api/v1/provision/devices/gateway/deploy. Its body (trace resource d9fd33cd…json) is a finished, successful removal: four steps done, outcome.state: "active", completed_at: 2026-09-07T01:01:16.206Z — beside "services": null.
  • 01:01:16 (t=961.8s) — console: [dashboard] surface display fault TypeError: Cannot read properties of null (reading 'find').
  • After that: zero page-originated requests for the remaining twenty minutes. Both independent pollers (deploy status ~1.5s, /api/v1/enroll/pending 3s) stopped dead. Only the harness's own page.request fleet probe kept firing.

The defect

internal/provision/health.go:228 (pre-fix):

out.Services = append([]ServiceHealth(nil), o.Services...)

healthGate builds the rows with make([]ServiceHealth, len(sel.Services)) (internal/provision/health.go:263), so unticking a co-host's LAST service hands clone() a non-nil empty slice — and append(nil, empty...) returns nil, not an empty slice. Every served snapshot goes through that clone (internal/provision/deploy.go:777 for the streamed frame, health.go:583 for ActiveState), so the zero-service outcome reached the wire as "services": null.

Services is tagged json:"services" with no omitempty, and the dashboard declares it non-nullable (dashboard/src/lib/provision.ts:659 — services: ServiceHealth[]). So dashboard/src/components/provisioning/SetupSurface.vue:599:

const mail = deployRun.value?.outcome?.services.find((s) => s.service === 'mail');

— optional-chained through outcome, not through services — threw on null.find. dashboard/src/components/SurfaceErrorBoundary.vue:49-53 caught it exactly as designed and replaced the provisioning surface with its display-fault frame, taking [data-field="active"], [data-status="deploy-progress"] and the surface's pollers with it. waitForDeployActive (app/tests/e2e/fixtures/provision.ts:369-437) then correctly reported what it could see: no bar, no active, budget gone.

ActiveScreen.vue:49 already guards its card list with v-if="outcome.services.length", so an EMPTY list is the case the UI always meant to render — only null was never anticipated. Seven green installs and a green founding never hit it because only a deploy whose service list ends empty reaches the nil.

Suspected layer

The Go outcome producer, internal/provision. Fixed there rather than in the dashboard: the wire contract on both sides already says services is always an array, so guarding ?? [] in the Vue would paper over a contract violation rather than close it.

Two notes on evidence gaps found while diagnosing (not fixed here, out of this commit's scope)

  1. provision-brands.live.spec.ts:121 calls installLegCapture(live.app, live.runDir) without the () => dash getter that the three sibling drives carry (#1244, commit b5cb2c30). Every leg frame in artifacts/legs/ is therefore the byte-identical Electron shell — md5-identical across all nine legs — and the drive keeps no picture of the dashboard at the moment of the red.
  2. waitForDeployActive's wire probe uses page.request.get(...), a Node-side APIRequestContext that does not honour the ceremony browser's --host-resolver-rules. It has failed getaddrinfo ENOTFOUND on every poll of every one of these drives, so the diagnostic that exists precisely to separate "stuck UI" from "stuck deploy" has never once worked — the very distinction this red turned on.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Two-way door, and a mechanical repair rather than a design decision. MECHANICAL: the wire contract already declares this field an array on both sides — internal/provision/health.go:177 tags it json:"services" with no omitempty, and dashboard/src/lib/provision.ts:659 types it services: ServiceHealth[] — and ActiveScreen.vue:49 already renders the empty case behind v-if="outcome.services.length". Emitting null was never what the code meant to do; append([]T(nil), empty...) returning nil is a Go slice trap, not a decision anyone made. The fix makes the code do what it already meant. REVERTIBLE: one line, append(make([]ServiceHealth, 0, len(o.Services)), o.Services...) back to append([]ServiceHealth(nil), o.Services...) at internal/provision/health.go:236 — a later commit reverts it with no migration, no stored state, no operator-visible trace. PROVEN BY A TEST WRITTEN HERE: TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull (internal/provision/health_test.go) drives a real deploy with an empty selection and asserts the outcome's Services is non-nil, that it marshals as "services":[], and that ActiveState serves the array too — it fails before the fix on the exact symptom the drive hit (outcome.Services is nil) and passes after. NO DESIGN CONTENT: no message at a trust moment, no default, no route shape, no secrets shape, no security posture; nothing a community sees changes except that the surface which used to crash now renders the P4-S5 screen it was already written to render. Rules 1 and 2 both hold: no assertion, expectation, test or leg was edited, deleted or skipped (one test was ADDED), and the commit is 3 files with 49 changed non-test lines. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260907T004410Z red at remove-archive (sig 363b2c05fde1) — self-fixed on the fast lane, commit fe6381e364d834ce85b6f134078148ebef849351; checks: targeted (red-first): go test ./internal/provision/ -run TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull -v → FAIL before the fix (health_test.go:1060: outcome.Services is nil — an empty selection must stay an empty SLICE, not a nil one), PASS after. package: go test ./internal/provision/ → ok. consumers: go test ./internal/controlapi/ → ok. whole tree: go test ./internal/... → every package ok, no failures. go build ./... → clean; gofmt -l internal/provision/ → clean.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260907T004410Z on matou-workstation.

## The failure Drive `20260907T004410Z` (`provision-brands.live.spec.ts`, commit d192cc9b) went green through eight legs and redded on its FIRST removal leg, `remove-archive`, after sitting out the whole 1200s `SERVICE_REMOVE_CEILING_MS`: ``` deploy did not reach active within 1200s — deploy bar: (no deploy-progress bar found); wire /api/v1/fleet: probe failed: apiRequestContext.get: getaddrinfo ENOTFOUND admin.e2e-drive.idss.internal ``` ## The evidence — the removal LANDED; the dashboard died on its outcome From the run's Playwright trace (`report/data/a9ae6ba8….zip`, `1-trace.trace` + `1-trace.network`), all times UTC: - `01:00:55.573` — `POST /api/v1/provision/deploy` → **202**. The untick, the REMOVES row and the plain-Deploy confirm all drove clean (`app/tests/e2e/fixtures/brandreach.ts:217-275`). - `01:01:16.675` — the last `GET /api/v1/provision/devices/gateway/deploy`. Its body (trace resource `d9fd33cd…json`) is a **finished, successful removal**: four steps `done`, `outcome.state: "active"`, `completed_at: 2026-09-07T01:01:16.206Z` — beside **`"services": null`**. - `01:01:16` (t=961.8s) — console: `[dashboard] surface display fault TypeError: Cannot read properties of null (reading 'find')`. - After that: **zero** page-originated requests for the remaining twenty minutes. Both independent pollers (deploy status ~1.5s, `/api/v1/enroll/pending` 3s) stopped dead. Only the harness's own `page.request` fleet probe kept firing. ## The defect `internal/provision/health.go:228` (pre-fix): ```go out.Services = append([]ServiceHealth(nil), o.Services...) ``` `healthGate` builds the rows with `make([]ServiceHealth, len(sel.Services))` (`internal/provision/health.go:263`), so unticking a co-host's LAST service hands `clone()` a non-nil **empty** slice — and `append(nil, empty...)` returns **nil**, not an empty slice. Every served snapshot goes through that clone (`internal/provision/deploy.go:777` for the streamed frame, `health.go:583` for `ActiveState`), so the zero-service outcome reached the wire as `"services": null`. `Services` is tagged `json:"services"` with **no** `omitempty`, and the dashboard declares it non-nullable (`dashboard/src/lib/provision.ts:659` — `services: ServiceHealth[]`). So `dashboard/src/components/provisioning/SetupSurface.vue:599`: ```ts const mail = deployRun.value?.outcome?.services.find((s) => s.service === 'mail'); ``` — optional-chained through `outcome`, not through `services` — threw on `null.find`. `dashboard/src/components/SurfaceErrorBoundary.vue:49-53` caught it exactly as designed and replaced the provisioning surface with its display-fault frame, taking `[data-field="active"]`, `[data-status="deploy-progress"]` and the surface's pollers with it. `waitForDeployActive` (`app/tests/e2e/fixtures/provision.ts:369-437`) then correctly reported what it could see: no bar, no active, budget gone. `ActiveScreen.vue:49` already guards its card list with `v-if="outcome.services.length"`, so an EMPTY list is the case the UI always meant to render — only `null` was never anticipated. Seven green installs and a green founding never hit it because only a deploy whose service list ends empty reaches the nil. ## Suspected layer The Go outcome producer, `internal/provision`. Fixed there rather than in the dashboard: the wire contract on both sides already says `services` is always an array, so guarding `?? []` in the Vue would paper over a contract violation rather than close it. ## Two notes on evidence gaps found while diagnosing (not fixed here, out of this commit's scope) 1. `provision-brands.live.spec.ts:121` calls `installLegCapture(live.app, live.runDir)` **without** the `() => dash` getter that the three sibling drives carry (#1244, commit b5cb2c30). Every leg frame in `artifacts/legs/` is therefore the byte-identical Electron shell — md5-identical across all nine legs — and the drive keeps no picture of the dashboard at the moment of the red. 2. `waitForDeployActive`'s wire probe uses `page.request.get(...)`, a Node-side `APIRequestContext` that does **not** honour the ceremony browser's `--host-resolver-rules`. It has failed `getaddrinfo ENOTFOUND` on every poll of every one of these drives, so the diagnostic that exists precisely to separate "stuck UI" from "stuck deploy" has never once worked — the very distinction this red turned on. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door, and a mechanical repair rather than a design decision. MECHANICAL: the wire contract already declares this field an array on both sides — `internal/provision/health.go:177` tags it `json:"services"` with no `omitempty`, and `dashboard/src/lib/provision.ts:659` types it `services: ServiceHealth[]` — and `ActiveScreen.vue:49` already renders the empty case behind `v-if="outcome.services.length"`. Emitting `null` was never what the code meant to do; `append([]T(nil), empty...)` returning nil is a Go slice trap, not a decision anyone made. The fix makes the code do what it already meant. REVERTIBLE: one line, `append(make([]ServiceHealth, 0, len(o.Services)), o.Services...)` back to `append([]ServiceHealth(nil), o.Services...)` at internal/provision/health.go:236 — a later commit reverts it with no migration, no stored state, no operator-visible trace. PROVEN BY A TEST WRITTEN HERE: `TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull` (internal/provision/health_test.go) drives a real deploy with an empty selection and asserts the outcome's `Services` is non-nil, that it marshals as `"services":[]`, and that `ActiveState` serves the array too — it fails before the fix on the exact symptom the drive hit (`outcome.Services is nil`) and passes after. NO DESIGN CONTENT: no message at a trust moment, no default, no route shape, no secrets shape, no security posture; nothing a community sees changes except that the surface which used to crash now renders the P4-S5 screen it was already written to render. Rules 1 and 2 both hold: no assertion, expectation, test or leg was edited, deleted or skipped (one test was ADDED), and the commit is 3 files with 49 changed non-test lines. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260907T004410Z` red at `remove-archive` (sig 363b2c05fde1) — self-fixed on the fast lane, commit `fe6381e364d834ce85b6f134078148ebef849351`; checks: targeted (red-first): `go test ./internal/provision/ -run TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull -v` → FAIL before the fix (`health_test.go:1060: outcome.Services is nil — an empty selection must stay an empty SLICE, not a nil one`), PASS after. package: `go test ./internal/provision/` → ok. consumers: `go test ./internal/controlapi/` → ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/provision/` → clean.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260907T004410Z` on matou-workstation. <!-- rehearsal-sig: 363b2c05fde1 -->
Author
Member

close-report for #1282 — status success

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

envelope
{
  "issue": 1282,
  "status": "success",
  "commits": [
    "fe6381e364d834ce85b6f134078148ebef849351"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/provision/health.go",
    "internal/provision/health_test.go"
  ],
  "tests": [
    {
      "command": "targeted (red-first): `go test ./internal/provision/ -run TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull -v` → FAIL before the fix (`health_test.go:1060: outcome.Services is nil — an empty selection must stay an empty SLICE, not a nil one`), PASS after. package: `go test ./internal/provision/` → ok. consumers: `go test ./internal/controlapi/` → ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/provision/` → clean.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit fe6381e364d834ce85b6f134078148ebef849351"
  },
  "summary": "`Outcome.clone` used `append([]ServiceHealth(nil), …)`, which returns nil for an empty source, so a co-host unticked to zero services served `\"services\": null` and crashed the dashboard's provisioning surface into its display-fault boundary mid-removal; the clone now builds a made slice (the shape `deploy.go`'s `snapshot()` already uses), plus a zero-service regression test and GOTCHAS #182.",
  "blockers": []
}
**close-report** for #1282 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1282, "status": "success", "commits": [ "fe6381e364d834ce85b6f134078148ebef849351" ], "changed_files": [ "docs/GOTCHAS.md", "internal/provision/health.go", "internal/provision/health_test.go" ], "tests": [ { "command": "targeted (red-first): `go test ./internal/provision/ -run TestDeploy_AZeroServiceDeployCarriesAnEmptyServicesArrayNeverNull -v` → FAIL before the fix (`health_test.go:1060: outcome.Services is nil — an empty selection must stay an empty SLICE, not a nil one`), PASS after. package: `go test ./internal/provision/` → ok. consumers: `go test ./internal/controlapi/` → ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/provision/` → clean.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit fe6381e364d834ce85b6f134078148ebef849351" }, "summary": "`Outcome.clone` used `append([]ServiceHealth(nil), …)`, which returns nil for an empty source, so a co-host unticked to zero services served `\"services\": null` and crashed the dashboard's provisioning surface into its display-fault boundary mid-removal; the clone now builds a made slice (the shape `deploy.go`'s `snapshot()` already uses), plus a zero-service regression test and GOTCHAS #182.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1282
No description provided.