main is red: the theming hex scan reads a #nnnn issue ref inside a <style> comment as a hex literal (ServiceCards.vue #1508) #1533

Closed
opened 2026-09-16 04:39:04 +00:00 by matou-build-agent · 2 comments

Symptom

ci run 25010 fails on main at the TypeScript: build (tsc), test (vitest), lint (eslint) stage, exit=1:

FAIL dashboard/tests/unit/themingDashboardCore.test.ts
  > dashboard core surfaces are hex-free and token-themed (issue #137) > shell
  > ServiceCards.vue: no hex literal in its styling
AssertionError: expected [ '#1508' ] to deeply equal []
  at tests/unit/themingDashboardCore.test.ts:62:43

1 failed / 1649 passed. Nothing else is broken — this one assertion holds main red.

Root cause

80b16416 (sandcastle: #1508 — the Overview's running service card carries the Services tab's Open door) added an SCSS comment naming its own issue inside the SFC's <style scoped lang="scss"> block:

dashboard/src/components/shell/ServiceCards.vue:408

/* the card's one act — Open, the service's own door (#1508). Said exactly as
   the Services tab's card says it (`catalogue/CatalogueScreen.vue`): ... */

themingDashboardCore.test.ts scans <style> block contents with HEX = /#[0-9a-fA-F]{3,8}\b/g. 1508 is four hex digits, so the issue ref matches. The test's own header comment states the opposite belief:

Matched inside <style> blocks only, so #nnn issue refs in comments and data-* attribute values in templates are out of scope by construction.

That holds for comments in the <template>/<script> blocks, not for CSS comments inside the style block — which is where a styling rationale comment naturally goes. The scan does not strip CSS comments. Reproduced locally:

HEX matches: ["#1508"]
after stripping /* … */ from the style block: []

No colour literal was actually introduced — the styling is token-clean.

Latent second hit

The same landmine is already sitting in dashboard/src/components/catalogue/CatalogueScreen.vue (#1258 inside its style block). catalogue/ is in neither scan's SURFACES today (themingDashboardCore covers shell/members/monitoring/provisioning; themingDashboardOps covers backups/rescue/device-add), so it is silent — it detonates the day catalogue is added to a scan.

Acceptance

  1. pnpm -r test is green on main.
  2. A #nnnn issue reference written in a CSS comment inside a <style> block does not fail the theming scans — an agent citing the ticket it is working on next to the rule it wrote is the normal, desirable comment style here, and it must not be a booby trap.
  3. A genuine hex colour literal in a style block (in a rule, not a comment) still fails the scan — including one that appears after a comment, so the comment-stripping cannot swallow live declarations.
  4. The same treatment is applied to both themingDashboardCore.test.ts and themingDashboardOps.test.ts (and brandKitTheming.test.ts if it carries the same regex), so the surfaces do not drift apart on this rule.
  5. The stale "out of scope by construction" comment at the top of the scan is corrected to say what the code actually does.

Suggested shape (the fixing agent's call): strip /* … */ from the style-block text in styleBlocks() before matching, rather than editing the ServiceCards comment to dodge the regex — deleting the ref only rearms the trap for the next ticket. Tightening HEX to require a non-word boundary before # would not help; #1508 is genuinely hex-shaped.

Provenance

Filed by the swarm healer for ci run 25010 (signature 57005f62054a, heal run heal-Matou-idss-1789533449-4058916). Classified product-class: the fault is in dashboard/ sources, so the healer did not touch it. The harness behaved correctly — the seam gate caught a real regression on main and refused it.

## Symptom `ci` run [25010](https://git.matou.nz/Matou/idss/actions/runs/25010) fails on main at the **TypeScript: build (tsc), test (vitest), lint (eslint)** stage, `exit=1`: ``` FAIL dashboard/tests/unit/themingDashboardCore.test.ts > dashboard core surfaces are hex-free and token-themed (issue #137) > shell > ServiceCards.vue: no hex literal in its styling AssertionError: expected [ '#1508' ] to deeply equal [] at tests/unit/themingDashboardCore.test.ts:62:43 ``` 1 failed / 1649 passed. Nothing else is broken — this one assertion holds main red. ## Root cause `80b16416` (`sandcastle: #1508 — the Overview's running service card carries the Services tab's Open door`) added an SCSS comment naming its own issue inside the SFC's `<style scoped lang="scss">` block: `dashboard/src/components/shell/ServiceCards.vue:408` ```scss /* the card's one act — Open, the service's own door (#1508). Said exactly as the Services tab's card says it (`catalogue/CatalogueScreen.vue`): ... */ ``` `themingDashboardCore.test.ts` scans `<style>` block contents with `HEX = /#[0-9a-fA-F]{3,8}\b/g`. `1508` is four hex digits, so the issue ref matches. The test's own header comment states the opposite belief: > Matched inside `<style>` blocks only, so `#nnn` issue refs in comments and data-* attribute values in templates are out of scope by construction. That holds for comments in the `<template>`/`<script>` blocks, **not** for CSS comments *inside* the style block — which is where a styling rationale comment naturally goes. The scan does not strip CSS comments. Reproduced locally: ``` HEX matches: ["#1508"] after stripping /* … */ from the style block: [] ``` No colour literal was actually introduced — the styling is token-clean. ## Latent second hit The same landmine is already sitting in `dashboard/src/components/catalogue/CatalogueScreen.vue` (`#1258` inside its style block). `catalogue/` is in neither scan's `SURFACES` today (`themingDashboardCore` covers shell/members/monitoring/provisioning; `themingDashboardOps` covers backups/rescue/device-add), so it is silent — it detonates the day catalogue is added to a scan. ## Acceptance 1. `pnpm -r test` is green on main. 2. A `#nnnn` issue reference written in a CSS comment inside a `<style>` block does **not** fail the theming scans — an agent citing the ticket it is working on next to the rule it wrote is the normal, desirable comment style here, and it must not be a booby trap. 3. A genuine hex colour literal in a style block (in a rule, not a comment) still fails the scan — including one that appears *after* a comment, so the comment-stripping cannot swallow live declarations. 4. The same treatment is applied to **both** `themingDashboardCore.test.ts` and `themingDashboardOps.test.ts` (and `brandKitTheming.test.ts` if it carries the same regex), so the surfaces do not drift apart on this rule. 5. The stale "out of scope by construction" comment at the top of the scan is corrected to say what the code actually does. **Suggested shape** (the fixing agent's call): strip `/* … */` from the style-block text in `styleBlocks()` before matching, rather than editing the ServiceCards comment to dodge the regex — deleting the ref only rearms the trap for the next ticket. Tightening `HEX` to require a non-word boundary before `#` would not help; `#1508` is genuinely hex-shaped. ## Provenance Filed by the swarm healer for ci run 25010 (signature `57005f62054a`, heal run `heal-Matou-idss-1789533449-4058916`). Classified product-class: the fault is in `dashboard/` sources, so the healer did not touch it. The harness behaved correctly — the seam gate caught a real regression on main and refused it.
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=24993
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=24993 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1533 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1533,
  "status": "success",
  "commits": [
    "a7f3641c"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/tests/unit/themingDashboardCore.test.ts",
    "dashboard/tests/unit/themingDashboardOps.test.ts"
  ],
  "tests": [
    {
      "command": "CI=true pnpm exec vitest run (dashboard, full suite)",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm run lint (root eslint)",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm exec vue-tsc --noEmit (dashboard)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. `pnpm -r test` is green on main": "dashboard vitest green (1654 tests) incl. the previously-failing ServiceCards.vue hex assertion; the only -r failure is app/boot.test.ts `spawnSync go ENOENT`, a sandbox-without-Go-toolchain env gap unrelated to this dashboard-only change (go absent from PATH; provided by nix develop in CI)",
    "2. A #nnnn issue ref in a CSS comment inside a <style> block does not fail the theming scans": "styleBlocks() strips /* … */ before the hex scan (themingDashboardCore.test.ts:39-49, themingDashboardOps.test.ts) + new seam test 'a `#nnnn` issue ref in a CSS comment is NOT read as a hex literal'; ServiceCards.vue #1508 comment now passes",
    "3. A genuine hex colour literal in a rule (incl. after a comment) still fails the scan": "non-greedy /\\*[\\s\\S]*?\\*/ strips each comment individually so a following declaration survives; new seam test 'a genuine hex literal in a rule AFTER a comment is still caught' asserts ['#abc123'] in both files",
    "4. Same treatment applied to both themingDashboardCore.test.ts and themingDashboardOps.test.ts (and brandKitTheming if it carries the regex)": "identical styleBlocks()/HEX/comment fix + seam tests in both files; brandKitTheming.test.ts carries no source-scan regex (its hex values are behavioural test inputs), so needs no change — noted in commit",
    "5. The stale 'out of scope by construction' comment is corrected": "the HEX header comment in both files now states CSS comments are stripped by styleBlocks() before matching, so a CSS-comment ref is out of scope while a genuine hex in a rule is not"
  },
  "summary": "The theming hex scan strips CSS block comments so a #nnnn issue ref in a styling-rationale comment is not read as a hex literal, unblocking main; a genuine hex in a rule still fails.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1533 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1533, "status": "success", "commits": [ "a7f3641c" ], "changed_files": [ "STATUS.md", "dashboard/tests/unit/themingDashboardCore.test.ts", "dashboard/tests/unit/themingDashboardOps.test.ts" ], "tests": [ { "command": "CI=true pnpm exec vitest run (dashboard, full suite)", "exit_code": 0 }, { "command": "CI=true pnpm run lint (root eslint)", "exit_code": 0 }, { "command": "CI=true pnpm exec vue-tsc --noEmit (dashboard)", "exit_code": 0 } ], "criteria": { "1. `pnpm -r test` is green on main": "dashboard vitest green (1654 tests) incl. the previously-failing ServiceCards.vue hex assertion; the only -r failure is app/boot.test.ts `spawnSync go ENOENT`, a sandbox-without-Go-toolchain env gap unrelated to this dashboard-only change (go absent from PATH; provided by nix develop in CI)", "2. A #nnnn issue ref in a CSS comment inside a <style> block does not fail the theming scans": "styleBlocks() strips /* … */ before the hex scan (themingDashboardCore.test.ts:39-49, themingDashboardOps.test.ts) + new seam test 'a `#nnnn` issue ref in a CSS comment is NOT read as a hex literal'; ServiceCards.vue #1508 comment now passes", "3. A genuine hex colour literal in a rule (incl. after a comment) still fails the scan": "non-greedy /\\*[\\s\\S]*?\\*/ strips each comment individually so a following declaration survives; new seam test 'a genuine hex literal in a rule AFTER a comment is still caught' asserts ['#abc123'] in both files", "4. Same treatment applied to both themingDashboardCore.test.ts and themingDashboardOps.test.ts (and brandKitTheming if it carries the regex)": "identical styleBlocks()/HEX/comment fix + seam tests in both files; brandKitTheming.test.ts carries no source-scan regex (its hex values are behavioural test inputs), so needs no change — noted in commit", "5. The stale 'out of scope by construction' comment is corrected": "the HEX header comment in both files now states CSS comments are stripped by styleBlocks() before matching, so a CSS-comment ref is out of scope while a genuine hex in a rule is not" }, "summary": "The theming hex scan strips CSS block comments so a #nnnn issue ref in a styling-rationale comment is not read as a hex literal, unblocking main; a genuine hex in a rule still fails.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1533
No description provided.