[PR #5428] [CLOSED] Fix/javascript source selection limitations #6927

Closed
opened 2026-11-01 21:44:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5428
Author: @Abhiiishek44
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/javascript-source-selection-limitations


📝 Commits (1)

  • 8eccd2d fix: omit unselected-source limitation when all sources are selected

📊 Changes

3 files changed (+112 additions, -3 deletions)

View changed files

📝 src/application/javascript/JavaScriptArtifactGraphBuilder.ts (+14 -3)
📝 tests/acceptance/applications/javascriptSourceSelectionCli.test.ts (+56 -0)
📝 tests/boundary/mcp/javascriptSourceSelection.test.ts (+42 -0)

📄 Description

Summary

Fixes #5407.

Avoids reporting an unselected-source limitation when explicit JavaScript source selection includes every inventoried file. Graph coverage and limitation generation now use the same source-selection gap check.

Problem and expected behavior

When all JavaScript sources were explicitly selected, both analyze and analyze-javascript-application reported complete graph coverage with unselected_files: 0, but still emitted:

Caller-selected source analysis leaves 0 inventoried files outside analysis scope.

The coverage calculation already treated source selection as a gap only when unselected_files > 0. Limitation generation instead checked whether source_selection existed, regardless of the excluded-file count.

Complete selection should not produce this limitation. Partial selection should continue to report excluded sources and incomplete coverage.

Change and scope

  • Added sourceSelectionGap() in JavaScriptArtifactGraphBuilder.ts to centralize the existing unselected_files > 0 condition.
  • Used the shared check for graph coverage and limitation generation.
  • Preserved the existing limitation text and coverage behavior when sources remain excluded.
  • Added CLI and MCP regression tests for complete selection and retained assertions for partial selection.

The change is limited to JavaScript artifact graph construction and regression coverage. It does not change source inventory, selection inputs, graph relationships, or other analysis limitations.

Contract and boundary impact

  • Semantic owner and earliest changed stage: JavaScriptArtifactGraphBuilder.ts, during graph coverage and limitation construction.
  • Contribution scope fit and linked maintainer decision: Existing static-analysis diagnostic correction. No new capability; separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: Both CLI analysis commands and the MCP application tool omit the misleading limitation for complete selection. No tool arguments or response schema changes.
  • Provider, bridge, target-format, or platform compatibility: No provider or bridge changes.
  • Evidence, artifact, provenance, or reconstruction contract: Corrects the limitation text emitted for complete source selection. Existing inventory, graph coverage, and reconstruction data remain unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: No change to target selection or execution authority.
  • Generated metadata, package, or installation impact: None.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:
    • javascriptSourceSelectionCli.test.ts: Covers complete selection through analyze and analyze-javascript-application, and verifies that the limitation remains for partial selection.
    • javascriptSourceSelection.test.ts: Covers complete selection through the MCP application tool.
  • Base reproduction or other evidence: The two new CLI regression cases failed before the fix, reproducing the reported behavior.
  • User-visible CLI/MCP output: With both main.mjs and util.mjs selected, unselected_files remains 0, graph coverage remains complete, and the unselected-source limitation is omitted. With four files excluded, the existing limitation remains present.
  • Remaining proof gaps: No separate real-provider or ASAR-specific verification was performed.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Pre-fix CLI regression reproduction: 2 new cases failed as expected.
  • Focused CLI/MCP tests: 14 passed.
  • npm run check:fast: passed.
  • npm run check: passed, including typecheck, lint, formatting, Knip, metadata, module boundaries, and architecture checks.
  • git diff --check: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: None. This removes an incorrect diagnostic without changing the response schema.
  • Real Hopper/Ghidra, browser, or OS coverage: Not required for the changed static JavaScript graph-building logic; no separate real-provider verification performed.
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: No new execution, instrumentation, network, or mutation capabilities. The change affects existing static-analysis limitation reporting only.

Author readiness

Human owner: @abhishek-kumbhar

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5428 **Author:** [@Abhiiishek44](https://github.com/Abhiiishek44) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/javascript-source-selection-limitations` --- ### 📝 Commits (1) - [`8eccd2d`](https://github.com/morluto/rea/commit/8eccd2de45bd547da50a09da93a6a5c6d3001316) fix: omit unselected-source limitation when all sources are selected ### 📊 Changes **3 files changed** (+112 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptArtifactGraphBuilder.ts` (+14 -3) 📝 `tests/acceptance/applications/javascriptSourceSelectionCli.test.ts` (+56 -0) 📝 `tests/boundary/mcp/javascriptSourceSelection.test.ts` (+42 -0) </details> ### 📄 Description ## Summary Fixes #5407. Avoids reporting an unselected-source limitation when explicit JavaScript source selection includes every inventoried file. Graph coverage and limitation generation now use the same source-selection gap check. ## Problem and expected behavior When all JavaScript sources were explicitly selected, both `analyze` and `analyze-javascript-application` reported complete graph coverage with `unselected_files: 0`, but still emitted: > Caller-selected source analysis leaves 0 inventoried files outside analysis scope. The coverage calculation already treated source selection as a gap only when `unselected_files > 0`. Limitation generation instead checked whether `source_selection` existed, regardless of the excluded-file count. Complete selection should not produce this limitation. Partial selection should continue to report excluded sources and incomplete coverage. ## Change and scope - Added `sourceSelectionGap()` in `JavaScriptArtifactGraphBuilder.ts` to centralize the existing `unselected_files > 0` condition. - Used the shared check for graph coverage and limitation generation. - Preserved the existing limitation text and coverage behavior when sources remain excluded. - Added CLI and MCP regression tests for complete selection and retained assertions for partial selection. The change is limited to JavaScript artifact graph construction and regression coverage. It does not change source inventory, selection inputs, graph relationships, or other analysis limitations. ## Contract and boundary impact - **Semantic owner and earliest changed stage:** `JavaScriptArtifactGraphBuilder.ts`, during graph coverage and limitation construction. - **Contribution scope fit and linked maintainer decision:** Existing static-analysis diagnostic correction. No new capability; separate scope decision not applicable. - **CLI and MCP/tool-catalog contract:** Both CLI analysis commands and the MCP application tool omit the misleading limitation for complete selection. No tool arguments or response schema changes. - **Provider, bridge, target-format, or platform compatibility:** No provider or bridge changes. - **Evidence, artifact, provenance, or reconstruction contract:** Corrects the limitation text emitted for complete source selection. Existing inventory, graph coverage, and reconstruction data remain unchanged. - **Target selection, authority, upstream behavior, and cleanup details:** No change to target selection or execution authority. - **Generated metadata, package, or installation impact:** None. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - **Tests added or updated:** - `javascriptSourceSelectionCli.test.ts`: Covers complete selection through `analyze` and `analyze-javascript-application`, and verifies that the limitation remains for partial selection. - `javascriptSourceSelection.test.ts`: Covers complete selection through the MCP application tool. - **Base reproduction or other evidence:** The two new CLI regression cases failed before the fix, reproducing the reported behavior. - **User-visible CLI/MCP output:** With both `main.mjs` and `util.mjs` selected, `unselected_files` remains `0`, graph coverage remains `complete`, and the unselected-source limitation is omitted. With four files excluded, the existing limitation remains present. - **Remaining proof gaps:** No separate real-provider or ASAR-specific verification was performed. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - Pre-fix CLI regression reproduction: 2 new cases failed as expected. - Focused CLI/MCP tests: 14 passed. - `npm run check:fast`: passed. - `npm run check`: passed, including typecheck, lint, formatting, Knip, metadata, module boundaries, and architecture checks. - `git diff --check`: passed. ## Compatibility, safety, and release - **Breaking changes or migration steps:** None. This removes an incorrect diagnostic without changing the response schema. - **Real Hopper/Ghidra, browser, or OS coverage:** Not required for the changed static JavaScript graph-building logic; no separate real-provider verification performed. - **Package or release metadata impact:** None. - **Security, privacy, process, or containment review:** No new execution, instrumentation, network, or mutation capabilities. The change affects existing static-analysis limitation reporting only. ## Author readiness Human owner: @abhishek-kumbhar - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6927
No description provided.