clan: the Attach* layer has no production callers — no gateway machine dir imports a second .nix #327
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#327
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?
AttachFrontDoor,AttachCodeandAttachMailare called only from tests — grep finds no production caller for any of them.RenderAcmeDNShas no attach step at all (there is noacmedns_attach.go, and noAcmeDNSFileNameconst).The only Nix that reaches a real gateway is
renderGatewayGuest(internal/clan/vmguest.go:75), called fromwriteNodeConfig(internal/clan/enrollment.go:285). Nothing anywhere writes animports = [ ./front-door.nix ]line, so even a written module would not be evaluated.Partly known —
STATUS.md:1076records that "the live wildcard-cert clan-lab smoke needs a provisioning slice to wirefront-door.nixinto a gateway machine config" — but the gap is broader than the front-door case: it is the same missing slice for acme-dns, code, mail and every future gateway module.Consequences today:
_acme-challengeticket);Definition of done
A provisioning slice composes the gateway machine dir from the live set — the modules that should land, imported and evaluated — with the
AttachXidempotency contract preserved and thenix evalsmoke (internal/clan/seedcommunity_eval_test.go) covering the composed result.Found 2026-08-07 while scoping home-gateway reachability (dynamic address / automatic port opening / IPv6). Full trace in
docs/research/2026-08-07-home-gateway-reachability-scope.md.Verified:
AttachFrontDoor,AttachCode,AttachMailconfirmed defined (each rendering a module and taking a*LiveSet), grepped for callers outside their own definition file and_test.gofiles — none found in production code.RenderAcmeDNSconfirmed to have noAttach*counterpart at all. Confirmed the only Nix path that reaches a real gateway machine dir is the base guest render. Claim holds.Agent Brief
Category: bug
Summary: Compose the gateway machine directory from the live provisioning set so the already-written Attach* modules (front-door, code, mail) and acme-dns actually get imported and evaluated.
Current behavior:
AttachFrontDoor,AttachCode, andAttachMaileach render a Nix module and are exercised in tests, but nothing in the production path calls any of them, and there's no attach step for acme-dns at all. The only Nix path that reaches a real gateway machine dir is the base guest render. So none of these modules' output is ever imported into a machine's config — they are rendered (in tests) but never applied. Consequences: the gateway's public TLS/auth-gate/routing are never actually wired in, and acme-dns never runs (so wildcard DNS-01 can't complete).Desired behavior:
When a gateway needs a module (front door / code / mail / acme-dns), a provisioning slice composes the gateway's machine directory to include it — imported and evaluated, not just written to disk unreferenced. The existing per-module Attach* idempotency contract (each is safe to call again on an unchanged live set) is preserved.
Key interfaces:
AttachFrontDoor,AttachCode,AttachMail, each taking a*LiveSetand returning aCommit) — reuse as-is; the gap is nobody calling them.RenderAcmeDNSexists but has noAttachcounterpart yet.Acceptance criteria:
nix evalsmoke test on the composed result).Out of scope:
Landed in
53fd640onmain.Provisioning slice (the composition):
(*Adapter).AttachGateway(ctx, GatewayLiveSet)(internal/clan/gateway_attach.go) composes the gateway machine dir — it drives each live module'sAttach*(retargeted to the gateway) then writes the gateway'sconfiguration.niximporting EXACTLY the live set plus the baked base host files present in the dir (networking.nix/disko.nix, stat-checked, never fabricated). clan evaluates onlyconfiguration.nixfor a machine (S13 finding), so this is what makes the rendered modules imported-and-evaluated rather than dead text.acme-dns attach step (was missing entirely):
(*Adapter).AttachAcmeDNS(ctx, AcmeDNSLiveSet)+AcmeDNSFileName(internal/clan/acmedns_attach.go), same gateway-only, idempotent shape asAttachFrontDoor.Acceptance:
configuration.nix; a realnix-instantiate --parsesmoke over the composed file proves it is valid Nix (gateway_attach_test.go). A fullnixosSystemeval stays the clan-lab harness's job (deferred to real hardware, per the front-door deferral precedent).Attach*+ the configuration render are deterministic → single writer no-ops; asserted by tip + commit-count equality).Still open (next slice, not this one): no
Attach*has a production caller yet — a production orchestrator must assemble the real live set (apex + service placement + secret paths) from the running fleet and callAttachGateway. #324's_acme-challengebroker wiring depends on this composition having landed. Recorded in STATUS.md.go build ./...+go vet+golangci-lint+go test ./internal/clan/all green; the pre-push gate ran the full suite green.Reopening on the 2026-08-08 whole-branch review's evidence:
53fd640builtAttachGateway(internal/clan/gateway_attach.go) but the slice this issue names is still missing —acmedns_attach.go.renderGatewayGuest→writeNodeConfigremains the only Nix reaching a real gateway, so nothing writes the composedconfiguration.nix(with itsimports = [ ... ]of the live set) onto a live machine — the issue title is still literally true one level up.internal/clan/seedcommunity_eval_test.gois untouched; nonix evalcovers the composed result.What exists is well-made and reviewed; what's missing is the wiring and the smoke. Re-queued ready-for-agent with the above as the remaining scope.
Blocked — the remaining scope's substrate is not on
main.The composition (
AttachGateway,internal/clan/gateway_attach.go) landed onmainin53fd640and its ACs (imported-and-evaluated / idempotent / none-live-none-imported) are covered by the realnix-instantiate --parsesmoke ininternal/clan/gateway_attach_test.go. But the remaining scope this reopen names cannot land onmain:main. The reopen says "renderGatewayGuest→writeNodeConfigremains the only Nix reaching a real gateway, so nothing writes the composedconfiguration.nixonto a live machine." Onmainthere is norenderGatewayGuestand nointernal/clan/vmguest.go— both live only onorigin/private-standup-polish(not an ancestor ofmain). Onmain,writeNodeConfigwrites onlynetworking.nix/disko.nix.main. The reopen says "internal/clan/seedcommunity_eval_test.gois untouched" — that file exists only onorigin/private-standup-polish. The on-maincomposition smoke lives ingateway_attach_test.go.AttachGatewayhas no production home onmain. It is the only production-code writer ofconfiguration.nix, and the on-mainprivate-path gateway guest is stood up viaLocalVM.Create(a NixOS VM from a baked base image) +clan.Enrollin VM mode — not via a composed clan machine dir. The clan-machine-dir gateway-guest path AttachGateway plugs into is theprivate-standup-polisharc's.The 2026-08-08 "whole-branch review" that reopened this evaluated the merged
main+private-standup-polishview; the wiring it asks for belongs on that branch's gateway-guest render path. Landing a divergent main-only caller would also require the deferred "assemble the real live set (apex + service placement + secret paths)" work (which the first close explicitly scoped as the next slice) and would conflict with the private branch on merge.To re-arm: merge the
private-standup-polishgateway-guest path (renderGatewayGuest/vmguest.go) intomain, then wireAttachGatewayinto it and extend the eval smoke there — or run this task on theprivate-standup-polishbranch. Same unmerged-arc root cause as #333/#337/#338. Moving toagent-blocked.Unblocked (2026-08-08): the substrate the reopen names is now on
origin/main—renderGatewayGuestlives ininternal/clan(enrollment.go, vmguest.go, warm_repo.go) andwriteNodeConfigsits atinternal/clan/enrollment.go:264with its caller at line 252. Re-flippedready-for-agentper the agent-blocked protocol (Ben approved).Landed in
49f791bonmain.The remaining scope (production caller + eval smoke) is now wired.
AttachGateway.writeNodeConfigs VM-mode gateway branch now bakes the guest baseline as an IMPORTABLE module (gateway-guest.nix, newGatewayGuestFileName) instead of directly asconfiguration.nix, and theconfigurestage drives(*Adapter).AttachGateway(ctx, GatewayLiveSet{Gateway: node})after the bake (enrollment.go). So a real VM-mode gateway (the privatepath fleet-seeding arc,privatepath.go:634) now writes the COMPOSEDconfiguration.nix— the entry module clan evaluates (S13) — importing the baseline; the compositionimports = [ ... ]finally reaches a live machine. No service live set is assembled yet, so today it composes the baseline alone; every future live gateway module (front door / acme-dns / code / mail) joins the same imports (AC3).baseMachineModulesgainedgateway-guest.nix(stat-checked, never fabricated) soAttachGatewayimports the baseline only when present.warm_repo.go) mirrors the composed shape so its carried closure still matches what founding builds; warm-repo tests updated.seedcommunity_eval_test.gonow composes the gateway via the realAttachGatewayand evals the COMPOSEDconfiguration.nix(baseline imported) against real clan-core + nixpkgs. Ran green locally:OURCLOUD_EVAL_SMOKE=1 ... -run TestSeedCommunity_EvalSmokePASS (64.8s).TestEnroll_VMModeGatewayComposesConfigurationproves the production path composes (baseline asgateway-guest.nix,configuration.nixa thin imports file, not the inline render).Gate: full
nix develop .#go-cisuite green on pre-push (build + vet + golangci-lint + whole-treego test, includinginternal/clanandinternal/vm).Still deferred to the next slice (unchanged from the first close): a production orchestrator that assembles the real SERVICE live set (apex + service placement + secret paths) from the running fleet and passes it to
AttachGateway, so the per-serviceAttach*gain production callers and #324s_acme-challengebroker wiring completes. Recorded in STATUS.md.