Auto-detect wazero execution engine instead of forcing Compiler mode - #12234
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches wazero v1.12’s documented fallback behavior without altering other runtime settings.
Pull request overview
Updates WASM guard runtime creation to use wazero’s portable engine auto-detection.
Changes:
- Uses the compiler where supported and interpreter elsewhere.
- Preserves existing memory, debugging, cancellation, and cache settings.
File summaries
| File | Description |
|---|---|
internal/guard/wasm_lifecycle.go |
Enables portable wazero engine selection and documents the rationale. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔒 mcpg Read-Only Stress — default AWF (normal container isolation)Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. All reads succeeded.
|
🔒 mcpg Read-Only Stress — gVisor (
|
| Part | Surface | Op | Result | Expected | Status |
|---|---|---|---|---|---|
| A | MCP | reads (issues/PRs/file/commits) | data returned | ALLOWED | ✅ |
| B | MCP | writes (reaction/star/issue/comment/branch/file/PR) | unknown tool [-32602] |
BLOCKED | |
| C | CLI | reads (issues/PRs/file/commits via gateway bridge) | data returned | ALLOWED | ✅ |
| D | CLI | REST writes (reaction/star/issue/comment) | unauthenticated | BLOCKED | |
| E | CLI | GraphQL mutations (addReaction/addStar/createIssue) | unauthenticated | BLOCKED |
Overall: INCONCLUSIVE
add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) were absent from the 23-tool gateway catalog (backend launched with GITHUB_READ_ONLY=1). Refusals returned Error[-32602]: unknown tool — this confirms backend read-only mode but does not independently confirm gateway-level DIFC enforcement. Result: INCONCLUSIVE per methodology.
gh CLI is not authenticated in this environment (GH_TOKEN not set). REST write and GraphQL mutation attempts could not be executed. Token-scope boundary not validated this run.
No writes succeeded. The read-only guarantee held; methodology gaps prevented full gateway-enforcement confirmation.
🔒 mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No FAIL conditions observed. References: §33409463722
|
The go-fan review of
tetratelabs/wazeroflagged a portability gap:newGuardRuntimeConfighard-codeswazero.NewRuntimeConfigCompiler(), but the Compiler (AOT) backend only supports amd64/arm64. On any other architecture (e.g. riscv64), WASM guard runtime creation fails or misbehaves instead of degrading gracefully.Changes
internal/guard/wasm_lifecycle.go:newGuardRuntimeConfignow builds fromwazero.NewRuntimeConfig()instead ofwazero.NewRuntimeConfigCompiler(). This lets wazero auto-select the Compiler engine where supported and transparently fall back to the Interpreter engine elsewhere, matching wazero's own recommended usage pattern.WithCloseOnContextDone, conditional DWARF debug info, and compilation cache wiring (opt-out, injected, or shared global cache).This makes WASM guard support portable to any Go-supported architecture without silently failing on unsupported hosts.