[GH-ISSUE #4254] [Bug] WASM artifact inspection returns success after cancellation during final cleanup #1679

Closed
opened 2026-10-16 21:08:58 +00:00 by bsakaguchi · 1 comment
Owner

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

[Bug] WASM artifact inspection returns success after cancellation during final cleanup

Area: Evidence, artifacts, or reconstruction
Interface: CLI and MCP share WabtArtifactProvider; boundary probe called the provider directly
Earliest failure stage: Cleanup, cancellation, or lifecycle

Observed behavior

At source revision 0e1f0bf2d06943e59253b8a66923a1ae6005e81e, inspect_wasm_artifact returns a completed success if its AbortSignal is aborted during private runtime-root cleanup. The tool had already produced and validated the normal result, but cancellation occurred before the provider returned. The caller receives success without a cancellation outcome or a retained partial observation.

src/wasm/WabtArtifactProvider.ts:445-491 releases the runtime root and returns result without checking the signal after the awaited cleanup. The EVM provider performs this final check at src/evm/EvmoleInterfaceProvider.ts:575-584; its boundary suite tests abort from inside root close.

Reproduction

From the repository root, run:

PATH=/opt/homebrew/opt/node@24/bin:$PATH node_modules/.bin/vitest run --config .cache/codebase-audit/artifacts/vitest.audit.config.mts --reporter=verbose

The test WABT control (abort during close: true) invokes the production WabtArtifactProvider.inspect with source-owned fake WABT executables and a normal successful protocol response. Its injected runtime owner performs the actual root cleanup, then aborts the caller signal inside close(). Observed result: ok: true, signal is aborted, and the root is gone. The paired false control performs the same successful operation and cleanup without aborting and also returns ok: true.

The complete disposable suite passed 8/8 on Node v24.18.0, macOS arm64: six ADB cases and two WABT cases. Probe file: .cache/codebase-audit/artifacts/wasmAudit.test.ts. This uses fake WABT executables and does not claim real WABT behavior.

Expected behavior

After the last awaited finalization step, observe the signal before returning success. A cancellation at this point should be typed and retain the completed result's Evidence as a partial observation, with cleanup status represented truthfully. Root cleanup succeeded in the reproduction.

Impact and scope

A caller can cancel during WABT's final root release and still receive a normal success response. This is a provider lifecycle result-projection issue; parser correctness and real WABT compatibility are outside this reproduction.

Relevant evidence and dedupe

  • Producer boundary: src/wasm/WabtArtifactProvider.ts:445-491.
  • Lifecycle guidance: docs/tool-design.md#own-the-lifecycle requires cancellation through awaited cleanup and a signal check after the final awaited step.
  • Comparator: src/evm/EvmoleInterfaceProvider.ts:575-584 plus tests/boundary/evm/evmoleInterfaceProvider.test.ts late-cancellation case.
  • Dedupe search: gh issue list --repo morluto/rea --state all --search 'repo:morluto/rea WABT cancellation cleanup finalization' --limit 20 returned broad lifecycle #4227 and cleanup-projection #3935. #3935 concerns discarded results when cleanup itself fails; the reproduction here has successful cleanup and a cancellation during that cleanup.
  • No real WABT installation was used; fake-provider boundary only.
Originally created by @morluto on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4254 # [Bug] WASM artifact inspection returns success after cancellation during final cleanup **Area:** Evidence, artifacts, or reconstruction **Interface:** CLI and MCP share `WabtArtifactProvider`; boundary probe called the provider directly **Earliest failure stage:** Cleanup, cancellation, or lifecycle ## Observed behavior At source revision `0e1f0bf2d06943e59253b8a66923a1ae6005e81e`, `inspect_wasm_artifact` returns a completed success if its `AbortSignal` is aborted during private runtime-root cleanup. The tool had already produced and validated the normal result, but cancellation occurred before the provider returned. The caller receives success without a cancellation outcome or a retained partial observation. `src/wasm/WabtArtifactProvider.ts:445-491` releases the runtime root and returns `result` without checking the signal after the awaited cleanup. The EVM provider performs this final check at `src/evm/EvmoleInterfaceProvider.ts:575-584`; its boundary suite tests abort from inside root close. ## Reproduction From the repository root, run: ```sh PATH=/opt/homebrew/opt/node@24/bin:$PATH node_modules/.bin/vitest run --config .cache/codebase-audit/artifacts/vitest.audit.config.mts --reporter=verbose ``` The test `WABT control (abort during close: true)` invokes the production `WabtArtifactProvider.inspect` with source-owned fake WABT executables and a normal successful protocol response. Its injected runtime owner performs the actual root cleanup, then aborts the caller signal inside `close()`. Observed result: `ok: true`, signal is aborted, and the root is gone. The paired false control performs the same successful operation and cleanup without aborting and also returns `ok: true`. The complete disposable suite passed 8/8 on Node `v24.18.0`, macOS arm64: six ADB cases and two WABT cases. Probe file: `.cache/codebase-audit/artifacts/wasmAudit.test.ts`. This uses fake WABT executables and does not claim real WABT behavior. ## Expected behavior After the last awaited finalization step, observe the signal before returning success. A cancellation at this point should be typed and retain the completed result's Evidence as a partial observation, with cleanup status represented truthfully. Root cleanup succeeded in the reproduction. ## Impact and scope A caller can cancel during WABT's final root release and still receive a normal success response. This is a provider lifecycle result-projection issue; parser correctness and real WABT compatibility are outside this reproduction. ## Relevant evidence and dedupe - Producer boundary: `src/wasm/WabtArtifactProvider.ts:445-491`. - Lifecycle guidance: `docs/tool-design.md#own-the-lifecycle` requires cancellation through awaited cleanup and a signal check after the final awaited step. - Comparator: `src/evm/EvmoleInterfaceProvider.ts:575-584` plus `tests/boundary/evm/evmoleInterfaceProvider.test.ts` late-cancellation case. - Dedupe search: `gh issue list --repo morluto/rea --state all --search 'repo:morluto/rea WABT cancellation cleanup finalization' --limit 20` returned broad lifecycle #4227 and cleanup-projection #3935. #3935 concerns discarded results when cleanup itself fails; the reproduction here has successful cleanup and a cancellation during that cleanup. - No real WABT installation was used; fake-provider boundary only.
bsakaguchi 2026-10-16 21:08:58 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

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

Fixed on main in 321cacb84. WASM artifact completion now observes cancellation after private-root cleanup and retains completed Evidence.

Simulated WABT controls cover successful close, late cancellation and cleanup-failure retry.

Hosted main CI is still pending; this closure is based on the implemented fix and the scoped regression evidence.

<!-- gh-comment-id:6206016123 --> @morluto commented on GitHub (Oct 16, 2026): Fixed on `main` in [321cacb84](https://github.com/morluto/rea/commit/321cacb84a020f447e1110df5c58fa71d99b7bf1). WASM artifact completion now observes cancellation after private-root cleanup and retains completed Evidence. Simulated WABT controls cover successful close, late cancellation and cleanup-failure retry. Hosted main CI is still pending; this closure is based on the implemented fix and the scoped regression evidence.
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#1679
No description provided.