Test gap: INV-AUDIO-103 parity guard only enforces TS-side, CSS literal can drift silently #107
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#107
Loading…
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?
P3-low test gap:
mobileAlbumDockLayout.test.tsonly assertsMOBILE_HEADER_TOP_CLEARANCE_BELOW_SAFE_AREA_REM === 4.5. It does not readfrontend/src/index.cssand verify the+ 4.5remliteral still matches. The invariantINV-AUDIO-103is one-way — TS-side drift fails CI, CSS-side drift passes silently.Repro
frontend/src/audio/mobileAlbumDockLayout.test.ts(entire file):The test name says "mirrored in index.css" but the assertion only checks the TS-side constant.
Why it matters
INV-AUDIO-103perdocs/testing/invariants-and-business-logic.mdand the newskills/contributor-mobile-album-dock/SKILL.mdis bidirectional: the CSS+ 4.5remterm and the TS constant must stay in sync. A contributor can:MOBILE_HEADER_TOP_CLEARANCE_BELOW_SAFE_AREA_REMfrom4.5to5→ test fails ✓ (caught)index.cssline 3157+ 4.5rem→+ 5rem→ test passes ✗ (silent drift, mobile dock overlap regresses)The second path is exactly the regression #103 was filed to fix.
Proposed fix
Extend the test to read
index.cssand parse the literal:This matches the pattern used in
frontend-dapp/src/viteConfig.build.test.tsin the DEX repo (filesystem read in a unit test for cross-file invariants).Verified locally: only one match for
safe-area-inset-topinindex.css(the line 3157 dock-clearance rule). Regex is unambiguous.Severity
P3-low. Test gap, not a runtime bug. The current 4.5 value is correct; this is about preventing future silent drift on a documented invariant.
Acceptance
mobileAlbumDockLayout.test.tsreadsindex.cssand asserts thesafe-area-inset-top + Nremliteral equalsMOBILE_HEADER_TOP_CLEARANCE_BELOW_SAFE_AREA_REM.cc @PlasticDigits
mentioned in commit
117dca7fd7Implemented on
main(117dca7)Extended
mobileAlbumDockLayout.test.tsso INV-AUDIO-103 is enforced both ways: the canonical4.5assertion remains, and Vitest readsfrontend/src/index.cssand matches theenv(safe-area-inset-top, 0px) + Nremliteral toMOBILE_HEADER_TOP_CLEARANCE_BELOW_SAFE_AREA_REM(GitLab #107 acceptance).Docs / cross-links:
docs/testing/invariants-and-business-logic.md§103,manual-qa-checklists.md#103,skills/contributor-mobile-album-dock/SKILL.md,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.md.Verification checklist for @brouie
cd frontend && npm run test -- src/audio/mobileAlbumDockLayout.test.tspasses locally (2 tests).+ 4.5remin.app-headermobilemargin-topinindex.css→ Vitest should fail; revert.MOBILE_HEADER_TOP_CLEARANCE_BELOW_SAFE_AREA_REM→ Vitest should fail; revert.mobileAlbumDockLayout.tsJSDoc still points at the parity test (#107).Leaving this issue open for your sign-off.
Verification PASS on
117dca7All acceptance items verified.
Acceptance items
[✓] Test passes baseline —
npx vitest run src/audio/mobileAlbumDockLayout.test.ts→ 2/2 PASS in 3ms.[✓] CSS-side drift detected — Mutated
index.cssline 3157 from+ 4.5remto+ 5.5rem. Test 2 (parity) failed:Reverted, baseline restored.
[✓] TS-side drift detected — Mutated
mobileAlbumDockLayout.tsline 19 constant from4.5to5.5. Both tests failed:expected 5.5 to be 4.5at line 13expected 4.5 to be 5.5at line 20Reverted, baseline restored (re-ran 2/2 PASS).
[✓] JSDoc points at parity test —
mobileAlbumDockLayout.tslines 14-16:INV-AUDIO-103 now bidirectionally enforced. cc @PlasticDigits
mentioned in issue #103