[PR #1975] [CLOSED] fix(javascript): keep unselected sources out of cancellation failures #4944

Closed
opened 2026-10-31 00:57:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1975
Author: @kaoru0822-kitauji
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: fix/issue-1968


📝 Commits (1)

  • 8a8efb8 fix(javascript): keep unselected sources out of cancellation failures

📊 Changes

2 files changed (+80 additions, -29 deletions)

View changed files

📝 src/application/javascript/JavaScriptArtifactAnalysis.ts (+18 -29)
➕ tests/boundary/filesystem/javascript-applications/javascriptSelectedSourceCancellation.test.ts (+62 -0)

📄 Description

Fixes #1968

Behavior

With source_paths, analyzeAndAdoptJavaScriptArtifactFiles checked cancellation before it recognized an outside-analysis-scope file. If cancellation arrived after the last selected source finished, the next unselected file was recorded as a cancelled analysis_failure. The completion loop then skipped that file as already analyzed. Every unselected file now stays classified as outside the caller-selected source_paths, and the cancellation is still returned as the interruption. Found by Codex on #1944.

The worker loop, its interruption handler, and the completion loop now share one recordOutsideSelection owner. Before, the loop and the completion loop each had their own copy of the classification, and the handler had none.

Still separate: analyzeArtifactFileSteps, the in-process step path, has its own out-of-scope check. It has no semantic projection to record into, so it only appends the file.

Validation

  • New boundary test tests/boundary/filesystem/javascript-applications/javascriptSelectedSourceCancellation.test.ts uses the real selection fixture and the real worker, and aborts right after the selected source returns. It fails on main (one unselected file carries a cancelled analysis_failure) and passes here.
  • The 229 tests in the selection, application service, source-selection CLI, and src/application/javascript suites pass.
  • npm run lint, npm run typecheck, npm run format:check: pass.
  • npm test: 8,408 passed, 16 failed. Twelve are this Mac's usual environmental failures (ibtool, hdiutil, JS runtime paths under /private/var). The other four fail identically on clean main 1d4c4eb03 and are unrelated to this change:
    • src/browser/CdpCaptureEvents.redirectBodyShape.test.ts: already captured response shape
    • tests/boundary/filesystem/qwenClientConfiguration.test.ts (×2): { ok: true, value: "installed" } vs "installed"
    • tests/boundary/providers/native/nativeProvider.test.ts: otool output is missing the Mach header

🤖 Generated with Claude Code


🔄 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/1975 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/issue-1968` --- ### 📝 Commits (1) - [`8a8efb8`](https://github.com/morluto/rea/commit/8a8efb822677327070ef36fa187f00eafc9d0ef6) fix(javascript): keep unselected sources out of cancellation failures ### 📊 Changes **2 files changed** (+80 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptArtifactAnalysis.ts` (+18 -29) ➕ `tests/boundary/filesystem/javascript-applications/javascriptSelectedSourceCancellation.test.ts` (+62 -0) </details> ### 📄 Description Fixes #1968 ## Behavior With `source_paths`, `analyzeAndAdoptJavaScriptArtifactFiles` checked cancellation before it recognized an `outside-analysis-scope` file. If cancellation arrived after the last selected source finished, the next unselected file was recorded as a cancelled `analysis_failure`. The completion loop then skipped that file as already analyzed. Every unselected file now stays classified as outside the caller-selected `source_paths`, and the cancellation is still returned as the interruption. Found by Codex on #1944. ## Related cleanup The worker loop, its interruption handler, and the completion loop now share one `recordOutsideSelection` owner. Before, the loop and the completion loop each had their own copy of the classification, and the handler had none. Still separate: `analyzeArtifactFileSteps`, the in-process step path, has its own out-of-scope check. It has no semantic projection to record into, so it only appends the file. ## Validation - New boundary test `tests/boundary/filesystem/javascript-applications/javascriptSelectedSourceCancellation.test.ts` uses the real selection fixture and the real worker, and aborts right after the selected source returns. It fails on main (one unselected file carries a `cancelled` `analysis_failure`) and passes here. - The 229 tests in the selection, application service, source-selection CLI, and `src/application/javascript` suites pass. - `npm run lint`, `npm run typecheck`, `npm run format:check`: pass. - `npm test`: 8,408 passed, 16 failed. Twelve are this Mac's usual environmental failures (ibtool, hdiutil, JS runtime paths under `/private/var`). The other four fail identically on clean main `1d4c4eb03` and are unrelated to this change: - `src/browser/CdpCaptureEvents.redirectBodyShape.test.ts`: already captured response shape - `tests/boundary/filesystem/qwenClientConfiguration.test.ts` (×2): `{ ok: true, value: "installed" }` vs `"installed"` - `tests/boundary/providers/native/nativeProvider.test.ts`: otool output is missing the Mach header 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:13 +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#4944
No description provided.