founding: gateway deploy sends an empty Revision, tripping clan's own ADR-0102 exact-revision guard (#462 follow-on) #464
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#464
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
Red leg
control-plane(drive20260812T032139Z, signatureed8f4af586c4):Evidence:
test-results/drive-droplet/20260812T032139Z/logs/founding-state.log:188,.../artifacts/.../error-context.md:15.Root cause
The prior healer commit
327b968(#462) changeddeployRevision()(internal/founding/deploy.go:689-691) to return"", reasoning in its own comment (deploy.go:679-681) that "the clan-config is a locally-assembled path tree ... NOT a git checkout at a committed rev." That premise is false:internal/clan/configrepo.go:54-104(ConfigRepo.Mutate/.Head) shows the config repo IS a real git repo — every mutation (git add -A+git commit) lands a commit, andrunDeployalready lands brand artifacts and the brand logo as commits (internal/founding/deploy.go:301-307, vialandBrandArtifacts/landBrandLogoatdeploy.go:525-573) immediately before callingapplyControlPlane(deploy.go:311) — their returnedclan.Commitvalues are just discarded.So the empty
""revision fromdeployRevision()is threaded intoclan.DeployRequest{Revision: deployRevision()}atdeploy.go:403, and immediately tripsAdapter.Deploy's own guard atinternal/clan/adapter.go:201-203:...which exists precisely because ADR 0102 (
docs/adr/0102-...md:44-46) mandates "Commit-then-apply-exact-revision. A deploy applies a named revision (DeployRequest.Revision)" for every caller, founding included ("founding's stand-up all get their real backing from this one adapter", same ADR, Consequences). The founding path never reaches nix eval; it fails synchronously beforedep.Run().Note: this slipped past
go test ./internal/founding/...in #462 becauseinternal/clan/testing/fake.go'sFake.Deploy(used by founding's test doubles) never enforces the empty-revision guard the realAdapter.Deploydoes — the guard only lives in the production adapter, so only a real rehearsal drive catches it.Suspected layer
internal/founding(deploy orchestration) +internal/clan(theConfigseam needs a way to hand founding a real committed revision).What plugging it needs
"". Two viable shapes:clan.Commitalready returned bylandBrandArtifacts/landBrandLogo(deploy.go:525-573, currently discarded) throughrunDeployintoapplyControlPlane'sDeployRequest.Revision.Head(ctx) (clan.Commit, error)method to theclan.Configinterface (internal/clan/clan.go), backed byconfigFacecalling the existing*ConfigRepo.Head(internal/clan/config.go,internal/clan/adapter.go:407), and call it right before the deploy inrunDeploy.deployRevision()(internal/founding/deploy.go:689-691) and its now-wrong-contract testinternal/founding/deployrevision_internal_test.go(currently asserts the revision MUST be empty — exactly backwards).internal/clan/testing/fake.go'sfakeConfigneeds the corresponding method/wiring so founding's unit tests keep exercising the real contract (and would have caught this).internal/founding/privatepath.go:728,740also callslandBrandArtifacts/landBrandLogo(for the private/VM path, which builds viaEnroll, notDeploy— it doesn't need the revision, just needs to keep compiling against whatever signature change lands).This spans the
clan.Configinterface plus its two implementations and 2-3 founding files — over the healer's self-fix bound (design/interface decision, >3 files) — so filing rather than patching directly.deployRevision()is currently called from exactly one site (deploy.go:403), so the blast radius of the actual fix is well-contained once the shape (a) vs (b) is picked.drive
20260812T032139Zred atcontrol-plane:journey leg "control-plane" went red: founding: gateway deploy: founding: prepare gateway deploy: clan: deploy requires an exact committed revision (commit-then-apply, ADR N)evidence:
test-results/…/20260812T032139Z/on matou-workstation (legs.json, droplet-journal.txt, trace)Verified fix: return the assembled clan-config repo's HEAD commit SHA
Confirmed against this run's captured config (
test-results/drive-droplet/20260812T032139Z/state/clan-config), no droplet:git rev-parse HEAD=c82402cc75cefd52df69c8e362037e669bb5358d, working tree clean.So the fix is not the previous empty string (#462 — trips this ADR-0102 guard) and not the old
"founding-gateway-"+nodestub (parses as a bad hash).deployRevisionmust return the HEAD commit SHA of the assembled clan-config repo (o.clan/adapter repo dir = the same dirflakeRefuses). Resolve it withgit -C <dir> rev-parse HEADat deploy time;flakeRefthen buildsgit+file://<dir>?rev=<SHA>, which satisfies commit-then-apply (ADR 0102) and evals cleanly.The founding flow already commits the assembled config (that IS the "commit" in commit-then-apply); the bug is only that
deployRevisionnever read the resulting HEAD.deployRevisioncurrently takes no args and returns "" — it will need the config repo dir (thread it through fromapplyControlPlane, which haso), or resolve HEAD inapplyControlPlaneand pass it asDeployRequest.Revision.Test
deployRevision/applyControlPlaneyields a 40-hex SHA thatrev-parse --verifyconfirms in the assembled repo — never "" and never a non-SHA.readinessAtover the assembled config at the resolved rev returns OK for the gateway node.clan machines update(reconcile runs) rather than the ADR-0102 guard or the preflight-skip.Verified diagnosis; the next drive is the first real reconcile. Advances #378.
close-report for #464 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope
foundedflips true before the stand-up completes — resume skips the credential hand-off (S12 never ran) #484