Status: deferred 2026-08-20 in PR #391 (defer rule D1 — the affected modules are outside that PR's diff)
What: css_blocks(prelude) (dashboard/backend/tests/_frontend_source.py:96) searches raw styles.css for re.escape(prelude) + r"\s*\{". That matches two things it should not:
- Comment bodies. A CSS comment containing an illustrative rule is brace-matched and returned as if it were live cascade.
.section-card h3 returns 5 blocks — 1 real rule plus 4 copies of the comment /* Beat \.section-card h3 { font-size: 12px }` (higher specificity). */` (styles.css:7778, 9242, 9455, 9555).
- Tail selectors. Any longer selector ending in the prelude matches.
.home-module-rank-list li returns 3 blocks: the exact rule plus .home-landing-board .home-module-rank-list li and a grouped selector (styles.css:6404, 6983, 6987).
The helper's own docstring says it returns every match rather than the first specifically so tests do not "silently depend on authoring order" — but 14 call sites then index [0], which reintroduces exactly that dependency. Both ambiguous preludes above pass today only because the exact rule happens to be authored first.
One guard is provably vacuous. test_onboarding_flow_ux.py:165 (default = css_blocks(".section-card h3")) asserts the rule exists and reads its font-size to derive the threshold the three Configure panel titles must beat. Delete the real rule from styles.css entirely and:
$ python -m pytest dashboard/backend/tests/test_onboarding_flow_ux.py -q -k "section_card or title"
1 passed, 13 deselected
default[0] falls through to the comment, which parses to the same 12px, so the threshold is unchanged and the guard passes with the rule it exists to protect gone. Restored after measuring; main is unmodified.
Scope — deliberately narrow. I mutation-tested the other ambiguous site too: deleting the real .home-module-rank-list li rule does fail test_frontend_chart_first_home.py::test_the_swatch_sits_inside_the_name_cell_not_in_the_row_grid at :806, because the substituted block carries different column values. That one is latent, not vacuous. No assert not css_blocks(...) absence guards exist today — an absence assertion over this helper would be defeated by a comment merely mentioning the selector, so the fix matters more the moment one is written.
Why deferred: D1. PR #391 touched test_frontend_chart_first_home.py, test_frontend_fast_boot.py, app.html, styles.css. _frontend_source.py and test_onboarding_flow_ux.py are in neither that diff nor #388's, and the helper is shared by 9 test modules — changing its matching semantics is a suite-wide change that does not belong in a home-hero layout fix.
Next-session entry point:
dashboard/backend/tests/_frontend_source.py:96 — strip /* … */ before scanning (offset-preserving, e.g. blank out comment spans in place so STYLES.index stays valid), and add an exact: bool = False parameter that anchors the prelude to a selector boundary (start-of-block, {, }, ; or ,).
- Then audit the 14
[0] sites: 6 in test_frontend_chart_first_home.py (67, 105, 123, 716, 795, 800), 8 in test_onboarding_flow_ux.py (117, 129, 144, 152, 165, 174, 183, 191). Only :165 and :795 are ambiguous today; the rest are single-match and just need the stricter call.
test_frontend_chart_first_home.py already carries a private _exact_rule_blocks written for this exact problem — lift it rather than re-deriving.
- Re-run the mutation above and require it to fail before calling it fixed.
- Effort: ~1–2h including the audit.
Status: deferred 2026-08-20 in PR #391 (defer rule D1 — the affected modules are outside that PR's diff)
What:
css_blocks(prelude)(dashboard/backend/tests/_frontend_source.py:96) searches rawstyles.cssforre.escape(prelude) + r"\s*\{". That matches two things it should not:.section-card h3returns 5 blocks — 1 real rule plus 4 copies of the comment/* Beat \.section-card h3 { font-size: 12px }` (higher specificity). */` (styles.css:7778, 9242, 9455, 9555)..home-module-rank-list lireturns 3 blocks: the exact rule plus.home-landing-board .home-module-rank-list liand a grouped selector (styles.css:6404, 6983, 6987).The helper's own docstring says it returns every match rather than the first specifically so tests do not "silently depend on authoring order" — but 14 call sites then index
[0], which reintroduces exactly that dependency. Both ambiguous preludes above pass today only because the exact rule happens to be authored first.One guard is provably vacuous.
test_onboarding_flow_ux.py:165(default = css_blocks(".section-card h3")) asserts the rule exists and reads itsfont-sizeto derive the threshold the three Configure panel titles must beat. Delete the real rule fromstyles.cssentirely and:default[0]falls through to the comment, which parses to the same12px, so the threshold is unchanged and the guard passes with the rule it exists to protect gone. Restored after measuring;mainis unmodified.Scope — deliberately narrow. I mutation-tested the other ambiguous site too: deleting the real
.home-module-rank-list lirule does failtest_frontend_chart_first_home.py::test_the_swatch_sits_inside_the_name_cell_not_in_the_row_gridat :806, because the substituted block carries different column values. That one is latent, not vacuous. Noassert not css_blocks(...)absence guards exist today — an absence assertion over this helper would be defeated by a comment merely mentioning the selector, so the fix matters more the moment one is written.Why deferred: D1. PR #391 touched
test_frontend_chart_first_home.py,test_frontend_fast_boot.py,app.html,styles.css._frontend_source.pyandtest_onboarding_flow_ux.pyare in neither that diff nor #388's, and the helper is shared by 9 test modules — changing its matching semantics is a suite-wide change that does not belong in a home-hero layout fix.Next-session entry point:
dashboard/backend/tests/_frontend_source.py:96— strip/* … */before scanning (offset-preserving, e.g. blank out comment spans in place soSTYLES.indexstays valid), and add anexact: bool = Falseparameter that anchors the prelude to a selector boundary (start-of-block,{,},;or,).[0]sites: 6 intest_frontend_chart_first_home.py(67, 105, 123, 716, 795, 800), 8 intest_onboarding_flow_ux.py(117, 129, 144, 152, 165, 174, 183, 191). Only:165and:795are ambiguous today; the rest are single-match and just need the stricter call.test_frontend_chart_first_home.pyalready carries a private_exact_rule_blockswritten for this exact problem — lift it rather than re-deriving.