[PR #1742] [MERGED] fix(browser): retain effective source-map response urls #4789

Closed
opened 2026-10-31 00:55:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1742
Author: @evenafterallisaid
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/source-map-effective-url


📝 Commits (2)

  • d9bc3dd fix(browser): retain effective source-map response urls
  • faeda51 fix(browser): admit source-map identities before reading response bodies

📊 Changes

9 files changed (+636 additions, -100 deletions)

View changed files

📝 docs/browser-observation.md (+11 -0)
📝 src/browser/WebSourceMapFetcher.ts (+136 -46)
📝 src/domain/webBundleAnalysis.ts (+2 -0)
📝 src/domain/webBundleAnalyzer.test.ts (+1 -0)
📝 tests/boundary/browser/webSourceMapFetcher.test.ts (+193 -45)
📝 tests/boundary/browser/webSourceMapHttpStatus.test.ts (+185 -1)
📝 tests/boundary/mcp/browserMcp.test.ts (+82 -0)
📝 tests/fixtures/fakeCdpBrowser.ts (+25 -8)
📝 tests/fixtures/fakeCdpBrowserTypes.ts (+1 -0)

📄 Description

Retain each source map's declared URL separately from the last approved response URL actually observed, so the result records the base used to resolve original sources. Preserve query values, source artifacts, mappings and module edges. Closes #1729 and #1738.

The browser fetch boundary emits effective_url: string | null for current results. Historical observations may omit the field; parsing does not insert a default or alter their stored identity. An initial policy rejection or failed first fetch emits null, while a rejected redirect retains the last approved response identity.

Charge JSON-escaped response identities before reading response bodies and complete failure diagnostics against the existing 32 MiB output budget. Preserve completed results when another map cannot fit, and report requested/processed coverage with explicit unknown omissions. If response cancellation fails, retain the primary capacity reason, aggregate cleanup cause and resource identity. Price invariant envelopes once rather than serializing them for every map.

Validation on the amended source:

  • 130 browser/fetcher/CDP/MCP tests passed, plus the domain bundle-analysis suite, full single-threaded typecheck, lint, architecture guards and generated-document checks.
  • A real loopback HTTP redirect records the effective resolution URL. The public CLI and SDK MCP fixture workflow preserves query values, authenticates Evidence and checks text/structured delivery parity. The CDP wire is a fixture; this local check does not claim a live Chromium session.
  • A real 1,500-request malformed-Location probe now retains complete failure messages within the output limit and marks remaining results unknown.
  • An injected finite-response probe with an escaped URL exceeding output capacity now reads zero body bytes and cancels immediately; regression cases cover successful cancellation and rejection with both an Error and undefined.
  • Both the original 50,000-map origin, whose expanded result exceeds capacity, and a shorter origin whose complete result fits remain covered. No input-size reduction is reported as a performance improvement.
  • Flameox identified repeated fixed-envelope serialization as a production CPU hotspot. The complete result oracle was preserved in the measured consolidation experiment; no general CLI speed or token-reduction percentage is claimed.

CI verifies the amended exact head before merge, including real browser and native package lanes. No installation, executable mutation or browser interaction authority changed. Generated catalogs, build outputs and profiles are not committed; the temporary profiling environment has been removed.


🔄 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/1742 **Author:** [@evenafterallisaid](https://github.com/evenafterallisaid) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/source-map-effective-url` --- ### 📝 Commits (2) - [`d9bc3dd`](https://github.com/morluto/rea/commit/d9bc3ddaede91449572f5fe13a5adc489f97417d) fix(browser): retain effective source-map response urls - [`faeda51`](https://github.com/morluto/rea/commit/faeda516a9a2036e6d485f434f5838b5a586643d) fix(browser): admit source-map identities before reading response bodies ### 📊 Changes **9 files changed** (+636 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `docs/browser-observation.md` (+11 -0) 📝 `src/browser/WebSourceMapFetcher.ts` (+136 -46) 📝 `src/domain/webBundleAnalysis.ts` (+2 -0) 📝 `src/domain/webBundleAnalyzer.test.ts` (+1 -0) 📝 `tests/boundary/browser/webSourceMapFetcher.test.ts` (+193 -45) 📝 `tests/boundary/browser/webSourceMapHttpStatus.test.ts` (+185 -1) 📝 `tests/boundary/mcp/browserMcp.test.ts` (+82 -0) 📝 `tests/fixtures/fakeCdpBrowser.ts` (+25 -8) 📝 `tests/fixtures/fakeCdpBrowserTypes.ts` (+1 -0) </details> ### 📄 Description Retain each source map's declared URL separately from the last approved response URL actually observed, so the result records the base used to resolve original sources. Preserve query values, source artifacts, mappings and module edges. Closes #1729 and #1738. The browser fetch boundary emits `effective_url: string | null` for current results. Historical observations may omit the field; parsing does not insert a default or alter their stored identity. An initial policy rejection or failed first fetch emits null, while a rejected redirect retains the last approved response identity. Charge JSON-escaped response identities before reading response bodies and complete failure diagnostics against the existing 32 MiB output budget. Preserve completed results when another map cannot fit, and report requested/processed coverage with explicit unknown omissions. If response cancellation fails, retain the primary capacity reason, aggregate cleanup cause and resource identity. Price invariant envelopes once rather than serializing them for every map. Validation on the amended source: - 130 browser/fetcher/CDP/MCP tests passed, plus the domain bundle-analysis suite, full single-threaded typecheck, lint, architecture guards and generated-document checks. - A real loopback HTTP redirect records the effective resolution URL. The public CLI and SDK MCP fixture workflow preserves query values, authenticates Evidence and checks text/structured delivery parity. The CDP wire is a fixture; this local check does not claim a live Chromium session. - A real 1,500-request malformed-Location probe now retains complete failure messages within the output limit and marks remaining results unknown. - An injected finite-response probe with an escaped URL exceeding output capacity now reads zero body bytes and cancels immediately; regression cases cover successful cancellation and rejection with both an Error and undefined. - Both the original 50,000-map origin, whose expanded result exceeds capacity, and a shorter origin whose complete result fits remain covered. No input-size reduction is reported as a performance improvement. - Flameox identified repeated fixed-envelope serialization as a production CPU hotspot. The complete result oracle was preserved in the measured consolidation experiment; no general CLI speed or token-reduction percentage is claimed. CI verifies the amended exact head before merge, including real browser and native package lanes. No installation, executable mutation or browser interaction authority changed. Generated catalogs, build outputs and profiles are not committed; the temporary profiling environment has been removed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:04 +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#4789
No description provided.