Health checks scan for broken-app signatures and refuse to pass on an unassertable response #417

Closed
opened 2026-08-10 21:14:43 +00:00 by ben · 2 comments
Owner

The declared health checks (control-plane/cmd/control-plane/servicehealth.go) assert decoded semantics — good. What's missing is the negative half, learned from the mauke fleet's probe harness: their SnappyMail served "Permission denied! SnappyMail can not access the data folder" with HTTP 200 for days — unit active, container Up, fleet reporting zero failed units. A status code (and even a 200-with-body) is not a health signal. See docs/GOTCHAS.md #8.

Acceptance criteria

  • Each HTTP-bodied health check scans the body against a shared error-signature list (stack-trace markers, permission-denied phrasings, framework error pages); calibrate the list against all current healthy bodies so a hit is signal, not noise (record the calibration in a comment).
  • Each check declares a minimum-body-size floor — a broken app's error page is almost always dramatically smaller than its real one.
  • A check that could not have asserted anything (e.g. an empty or sub-floor redirect body) reports a distinct not-asserted outcome — never healthy. "A green row that could never have gone red is a lie" (the same honesty rule as ADR 0071 / ADR 0112's noDeclaredCheck).
  • No assertion pins operator-renamable content (community name/title) — renaming through the brand kit is a supported no-rebuild operation and must not redden health.

Source: the clan-community (mauke reference fleet) lessons review, docs/research/2026-08-10-clan-community-lessons.md (lands on main this sitting), lesson 6.

The declared health checks (`control-plane/cmd/control-plane/servicehealth.go`) assert decoded semantics — good. What's missing is the negative half, learned from the mauke fleet's probe harness: **their SnappyMail served "Permission denied! SnappyMail can not access the data folder" with HTTP 200 for days** — unit active, container Up, fleet reporting zero failed units. A status code (and even a 200-with-body) is not a health signal. See `docs/GOTCHAS.md` #8. **Acceptance criteria** - Each HTTP-bodied health check scans the body against a shared error-signature list (stack-trace markers, permission-denied phrasings, framework error pages); calibrate the list against all current healthy bodies so a hit is signal, not noise (record the calibration in a comment). - Each check declares a minimum-body-size floor — a broken app's error page is almost always dramatically smaller than its real one. - A check that could not have asserted anything (e.g. an empty or sub-floor redirect body) reports a distinct **not-asserted** outcome — never healthy. "A green row that could never have gone red is a lie" (the same honesty rule as ADR 0071 / ADR 0112's `noDeclaredCheck`). - No assertion pins operator-renamable content (community name/title) — renaming through the brand kit is a supported no-rebuild operation and must not redden health. _Source: the clan-community (mauke reference fleet) lessons review, `docs/research/2026-08-10-clan-community-lessons.md` (lands on main this sitting), lesson 6._
Author
Owner

Scope note: this ticket improves the checks themselves at their existing run points (provisioning / rollout / rehome). Whether monitoring re-runs them on a schedule is the separate ruling #422 — do not add a scheduler here.

Scope note: this ticket improves the checks themselves at their existing run points (provisioning / rollout / rehome). Whether monitoring re-runs them on a schedule is the separate ruling #422 — do not add a scheduler here.
Author
Owner

Landed in 678812f on main.

The negative half now runs before every HTTP-bodied check trusts its decode, in control-plane/cmd/control-plane/servicehealth.go:

  • Shared error-signature scan (errorSignatures + scanHealthBody): permission-denied phrasings (mauke's SnappyMail Permission denied! SnappyMail can not access the data folder), stack/traceback markers, PHP fatal/parse, framework error pages, 5xx bodies served as 200. Calibrated against every healthy fixture — no bare error/maintenance, no operator-renamable token (community name/title, Nextcloud productname), case-insensitive. Calibration recorded in the source comment.
  • Minimum-body-size floors per check (files/mail/static-sites/docs-editing/code/chat), documented against each healthy body.
  • Distinct not-asserted outcome (errNotAsserted sentinel): an empty or sub-floor 200 is not-asserted, never healthy (ADR 0071 / ADR 0112 noDeclaredCheck honesty), and no longer a cryptic decode error.
  • No operator-renamable content pinned — a renamed productname stays green (covered by the calibration guard test).
  • JVB /about/health runs the scan at floor 0: an empty healthy body is fine (status is the assertion), an error page served with a 200 still reds.

Tests: control-plane/cmd/control-plane/servicehealth_signature_test.go — scanHealthBody outcomes, healthy-fixture calibration guard (incl. renamed community productname), every check builder refusing a 200 error page, and the floored checks reporting not-asserted on an empty 200 (meetings exempt). Full package tests green; pre-push gate green.

Scope honoured (#422 ruling): checks hardened at their existing run points — no scheduler added here. STATUS.md header marks #417 LANDED.

Landed in `678812f` on `main`. The negative half now runs before every HTTP-bodied check trusts its decode, in `control-plane/cmd/control-plane/servicehealth.go`: - **Shared error-signature scan** (`errorSignatures` + `scanHealthBody`): permission-denied phrasings (mauke's SnappyMail `Permission denied! SnappyMail can not access the data folder`), stack/traceback markers, PHP fatal/parse, framework error pages, 5xx bodies served as 200. **Calibrated** against every healthy fixture — no bare `error`/`maintenance`, no operator-renamable token (community name/title, Nextcloud `productname`), case-insensitive. Calibration recorded in the source comment. - **Minimum-body-size floors** per check (files/mail/static-sites/docs-editing/code/chat), documented against each healthy body. - **Distinct not-asserted outcome** (`errNotAsserted` sentinel): an empty or sub-floor 200 is not-asserted, never healthy (ADR 0071 / ADR 0112 `noDeclaredCheck` honesty), and no longer a cryptic decode error. - **No operator-renamable content pinned** — a renamed `productname` stays green (covered by the calibration guard test). - JVB `/about/health` runs the scan at floor 0: an empty healthy body is fine (status is the assertion), an error page served with a 200 still reds. Tests: `control-plane/cmd/control-plane/servicehealth_signature_test.go` — `scanHealthBody` outcomes, healthy-fixture calibration guard (incl. renamed community productname), every check builder refusing a 200 error page, and the floored checks reporting not-asserted on an empty 200 (meetings exempt). Full package tests green; pre-push gate green. Scope honoured (#422 ruling): checks hardened at their existing run points — no scheduler added here. STATUS.md header marks #417 LANDED.
ben closed this issue 2026-08-10 23:11:28 +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#417
No description provided.