Skip to content

fix(javascript): preserve Node exports fallback stop reasons - #606

Merged
morluto merged 3 commits into
morluto:mainfrom
rudycelekli:campaign/rea-exports-fallback-followup-20261005
Oct 5, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
rudycelekli:campaign/rea-exports-fallback-followup-20261005

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 5, 2026 •

Copy link
Copy Markdown

Summary

Follow up on merged #591: preserve Node's distinction between unmatched nested conditions, explicit null, and invalid array fallback entries.

No separate issue: this is a focused correctness follow-up found while verifying the maintainer's expanded condition/array support in #591.

Problem and expected behavior

Real installed-package Node comparisons exposed five remaining differences:

  • An unmatched nested condition should allow a later outer default; explicit null must still block it.
  • Arrays should skip invalid targets, stop at their first selected string, and retain the final invalid-versus-null refusal if no string is selected.
  • A selected file that is absent must remain absent, without falling through to another file.

Change and scope

Add an explicit unmatched outcome to the existing private resolver and stop array selection at the first usable target. Retain the maintainer's active node/node-addons conditions, nested targets, ordered conditions, and refusal diagnostics.

The target check covers the supported relative ./ prefix. This does not establish universal equivalence with Node's export grammar: top-level array exports, subpath patterns, and other target-segment grammar remain outside the existing supported contract.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application package-export target selection before artifact relationship resolution.
  • CLI and MCP/tool catalog: existing schemas and tools; corrected target selection uses existing result states.
  • Provider/platform coverage: real Node 24.18.0 import/require execution against owned temporary packages on macOS.
  • Evidence/provenance: source-derived artifact relationships retain their paths and identities; native comparisons are executed test evidence.
  • Execution, authority, cleanup and containment: production still parses caller-selected metadata; tests clean their owned package directories.
  • Metadata/package/install: no dependency, manifest, generated catalog, or installation changes.

Evidence and regression coverage

The added differential cases fail on current upstream bae87b4: five failed, 29 passed. After the fix, 34 real Node comparison cases plus 28 existing resolver tests pass. Tests retain Node's actual error codes for all-invalid and explicit-null controls. No module mocks are used.

Validation performed

On the final signed head:

  • npm run test:focused -- tests/boundary/javascript/packageConditionalExports.test.ts src/application/JavaScriptArtifactPathResolution.test.ts — 62 passed.
  • npm run check — passed, including type checking, lint, formatting, dead-code and metadata checks.
  • npm run check:fast — passed.

These follow the current ordinary-fix workflow in CONTRIBUTING after #599. check:pr is optional for this routine change and was not run on this head; upstream CI provides full coverage. Package contents and installation paths are unchanged.

Compatibility and remaining limits

No migration or new provider support. Real Hopper/Ghidra verification is not relevant to this application resolver change. Preserve explicit unavailable/external outcomes rather than claiming all Node package forms are supported.

Prepared with AI assistance.

CI baseline reconciliation

The final head 7c5f359 preserves upstream #609’s exact recovered-source fixture through a signed normal merge. The package resolver regression and source-map tests pass together, and npm run check passes on this head. Earlier whole-suite receipts refer to earlier heads; no whole-suite or hosted-CI pass is claimed for this update.

@rudycelekli

Copy link
Copy Markdown
Author

The shared shard failure was inherited from the recovered-source fixture and is now corrected upstream in #609. This branch preserves the owner’s exact fixture through a signed normal merge at 7c5f359. The package resolver and source-map focused tests pass together, and static checks pass; hosted CI is running separately. #610 was withdrawn after the owner’s fix landed.

@morluto
morluto merged commit adc07f5 into morluto:main Oct 5, 2026
19 checks passed
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(javascript): preserve Node exports fallback stop reasons.” I appreciate your contribution to REA.

darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…#606)

* fix(javascript): preserve Node exports fallback stop reasons

Signed-off-by: Rudy Celekli <[email protected]>

* test(browser): preserve unknown with-scope loader bindings

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants