[GH-ISSUE #6428] [Bug] commandFinalizationCancellation bundle projection cases fail on main since b7f8bbb4 #3846

Closed
opened 2026-10-31 00:44:35 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Sriram-PR on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6428

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Other

Observed behavior

Test shard 4 has been red on main since b7f8bbb4 (refactor(analysis-view): unify request and source ownership), and it fails every PR based on it (#6423, #6424 and #6425 at least). Three cases in tests/process-global/commandFinalizationCancellation.test.ts fail:

  • preserves the analysis-view result and exit status for bundle: SIGINT during projection
  • preserves the analysis-view result and exit status for bundle: SIGTERM during projection
  • preserves the analysis-view result and exit status for bundle: SIGTERM during projection-failure

Each one expects code: "cancelled" and gets the projected summary Evidence back instead.

Reproduction

git checkout ed069bb9   # or b7f8bbb4
npm ci && npm run build:cached
npm run test:focused -- tests/process-global/commandFinalizationCancellation.test.ts
# Tests  3 failed | 17 passed (20)
git checkout 6b7aa124   # parent of b7f8bbb4
npm run test:focused -- tests/process-global/commandFinalizationCancellation.test.ts
# Tests  20 passed (20)

Expected behavior

The 3 bundle projection cases pass again, so shard 4 is green on main and on PRs.

Impact and scope

CI only, as far as I can tell: every PR based on main since b7f8bbb4 fails Test shard (4/8), Portable tests and CI required. I haven't seen anything pointing at a production cancellation bug (see the analysis below).

REA version

main ed069bb9 (first bad b7f8bbb4, last good 6b7aa124)

Runtime and platform

Node 24.18.0 (repo pin), Linux x64 locally; same failure on the GitHub Actions shard 4 runs

Target and artifact context

Test fixtures only (the analysis-view layout Evidence and bundle the test writes)

Interface

CLI

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

FAIL  tests/process-global/commandFinalizationCancellation.test.ts > preserves the analysis-view result and exit status for bundle: SIGINT during projection
AssertionError: expected { ...(16) } to match object { code: 'cancelled' }
-   "code": "cancelled",
+   "analysis_profile": null,
+   "authority": "shipped-artifact",
...
+     "kind": "summary",

Same output on main's own shard 4 run for da9a580a and on the PR runs.

Typed outcome or recovery expected

No response

Analysis or suspected cause

Looks like the test hook stopped firing rather than the cancellation itself breaking. The test queues its interrupt from vi.spyOn(analysisViewService, "inspectAnalysisViewValidated"). Before b7f8bbb4 the bundle path was inspectAnalysisViewFromBundle in EvidenceBundleCommands.ts, which called that function through its import, so the spy saw it. Now the bundle path is inspectBundleView inside AnalysisViewService.ts and calls inspectAnalysisViewValidated in the same module, so the spy on the module namespace never runs. I counted the spy calls on ed069bb9 and it's 0 for all nine bundle cases, so no interrupt is queued in the projection phases. The authentication and close cases still pass because they hook OwnedFileHandle.prototype.close instead.

I didn't check whether inspectBundleView still handles a real interrupt during projection; the dispatchQueuedInterrupts() + signal.aborted check after projection is still there, so it probably does. The fix is probably on the test side (hook something the bundle path still calls across a module boundary), but I haven't tried one.

Additional context

No response

Originally created by @Sriram-PR on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6428 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Other ### Observed behavior Test shard 4 has been red on main since b7f8bbb4 (refactor(analysis-view): unify request and source ownership), and it fails every PR based on it (#6423, #6424 and #6425 at least). Three cases in `tests/process-global/commandFinalizationCancellation.test.ts` fail: - preserves the analysis-view result and exit status for bundle: SIGINT during projection - preserves the analysis-view result and exit status for bundle: SIGTERM during projection - preserves the analysis-view result and exit status for bundle: SIGTERM during projection-failure Each one expects `code: "cancelled"` and gets the projected summary Evidence back instead. ### Reproduction ```sh git checkout ed069bb9 # or b7f8bbb4 npm ci && npm run build:cached npm run test:focused -- tests/process-global/commandFinalizationCancellation.test.ts # Tests 3 failed | 17 passed (20) git checkout 6b7aa124 # parent of b7f8bbb4 npm run test:focused -- tests/process-global/commandFinalizationCancellation.test.ts # Tests 20 passed (20) ``` ### Expected behavior The 3 bundle projection cases pass again, so shard 4 is green on main and on PRs. ### Impact and scope CI only, as far as I can tell: every PR based on main since b7f8bbb4 fails `Test shard (4/8)`, `Portable tests` and `CI required`. I haven't seen anything pointing at a production cancellation bug (see the analysis below). ### REA version main ed069bb9 (first bad b7f8bbb4, last good 6b7aa124) ### Runtime and platform Node 24.18.0 (repo pin), Linux x64 locally; same failure on the GitHub Actions shard 4 runs ### Target and artifact context Test fixtures only (the analysis-view layout Evidence and bundle the test writes) ### Interface CLI ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence ``` FAIL tests/process-global/commandFinalizationCancellation.test.ts > preserves the analysis-view result and exit status for bundle: SIGINT during projection AssertionError: expected { ...(16) } to match object { code: 'cancelled' } - "code": "cancelled", + "analysis_profile": null, + "authority": "shipped-artifact", ... + "kind": "summary", ``` Same output on main's own shard 4 run for da9a580a and on the PR runs. ### Typed outcome or recovery expected _No response_ ### Analysis or suspected cause Looks like the test hook stopped firing rather than the cancellation itself breaking. The test queues its interrupt from `vi.spyOn(analysisViewService, "inspectAnalysisViewValidated")`. Before b7f8bbb4 the bundle path was `inspectAnalysisViewFromBundle` in `EvidenceBundleCommands.ts`, which called that function through its import, so the spy saw it. Now the bundle path is `inspectBundleView` inside `AnalysisViewService.ts` and calls `inspectAnalysisViewValidated` in the same module, so the spy on the module namespace never runs. I counted the spy calls on ed069bb9 and it's 0 for all nine bundle cases, so no interrupt is queued in the projection phases. The authentication and close cases still pass because they hook `OwnedFileHandle.prototype.close` instead. I didn't check whether `inspectBundleView` still handles a real interrupt during projection; the `dispatchQueuedInterrupts()` + `signal.aborted` check after projection is still there, so it probably does. The fix is probably on the test side (hook something the bundle path still calls across a module boundary), but I haven't tried one. ### Additional context _No response_
bsakaguchi 2026-10-31 00:44:35 +00:00
  • closed this issue
  • added the
    bug
    triage
    labels
Author
Owner

@Sriram-PR commented on GitHub (Oct 23, 2026):

Fixed by #6431, which moved the spies onto the imported projector and resolver. commandFinalizationCancellation.test.ts passes 20/20 for me on main (e32a0494) and shard 4 is green again, so closing.

<!-- gh-comment-id:6357228155 --> @Sriram-PR commented on GitHub (Oct 23, 2026): Fixed by #6431, which moved the spies onto the imported projector and resolver. commandFinalizationCancellation.test.ts passes 20/20 for me on main (e32a0494) and shard 4 is green again, so closing.
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#3846
No description provided.