[PR #591] [MERGED] fix(javascript): honor package exports condition order #2091

Closed
opened 2026-10-16 21:14:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/591
Author: @rudycelekli
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: campaign/rea-package-condition-order-20261005


📝 Commits (3)

  • 29155ef fix(javascript): honor package exports condition order
  • 23eb882 fix(javascript): resolve exports against Node's full condition set
  • e22576f style: apply Prettier to the conditional exports differential test

📊 Changes

2 files changed (+302 additions, -7 deletions)

View changed files

📝 src/application/JavaScriptArtifactPathResolution.ts (+74 -7)
➕ tests/boundary/javascript/packageConditionalExports.test.ts (+228 -0)

📄 Description

Summary

Select supported default/import/require package export conditions in declared insertion order. Real source-owned installed-package Node import and require subprocesses prove default-before-specific selects default; no expansion of unsupported nested/array conditions.

No tracking issue: this is a focused correctness regression found through production-seam reproduction.

Problem and expected behavior

Module relationship selection now respects supported condition insertion order; nested and array-condition coverage remains as before.

Change and scope

The change stays in the owning adapter/application stage and corrects existing behavior without adding tools or broadening provider coverage.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Application package export-condition selection, before selecting a package entry artifact.
  • CLI and MCP/tool-catalog contract: existing schemas and tool inventory remain intact; corrected results flow through the owning operation.
  • Provider, bridge, target-format, or platform compatibility: Actual Node import/require executions ran for the changed condition-order cases. No claim is made about additional Node export-map forms.
  • Evidence, artifact, provenance, or reconstruction contract: Module relationship selection now respects supported condition insertion order; nested and array-condition coverage remains as before.
  • Process execution, authorization, cleanup, or containment impact: Existing execution authority, cleanup and containment remain preserved.
  • Generated metadata, package, or installation impact: no metadata or dependency changes.

Evidence and regression coverage

Two base-revision mismatches; 30 focused tests pass. Real installed-package Node import and require subprocesses select the earlier default condition.

Tests exercise production parsing, filesystem, HTTP, or browser seams, without module mocks. Evidence above is executed; unverified platform/provider coverage is stated explicitly.

Validation performed

All required local gates passed on the signed commit:

  • npm run check:pr
  • npm run check:ci
  • npm run verify:package
  • npm pack --dry-run

Development runtime: Node.js 24.18.0 and npm 11.16.0. Upstream CI is separate from these local results.

Compatibility, safety, and release

No migration or package dependency changes. Real Hopper/Ghidra verification was not run; this patch does not change those providers. Remaining proof limits are stated above. The final diff contains source and tests only.

Prepared with AI assistance.


🔄 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/591 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `campaign/rea-package-condition-order-20261005` --- ### 📝 Commits (3) - [`29155ef`](https://github.com/morluto/rea/commit/29155ef0901c63e779794deca4fb39cd23b7d374) fix(javascript): honor package exports condition order - [`23eb882`](https://github.com/morluto/rea/commit/23eb8820fe8418193f212d3d5b2c550d782c7345) fix(javascript): resolve exports against Node's full condition set - [`e22576f`](https://github.com/morluto/rea/commit/e22576fedb21864c8137b30e9bc18da5901c1ed9) style: apply Prettier to the conditional exports differential test ### 📊 Changes **2 files changed** (+302 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/application/JavaScriptArtifactPathResolution.ts` (+74 -7) ➕ `tests/boundary/javascript/packageConditionalExports.test.ts` (+228 -0) </details> ### 📄 Description ## Summary Select supported default/import/require package export conditions in declared insertion order. Real source-owned installed-package Node import and require subprocesses prove default-before-specific selects default; no expansion of unsupported nested/array conditions. No tracking issue: this is a focused correctness regression found through production-seam reproduction. ## Problem and expected behavior Module relationship selection now respects supported condition insertion order; nested and array-condition coverage remains as before. ## Change and scope The change stays in the owning adapter/application stage and corrects existing behavior without adding tools or broadening provider coverage. ## Contract and boundary impact - Semantic owner and earliest changed stage: Application package export-condition selection, before selecting a package entry artifact. - CLI and MCP/tool-catalog contract: existing schemas and tool inventory remain intact; corrected results flow through the owning operation. - Provider, bridge, target-format, or platform compatibility: Actual Node import/require executions ran for the changed condition-order cases. No claim is made about additional Node export-map forms. - Evidence, artifact, provenance, or reconstruction contract: Module relationship selection now respects supported condition insertion order; nested and array-condition coverage remains as before. - Process execution, authorization, cleanup, or containment impact: Existing execution authority, cleanup and containment remain preserved. - Generated metadata, package, or installation impact: no metadata or dependency changes. ## Evidence and regression coverage Two base-revision mismatches; 30 focused tests pass. Real installed-package Node import and require subprocesses select the earlier default condition. Tests exercise production parsing, filesystem, HTTP, or browser seams, without module mocks. Evidence above is executed; unverified platform/provider coverage is stated explicitly. ## Validation performed All required local gates passed on the signed commit: - `npm run check:pr` - `npm run check:ci` - `npm run verify:package` - `npm pack --dry-run` Development runtime: Node.js 24.18.0 and npm 11.16.0. Upstream CI is separate from these local results. ## Compatibility, safety, and release No migration or package dependency changes. Real Hopper/Ghidra verification was not run; this patch does not change those providers. Remaining proof limits are stated above. The final diff contains source and tests only. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:07 +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#2091
No description provided.