Skip to content

§3: move glyph/ANSI realization from std/symbols to extdeps/render - #5281

Merged
briansrls merged 4 commits into
mainfrom
session/proud-raven-799
Jun 19, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/proud-raven-799

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Move the glyph realization table (standard_symbols), encoding-tier dispatch (resolve_symbol, symbol_color), and ANSI 256-color escape table (ansi_code) out of dsl/std/symbols into a new dsl/extdeps/render/ carrier (ansi.dag, glyphs.dag, terminal.dag).
  • std/symbols now holds only agnostic concepts: SemanticColor, Tier, SymbolId, and the SymbolEntry shape.
  • Terminal width composition (span_width, constrain_frame, …) moves to extdeps/render/terminal.dag so std/render stays realization-free (no std→extdeps import inversion).
  • Lookup uses fold + explicit enum equality instead of filter on record fields — the v1 interpreter hits a non-exhaustive pattern-match bug on the latter.

Test plan

  • gunbc run --source-root dsl --entry dsl/test/claim/render_glyphs_ansi_witness_test.dag --function render_glyphs_ansi_witnesses --claim-run — green
  • gunbc run --source-root dsl --entry dsl/tools/dsl_compile_clean_gate.dag --function main — green (whole-tree dsl/ compile-clean)

briansrls and others added 2 commits June 19, 2026 15:36
filter+field-equality on record rows hits a non-exhaustive pattern-match
bug in the v1 interpreter; fold with explicit enum equality is green under
render_glyphs_ansi_witnesses --claim-run.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot gunbai-bot Bot changed the title STD_LEAK slice-2 (render/ANSI): move the ANSI escape / glyph realization table + its terminal-selecting match-dispatch OUT of dsl/std/symbols into a NEW extdeps/render (build the carrier). §3: std/symbols keeps ONLY the agnostic glyph/symbol concept; the per-terminal ANSI table + the dispatch that s §3: move glyph/ANSI realization from std/symbols to extdeps/render Jun 19, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 19, 2026 15:40
@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Re: symbol_id_eq / semantic_color_eq scaffolds — verified, agree these dissolve once derived == lands on closed enums.

They are not optional today: the prior filter(rows, e => e.id == id) / filter(ansi_mappings, m => m.color == c) pattern typechecks but fails at runtime under the v1 interpreter (non-exhaustive pattern match on: { id: NodeCompleted, … }). The fold + explicit per-variant equality is the working workaround until derived equality (or the interpreter fix) ships.

No code change on this PR — reviewer note is non-blocking per the APPROVE verdict.

— sent from proud-raven-799

briansrls and others added 2 commits June 19, 2026 15:58
Add top-of-module Anchor citing https://en.wikipedia.org/wiki/ANSI_escape_code
and name the upstream SGR/CSI sequences (ECMA-48, ANSI X3.64, ISO 8613-6
256-color foreground). fermi/colors.go retained as project palette note only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Coproduct == works in fold (verified); only filter+field-equality hits the
v1 interpreter non-exhaustive-pattern-match bug. Removes symbol_id_eq and
semantic_color_eq predicate-dissolution debt from extdeps/render.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Re: hand-rolled symbol_id_eq / semantic_color_eq — valid finding, fixed in 8c24382..HEAD.

Verified: structural == on SymbolId / SemanticColor does work — but only outside filter. The pre-PR filter(rows, e => e.id == id) pattern typechecks yet fails at runtime (non-exhaustive pattern match on: { id: NodeCompleted, … }). The second commit's per-variant match-of-match helpers were a workaround for that interpreter bug, not missing derived equality.

Fix: deleted both helpers; lookup now uses fold + e.id == id / m.color == c (structural ==, no per-type predicates in extdeps). Witness still green.

— sent from proud-raven-799

@briansrls
briansrls merged commit 4e59da0 into main Jun 19, 2026
1 check passed
@briansrls
briansrls deleted the session/proud-raven-799 branch June 19, 2026 17:06
briansrls added a commit that referenced this pull request Jun 19, 2026
…ng columns (#5296)

* WIP: Rework render/glyphs modeling in a child PR (follow-up to merged #5281,

* fix(render): use List<TierGlyph> for tier-keyed glyph encodings

Map literal syntax parses as Record in the v1 interpreter (raw_map_lookup
fails at runtime). SymbolEntry.glyphs is List<TierGlyph> keyed by Tier;
resolve_glyph folds the list instead of a 3-way field match or map_get.

render_glyphs_ansi_witnesses --claim-run is green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* render: anchors (step 3), std/extdeps confirm (2), SGR decomposition (4)

- glyphs.dag: Unicode latest + U+2500/U+2800/UTS #51 repertoire cite
- terminal.dag: UAX #11 East Asian Width anchor (sibling to std.unicode)
- ansi.dag: ECMA-48 anchor (replaces Wikipedia); fermi/colors.go provenance
- ansi.dag: decompose AnsiMapping into SgrStyle + PaletteIndex; CSI framing
  via emit_sgr_csi (csi_esc/csi_end constants, not per-row literals)
- std/symbols: Tier comment — project interface, not external authority

render_glyphs_ansi_witnesses --claim-run green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(symbols): TierGlyphs total product replaces List<TierGlyph>

Address opus REQUEST_CHANGES: List<TierGlyph> made missing/duplicate tier
rows representable and introduced a spurious Absent path in tier lookup.
SymbolEntry.glyphs is now TierGlyphs { emoji, unicode, ascii } — a total
product keyed by the closed Tier enum. glyph_at centralizes tier dispatch;
resolve_symbol returns Absent only for unknown SymbolId, not missing tier.

render_glyphs_ansi_witnesses --claim-run green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* render: ground tier glyphs in distinct extdeps encoding authorities

- Add ascii_glyph (ECMA-6), unicode_glyph (Unicode std.unicode cite),
  emoji_glyph (UTS #51) — branded String carriers, distinct dissolve-on each
- tier_glyphs.dag: TierGlyphs total product + glyph_at projections
- Move SymbolEntry realization to extdeps/render/glyphs.dag; std/symbols
  keeps SymbolId / Tier / SemanticColor only
- Behavioral witness w_glyph_at_selects_matching_tier_text (distinct A/U/E)

render_glyphs_ansi_witnesses --claim-run green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(render): real std.unicode ref in unicode_glyph; re-trigger CI

CI failure on ea2a629 was sccache infra flake (failed to read response
header during cargo build), not a witness/gate regression — prior runs
green on this branch. Replace empty `import std.unicode {}` with
unicode_glyph_display_width delegating to string_display_width (UAX #11).

render_glyphs_ansi_witnesses --claim-run green.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant