Feat/runner native regex slice4#450
Merged
Merged
Conversation
…lace/.replaceAll) Differential oracle certifying the ReferenceRunner as the neutral 3rd leg (ref === ts === py === expected) for the two string/array-RESULT regex ops the dual emitters already support: <str>.split(/re/) -> string[] and <str>.replace/.replaceAll(/re/, "lit") -> string. Every expected value was verified empirically on the real pipeline (node V8 + python3 CPython 3.11) via the shipped TS+PY emitters on 2026-06-19. RED-at-base: 46 fail (need the runner impl) / 16 pass (abstain rows already correct). Discriminating fixtures: capture interleave; non-participating capture -> null; $0 literal; $10 trailing-digit disambiguation; zero-width replace certifies; nullable-alternation /g + /m-anchor-over-\r diverge (fence); surrogate subject abstain; split terminal-tag boundary.
Make the ReferenceRunner EXECUTE <str>.split(/re/) -> string[] and <str>.replace/.replaceAll(/re/, "lit") -> string as the neutral 3rd leg of 3-way parity. Mirrors the slice-3 gate/eval/route structure; reuses the shared emitter validators (isZeroWidthCapableRegex, regexCaptureMeta, validateReplStringForTS) so parity holds by construction. Fences (all empirically verified node+python3): split RE-ADMITs limit/zero-width/ backref; replace RE-ADMITs non-literal-repl / bad-$-surface / replaceAll-no-g via the shared validator; replace/replaceAll fence top-level alternation (nullable /g diverges); BOTH abstain on a surrogate subject and on a /m anchor over a non-\n line terminator. split binding is terminal-tagged; replace binding is a plain string. Bare-dot refinement: a bare `.` diverges only over a \r/LS/PS SUBJECT (JS . excludes them, Python . excludes only \n) — so it is a SUBJECT fence (assertNoBareDotLineTerminatorDivergence), parallel to the /m fence, NOT a blanket pattern reject; a bare dot over a clean subject certifies. Oracle hardened with the no-/m bare-dot-\r rows that a competitive build (codex) missed by checking only /m. slice-4 oracle 64/64; slice-1/2/3 31/38/43 unchanged; tsc + biome clean.
3e25045 to
aa0301b
Compare
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.
What
Why
How
Checklist
tsc -bpassespnpm testpassespnpm test:kernpassespnpm lintpasseskern review packages/ --recursivechecked