[PR #6472] [CLOSED] fix(source-maps): preserve pathless HTTP context authority #7360

Closed
opened 2026-11-01 21:47:19 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6472
Author: @WenyuChiou
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/source-map-pathless-context-6435


📝 Commits (4)

  • c5c0582 fix(source-maps): preserve pathless HTTP context authority
  • b1b4351 fix(source-maps): preserve pathless HTTP context authority
  • 8927f1f fix(source-maps): preserve pathless HTTP context authority
  • a9f64ad fix(source-maps): preserve pathless HTTP context authority

📊 Changes

4 files changed (+123 additions, -14 deletions)

View changed files

📝 src/domain/javascript/javascriptSourceMapPaths.ts (+13 -1)
📝 src/javascript/sourceMaps/DecodedSourceMap.ts (+6 -3)
📝 src/javascript/sourceMaps/TraceSourceMap.test.ts (+77 -0)
📝 tests/acceptance/webSourceLocationCli.test.ts (+27 -10)

📄 Description

Summary

Fixes #6435. Keep the selected HTTPS authority when a source-map context has no path, while retaining the caller's literal url_context in Evidence.

Problem and expected behavior

For sources: ["original.ts"], https://app.test succeeded with https:///original.ts; the equivalent https://app.test/ correctly returned https://app.test/original.ts. The locked codec strips the map filename at the last literal slash, so a pathless authority was mistaken for a filename.

Change and scope

Adapt HTTP(S) contexts to a parsed directory URL at the codec input boundary. Share that adaptation with the source-declaration resolver used by browser byte-budget preflight, keeping accounting and decoding consistent. Do not modify the dependency or repair output URLs. Leave virtual/file contexts to their existing codec semantics, and retain original map text, declarations and literal context in Evidence.

This is an ordinary correction within the existing local source-map workflow; a new maintainer scope decision is not applicable. No fetching, provider or target execution is added.

Contract and boundary impact

  • Semantic owner: HTTP(S) context adaptation before TraceMap source resolution.
  • CLI/MCP schemas and tool catalogs: unchanged; existing resolved-source values are corrected.
  • Evidence/provenance: literal URL context and declarations unchanged; absolute sources/sourceRoot may still select another authority.
  • Provider/platform/cleanup: no provider protocol, launch or ownership changes.
  • Generated metadata/package/installation: none.

Expected existing workflow effects:

  • Read existing files or captured data.
  • Launch or attach to a process (existing owned source-map codec subprocess).
  • Inject instrumentation or run target scripts/code.
  • Contact network services.
  • Recover protected code or work around protections.

Evidence and regression coverage

Executed on Linux with pinned Node 24.18.0 and npm 11.16.0, using only synthetic local manifest/script/map artifacts.

  • On unchanged production base e32a0494d42dedd5e79ca341d20c53f07479d9bb, the extended actual CLI + initialized stdio MCP test produced 2 failed / 2 passed. Both interfaces reported https:///original.ts for pathless and query-only contexts; filename and trailing-slash controls passed.
  • Expected fixed result: url_context: "https://app.test" and resolved_url: "https://app.test/original.ts".
  • Producer controls cover HTTP port, query containing slashes, virtual/file contexts, absolute sources, absolute/relative sourceRoot, and indexed maps. The shared preflight resolver is compared with actual decoding.
  • No browser, live service, real analysis provider, target, private artifact or credential was used. These synthetic artifacts do not establish real-provider behavior or other host-platform coverage.

Validation performed

  • npm run test:focused -- tests/acceptance/webSourceLocationCli.test.ts tests/boundary/mcp/webSourceLocationMcp.test.ts — 6 passed (actual compiled CLI/stdio MCP plus SDK boundary tests); final rerun passed.
  • npm run test:focused -- src/javascript/sourceMaps/TraceSourceMap.test.ts src/application/WebSourceLocationService.test.ts src/browser/WebSourceMapFetcher.test.ts tests/boundary/filesystem/sourceToBundlePaths.test.ts tests/boundary/process/sourceMapUncHosts.test.ts — 136 passed across 5 files.
  • npm run check — passed: typecheck, lint (0 errors), formatting, knip, metadata, module boundaries and architecture guards. An initial test timeout-overload type error was corrected before this final pass.
  • Runtime build prerequisites passed. git diff --check passed.
  • Independent review of the exact tested commit/tree found no blocking or remaining actionable findings. Full deterministic CI suite and real-provider lanes not run locally.

Compatibility, safety, and release

No schema migration or package change. HTTP(S) directories now follow URL parsing before the pinned codec resolves declarations; non-HTTP(S) context handling remains unchanged. No new network, target-execution or mutation authority.

Author readiness

Human owner: @WenyuChiou

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Draft for human ownership/review; no merge requested or performed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6472 **Author:** [@WenyuChiou](https://github.com/WenyuChiou) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/source-map-pathless-context-6435` --- ### 📝 Commits (4) - [`c5c0582`](https://github.com/morluto/rea/commit/c5c0582bd77370ff2bd45dbfb70acc1aa91295e8) fix(source-maps): preserve pathless HTTP context authority - [`b1b4351`](https://github.com/morluto/rea/commit/b1b4351b1a8650448b86af9d215e9b99eefe80e2) fix(source-maps): preserve pathless HTTP context authority - [`8927f1f`](https://github.com/morluto/rea/commit/8927f1ff11fdeeea23cbae1526d15acf545094d7) fix(source-maps): preserve pathless HTTP context authority - [`a9f64ad`](https://github.com/morluto/rea/commit/a9f64ad114a50a7b20ceb9e1f82897403a55e44b) fix(source-maps): preserve pathless HTTP context authority ### 📊 Changes **4 files changed** (+123 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSourceMapPaths.ts` (+13 -1) 📝 `src/javascript/sourceMaps/DecodedSourceMap.ts` (+6 -3) 📝 `src/javascript/sourceMaps/TraceSourceMap.test.ts` (+77 -0) 📝 `tests/acceptance/webSourceLocationCli.test.ts` (+27 -10) </details> ### 📄 Description ## Summary Fixes #6435. Keep the selected HTTPS authority when a source-map context has no path, while retaining the caller's literal `url_context` in Evidence. ## Problem and expected behavior For `sources: ["original.ts"]`, `https://app.test` succeeded with `https:///original.ts`; the equivalent `https://app.test/` correctly returned `https://app.test/original.ts`. The locked codec strips the map filename at the last literal slash, so a pathless authority was mistaken for a filename. ## Change and scope Adapt HTTP(S) contexts to a parsed directory URL at the codec input boundary. Share that adaptation with the source-declaration resolver used by browser byte-budget preflight, keeping accounting and decoding consistent. Do not modify the dependency or repair output URLs. Leave virtual/file contexts to their existing codec semantics, and retain original map text, declarations and literal context in Evidence. This is an ordinary correction within the existing local source-map workflow; a new maintainer scope decision is not applicable. No fetching, provider or target execution is added. ## Contract and boundary impact - Semantic owner: HTTP(S) context adaptation before `TraceMap` source resolution. - CLI/MCP schemas and tool catalogs: unchanged; existing resolved-source values are corrected. - Evidence/provenance: literal URL context and declarations unchanged; absolute sources/sourceRoot may still select another authority. - Provider/platform/cleanup: no provider protocol, launch or ownership changes. - Generated metadata/package/installation: none. Expected existing workflow effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process (existing owned source-map codec subprocess). - [ ] Inject instrumentation or run target scripts/code. - [ ] Contact network services. - [ ] Recover protected code or work around protections. ## Evidence and regression coverage Executed on Linux with pinned Node 24.18.0 and npm 11.16.0, using only synthetic local manifest/script/map artifacts. - On unchanged production base `e32a0494d42dedd5e79ca341d20c53f07479d9bb`, the extended actual CLI + initialized stdio MCP test produced **2 failed / 2 passed**. Both interfaces reported `https:///original.ts` for pathless and query-only contexts; filename and trailing-slash controls passed. - Expected fixed result: `url_context: "https://app.test"` and `resolved_url: "https://app.test/original.ts"`. - Producer controls cover HTTP port, query containing slashes, virtual/file contexts, absolute sources, absolute/relative sourceRoot, and indexed maps. The shared preflight resolver is compared with actual decoding. - No browser, live service, real analysis provider, target, private artifact or credential was used. These synthetic artifacts do not establish real-provider behavior or other host-platform coverage. ## Validation performed - `npm run test:focused -- tests/acceptance/webSourceLocationCli.test.ts tests/boundary/mcp/webSourceLocationMcp.test.ts` — 6 passed (actual compiled CLI/stdio MCP plus SDK boundary tests); final rerun passed. - `npm run test:focused -- src/javascript/sourceMaps/TraceSourceMap.test.ts src/application/WebSourceLocationService.test.ts src/browser/WebSourceMapFetcher.test.ts tests/boundary/filesystem/sourceToBundlePaths.test.ts tests/boundary/process/sourceMapUncHosts.test.ts` — 136 passed across 5 files. - `npm run check` — passed: typecheck, lint (0 errors), formatting, knip, metadata, module boundaries and architecture guards. An initial test timeout-overload type error was corrected before this final pass. - Runtime build prerequisites passed. `git diff --check` passed. - Independent review of the exact tested commit/tree found no blocking or remaining actionable findings. Full deterministic CI suite and real-provider lanes not run locally. ## Compatibility, safety, and release No schema migration or package change. HTTP(S) directories now follow URL parsing before the pinned codec resolves declarations; non-HTTP(S) context handling remains unchanged. No new network, target-execution or mutation authority. ## Author readiness Human owner: @WenyuChiou - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. Draft for human ownership/review; no merge requested or performed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7360
No description provided.