update: runHealth passes a rollout stage with no declared check #276

Closed
opened 2026-08-05 23:09:37 +00:00 by ben · 1 comment
Owner

internal/update/rollout.go:344 — runHealth returns nil when hc.Run == nil, so a service with no declared health check counts as healthy. deployStage sets st.Healthy = true, Rollout records Applied, Healthy = true, true (line ~296), the fleet is recorded converged and OutcomeApplied enters history. The Updates surface renders "applied, healthy" for a revision nothing verified — a direct ADR 0112 violation (no check ⇒ no activation).

The correct posture already exists in this repo: internal/provision/health.go:210 treats the identical situation as Healthy = false with a noDeclaredCheck fault.

Acceptance

  • A rollout stage over a node whose clan.HealthCheck.Run is nil records the stage (and the rollout result) as not healthy, with a named no-declared-check fault — never a silent pass.
  • Existing behaviour with a real check (pass and fail) unchanged.
  • Test: rollout with a nil check asserts the fault and that Healthy is false end-to-end (stage → result → history outcome).

Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).

`internal/update/rollout.go:344` — `runHealth` returns nil when `hc.Run == nil`, so a service with **no declared health check counts as healthy**. `deployStage` sets `st.Healthy = true`, `Rollout` records `Applied, Healthy = true, true` (line ~296), the fleet is recorded converged and `OutcomeApplied` enters history. The Updates surface renders "applied, healthy" for a revision nothing verified — a direct ADR 0112 violation (no check ⇒ no activation). The correct posture already exists in this repo: `internal/provision/health.go:210` treats the identical situation as `Healthy = false` with a `noDeclaredCheck` fault. **Acceptance** - A rollout stage over a node whose `clan.HealthCheck.Run` is nil records the stage (and the rollout result) as **not** healthy, with a named no-declared-check fault — never a silent pass. - Existing behaviour with a real check (pass and fail) unchanged. - Test: rollout with a nil check asserts the fault and that `Healthy` is false end-to-end (stage → result → history outcome). --- _Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code)._
Author
Owner

Fixed in origin/main 9946893.

runHealth (internal/update/rollout.go) returned nil for a nil clan.HealthCheck.Run, so deployStage marked the stage healthy, Rollout recorded Applied, Healthy = true, true, the fleet converged and OutcomeApplied entered history — a direct ADR 0112 violation. It now returns a sentinel errNoDeclaredCheck; deployStage names the noDeclaredCheck fault ("no health check declared") on the StageResult, and deployGate carries it onto RolloutResult.Fault. So the stage and the result both record not-healthy with a named fault, the rollout rolls back rather than converging on the unverified revision, and history records OutcomeRolledBack — mirroring provision's posture (internal/provision/health.go).

Acceptance:

  • nil-check stage records not healthy + named no-declared-check fault (never a silent pass) ✓
  • real-check pass/fail behaviour unchanged ✓ (a nil Run was the only silent path; also corrected controlapi passingHealth, which had encoded the bug as a nil Run passes)
  • TestRollout_NoDeclaredCheckIsNotASilentPass asserts the fault and Healthy == false end-to-end (stage → result → history outcome) ✓

go build/go vet/go test green (internal/..., control-plane).

Fixed in origin/main `9946893`. `runHealth` (`internal/update/rollout.go`) returned nil for a nil `clan.HealthCheck.Run`, so `deployStage` marked the stage healthy, `Rollout` recorded `Applied, Healthy = true, true`, the fleet converged and `OutcomeApplied` entered history — a direct ADR 0112 violation. It now returns a sentinel `errNoDeclaredCheck`; `deployStage` names the `noDeclaredCheck` fault ("no health check declared") on the `StageResult`, and `deployGate` carries it onto `RolloutResult.Fault`. So the stage and the result both record not-healthy with a named fault, the rollout rolls back rather than converging on the unverified revision, and history records `OutcomeRolledBack` — mirroring `provision`'s posture (`internal/provision/health.go`). Acceptance: - nil-check stage records not healthy + named no-declared-check fault (never a silent pass) ✓ - real-check pass/fail behaviour unchanged ✓ (a nil Run was the only silent path; also corrected `controlapi` `passingHealth`, which had encoded the bug as `a nil Run passes`) - `TestRollout_NoDeclaredCheckIsNotASilentPass` asserts the fault and `Healthy == false` end-to-end (stage → result → history outcome) ✓ `go build`/`go vet`/`go test` green (internal/..., control-plane).
ben closed this issue 2026-08-06 03:57:22 +00:00
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#276
No description provided.