whakapapa-healthy: the health gate reads Gramps Web's "absent" 404 as a fault, so create-or-read never reaches its create #1316

Closed
opened 2026-09-08 06:54:35 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260908T053608Z (target brands, on 729d81be): 16 of 17 legs green, whakapapa-healthy red at the 360 s warm-up ceiling.

whakapapa service is not healthy after 360s of warm-up re-probe (#556): Whakapapa is not serving — Gramps Web could not keep a person on the family tree and export it back out

deploy-whakapapa itself went green (1548 s) — the #1313 fixes held: the owner user-add ran once, gated and loud; celery came up clean; whakapapa-brand PUT the kit.

The evidence

Every one of the 36 warm-up probes and every re-probe to the ceiling logged the same line, never advancing and never a different code — logs/guest-control-plane.log:130-201:

service health probe … service=whakapapa node=gateway attempt=1 attempts=36 error="gramps web: could not read the family tree (HTTP 404)" verdict=failed

The port was serving throughout:

  • sign-in returned a token every tick — the check never emitted its could not sign in as the owner identity branch (control-plane/cmd/control-plane/whakapapahealth.go:179);
  • the brand oneshot's tree-scoped PUT /api/trees/-/config answered 200 at 06:25:27 (logs/guest-grampsweb.log), so the owner's tree resolves;
  • guest-failed-units.log lists 0 failed units; celery ran a telemetry task every 10 s to the end of the run.

So: authenticated, tree present, /api/people/ answering 404.

The defect

whakapapaFindFixture GETs /api/people/?gramps_id=IDSSHEALTH0001 and treated any non-200 as a fault — control-plane/cmd/control-plane/whakapapahealth.go:208-210:

if resp.StatusCode != http.StatusOK {
	return false, fmt.Errorf("gramps web: could not read the family tree (HTTP %d)", resp.StatusCode)
}

But gramps-web-api answers a gramps_id-filtered collection GET with abort(404) when no object carries that id — gramps_webapi/api/resources/base.py, GrampsObjectsResource.get, the if "gramps_id" in args branch (read from the pinned upstream, v3.21.1). It never returns an empty list.

A freshly-founded community tree therefore answers the check's very first read with 404. The read half of create-or-read errored out, so the create half at whakapapahealth.go:236-267 was unreachable: the fixture could never be put on the tree, so the gate could never pass. Not a race and not a warm-up ceiling — 360 s or 360 min would have failed identically.

Why it shipped green

Both Gramps Web stand-ins in control-plane/cmd/control-plane/provision_whakapapa_health_test.go served [] for absent (lines 90-92 and 204-206) — a wire the upstream does not speak. The seam proved the check against an invented contract.

Suspected layer

The control plane's whakapapa health check (control-plane/cmd/control-plane/whakapapahealth.go) and its seam fixtures. Nothing in internal/clan's whakapapa render is implicated: the deploy, the containers, the owner bootstrap and the brand oneshot all did their jobs.

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

Two-way door. The change is a nine-line if resp.StatusCode == http.StatusNotFound { return false, nil } branch plus comments in one function of one file — git revert f37e7441 restores the previous behaviour exactly, with no migration, no state, no persisted artifact and no deployed surface behind it. It is revertible by a later commit with nothing to unwind.

Proven by a test written here. TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList (provision_whakapapa_health_test.go) drives the check against a stand-in that answers the absent gramps_id with http.NotFound, exactly as the pinned upstream does. It failed before the fix with the drive's own error string verbatim (gramps web: could not read the family tree (HTTP 404)) and passes after, asserting the create ran exactly once. The two pre-existing stand-ins were corrected to the same real wire, so the whole seam now exercises the fixed path.

Mechanical repair, not a design decision. The check already means to create-or-read by a stable gramps_id — that intent is written into its own header comment (whakapapahealth.go:10-17) and its re-run-safety test. It simply misread the upstream's way of saying "not there yet". No default, message, route, secret or security posture changes; the operator-facing summary is untouched. This is the same class as GOTCHAS #187 ("a container CLI's argument shape is an upstream contract to read from the pinned version's source"), one layer over: an invented REST absent-answer.

Rule 1 is not brushed against. Nothing the check proves is weakened, and I verified the diff against the rails' own patterns: no assertion, expectation, test declaration or leg was removed or rewritten; no skip added; the only test change is net-new. The keep-and-export loop still has to prove itself end to end — if the tree is genuinely unreachable the create that follows 404s too and is reported (as could not add a person to the family tree, a strictly more diagnostic fault than the old dead-end), and the read-back after the create still has to find the fixture on the tree.

One honest limit. This lands the defect the run's evidence names. Whether the POST /api/people/ that now becomes reachable is accepted by the real Gramps Web is not provable on this workstation — I read the upstream's post handler and Gramps' Person.get_schema() (no required fields; fix_object_dict/validate_object_dict accept the partial person the check sends) and it looks sound, but only the drive answers it. That is the drive's job, and it is now able to get there. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260908T053608Z red at whakapapa-healthy (sig 1163e96f8198) — self-fixed on the fast lane, commit 04237af30b734ada43f151c736b0b0e49f107840; checks: targeted (red-first): go test ./control-plane/cmd/control-plane/ -run TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList -v → FAIL before the fix (provision_whakapapa_health_test.go:285: a fresh tree answering 404 for the absent fixture must be CREATED, not read as a fault: gramps web: could not read the family tree (HTTP 404) — the drive's error string verbatim), PASS after. package: go test ./control-plane/cmd/control-plane/ → ok (6.99s). trees: go test ./control-plane/... → no failures; go test ./internal/... → no failures. go build ./... → clean; gofmt -l control-plane/cmd/control-plane/ → clean; go vet ./control-plane/... → clean. Commit shape: 3 files, 24 changed non-test lines (whakapapahealth.go 15, GOTCHAS.md 9), one commit, not pushed; rails self-check → no removed assertion/expectation line, no removed test or leg declaration, no added skip.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260908T053608Z on matou-workstation.

## The failure Drive `20260908T053608Z` (target `brands`, on `729d81be`): 16 of 17 legs green, `whakapapa-healthy` red at the 360 s warm-up ceiling. > `whakapapa service is not healthy after 360s of warm-up re-probe (#556): Whakapapa is not serving — Gramps Web could not keep a person on the family tree and export it back out` `deploy-whakapapa` itself went **green** (1548 s) — the #1313 fixes held: the owner user-add ran once, gated and loud; celery came up clean; `whakapapa-brand` PUT the kit. ## The evidence Every one of the 36 warm-up probes and every re-probe to the ceiling logged the **same** line, never advancing and never a different code — `logs/guest-control-plane.log:130-201`: > `service health probe … service=whakapapa node=gateway attempt=1 attempts=36 error="gramps web: could not read the family tree (HTTP 404)" verdict=failed` The port was serving throughout: - sign-in returned a token every tick — the check never emitted its `could not sign in as the owner identity` branch (`control-plane/cmd/control-plane/whakapapahealth.go:179`); - the brand oneshot's tree-scoped `PUT /api/trees/-/config` answered 200 at 06:25:27 (`logs/guest-grampsweb.log`), so the owner's tree resolves; - `guest-failed-units.log` lists **0 failed units**; celery ran a telemetry task every 10 s to the end of the run. So: authenticated, tree present, `/api/people/` answering 404. ## The defect `whakapapaFindFixture` GETs `/api/people/?gramps_id=IDSSHEALTH0001` and treated **any** non-200 as a fault — `control-plane/cmd/control-plane/whakapapahealth.go:208-210`: ```go if resp.StatusCode != http.StatusOK { return false, fmt.Errorf("gramps web: could not read the family tree (HTTP %d)", resp.StatusCode) } ``` But gramps-web-api answers a `gramps_id`-filtered collection GET with `abort(404)` when no object carries that id — `gramps_webapi/api/resources/base.py`, `GrampsObjectsResource.get`, the `if "gramps_id" in args` branch (read from the pinned upstream, v3.21.1). It never returns an empty list. A freshly-founded community tree therefore answers the check's **very first** read with 404. The read half of create-or-read errored out, so the create half at `whakapapahealth.go:236-267` was unreachable: the fixture could never be put on the tree, so the gate could never pass. Not a race and not a warm-up ceiling — 360 s or 360 min would have failed identically. ## Why it shipped green Both Gramps Web stand-ins in `control-plane/cmd/control-plane/provision_whakapapa_health_test.go` served `[]` for absent (lines 90-92 and 204-206) — a wire the upstream does not speak. The seam proved the check against an invented contract. ## Suspected layer The control plane's whakapapa health check (`control-plane/cmd/control-plane/whakapapahealth.go`) and its seam fixtures. Nothing in `internal/clan`'s whakapapa render is implicated: the deploy, the containers, the owner bootstrap and the brand oneshot all did their jobs. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) **Two-way door.** The change is a nine-line `if resp.StatusCode == http.StatusNotFound { return false, nil }` branch plus comments in one function of one file — `git revert f37e7441` restores the previous behaviour exactly, with no migration, no state, no persisted artifact and no deployed surface behind it. It is revertible by a later commit with nothing to unwind. **Proven by a test written here.** `TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList` (`provision_whakapapa_health_test.go`) drives the check against a stand-in that answers the absent gramps_id with `http.NotFound`, exactly as the pinned upstream does. It failed before the fix with the drive's own error string verbatim (`gramps web: could not read the family tree (HTTP 404)`) and passes after, asserting the create ran exactly once. The two pre-existing stand-ins were corrected to the same real wire, so the whole seam now exercises the fixed path. **Mechanical repair, not a design decision.** The check already *means* to create-or-read by a stable gramps_id — that intent is written into its own header comment (`whakapapahealth.go:10-17`) and its re-run-safety test. It simply misread the upstream's way of saying "not there yet". No default, message, route, secret or security posture changes; the operator-facing summary is untouched. This is the same class as GOTCHAS #187 ("a container CLI's argument shape is an upstream contract to read from the pinned version's source"), one layer over: an invented REST absent-answer. **Rule 1 is not brushed against.** Nothing the check proves is weakened, and I verified the diff against the rails' own patterns: no assertion, expectation, test declaration or leg was removed or rewritten; no skip added; the only test change is net-new. The keep-and-export loop still has to prove itself end to end — if the tree is genuinely unreachable the create that follows 404s too and *is* reported (as `could not add a person to the family tree`, a strictly more diagnostic fault than the old dead-end), and the read-back after the create still has to find the fixture on the tree. **One honest limit.** This lands the defect the run's evidence names. Whether the `POST /api/people/` that now becomes reachable is accepted by the real Gramps Web is not provable on this workstation — I read the upstream's `post` handler and Gramps' `Person.get_schema()` (no `required` fields; `fix_object_dict`/`validate_object_dict` accept the partial person the check sends) and it looks sound, but only the drive answers it. That is the drive's job, and it is now able to get there. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260908T053608Z` red at `whakapapa-healthy` (sig 1163e96f8198) — self-fixed on the fast lane, commit `04237af30b734ada43f151c736b0b0e49f107840`; checks: targeted (red-first): `go test ./control-plane/cmd/control-plane/ -run TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList -v` → FAIL before the fix (`provision_whakapapa_health_test.go:285: a fresh tree answering 404 for the absent fixture must be CREATED, not read as a fault: gramps web: could not read the family tree (HTTP 404)` — the drive's error string verbatim), PASS after. package: `go test ./control-plane/cmd/control-plane/` → ok (6.99s). trees: `go test ./control-plane/...` → no failures; `go test ./internal/...` → no failures. `go build ./...` → clean; `gofmt -l control-plane/cmd/control-plane/` → clean; `go vet ./control-plane/...` → clean. Commit shape: 3 files, 24 changed non-test lines (whakapapahealth.go 15, GOTCHAS.md 9), one commit, not pushed; rails self-check → no removed assertion/expectation line, no removed test or leg declaration, no added skip.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T053608Z` on matou-workstation. <!-- rehearsal-sig: 1163e96f8198 -->
Author
Member

close-report for #1316 — status success

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

envelope
{
  "issue": 1316,
  "status": "success",
  "commits": [
    "04237af30b734ada43f151c736b0b0e49f107840"
  ],
  "changed_files": [
    "control-plane/cmd/control-plane/provision_whakapapa_health_test.go",
    "control-plane/cmd/control-plane/whakapapahealth.go",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "targeted (red-first): `go test ./control-plane/cmd/control-plane/ -run TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList -v` → FAIL before the fix (`provision_whakapapa_health_test.go:285: a fresh tree answering 404 for the absent fixture must be CREATED, not read as a fault: gramps web: could not read the family tree (HTTP 404)` — the drive's error string verbatim), PASS after. package: `go test ./control-plane/cmd/control-plane/` → ok (6.99s). trees: `go test ./control-plane/...` → no failures; `go test ./internal/...` → no failures. `go build ./...` → clean; `gofmt -l control-plane/cmd/control-plane/` → clean; `go vet ./control-plane/...` → clean. Commit shape: 3 files, 24 changed non-test lines (whakapapahealth.go 15, GOTCHAS.md 9), one commit, not pushed; rails self-check → no removed assertion/expectation line, no removed test or leg declaration, no added skip.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit 04237af30b734ada43f151c736b0b0e49f107840"
  },
  "summary": "The whakapapa health check treated gramps-web-api's `abort(404)` — its \"no person carries that gramps_id\" answer — as a fault, so create-or-read dead-ended on its first read of a fresh tree and the fixture could never be created; the find now reads 404 as not-yet-present, the two seam stand-ins serve the real wire instead of an invented `[]`, and a named test pins the upstream contract.",
  "blockers": []
}
**close-report** for #1316 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1316, "status": "success", "commits": [ "04237af30b734ada43f151c736b0b0e49f107840" ], "changed_files": [ "control-plane/cmd/control-plane/provision_whakapapa_health_test.go", "control-plane/cmd/control-plane/whakapapahealth.go", "docs/GOTCHAS.md" ], "tests": [ { "command": "targeted (red-first): `go test ./control-plane/cmd/control-plane/ -run TestWhakapapaHealth_AbsentFixtureIs404NotAnEmptyList -v` → FAIL before the fix (`provision_whakapapa_health_test.go:285: a fresh tree answering 404 for the absent fixture must be CREATED, not read as a fault: gramps web: could not read the family tree (HTTP 404)` — the drive's error string verbatim), PASS after. package: `go test ./control-plane/cmd/control-plane/` → ok (6.99s). trees: `go test ./control-plane/...` → no failures; `go test ./internal/...` → no failures. `go build ./...` → clean; `gofmt -l control-plane/cmd/control-plane/` → clean; `go vet ./control-plane/...` → clean. Commit shape: 3 files, 24 changed non-test lines (whakapapahealth.go 15, GOTCHAS.md 9), one commit, not pushed; rails self-check → no removed assertion/expectation line, no removed test or leg declaration, no added skip.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit 04237af30b734ada43f151c736b0b0e49f107840" }, "summary": "The whakapapa health check treated gramps-web-api's `abort(404)` — its \"no person carries that gramps_id\" answer — as a fault, so create-or-read dead-ended on its first read of a fresh tree and the fixture could never be created; the find now reads 404 as not-yet-present, the two seam stand-ins serve the real wire instead of an invented `[]`, and a named test pins the upstream contract.", "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#1316
No description provided.