Repository navigation
fix(javascript): decline NUL source-map matching paths - #7729
HeadmasterEggy wants to merge 1 commit into
Conversation
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR marks decoded source-map paths containing NUL as unresolved without discarding the declarations or their content evidence.
Reviews (1) · Last reviewed commit: "fix(javascript): decline NUL source-map ..." · Reviewed by Greptile |
|
TL;DR: I ran the test file for this fix on three Node versions, and all 14 tests pass at the head. With the old I ran
Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/acceptance/applications/sourceMapPrefixCli.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
The shared source-map path reader now marks NUL-bearing matching paths unresolved while retaining the source declaration and content. This landed in #12161. Thanks for the original regression coverage. |
Summary
Source-map declarations such as
bad%00.tscurrently become usable matching paths containing a NUL byte. These cannot name filesystem entries. Retain the declaration and content evidence, but mark that path interpretation unresolved.Change and scope
The shared source-map path producer owns the correction. URL identity resolution remains unchanged. Existing source comparison and feature-seed consumers already skip unresolved path facts; source-content digests remain available independently. No downstream repair or new abstraction is needed.
Ordinary local static-analysis fix; no new provider or execution capability, so a separate maintainer scope decision is not applicable. Tool/schema shapes, installation and generated outputs are unchanged. Effects: read selected local artifacts through existing CLI/MCP analysis; no additional execution, network or mutation authority.
Evidence
2b8fb387b, the new public CLI and stdio MCP regressions both failed:root%00/original.tsproduced{kind:"artifact-relative", path:"root\u0000/original.ts"}.After: both return
{kind:"unresolved", reason:"Source reference contains a NUL byte and cannot name a filesystem path."}.sourceRoot. Controls preserve ordinary paths and decodeliteral%2500.tsexactly once to the valid literal spellingliteral%00.ts.Executed on macOS with Node 24.22.1 / npm 11.16.0:
npm run test:focused -- tests/acceptance/applications/sourceMapPrefixCli.test.ts src/domain/javascript/sourceToBundleComparison.test.ts: 39 passed.npm run check:fast: passed, including a fresh pre-push run.git diff --check: passed.This establishes incorrect path facts and their correction, not a crash or exploitable filesystem operation. Fixtures are generated source maps; no real browser capture, native Windows IO or Hopper/Ghidra execution was run. Existing consumer behavior was inspected in source; no new end-to-end comparison-performance claim is made.
Remote verification for head
47dd004fe00fe194cf947e4ec143f0a34a36b81e: CI run 40652752493 passed, including all eight portable test shards, source tests, static checks, build, documentation, real JavaScript recovery, and the Linux x64 native package baseline. Greptile reported no blocking findings. Unselected provider/platform lanes were skipped; this does not establish native Windows execution or real browser source-map capture. Draft author-readiness checks do not attest to human review.Merge Danger
Door: two-way
Blast Radius: narrow
Only decoded NUL source-map path interpretations change. Original declaration identities and content evidence remain admitted.
Author readiness
Human owner: @HeadmasterEggy