updates-open: the Updates surface's empty sections arrive as JSON null, the screen reads .length off one, and the whole P4b surface falls to the display-fault boundary #1630

Closed
opened 2026-09-19 14:15:22 +00:00 by matou-build-agent · 1 comment

The failure

The updates-open leg of the #1618 Updates-lane proof drive (run 20260919T135211Z, artifacts/legs.json — founding-prefix green, operator-session green, updates-open red after 30.5 s) timed out on:

Locator: locator('[data-field="updates"], [data-status="resting"], [data-field="rollout"]').first()
Expected: visible
Error: element(s) not found

at app/tests/e2e/fixtures/updatesDrive.ts:44-45. This is a NEW fault behind the same signature (7e8181a118ff): the previous heal (6bfde109) and the human fix (0f141763) repaired the route owner, and the drive's trace confirms the drill-in assertion one line earlier now PASSES — [data-field="updates-surface-drill-in"] was visible at monotonic 721234.9.

The evidence

artifacts/live-box.json was absent — the droplet was already torn down, so I read the box's own words out of the harvested Playwright trace (artifacts/journey.updates-…/trace.zip), which carries the captured request/response bodies verbatim.

The leg's accessibility snapshot (error-context.md) shows what stood where the surface should be:

- alert:
  - paragraph: This view hit a display fault. The fleet itself is unaffected — this is a display failure, not a service failure.
  - button "Reload this view"

The page console names the throw, 0.5 s after the surface's two reads resolved (721245.3, immediately after GET /api/v1/updates at 721230.9 and GET /api/v1/updates/rollout at 721244.8):

[dashboard] surface display fault TypeError: Cannot read properties of null (reading 'length')
    at Proxy.<anonymous> (…/assets/index-DmrOvLj3.js:144:129095)

And the box's own GET /api/v1/updates — 200, x-idss-composition: whole — says why, verbatim:

{"resting": false, "channel": "testing", "pending": null,
 "automatic": [ {"revision": "6bfde109…", "kind": "patch", …} ],
 "queued": null, "quarantined": null, "current": {…}, "policy": {…}}

(GET /api/v1/updates/rollout answered 404 {"code":"no_rollout","message":"no rollout has run"} — that one is handled correctly by nullOn404 in dashboard/src/lib/api/updatesClient.ts:44-47,110-116, and is not the fault.)

The defect

internal/update/surface.go:94-95 declared the four sections as nil slices:

var pending, automatic, queued []ReleaseView
var quarantined []QuarantineView

and appended per group over s.active. A group with no members stays nil, and encoding/json writes a nil slice as null, never []. internal/controlapi/updates.go:64 marshals svc.State() straight out.

The surface contract declares all four as arrays — dashboard/src/lib/updates.ts:175-179 (pending: ReleaseView[] …) — and HttpUpdatesClient.state() only camelizes the wire (updatesClient.ts:61-63), so UpdatesScreen.vue reads surface.pending.length directly at line 44 (and :76, :100, :118 for the other three). The first null throws in render, Vue unmounts the subtree, and SurfaceErrorBoundary swallows the whole P4b surface — pending releases, review, policy, the maintenance window, rollout. A community at rest, or one with only ONE kind of release outstanding, cannot open Updates at all.

Nothing caught it because every unit test drives the fakes in updates.ts (restingSurface/busySurface), which build [] by hand and never marshal.

Suspected layer

