[PR #5869] [CLOSED] fix(javascript): omit unselected-source limitation when every source is selected #7094

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5869
Author: @KumarSharmaAkash
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: fix/5407-zero-unselected-warning


📝 Commits (1)

  • e8b8de4 fix(javascript): omit unselected-source limitation when every source is selected

📊 Changes

2 files changed (+39 additions, -1 deletions)

View changed files

📝 src/application/javascript/JavaScriptArtifactGraphBuilder.ts (+2 -1)
📝 tests/acceptance/applications/javascriptSourceSelectionCli.test.ts (+37 -0)

📄 Description

Summary

Fixes #5407

Selecting every inventoried JavaScript source with --source-path reported
source_selection.unselected_files: 0 and complete coverage, yet the graph still
carried the limitation "Caller-selected source analysis leaves 0 inventoried files
outside analysis scope … relationships through unselected sources remain unknown."
That limitation is now emitted only when at least one inventoried file is left
outside analysis scope.

Problem and expected behavior

Smallest trigger: a directory with main.mjs (imports ./util.mjs) and util.mjs,
analyzed with --source-path main.mjs --source-path util.mjs. No source is
unselected, so no relationship can pass through an unselected source; the limitation
contradicted the result's own unselected_files: 0. Partial selections must keep
the limitation.

Change and scope

graphLimitations in src/application/javascript/JavaScriptArtifactGraphBuilder.ts
already owns this limitation and reads source_selection.unselected_files for its
text; the condition now also requires that count to be non-zero. No other
consumer reinterprets the selection. Nothing else is changed.

Contribution scope: ordinary fix within existing boundaries; maintainer scope
decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: graphLimitations (JavaScript application graph construction).
  • Contribution scope fit and linked maintainer decision: not applicable (bug fix).
  • CLI and MCP/tool-catalog contract: no schema change; one spurious limitation string is no longer emitted when every source is selected.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: Evidence for full selections no longer contains the contradictory limitation; partial selections unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • 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: tests/acceptance/applications/javascriptSourceSelectionCli.test.ts — new CLI test runs the two-file fixture with both sources selected (expects unselected_files: 0 and no limitation) and with only main.mjs selected (expects unselected_files: 1 and the limitation).
  • Base reproduction or other evidence: on base f801b2fbf, the issue's analyze-javascript-application command emitted the "leaves 0 inventoried files" limitation. With the source change reverted, the new test fails (expected true to be false); with the change it passes.
  • User-visible CLI/MCP output (if applicable): with both sources selected, analyze-javascript-application and analyze output contain no "Caller-selected source analysis leaves" text; with one source selected, output still contains "leaves 1 inventoried files …".
  • Remaining proof gaps: only the edited test file was run, not the full suite; MCP path not separately exercised (it shares the same graph builder).

Validation performed

Executed on macOS (arm64), Node 24.14.0:

  • npx vitest run tests/acceptance/applications/javascriptSourceSelectionCli.test.ts — 6 passed.
  • Same test with the source change stashed — new test failed, 5 skipped.
  • node scripts/rea.mjs analyze-javascript-application <fixture> --source-path main.mjs --source-path util.mjs --format json (and analyze) — limitation absent after the fix, present before.
  • npx tsc --noEmit — passed.
  • npx oxlint on both changed files — 2 warnings (max-lines-per-function, complexity), both present on base before this change.
  • npx oxfmt --check on both changed files — clean after formatting.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable (static JavaScript analysis, no provider).
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new reads, processes, or network access.

Author readiness

Human owner: @KumarSharmaAkash

  • 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/5869 **Author:** [@KumarSharmaAkash](https://github.com/KumarSharmaAkash) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/5407-zero-unselected-warning` --- ### 📝 Commits (1) - [`e8b8de4`](https://github.com/morluto/rea/commit/e8b8de48ce7797321f13554e789e19e203b9204a) fix(javascript): omit unselected-source limitation when every source is selected ### 📊 Changes **2 files changed** (+39 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptArtifactGraphBuilder.ts` (+2 -1) 📝 `tests/acceptance/applications/javascriptSourceSelectionCli.test.ts` (+37 -0) </details> ### 📄 Description ## Summary Fixes #5407 Selecting every inventoried JavaScript source with `--source-path` reported `source_selection.unselected_files: 0` and complete coverage, yet the graph still carried the limitation "Caller-selected source analysis leaves 0 inventoried files outside analysis scope … relationships through unselected sources remain unknown." That limitation is now emitted only when at least one inventoried file is left outside analysis scope. ## Problem and expected behavior Smallest trigger: a directory with `main.mjs` (imports `./util.mjs`) and `util.mjs`, analyzed with `--source-path main.mjs --source-path util.mjs`. No source is unselected, so no relationship can pass through an unselected source; the limitation contradicted the result's own `unselected_files: 0`. Partial selections must keep the limitation. ## Change and scope `graphLimitations` in `src/application/javascript/JavaScriptArtifactGraphBuilder.ts` already owns this limitation and reads `source_selection.unselected_files` for its text; the condition now also requires that count to be non-zero. No other consumer reinterprets the selection. Nothing else is changed. Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: `graphLimitations` (JavaScript application graph construction). - Contribution scope fit and linked maintainer decision: not applicable (bug fix). - CLI and MCP/tool-catalog contract: no schema change; one spurious limitation string is no longer emitted when every source is selected. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: Evidence for full selections no longer contains the contradictory limitation; partial selections unchanged. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata, package, or installation impact: none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] 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: `tests/acceptance/applications/javascriptSourceSelectionCli.test.ts` — new CLI test runs the two-file fixture with both sources selected (expects `unselected_files: 0` and no limitation) and with only `main.mjs` selected (expects `unselected_files: 1` and the limitation). - Base reproduction or other evidence: on base `f801b2fbf`, the issue's `analyze-javascript-application` command emitted the "leaves 0 inventoried files" limitation. With the source change reverted, the new test fails (`expected true to be false`); with the change it passes. - User-visible CLI/MCP output (if applicable): with both sources selected, `analyze-javascript-application` and `analyze` output contain no "Caller-selected source analysis leaves" text; with one source selected, output still contains "leaves 1 inventoried files …". - Remaining proof gaps: only the edited test file was run, not the full suite; MCP path not separately exercised (it shares the same graph builder). ## Validation performed Executed on macOS (arm64), Node 24.14.0: - `npx vitest run tests/acceptance/applications/javascriptSourceSelectionCli.test.ts` — 6 passed. - Same test with the source change stashed — new test failed, 5 skipped. - `node scripts/rea.mjs analyze-javascript-application <fixture> --source-path main.mjs --source-path util.mjs --format json` (and `analyze`) — limitation absent after the fix, present before. - `npx tsc --noEmit` — passed. - `npx oxlint` on both changed files — 2 warnings (`max-lines-per-function`, `complexity`), both present on base before this change. - `npx oxfmt --check` on both changed files — clean after formatting. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable (static JavaScript analysis, no provider). - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new reads, processes, or network access. ## Author readiness Human owner: @KumarSharmaAkash - [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 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:20 +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#7094
No description provided.