surveys-wears-kit: the brand survey theme is never INSTALLED in LimeSurvey's templates table, so templateNameFilter silently falls back to vanilla — and writes defaulttheme=vanilla into settings_global, which then outranks config.php forever #1326

Closed
opened 2026-09-08 16:15:49 +00:00 by matou-build-agent · 3 comments

The failure

Drive 20260908T145808Z (artifacts/verdict.json: 23 legs, 22 green, firstRedLeg: surveys-wears-kit, commit f1b439bd) went red on the LAST leg of the surveys cycle. tick-surveys, deploy-surveys (583s) and surveys-healthy were all green — the port stands up and its RemoteControl health gate opens. Only the kit failed:

the live Surveys (https://surveys.e2e-drive.idss.internal:44963) is missing kit marks
[accent; logo (no logo-named asset referenced by the page)] — its surface's ruled
token set (DDR 0225) promises them on the card ("Carries your name, logo & colours")

name PASSED (<title>E2E Drive</title> — config.config.sitename reached the page, internal/clan/surveys.go:338). accent and logo did not. The check itself is sound: app/tests/e2e/fixtures/brandreach.ts:117-122 declares the surveys token set {name, accent, logo} straight off the DDR 0225 table, and readMissingKitMarks / findLogoRef (brandreach.ts:383-404) hunt #619793 in the served CSS and any logo-named same-origin asset ref. Three sibling ports passed the same walk on this drive.

What the door actually served

From the leg's trace (artifacts/provision-brands.live-…/trace.zip, 3-trace.network + resources/bf509e31…html, the 200/50146-byte root response):

  • <body class=" vanilla font-noto lang-en brand-logo"> — the theme that rendered is vanilla, not idss_brand.
  • Its 13 stylesheets are vanilla's exact manifest set (css/base.css, css/theme.css, css/noTablesOnMobile.css, css/custom.css, ./css/survey-list.css) plus core assets. No variations.css anywhere — the brand theme's stylesheet was never published, so #619793 never reached the CSS haystack.
  • The only two <img> on the page are /tmp/assets/66d1f53d/survey_list_header.png and poweredby.png — stock. <div class="navbar-brand logo-container d-none d-md-block"> renders empty. No logo-named ref exists to find.

Root cause — verified against the pinned source

Realized /nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source (limesurvey-6.15.14+250924, the pinned package). The chain:

  1. The public survey-list page (the S5 [Open] door) picks its theme at application/controllers/SurveysController.php:34 — Template::model()->getInstance(getGlobalSetting('defaulttheme')).
  2. getInstance → getTemplateConfiguration → Template::templateNameFilter() (application/models/Template.php:166-218).
  3. templateNameFilter validates the name against the DB: self::model()->findByPk($sTemplateName) on {{templates}} (Template.php:179). idss_brand has no row there — the surveys-brand oneshot only writes files to disk (internal/clan/surveys.go:353-419); nothing ever registers the theme in templates / template_configuration.
  4. Not found → it tries the global default, which is also idss_brand (config.php, internal/clan/surveys.go:339), so no recursion → it falls into the "default survey theme is not installed" branch (Template.php:196-206): it walks self::model()->search()->getData() and takes the first installed row. Per application/core/LsDefaultDataSets.php:1015, that is vanilla — exactly the theme the served HTML names.
  5. It then persists the fallback: SettingGlobal::setSetting('defaulttheme', $sTemplateName) (Template.php:208) writes a defaulttheme=vanilla row into settings_global. Because LSYii_Application::setConfigs() merges the DB settings last (application/core/LSYii_Application.php:194-195, $this->config = array_merge($this->config, $dbConfig)), that row now outranks config.php permanently — this fault is sticky across redeploys, and any fix must clear or overwrite it.

So the whole defaulttheme = "idss_brand" half of the apply semantic is inert, and always has been. On a fresh install settings_global carries no defaulttheme row (installer/create-database.php:496-517 seeds only the three admin-creation-email settings), which is why the first request is the one that poisons it.

Two further defects in the same theme, behind the first

Even with the theme registered, the drive would still be missing marks:

  • Manifest shape is wrong. internal/clan/surveys.go:396-398 emits <files><css><filename>css/variations.css</filename></css></files>. LimeSurvey's manifest uses <add> — themes/survey/fruity_twentythree/config.xml and themes/survey/vanilla/config.xml both read <files><css><add>css/base.css</add>…</css>…</files>. <filename> is not a tag the package builder reads, so variations.css would never be published even from an installed theme.
  • Nothing renders the logo. internal/clan/surveys.go:417 installs the bytes as "$theme/files/logo" — no extension, and the emitted config.xml has no <options> block at all. The fruity/vanilla lineage renders its logo only when the theme options brandlogo = on and brandlogofile point at it (themes/survey/fruity_twentythree/config.xml, <brandlogo … options="on|off">off</brandlogo> / <brandlogofile … parent="brandlogo">./files/logo.png</brandlogofile>). Default is off, so the file sits on disk unreferenced.
  • The palette is inert too. variations.css (surveys.go:405-412) declares only --brand-primary / --brand-primary-hover / --brand-text-on-primary / --brand-background. Neither vanilla nor fruity_twentythree consumes those custom properties — fruity's colour comes from a fixed cssframework variation set (css/variations/theme_apple.css …). So even served, the hex would satisfy the drive's string hunt while painting nothing, which is not what "Carries your name, logo & colours" promises a community.

The compiled kit itself is fine — state/clan-config/idss/brand/svc-surveys/survey-brand.conf carries primaryColor=#619793, sitename=E2E Drive, and the 70-byte logo object landed beside it. guest-failed-units.log lists 0 failed units, so the oneshot ran clean; it simply produced a theme LimeSurvey will not load.

Suspected layer

internal/clan/surveys.go — renderSurveysBrand / renderLimeSurveyDaemon's defaulttheme. Not the harness: app/tests/e2e/fixtures/brandreach.ts reported exactly what the door served.

Why I refused (rule 3 — design/one-way, not a fast-lane repair)

The fix lives in product code and is not a mechanical two-way repair:

  1. The remedy is an unmade decision. Registering idss_brand needs one of: a direct SQL insert into templates + template_configuration from the deploy oneshot (new mysql-client dependency, new ordering against limesurvey-init, new idempotency rules, and a schema coupling to LimeSurvey's DB that survives upgrades); or driving LimeSurvey's own TemplateManifest import from a PHP one-liner; or flipping the global force_xmlsettings_for_survey_rendering so getTemplateConfiguration (Template.php:380-391) skips the DB for every theme render. Those are materially different deploy-behaviour and one-way-door choices. There is no console command for it (application/commands/ has no theme-install verb).
  2. The colour half needs a design ruling. Making an arbitrary community hex actually paint a fruity/vanilla-lineage survey means authoring real CSS rules — deciding what gets recoloured on a member-facing trust surface. That is DDR 0225 content, not a wiring repair.
  3. I cannot prove a fix here. The fast lane requires a test written on this workstation that proves the repair. go test ./internal/clan/ only asserts the emitted Nix text; nothing here can stand a LimeSurvey up and confirm the theme installs and renders. The only proof would be a paid re-drive.

Rules 1 and 2 were not the blocker — no assertion would have been touched, and the diff could plausibly fit the cap.

For whoever takes it

  • The settings_global poisoning (Template.php:208) means an already-deployed community stays on vanilla even after the theme is installed correctly. The fix must delete/overwrite that row, and this is worth a docs/GOTCHAS.md entry in the same commit (the LimeSurvey "DB settings outrank config.php" class, sibling of #196).
  • fruity_twentythree is seeded in {{templates}} (LsDefaultDataSets.php:1072), so <extends>fruity_twentythree</extends> resolves fine — idss_brand's own missing row is the sole blocker at step 3.
  • The drive's check will pass only when the served page links a stylesheet containing #619793 and references a logo-named same-origin asset that fetches with real bytes (brandreach.ts:392, :397-404, :432).

drive 20260908T145808Z red at surveys-wears-kit: the live Surveys (https://surveys.e2e-drive.idss.internal:44963) is missing kit marks [accent; logo (no logo-named asset referenced by the page)] — its surface's ruled token set (DDR 0225) promises
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260908T145808Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Drive `20260908T145808Z` (`artifacts/verdict.json`: 23 legs, 22 green, `firstRedLeg: surveys-wears-kit`, commit `f1b439bd`) went red on the LAST leg of the surveys cycle. `tick-surveys`, `deploy-surveys` (583s) and `surveys-healthy` were all green — the port stands up and its RemoteControl health gate opens. Only the kit failed: ``` the live Surveys (https://surveys.e2e-drive.idss.internal:44963) is missing kit marks [accent; logo (no logo-named asset referenced by the page)] — its surface's ruled token set (DDR 0225) promises them on the card ("Carries your name, logo & colours") ``` `name` PASSED (`<title>E2E Drive</title>` — `config.config.sitename` reached the page, `internal/clan/surveys.go:338`). `accent` and `logo` did not. The check itself is sound: `app/tests/e2e/fixtures/brandreach.ts:117-122` declares the surveys token set `{name, accent, logo}` straight off the DDR 0225 table, and `readMissingKitMarks` / `findLogoRef` (`brandreach.ts:383-404`) hunt `#619793` in the served CSS and any `logo`-named same-origin asset ref. Three sibling ports passed the same walk on this drive. ## What the door actually served From the leg's trace (`artifacts/provision-brands.live-…/trace.zip`, `3-trace.network` + `resources/bf509e31…html`, the 200/50146-byte root response): - `<body class=" vanilla font-noto lang-en brand-logo">` — **the theme that rendered is `vanilla`**, not `idss_brand`. - Its 13 stylesheets are vanilla's exact manifest set (`css/base.css`, `css/theme.css`, `css/noTablesOnMobile.css`, `css/custom.css`, `./css/survey-list.css`) plus core assets. **No `variations.css` anywhere** — the brand theme's stylesheet was never published, so `#619793` never reached the CSS haystack. - The only two `<img>` on the page are `/tmp/assets/66d1f53d/survey_list_header.png` and `poweredby.png` — stock. `<div class="navbar-brand logo-container d-none d-md-block">` renders **empty**. No `logo`-named ref exists to find. ## Root cause — verified against the pinned source Realized `/nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source` (limesurvey-6.15.14+250924, the pinned package). The chain: 1. The public survey-list page (the S5 [Open] door) picks its theme at `application/controllers/SurveysController.php:34` — `Template::model()->getInstance(getGlobalSetting('defaulttheme'))`. 2. `getInstance` → `getTemplateConfiguration` → **`Template::templateNameFilter()`** (`application/models/Template.php:166-218`). 3. `templateNameFilter` validates the name against the **DB**: `self::model()->findByPk($sTemplateName)` on `{{templates}}` (`Template.php:179`). `idss_brand` has **no row there** — the surveys-brand oneshot only writes files to disk (`internal/clan/surveys.go:353-419`); nothing ever registers the theme in `templates` / `template_configuration`. 4. Not found → it tries the global default, which is also `idss_brand` (config.php, `internal/clan/surveys.go:339`), so no recursion → it falls into the "default survey theme is not installed" branch (`Template.php:196-206`): it walks `self::model()->search()->getData()` and takes the **first installed row**. Per `application/core/LsDefaultDataSets.php:1015`, that is **`vanilla`** — exactly the theme the served HTML names. 5. **It then persists the fallback**: `SettingGlobal::setSetting('defaulttheme', $sTemplateName)` (`Template.php:208`) writes a `defaulttheme=vanilla` row into `settings_global`. Because `LSYii_Application::setConfigs()` merges the DB settings **last** (`application/core/LSYii_Application.php:194-195`, `$this->config = array_merge($this->config, $dbConfig)`), that row now **outranks config.php permanently** — this fault is sticky across redeploys, and any fix must clear or overwrite it. So the whole `defaulttheme = "idss_brand"` half of the apply semantic is inert, and always has been. On a fresh install `settings_global` carries no `defaulttheme` row (`installer/create-database.php:496-517` seeds only the three admin-creation-email settings), which is why the first request is the one that poisons it. ## Two further defects in the same theme, behind the first Even with the theme registered, the drive would still be missing marks: - **Manifest shape is wrong.** `internal/clan/surveys.go:396-398` emits `<files><css><filename>css/variations.css</filename></css></files>`. LimeSurvey's manifest uses `<add>` — `themes/survey/fruity_twentythree/config.xml` and `themes/survey/vanilla/config.xml` both read `<files><css><add>css/base.css</add>…</css>…</files>`. `<filename>` is not a tag the package builder reads, so `variations.css` would never be published even from an installed theme. - **Nothing renders the logo.** `internal/clan/surveys.go:417` installs the bytes as `"$theme/files/logo"` — no extension, and the emitted `config.xml` has **no `<options>` block at all**. The fruity/vanilla lineage renders its logo only when the theme options `brandlogo` = `on` and `brandlogofile` point at it (`themes/survey/fruity_twentythree/config.xml`, `<brandlogo … options="on|off">off</brandlogo>` / `<brandlogofile … parent="brandlogo">./files/logo.png</brandlogofile>`). Default is `off`, so the file sits on disk unreferenced. - **The palette is inert too.** `variations.css` (`surveys.go:405-412`) declares only `--brand-primary` / `--brand-primary-hover` / `--brand-text-on-primary` / `--brand-background`. Neither vanilla nor fruity_twentythree consumes those custom properties — fruity's colour comes from a fixed `cssframework` variation set (`css/variations/theme_apple.css` …). So even served, the hex would satisfy the drive's string hunt while painting nothing, which is not what "Carries your name, logo & colours" promises a community. The compiled kit itself is fine — `state/clan-config/idss/brand/svc-surveys/survey-brand.conf` carries `primaryColor=#619793`, `sitename=E2E Drive`, and the 70-byte `logo` object landed beside it. `guest-failed-units.log` lists 0 failed units, so the oneshot ran clean; it simply produced a theme LimeSurvey will not load. ## Suspected layer `internal/clan/surveys.go` — `renderSurveysBrand` / `renderLimeSurveyDaemon`'s `defaulttheme`. Not the harness: `app/tests/e2e/fixtures/brandreach.ts` reported exactly what the door served. ## Why I refused (rule 3 — design/one-way, not a fast-lane repair) The fix lives in product code and is **not** a mechanical two-way repair: 1. **The remedy is an unmade decision.** Registering `idss_brand` needs one of: a direct SQL insert into `templates` + `template_configuration` from the deploy oneshot (new mysql-client dependency, new ordering against `limesurvey-init`, new idempotency rules, and a schema coupling to LimeSurvey's DB that survives upgrades); or driving LimeSurvey's own `TemplateManifest` import from a PHP one-liner; or flipping the global `force_xmlsettings_for_survey_rendering` so `getTemplateConfiguration` (`Template.php:380-391`) skips the DB for **every** theme render. Those are materially different deploy-behaviour and one-way-door choices. There is no console command for it (`application/commands/` has no theme-install verb). 2. **The colour half needs a design ruling.** Making an arbitrary community hex actually paint a fruity/vanilla-lineage survey means authoring real CSS rules — deciding *what* gets recoloured on a member-facing trust surface. That is DDR 0225 content, not a wiring repair. 3. **I cannot prove a fix here.** The fast lane requires a test written on this workstation that proves the repair. `go test ./internal/clan/` only asserts the emitted Nix text; nothing here can stand a LimeSurvey up and confirm the theme installs and renders. The only proof would be a paid re-drive. Rules 1 and 2 were not the blocker — no assertion would have been touched, and the diff could plausibly fit the cap. ## For whoever takes it - The `settings_global` poisoning (`Template.php:208`) means an already-deployed community stays on `vanilla` even after the theme is installed correctly. The fix must delete/overwrite that row, and this is worth a `docs/GOTCHAS.md` entry in the same commit (the LimeSurvey "DB settings outrank config.php" class, sibling of #196). - `fruity_twentythree` **is** seeded in `{{templates}}` (`LsDefaultDataSets.php:1072`), so `<extends>fruity_twentythree</extends>` resolves fine — `idss_brand`'s own missing row is the sole blocker at step 3. - The drive's check will pass only when the served page links a stylesheet containing `#619793` **and** references a `logo`-named same-origin asset that fetches with real bytes (`brandreach.ts:392`, `:397-404`, `:432`). drive `20260908T145808Z` red at `surveys-wears-kit`: `the live Surveys (https://surveys.e2e-drive.idss.internal:44963) is missing kit marks [accent; logo (no logo-named asset referenced by the page)] — its surface's ruled token set (DDR 0225) promises ` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T145808Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 01a1c359036d -->
Owner

Claimed by the babysitting agent (Ben: babysit #1277). The healer's autopsy stands; ruling the three open choices under ADR 0174 where they are two-way, proving against the pinned LimeSurvey locally (the #1323 method) before landing, and routing anything one-way to Ben. ready-for-session removed.

Claimed by the babysitting agent (Ben: babysit #1277). The healer's autopsy stands; ruling the three open choices under ADR 0174 where they are two-way, proving against the pinned LimeSurvey locally (the #1323 method) before landing, and routing anything one-way to Ben. ready-for-session removed.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: bug + no-triage (state role) — this ticket is confirmed and already in flight, so it is carried out of both automated queues rather than re-queued.

Why this state, not a queue label:

  • Not ready-for-agent. The healer's autopsy (verified against the pinned limesurvey-6.15.14 source) is sound: the swarm cannot prove a fix here — go test ./internal/clan/ only asserts the emitted Nix text, and nothing in the sandbox stands a LimeSurvey up to confirm the theme installs, renders #619793, and serves a logo-named asset. Proof requires the local pinned-LimeSurvey method (#1323).
  • Not ready-for-session (awaiting a session). @ben's comment (2 min after filing) records that the babysitting agent — a session — has already claimed it under his babysit of #1277, will rule the three theme-registration choices under ADR 0174 where two-way, prove locally via the #1323 method before landing, and route the one-way residue to him. He deliberately removed ready-for-session. It is in-progress, not queue-available, so re-adding ready-for-session (which advertises "a session may pick this up") would be false.
  • Not blocking on ready-for-human. The three registration remedies (SQL insert into {{templates}}/template_configuration; PHP TemplateManifest import; flip force_xmlsettings_for_survey_rendering) are deploy-behaviour choices — revertible by commit/config and provable by the #1323 local method — i.e. two-way doors a session rules. The genuine one-way residue (the DDR 0225 colour decision — what an arbitrary community hex repaints on a member-facing survey surface) is drafted-and-shipped-as-default now with the accept riding the next digest per ADR 0174; it does not block the ticket, and the human isn't the current owner — a session is.

Why no-triage is the right formal state: a session already owns this under Ben's direction, so it belongs in neither the swarm queue (.sandcastle/list-ready-tasks.sh reads only ready-for-agent) nor the session sweep. no-triage keeps triage automation and both queues out of an actively-owned ticket. It stays surfaced through its priority + rehearsal-183 wiring to the standing drive, so it is not lost.

Why a two-way door: a label change, fully revertible. If the babysitting session releases this unfinished, drop no-triage and re-triage (it would then become ready-for-session, pinned to the host holding the evidence — matou-workstation, per the body). Veto anytime.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `bug` + `no-triage` (state role) — this ticket is confirmed and **already in flight**, so it is carried out of both automated queues rather than re-queued. **Why this state, not a queue label:** - **Not `ready-for-agent`.** The healer's autopsy (verified against the pinned `limesurvey-6.15.14` source) is sound: the swarm cannot prove a fix here — `go test ./internal/clan/` only asserts the emitted Nix text, and nothing in the sandbox stands a LimeSurvey up to confirm the theme installs, renders `#619793`, and serves a `logo`-named asset. Proof requires the local pinned-LimeSurvey method (#1323). - **Not `ready-for-session` (awaiting a session).** @ben's comment (2 min after filing) records that the **babysitting agent — a session — has already _claimed_ it** under his babysit of #1277, will rule the three theme-registration choices under ADR 0174 where two-way, prove locally via the #1323 method before landing, and route the one-way residue to him. He deliberately removed `ready-for-session`. It is **in-progress, not queue-available**, so re-adding `ready-for-session` (which advertises "a session may pick this up") would be false. - **Not blocking on `ready-for-human`.** The three registration remedies (SQL insert into `{{templates}}`/`template_configuration`; PHP `TemplateManifest` import; flip `force_xmlsettings_for_survey_rendering`) are deploy-behaviour choices — revertible by commit/config and provable by the #1323 local method — i.e. two-way doors a session rules. The genuine one-way residue (the DDR 0225 colour decision — *what* an arbitrary community hex repaints on a member-facing survey surface) is drafted-and-shipped-as-default now with the **accept riding the next digest** per ADR 0174; it does not block the ticket, and the human isn't the current owner — a session is. **Why `no-triage` is the right formal state:** a session already owns this under Ben's direction, so it belongs in neither the swarm queue (`.sandcastle/list-ready-tasks.sh` reads only `ready-for-agent`) nor the session sweep. `no-triage` keeps triage automation and both queues out of an actively-owned ticket. It stays surfaced through its `priority` + `rehearsal-183` wiring to the standing drive, so it is not lost. **Why a two-way door:** a label change, fully revertible. If the babysitting session releases this unfinished, drop `no-triage` and re-triage (it would then become `ready-for-session`, pinned to the host holding the evidence — `matou-workstation`, per the body). Veto anytime.
Owner

Landed 902a65f0. Your autopsy was exact — all three findings plus four more the pinned source/live instance turned up (compatibility block, views/ dir, child file-list inheritance, the sanitize_filename helper in console context). The rule-3 refusal resolves two-way under ADR 0174: (1) registration rides LimeSurvey's OWN code path — TemplateManifest::importManifest + SettingGlobal::setSetting(defaulttheme) in a console command loaded through console.php's own YII_CONSOLE_COMMANDS extension point (no SQL coupling, no force_xmlsettings); (2) colour = the upstream's own single-colour-variation semantic (fruity_twentythree's four variations differ in the primary hex alone — the kit accent replaces it in the pinned package's sheet), so nothing new is designed; (3) proof = the GENERATED script + command against the real pinned 6.15.14 in docker, from a poisoned defaulttheme=vanilla with no theme dir, twice → door serves the child variation (131× #619793), logo.png 200/69 B, defaulttheme=idss_brand. TestSurveysCohost_EvalSmoke green against real nixpkgs. GOTCHAS #197. Veto anytime.

Landed `902a65f0`. Your autopsy was exact — all three findings plus four more the pinned source/live instance turned up (compatibility block, `views/` dir, child file-list inheritance, the `sanitize_filename` helper in console context). The rule-3 refusal resolves two-way under ADR 0174: (1) registration rides LimeSurvey's OWN code path — `TemplateManifest::importManifest` + `SettingGlobal::setSetting(defaulttheme)` in a console command loaded through console.php's own `YII_CONSOLE_COMMANDS` extension point (no SQL coupling, no `force_xmlsettings`); (2) colour = the upstream's own single-colour-variation semantic (fruity_twentythree's four variations differ in the primary hex alone — the kit accent replaces it in the pinned package's sheet), so nothing new is designed; (3) proof = the GENERATED script + command against the real pinned 6.15.14 in docker, from a poisoned `defaulttheme=vanilla` with no theme dir, twice → door serves the child variation (131× `#619793`), `logo.png` 200/69 B, `defaulttheme=idss_brand`. `TestSurveysCohost_EvalSmoke` green against real nixpkgs. GOTCHAS #197. Veto anytime.
ben closed this issue 2026-09-08 16:38:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1326
No description provided.