Repository navigation
fix(verifiers): retain WABT roots until MCP cleanup completes - #8698
wunianze666-netizen wants to merge 1 commit into
Conversation
[Low impact] No actionable defect was found in the reviewed changes. SummaryThe PR gives the WABT verifier one cleanup owner and retains its directories until MCP cleanup completes.
No actionable defect was established from the reviewed source. Tests were not executed during this review. GitHub authentication was unavailable, so supersession and existing review threads could not be checked. Acknowledged by Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Acquire input root] --> B[Create cleanup owner]
B --> C[Acquire temp root, client, and transport]
C --> D[Run verifier]
D --> E[Attempt both MCP closes]
E --> F{Child completion established?}
F -- No --> R[Retain roots and expose same owner]
F -- Yes --> G[Check lineage and provider residue]
G --> H{Checks pass?}
H -- No --> R
H -- Yes --> I[Release each directory independently]
I --> J{Any release failed?}
J -- Yes --> R
J -- No --> K[Cleanup complete]
R --> E
Reviews (1) · Last reviewed commit: "fix(verifiers): retain WABT roots until ..." · Reviewed by Greptile |
|
TL;DR: I ran the one changed test file on three Node versions, and all 13 tests passed on each. The head is 379 commits behind main 9d0e87f, and I did not merge it. CI shows one cancelled check,
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/process/wabtVerifierResources.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thanks. These cleanup orderings were real. They landed in #10491, which fixes the shared rule once with a |
Summary
A failed WABT verifier handshake or MCP close could still release its input root and provider temporary directory. Retain both until their MCP owners complete, preserve the primary and cleanup errors, and expose the same cleanup owner for retry. Fixes #8564.
Problem and expected behavior
On frozen main
2cb29693c3d574c4898832047fe309ac1ad00e9d, an executed Windows subprocess importing the actual verifier reached an authored handshake refusal, observed both MCP closes reject, and still removed both directories. A directory must outlive the process or transport that may use it. Constructors and partial setup must also leave every acquired resource with a cleanup owner.Change and scope
One verifier resource owner replaces the unconditional directory cleanup and the separate setup-error cleanup path. It attempts both MCP closes, retains the SDK's exact child before the SDK forgets it, and uses the existing process supervisor to establish exit and output closure. Only then can independent directory releases run; successful releases are not repeated on retry. The error lists only roots still held, and its retry capability is non-enumerable so logging the error does not dump the inherited child environment.
This is an ordinary correction to the existing verifier; no new provider, target execution, installation or protection capability. A maintainer scope decision is not applicable.
Contract and boundary impact
Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Effects concern only the existing verifier's authored fixture files and MCP child; no WASM target is executed.
Evidence and regression coverage
The new subprocess cases import the actual verifier and resource helper. Authored WABT version probes and controlled client failures avoid requiring an engine; child lifecycle cases use the real pinned SDK transport and real Node children. The
real-servercontrol also connects the real SDK client to the compiled REA MCP server, then stops at fake compiler output rather than claiming a WABT analysis.The original verifier failed 9 of the initial 11 scenarios, with 2 controls passing. The candidate covers client/transport close failures individually and together, constructor and spawn failure, delayed exit after the SDK's final kill, separate directory-release failures, retained residue, and idempotent same-owner retry. Additional setup cases cover provider-temp allocation failure and failure to release the input root at that stage. Assertions retain the exact primary/close error objects and prevent inherited-environment output.
No real WABT, selected target execution, natural failure frequency, or detached-descendant guarantee is claimed. The preserved original failures and current results are separate; repeated runs are not additional scenarios. Production Evidence is unchanged; the following Evidence-specific checklist is not applicable.
For evidence-bearing changes:
Validation performed
node scripts/run-exact-tests.mjs run tests/boundary/process/wabtVerifierResources.test.ts tests/boundary/process/verifierCleanup.test.ts— 25 passed (13 new lifecycle cases, 12 existing cleanup cases), no skips; Windows x64, official Node 24.22.1.npm run check:fast— typecheck and lint successful, 2 tasks, no cache. An earlier lint run rejected one overlong test callback; the fixture source builder was factored out and the final check passed.npm run docs:check— 6 tasks successful (3 cached), plus 9 README consistency tests passed.node scripts/verify-test-discovery.mjs— 2,981 files discovered exactly once;npm run verify:architecture-guards— 2,369 source files passed. One earlier invocation used a nonexistent architecture script path and was corrected; it was not a product failure.git diff --checkpassed.check, typed lint, a real WABT engine run, and local Linux/macOS execution were not run. CI run 41487270752, attempt 1, completed successfully for headb792e5d137c7cb3442a1d3c58c6627831364ab8c: all 40 jobs were enumerated, with 17 successful and 23 conditional skips, no failures or cancellations. The actual checkout was2d21fb7bee436344323e3dfc31ec519b1e557580, parents2cb29693c3d574c4898832047fe309ac1ad00e9d+b792e5d137c7cb3442a1d3c58c6627831364ab8c, tree579d5108a571e54c39b0f8980ce85c14996db6ec. The selected Linux shard 2/8 actually executed all 13 new WABT cleanup cases successfully; that shard reported 2,243 passed and 32 skipped in total. The aggregate Portable job is not additional test execution. No skipped optional provider lane or unread raw report is claimed as verified.Compatibility, safety, and release
No public tool, Evidence, package version, deadline or provider permission changes. The standalone verifier now fails and names retained directories when completion is unproven; an importing caller can retry
cleanupOwner.close()on the same error owner. POSIX additionally requires positive run-lineage evidence; the new controlled lifecycle cases exercised it in Linux CI. No local Linux/macOS or real WABT run was performed. Windows verifies the exact SDK child and its output, and reports that it has no retained native Job Object lease for other descendants. Detached/reparented processes outside those pipes remain an explicit limit. Real WABT and Linux/macOS verification were not run.Author readiness
Human owner: @wunianze666-netizen
Before merge
type(scope): outcome.