The producer: internal/update/Orchestrator.State(). Fixed there so every consumer (the panel, and the drive's own API probes) gets the shape the contract declares. GOTCHAS #269 records the hazard.

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

Two-way door. The change is six lines in one function — the four sections are composed []ReleaseView{} / []QuarantineView{} instead of var … []ReleaseView; reverting is a one-hunk git revert with no migration, no stored state and no other call site (grepped: nothing reads these fields for nil). It is a mechanical repair, not a design decision: every section already renders behind v-if="…length", so an empty list and a nil slice draw the IDENTICAL screen — no message, route, default, secret or posture changes, and nothing a community sees differs except that the surface now renders at all instead of falling to the error boundary. The code is made to do what it already declared it does (Pending []ReleaseView \json:"pending"`againstpending: ReleaseView[]). Proven here red-first by internal/update/surface_test.go: TestState_EmptySectionsMarshalAsListsNotNullmarshalsState()and failed with"pending" must marshal as an empty list, got null— the box's exact shape — and passes after;TestState_PopulatedSectionLeavesTheOthersAsListsseeds one automatic release (the drive's own founding shape) and proves the other three stay lists.internal/controlapi's HTTP integration suite over the same State()` stays green. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260919T135211Z red at updates-open (sig 7e8181a118ff) — self-fixed on the fast lane, commit 1035817588cc14a53e9ad6245dc69fafb80ef5d4; checks: Targeted: go test ./internal/update -run 'TestState_EmptySectionsMarshalAsListsNotNull|TestState_PopulatedSectionLeavesTheOthersAsLists' — RED first (surface_test.go:34: "pending" must marshal as an empty list, got null), GREEN after (ok git.matou.nz/Matou/idss/internal/update 0.005s). Package: go test ./internal/update/... — ok. Consumer package: go test ./internal/controlapi/... — ok (1.039s). gofmt -l internal/update/ clean, go vet ./internal/update/ clean.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260919T135211Z on matou-workstation.

## The failure The `updates-open` leg of the #1618 Updates-lane proof drive (run `20260919T135211Z`, `artifacts/legs.json` — `founding-prefix` green, `operator-session` green, `updates-open` red after 30.5 s) timed out on: ``` Locator: locator('[data-field="updates"], [data-status="resting"], [data-field="rollout"]').first() Expected: visible Error: element(s) not found ``` at `app/tests/e2e/fixtures/updatesDrive.ts:44-45`. This is a NEW fault behind the same signature (`7e8181a118ff`): the previous heal (`6bfde109`) and the human fix (`0f141763`) repaired the route owner, and the drive's trace confirms the drill-in assertion one line earlier now PASSES — `[data-field="updates-surface-drill-in"]` was visible at monotonic 721234.9. ## The evidence `artifacts/live-box.json` was absent — the droplet was already torn down, so I read the box's own words out of the harvested Playwright trace (`artifacts/journey.updates-…/trace.zip`), which carries the captured request/response bodies verbatim. The leg's accessibility snapshot (`error-context.md`) shows what stood where the surface should be: ```yaml - alert: - paragraph: This view hit a display fault. The fleet itself is unaffected — this is a display failure, not a service failure. - button "Reload this view" ``` The page console names the throw, 0.5 s after the surface's two reads resolved (721245.3, immediately after `GET /api/v1/updates` at 721230.9 and `GET /api/v1/updates/rollout` at 721244.8): ``` [dashboard] surface display fault TypeError: Cannot read properties of null (reading 'length') at Proxy.<anonymous> (…/assets/index-DmrOvLj3.js:144:129095) ``` And the box's own `GET /api/v1/updates` — **200**, `x-idss-composition: whole` — says why, verbatim: ```json {"resting": false, "channel": "testing", "pending": null, "automatic": [ {"revision": "6bfde109…", "kind": "patch", …} ], "queued": null, "quarantined": null, "current": {…}, "policy": {…}} ``` (`GET /api/v1/updates/rollout` answered `404 {"code":"no_rollout","message":"no rollout has run"}` — that one is handled correctly by `nullOn404` in `dashboard/src/lib/api/updatesClient.ts:44-47,110-116`, and is not the fault.) ## The defect `internal/update/surface.go:94-95` declared the four sections as nil slices: ```go var pending, automatic, queued []ReleaseView var quarantined []QuarantineView ``` and appended per group over `s.active`. A group with no members stays nil, and `encoding/json` writes a nil slice as `null`, never `[]`. `internal/controlapi/updates.go:64` marshals `svc.State()` straight out. The surface contract declares all four as arrays — `dashboard/src/lib/updates.ts:175-179` (`pending: ReleaseView[]` …) — and `HttpUpdatesClient.state()` only camelizes the wire (`updatesClient.ts:61-63`), so `UpdatesScreen.vue` reads `surface.pending.length` directly at line 44 (and `:76`, `:100`, `:118` for the other three). The first `null` throws in render, Vue unmounts the subtree, and `SurfaceErrorBoundary` swallows the whole P4b surface — pending releases, review, policy, the maintenance window, rollout. A community at rest, or one with only ONE kind of release outstanding, cannot open Updates at all. Nothing caught it because every unit test drives the fakes in `updates.ts` (`restingSurface`/`busySurface`), which build `[]` by hand and never marshal. ## Suspected layer The producer: `internal/update/Orchestrator.State()`. Fixed there so every consumer (the panel, and the drive's own API probes) gets the shape the contract declares. GOTCHAS #269 records the hazard. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door. The change is six lines in one function — the four sections are composed `[]ReleaseView{}` / `[]QuarantineView{}` instead of `var … []ReleaseView`; reverting is a one-hunk `git revert` with no migration, no stored state and no other call site (grepped: nothing reads these fields for nil). It is a mechanical repair, not a design decision: every section already renders behind `v-if="…length"`, so an empty list and a nil slice draw the IDENTICAL screen — no message, route, default, secret or posture changes, and nothing a community sees differs except that the surface now renders at all instead of falling to the error boundary. The code is made to do what it already declared it does (`Pending []ReleaseView \`json:"pending"\`` against `pending: ReleaseView[]`). Proven here red-first by `internal/update/surface_test.go`: `TestState_EmptySectionsMarshalAsListsNotNull` marshals `State()` and failed with `"pending" must marshal as an empty list, got null` — the box's exact shape — and passes after; `TestState_PopulatedSectionLeavesTheOthersAsLists` seeds one automatic release (the drive's own founding shape) and proves the other three stay lists. `internal/controlapi`'s HTTP integration suite over the same `State()` stays green. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260919T135211Z` red at `updates-open` (sig 7e8181a118ff) — self-fixed on the fast lane, commit `1035817588cc14a53e9ad6245dc69fafb80ef5d4`; checks: Targeted: `go test ./internal/update -run 'TestState_EmptySectionsMarshalAsListsNotNull|TestState_PopulatedSectionLeavesTheOthersAsLists'` — RED first (`surface_test.go:34: "pending" must marshal as an empty list, got null`), GREEN after (`ok git.matou.nz/Matou/idss/internal/update 0.005s`). Package: `go test ./internal/update/...` — ok. Consumer package: `go test ./internal/controlapi/...` — ok (1.039s). `gofmt -l internal/update/` clean, `go vet ./internal/update/` clean.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260919T135211Z` on matou-workstation. <!-- rehearsal-sig: 7e8181a118ff -->
Author
Member

close-report for #1630 — status success

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

envelope
{
  "issue": 1630,
  "status": "success",
  "commits": [
    "1035817588cc14a53e9ad6245dc69fafb80ef5d4"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/update/surface.go",
    "internal/update/surface_test.go"
  ],
  "tests": [
    {
      "command": "Targeted: `go test ./internal/update -run 'TestState_EmptySectionsMarshalAsListsNotNull|TestState_PopulatedSectionLeavesTheOthersAsLists'` — RED first (`surface_test.go:34: \"pending\" must marshal as an empty list, got null`), GREEN after (`ok git.matou.nz/Matou/idss/internal/update 0.005s`). Package: `go test ./internal/update/...` — ok. Consumer package: `go test ./internal/controlapi/...` — ok (1.039s). `gofmt -l internal/update/` clean, `go vet ./internal/update/` clean.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit 1035817588cc14a53e9ad6245dc69fafb80ef5d4"
  },
  "summary": "`Orchestrator.State()` left the Updates surface's empty release sections as nil slices, so the control plane served `\"pending\": null` and `UpdatesScreen.vue`'s `surface.pending.length` threw in render, dropping the whole P4b surface to the display-fault boundary — the four sections are now composed empty, plus a red-first wire-shape test and GOTCHAS #269.",
  "blockers": []
}
**close-report** for #1630 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1630, "status": "success", "commits": [ "1035817588cc14a53e9ad6245dc69fafb80ef5d4" ], "changed_files": [ "docs/GOTCHAS.md", "internal/update/surface.go", "internal/update/surface_test.go" ], "tests": [ { "command": "Targeted: `go test ./internal/update -run 'TestState_EmptySectionsMarshalAsListsNotNull|TestState_PopulatedSectionLeavesTheOthersAsLists'` — RED first (`surface_test.go:34: \"pending\" must marshal as an empty list, got null`), GREEN after (`ok git.matou.nz/Matou/idss/internal/update 0.005s`). Package: `go test ./internal/update/...` — ok. Consumer package: `go test ./internal/controlapi/...` — ok (1.039s). `gofmt -l internal/update/` clean, `go vet ./internal/update/` clean.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit 1035817588cc14a53e9ad6245dc69fafb80ef5d4" }, "summary": "`Orchestrator.State()` left the Updates surface's empty release sections as nil slices, so the control plane served `\"pending\": null` and `UpdatesScreen.vue`'s `surface.pending.length` threw in render, dropping the whole P4b surface to the display-fault boundary — the four sections are now composed empty, plus a red-first wire-shape test and GOTCHAS #269.", "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#1630
No description provided.