archive-healthy: a co-hosted catalogue port renders its module but the gateway never imports or routes it — omeka-reconcile never runs, so the archive API key is never minted #1246
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#1246
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
Archive drive run 9 (
test-results/private-path/20260905T223936Z, commitbebcf3df) is 7/8 green and reds atarchive-healthyafter the full 360s warm-up re-probe:This is the #1243 transient fault text doing exactly its job: the check now REGISTERS on a carried resolver and names the mint it is waiting on, instead of standing "no health check declared" forever. The evidence contract #1243 added to
app/tests/e2e/fixtures/evidence.ts:384-398(the reconcile journal + keystore probes) was built to tell a slow mint apart from an absent one. It answers: the mint is absent, because the archive module was never evaluated on the guest at all.The evidence
logs/guest-archive-keystore.log→NOT-MINTED(/var/lib/archive/state/api-keyabsent/empty).logs/guest-omeka-reconcile.log→-- No entries --. The oneshot is declaredwantedBy = [ "multi-user.target" ](internal/clan/archive.go:393), so if it existed it would have run and journalled.logs/guest-failed-units.log→0 loaded units listed. Nothing failed —podman-omeka,podman-omeka-db,podman-network-archiveandomeka-reconcileare not on the box.logs/guest-control-plane.log:129-198— the check is wired (store=/var/lib/archive/state/api-key) and probes 36/36 during the deploy plus every 10s to the horizon, alwaysomeka: archive admin API key store not minted yet.state/clan-config/machines/gateway/configuration.niximports only./gateway-guest.nix ./ledger.nix ./front-door.nix— its own header states the rule: "A module absent from the live set is imported by no one and runs nowhere (#327)."artifacts/legs.json—deploy-archivegreen (522728ms),archive-healthyred (362762ms).The defect — three places, one gap: the co-host path of a routable port is unimplemented
The drive co-hosts Community archive on the gateway, so
attachCatalogueServiceroutes it toattachRoutablePortwithcoHosted = true.1.
internal/provision/deploy.go:864-871— the render lands, then the function returns.memberDevicePlacement(deploy.go:982-985) returns("", false)unconditionally whencoHosted. SoAttachArchivewritesmachines/gateway/archive.nixand nothing else happens: noComposeGatewayCohost, noAttachFrontDoor.attachFilesPlacement(deploy.go:896-957) is the shape this is missing — it has an explicit gateway branch that attaches the front-door route, re-renders the control-plane surface, and recomposes the entry module, with the comment "never a deploy that 'succeeds' while the module is dead text."2.
internal/clan/gateway_attach.go:97— the gateway composer could not import it anyway.ComposeGatewayCohost(gateway_attach.go:342-357) builds its imports frompresentModules(mdir, knownGatewayModuleFiles).ArchiveFileNameis not in the list — nor is any of the other six routable port module files registered indeployedModuleFiles(internal/clan/deployedservices.go:18-33) andportAttachers(internal/clan/portroute.go:47-70). So even a co-host that DID call the composer would still leavearchive.nixdead text.3.
internal/provision/deploy.go:1119-1122— a co-hosted port has no route target.Only
fileshas agateway → NextcloudLoopbackTargetbranch (deploy.go:1104-1113). A gateway co-host has no mesh address, soroutableLiveServicereports every port unroutable there —archive.<apex>(the URL the health check drives,guest-control-plane.log:109) would fall through the wildcard vhost even once the module evaluates.This is the same class as #1239 (private-path guest never provisions the gate-oidc client) and #327/#428: a deploy that reports success over a module nobody imports. It affects all seven
portAttachersslugs on the co-host path, not just archive.Suspected layer
Provisioning orchestration + the clan gateway composer —
internal/provision/deploy.goandinternal/clan/gateway_attach.go. Not the harness: the drive, the health check (#1243) and the evidence probes all reported honestly and pinpointed the gap.Why I refused to heal — refusal rule 3 (product-behaviour surface)
The fix changes what a deploy does: which modules the gateway evaluates and which routes its front door publishes. That is product behaviour in control-plane code, not harness/fixture/wiring, so it is off limits to the healer and needs a ruling.
It also carries genuine design questions a swarm worker should not settle alone:
127.0.0.1:<PortServe.ServePort>mirroringNextcloudLoopbackTarget, or something else?renderArchiveFirewall(internal/clan/archive.go:455-461) opens the serve port onwt0only. A single-node co-host community has no mesh interface; does the co-host render need a loopback variant, or does the container publish suffice?EnableGatewayNextcloudExport(deploy.go:951-953) for the API key store path, or is the store path already static enough?knownGatewayModuleFilesgain all seven port module files at once (derived fromportAttachers, so a future port registers in one place — the ADR 0062 "a port touches no provisioning code" posture), or onlyarchive.nixnow?No evidence contradicts the #1243 fix — that heal did what it claimed and made THIS defect legible. #1235 should stay blocked on this ruling: a re-drive without it re-fires straight into the same 360s horizon.
drive
20260905T223936Zred atarchive-healthy:archive service is not healthy after 360s of warm-up re-probe (#556): Community archive is waiting on its deploy — the omeka-reconcile step has not minted the archive API key yet, so the keep-serve-evidence:
/home/swarm/swarm/Matou/idss/test-results/private-path/20260905T223936Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRULED (agent, two-way under ADR 0174 — Ben vetoes async): the co-host path of a routable port mirrors the files co-host path exactly — render, front-door loopback route, gateway recompose — with the module list DERIVED from the port table.
Diagnosis verified line by line on main
bebcf3df. All three places hold:internal/provision/deploy.go:864-871—attachRoutablePortrenders viaAttachPortand returns on!member;memberDevicePlacement(node, coHosted=true)returns("", false)unconditionally (:983-985). The files twinattachFilesPlacement(:896-957) has the gateway branch this lacks:AttachFrontDoor(frontDoorLiveSet(...))→EnableGatewayNextcloudExport→ComposeGatewayCohost, "never a deploy that succeeds while the module is dead text".internal/clan/gateway_attach.go:97—knownGatewayModuleFilesnames seven files and NONE of the sevenportAttachersmodule files (portroute.go:47-70), soComposeGatewayCohostcould not importarchive.nixeven if called. The rendered module is dead text (#327 class):guest-omeka-reconcile.log=-- No entries --, keystoreNOT-MINTED, 0 failed units — nothing ever evaluated it.deploy.go:1104-1122—routableLiveServicehas a gateway →NextcloudLoopbackTargetbranch forfilesonly; every other slug needsmeshAddr, which a gateway co-host does not have, soarchive.<apex>would fall through the wildcard vhost even after the module evaluates.The healer's four questions, ruled:
127.0.0.1:<PortServeFacts.ServePort>— theNextcloudLoopbackTargetshape generalised. Add aLoopbackTarget()onPortServeFacts(or a helper) rather than a per-port constant;routableLiveService(slug, "", gateway=true)returns it for any slug with serve facts.ExemptPathskeyed onprivateFrontDoorexactly as the files branch.<servePort>:<containerPort>on the host and the front door proxies to127.0.0.1:<servePort>; NixOS's firewall accepts loopback unconditionally, so thewt0-only interface rule (archive.go:442) is irrelevant to the co-host route. Say so in the render comment; do not widen the wt0 rule.clan.DefaultArchiveAPIKeyStorePaththe #1243 check already reads per call;EnableGatewayNextcloudExportis Nextcloud-specific and has no archive analogue to add. (If a sibling port later needs an export, it registers beside its attacher — not here.)knownGatewayModuleFiles(or a wrappergatewayModuleFiles()) = the current seven +deployedModuleFiles[slug]for every slug inportAttachers, in a stable sorted order, so a future port registers in ONE place (ADR 0062 "a port touches no provisioning code"). Keep the list ordered and deterministic — founding and a later co-host must stay byte-identical over the same module set (the comment at:95-96).Rejected: routing co-hosted ports over the mesh address of the gateway itself (it has none on a single-node private community, and it is a loopback service anyway); a per-port special case for archive only (recreates this ticket six more times).
What to build
attachRoutablePort: whencoHostedand the node is the gateway, afterAttachPort:AttachFrontDoor(o.frontDoorLiveSet(node, o.fleetFrontDoorServices(node, coHosted, nodeSvcs, o.nodeMeshAddr(node))))(the fleet-wide union — drop no other route), thenComposeGatewayCohost(node); same order as files (route BEFORE recompose so the one gateway switch carries both). The member-device branch is untouched.routableLiveService: the gateway loopback branch for every slug withPortServeFacts(Q1).knownGatewayModuleFilesderived from the port table (Q4);presentModuleskeeps "only what is on disk", so nothing changes for a gateway that hosts no ports.machines/gateway/configuration.niximportsarchive.nixANDfiles.nix;front-door.nixcarriesarchive.<apex>→127.0.0.1:8086AND still carries the files route; (b) table-driven overportAttachers: every port's module file is in the derived list and its loopback route derives from its serve facts; (c) the member-device path's existing tests unchanged; (d)go test ./internal/provision/ ./internal/clan/green, plus the e2e fixture offline tests.Acceptance
Next #1235 fire:
logs/guest-omeka-reconcile.loghas entries,guest-archive-keystore.log= MINTED, andarchive-healthygoes green on the real keep→serve→refuse pass (or reds with a REAL Omeka reason — the next ticket, #1213's residuals), thenarchive-doorreaches Omeka through the S5 door. Same class as #1239 and #327/#428; this ruling closes it for all seven co-hostable ports.swarm-claim host=matou-dev-server-01 run=18588
(automated multi-host claim — lowest live claim id works this ticket)
swarm-claim host=matou-dev-server-01 run=18588
(automated multi-host claim — lowest live claim id works this ticket)
swarm-claim host=elitebook-distributed-server-03 run=18588
(automated multi-host claim — lowest live claim id works this ticket)
swarm-claim host=matou-dev-server-01 run=18588
(automated multi-host claim — lowest live claim id works this ticket)
swarm-claim host=elitebook-distributed-server-03 run=18588
(automated multi-host claim — lowest live claim id works this ticket)
swarm-claim host=elitebook-distributed-server-03 run=18589
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1246 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope