#945: founding reads the community CA before it mints it — the rented and own-VPS gateways render no idss-community-ca-* vars, so Approve refuses with ErrNoCA #949
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.
Blocks
Reference
Matou/idss#949
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?
Failure
Drive
20260828T174113Z(targetdevice, commitfa0d297c) red at theapproveleg after 23 green legs —artifacts/legs.json:24,artifacts/verdict.json(firstRedLeg: approve, 814 ms). The control plane refused to mint the device grant:Surfaced by
app/tests/e2e/fixtures/deviceAdd.ts:214(the #945 refusal race added ated4499f5— that leg self-explained correctly and reds in 814 ms instead of burning the 5-min ceiling; it is working as designed).Diagnosis: an ordering inversion, not a missing wire
bb80306dwired the gateway's device-grant signer to two persisted-prompt clan vars fed by founding. On the rented and own-VPS carrier paths the feed is read one leg too early:internal/founding/rentedpath.go:289—installRented(theenroll-configureleg) callscommunityCAAnswers(ctx, o.trustRoot).internal/founding/standup.go:706-714—applyPairedis the only caller oftrustRoot.Ensure, i.e. the only thing that mints the root. It runs at the pair leg.internal/founding/rentedpath.go:254then:268— install returns before pair is entered. Same shape on own-VPS:internal/founding/ownvpspath.go:430(install) before:482(pair), feed at:609.On a fresh community the app's
community-cadir (app/helper/cmd/helper/wiring_prod.go:116) is empty, sotrustRootAdapter.Material→enroll.Material(internal/enroll/community_ca_store.go:187-190) returns a wrappedos.ErrNotExist.communityCAAnswers(internal/founding/ownvpspath.go:544-552) deliberately swallows that intook=false, so the miss is silent:GatewayFacts.CommunityCAstays false →gatewayCommunityCAGenerators(internal/clan/vmguest.go:1884-1889) emits no generator;gatewayEnvExports(internal/clan/vmguest.go:1657-1663) exports noIDSS_COMMUNITY_CA_KEY_FILE/_CERT_FILE;productionCommunityCA(control-plane/cmd/control-plane/main.go:192-207) returns nil and the enroll ledger's Granter rests.Both run records confirm it
state/clan-config-snapshot/tree.txt— the gateway's vars carryidss-claim-secret,gate-oidc,kanidm-admins,kanidm-tls,state-version, and zeroidss-community-ca-*entries. The generators were never declared.logs/gateway-journal.txt:1322(17:54, first control-plane start after enroll-activate), and again at:1718/:1808(18:36, after the deploy leg):community CA resting: no IDSS_COMMUNITY_CA_KEY_FILE/_CERT_FILE — device approval refuses (ErrNoCA) until founding feeds the root into the gateway's vars (ADR 0111, #945).logs/founding-state.log— the seed leg placedroot-caamong the 5 crown jewels, so the root does exist by then; it simply did not exist atenroll-configure, three legs earlier.Why the seam tests stayed green
Two independent blind spots:
internal/founding/selfhostedpath_test.go:476(TestSelfHosted_DeployFeedsTheCommunityCA) exercisescomposeSelfHostedGateway, whose feed atinternal/founding/selfhostedpath.go:210sits insiderunDeploy— afterapplyPairedmints. Self-hosted is genuinely fine. Rented and own-VPS have no equivalent test.FakeTrustRoot.Materialis not keyed onEnsure.internal/founding/testing/fakes.goanswers fromKeyPEM/CertPEMset at construction, so a fake handed material reports it minted even ifEnsurewas never called. The real adapter's material only appears on disk onceEnsureruns.TestCommunityCAAnswers(internal/founding/ownvpspath_internal_test.go:303) pins the unminted→ok=falsebehaviour of the helper in isolation, which is correct — nothing pins when the helper is called relative to the mint.Suspected layer
internal/founding— carrier-path leg ordering. Not clan render, not control-plane composition, not enroll: those three all behave correctly given a fed var. The commit message onbb80306dsays the feed rides "the seed leg"; the code puts it on the install leg, and on two of three carriers that is ahead of the mint.What plugging it needs
A ruling on where ADR 0111's mint moment sits, since
bb80306dlanded one commit ago as an ADR 0111 amendment on Ben's ruling and the fix amends it again. The options are not equivalent:trustRoot.Ensureso it runs ahead ofinstallRented/installOwnVPS(the community name is known from the create leg —s.Draft.Details.Nameis populated well before), keeping the idempotentEnsureatstandup.go:706as the convergence point for every path. Smallest change; moves ADR 0111's "created when the community is founded, immediately ahead of the first grant" wording earlier in the same ceremony.enroll-configurerender bakes, so a seed-leg feed needs a second render + redeploy after seeding — a new leg, and slower.Whichever lands, two test gaps should close in the same commit:
FakeTrustRoot.Materialhonest — return theos.ErrNotExistwrap untilEnsurehas been called, so the fake models the real adapter's disk;TestSelfHosted_DeployFeedsTheCommunityCA, assertingreq.Gateway.CommunityCAis true and both answers are fed on those paths. With the fake made honest, those two tests fail against today'smainand pass after the fix.Targeted check:
go test ./internal/founding/... ./internal/clan/....Notes
approveleg's own refusal handling is correct and should not be touched.drive
20260828T174113Zred atapprove:the control plane refused to approve the device — the Approve verb landed but minting the grant failed: "enroll: no community CA configured — approval fails loud (ADR 0100/0111); mint one at foundevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T174113Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedCorrect diagnosis — and already landed as
81bfee95(pushed 18:39, minutes before this was filed):communityCAAnswersnowEnsures (idempotently, for the draft's community name) at the seed leg before readingMaterial, on all three carrier paths;applyPaired's mint stays as the net.FakeTrustRoot.MintOnEnsuremodels the real adapter soTestSelfHosted_DeployFeedsTheCommunityCAproves the ordering end to end;TestCommunityCAAnswersasserts the mint precedes the read. Closing so the next #854 drive is the live proof — a worker picking this up would double-land it (#237).