[PR #3497] [MERGED] fix(reference): retain inventories with empty module specifiers #5783

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3497
Author: @zpf2234
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix/reference-import-empty-specifier


📝 Commits (1)

  • cf72c3f fix(reference): retain inventories with empty module specifiers

📊 Changes

3 files changed (+56 additions, -9 deletions)

View changed files

📝 src/application/ReferenceSourceImportEntries.test.ts (+36 -0)
📝 src/application/ReferenceSourceImportEntries.ts (+1 -0)
📝 src/domain/referenceSourceImportParsing.ts (+19 -9)

📄 Description

Summary

Fixes #3387. A valid JavaScript file containing import ""; currently produces an empty relationship target. The graph validator rejects that target and the CLI drops the entire historical-source inventory.

Problem and expected behavior

An empty module specifier is not a usable graph edge, but it should not hide unrelated files or their hashes. The importer now keeps the entries, omits the invalid edge, and records a limitation so the unresolved construct remains visible.

Change and scope

The shared relationship projector ignores empty targets and records a source-level limitation. Parsed limitations are also promoted to the graph-level inventory so the result remains partial instead of looking complete. No module-resolution behavior changes for non-empty specifiers.

Contract and boundary impact

  • Semantic owner and earliest changed stage: reference-source import parsing and projection.
  • Contribution scope fit and linked maintainer decision: ordinary static-analysis fix; no additional decision required.
  • CLI and MCP/tool-catalog contract: no schema or catalog change.
  • Provider, bridge, target-format, or platform compatibility: not applicable.
  • Evidence, artifact, provenance, or reconstruction contract: preserves entries and makes the dropped relationship explicit.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata or package impact: none.

Evidence and regression coverage

  • Tests added or updated: src/application/ReferenceSourceImportEntries.test.ts covers an empty specifier alongside a retained unrelated file.
  • Base reproduction or other evidence: issue #3387 reports the graph validation failure for import "";.
  • Remaining proof gaps: the full filesystem-import boundary suite requires O_NOFOLLOW, which is unavailable on this Windows host.

Validation performed

  • npm run test:focused -- src/application/ReferenceSourceImportEntries.test.ts — 4 passed.
  • npm run check:fast — typecheck and lint passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real provider or OS coverage: no external provider; Windows host used for local checks.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new access or execution.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • 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/3497 **Author:** [@zpf2234](https://github.com/zpf2234) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/reference-import-empty-specifier` --- ### 📝 Commits (1) - [`cf72c3f`](https://github.com/morluto/rea/commit/cf72c3f8f9159ed073a3a5d3be45fd3f000498dd) fix(reference): retain inventories with empty module specifiers ### 📊 Changes **3 files changed** (+56 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ReferenceSourceImportEntries.test.ts` (+36 -0) 📝 `src/application/ReferenceSourceImportEntries.ts` (+1 -0) 📝 `src/domain/referenceSourceImportParsing.ts` (+19 -9) </details> ### 📄 Description ## Summary Fixes #3387. A valid JavaScript file containing `import "";` currently produces an empty relationship target. The graph validator rejects that target and the CLI drops the entire historical-source inventory. ## Problem and expected behavior An empty module specifier is not a usable graph edge, but it should not hide unrelated files or their hashes. The importer now keeps the entries, omits the invalid edge, and records a limitation so the unresolved construct remains visible. ## Change and scope The shared relationship projector ignores empty targets and records a source-level limitation. Parsed limitations are also promoted to the graph-level inventory so the result remains partial instead of looking complete. No module-resolution behavior changes for non-empty specifiers. ## Contract and boundary impact - Semantic owner and earliest changed stage: reference-source import parsing and projection. - Contribution scope fit and linked maintainer decision: ordinary static-analysis fix; no additional decision required. - CLI and MCP/tool-catalog contract: no schema or catalog change. - Provider, bridge, target-format, or platform compatibility: not applicable. - Evidence, artifact, provenance, or reconstruction contract: preserves entries and makes the dropped relationship explicit. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata or package impact: none. ## Evidence and regression coverage - Tests added or updated: `src/application/ReferenceSourceImportEntries.test.ts` covers an empty specifier alongside a retained unrelated file. - Base reproduction or other evidence: issue #3387 reports the graph validation failure for `import "";`. - Remaining proof gaps: the full filesystem-import boundary suite requires `O_NOFOLLOW`, which is unavailable on this Windows host. ## Validation performed - `npm run test:focused -- src/application/ReferenceSourceImportEntries.test.ts` — 4 passed. - `npm run check:fast` — typecheck and lint passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real provider or OS coverage: no external provider; Windows host used for local checks. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new access or execution. ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] 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 01:09:24 +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#5783
No description provided.