[GH-ISSUE #4929] [Bug] Rust, Go and PE service admission discards caller cancellation reasons #3057

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

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

Before submitting

  • Searched open and closed cancellation-reason issues. #4858 covered artifact producer/signal consumers; #4458 concerns descriptor ownership. This report covers sibling artifact service admission.
  • No credentials or private targets included.

Area

Evidence, artifacts, or reconstruction

Observed behavior

At a8170163b, RustBinaryService, GoBinaryService and PeResourcesService return AnalysisCancelledError with cause undefined for already-aborted signals, discarding the exact caller reason. Five controlled reasons (null, string, object, Error and a typed error containing unrelated cleanup facts) fail identity assertions in each service. All 28 existing controls pass; 15 new controls fail.

Reproduction

Ran npm run test:local with the three existing service test files after adding admission controls. Abort a controller with each reason, call service.inspect(null, {signal}), assert error.cause === reason. A typed provider seam throws if invoked. No file read or provider launched.

Expected behavior

Retain signal.reason by identity at the service's admission boundary. Do not adopt cleanup authority from an opaque caller reason. Preserve existing input validation, provider failure precedence and completed Evidence on late cancellation. ProviderOperationExecution already implements this contract.

Impact and scope

Observed at three shared CLI/MCP application services only. NOT_ENOUGH_INFO for public adapter loss of reason or native provider cancellation frequency. Source scan finds similar bare cancellation constructors in other application workflows; each requires contextual review, especially after completed work. This report's repair scope is the three sibling stable-artifact services.

REA version

6.5.0, a8170163b

Runtime and platform

Node 24.18.0; macOS arm64.

Target and artifact context

No target; typed service admission seams.

Interface

Other: shared application boundary used by CLI/MCP.

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

15 failed / 28 passed. Each failure: expected undefined to be the exact caller reason. Sources: src/application/rust/RustBinaryService.ts:49, src/application/go/GoBinaryService.ts:48, src/application/binaryDiagnostics/PeResourcesService.ts:40. All instantiate AnalysisCancelledError without options at the admission guard.

Typed outcome or recovery expected

AnalysisCancelledError.cause is the original reason; reader calls zero; cancellation error owns no resources; caller-owned typed cleanup error remains unchanged.

Originally created by @morluto on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4929 ### Before submitting - [x] Searched open and closed cancellation-reason issues. #4858 covered artifact producer/signal consumers; #4458 concerns descriptor ownership. This report covers sibling artifact service admission. - [x] No credentials or private targets included. ### Area Evidence, artifacts, or reconstruction ### Observed behavior At a8170163b, RustBinaryService, GoBinaryService and PeResourcesService return AnalysisCancelledError with cause undefined for already-aborted signals, discarding the exact caller reason. Five controlled reasons (null, string, object, Error and a typed error containing unrelated cleanup facts) fail identity assertions in each service. All 28 existing controls pass; 15 new controls fail. ### Reproduction Ran npm run test:local with the three existing service test files after adding admission controls. Abort a controller with each reason, call service.inspect(null, {signal}), assert error.cause === reason. A typed provider seam throws if invoked. No file read or provider launched. ### Expected behavior Retain signal.reason by identity at the service's admission boundary. Do not adopt cleanup authority from an opaque caller reason. Preserve existing input validation, provider failure precedence and completed Evidence on late cancellation. ProviderOperationExecution already implements this contract. ### Impact and scope Observed at three shared CLI/MCP application services only. NOT_ENOUGH_INFO for public adapter loss of reason or native provider cancellation frequency. Source scan finds similar bare cancellation constructors in other application workflows; each requires contextual review, especially after completed work. This report's repair scope is the three sibling stable-artifact services. ### REA version 6.5.0, a8170163b ### Runtime and platform Node 24.18.0; macOS arm64. ### Target and artifact context No target; typed service admission seams. ### Interface Other: shared application boundary used by CLI/MCP. ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence 15 failed / 28 passed. Each failure: expected undefined to be the exact caller reason. Sources: src/application/rust/RustBinaryService.ts:49, src/application/go/GoBinaryService.ts:48, src/application/binaryDiagnostics/PeResourcesService.ts:40. All instantiate AnalysisCancelledError without options at the admission guard. ### Typed outcome or recovery expected AnalysisCancelledError.cause is the original reason; reader calls zero; cancellation error owns no resources; caller-owned typed cleanup error remains unchanged.
bsakaguchi 2026-10-31 00:35:38 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

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

Fixed in 52b73ee85 on main.

Root cause: Rust, Go and PE resource services constructed admission cancellation errors without the signal's reason. Each now retains the exact opaque reason at the boundary that observes admission cancellation. No provider is invoked; a caller-supplied typed cleanup error remains opaque and does not grant resource ownership. Existing late-completion checks retain completed Evidence and physical/output failure precedence. Removed a duplicate Rust completion test after retaining its parsed-Evidence and output-failure assertions in the other test.

Validation: the 15 new admission identity controls failed before the production change (28 existing controls passed). Final focused run: 84 tests passed across seven files, including actual Rust CLI cleanup retry and SDK MCP workflows; check:fast and normal hooks passed. Context7 Node24 documentation confirms abort(reason) accepts any value and signal.reason retains it. Tests use typed seams and authored artifacts on macOS, not native Linux/Windows or naturally occurring provider close faults. Similar bare constructors elsewhere remain contextual review candidates in the broader audit; this issue covers the three named sibling services.

<!-- gh-comment-id:6243934571 --> @morluto commented on GitHub (Oct 18, 2026): Fixed in 52b73ee85 on main. Root cause: Rust, Go and PE resource services constructed admission cancellation errors without the signal's reason. Each now retains the exact opaque reason at the boundary that observes admission cancellation. No provider is invoked; a caller-supplied typed cleanup error remains opaque and does not grant resource ownership. Existing late-completion checks retain completed Evidence and physical/output failure precedence. Removed a duplicate Rust completion test after retaining its parsed-Evidence and output-failure assertions in the other test. Validation: the 15 new admission identity controls failed before the production change (28 existing controls passed). Final focused run: 84 tests passed across seven files, including actual Rust CLI cleanup retry and SDK MCP workflows; check:fast and normal hooks passed. Context7 Node24 documentation confirms abort(reason) accepts any value and signal.reason retains it. Tests use typed seams and authored artifacts on macOS, not native Linux/Windows or naturally occurring provider close faults. Similar bare constructors elsewhere remain contextual review candidates in the broader audit; this issue covers the three named sibling services.
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#3057
No description provided.