NS9 slice: Add terminal color-mode probes and accessibility guardrails #63

Closed
opened 2026-06-21 09:15:36 +00:00 by tmk241 · 1 comment
Owner

OBJECTIVE: mim chooses safe color output for the current terminal and has guardrails that prevent unreadable or color-only UI states.

AUTHORITY: Parent #57; newed adapt.rs/detect.rs; mim PRODUCT.md mobile-first terminal constraint; req: ui/001-002, governance/001-002, testing/001-004.

AGENT AUTHORITY:

  • Delivery authority: local-commit
  • Tracker authority: this issue may be commented and closed when acceptance passes; parent #57 may be commented/checklisted.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #57 via explicit issue link and parent checklist.

SCOPE: Terminal capability detection/override-by-build-profile if already conventional, fallback strategy, contrast/readability tests for key token pairs, no-color behavior, style reset audit.

BOUNDARIES: Do not add runtime config files or a broad settings system. Environment probing must be deterministic and safe in SSH/non-interactive tests.

ACCEPTANCE:

  • Truecolor, 256-color, 16-color, mono/no-color terminals select deterministic output modes.
  • Critical semantic states have text/shape/attribute fallback, not color-only meaning.
  • Tests catch missing resets and unreadable token pairs for core surfaces.
  • Non-interactive/smoke output remains parseable and does not emit uncontrolled escape sequences when disabled.
  • SSH/mobile terminals with limited color support remain usable.

VERIFICATION:

  • zig build test
  • Unit/render tests for TERM/COLORTERM/no-color cases, style reset audit, contrast/readability guardrails, non-interactive output.
  • zig build v1-smoke

BLOCKERS: none.

OBJECTIVE: `mim` chooses safe color output for the current terminal and has guardrails that prevent unreadable or color-only UI states. AUTHORITY: Parent #57; newed `adapt.rs`/`detect.rs`; mim PRODUCT.md mobile-first terminal constraint; req: ui/001-002, governance/001-002, testing/001-004. AGENT AUTHORITY: - Delivery authority: local-commit - Tracker authority: this issue may be commented and closed when acceptance passes; parent #57 may be commented/checklisted. - Handoff state: committed clean, tracker commented/closed. PARENT: #57 via explicit issue link and parent checklist. SCOPE: Terminal capability detection/override-by-build-profile if already conventional, fallback strategy, contrast/readability tests for key token pairs, no-color behavior, style reset audit. BOUNDARIES: Do not add runtime config files or a broad settings system. Environment probing must be deterministic and safe in SSH/non-interactive tests. ACCEPTANCE: - Truecolor, 256-color, 16-color, mono/no-color terminals select deterministic output modes. - Critical semantic states have text/shape/attribute fallback, not color-only meaning. - Tests catch missing resets and unreadable token pairs for core surfaces. - Non-interactive/smoke output remains parseable and does not emit uncontrolled escape sequences when disabled. - SSH/mobile terminals with limited color support remain usable. VERIFICATION: - `zig build test` - Unit/render tests for TERM/COLORTERM/no-color cases, style reset audit, contrast/readability guardrails, non-interactive output. - `zig build v1-smoke` BLOCKERS: none.
tmk241 added the sliceready-for-agentgoal labels 2026-06-21 09:15:36 +00:00
Author
Owner

Closing receipt for #63.

Implemented in local commit de3b5d4 (Detect terminal color capabilities):

  • Added local terminal color capability detection to src/theme.zig for truecolor, 256-color, 16-color, and mono modes.
  • Detection uses local environment signals (TERM, COLORTERM, NO_COLOR, MIM_COLOR, COLORFGBG) without config files or installers.
  • Added background detection and accessibility contrast guardrails for theme styles.
  • Updated REQUIREMENTS.md for terminal color adaptation authority.

Verification:

  • zig build
  • zig build test
  • zig build terminal-e2e
  • zig build run -- --help
  • zig build --prefix /tmp/mim-install verify-install-code
  • redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md
Closing receipt for #63. Implemented in local commit `de3b5d4` (`Detect terminal color capabilities`): - Added local terminal color capability detection to `src/theme.zig` for truecolor, 256-color, 16-color, and mono modes. - Detection uses local environment signals (`TERM`, `COLORTERM`, `NO_COLOR`, `MIM_COLOR`, `COLORFGBG`) without config files or installers. - Added background detection and accessibility contrast guardrails for theme styles. - Updated REQUIREMENTS.md for terminal color adaptation authority. Verification: - `zig build` ✅ - `zig build test` ✅ - `zig build terminal-e2e` ✅ - `zig build run -- --help` ✅ - `zig build --prefix /tmp/mim-install verify-install-code` ✅ - `redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` ✅
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#63