[PR #2034] [MERGED] test(sourcemap): consolidate source map regressions #4976

Closed
opened 2026-10-31 00:57:37 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2034
Author: @xu91102
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/source-map-unnamed-sources


📝 Commits (4)

  • 401189e fix(sourcemap): retain named originals beside unknown source names
  • c0cd5ec test(sourcemap): merge main and retain unnamed-source regressions
  • 0783011 test(sourcemap): consolidate nullable source map regressions
  • bbcacd9 test(sourcemap): sync consolidated regressions with main

📊 Changes

2 files changed (+90 additions, -11 deletions)

View changed files

📝 tests/acceptance/applications/sourceMapPrefixCli.test.ts (+90 -10)
📝 tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts (+0 -1)

📄 Description

Summary

The standalone null-content and unnamed-source acceptance files repeat the existing source-map journeys. Keep their distinct controls and assertions in sourceMapPrefixCli.test.ts, and replace a weaker malformed-name boundary row with a CLI/MCP rejection scenario that also checks that later named entries do not leak into the graph.

Refs #2023 and #2024. The production nullable-source fixes are already on main in ee50ed121e; this PR updates existing regression coverage.

Problem and expected behavior

A valid map may contain absent embedded content or unnamed slots without losing its named declarations, source indices or artifact identity. A malformed non-string source name must reject the map explicitly and must not invent any originals. Those assertions should live in the existing public workflows without duplicate positive fixtures.

Change and scope

  • Expand the existing nullable journey with both embedded and unembedded unnamed slots, real TraceMap controls, aligned source/declaration indices, content availability and digests, original map bytes and complete coverage.
  • Assert exactly three known originals across the three valid maps, including their distinct map digests, so extra fabricated original nodes fail the test.
  • Exercise [42, "discarded.ts"] through CLI and stdio MCP separately from valid maps, checking partial coverage, the rejection reason, provenance, unchanged bytes and zero original nodes.
  • Remove the boundary matrix's superseded single [42] row. Other malformed-content, cardinality and reconstruction cases remain.

Contract and boundary impact

  • Semantic owner and earliest changed stage: existing retained source-map acceptance and filesystem boundary tests; production parsing is unchanged.
  • CLI and MCP/tool-catalog contract: unchanged; both compiled public surfaces are exercised.
  • Provider, bridge, target-format, or platform compatibility: unchanged; use the existing trace-mapping dependency.
  • Evidence, artifact, provenance, or reconstruction contract: preserve unknown slots, aligned content, map/source digests, source identity and malformed-map limitations.
  • Process execution, authorization, cleanup, or containment impact: existing owned temporary-directory cleanup and CLI/MCP harness retained.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests updated: sourceMapPrefixCli.test.ts and javascriptArtifactReconstruction.test.ts; no new test file.

  • Base evidence: the issue fixtures originally reproduced lost declarations on 2ff850de68. The current main already contains their production fix and overlapping acceptance coverage; this diff consolidates the useful additional assertions.

  • User-visible CLI/MCP output: named originals and explicit unnamed observations are retained for valid maps; malformed names expose an unknown parse observation with partial coverage and no invented original.

  • Remaining proof gaps: full deterministic CI and other operating systems are pending; no live browser or native provider run.

  • 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

Executed with Node 24.18.0 / npm 11.16.0 on macOS arm64:

  • npm run test:focused -- tests/acceptance/applications/sourceMapPrefixCli.test.ts tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts src/javascript/sourceMaps/TraceSourceMap.test.ts tests/boundary/filesystem/javascriptSourceMapLocations.test.ts src/domain/sourceMapEnvelope.test.ts — final diff: 54 tests / 5 files passed.
  • npm run check — final diff: all 6 tasks and architecture guards passed; 844 lint warnings, 0 errors.
  • npm run verify:test-discovery — final base: 909 test files discovered exactly once.
  • Independent Standards and Spec review of the final diff — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: compiled CLI and stdio MCP on macOS; no browser/native provider or cross-platform run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: only existing test fixtures and assertions change; no production authorization or external provider changes.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed (no production contract changes).
  • User-visible CLI/MCP assertions cover representative valid and rejected evidence.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/2034 **Author:** [@xu91102](https://github.com/xu91102) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/source-map-unnamed-sources` --- ### 📝 Commits (4) - [`401189e`](https://github.com/morluto/rea/commit/401189ee6f4c729ba8bfbfe067fae02fb60d24f1) fix(sourcemap): retain named originals beside unknown source names - [`c0cd5ec`](https://github.com/morluto/rea/commit/c0cd5ecdaac3ee887fba9400b2ae57f14ca4cc41) test(sourcemap): merge main and retain unnamed-source regressions - [`0783011`](https://github.com/morluto/rea/commit/078301120ee86cac2a5b24d741ceb54f11542d31) test(sourcemap): consolidate nullable source map regressions - [`bbcacd9`](https://github.com/morluto/rea/commit/bbcacd95c46e3daa27df11cb7adcdd718a1081fc) test(sourcemap): sync consolidated regressions with main ### 📊 Changes **2 files changed** (+90 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `tests/acceptance/applications/sourceMapPrefixCli.test.ts` (+90 -10) 📝 `tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts` (+0 -1) </details> ### 📄 Description ## Summary The standalone null-content and unnamed-source acceptance files repeat the existing source-map journeys. Keep their distinct controls and assertions in `sourceMapPrefixCli.test.ts`, and replace a weaker malformed-name boundary row with a CLI/MCP rejection scenario that also checks that later named entries do not leak into the graph. Refs #2023 and #2024. The production nullable-source fixes are already on main in ee50ed121e38cc6e1a2ff0dc8b789f15f71c5402; this PR updates existing regression coverage. ## Problem and expected behavior A valid map may contain absent embedded content or unnamed slots without losing its named declarations, source indices or artifact identity. A malformed non-string source name must reject the map explicitly and must not invent any originals. Those assertions should live in the existing public workflows without duplicate positive fixtures. ## Change and scope - Expand the existing nullable journey with both embedded and unembedded unnamed slots, real `TraceMap` controls, aligned source/declaration indices, content availability and digests, original map bytes and complete coverage. - Assert exactly three known originals across the three valid maps, including their distinct map digests, so extra fabricated original nodes fail the test. - Exercise `[42, "discarded.ts"]` through CLI and stdio MCP separately from valid maps, checking partial coverage, the rejection reason, provenance, unchanged bytes and zero original nodes. - Remove the boundary matrix's superseded single `[42]` row. Other malformed-content, cardinality and reconstruction cases remain. ## Contract and boundary impact - Semantic owner and earliest changed stage: existing retained source-map acceptance and filesystem boundary tests; production parsing is unchanged. - CLI and MCP/tool-catalog contract: unchanged; both compiled public surfaces are exercised. - Provider, bridge, target-format, or platform compatibility: unchanged; use the existing trace-mapping dependency. - Evidence, artifact, provenance, or reconstruction contract: preserve unknown slots, aligned content, map/source digests, source identity and malformed-map limitations. - Process execution, authorization, cleanup, or containment impact: existing owned temporary-directory cleanup and CLI/MCP harness retained. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Tests updated: `sourceMapPrefixCli.test.ts` and `javascriptArtifactReconstruction.test.ts`; no new test file. - Base evidence: the issue fixtures originally reproduced lost declarations on 2ff850de68dc9b05c6faf2bbfd26d56bc2d5d27c. The current main already contains their production fix and overlapping acceptance coverage; this diff consolidates the useful additional assertions. - User-visible CLI/MCP output: named originals and explicit unnamed observations are retained for valid maps; malformed names expose an unknown parse observation with partial coverage and no invented original. - Remaining proof gaps: full deterministic CI and other operating systems are pending; no live browser or native provider run. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Executed with Node 24.18.0 / npm 11.16.0 on macOS arm64: - `npm run test:focused -- tests/acceptance/applications/sourceMapPrefixCli.test.ts tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts src/javascript/sourceMaps/TraceSourceMap.test.ts tests/boundary/filesystem/javascriptSourceMapLocations.test.ts src/domain/sourceMapEnvelope.test.ts` — final diff: 54 tests / 5 files passed. - `npm run check` — final diff: all 6 tasks and architecture guards passed; 844 lint warnings, 0 errors. - `npm run verify:test-discovery` — final base: 909 test files discovered exactly once. - Independent Standards and Spec review of the final diff — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: compiled CLI and stdio MCP on macOS; no browser/native provider or cross-platform run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: only existing test fixtures and assertions change; no production authorization or external provider changes. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed (no production contract changes). - [x] User-visible CLI/MCP assertions cover representative valid and rejected evidence. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:37 +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#4976
No description provided.