#13336

test(verify): launch verifier MCP servers through the owned stdio transport

OpenN0zoM1z0opened 3d ago

Summary

Most verifier scripts start their MCP server child with the SDK's StdioClientTransport rather than the REA-owned createOwnedMcpStdioTransport (scripts/lib/owned-mcp-stdio.mjs). Those children are therefore outside REA's process-family cleanup and the retained-cleanup retry that docs/development/testing.md#verifier-scripts describes for verifier-launched commands.

Observed (main c1943f196, source search only)

  • 75 files under scripts/ call new StdioClientTransport(: 21 in scripts/lib/, 6 in scripts/verify/android/, 4 in scripts/verify/javascript/, and the rest in single verifiers such as verify-real-kuna.mjs and verify-wasm-artifact.mjs.
  • 6 call createOwnedMcpStdioTransport(, for example verify-go-binary.mjs, verify-real-ida.mjs, and scripts/lib/artifact-e2e.mjs.
  • No guard rejects a new direct launch. Greptile raised this on #7772's new scripts/verify/android/bridge-catalog.mjs, which follows the existing Android verifier pattern (analysis.mjs, method-bodies.mjs, direct-invokes.mjs, failure-recovery.mjs).

Proposed change (not implemented)

Migrate the direct launches to createOwnedMcpStdioTransport by family, starting with shared scripts/lib/ helpers. Then add a guard, with a shrinking baseline, that rejects new new StdioClientTransport( in scripts/. Verifiers that read child stderr would switch to the owned transport's diagnostics().

I did not observe a leaked child from these verifiers. This is a cleanup-ownership gap derived from the source, not a reproduced failure.

Activity

2
JohnnyWilson163d ago

I'd like to take the first slice of this: the guard plus scripts/lib/large-result-mcp.mjs.

Counted guard in architecture-guards.mjs over all scripts/**/*.mjs, scripts/lib/ included (the existing verifierScripts selection skips it), with a shrink-only baseline. large-result-mcp.mjs needs a larger frame than the factory's fixed 10 MiB (verify-binary-layout passes 256 MiB), so createOwnedMcpStdioTransport would take an optional { maxFrameBytes }.

I'll leave the other families for follow-ups. I'll open a PR in the next day or two unless you'd rather handle it.

YunzhouLi-hub3d ago

I'd like to take the JavaScript verifier slice under scripts/verify/javascript. I'll use the existing owned stdio factory and verify the affected workflows and cleanup. The architecture guard and large-result helper can stay with JohnnyWilson16's slice.