Skip to content

feat(style): pounamu/ochre semantic palette for CLI output (#83)#140

Merged
mattcollie merged 1 commit into
mainfrom
feat/83-cli-palette
May 31, 2026
Merged

feat(style): pounamu/ochre semantic palette for CLI output (#83)#140
mattcollie merged 1 commit into
mainfrom
feat/83-cli-palette

Conversation

@mattcollie

Copy link
Copy Markdown
Contributor

Summary

Adds a semantic two-colour palette to Arai's CLI output (closes #83,
part of parent #64).

  • src/style.rs — new module; single source of truth for all ANSI
    truecolor construction. Five public helpers: structural(), passage(),
    error(), warn(), should_colorize(). Palette: pounamu
    RGB(61,130,104) for structural text; ochre RGB(184,118,58) for
    passage moments, warnings, and errors. Foreground-only unconditionally —
    no background escapes anywhere.

  • Gating hierarchy (highest priority wins): NO_COLOR present →
    strip all; non-TTY stdout and no CLICOLOR_FORCE → strip all;
    CLICOLOR_FORCE=1 → force on; interactive TTY → on. NO_COLOR
    dominates CLICOLOR_FORCE.

  • Machine-consumer carve-out: the hook-protocol path
    (guardrails --match-stdin) and every --json flag output remain
    ANSI-free even when CLICOLOR_FORCE=1 is set. src/hooks.rs is not
    modified and does not import the style module — the carve-out is
    structural, not conditional.

  • AC9 legibility decision: structural pounamu was lightened from
    the original RGB(31,77,63) (#1f4d3f) to RGB(61,130,104) (#3d8268)
    following a user-directed readability review. WCAG 2.1 contrast
    (verifier-computed): ~5.0:1 on black (passes WCAG AA >=4.5:1);
    ~4.2:1 on white (below WCAG AA-normal 4.5:1, above AA-large 3:1).
    The old value was ~2.3:1 on black (failing AA). The white-terminal
    gap (~4.2:1 vs 4.5:1) is a known caveat; AC9 calls for human visual
    inspection rather than a specific numeric threshold, and the new
    value is visibly improved on both common terminal backgrounds.

  • Zero new dependencies: Cargo.toml is unchanged from origin/main.
    No colour crate, no terminal crate, no temp-dir crate.

Test coverage

Suite Tests
Unit tests (src/) 400
brand_palette_verifier 30
style_integration 12
All other suites 94
Total 536 (all pass)

Full gate: cargo fmt --check clean, cargo clippy 0 new warnings,
cargo test 536/536.

Provenance

Built via the Taniwha dispatch cycle (design v5 → contract → leaf → verifier),
with a user-directed AC9 legibility correction (corrective leaf + verifier)
when the dispatcher's WCAG check flagged the original pounamu as too dark on
dark terminals. Full audit trail under .taniwha/kupu/ in this branch.

🤖 Generated with Claude Code

…#83)

Introduces src/style.rs with a two-colour semantic palette (pounamu green
for structural text, ochre for passage/warn/error) applied foreground-only
with WCAG-aware truecolor escapes. Gating: NO_COLOR (env) > TTY-detect >
CLICOLOR_FORCE > plain. The hook-protocol path (guardrails --match-stdin)
and all --json outputs remain ANSI-free even under CLICOLOR_FORCE=1, so
machine consumers are unaffected. Structural pounamu was lightened from
RGB(31,77,63) to RGB(61,130,104) for dark-terminal readability (~5.0:1 vs
black, WCAG AA pass). 536/536 tests pass; zero new dependencies.

Closes #83. Part of parent #64.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mattcollie mattcollie force-pushed the feat/83-cli-palette branch from 009855c to a498050 Compare May 31, 2026 21:08
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 31, 2026

Copy link
Copy Markdown

Deploying arai with  Cloudflare Pages  Cloudflare Pages

Latest commit: a498050
Status: ✅  Deploy successful!
Preview URL: https://1e004d90.arai-dh0.pages.dev
Branch Preview URL: https://feat-83-cli-palette.arai-dh0.pages.dev

View logs

@mattcollie mattcollie merged commit c10fb9e into main May 31, 2026
10 checks passed
@mattcollie mattcollie deleted the feat/83-cli-palette branch May 31, 2026 23:24
@mattcollie mattcollie mentioned this pull request Jun 1, 2026
3 tasks
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.

[ui] apply pounamu/ochre/paper/ink palette across CLI output

1 participant