Repository navigation
test(oracles): freeze scanner, specifier and closure edge cases - #129
Merged
Merged
Conversation
Second slice of the R0 edge-case oracles (#84), for E7 (#116) and R5a (#92): 18 scanner cases (UTF-16 positions, skipped trivia, context-free regex scanning, literal values), 16 module specifier cases and 12 test closure scenarios (resolution order, path keys, UTF-16 path order, packages, links, refusals), each with the exact current output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second slice of the R0 edge-case oracles (#84): the JavaScript scanner, module specifier discovery and the test closure, which E7 (#116) and R5a (#92) move to Rust. The first slice, canonical JSON and digests, is #128.
Three fixtures in
tests/edge-oracles/freeze each input with the exact output the TypeScript implementation produces, or its refusal code:javascript-tokens.json, 18 cases. Each token is[kind, start, end, text], plusvaluefor identifier and literal kinds, the only ones consumers read. The cases cover:#token being skipped;0x1F→31,0xFFn→0xffn,017→15);module-specifiers.json, 16 cases. Every static and dynamic form,require, Bun'smock.module, computed specifiers, escapes,fromacross lines, a semicolon ending the search, and an import hidden behind a regex quote.test-closure.json, 12 scenarios. Each describes an in-memory repository:c.jswins overc.ts);ΑΣ/x.jsreachesας/x.ts, while a per-character lowercase misses it);imports, a workspace package;TEST_CLOSURE_PACKAGE_IMPORT_UNSUPPORTEDandTEST_CLOSURE_TSCONFIG_EXTENDS_UNSUPPORTED.tests/scanner-closure-oracles.test.tsreplays every case and checks:Kinds are recorded by name, not by the numeric value of the TypeScript enum. Refusals are recorded by their product code.
Proof
Ten negative witnesses run in a disposable worktree at
721330a. Each one turns red onERR_ASSERTIONin the designated test, then green after restore:utf16-astral-positionsnumeric-literal-valuestemplate-nestingx.module(...)is an edgemock-moduleimport("a" + x)keeps"a"dynamic-concatenationpath-keys-and-orderpath-keys-and-order.tssource tried before the exact.jsresolution-candidatespackages-and-runner-modulesregex-hides-importremovedkeep every divergence trap…pnpm check: green at721330a: format, lint, schemas, conformance, typecheck, 1044/1044 tests (run alone)7c623ae, candidate721330a, subject digestsha256:8955fbb6…, classifier categorytest_oracles(4 paths).Limits
./café.js) makescomputeTestClosurethrowTypeError: Ambiguous Unicode path segment must use NFCinstead of aTEST_CLOSURE_*refusal. It is left out until [Bug] closure : un specifier non-NFC lève un TypeError brut au lieu d'un refus TEST_CLOSURE_* #130 decides the intended behavior.node:builtin list comes from the running Node version. These cases only use builtins that are stable across versions.Test plan
pnpm checkRefs #84, #116, #92
🤖 Generated with Claude Code