Repository navigation
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Oct 9, 2026
Owner
|
Closing as superseded by work already landed on main: 7a4f2685. Main rejects mixed subpath/condition exports objects and visited numeric condition keys, propagating invalid-configuration outcomes instead of recovering through an array fallback. Real-Node controls remain. The follow-up refactor/test consolidation is on main in 392f1f31. Closure is based on the behavior now present on main, not on treating this branch as merged. Thank you for documenting the issue and regression cases. |
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
Reject invalid package
exportsconfigurations instead of selecting an apparent dependency target. Mixed subpath/condition keys and numeric condition keys must fail as configuration errors; an exports array must not recover from that error by choosing a later file.No linked issue: this is a focused correctness bug reproduced against Node. Related #591, #606 and #1046 cover condition order, target fallback and root arrays, respectively; this change handles configuration errors those paths still accepted.
Problem and expected behavior
For example,
exports: {"node":[{"0":null},"./index.cjs"],"default":"./index.cjs"}makes Node throwERR_INVALID_PACKAGE_CONFIG, but REA selects index.cjs. Likewise, mixing"."with"import"at the root selects a target despite Node rejecting the configuration.Change and scope
Validate root key categories before root-subpath selection. Validate numeric condition keys only when that condition object is visited, using Node's numeric-key predicate. Carry a distinct private invalid-configuration outcome through array traversal; preserve ordinary invalid-target fallback, inactive branches, and early successful selections.
Contract and boundary impact
Evidence and regression coverage
d83cbd2a, with 39 passing controls/existing tests.".", and an invalid object before an array fallback. Both import and require are exercised after the fix."01","4294967295", unvisited invalid branches, early array success and ordinary subpath maps.analyze-javascript-application <fixture> --jsonretains{"specifier":"fixture","resolved_path":null}rather than linking index.cjs. The resolver supplies a specific configuration diagnostic; this does not claim the application graph exposes every resolver diagnostic.Validation performed
Node 24.18.0 / npm 11.16.0:
npm run test:focused -- tests/boundary/javascript/packageConditionalExports.test.ts tests/boundary/filesystem/javascriptPackagePrecedence.test.ts src/application/javascript/JavaScriptArtifactPathResolution.test.ts src/application/javascript/JavaScriptModuleSpecifierPaths.test.ts— 158 passed across four files.npm run check— all six tasks passed, warnings and no errors.git diff --check— passed.Compatibility, safety, and release
No migration, dependency, metadata, or execution-authority changes. Unsupported package subpaths remain outside this fix. Real Hopper/Ghidra/browser verification and the complete repository test suite were not run; those providers are unchanged. Hosted CI is separate from local validation.
Review checklist
Prepared with OpenAI Codex assistance.