Skip to content

Add an explicit failure path for color pairings that fail contrast - #36

Merged
codeswithroh merged 1 commit into
mainfrom
feat/contrast-failure-path
Jul 23, 2026
Merged

Add an explicit failure path for color pairings that fail contrast#36
codeswithroh merged 1 commit into
mainfrom
feat/contrast-failure-path

Conversation

@codeswithroh

Copy link
Copy Markdown
Owner

What this changes

Closes the remaining gap in #8. Semantic roles with attached ratios (the Color contract in style-lock-format.md) and use-time re-checking of invented pairings (SKILL.md's non-negotiable #5) already shipped in earlier work. Missing was the third piece reviewers explicitly flagged: what happens when a pairing genuinely fails. Without a defined path, "iterate until it passes" has no way to distinguish a real fix from looping on the same failing value.

  • SKILL.md — non-negotiable Motion defaults assume a scroll-driven marketing page #5 gains an ordered failure path: reuse an already-legal pairing → nudge the new color's lightness within its own hue family and re-verify with the matrix (the same approach generate_palette.py already uses at generation time, applied ad hoc to one token) → fall back to a known-safe neutral if nudging would break the color's intended role → surface a genuine conflict to the user rather than shipping the failure or silently substituting something unasked for.
  • references/style-lock-format.md — Color contract section points at the failure path and adds a note field for recording when a token's value was nudged mid-build for contrast.

Closes #8

Test plan

  • Verified fence balance and no stray "preset" mentions in both edited files
  • Cross-checked the failure path doesn't conflict with existing generate_palette.py behavior — it's the same lightness-solving principle applied to a single ad hoc token instead of a full palette

Closes the remaining gap in #8: semantic roles with attached ratios
(the Color contract in style-lock-format.md) and use-time re-checking
of invented pairings (SKILL.md's non-negotiable #5) already shipped
in earlier work. What was missing was the third piece reviewers
explicitly flagged — what happens when a pairing genuinely fails.
Without a defined path, "iterate until it passes" has no way to
distinguish a real fix from looping on the same failing value.

- SKILL.md: non-negotiable #5 gains an ordered failure path — reuse
  an already-legal pairing, nudge the new color's lightness within
  its own hue family and re-verify with the matrix (the same
  approach generate_palette.py already uses at generation time,
  applied ad hoc to one token), fall back to a known-safe neutral if
  nudging would break the color's intended role, or surface a
  genuine conflict to the user rather than shipping the failure or
  silently substituting something unasked for.
- references/style-lock-format.md: Color contract section points at
  the failure path and adds a note field for recording when a
  token's value was nudged mid-build for contrast, so a later session
  sees the final value already reflects a deliberate fix.

Closes #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codeswithroh
codeswithroh merged commit 29ccacf into main Jul 23, 2026
@codeswithroh
codeswithroh deleted the feat/contrast-failure-path branch July 23, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contrast check should be a use-time, pairwise, token-level contract, not an author-time preset pass

1 participant