Ψ-W2-T1 remediation: scrim the card name over the waveform, hedge two SDK claims, fix a UTF-8-truncation empty-label bug, file the legibility DAW deferral

This commit is contained in:
2026-08-01 22:08:35 -04:00
parent 3278b4eced
commit 0feb32d59b
12 changed files with 115 additions and 11 deletions
+20
View File
@@ -250,6 +250,25 @@ static void testTextOnHoverSurfaceClearsFloor() {
CHECK(contrastRatio(roleColor(Role::TextDim), hover) >= textFloor(TextClass::Large));
}
// The card name strip (panel_render.cpp's drawCardName) draws text/primary Micro (10px, BODY
// class) over a bg/base scrim at kCardNameScrimAlpha, itself drawn over whatever the waveform
// left in that rect. Enumerate both backgrounds a loud/quiet capture can leave there: the
// accent-lime fill (a full-scale peak reaching the strip) and bare bg/cell (a quiet capture,
// nothing painted that high). Unscrimmed, text/primary reads ~1:1 against the fill — this is
// the load-bearing check that the scrim actually fixes it.
static void testCardNameScrimClearsBodyFloorOnItsWorstBackground() {
const KitColor scrim = roleColor(Role::BgBase);
const KitColor onFill = compositeOver(scrim, roleColor(Role::AccentPrimary),
kCardNameScrimAlpha);
const KitColor onCell = compositeOver(scrim, roleColor(Role::BgCell), kCardNameScrimAlpha);
CHECK(contrastRatio(roleColor(Role::TextPrimary), onFill) >= textFloor(TextClass::Body));
CHECK(contrastRatio(roleColor(Role::TextPrimary), onCell) >= textFloor(TextClass::Body));
// Without the scrim, text/primary on the bare accent-lime fill is UNDER floor — pins the
// defect the scrim exists to close, so a future removal of the scrim fails this first.
CHECK(contrastRatio(roleColor(Role::TextPrimary), roleColor(Role::AccentPrimary))
< textFloor(TextClass::Body));
}
// --- Single point of change (structural guarantee) ----------------------------
//
// roleColor is the ONLY color source; there is no other public accessor that yields a
@@ -346,6 +365,7 @@ int main() {
testRegionTitleAccentsClearLargeFloorOnPanel();
testTextOnPastelFillClearsBodyFloor();
testTextOnHoverSurfaceClearsFloor();
testCardNameScrimClearsBodyFloorOnItsWorstBackground();
testCurveTraceOnHoverSurfaceClearsFloor();
testSecondaryTertiaryAreDistinguishable();
testOverlayTraceClearsIndicatorFloorOnTheWaveform();