# C-01 Grill Gate Evaluation — wasmtime / CGO

**Gate**: C-01 (wasmtime/CGO evaluation), gating P07b.

**Question**: The wasmtime Go binding
(`github.com/bytecodealliance/wasmtime-go`) is CGO-based. Does adopting
it revoke D-002 (modernc/sqlite CGO-free cross-compile story)?

## Evaluation

| Option | CGO required? | Cross-compile impact | Decision |
|--------|---------------|----------------------|----------|
| A. Use `bytecodealliance/wasmtime-go` (Go binding) | **YES** — the binding links libwasmtime via cgo | Revokes D-002 — Go cross-compile (`GOOS=linux GOARCH=arm64 go build`) breaks; CGO toolchain needed on every build host; static-binary story lost | REJECTED |
| B. Use the `wasmtime` CLI (apt-installed on the peer) via SSH exec | **NO** — pure Go code, shells out to a CLI over SSH (same pattern as podman/qm/pct) | None — D-002 preserved | **ACCEPTED** |
| C. Use an alternative pure-Go WASM runtime (e.g. wazero) | No CGO | Pure-Go alternative exists; but wazero's wasmtime-compat is incomplete (component model, WASI 0.2); different runtime semantics than the "wasmtime" operator surface promised in D-088 | DEFERRED (v0.10 evaluation if CLI-via-SSH proves insufficient) |

## Decision (full autonomy, auto-decision)

**Option B**: `WasmRuntime` uses the `wasmtime` CLI (apt-installed on
the peer) via the SSH-push transport. It does NOT import
`bytecodealliance/wasmtime-go` (or any other CGO package).

## C-01 Gate Status

**SATISFIED.** C-01 is satisfied:
- wasmtime works without CGO (CLI-via-SSH pattern, identical to podman/qm/pct).
- D-002 cross-compile story preserved (no CGO introduced anywhere in
  the runtime package or any orca Go code).
- D-002 is NOT revoked.

## Recorded as D-187

See PROJECT.md v0.9 D-series: "wasmtime Go binding is CGO-based
(bytecodealliance/wasmtime-go); orca uses the wasmtime CLI via SSH
(apt-installed on peer) instead of the Go binding, avoiding CGO
entirely. D-002 cross-compile story preserved. C-01 satisfied."

## Verification

- `go build ./internal/runtime/` succeeds with `CGO_ENABLED=0`.
- `internal/runtime/wasm.go` imports only stdlib + sshpush (no
  wasmtime-go).
- The full test suite (`go test ./...`) does not require CGO.