[PR #5370] [CLOSED] fix(evm): preserve artifact cancellation reasons #6903

Closed
opened 2026-11-01 21:43:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5370
Author: @Doribelove
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/evm-artifact-cancellation-reason


📝 Commits (1)

  • 5764dbf fix(evm): preserve artifact cancellation reasons

📊 Changes

3 files changed (+213 additions, -1 deletions)

View changed files

📝 src/evm/EvmoleFailures.test.ts (+43 -0)
📝 src/evm/EvmoleFailures.ts (+2 -1)
➕ tests/process-global/evmArtifactCancellation.test.ts (+168 -0)

📄 Description

Summary

Fixes #5332. Preserve the caller's exact abort reason in AnalysisCancelledError.cause when EVM carrier reading observes cancellation after the entry check, including during descriptor finalization.

Problem and expected behavior

The artifact reader already retains the reason, but evmInterfaceFailure uses the entire ArtifactReaderFailure as the cancellation cause. In-process consumers receive a wrapper instead of the original value. Pre-aborted calls already preserve it correctly.

CLI/MCP cancellation JSON does not expose this cause, so this patch does not claim a change to the serialized response.

Change and scope

Reuse artifactFileCancellationCause, the file owner's existing interpretation, at the EVM error conversion boundary. Keep the existing cleanup observation and physical-failure precedence. This removes the EVM-specific divergence without adding another unwrapping rule.

Routine correction within existing offline inspection; a separate scope decision is not applicable. No API, schema, package, dependency, generated metadata or execution-authority changes. File cleanup ownership/retry status beyond cause preservation is outside this patch, including #5295.

Expected effects:

  • Read existing files or captured data.

Evidence and regression coverage

Executed on Ubuntu 22.04.5 x86_64 with Node 24.18.0 and npm 11.16.0, based on 799e8265b254e225dc1dabdd25e56f0ab7f86bd3:

  • Before the production fix, the two new/extended regression suites reported 9 failed, 11 passed. All nine failures were exact-cause assertions.
  • Afterward, those suites pass 20/20. Cases cover undefined/null/primitive/object/error reasons, wrapped cleanup, pre-aborted admission, cancellation before reading, successful and failed descriptor close, and physical read failure followed by cancellation.
  • Provider/service regressions use real Linux admission and real files. Isolated filesystem hooks control cancellation and close-failure timing; no worker starts in those cases. Failed descriptors remain retained and are actually closed on retry.
  • An initial new projection assertion was corrected to expect the existing cleanup_incomplete code when close fails. Production cleanup classification is unchanged.

Validation performed

  • npm run test:focused -- src/evm/EvmoleFailures.test.ts tests/process-global/evmArtifactCancellation.test.ts tests/boundary/evm/evmoleInterfaceProvider.test.ts tests/boundary/mcp/evmInterfaceMcp.test.ts tests/composition/evmModuleContract.test.ts — 63 passed, 2 skipped (the two unsupported-host controls do not run on Linux x64).
  • npm run check — passed (typecheck, lint/module boundaries, formatting, knip, metadata and architecture guards).
  • npm run verify:test-discovery — all 1,715 test files discovered exactly once.
  • npm run verify:evm:interface with solc 0.8.30, EVMole 0.9.3 and /usr/bin/strace — 59 public CLI/MCP cases passed. The verifier reported no retained descendants and no target execution or network requests in its traced controls.
  • git diff --check — passed.

Compatibility, safety, and release

The exact-cause regression is established through the production service/provider with controlled cancellation, not a live client interrupt. The separate real-provider lane checks ordinary CLI/MCP inspection and failure paths. No Windows/macOS execution or chain interaction was tested. Existing build/lint warnings remain; no performance improvement is claimed.

Author readiness

Human owner: @Doribelove

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

Draft pending the human owner's final review of this change and its evidence.

Before merge

  • Concrete problem and related issue are identified.
  • Scope remains within existing offline inspection and the PR has one focused outcome.
  • Tests cover changed behavior, physical failure precedence and retained descriptor cleanup.
  • Public contracts and generated documentation require no changes.
  • Human owner has completed the initial readiness declaration.

🔄 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/5370 **Author:** [@Doribelove](https://github.com/Doribelove) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/evm-artifact-cancellation-reason` --- ### 📝 Commits (1) - [`5764dbf`](https://github.com/morluto/rea/commit/5764dbf902ceb0ab58c41f5bbc98fb42c37acc38) fix(evm): preserve artifact cancellation reasons ### 📊 Changes **3 files changed** (+213 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/evm/EvmoleFailures.test.ts` (+43 -0) 📝 `src/evm/EvmoleFailures.ts` (+2 -1) ➕ `tests/process-global/evmArtifactCancellation.test.ts` (+168 -0) </details> ### 📄 Description ## Summary Fixes #5332. Preserve the caller's exact abort reason in `AnalysisCancelledError.cause` when EVM carrier reading observes cancellation after the entry check, including during descriptor finalization. ## Problem and expected behavior The artifact reader already retains the reason, but `evmInterfaceFailure` uses the entire `ArtifactReaderFailure` as the cancellation cause. In-process consumers receive a wrapper instead of the original value. Pre-aborted calls already preserve it correctly. CLI/MCP cancellation JSON does not expose this cause, so this patch does not claim a change to the serialized response. ## Change and scope Reuse `artifactFileCancellationCause`, the file owner's existing interpretation, at the EVM error conversion boundary. Keep the existing cleanup observation and physical-failure precedence. This removes the EVM-specific divergence without adding another unwrapping rule. Routine correction within existing offline inspection; a separate scope decision is not applicable. No API, schema, package, dependency, generated metadata or execution-authority changes. File cleanup ownership/retry status beyond cause preservation is outside this patch, including #5295. Expected effects: - [x] Read existing files or captured data. ## Evidence and regression coverage Executed on Ubuntu 22.04.5 x86_64 with Node 24.18.0 and npm 11.16.0, based on `799e8265b254e225dc1dabdd25e56f0ab7f86bd3`: - Before the production fix, the two new/extended regression suites reported **9 failed, 11 passed**. All nine failures were exact-cause assertions. - Afterward, those suites pass **20/20**. Cases cover undefined/null/primitive/object/error reasons, wrapped cleanup, pre-aborted admission, cancellation before reading, successful and failed descriptor close, and physical read failure followed by cancellation. - Provider/service regressions use real Linux admission and real files. Isolated filesystem hooks control cancellation and close-failure timing; no worker starts in those cases. Failed descriptors remain retained and are actually closed on retry. - An initial new projection assertion was corrected to expect the existing `cleanup_incomplete` code when close fails. Production cleanup classification is unchanged. ## Validation performed - `npm run test:focused -- src/evm/EvmoleFailures.test.ts tests/process-global/evmArtifactCancellation.test.ts tests/boundary/evm/evmoleInterfaceProvider.test.ts tests/boundary/mcp/evmInterfaceMcp.test.ts tests/composition/evmModuleContract.test.ts` — **63 passed, 2 skipped** (the two unsupported-host controls do not run on Linux x64). - `npm run check` — passed (typecheck, lint/module boundaries, formatting, knip, metadata and architecture guards). - `npm run verify:test-discovery` — all **1,715** test files discovered exactly once. - `npm run verify:evm:interface` with solc **0.8.30**, EVMole **0.9.3** and `/usr/bin/strace` — **59 public CLI/MCP cases passed**. The verifier reported no retained descendants and no target execution or network requests in its traced controls. - `git diff --check` — passed. ## Compatibility, safety, and release The exact-cause regression is established through the production service/provider with controlled cancellation, not a live client interrupt. The separate real-provider lane checks ordinary CLI/MCP inspection and failure paths. No Windows/macOS execution or chain interaction was tested. Existing build/lint warnings remain; no performance improvement is claimed. ## Author readiness Human owner: @Doribelove - [ ] 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. Draft pending the human owner's final review of this change and its evidence. ## Before merge - [x] Concrete problem and related issue are identified. - [x] Scope remains within existing offline inspection and the PR has one focused outcome. - [x] Tests cover changed behavior, physical failure precedence and retained descriptor cleanup. - [x] Public contracts and generated documentation require no changes. - [ ] Human owner has completed the initial readiness declaration. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:56 +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#6903
No description provided.