GeezerVison is showing github.com — PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is · Issue #761 · developing-today/code
PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is #761Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus:done DescriptionFinding
Open draft PR #759 ("fix(web): match world surface presenter validation with rust wire rules", head 75a4be64) claims Fixes #724, but its terminal-width measurement in pkgs/id/web/src/world-surface.ts mis-measures every wide glyph outside the BMP, plus ZWJ emoji sequences and ⚠️ — so it still diverges from the Rust validator in both directions, and merging it as-is would auto-close #724 with its own acceptance criteria ("ZWJ grapheme clusters handled as one grapheme", "width measurement matches Rust's unicode-width semantics") unmet for those cases.
Evidence
PR head (cross-checked via gh api contents?ref=75a4be64):
const isEastAsianWide =
/[\u1100-\u115F\u2329\u232A\u2E80-\u303E\u3040-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uA960-\uA97F\uAC00-\uD7A3\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE6F\uFF01-\uFF60\uFFE0-\uFFE6]/;
const terminalWidth = isEastAsianWide.test(cell.symbol) ? 2 : 1;
All ranges in the regex are BMP-only. Probed the exact regex + Intl.Segmenter grapheme split in Node (each symbol is exactly 1 grapheme, so the grapheme-count check passes and the width check decides):
| Symbol |
PR #759 width |
Rust unicode-width 0.2 width |
| 😀 U+1F600 |
1 |
2 |
| 𠮷 U+20BB7 (CJK Ext. B) |
1 |
2 |
| 👨👩👧 (ZWJ sequence) |
1 |
2 |
| ⚠️ U+26A0 U+FE0F |
1 |
2 |
| 界 U+754C |
2 |
2 |
| x |
1 |
1 |
Rust side ground-truthed two ways: pkgs/id/src/world_presentation.rs:219,350 requires UnicodeWidthStr::width(symbol) == columns with unicode-width = "0.2" (pkgs/id/Cargo.toml:90), and a scratch cargo program against the real unicode-width 0.2 crate printed width 2 for all four failing symbols above.
Consequences, mirroring #724's original failure modes:
The PR's new tests in world-surface.test.ts cover only BMP cases (界, x, ab, ""), so none of this is caught. Separately, the PR also drops "configVersion": 1 from pkgs/id/web/bun.lock — unrelated lockfile churn that should not ride along.
Dedupe
#724 is the parent finding and is still open; this issue is specifically about PR #759's implementation shortfall and its Fixes #724 closure. Searches for emoji/unicode-width/astral issues return only #724. Cross-repo: world-surface.ts exists only in this repo.
Acceptance criteria
Activitydeveloping-today commented on Oct 24, 2026 dezren39 commented on Oct 24, 2026 id train triage (2026-10-24): needs-decision — Muse: assign to Session A (phases 0-10 review); PR #759's width check mis-measures astral-plane/ZWJ/emoji glyphs vs Rust unicode-width. dezren39 commented on Oct 26, 2026 Intake review — fleet monitor, 2026-10-26T08:26:24Z.
Still live — verified this run: PR #759 is still OPEN and draft; its head has moved to 8c0f035d, and pkgs/id/web/src/world-surface.ts at that head (line ~134) still computes terminalWidth = isEastAsianWide.test(cell.symbol) ? 2 : 1 with the same BMP-only regex ranges the issue quotes. Astral-plane, ZWJ and ⚠️ symbols are still measured 1 against Rust unicode-width 0.2's 2. Nothing has merged that fixes this, and #724 is still open.
Related: parent finding #724; PR #759 (shepherded by live queue task 1063's sibling task 1058, repo-health-code-pilot); the PR also still needs the unrelated bun.lock configVersion churn addressed before merge.
Suggested approach: fix the width function on PR #759 itself (count width per grapheme with a range table that includes astral planes, ZWJ sequences measured as one cluster, and VS16 emoji presentation), add the issue's six-symbol table as tests, and only then let Fixes #724 stand. Do not merge #759 as-is — it would auto-close #724 with its acceptance criteria unmet.
Risks: merging first and fixing later loses the tracking thread (the parent closes silently); the fix is small and belongs in the same PR. added app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/sSmall: expected under 2 hours of work kind/bugSomething isn't working (prefixed form of the classic bug label) meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Oct 26, 2026dezren39 commented on Oct 26, 2026
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus:done DevelopmentNo branches or pull requestsIssue actions
|