Skip to content

feat(bedside): structural Unicode text classes and golden corpus (BA-W01 L6) - #11785

Merged
dezren39 merged 1 commit into
mainfrom
feat/ba-w01-l6-unicode
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
feat/ba-w01-l6-unicode

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: the server stripped every format character from names and steering text, so an emoji ZWJ family or a tag flag in a store name or request came out broken, and the browser removed every zero-width joiner. Comments were stored with no structural check at all, so a lone surrogate or a control character went in as written. Variant IDs refused control and format characters but accepted a lone surrogate.

After: worker/text.mjs has three classes. Names keep emoji sequences and a ZWNJ between letters and drop other invisible characters. Comments are refused (400) only for an unpaired surrogate or a control character other than tab and line breaks, and keep emoji as written. Identifiers refuse control and format characters and unpaired surrogates. The browser keeps emoji sequences too. tests/unicode-corpus.json is the golden corpus (41 cases).

How: the API's clean now uses name, validateNewRecords checks new and edited note text with isComment, steering's text clean-up uses visible, and variant IDs use isIdentifier. The browser builds its regex with the v flag in a try, falling back to the old behaviour where unsupported. tests/unicode.mjs runs the corpus and an API round trip; scripts/check.mjs covers the browser clean-up. All 19 test files pass.

Closes #11755.


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…W01 L6)

worker/text.mjs defines identifier, name and comment classes. Names
keep emoji sequences (ZWJ families, tag flags) and a ZWNJ between
letters while dropping other invisible characters; comments refuse
only unpaired surrogates and control characters other than tab and
line breaks; identifiers refuse every control and format character
and unpaired surrogates. The API cleans names with it, refuses
malformed new or edited comments, and steering text keeps emoji. The
browser's blanket ZWJ removal is gone. tests/unicode-corpus.json is
the golden corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 11:38
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 11:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T11:39:43.223232Z 46e7770 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit a6ac34a into main Nov 18, 2026
@dezren39
dezren39 deleted the feat/ba-w01-l6-unicode branch November 18, 2026 11:38
@dezren39 dezren39 added the app/bedside-and-away Package/app: bedside-and-away (pkgs/ or apps/ in this repo) label Nov 18, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/bedside-and-away Package/app: bedside-and-away (pkgs/ or apps/ in this repo)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BA-W01 L6: Unicode structural validator

2 participants