[GH-ISSUE #195] fix(domain): treat source-map extension case-insensitively in artifact edge mapping #140

Closed
opened 2026-10-15 18:21:34 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/195

Problem

When building artifact edges, createArtifactEdges and relationFor identify source-map files with case-sensitive checks.

  • src/application/ArtifactGraphConstruction.ts:206 checks occurrence.logical_path.endsWith(".map").
  • src/application/ArtifactGraphConstruction.ts:340 checks if (lower.endsWith(".map")) where lower is precomputed as path.toLowerCase(), but that helper is not used for the .endsWith(".map") checks above.

Files named MAIN.JS.MAP (or mixed-case .Map) are currently treated as generic contains edges, and mapped-source lookup for the parent artifact fails because it slices logical_path using the same case-sensitive suffix.

Repro

  1. Produce an artifact containing a source map with upper/mixed-case suffix (for example main.js.MAP) and its source file main.js.
  2. Run inventory_artifact and inspect edges.items in the returned graph.
  3. The source-map edge is not reported as maps-source and parent-child inference is lost.

Expected

Source-map relation inference should be case-insensitive and consistent with file classification (which already lowercases paths for extension checks), so .map variants still map to their source file.

Originally created by @morluto on GitHub (Jul 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/195 ## Problem When building artifact edges, `createArtifactEdges` and `relationFor` identify source-map files with case-sensitive checks. - `src/application/ArtifactGraphConstruction.ts:206` checks `occurrence.logical_path.endsWith(".map")`. - `src/application/ArtifactGraphConstruction.ts:340` checks `if (lower.endsWith(".map"))` where `lower` is precomputed as `path.toLowerCase()`, but that helper is not used for the `.endsWith(".map")` checks above. Files named `MAIN.JS.MAP` (or mixed-case `.Map`) are currently treated as generic `contains` edges, and mapped-source lookup for the parent artifact fails because it slices `logical_path` using the same case-sensitive suffix. ## Repro 1. Produce an artifact containing a source map with upper/mixed-case suffix (for example `main.js.MAP`) and its source file `main.js`. 2. Run `inventory_artifact` and inspect `edges.items` in the returned graph. 3. The source-map edge is not reported as `maps-source` and parent-child inference is lost. ## Expected Source-map relation inference should be case-insensitive and consistent with file classification (which already lowercases paths for extension checks), so `.map` variants still map to their source file.
bsakaguchi 2026-10-15 18:21:34 +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#140
No description provided.