archive-healthy: the archive health check is never registered — composition resolves the lazy Omeka API-key store at BOOT, so a co-host archive stands "no health check declared" forever #1243
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Matou/idss#1243
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Private-path archive drive run
20260905T213911Z(commit10c31f6e) went red on its last leg. Seven legs green,deploy-archivegreen at 191 s, then:artifacts/legs.json(legarchive-healthy,ms: 362923),artifacts/verdict.json(firstRedLeg: archive-healthy). The throw isapp/tests/e2e/fixtures/provision.ts:508-511: the leg polled the[data-service="archive"]card across the wholeFILES_WARMUP_HORIZON_MSbudget, and the reason it carries is the card's own[data-field="failure"]text.The check never ran. This is not a slow archive, a warm-up race, or a sovereignty breach — it is the cannot-fail-check class: the archive's real keep→serve→refuse gate was dead code on this drive.
Evidence
no health check declaredis the const atinternal/provision/health.go:394. It is set at exactly one place —internal/provision/health.go:416— reached only by the!ok || check.Run == nilbranch oncheck, ok := o.portCheck(s.Service)(internal/provision/health.go:413).archiveHealthCheckalways populatesRun(control-plane/cmd/control-plane/archivehealth.go:152-192), so the branch taken was!ok: thearchiveslug was never in the registry.control-plane/cmd/control-plane/whole_composition.go:246-248, guarded bydeps.archiveURL != "" && !deps.archiveAdmin.Zero(). The URL half held —guest-control-plane.log:125logsarchive service URL derived ... url=https://archive.e2e-drive.idss.internal. So the guard failed onZero().ArchiveAdmin.Zero()(control-plane/cmd/control-plane/archivehealth.go:98-104) invokes the resolver:id, cred := a.Key(); return id == "" || cred == "". Called from the composition root, that resolves the store file at boot.productionArchiveAdmin(control-plane/cmd/control-plane/main.go:662-673) always hands backArchiveAdmin{Key: lazyArchiveKey(store)}overclan.DefaultArchiveAPIKeyStorePath=/var/lib/archive/state/api-key(internal/clan/archive.go:117-124). That store is minted by theomeka-reconcileoneshot, which only runs when the archive port is deployed (internal/clan/archive.go:389-420).logs/guest-control-plane.logis21:50:35, anddeploy-archiveran21:50:41 → 21:53:53with the health probe after. No boot follows the archive deploy.So at every boot the store cannot exist →
Zero()is true → the check is never registered → the deployed archive readsno health check declared, and the card's Retry cannot rescue it:runCheckdoes re-read the registry per probe (internal/provision/health.go:405-407), but nothing ever adds the entry post-boot.Suspected layer
Control-plane composition root —
control-plane/cmd/control-plane/whole_composition.go:246. The boot-timeZero()guard defeats the very design the port documents three times over:ArchiveAdmin.Key(archivehealth.go:85-91),productionArchiveAdmin(main.go:655-661) andlazyArchiveKey(main.go:675-683) all state the key is read per call "so the store an archive co-host deploy materialises AFTER this switch-exempt control plane booted (#858) is honoured with no restart, never the boot-frozen empty key that would rest a deployed service's check forever (#1169)". The resolver is lazy; the guard that reads it is not.This is precisely the resting-because-UNWIRED class the port's own suite names at
control-plane/cmd/control-plane/six_port_health_wiring_test.go:25-31. That suite is green only becausesetArchiveKeyStore(:42-49) pre-writes the store beforeproductionArchiveAdminis called (:105,:210) — production has no such pre-write, so the seam the test covers is not the seam production crosses.Class, not one port. Every sibling resolves its lazy secret inside
Zero()the same way —paperlesshealth.go:85,whakapapahealth.go:92,videohealth.go:137,surveyshealth.go:87(a.Secret == nil || a.Secret() == "") — all read atwhole_composition.go:233…. Any co-host deploy whose credential materialises at deploy time can freeze the same way. Archive is strictly the worst case: both its identity and its credential come from the minted store, so it has no boot-known fallback at all. Worth one ruling for all six.Why this was refused, not healed
Refusal rule 3 — product-behaviour surface. The fix lands in the control plane's composition root and changes which health checks gate a deploy: an archive that today can never activate would be gated on a real Omeka probe and could activate and publish its door. That is a change to what a deploy does and what the community sees on the P4-S5 card — a ruling, not a heal.
It is also not a mechanical one-liner. The naive fix (guard on
deps.archiveAdmin.Key != nil) registers the check unconditionally, so a store not yet minted at probe time makes the check probe anonymously and fail with its sovereignty summary — "Community archive is not serving … the visibility gate did not hold" — blaming a breach for a missing key.Zero()'s own doc rejects exactly that (archivehealth.go:95-97: "the check rests rather than probe as a half key (the honest 403 would red a healthy instance)"). Andsix_port_health_wiring_test.go:238-262encodes the current rest-on-Zero semantics as the closed-bug proof. Choosing between rest and fail-loud here is an ADR 0100 / ADR 0112 decision.Shapes for the ruling
deps.archiveAdmin.Key != nil(a resolver was carried,productionArchiveAdmin("")still yields nil) and give the check a named probe-time "the omeka-reconcile key store has not been minted yet" fault, distinct from the sovereignty summary, so the warm-up re-probe can ride it out while the store lands and an unminted store never reads as a breach.runCheckasks the check itself whether it can present a key, so rest-vs-run is decided per probe rather than frozen at boot. Closest to the documented per-call intent, but changes what "registered" means for the no-coverage invariant.omeka-reconcilehas minted. Heaviest; adds a deploy→control-plane edge that does not exist today.Whichever shape lands should also settle the sibling ports at
whole_composition.go:233-256.Open question the harvest cannot answer
Whether
/var/lib/archive/state/api-keywas in fact minted on this drive is unverifiable now — the guest is torn down (no listener on the forwarded 45571/34329),grep -i omekaoverlogs/guest-*.logreturns nothing, andlogs/guest-failed-units.loglists 0 failed units, soomeka-reconcileneither succeeded visibly nor failed visibly in the harvest. If the oneshot did not run, there is a second defect in the archive port behind this one, and shape A/B alone will not green the leg.Suggested harvest addition so the next drive can tell the two apart without a paid re-run: capture the
omeka-reconcileunit journal and atest -s /var/lib/archive/state/api-keyprobe alongside the existing guest logs.drive
20260905T213911Zred atarchive-healthy:archive service is not healthy after 360s of warm-up re-probe (#556): no health check declared — this service is not doing its jobevidence:
/home/swarm/swarm/Matou/idss/test-results/private-path/20260905T213911Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedswarm-claim host=matou-dev-server-01 run=222479
(automated multi-host claim — lowest live claim id works this ticket)
RULED (agent, two-way under ADR 0174 — Ben vetoes async): shape A — register the check whenever a resolver is carried; the check itself decides at PROBE time, with a named "key not minted yet" fault.
Diagnosis verified line by line against main
10c31f6e:ArchiveAdmin.Zero()(archivehealth.go:98-104) INVOKES the per-call resolver, andwhole_composition.go:246calls it at boot — so the storeomeka-reconcilemints only after the archive co-host deploy (internal/clan/archive.go:389-420) can never exist when the guard runs, the switch-exempt control plane (#858) never reboots to re-evaluate it, and a deployed archive rests onno health check declared(internal/provision/health.go:394/416) forever. The resolver is lazy; the guard that reads it is not.guest-control-plane.logshows three boots (21:50:12/30/35) all logging "the key is read … per call", and the deploy at 21:50:41→21:53:53 with no boot after it. Cannot-fail-check class (#1169's twin): the sovereignty check was dead code on this drive.Rejected: B (runCheck asks the check per probe whether it can present a key) changes what "registered" means for the ADR 0061 no-coverage invariant across every port for one caller's benefit; C (deploy → control-plane re-register signal) adds an edge that does not exist and still races the first probe.
What to build (this ticket = the archive port; the five siblings are a follow-on, see below)
Zero():Carried()(=Key != nil) is whatwhole_composition.go:246guards on;productionArchiveAdmin("")still yields no resolver, so the ABSENT case (no apex, ADR 0100) still rests exactly as today. Do not touchlazyArchiveKey.archiveHealthCheck.Run(archivehealth.go:155): resolveid, cred := admin.Key()FIRST; if either is empty, return a NAMED error before any HTTP — e.g.archive admin key not minted yet: the omeka-reconcile store <path> is empty — the co-host deploy has not landed the key— so the P4-S5 card's failure text names the missing key, never the sovereignty summary ("visibility gate did not hold" must only ever mean a real breach —Zero()'s own doc at:95-97stands). Make sure the card surfaces that error text (check howSummary/the returned error compose intoServiceHealth.Failure/Detailininternal/provision/health.go), and that the anonymous refuse-leg is NEVER run with an empty key.six_port_health_wiring_test.go): the subtest at:238-262currently ENCODES the bug (URL present + Zero credential → no check registered). Re-encode it as: URL derived + store ABSENT → the check IS registered, the probe returns the not-minted fault, and the fake Omeka receives ZERO requests (the leak-unseen assertion becomes "never probed anonymously"). Add the seam production actually crosses: compose with the store absent, THEN write the store (setArchiveKeyStoreaftercomposeSixPortControlPlane), and prove the next probe passes with no re-compose. Keep the ABSENT-URL subtest as is.app/tests/e2e/fixtures/evidence.ts~349-376): addguest-omeka-reconcile(journalctl -u omeka-reconcile --no-pager -n 200) andguest-archive-key-store(test -s /var/lib/archive/state/api-key && wc -l < /var/lib/archive/state/api-key || echo ABSENT) beside the other guest logs. Whether the mint happened on THIS drive is unverifiable now (the healer's open question); if it did not, that is the next ticket (#1213's residual), not this one.go test ./control-plane/... ./internal/provision/green; STATUS.md lead in the same commit.Follow-on (not this ticket):
paperlesshealth.go:85,whakapapahealth.go:92,videohealth.go:137,surveyshealth.go:87,newslettershealth.go:106,calendarhealth.go:112all callSecret()insideZero()at the same boot-time guards (whole_composition.go:233-256). Their credentials come from clan vars that exist at gateway build time, so they do not freeze today — same pattern, consistency fix, filed separately once this lands.Acceptance
On the next #1235 fire:
archive-healthyturns green on a REAL keep→serve→refuse pass (or reds with the not-minted reason naming the store — which would prove the mint itself failed and is then #1213's residual), andarchive-doorreaches Omeka through the S5 door.Ruled by agent under ADR 0174 — veto anytime
Shape A landed (register on a carried resolver, distinguish at probe time). Two-way door: revertible by one commit, proven by red-first tests at the exact production seam; no security-posture widening (it makes a dead sovereignty check live — activation still requires the real keep→serve→refuse pass, including refuse-to-public; a leaking archive is still gated). Not on the one-way-door list.
What landed — commit
bebcf3dfRoot cause confirmed against main: the six credentialed catalogue checks registered behind
deps.<svc>URL != "" && !deps.<svc>Admin.Zero(), butZero()invokes the lazy per-call credential resolver, and the composition root calls it at boot — before the port's own deploy-time oneshot mints the credential store (which lands after the switch-exempt control plane boots, #858). So the guard read the empty pair, the check was never registered, and nothing re-registers post-boot →no health check declaredforever. The resolver was lazy; the guard that read it was not. Archive is the worst case (both identity and credential come from the minted store), but surveys/video/whakapapa/newsletters/document-archive freeze identically — one ruling for all six.The fix:
Admin.Carried()(the resolver func is non-nil, true the moment the URL derives).productionArchiveAdmin("")still yields nil, so the closed #1169 unwired-dep case still readsno health check declared. Six guards flipped; data-collections keeps!Zero()(itsOwnerEmailis boot-known — genuinely resting-because-absent, never freezes).clan.PendingFault— a check that cannot present its deploy-minted credential yet returns it at probe time with its own operator summary ("…is waiting on its deploy — the credential has not landed yet…"), distinct from both the port's sovereignty/serving breachSummary(a missing key is not a breach) andno health check declared(the check is declared).provision.runCheckprefersPendingFault.OperatorSummary()over the staticSummary; the warm-up re-probe / Retry rides it out the moment the store lands. ADR 0100/0112 honoured — no vacuous activation (Healthy stays false while pending).Red-first tests (each fails on old code for the right reason):
six_port_health_wiring_test.go— an un-minted store now registers and waits, notno health check declared.provision_archive_health_test.go— the check returns a*clan.PendingFault, not the sovereignty summary.internal/provision/health_test.go— the gate prefers thePendingFault's own summary and rides it out within the warm-up budget.go build ./...,go test ./internal/provision/... ./internal/clan/... ./control-plane/..., gofmt/vet all green;vitest run tests/e2e/fixtures/331/331 +vue-tscclean. GOTCHAS #172 added.Harvest addition (the open question the harvest couldn't answer)
Added two collectors (
app/tests/e2e/fixtures/evidence.ts, contract test updated):guest-omeka-reconcile(the mint oneshot's journal) andguest-archive-keystore(reportsMINTED size=… lines=…orNOT-MINTED— never the key bytes, rule 6). This lets the next drive tell a boot-freeze (this bug) apart from a mint that never landed (a separate defect).Remaining proof — needs a paid re-drive, not this session
This fix is unit/seam-proven. The
archive-healthyleg itself can only be confirmed green by a re-drive:guest-archive-keystoreharvest shows NOT-MINTED, there is a second defect in the omeka-reconcile path behind this one, and shape A alone cannot green the leg — file it separately. The leg's failure text will now honestly say "waiting on the mint" rather than the misleadingno health check declared, and the harvest disambiguates it.Closing: the ticket's named defect (the boot-frozen
Zero()guard) is fixed and proven. The re-drive confirmation rides #1235.after/requireson podman-omeka.service carries no readiness, so the switch dies at exit 4 #1254after/requireson podman-omeka.service carries no readiness, so the switch dies at exit 4 #1254