test(tools): pin the U+200C tail/head split; qualify the identifier-equivalence measurement

The docstring names ZWNJ/ZWJ as a skew instance but nothing checked the
predicate's tail-position accept branch; this is its first test, and it
also covers camelCase's Tool-prefix branch for a head that is
XID_Continue but not XID_Start.

The equivalence sentence pinned its evidence to Node 22.23.1 against
CPython 3.9.6 without saying the samples sit inside those two versions'
shared tables, next to five named characters where that same pair
diverges.
This commit is contained in:
Chinesezjc
2026-08-06 02:09:27 +08:00
parent eb3b635796
commit 4f8ba6c190
3 changed files with 38 additions and 8 deletions
+4 -4
View File
@@ -300,10 +300,10 @@ export interface RunCodeBridgeOptions {
/** Resolves `ctx.codeRuntime` or throws the loud misconfiguration error (shared with the registry's assembly-time checks). */
requireRuntime: () => CodeRuntime
/**
* Reads `ctx.codeRuntime` without throwing: `undefined` when none is
* mounted. Lets schema emission tell "no runtime" (degrade to TS; the
* readers that reach it are {@link resolveFlavor}'s) apart from "unknown
* language" (fail loud).
* Reads `ctx.codeRuntime` without throwing: `undefined` when none is mounted.
* Lets schema emission tell "no runtime" (degrade to TS; the readers that
* reach it are {@link resolveFlavor}'s) apart from "unknown language" (fail
* loud).
*/
peekRuntime: () => CodeRuntime | undefined
/** The run's overlap cap for parallel-classified sub-calls (the registry passes its validated `maxParallelSubCalls`). */
+5 -4
View File
@@ -42,10 +42,11 @@ const IDENTIFIER = /^[\p{XID_Start}_]\p{XID_Continue}*$/u
* take the subscript path, which carries their exact bytes.
*
* `IDENTIFIER`'s equivalence to `str.isidentifier()` was measured across 21
* samples with zero divergence, on Node 22.23.1 against CPython 3.9.6. The
* predicate as a whole is deliberately stricter than `isidentifier()`, which
* does not test NFKC stability: `'field'.isidentifier()` is True and this
* returns false.
* samples with zero divergence, on Node 22.23.1 against CPython 3.9.6 — every
* sample sits inside the two versions' shared tables, and the skew characters
* below are exactly where that pair diverges. The predicate as a whole is
* deliberately stricter than `isidentifier()`, which does not test NFKC
* stability: `'field'.isidentifier()` is True and this returns false.
*
* Both conditions are evaluated against the ENGINE's Unicode tables, and the
* two sides are versioned independently — `\p{XID_Start}`/`\p{XID_Continue}`