deploy-surveys: the surveys-brand oneshot hand-copies limesurvey-init's PATH beside the one systemd-lib generates from its own path — two normal-priority definitions, eval preflight excludes the gateway, nothing deployed #1329
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#1329
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
20260908T164009Z(artifacts/verdict.json: 21 legs, 20 green) red atdeploy-surveysafter 50.6s. The clean-retry deploy never reached the box — the node was excluded at the eval preflight:The defect
environment.PATHis not a key a service author owns.nixos/lib/systemd-lib.nix:660(serviceConfigsubmodule) defines it for every unit from that unit's ownpath, at NORMAL priority:environment.PATH = mkIf (config.path != []) "${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}".nixos/lib/systemd-lib.nix:708-720(stage2ServiceConfig)mkAfter-appends coreutils/findutils/gnugrep/gnused/systemd to every stage-2 service'spath, soconfig.pathis never empty and that definition always exists.internal/clan/surveys.go:479gave the oneshotpath = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep ], andinternal/clan/surveys.go:481also copied the sibling's already-evaluated, already-PATH-bearing environment attrset whole:attrsOfthen held two equal-priority values forenvironment.PATH— the unit's own 3+5 packages vs the sibling's 5 — andtypes.strrefuses to merge unequal definitions. Both lines were introduced by HEAD commit902a65f0(#1326).limesurvey-admin(internal/clan/surveys.go:650, #1319) carried the same copy. It evaluated green only because it adds no package of its own, so its generated PATH and the copied one are byte-equal and the merge is quiet — quiet by coincidence, one package away from the identical red.Why the workstation missed it
TestSurveysCohost_EvalSmoke(internal/clan/surveys_eval_test.go) never landed a brand kit, sohaveBrand(surveys.go:224) was false and the entirelib.mkIf haveBrandbranch — the oneshot, itsenvironment, itspath, config.php's brand keys — was dead text no eval ever type-checked. The brand-bearing half of the render had only ever been evaluated on a paid droplet.The fix
Both units strip PATH on the way in (
removeAttrs … [ "PATH" ]) and letpathbe the single definition. The inheritedLIMESURVEY_CONFIG(#1319) and theYII_CONSOLE_COMMANDSdir (#1326) are unchanged;limesurvey-admin's resulting PATH is byte-identical to what it had.The eval smoke now lands the compiled
svc:surveysartifact plus its logo object and type sidecar (the exact bytes this drive's brand apply committed, read fromstate/clan-config/idss/brand/svc-surveys/) before the eval, so the brand branch is evaluated against real nixpkgs here, and asserts both oneshots' evaluated environments. The render seam gains two negative guards: noenvironment.PATHanywhere in the output, and no un-stripped inheritance of the sibling's environment.Suspected layer
The clan render (
internal/clan/surveys.go) vs. the NixOS module system's per-key merge priority — the same class as #1322 (config.configat normal priority wiping nixpkgs' subtree), one level down: not which option, but who owns the key.Follow-up not landed here
A
docs/GOTCHAS.mdentry ("never hand-write or copy a systemd unit'senvironment.PATH; it is generated frompathat normal priority for every unit") — the 3-file heal cap was spent on the fix plus the two test files that prove it.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way door. Revertible:
git revert 7153771brestores the previous render byte-for-byte; the change is three rendered Nix lines plus comments in one file, no state, no migration, no secret, no route, no message a community reads. Proven by:TestSurveysCohost_EvalSmoke— a real-nixpkgs eval of the co-hosted gateway, extended here to land a brand kit so the branch is live; it FAILED before the fix with the drive's exact conflict sentence and PASSES after, and additionally decodes both units' evaluatedenvironmentattrsets to prove LIMESURVEY_CONFIG is inherited (identical across the two) and PATH is the generated one. Plus two negative render-seam guards inTestRenderSurveys_BrandThemeLandsInWritableUploadAndSetDefaultand the existingTestRenderSurveys_AdminConsoleCarriesLimeSurveyConfigEnv. Mechanical, not a design decision: nothing about what the port means to do changed — the oneshot still lands and registers the brand theme, still reads the same config.php, still runs with the same tools on PATH. The render simply stopped defining a key the module system already defines for it. There is no product-visible difference:limesurvey-admin's PATH is byte-identical before and after, andsurveys-brandpreviously produced no configuration at all (eval refused). Rules 1 and 2 self-checked against the rails' own regexes in.sandcastle/rehearsal-heal-lib.sh: no removed or edited assertion/expectation line (I reverted one rewordedt.Fatalfmessage to keep it byte-identical), no removed test or leg declaration, no added skip; 3 files, 25 changed non-test lines, exactly one commit, no.sandcastle/rehearsal-*or.forgejo/workflows/touched. Not pushed. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260908T164009Zred atdeploy-surveys(sig 119db33993c0) — self-fixed on the fast lane, commitf99c325ee195462891408c0bc561d9673636512b; checks: targeted (red-first):IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v→ FAIL before the fix (97.65s), reproducing the drive's exact sentence: "The optionsystemd.services.surveys-brand.environment.PATH' has conflicting definition values" — same 8-package vs 5-package values, at… while evaluating the option systemd.units."surveys-brand.service".text. PASS after (34.88s): toplevel evaluated to/nix/store/8ijby2gkggdy94l6jmcrlshdv1102cy3-nixos-system-gateway-26.11.20260612.173d0ad.drv; "surveys environment guard passed: LIMESURVEY_CONFIG inherited by both oneshots, PATH generated frompathalone"; the #1322 config.config merge guard still passes; the teeth half still fails on the phantomuploadsDiras it should. package:go test ./internal/clan/→ ok (18.4s), all 11TestRenderSurveys_PASS. trees:go test ./internal/... ./control-plane/...→ no failures. root cause verified against the pinned nixpkgs source (/nix/store/lr5ld8f0qbyhjx3nr9mxfvg4cndvpggp-source):nixos/lib/systemd-lib.nix:660definesenvironment.PATH = mkIf (config.path != []) …at normal priority,:708-720stage2ServiceConfigmkAfter-appends the 5 default packages to every service'spath;nixos/modules/services/web-apps/limesurvey.nix:327-333shows limesurvey-init declares only DBENGINE + LIMESURVEY_CONFIG and nopath, which is why its evaluated environment carries the default-5 PATH the render was copying.go build ./...→ clean;go vet ./internal/clan/→ clean;gofmt -l internal/clan/→ clean. commit shape: 3 files, 25 changed non-test lines (internal/clan/surveys.go20/5;surveys_eval_test.go128/0;surveys_test.go27/2), one commit, not pushed. rails self-check with the lib's own regexes → rule 1 NONE on all three patterns (removed assertion/expectation, removed test/leg declaration, added skip); no.sandcastle/rehearsal-or.forgejo/workflows/path in the diff.. evidence:/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T164009Z` on matou-workstation.close-report for #1329 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
userthemerootdiris derived from the DEFAULTuploaddirbefore config.php is merged, and a theme it cannot see is sile… #1330