Repository navigation
docs(tokenize): reframe character-level scaffold as consumption gap - #662
Conversation
|
Review metadata
Verdict: APPROVE — Docs-only PR that labels an existing borrow (ASCII character-class predicates hardcoded in |
|
Review metadata
Verdict: APPROVE Doc-only diff, and it stays honest against the live code. The new scaffold note in |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/gpt-5.4 - Commit:
5b99ea5e· Trigger:schedule - Thinking:
212s wall
Non-blocking — Strengths
ROADMAP.mdThis is real tracked debt under P5: the new row documents the missing authority, bounds it to the tokenizer's borrowed ASCII classes, and names a concrete dissolution trigger.src/v3/compiler/tokenize.dagMirroring the receipt at the authority site is the right shape because the borrow is now visible to readers of the tokenizer spec instead of living only in roadmap prose.
ROADMAP — Verified
- Character-class borrow in tokenize: The cited hardcoded predicates are present in
regen_tokenize.rs, anddsl/extdeps/languages/dag/syntax.dagcurrently exposes keywords/operators but no structural character-class carrier.
✅ This looks clean; it makes an implicit tokenizer borrow explicit without changing behavior and the scaffold is tracked the way INVARIANTS.md expects.
Discovery pass found that the character-level authorities tokenize.dag
would consume already exist in dsl/std/ and are imported cross-tree
today (src/v3/compiler/regen.dag:3 imports std.types):
- std.types::Char = Int (Unicode scalar, U+0000–U+10FFFF)
- std.string_type::String = FreeMonoid<Char>
- std.unicode (DisplayWidth, UnicodeBlock, classification helpers)
- std.encoding (ASCII | UTF8 | Latin1 | Text | Binary | Unknown
lattice with ASCII <: UTF8 <: Text — literally the ASCII→Unicode
causal chain)
- std.bit::Byte
The gap is not substrate — it is consumption. tokenize.dag encodes
reserved individual codepoints as opaque strings (StringEscapeSpec
fields, LocalPunctSpec.pattern, string_literal_delimiter,
line_comment_prefix) and reserved codepoint classes as hidden Rust
predicates (is_ascii_whitespace / is_ascii_digit / is_ascii_alphabetic
/ is_ascii_alphanumeric) `push_str`'d into regen_tokenize.rs, rather
than consuming the canonical Char / std.unicode authorities. Parallel
misuse in dsl/extdeps/languages/dag/syntax.dag (OperatorSpec.symbol,
dag_keyword_set keys).
The only missing substrate piece is a CharClass taxonomy for
tokenization (Whitespace | Digit | IdentStart | IdentContinue), with
natural home as a sibling to DisplayWidth in std.unicode.
Reframes the tokenize.dag header scaffold note and the ROADMAP debt
row as a consumption-gap receipt that names the existing authorities,
the misuse points, and the single missing substrate piece, and carves
the concrete follow-up lane (add CharClass + predicates; retype
opaque-string fields; rewire regen_tokenize).
Goal is faithful consumption of an existing borrow, not
re-implementing Unicode in .dag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5b99ea5 to
663d972
Compare
…mment The widened scaffold note in `src/v3/compiler/tokenize.dag` added header comment lines, shifting span positions in the parse-output debug serialization. Item count and debug-byte length are unchanged (33 items, 95348 bytes); only the fnv1a64 hash shifts from `4da47ab3d20957f3` to `c93633f314d1062d`. Refreshed via `cargo test -p v3-compiler refresh_handwritten_parse_snapshot_manifest -- --ignored`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Verdict: APPROVE — docs-only change. The scaffold note is tracked correctly: documented (both in |
|
Review metadata
APPROVE Diff is docs-only, and the new |
Summary
Discovery pass found that the character-level authorities
tokenize.dagwould consume already exist indsl/std/and are imported cross-tree today (src/v3/compiler/regen.dag:3importsstd.types):std.types::Char = Int— Unicode scalar, U+0000–U+10FFFFstd.string_type::String = FreeMonoid<Char>std.unicode—DisplayWidth,UnicodeBlock, block/width classificationstd.encoding—ASCII | UTF8 | Latin1 | Text | Binary | Unknownlattice withASCII <: UTF8 <: Text(literally the ASCII→Unicode causal chain)std.bit::ByteThe gap is not substrate — it is consumption.
tokenize.dagencodes reserved individual codepoints as opaque strings (StringEscapeSpecfields,LocalPunctSpec.pattern,string_literal_delimiter,line_comment_prefix) and reserved codepoint classes as hidden Rust predicates (is_ascii_whitespace/is_ascii_digit/is_ascii_alphabetic/is_ascii_alphanumeric)push_str'd intoregen_tokenize.rs, rather than consuming the canonicalChar/std.unicodeauthorities. Parallel misuse indsl/extdeps/languages/dag/syntax.dag(OperatorSpec.symbol,dag_keyword_setkeys).The only missing substrate piece is a
CharClasstaxonomy for tokenization (Whitespace | Digit | IdentStart | IdentContinue), with natural home as a sibling toDisplayWidthinstd.unicode.What this PR changes
Docs-only. Two edits:
src/v3/compiler/tokenize.dagheader — reframes the character-level scaffold note as a consumption gap. Enumerates the two parallel non-canonical forms (opaque-string codepoints, hidden Rust class predicates), names the existing authorities to consume, names the single missing substrate delta (CharClasstaxonomy), and carves the three-step follow-up lane.ROADMAP.mdpost-merge debt (2026-04-22) — matching debt row pointing at the scaffold note, naming the existing authorities, enumerating the misuse points in bothtokenize.dagandsyntax.dag, and listing the follow-up lane steps (addCharClass+ predicates; retype opaque-string fields; rewireregen_tokenize).No structural rewrite in this PR. The follow-up lane is marked ready-to-dispatch in ROADMAP.
Test plan
grepfor existingstd.types::Charandstd.unicodereferences confirms the authorities exist and are imported cross-tree🤖 Generated with Claude Code