Repository navigation
fix(javascript): preserve and resolve complete source-map URLs - #1788
Conversation
Keep line-comment URL declarations intact and percent-decode local URL paths once, preserving raw Evidence identity and artifact-root confinement. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
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. |
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed the two producer fixes and public CLI/stdio-MCP regressions; both failed on the affected base. Raw URL/digest/ranges and distinct observations remain intact, while local URL paths decode once and retain existing external/confinement/invalid-byte guards. The shared Worker/service-worker callers are covered too. Relevant suites passed 133/133, final affected scenarios and main integration passed, and static checks passed. Two independent source reviews found no blockers. Waiting for current-head CI and automated review before merge; no native target execution claim.
Summary
Keep complete source-map URL evidence and resolve percent-encoded local paths to the selected map. Fixes #1781. Fixes #1782.
Problem and expected behavior
//# sourceMappingURL=app.js.map?variant=a*modernwas truncated at*, collapsing distinct declarations and shortening source ranges.space%20part.js.mapremained encoded during local lookup, reporting an unavailable map despite inventory containingspace part.js.map.The original declaration, SHA-256 and source span must stay intact, while local URL lookup removes query/fragment and percent-decodes the path exactly once.
Change and scope
Line-comment directives terminate at whitespace; the existing block-comment terminator stays unchanged. The owning
url-referencepath boundary reusespercentDecodeUrlPath, preserving literal invalid percent escapes and rejecting decoded NUL/invalid UTF-8. ESM, CommonJS, HTML and filesystem-expression policies are unchanged. These related producer corrections share public CLI/MCP regression coverage.Contract and boundary impact
*is in URL query/fragment.Evidence and regression coverage
Tests added or updated: two compiled CLI + real stdio MCP scenarios for modern/legacy line comments, distinct URLs, SHA-256/ranges/target edges, encoded spaces/percent/Unicode, one-pass decoding, suffixes and literal
%ZZ. The same URL resolver's Worker/service-worker callers preserve encoded specifiers and link literal-space files. Resolver cases preserve rejected outcomes for NUL, invalid UTF-8, encoded separators/dots and traversal. Existing block-comment and 9M/9.5M-character regressions remain.Base reproduction: both new public tests fail on unchanged production at
aaeadf2d4: three star-containing declarations yielded only two reference observations, and the encoded-space reference did not link to its inventoried map.User-visible output:
declared_url/declared_url_sha256remain original;resolved_pathnames the local decoded path,available: true, andmaps_totargets the inventoried map node.Remaining proof gaps: static relationships do not prove target JavaScript executes or debugger/provider behavior. Native Windows execution is not locally available.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run test:focused -- src/domain/javascript/javascriptStaticAnalysisSourceMaps.test.ts src/application/javascript/JavaScriptArtifactPathResolution.test.ts tests/acceptance/applications/applicationWorkflowCli.test.ts— 133/133 passed, including the unchanged capacity regressions.node node_modules/vitest/vitest.mjs run tests/acceptance/applications/applicationWorkflowCli.test.ts -t 'source-map URL'— 2/2 passed (31 unrelated tests intentionally filtered).npm run check— typecheck, lint/module boundaries, formatting, Knip, metadata and architecture guards passed.npm run build:cachedpassed; targeted compiled CLI/MCP source-map scenarios plus the merged Mach-O regression passed 3/3 (40 unrelated tests filtered).Compatibility, safety, and release
Review checklist