Repository navigation
fix(javascript): route directories by JavaScript input presence and name directory-capable operations - #14186
Merged
Merged
Conversation
…e directory-capable operations `analyze <dir>` routed every non-bundle directory to the static JavaScript lane, which reported an all-zero Electron summary as success for native build output. The JavaScript lane now owns that applicability decision from its complete inventory: when coverage is complete and no JavaScript, HTML, package.json, source map, or nested ASAR input exists, it returns a typed unsupported_target refusal naming inspect_desktop_application, audit_release_exposure, inspect_artifact, and open_binary. Incomplete coverage or unavailable files of unknown kind stay unknown and proceed. The directory_requires_file refusal no longer claims to come from open_binary when another operation (inspect, inspect-artifact) admitted the target, and it names the directory-capable operations instead of only the JavaScript lane.
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR refuses nonempty targets that have no JavaScript application inputs and gives callers other operations to use.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read inventory and file facts] --> B{Application inputs found?}
B -->|Yes| C[Analyze]
B -->|No| D{Coverage complete and kinds known?}
D -->|No| C
D -->|Yes| E{Contained non-directory entries?}
E -->|Yes| F[Refuse with format counts and next operations]
E -->|No| G[Analyze with no-input warning]
Reviews (2) · Last reviewed commit: "fix(javascript): keep empty directories ..." · Reviewed by Greptile |
… facts for non-JavaScript ones Owner decision on #14186: an empty directory is "nothing to analyze", not "unsupported". The JavaScript lane now classifies application-input presence once, in the domain owner of its file facts (javaScriptApplicationInputPresence): present, empty, absent, or unknown. - empty (complete traversal, no non-directory entries): analysis succeeds as before and the graph carries an explicit "No JavaScript inputs were found" limitation naming the next operations. - absent (complete traversal, entries but no JavaScript, HTML, package.json, source map, or nested ASAR): the typed unsupported_target refusal now carries bounded diagnostics from the inventory the lane already read: inventoried_entries, entries_by_format, json_files and native_addon_files. No paths are retained. - unknown (incomplete traversal or unavailable file of unknown kind) and present: unchanged analysis. Reverts the fixture edits that added package.json to empty directories.
morluto
added a commit
that referenced
this pull request
Nov 23, 2026
… facts for non-JavaScript ones Owner decision on #14186: an empty directory is "nothing to analyze", not "unsupported". The JavaScript lane now classifies application-input presence once, in the domain owner of its file facts (javaScriptApplicationInputPresence): present, empty, absent, or unknown. - empty (complete traversal, no non-directory entries): analysis succeeds as before and the graph carries an explicit "No JavaScript inputs were found" limitation naming the next operations. - absent (complete traversal, entries but no JavaScript, HTML, package.json, source map, or nested ASAR): the typed unsupported_target refusal now carries bounded diagnostics from the inventory the lane already read: inventoried_entries, entries_by_format, json_files and native_addon_files. No paths are retained. - unknown (incomplete traversal or unavailable file of unknown kind) and present: unchanged analysis. Reverts the fixture edits that added package.json to empty directories. Claude-Session: https://claude.ai/code/session_01TBh3FSTJTdVSc2DntiwVY7
morluto
force-pushed
the
fix/directory-input-routing-14161
branch
from
November 23, 2026 22:50
4a3a9dc to
9e48702
Compare
This was referenced Nov 24, 2026
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.
Part of #14161
Owner decision
An empty directory is "nothing to analyze", not "unsupported", so it keeps returning Evidence. A non-empty directory with no JavaScript inputs no longer gets a silent all-zero summary. It gets a typed refusal that includes bounded routing facts: counts by format, with no file lists.
Behaviour matrix (
analyze <dir>/analyze_javascript_application)package.json/ source map / nested ASAR presentpresentemptyabsentunsupported_targetrefusal.details.diagnosticshas{inventoried_entries, entries_by_format, json_files, native_addon_files}, e.g.{"inventoried_entries":4,"entries_by_format":{"file":2,"pe":2},"json_files":1,"native_addon_files":0}.related_operationslistsinspect_desktop_application,audit_release_exposure,inspect_artifactandopen_binary.unknownThe JS result schema has no next-probes field, so the empty case names its next probes in the limitation text. No contract or schema changed.
Root cause
analyzesends every directory that is not an Apple bundle to the JavaScript lane. The lane never classified whether its own inventory held anything it analyzes, so native build output came back as an exit-0, all-zero Electron summary.directory_requires_filepresentation hard-codedopen_binaryas the refusing operation and listed onlyanalyze_javascript_applicationas an alternative.inspectandinspect-artifactinherited that advice.Structural fix
javaScriptApplicationInputPresenceandjavaScriptAbsentInputDiagnostics(src/domain/javascript/javascriptArtifactFiles.ts) classify presence once. They use facts the lane already holds: the relevant-kind file set fromreadJavaScriptArtifactFilesand the inventory occurrences/coverage. The root occurrence is excluded and nothing is re-scanned.reconstructJavaScriptArtifactrefusesabsenttargets.graphLimitations, which owns the result's limitations, adds the empty-input limitation foremptytargets.directory_requires_filemessage is now operation-neutral. Its remediation andrelated_operationsnameinspect_desktop_application,audit_release_exposureandanalyze_javascript_application.The
inspect-desktop-applicationpart of the issue (≈30k tokens, no candidates or probes for native PE headers) has a different root cause in the desktop projection. It overlaps #14173 and #14179 and is not fixed here, so this PR is "Part of".Tests
tests/boundary/filesystem/javascriptApplicationInputSelection.test.tscovers:pe()fixture) + JSON + a CMake directory, with no paths leaked.package.json-only and source-map-only directories.tests/boundary/cli/analyzeAppBundlePathCli.test.tscovers publicrea analyze <dir>: the native-directory refusal with diagnostics, the empty-directory limitation, and an HTML-only control.directory_requires_fileexpectations intargetDiagnostics.test.tsandrawBinaryCli.test.ts.package.jsonto empty directories are reverted. Those four tests pass unchanged against main's fixtures.Validation run
npx oxfmt/npx oxlinton the changed files: formatted. The changed files raise no new lint warnings; existing size/complexity warnings remain.node scripts/verify/architecture-guards.mjs: passed across 3075 source files.npx vitest run tests/boundary/filesystem/javascriptApplicationInputSelection.test.ts: 11 passed, 2 failed. The 2 failures are the existing access-denied tests. They analyze a.jsfile and need the built workerdist/composition/javascriptAnalysisWorkerProcess.js, which was absent because I did not build.targetDiagnostics,appleBundleTargets, and the reverted empty-directory fixtures injavascriptApplicationWorkflows/sourceToBundlePaths: all pass except tests that need the built JS worker. Those fail withProviderAdapterErrorbefore any applicability decision.absentrefusal text appears in none of the failures. Every failure there comes from the missing built worker.analyzeAppBundlePathCli.test.ts,rawBinaryCli.test.ts), the full typecheck and MCP. CI has to cover them. No real-provider verification applies.Remaining cleanup
inspect-desktop-applicationnative-image summarization and next probes: [Feature] inspect-desktop-application: recognise native (Qt/SDL/Win32) desktop releases instead of returning only file metadata #14173 / [Bug] inspect-desktop-application: Godot candidates get no probe, and self-contained .NET games bury the app among 180+ BCL probes #14179.