Repository navigation
Conversation
This was referenced Nov 14, 2026
gensokyo-dev
added a commit
that referenced
this pull request
Nov 14, 2026
Fixes #9998 Supersedes #10107 Co-Authored-By: gensokyo-dev <[email protected]>
N0zoM1z0
pushed a commit
that referenced
this pull request
Nov 14, 2026
Fixes #9998 Supersedes #10107 Co-Authored-By: gensokyo-dev <[email protected]>
Collaborator
|
Thank you for this fix. It landed in #10538 with your authorship kept on the commit (plus review follow-ups noted in the PR), so I'm closing this PR as superseded. |
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
Fixes #9998. Preserve an uncertain resolution result for package exports wildcard requests ending in
/, instead of incorrectly classifying them as external.Related work: #2018 implements broader exports/imports wildcard resolution and overlaps this code. This PR is a narrow correction to the current conservative behavior; maintainers may prefer to incorporate it there.
Problem and expected behavior
For
exports: { "./*": "./lib/*.js" }, Node can resolvedep/a/tolib/a/.js. REA currently returnsexternalbefore checking wildcard keys. Since full wildcard expansion is unsupported here, the correct existing-contract outcome isunavailable, with no invented resolved path. Exact keys ending in/must still be ignored, while a matching null wildcard remains blocked.Change and scope
Move the trailing-slash guard into exact-key selection so wildcard matching can still run. Add import/require regression cases and a CLI/stdio MCP acceptance test with a native Node resolution oracle. Full wildcard expansion is outside this change.
Contract and boundary impact
selectPackageExportinJavaScriptArtifactPathResolution.ts; package-export selection feeds JavaScript graph edge resolution. Existing pattern selection and target evaluation remain shared.resolution_status: unavailableandresolved_path: nullinstead ofexternal.Expected production effects: read existing files. No additional target execution, mutation, network access, or protection recovery is introduced.
Evidence and regression coverage
48357cb34, the source regression suite had 2 failures and 310 passes: trailing-slash wildcard cases returnedexternalwhereunavailablewas expected. With the fix, all 312 pass.import.meta.resolveandrequire.resolveoracle assertions passed without loading target modules.Unknown native filesystem operation (Win32 87): The parameter is incorrect.This occurs on both the base and fixed code in this Windows environment. Endpoint success and final graph assertions are therefore not claimed.Validation performed
Environment: Windows x64, Node 24.22.1, npm 11.16.0.
npm run test:local -- src/application/javascript/JavaScriptArtifactPathResolution.test.ts src/domain/javascript/javascriptPackageSubpathPatterns.test.ts src/domain/javascript/javascriptPackageImportAliases.test.ts— 360 passed across 3 files.npm run test:focused -- tests/acceptance/applications/javascriptTrailingSlashExports.test.ts— 2 failed on both base and fix at the pre-resolution Windows source-transfer boundary described above; Node oracle assertions passed.npm run verify:test-discovery— 3434 test files discovered exactly once.git diff --check— passed.npm run check— typecheck, lint, formatting, metadata checks, and runtime compilation passed. The gate stopped at Knip on the pre-existing unused exported typeAdbDeviceStateinsrc/domain/adb/adbDeviceAnalysis.ts:54; subsequent chained checks did not run.Compatibility, safety, and release
No schema migration, dependency, release metadata, target execution, or containment change. Windows endpoint verification remains incomplete as recorded above; Linux/macOS were not exercised locally. Hopper/Ghidra coverage is not applicable to this JavaScript-only change.
Author readiness
Human owner: @dimxxkun
This is a draft. The declarations below are reserved for the human owner and have not been made by the assistant.
Before merge