real-rail: the set-release-channel --apply land-step hand-rolled a nix develop clan the gateway's own flake can never provide #1663
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.
Dependencies
No dependencies set.
Reference
Matou/idss#1663
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
Drive
20260920T123207Z(artifacts/verdict.json: 8 green, 1 red,firstRedLeg: real-rail, commit039b0c35) redded at the last leg. The guest refused the re-tune and named the reason itself — the verbatim refusal fromartifacts/legs.json(legreal-rail):That is
nix develop's error, not clan's: nix refused before the clan CLI ever ran, so the pin stayed committed-but-not-live and the Updates surface never reachedapplied.The defect
control-plane/cmd/control-plane/channel_apply.go:105-119(as of039b0c35, #1661) hand-rolled its own invocation:The comment above it says it mirrors "the standing re-supply (rehearsal-standing-lib.sh)" — a shape that only works from a DEV checkout.
IDSS_CONFIG_REPOon a gateway is not one: this drive's captured community flake (state/clan-config/flake.nix:12) exportsnixosConfigurations nixosModules clanInternalsand nothing else, sonix developthere can only ever fail.Three things were wrong with the hand-roll, all in one line:
clanexists on a gateway either —internal/clan/toolpin.go:16-19states it outright: "On the control-plane deploy path no dev-shellclanis on PATH (vmguest.go omits it deliberately), sonix run <PinnedClanRef>runs on the critical path of every gateway deploy." The hand-roll bypassed that pinned-CLI resolution (resolveTool, ADR 0125) entirely.internal/clan— the DDR 0010 quarantine (internal/clan/cli.go:20: "Nothing OUTSIDE this package ever names a tool, a flag, or an exit code").The layer, and what already worked on this same box
The product's own path was green on this guest an hour earlier. The gateway control plane wires its deploy runner over the same directory (
logs/guest-control-plane.log:57:config repo wired: single-writer config store + clan deploy runner … dir=/srv/idss/config), and the update rollout's self-deploy (internal/update/rollout.go:526→clan.Adapter.Deploy→internal/clan/adapter.go:632updateNode) raised real switch units on the box:clan-switch-gateway-30a1376fat 13:12:25 andclan-switch-gateway-091be240at 13:13:30 (logs/guest-system-journal.log:2967,3183), with theappliedleg green inartifacts/legs.json. Only the new one-shot invented a second, broken way to do the same thing.The fix
SwitchClosurenow drives the SAME adapter the deploy runner drives (clan.New(clan.OpenConfigRepo(dir), clan.ExecCLI{}, log)— the shapeset_release_channel.go:62already uses for the pin):Deployat an exact revision → eval preflight → headlessclan machines updatewith the flags that work → layered failure classification, all insideinternal/clan.Deployrequires an exact commit (ADR 0102, commit-then-apply), which the land-step already has in hand: the pin's own commit now flowspin → SwitchClosure(node, revision), so the apply can never pick up a later writer's tip.Strict: trueplus a reconciled-none guard keep a non-evaluating gateway a loud failure rather than a silent no-op the restart would then run over.Banner text, the operator-facing command line (
set-release-channel --apply gateway <url> <key>) and the five-step order are unchanged.Box query
No
artifacts/live-box.jsonwas handed over — the guest was torn down (logs/qemu.log:exit 1 … ps -C qemu-system-x86_64with no process). Diagnosis is from the harvested logs, quoted verbatim above;logs/guest-failed-units.logrecords 0 failed units and the control planeactive/running,Result=success,NRestarts=2. This is not a roles-proof door leg, so no door re-prove applies.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way door. The change is confined to how one on-box step shells out; reverting is
git revert 043566a2with nothing to undo on any box, in any config repo, or in any persisted state —SwitchClosurewrites nothing of its own, and the pin it follows is unchanged. No operator-visible message, no route, no secrets shape, no security posture, and no default moved: the land-step's command line, its banners and its five-step order are byte-identical.Mechanical, not a design decision. #1661 already decided WHAT this step does (switch the gateway's own closure in place after the pin, before the restart — DOOR 1, ruled under ADR 0174). It simply did it through an invocation that cannot resolve on the machine it runs on:
nix developagainst a flake whose outputs arenixosConfigurations nixosModules clanInternals. Routing it throughclan.Adapter.Deploymakes the code do what it already meant to do, using the one sanctioned path (ADR 0125's pinned CLI, DDR 0010's flag quarantine) that the rollout drives green on this very box.Proven by tests written here.
TestExecChannelApply_SwitchClosureDrivesThePinnedClanAtThePinnedRevisioninjects a recordingclan.CLIand asserts the switch runsmachines updateasclan.ToolClanin the config repo atgit+file://<dir>?rev=<commit>, and that no invocation shells into a dev shell — it fails on the exact defect the drive hit.TestExecChannelApply_SwitchClosureRefusesWithoutAPinnedRevisionandTestRunSetReleaseChannelApply_SwitchesTheClosureAtTheCommitThePinJustMadepin the commit-then-apply threading. All three were RED before the fix (build failure: noclifield,too many arguments in call to e.SwitchClosure) and green after.Rules 1 and 2 hold. No assertion, expectation or test was edited, deleted or skipped — the only removed line in the test file is the fake's method signature (
git diffdeletions: exactly one line,func (f *fakeApply) SwitchClosure(_ context.Context, node string) error {); existingt.Fatalfvalues and thewant := []string{"FleetIdle", "SwitchClosure:"+tNode, …}order assertion are untouched (the revision is recorded in a new field asserted by a new test). 3 files, 69 changed non-test lines, one commit. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260920T123207Zred atreal-rail(sig 844ba04b38b5) — self-fixed on the fast lane, commit2f368486cbe7343fd6982daa1a2685f994efabb7; checks: Targeted:go test ./control-plane/cmd/control-plane/ -run 'TestRunSetReleaseChannel|TestExecChannelApply' -v— RED first against the unfixed code, the absence proven by the compiler (set_release_channel_test.go:140:60: unknown field cli in struct literal of type execChannelApply;176:54: too many arguments in call to e.SwitchClosure — have (context.Context, string, string), want (context.Context, string); build failed). GREEN after: 11 passed, including the recording-CLI case proving the invocation is the pinned clan atgit+file://<dir>?rev=abc123with no dev shell anywhere in it. Package tests:go test ./control-plane/cmd/control-plane/ ./internal/clan/— both ok (26.239s / 20.275s).go build ./control-plane/...— clean.go vet ./control-plane/cmd/control-plane/— clean.gofmt -l control-plane/cmd/control-plane/— clean. golangci-lint is not on PATH on this workstation, so the errcheck gate (#1662) was not re-run here; the new code returns every error it produces and adds no writes to an io.Writer.. evidence:/home/swarm/swarm/Matou/idss/test-results/private-path/20260920T123207Zon matou-workstation.close-report for #1663 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope