Repository navigation
fix(artifacts): never treat a directory named *.map as a source map - #4131
Merged
Merged
Conversation
Artifact inventory decided source-map edges from the `.map` path suffix, so an archive directory such as `main.js.map/` received a maps-source edge whose parent was the sibling `main.js`, although the same occurrence was classified as a directory container. Edge construction now uses the occurrence's own artifact_kind, and the duplicate suffix rule in relationFor is removed; such directories are contained by their parent, and real source-map files keep maps-source. Fixes #3909 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
Contributor
[Medium impact] The PR appears safe to merge; it fixes directory containment without breaking ordinary source-map links. SummaryThe PR fixes false source-map relationships for directories named
Reviews (1) · Last reviewed commit: "fix(artifacts): never treat a directory ..." · Reviewed by Greptile |
This was referenced Oct 15, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3909. Artifact inventory gave an archive directory named like a source map, such as
main.js.map/, amaps-sourceedge whose parent was the siblingmain.js. The same occurrence was correctly classified as a directory container. Edges now use the occurrence's own classification, so the directory is contained by its archive. Real source-map files keepmaps-source.Problem and expected behavior
createArtifactEdges(src/artifacts/inventory/ArtifactGraphConstruction.ts) decided "source map" fromlogical_path.endsWith(".map"), andrelationForrepeated the same suffix rule. Both ignored the producer's parsed fact.createOccurrenceclassifies a directory entry asartifact_kind: "container"(orframework) withartifact_format: "directory". Only regular files are path-classified assource-map.Reproduced with the issue's ZIP (
main.jsplus the empty directorymain.js.map/) throughinspect-artifact --json, together with a real file source-map control:main.js+ directorymain.js.map/container/directory,maps-source, parentmain.js, 7,963 bytes, 503 mscontainer/directory,contains, parent archive root, 7,960 bytes, 522 msmain.js+ filemain.js.map(control)source-map,maps-source, parentmain.js, 7,934 bytesChange and scope
isSourceMapis nowoccurrence.artifact_kind === "source-map", the classification the inventory producer already owns, including after content digestion. Matching sibling lookup, ambiguity and identity limitations are unchanged for real source maps.slice-of;maps-sourcefor a source map with a unique identified target, otherwisecontains;embedsorcontainsfor everything else.relationForno longer handles.map. That duplicate rule is removed.Contract and boundary impact
Semantic owner and earliest changed stage: inventory edge construction now consumes the occurrence classification owned by
createOccurrenceand the content digest, instead of re-deriving it from the path.Contribution scope fit and linked maintainer decision: a bug fix within the existing static, read-only boundary; not applicable.
CLI and MCP/tool-catalog contract: schemas unchanged.
Provider, bridge, target-format, or platform compatibility: provider-independent artifact inventory.
Evidence, artifact, provenance, or reconstruction contract: no false derivation edge for directories. Directory containment is preserved.
Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
src/artifacts/inventory/ArtifactGraphConstruction.test.tsadds a case with an identifiedapp/main.jsfile and an identifiedapp/main.js.mapdirectory. It asserts the directory's container/directory classification, acontainsedge to its parent, and no limitations. It fails on main and passes with the fix. The existing source-map relationship cases (missing, unread, unique and duplicate targets) still pass.@modelcontextprotocol/serverdist/(34 real.js.mapfiles), zipped with/usr/bin/zipand inventoried through the CLI:contains50,maps-source34f97a72ad743bdb00contains50,maps-source34f97a72ad743bdb00Real source maps and the full edge set are byte-identical, and timing is unchanged.
Validation performed
npx vitest run src/artifacts/inventory/ArtifactGraphConstruction.test.ts— 25 passed; against main, 1 failed as expected.npx vitest run src/artifacts tests/boundary/filesystem/artifactComparison.test.ts tests/boundary/filesystem/artifactDirectoryIdentity.test.ts tests/boundary/mcp/artifactMcp.test.ts tests/boundary/providers/native/artifactProvider.archiveInventory.test.ts src/domain/artifactInventoryEvidence.test.ts— 21 files, 204 passed.npm run check:fast— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.🤖 Generated with Claude Code