Skip to content

feat(style): gateway outcome glyphs for blocked/allowed/warned (#84)#141

Merged
mattcollie merged 1 commit into
mainfrom
feat/84-gateway-glyphs
Jun 1, 2026
Merged

feat(style): gateway outcome glyphs for blocked/allowed/warned (#84)#141
mattcollie merged 1 commit into
mainfrom
feat/84-gateway-glyphs

Conversation

@mattcollie

Copy link
Copy Markdown
Contributor

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

Outcome Unicode ASCII fallback
Blocked ●·│✕ o.|x
Allowed │●│ |o|
Warned (Warn + Inform) ●·│ 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's passage() helper and the should_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

  • Hook output (src/hooks.rs): all outcome_glyph calls pass literal false
    for colorize — glyph characters appear in Pre/Post human strings but zero ANSI
    escape bytes are emitted, even under CLICOLOR_FORCE=1.
  • --json output: no outcome_glyph call on any JSON code path — glyph-free by
    design (structural, not conditional).
  • Audit-chain / integrity markers (src/main.rs) are left untouched
    (different semantic — hash-chain verification, not outcome display).

Integration surfaces

  • src/main.rs: cmd_audit and cmd_why human-output rows prefixed with the glyph.
  • src/stats.rs: print_compliance_section replaces the generic with the warned glyph.
  • src/hooks.rs: Pre/Post human strings prefixed with glyphs; colorize hard-coded false.

Zero new dependencies

src/style.rs extended in-place. Cargo.toml / Cargo.lock unchanged.

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 unit
tests. Full gate: cargo fmt --check clean, cargo clippy 0 new warnings, cargo test 584/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

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>
@mattcollie mattcollie force-pushed the feat/84-gateway-glyphs branch from a07e8cb to 79df71e Compare June 1, 2026 01:50
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 1, 2026

Copy link
Copy Markdown

Deploying arai with  Cloudflare Pages  Cloudflare Pages

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

View logs

@mattcollie mattcollie merged commit 6e713f1 into main Jun 1, 2026
10 checks passed
@mattcollie mattcollie deleted the feat/84-gateway-glyphs branch June 1, 2026 02:52
@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] replace generic warning/blocked iconography with gateway-derived glyphs

1 participant