[PR #4214] [CLOSED] fix(artifacts): reject directory targets for source maps (#4212) #6127

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4214
Author: @glaucojrcarvalho
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/4212-source-map-directory-target


📝 Commits (3)

  • ae7218e fix(artifacts): reject directory targets for source maps (#4212)
  • 2a8638b test(artifacts): cover mapped directory targets (#4212)
  • 5b6a4cb test(artifacts): model archive containment in directory regression

📊 Changes

2 files changed (+58 additions, -2 deletions)

View changed files

📝 src/artifacts/inventory/ArtifactGraphConstruction.test.ts (+52 -0)
📝 src/artifacts/inventory/ArtifactGraphConstruction.ts (+6 -2)

📄 Description

Summary

Fixes #4212.

  • Reject known directory occurrences as inferred source-map file targets while retaining regular-file mapping.
  • Preserve occurrence containment for the directory, source-map file, and nested children.
  • Add regression cases for directory targets with and without a child, while retaining existing controls for real file targets, missing/unread targets, ambiguous targets, and directories named *.map.

Evidence and validation

  • Source review: createArtifactEdges was accepting a uniquely named directory occurrence with a non-null artifact ID as the mapped source. The change limits matching to file entries and only marks unresolved identity for a matching file.
  • Contributor-reported local execution on 2026-10-15 at commit 5b6a4cb48fbd2e6a1e99d5fc1fdde3060d0b0d60, Node.js v24.18.0 / npm 12.0.1 (Linux): npm ci passed (0 audit vulnerabilities); npm run test:local -- src/artifacts/inventory/ArtifactGraphConstruction.test.ts passed (27/27 tests); npm run check:fast passed (2/2 tasks); npm run build:cached passed (3/3 tasks). Results were shared as terminal logs; not independently reproduced by the assisting agent.
  • Contributor-reported public CLI reproduction (five cases from #4212) passed with exit code 0 for each: directory-target and directory-with-child returned contains to archive root, file-target returned maps-source to main.js, and directory-map and missing-target returned contains to archive root. All five reported complete container-entry coverage and no map limitations. These outputs were supplied in the conversation; no independent local rerun by the assisting agent.
  • Remaining: upstream GitHub Actions CI is reporting action_required (no job-level result available). Downstream-provider verification was not performed.

Author readiness

  • I reviewed the final diff and relevant existing code and take human ownership of this contribution.
  • I reviewed the verification results and explicitly described relevant untested scope.
  • This PR is ready for initial maintainer review.

Ready for review: The human owner checked all author-readiness declarations and marked the PR ready on 2026-10-15.


🔄 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/4214 **Author:** [@glaucojrcarvalho](https://github.com/glaucojrcarvalho) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/4212-source-map-directory-target` --- ### 📝 Commits (3) - [`ae7218e`](https://github.com/morluto/rea/commit/ae7218ef8e7adab77189f7ea2059f87eb9a17729) fix(artifacts): reject directory targets for source maps (#4212) - [`2a8638b`](https://github.com/morluto/rea/commit/2a8638b81f60b6fd24a903faa6612b7795df8272) test(artifacts): cover mapped directory targets (#4212) - [`5b6a4cb`](https://github.com/morluto/rea/commit/5b6a4cb48fbd2e6a1e99d5fc1fdde3060d0b0d60) test(artifacts): model archive containment in directory regression ### 📊 Changes **2 files changed** (+58 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/inventory/ArtifactGraphConstruction.test.ts` (+52 -0) 📝 `src/artifacts/inventory/ArtifactGraphConstruction.ts` (+6 -2) </details> ### 📄 Description ## Summary Fixes #4212. - Reject known directory occurrences as inferred source-map file targets while retaining regular-file mapping. - Preserve occurrence containment for the directory, source-map file, and nested children. - Add regression cases for directory targets with and without a child, while retaining existing controls for real file targets, missing/unread targets, ambiguous targets, and directories named `*.map`. ## Evidence and validation - Source review: `createArtifactEdges` was accepting a uniquely named directory occurrence with a non-null artifact ID as the mapped source. The change limits matching to file entries and only marks unresolved identity for a matching file. - Contributor-reported local execution on 2026-10-15 at commit `5b6a4cb48fbd2e6a1e99d5fc1fdde3060d0b0d60`, Node.js v24.18.0 / npm 12.0.1 (Linux): `npm ci` passed (0 audit vulnerabilities); `npm run test:local -- src/artifacts/inventory/ArtifactGraphConstruction.test.ts` passed (27/27 tests); `npm run check:fast` passed (2/2 tasks); `npm run build:cached` passed (3/3 tasks). Results were shared as terminal logs; not independently reproduced by the assisting agent. - Contributor-reported public CLI reproduction (five cases from #4212) passed with exit code 0 for each: `directory-target` and `directory-with-child` returned `contains` to archive root, `file-target` returned `maps-source` to `main.js`, and `directory-map` and `missing-target` returned `contains` to archive root. All five reported complete container-entry coverage and no map limitations. These outputs were supplied in the conversation; no independent local rerun by the assisting agent. - Remaining: upstream GitHub Actions CI is reporting `action_required` (no job-level result available). Downstream-provider verification was not performed. ## Author readiness - [x] I reviewed the final diff and relevant existing code and take human ownership of this contribution. - [x] I reviewed the verification results and explicitly described relevant untested scope. - [x] This PR is ready for initial maintainer review. **Ready for review:** The human owner checked all author-readiness declarations and marked the PR ready on 2026-10-15. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12: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#6127
No description provided.