Repository navigation
fix(javascript): report present non-JavaScript require targets as unavailable - #2642
cyberpunk47 wants to merge 8 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 822e466066
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d404bbdfac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10746e3c3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Source changes are on 10746e3. Separated candidate identity lookup from loader/declaration policy. Exact ESM declaration imports use the shared identity owner and preserve the existing resolved contract; only declaration fallbacks get the unavailable runtime outcome. The pre-existing explicit .d.ts/.d.mts/.d.cts assertions remain intact. Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request. Source changes are on 10746e3. Opaque classification now excludes verified expanded container identities rather than every .asar suffix. Ordinary ASAR members retain inventory identity and exact-candidate precedence over later .js candidates. Added an outer-ASAR production regression containing ordinary.asar and ordinary.asar.js. Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request. Source changes are on 10746e3. Replaced occurrence/node linear scans with binary lower-bound lookup over canonical snapshot arrays. Prefix queries examine only their contiguous directory range, and requested candidates/directory outcomes remain cached for the immutable reconstruction lifetime. Expanded-container ownership uses verified container facts, without eager metadata copies for every opaque asset. Resource/time/token costs remain unmeasured after the requested verification stop. Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request. Source changes are on 10746e3. The owning lookup now reuses the snapshot arrays already sorted by code-point logical path and artifact ID; first misses and positive metadata lookup use binary search rather than whole-inventory scans. Directory queries use a bounded prefix range and retain only requested query results. The snapshot order invariant is documented at its domain owner; no all-assets metadata map is allocated. Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request. Source changes are on 10746e3. Source-map observations and maps_to edges now retain the full contextual resolution: status, candidate path and original limitations. Present opaque candidates preserve their digest/size evidence; absent, external and wrong-projection outcomes no longer collapse into the false not-present message. Added a boundary regression for an opaque sourceMappingURL target. Source inspection and git diff checks completed. Tests, typecheck/lint, generated-schema checks and real-provider lanes were not run for this final revision at the user's explicit request. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73534cf2d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Changes are on 73534cf. Opaque presence was incorrectly conditional on a content digest. The borrowed lookup now admits known regular-file occurrences with null artifact IDs, retains nullable digest/size and the inventory's limitations, and includes them in directory presence. The shared resolver reports unavailable and unknown digest instead of not-found or ancestor fallback. Source validation: Authored an unexecuted ASAR missing-unpacked-companion regression covering both graph projections. Reviewed container identity and nearest-package lookup; no invented digest or content-addressed identity is produced. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads. Changes are on 73534cf. Worker resolution returned null before its unavailable facts could reach the graph. Resolution now survives independently of an optional asset node; worker/service-worker observations and launch edges retain status, candidate and limitations. Missing and opaque targets stay distinguishable. Source validation: Authored an unexecuted worker/service-worker graph regression. Reviewed the ordinary module path and nullable worker target; no orphan placeholder module is created for an unavailable worker. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads. Changes are on 73534cf. Utility-process resolution ran after the observation and launch edge and was dropped when no asset link existed. It now runs once before projection; a separate inference observation and launch edge retain status/candidate/limitations while the original AST observation preserves its observed authority. Source validation: Authored an unexecuted utility-process graph regression. Reviewed the optional maps_to edge and shared path-resolution owner; no raw path is reinterpreted downstream. Tests, checks, builds, lint/typechecks, provider workloads and CI reruns were not run at the user's explicit request. Targeted formatting used the pinned Node toolchain with two formatter threads. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5ed98b029
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Fixed publicly in b5ed98b. Package-role projection now retains opaque candidate paths instead of dropping them at the structure boundary; the consumer and fixture coverage preserve those candidates through graph construction. Source inspection covered the producer and graph consumers; git diff --check passed. Tests, builds, lint, typechecks, provider workloads and CI reruns were skipped at the user's explicit request. No directly related cleanup remains. Finding addressed: Useful? React with 👍 / 👎.. |
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Changes are present at public head |
| sourcePath: file.path, | ||
| context: value.module_resolution_context, | ||
| files: context.filesByPath, | ||
| unanalyzedFiles: context.unanalyzedFiles, |
There was a problem hiding this comment.
addUtilityProcess now uses unanalyzedFiles, but summarizeElectronBoundaries still resolves utility entrypoints using only analyzed files. With utilityProcess.fork("./worker"), an extensionless opaque worker, and worker.js, the graph reports unavailable for worker. The summary instead selects worker.js and counts the launch in electron_summary.resolved_utility_entrypoints, giving users conflicting answers in one result.
Pass the same inventory lookup to the summary and add a regression that checks both outputs.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/javascript/ElectronBoundaryGraphWindows.ts
Line: 243
Comment:
**Utility counts disagree**
`addUtilityProcess` now uses `unanalyzedFiles`, but `summarizeElectronBoundaries` still resolves utility entrypoints using only analyzed files. With `utilityProcess.fork("./worker")`, an extensionless opaque `worker`, and `worker.js`, the graph reports `unavailable` for `worker`. The summary instead selects `worker.js` and counts the launch in `electron_summary.resolved_utility_entrypoints`, giving users conflicting answers in one result.
Pass the same inventory lookup to the summary and add a regression that checks both outputs.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97a79c05d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| analysis, | ||
| root, | ||
| filesByPath: new Map(fileSet.files.map((file) => [file.path, file])), | ||
| unanalyzedFiles: fileSet.unanalyzed_files, |
There was a problem hiding this comment.
Carry the opaque lookup into Electron summary resolution
When utilityProcess.fork("./worker") is analyzed with both an extensionless opaque worker and worker.js, the graph context added here correctly stops at worker with unavailable, but JavaScriptArtifactReconstruction.ts:255 still calls summarizeElectronBoundaries(analysis) without this lookup; ElectronBoundaryAnalysis.ts:155-163 consequently skips worker, resolves worker.js, and increments resolved_utility_entrypoints while the graph reports the entrypoint unavailable. Pass fileSet.unanalyzed_files through the summary resolver as well.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Normalize path facts once at the owning filesystem boundary, preserve caller spelling and unavailable inventory members, and retain typed read failures. Record exclusion entry kinds so only proven directories can establish descendant symlink targets; omitted legacy kinds stay unknown. Reviewed fixes include #1969, #2642, #2759, and #2994. Validation: 26 reference graph source tests passed; prior artifact checks passed 275 tests with one Windows-only skip. Updated compiled import workflows are included in final validation after regeneration.
Preserve CommonJS literal paths and confined ESM URL semantics, including package main fallback, directory intent, Unicode identity, and present opaque modules. Parse extraction inputs at their AST/source owner, retain skipped HTML and source-map coverage, and distinguish endpoint candidates from proven receiver facts. Version structural fingerprints with computed literal contents and propagate them through worker contracts. Reviewed fixes include #1810, #1840, #2642, #2700, #2702, #2714, #2803, #2960, #2968, #2986, #3035, and #3036. Validation: 158 resolver tests passed; public CLI/MCP module lookup controls, package-main/Unicode workflows, and six builtin workflows passed in the current compiled lane. Worker schema/fingerprint regressions passed. Large public pdf.js completion and real Electron analysis remain unverified.
This appears to be covered on main by b58adaf. Is anything further needed here, or can this be closed? |
|
Heads up: main already has this change in b58adaf. The code is in 🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
|
Superseded by the delivered change on main: b58adafa4. Present non-JavaScript require targets retain unavailable status and candidate identity rather than becoming not-found. Current inventory/path tests also distinguish genuinely missing files; this does not claim decoding support. Closing this earlier proposal. Current main qualification passed: https://github.com/morluto/rea/actions/runs/38690953281. |
|
Thank you @cyberpunk47 for distinguishing a present but opaque .jsc file from a module that cannot be found. Main preserves that unavailable-versus-absent distinction in module resolution. |
Summary
Fixes #2641
analyze-javascript-applicationreportedresolution_status: "not-found"for a module target that exists in the analysed artifact when the file is outside the JavaScript-relevant kinds (for example a bytenode.jscmodule). The output was identical to a really missing file, and the edge evidence stated that no candidate exists in the inventoried container. This change keeps the inventory identity of such files and reports them asunavailable, with a limitation naming their sha256 and size. Missing files still reportnot-found.Problem and expected behavior
Smallest trigger: a directory with
main.jscontainingconst core = require("./core.jsc")and acore.jscfile next to it.resolution_status: "not-found", with the limitation "No extension, directory package, or index candidate exists in the inventoried artifact container."resolution_status: "unavailable", with the limitation "core.jsc exists in the inventoried artifact container (sha256 …, N bytes) but is not a JavaScript, JSON, HTML, source map, or native add-on file; its contents were not analyzed."Violated invariant (AGENTS.md): "Unresolved identity or applicability must remain unknown rather than be treated as absent, foreign, or aligned."
Change and scope
src/artifacts/javascript/JavaScriptArtifactFiles.tsskipped inventoried regular files with no relevant kind (if (kind === undefined) continue;) and left no record. It now records them asunanalyzed_files(path, container sha256, sha256, bytes, inventory artifact id) onJavaScriptArtifactFileSet. Their bytes are still never read.JavaScriptArtifactPathResolution.resolveFileCandidateschecks those records in the same candidate order as before, keeping the same-container rule. A match returnsunavailableinstead of falling through tonot-found.unanalyzedFilesByPath, and everyresolveArtifactPathByContextcall built from the context passes it.Contribution scope: not applicable (routine fix within existing boundaries).
Contract and boundary impact
JavaScriptArtifactFiles), then path resolutionunavailablestatus is now used for this casedocs/public/product-catalog.json), package, or installation impact: noneExpected effects:
Evidence and regression coverage
src/application/javascript/JavaScriptArtifactPathResolution.test.ts: require and import targets present outside the projection giveunavailable; a target in another container staysnot-found; a missing target staysnot-found.tests/boundary/filesystem/javascriptRequireLiteralPaths.test.ts: real directory analysis; a present.jscgivesunavailablewith its sha256 and size, and the same layout without the file givesnot-found.unavailableunit tests fail; the twonot-foundguard tests pass.coverage.statusremainscomplete; whether it should change is left to maintainer preference (asked in the issue).For evidence-bearing changes:
Validation performed
npx vitest run src/application/javascript src/artifacts src/domain/javascript: 76 files, 1547 tests passednpm run test:focused -- <43 JavaScript boundary test files>: 565 passed, 1 skipped, 1 failed. The failure (packageImportAliases.test.ts, "matches literal imports keys containing path-like bytes in both Node loaders") fails identically on the unmodified base under Node 22.22 (Node returnsERR_INVALID_MODULE_SPECIFIER) and is unrelated to this change.npm run check:fast: typecheck and lint passedoxfmt --checkon changed files: passed./core.jscreportsunavailable; with the file deleted it reportsnot-found.Compatibility, safety, and release
resolvedstatus as unresolved are unaffected; consumers matchingnot-foundspecifically will now seeunavailablefor present, unanalysed targets.Before merge
type(scope): outcome.