deploy-surveys: the surveys render emits services.limesurvey.uploadsDir — an option nixpkgs has never had — and three more nixpkgs faults wait behind it #1318
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#1318
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
20260908T080408Z(artifacts/verdict.json: 20 green, first reddeploy-surveys;artifacts/legs.jsonleg 21, 10.2s — it died at the eval preflight, nothing was deployed):Evidence
The community flake locks nixpkgs
173d0ad7a974f8543a9ab01d2271b2e290341b33(26.11pre1015397 —state/clan-config/flake.lock, viainputs.nixpkgs.follows = "clan-core/nixpkgs"instate/clan-config/flake.nix:3). That tree is on this workstation at/nix/store/lr5ld8f0qbyhjx3nr9mxfvg4cndvpggp-source; itsnixos/modules/services/web-apps/limesurvey.nixdeclares exactly these options underservices.limesurvey:enable,package,encryptionKey,encryptionNonce,encryptionKeyFile,encryptionNonceFile,database.*,webserver,httpd.virtualHost,nginx.virtualHost,poolConfig,config.There is no
uploadsDir— and there never was.grep -rl uploadsDirover every limesurvey module in this machine's store (24.11, 26.05, 26.11pre) returns nothing. The uploads dir is not a knob at all: the module bindsstateDir = "/var/lib/limesurvey"in itslet(limesurvey.nix:35) and derivesconfig.config.uploaddir = "${stateDir}/upload"itself (limesurvey.nix:382).The emitter is
internal/clan/surveys.go:254, insiderenderLimeSurveyDaemon:fed by
DefaultSurveysStorePath = "/var/lib/limesurvey"(internal/clan/surveys.go:58). The rendered value is already what nixpkgs does — the line asserts a dataset home that the module fixes by construction, using a name the module has never accepted.Three more eval-fatal faults sit behind this one
An unknown option aborts at module merge, so the preflight never reached the assertion block (
limesurvey.nix:285). Deleting only theuploadsDirline will re-red the drive on the very next tick — at whatever a paid re-drive costs — on these:createLocally+passwordFileare mutually exclusive.limesurvey.nix:300:"a password cannot be specified if services.limesurvey.database.createLocally is set to true". The render sets both —createLocally = true;(internal/clan/surveys.go:257) andpasswordFile = config.clan.core.vars.generators.surveys-secrets.files.dbpass.path;(internal/clan/surveys.go:260). WithcreateLocally, nixpkgs provisions the MariaDB user for unix-socket auth and thesurveys-secretsdbpassfile has no consumer at all.encryptionKeyFileis unset.limesurvey.nix:305demands a file holding a 32-character uppercase hex string.encryptionNonceFileis unset.limesurvey.nix:314demands a file holding a 24-character uppercase hex string.renderSurveysSecrets(internal/clan/surveys.go:223-240) mints onlyadminpassanddbpass— neither encryption secret has a producer.A fourth, non-fatal, that
surveys-wears-kitwould catch nextThe brand keys are rendered at the top level of
services.limesurvey.config—{ sitename = brandName; }and{ defaulttheme = "idss_brand"; }(internal/clan/surveys.go:274-277). nixpkgs nests LimeSurvey's own settings one level down, under aconfigattr (limesurvey.nix:359services.limesurvey.config = mapAttrs (name: mkDefault) { … config = { tempdir; uploaddir; … }; }, theconfigkey opening at:380), and the generatedconfig.phpis aarray_merge_recursiveofcfg.configverbatim. Top-levelsitename/defaultthemewould land outside the'config'array and be ignored — the community name and the brand theme would not take. Worth confirming against LimeSurvey'sconfig.phpshape as part of the same repair, so #1265's US6 doesn't red one drive later.Suspected layer
internal/clan/surveys.go— the surveys port's declarative render (ADR 0062 part 1). This is a render-vs-upstream-contract drift, not a runtime fault: nothing in the tree ever evaluated this module against real nixpkgs.internal/clan/surveys_test.gois a pure string-containment suite overRenderSurveysand it passes today (go test ./internal/clan/ -run TestRenderSurveys→ ok) precisely because it asserts the same wrong shape the render emits. The package has three real eval smokes —guestimage_eval_test.go,memberdevice_eval_test.go,seedcommunity_eval_test.go, all gated onIDSS_EVAL_SMOKE=1— and none of them composes a node carryingsurveys.nix. The same blind spot that let #1284'spasswordFile = ""reach a paid drive is still open for every catalogue port whose render has no eval smoke; an eval smoke over the co-hosted gateway shape is the durable fix, and is what would have caught all four faults above at once, locally.Why I refused to heal — refusal rules 1 and 3
Rule 1 (would weaken a check) — the blocking one. The correct repair cannot be made without changing what existing assertions prove:
internal/clan/surveys_test.go:92-94assertsuploadsDir = "/var/lib/limesurvey";is present in the render. The honest fix deletes that emission, so this assertion must be deleted or rewritten. There is no way to keep the string honestly — nixpkgs has no such option and no valid place to put it; emitting it somewhere merely eval-clean, to satisfy astrings.Contains, would be gaming the check.internal/clan/surveys_test.go:62assertspasswordFile = <the generator's path expr>;and:88-90assertscreateLocally = true;. nixpkgs forbids that pair, so one of those two assertions must change whichever way the repair goes.The drive is telling the truth here: the shape the tests pin is the shape the product cannot deploy. Deciding which of the two the surveys port should keep is not the healer's call.
Rule 3 (product-behaviour surface, as a design decision). Clearing assertions 2 and 3 means the
surveys-secretsgenerator must mint two NEW secrets — a 32-char and a 24-char uppercase hex — and wire them toencryptionKeyFile/encryptionNonceFile. That is a change to the port's secrets shape (the #1247 class named as off-limits in-lane), not a mechanical repair: these keys encrypt survey response data at rest, so their generation, rotation posture and what happens to already-encrypted responses if they change are trust decisions. The fast lane does not apply — this is a one-way door, not a revertible mechanical fix.What a ruling needs to settle
createLocally = trueand droppasswordFile(unix-socket auth; retiredbpassfrom the generator) — or setcreateLocally = falseand own the MariaDB database + user declaratively, keeping thedbpassclan var? The first is smaller and matches what nixpkgs is built for; the second keeps the port's #1247 single-home story intact for both secrets.surveys-secrets(openssl rand -hex 16upper-cased → 32 chars;openssl rand -hex 12upper-cased → 24 chars) and pass them viaencryptionKeyFile/encryptionNonceFile. Confirm the rotation posture, and that ADR 0080's Surveys-dataset backup coverage records that responses at rest are only restorable together with these two secrets.uploadsDirknob, ADR 0080's declared Surveys dataset is/var/lib/limesurveyby nixpkgs construction. Decide whetherDefaultSurveysStorePath/SurveysConfig.StorePath(internal/clan/surveys.go:58,146-148) stay as the assertion that backup coverage reads, or become a checked-against-nixpkgs constant. NoterenderSurveysBrandderives the theme dir from the samestore(internal/clan/surveys.go:291) and lands it under${store}/upload/themes/survey/— which does match nixpkgs'uploaddir(limesurvey.nix:382), so that path stays correct either way.config.config.sitename/config.config.defaulttheme; confirm against LimeSurvey'sconfig.phpbefore shipping.surveys.nix(thememberdevice_eval_test.goshape), so the next port-render drift is caught on this workstation rather than by a rented droplet.drive
20260908T080408Zred atdeploy-surveys:deploy failed (clean-retry): provision: deploy gateway: clan: config_eval on gateway: the node was excluded at the eval preflight — nothing was deployed: error: error: The optionservices.limesurveevidence:/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T080408Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 — veto anytime
Ruling: this is a two-way door — healed in-session, not routed to a human. The prior rehearsal healer refused correctly under its narrower fast-lane rules (rule 1: rewriting a check; rule 3: touching the secrets shape). Those refusals bounce to a session, not to Ben. Under ADR 0174 the repair is (a) revertible (one commit), (b) provable (a NEW real-nixpkgs eval smoke, run green in-session), and (c) not on the one-way-door list: the two encryption secrets are machine-generated by the SAME clan-vars generator that already mints
adminpass, nothing has ever deployed so there is no survey data at rest to migrate or lose, and no public surface / auth requirement is widened.ready-for-sessionwas the right route and this is exactly what it is for.What landed (commit
d2830225)All four eval-fatal faults in
internal/clan/surveys.go, settling the ticket's five questions:createLocally = true(nixpkgs provisions the MariaDB user for unix-socket auth:database.userdefaults tolimesurvey,socketto/run/mysqld/mysqld.sock, both satisfying nixpkgs' assertions). DroppedpasswordFileand retireddbpassfrom the generator. Smaller, and what nixpkgs is built for.surveys-secrets:openssl rand -hex 16 | tr a-f A-F(32-char upper hex) andopenssl rand -hex 12 | tr a-f A-F(24-char upper hex), wired toencryptionKeyFile/encryptionNonceFile. Rotation posture: they ride clan vars / sops-age like every other port secret; regenerating them would orphan any already-encrypted responses — so the render comment + GOTCHAS #191 record that the Surveys dataset is restorable ONLY together with these two secrets (ADR 0080). Nothing is deployed yet, so there is no existing at-rest data this touches.uploadsDirknob; nixpkgs FIXESstateDir = /var/lib/limesurveyand derivesuploaddir = ${stateDir}/uploaditself.DefaultSurveysStorePathnow pins that value (documented as nixpkgs' constant, not an override), which backup coverage reads and the brand theme dir (${store}/upload/themes/survey/) derives from — the path stays correct.config.config.{sitename,defaulttheme}. Confirmed against LimeSurvey'sconfig.phpshape: nixpkgsarray_merge_recursivescfg.configverbatim and the settings live under theconfigarray, so a top-level key was ignored (the #1265 US6 fourth fault, caught now rather than one drive later).TestSurveysCohost_EvalSmoke(internal/clan/surveys_eval_test.go), the first eval smoke over any catalogue port's render: seed → bake gateway baseline →AttachGateway→AttachSurveys→ComposeGatewayCohost→clan vars generate→nix eval …toplevel.drvPath, plus a teeth half.Proof (run in-session,
IDSS_EVAL_SMOKE=1, against the community flake's real 26.11pre nixpkgs pin)The drive's exact red is now GREEN, and the teeth reproduce the drive's own sentence when the phantom option is re-introduced. Full
go test ./internal/clan/green;gofmtclean;go vetclean.Docs
strings.Containsseam test can only pin a render to itself).surveys-healthy/surveys-wears-kit).Note for the next drive
This proves the eval preflight passes.
surveys-healthy(RemoteControl admin handshake) andsurveys-wears-kit(the brand theme actually landing) are runtime concerns a live drive still has to clear — the brand-nesting fix (fault 4) is aimed squarely at the latter but is unproven at runtime until a drive reaches it.Closing: work landed + proven. Advances the surveys frontier.
limesurvey-adminruns nixpkgs'console.phpwith noLIMESURVEY_CONFIG, andsurveys-brandcannot write under the root-owned Nix-store copy nixpkgs seedsupload/from #1319surveys-healthyred for the full 360s warm-up: LimeSurvey ships its RemoteControl JSON-RPC interface OFF, and OFF answers an empty HTTP 200 — the port's own health gate can never open a session #1321surveys-healthy(found while verifying): the render'sconfig.configdefinition outranks nixpkgs'mkDefaultand WIPES nixpkgs' entire LimeSurvey config subtree —uploaddir,tempdir,force_sslall fall back to the read-only Nix store #1322