NS9 slice: Add source-patched newed palette tokens and terminal adaptation #58

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

OBJECTIVE: Add a small source-patched theme model for mim that captures the newed night palette and adapts it deterministically to truecolor, 256-color, 16-color, and mono terminals.

AUTHORITY: Parent #57; /opt/repositories/newed/newed-theme/src/default_theme.rs, palette.rs, style.rs, adapt.rs; /opt/repositories/newed/newed-theme/REQUIREMENTS.md; mim PRODUCT.md/REQUIREMENTS.md governance and testing rows.

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: Add a minimal src/theme.zig or equivalent local module with named semantic tokens, newed-derived default values, ANSI SGR rendering helpers, color-mode detection/adaptation, and deterministic tests. Wire only enough to make later render slices use the model.

BOUNDARIES: Do not depend on /opt/repositories/newed at build/runtime. Do not add runtime config files, theme plugins, or a theme marketplace. Do not port the whole Rust theme crate unless a tiny local translation cannot satisfy mim.

ACCEPTANCE:

  • Theme tokens are semantic (normal, muted, accent, selection, diagnostic_error, panel_bg, etc.), not random call-site RGB literals.
  • The default palette is visibly traceable to newed night and documents the source anchors in comments/tests.
  • Truecolor, 256-color, 16-color, and mono adaptation produce deterministic SGR output.
  • Mono mode preserves emphasis via attributes or plain readable text without color-only meaning.
  • Theme rendering can be disabled/reset safely and never leaks terminal styles across lines or frames.

VERIFICATION:

  • zig build test
  • Unit tests for token lookup, SGR reset, truecolor/256/16/mono adaptation, deterministic output, and no style leakage.
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md if requirements change.

BLOCKERS: none.

OBJECTIVE: Add a small source-patched theme model for mim that captures the newed night palette and adapts it deterministically to truecolor, 256-color, 16-color, and mono terminals. AUTHORITY: Parent #57; `/opt/repositories/newed/newed-theme/src/default_theme.rs`, `palette.rs`, `style.rs`, `adapt.rs`; `/opt/repositories/newed/newed-theme/REQUIREMENTS.md`; mim PRODUCT.md/REQUIREMENTS.md governance and testing rows. 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: Add a minimal `src/theme.zig` or equivalent local module with named semantic tokens, newed-derived default values, ANSI SGR rendering helpers, color-mode detection/adaptation, and deterministic tests. Wire only enough to make later render slices use the model. BOUNDARIES: Do not depend on `/opt/repositories/newed` at build/runtime. Do not add runtime config files, theme plugins, or a theme marketplace. Do not port the whole Rust theme crate unless a tiny local translation cannot satisfy mim. ACCEPTANCE: - Theme tokens are semantic (`normal`, `muted`, `accent`, `selection`, `diagnostic_error`, `panel_bg`, etc.), not random call-site RGB literals. - The default palette is visibly traceable to newed night and documents the source anchors in comments/tests. - Truecolor, 256-color, 16-color, and mono adaptation produce deterministic SGR output. - Mono mode preserves emphasis via attributes or plain readable text without color-only meaning. - Theme rendering can be disabled/reset safely and never leaks terminal styles across lines or frames. VERIFICATION: - `zig build test` - Unit tests for token lookup, SGR reset, truecolor/256/16/mono adaptation, deterministic output, and no style leakage. - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` if requirements change. BLOCKERS: none.
tmk241 added the sliceready-for-agentgoal labels 2026-06-21 09:15:35 +00:00
Author
Owner

Closing receipt for #58.

Implemented in local commit 5652845 (Add newed night theme model):

  • Added src/theme.zig as the local source-patched newed night semantic palette model.
  • Captured stable tokens for normal/muted/accent/selection/panel/cursor/diagnostic styles.
  • Added deterministic terminal color adaptation for truecolor, 256-color, 16-color, and mono modes.
  • Added SGR helpers that reset styles and preserve bold/italic in mono.
  • Kept this as a local model only: no runtime theme/config/plugin surface and no broad rendering rewrite in this slice.

Verification:

  • zig build
  • zig build test (palette token, contrast, adaptation, SGR/reset tests)
  • 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 #58. Implemented in local commit `5652845` (`Add newed night theme model`): - Added `src/theme.zig` as the local source-patched newed night semantic palette model. - Captured stable tokens for normal/muted/accent/selection/panel/cursor/diagnostic styles. - Added deterministic terminal color adaptation for truecolor, 256-color, 16-color, and mono modes. - Added SGR helpers that reset styles and preserve bold/italic in mono. - Kept this as a local model only: no runtime theme/config/plugin surface and no broad rendering rewrite in this slice. Verification: - `zig build` ✅ - `zig build test` ✅ (palette token, contrast, adaptation, SGR/reset tests) - `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#58