[GH-ISSUE #4569] [Bug] Provider profile evaluation discards completion and cleanup facts on cancellation #2374

Closed
opened 2026-10-17 21:03:53 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4569

Before submitting

  • Searched open and closed profile/cancellation reports and exact AnalysisProviderEvaluation references.
  • Removed credentials and private target data.

Area

Provider or capability discovery

Observed behavior

Source-only finding: evaluateAnalysisProviderCandidate races candidate.resolveAnalysisProfile against the caller signal, returns a new cancellation when the race is aborted, and checks the latest signal again before interpreting an already returned Result. A provider's earlier physical failure, exact cancellation reason, or cleanup observation can therefore be replaced by generic cancellation. In the aborted-race case, profile resolution can continue after evaluation returns.

Reproduction

NOT_ENOUGH_INFO: no registered CLI/MCP reproduction of this registry boundary. Source inspected at ae07d151704bac5f0129985cedb92546d2d5411e: src/application/binary/AnalysisProviderEvaluation.ts, waitForAbortable call, ABORTED branch and post-resolution signal check. Proposed regression: a provider whose final file close aborts the caller after an earlier read failure; separately return typed cancellation with an unresolved cleanup owner. Assert the admitted caller receives the producer facts and shutdown joins the exact owner.

Expected behavior

Give asynchronous profile resolution an explicit completion owner. Preserve the provider's typed physical result, exact cancellation and cleanup dependencies through evaluation and selection. Define when caller departure can return early and who joins finalization before subsequent admission or shutdown. Avoid merely removing the cancellation race if that makes arbitrary provider promises hang without an owner.

Impact and scope

Source-derived shared admission/finalization defect; frequency, naturally occurring resource leakage and native-provider incidence are NOT_ENOUGH_INFO. #4521 concerns PSP's own file/directory inspection; #4517 concerns launcher/client classification after profile admission. This report covers their independent shared registry consumer. #3930 covers explicit profile refusal selection diagnostics.

REA version

Source ae07d151704bac5f0129985cedb92546d2d5411e; adjacent local PSP ownership work does not change this registry boundary.

Runtime and platform

Source review on macOS arm64, Node 24.18.0. No native Windows or real Ghidra admission fault verification.

Target and artifact context

No private target; source review only.

Interface

Other (shared CLI/MCP provider admission).

Earliest failure stage

Cleanup, cancellation, or lifecycle.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4569 ### Before submitting - [x] Searched open and closed profile/cancellation reports and exact `AnalysisProviderEvaluation` references. - [x] Removed credentials and private target data. ### Area Provider or capability discovery ### Observed behavior **Source-only finding:** `evaluateAnalysisProviderCandidate` races `candidate.resolveAnalysisProfile` against the caller signal, returns a new cancellation when the race is aborted, and checks the latest signal again before interpreting an already returned `Result`. A provider's earlier physical failure, exact cancellation reason, or cleanup observation can therefore be replaced by generic cancellation. In the aborted-race case, profile resolution can continue after evaluation returns. ### Reproduction NOT_ENOUGH_INFO: no registered CLI/MCP reproduction of this registry boundary. Source inspected at `ae07d151704bac5f0129985cedb92546d2d5411e`: `src/application/binary/AnalysisProviderEvaluation.ts`, `waitForAbortable` call, `ABORTED` branch and post-resolution signal check. Proposed regression: a provider whose final file close aborts the caller after an earlier read failure; separately return typed cancellation with an unresolved cleanup owner. Assert the admitted caller receives the producer facts and shutdown joins the exact owner. ### Expected behavior Give asynchronous profile resolution an explicit completion owner. Preserve the provider's typed physical result, exact cancellation and cleanup dependencies through evaluation and selection. Define when caller departure can return early and who joins finalization before subsequent admission or shutdown. Avoid merely removing the cancellation race if that makes arbitrary provider promises hang without an owner. ### Impact and scope Source-derived shared admission/finalization defect; frequency, naturally occurring resource leakage and native-provider incidence are NOT_ENOUGH_INFO. #4521 concerns PSP's own file/directory inspection; #4517 concerns launcher/client classification after profile admission. This report covers their independent shared registry consumer. #3930 covers explicit profile refusal selection diagnostics. ### REA version Source `ae07d151704bac5f0129985cedb92546d2d5411e`; adjacent local PSP ownership work does not change this registry boundary. ### Runtime and platform Source review on macOS arm64, Node 24.18.0. No native Windows or real Ghidra admission fault verification. ### Target and artifact context No private target; source review only. ### Interface Other (shared CLI/MCP provider admission). ### Earliest failure stage Cleanup, cancellation, or lifecycle.
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 17, 2026):

This appears fixed on current main (2092f90b7) by f26973a52 (the commit message references this issue).

Executed on main 2092f90b7 (macOS arm64, Node 24): npm run test:focused -- … including src/application/binary/AnalysisProviderRegistry.test.ts (21 tests) — all passed (205/205 across the 13 files checked in this batch).

I did not rerun the original fault injection from the report separately; the tests above are the regressions added with the fix. Leaving closure to a maintainer.

<!-- gh-comment-id:6232497394 --> @kaoru0822-kitauji commented on GitHub (Oct 17, 2026): This appears fixed on current main (2092f90b7) by f26973a52 (the commit message references this issue). Executed on main 2092f90b7 (macOS arm64, Node 24): `npm run test:focused -- …` including `src/application/binary/AnalysisProviderRegistry.test.ts` (21 tests) — all passed (205/205 across the 13 files checked in this batch). I did not rerun the original fault injection from the report separately; the tests above are the regressions added with the fix. Leaving closure to a maintainer.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • f26973a52: fix(providers): own profile selection through finalization.
  • b0ddb58e2: fix(ghidra): own PSP inspection finalization. Validation: 137 tests passed, 3 platform skips across six filesystem/provider/MCP files; check:fast passed. Controlled real-handle fixtures do not establish actual Allegrex execution or native Windows faults.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6256003236 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4569 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [f26973a52](https://github.com/morluto/rea/commit/f26973a52918a938631e90fdc9116f7b85a62a52): fix(providers): own profile selection through finalization. - [b0ddb58e2](https://github.com/morluto/rea/commit/b0ddb58e27b18af996f0411b0eb02a128f237a0a): fix(ghidra): own PSP inspection finalization. Validation: 137 tests passed, 3 platform skips across six filesystem/provider/MCP files; check:fast passed. Controlled real-handle fixtures do not establish actual Allegrex execution or native Windows faults. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
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#2374
No description provided.