Repository navigation
feat(javascript): analyze selected application sources - #1944
Conversation
Respect exact source_paths at text acquisition and static analysis while stream-verifying the full inventoried artifact. Preserve requested order, repeated choices, unavailable-byte diagnostics and explicit omitted scopes. Expose the same selection through both CLI routes and MCP, retaining source scope in canonical Evidence and summary views. Fixes #1848 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <[email protected]>
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: 59b8478ab0
ℹ️ 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".
| if (signal?.aborted === true) | ||
| throw new AnalysisCancelledError("analyze_javascript_application"); | ||
| if ( | ||
| !file.text.included && | ||
| file.text.reason === "outside-analysis-scope" |
There was a problem hiding this comment.
Classify omitted files before checking cancellation
If cancellation arrives during the setImmediate() after the last selected file but before the first unselected file, this check throws before recognizing outside-analysis-scope. The catch block consequently records that omitted file as an analysis failure and cancellation-derived semantic unknown, and analyzedPaths prevents the later completion loop from correcting it. Partial Evidence then misstates why that file was not analyzed; handle the scope omission before the abort check, while still retaining the overall cancellation.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
Summary
Let analysts obtain evidence for known entry sources before unrelated application analysis. Both CLI routes accept repeated
--source-path; MCP accepts exactsource_paths. The complete artifact inventory and identity remain intact.Fixes #1848.
Problem and expected behavior
Previously the application reader allocated text for every relevant file and the shared analyzer processed the entire application.
detail: "summary"only reduced delivery after that work. An entry-source question needs a producing selection boundary, with honest coverage for everything left unexamined.Change and scope
Validate exact relevant inventory paths before acquisition. Stream-verify unselected bytes without allocating or decoding their text. Analyze selected files in first-request order before projecting omitted scopes; preserve repeated caller choices while performing each file's work once. Unselected files and relationships remain explicit unknowns rather than parse failures. Supporting manifests, HTML and source maps must be selected explicitly; imports do not expand the scope.
Contract and boundary impact
JavaScriptArtifactFiles.source_pathsand repeated--source-pathon dedicated and generic static application routes. Explicit native/snapshot routing rejects selection instead of discarding it. Converted live input/output schemas validated through the SDK client and Ajv.source_selectionin results/summaries; preserve full root digest, inventory commitments and per-file identities. Omitted readable files reportoutside-analysis-scope, and application coverage stays partial. Unknown paths and known unavailable source bytes have distinct typed corrections.docs/public/product-catalog.json), package, or installation impact: authored contracts and skill reference updated; generated catalogs/skills validated and left ignored. No dependency or installation changes.Evidence and regression coverage
12ee785e5, the request has no source selection and reconstruction acquires all relevant text before invoking the file analyzer. Summary delivery occurs after analysis.source_selection: {requested_paths: ["main.js", "package.json"], unselected_files: 36}, selected-source progress, exact preserved inventory identities and partial coverage for omitted sources.For evidence-bearing changes:
Validation performed
npm run check— passed, including typecheck, lint, formatting, unused-code/metadata checks and architecture guards.npm run docs:check— passed.npm run verify:test-discovery— all 866 test files discovered exactly once.Compatibility, safety, and release
Review checklist
type(scope): outcome.