[PR #5048] feat(javascript): select inventoried sources by folder and glob #6759

Open
opened 2026-11-01 21:42:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5048
Author: @s4h8a
Created: 10/18/2026
Status: 🔄 Open

Base: main ← Head: feat/javascript-source-folder-glob-selection


📝 Commits (4)

  • 6014f00 feat(javascript): select inventoried sources by folder and glob
  • 0c27335 chore(javascript): integrate current main for pattern selection
  • 81ea528 fix(javascript): resolve source selectors without recursive stack growth
  • 106cc15 docs(javascript): record source selector verification and costs

📊 Changes

14 files changed (+985 additions, -63 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/javascript-applications.md (+15 -12)
📝 docs/javascript-artifact-reconstruction.md (+26 -15)
➕ docs/verification/javascript-source-selectors-2026-10-24.md (+96 -0)
📝 src/artifacts/javascript/JavaScriptArtifactFiles.ts (+29 -28)
📝 src/cli/javascriptApplicationAnalysis.ts (+1 -1)
📝 src/cliObservationOptions.ts (+1 -1)
📝 src/contracts/javascript/electronToolContracts.ts (+9 -1)
📝 src/domain/javascript/javascriptSourceSelection.ts (+15 -3)
➕ src/domain/javascript/javascriptSourceSelectionResolution.test.ts (+274 -0)
➕ src/domain/javascript/javascriptSourceSelectionResolution.ts (+171 -0)
➕ tests/acceptance/applications/javascriptSourcePatternSelectionCli.test.ts (+203 -0)
📝 tests/boundary/filesystem/javascriptDirectoryCoverage.test.ts (+68 -0)
📝 tests/boundary/mcp/javascriptSourceSelection.test.ts (+32 -2)
➕ tests/fixtures/javascriptSourceTree.ts (+45 -0)

📄 Description

Extends existing static JavaScript source selection with inventoried folders and globs (*, ?, whole-segment **). Exact file paths retain precedence, request order/duplicates remain recorded, and overlapping matches are analyzed once. Expanded selections expose their exact selected_paths; exact-only output remains compatible. Works through both CLI routes, #5029 JSON-array/file input and MCP without executing target code. Related #4987.

The resolver owns matching and incomplete-inventory applicability. Matching is iterative, compiles patterns and path segments once, sorts once when expansion requires it, and avoids those allocations for exact-only selections. Unmatched selectors under unknown directory traversal return unavailable with retained inventory; observed matches remain usable with explicit partial coverage. The redundant consumer-side interpretation is removed.

Validation: all 46 selected source/filesystem/public-CLI/production-stdio-MCP checks pass, including directory/ASAR, JSON-file selectors, exact-only behavior, schema/identity preservation, unreadable directories, Unicode/backtracking and two ~600 KB selectors that previously overflowed the stack. The initial 20,000-segment cases passed; definitive failure controls use 200,000 segments. Initial boundary worker crashes were missing-build setup failures, and both trees were then built before comparison. check:fast, complete format:check and docs:check pass. Executed here on non-root Linux; the contributor's earlier Windows 11 claim was not rerun.

Twelve completed alternating CLI tasks preserve every Evidence field and ID. Estimated full stdout plus invocation tokens remain 574,036 for a folder and 672,849 for a legal overlapping-selector capacity case. Timing/CPU ranges overlap; normal medians rise and capacity medians fall, so no general speed or memory improvement is claimed. The application remains explicitly partial for its unselected manifest, with all 128 selected modules processed. Exact pins, costs, warm/cold scope, exclusions and limitations: verification report.

This PR remains in its original draft state. The existing unchecked human-readiness declarations are preserved below.

Author readiness

Human owner: @s4h8a

  • 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.

🔄 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/5048 **Author:** [@s4h8a](https://github.com/s4h8a) **Created:** 10/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/javascript-source-folder-glob-selection` --- ### 📝 Commits (4) - [`6014f00`](https://github.com/morluto/rea/commit/6014f00ff5fd639261d6439e6786fb96c9d98649) feat(javascript): select inventoried sources by folder and glob - [`0c27335`](https://github.com/morluto/rea/commit/0c273357e5ff75d4e053e38a043f29243c3e5f1b) chore(javascript): integrate current main for pattern selection - [`81ea528`](https://github.com/morluto/rea/commit/81ea5288ade45836d27312f81906d299958d58a8) fix(javascript): resolve source selectors without recursive stack growth - [`106cc15`](https://github.com/morluto/rea/commit/106cc153948352bfe895dde160a10428836ada64) docs(javascript): record source selector verification and costs ### 📊 Changes **14 files changed** (+985 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/javascript-applications.md` (+15 -12) 📝 `docs/javascript-artifact-reconstruction.md` (+26 -15) ➕ `docs/verification/javascript-source-selectors-2026-10-24.md` (+96 -0) 📝 `src/artifacts/javascript/JavaScriptArtifactFiles.ts` (+29 -28) 📝 `src/cli/javascriptApplicationAnalysis.ts` (+1 -1) 📝 `src/cliObservationOptions.ts` (+1 -1) 📝 `src/contracts/javascript/electronToolContracts.ts` (+9 -1) 📝 `src/domain/javascript/javascriptSourceSelection.ts` (+15 -3) ➕ `src/domain/javascript/javascriptSourceSelectionResolution.test.ts` (+274 -0) ➕ `src/domain/javascript/javascriptSourceSelectionResolution.ts` (+171 -0) ➕ `tests/acceptance/applications/javascriptSourcePatternSelectionCli.test.ts` (+203 -0) 📝 `tests/boundary/filesystem/javascriptDirectoryCoverage.test.ts` (+68 -0) 📝 `tests/boundary/mcp/javascriptSourceSelection.test.ts` (+32 -2) ➕ `tests/fixtures/javascriptSourceTree.ts` (+45 -0) </details> ### 📄 Description Extends existing static JavaScript source selection with inventoried folders and globs (`*`, `?`, whole-segment `**`). Exact file paths retain precedence, request order/duplicates remain recorded, and overlapping matches are analyzed once. Expanded selections expose their exact `selected_paths`; exact-only output remains compatible. Works through both CLI routes, #5029 JSON-array/file input and MCP without executing target code. Related #4987. The resolver owns matching and incomplete-inventory applicability. Matching is iterative, compiles patterns and path segments once, sorts once when expansion requires it, and avoids those allocations for exact-only selections. Unmatched selectors under unknown directory traversal return unavailable with retained inventory; observed matches remain usable with explicit partial coverage. The redundant consumer-side interpretation is removed. Validation: all 46 selected source/filesystem/public-CLI/production-stdio-MCP checks pass, including directory/ASAR, JSON-file selectors, exact-only behavior, schema/identity preservation, unreadable directories, Unicode/backtracking and two ~600 KB selectors that previously overflowed the stack. The initial 20,000-segment cases passed; definitive failure controls use 200,000 segments. Initial boundary worker crashes were missing-build setup failures, and both trees were then built before comparison. check:fast, complete format:check and docs:check pass. Executed here on non-root Linux; the contributor's earlier Windows 11 claim was not rerun. Twelve completed alternating CLI tasks preserve every Evidence field and ID. Estimated full stdout plus invocation tokens remain 574,036 for a folder and 672,849 for a legal overlapping-selector capacity case. Timing/CPU ranges overlap; normal medians rise and capacity medians fall, so no general speed or memory improvement is claimed. The application remains explicitly partial for its unselected manifest, with all 128 selected modules processed. Exact pins, costs, warm/cold scope, exclusions and limitations: [verification report](docs/verification/javascript-source-selectors-2026-10-24.md). This PR remains in its original draft state. The existing unchecked human-readiness declarations are preserved below. ## Author readiness Human owner: @s4h8a - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6759
No description provided.