feat(style): gateway outcome glyphs for blocked/allowed/warned (#84)#141
Merged
Conversation
Adds should_use_unicode() and outcome_glyph() to src/style.rs, reusing the #83 palette/gate. Glyph set: blocked ●·│✕ / allowed │●│ / warned ●·│ with ASCII fallbacks. Unicode detection via ARAI_ASCII/NO_UNICODE env vars and UTF-8 locale check (TTY-independent). Hook output passes literal false for colorize — glyph chars but zero ANSI even under CLICOLOR_FORCE=1. --json paths carry no glyphs (structural carve-out). Ochre applied to ✕ only when colorize=true, reusing #83 passage() helper. Audit-chain ✓/✗ markers untouched. 584 tests pass, zero new dependencies. Closes #84. Part of parent #64. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a07e8cb to
79df71e
Compare
Deploying arai with
|
| Latest commit: |
79df71e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6f1f4057.arai-dh0.pages.dev |
| Branch Preview URL: | https://feat-84-gateway-glyphs.arai-dh0.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds gateway-derived outcome glyphs to Arai's human-readable output surfaces,
replacing generic warning/blocked icons with a coherent visual vocabulary that
mirrors the gateway metaphor. Closes #84 (parent #64). Follow-on to #83.
Glyph set
●·│✕o.|x│●│|o|●·│o.|Visual weight tracks severity: blocked is heaviest (dot outside + ochre cross),
warned is medium (dot adjacent, pre-passage), allowed is lightest (dot passing
through, centered).
Unicode detection (
should_use_unicode)Precedence:
ARAI_ASCII(non-empty) → ASCII;NO_UNICODE(non-empty) → ASCII;else locale priority
LC_ALL > LC_CTYPE > LANG(first non-empty, UTF-8 check);missing/empty locale → ASCII. Deliberately TTY-independent — piped output
honours the same locale as interactive output.
Palette reuse from #83
The ochre cross (
✕) reuses #83'spassage()helper and theshould_colorize()gate. Colour appears only on the blocked glyph's cross, and only when
colorize=true. Every other glyph character carries no colour.Carve-outs
src/hooks.rs): alloutcome_glyphcalls pass literalfalsefor
colorize— glyph characters appear in Pre/Post human strings but zero ANSIescape bytes are emitted, even under
CLICOLOR_FORCE=1.--jsonoutput: nooutcome_glyphcall on any JSON code path — glyph-free bydesign (structural, not conditional).
✓/✗integrity markers (src/main.rs) are left untouched(different semantic — hash-chain verification, not outcome display).
Integration surfaces
src/main.rs:cmd_auditandcmd_whyhuman-output rows prefixed with the glyph.src/stats.rs:print_compliance_sectionreplaces the generic⚠with the warned glyph.src/hooks.rs: Pre/Post human strings prefixed with glyphs;colorizehard-codedfalse.Zero new dependencies
src/style.rsextended in-place.Cargo.toml/Cargo.lockunchanged.Test coverage
584 tests pass (0 failures). New:
tests/gateway_outcome_glyphs.rs(9 integration),tests/gateway_glyphs_verifier.rs(29 independent verifier tests), plus style unittests. Full gate:
cargo fmt --checkclean,cargo clippy0 new warnings,cargo test584/584.Provenance
Built via the Taniwha dispatch cycle (design v6 → contract → leaf → verifier).
The glyph direction (bar+dot, closest to the line+ochre-dot brand mark) was a
user decision at the design gate. Full audit trail under
.taniwha/kupu/.🤖 Generated with Claude Code