mutation_test
Applies LLM-generated mutation patches to source files and runs tests to measure kill rate; verdict is pass/warn/fail based on configurable thresholds; used by the mutationtest gate (opt-in, off by default)
How to use it
mutation_test is exposed by the Opencode Swarm MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the mutation_test tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Opencode Swarm
bunx opencode-swarm installOther tools in Opencode Swarm (30)
Runs your project's native build/typecheck
Architect-only: validates terminal PR-review or PR-feedback coverage; feedback uses a two-call arm/publish protocol and clears only after the approved content is observed on both the bound remote-tracking ref and the actual remote branch
Structured git diff with contract change detection; supports summaryOnly mode returning file list with additions/deletions counts
Remove candidate from quarantine store
Fetch and validate a skill from a configured source
View full candidate details
List candidates with status filters
Promote validated candidate to active skill (user approval required)
Reject candidate with reason
Retire a previously promoted skill
Architect-only: generates LLM-based mutation patches (5–10 per function across 6 types: off-by-one, null substitution, operator swap, guard removal, branch swap, side-effect deletion) for direct consumption by the mutationtest tool; returns SKIP verdict on LLM failure rather than throwing
Per-line git blame metadata (sha, author, date, summary) via git blame --porcelain; supports optional line range filtering
Post-coder hook for TS/JS, Go, Rust, Python, and C#; configured by incrementalverify., not invoked as a registered tool
Default line limit for any tool output.
Architect-only: parses [CANDIDATE] rows and micro-lane [CLEAN] attestations from a lane outputref; supports asserted batch families, preserves dispatch provenance, and persists sidecar JSONL records
Overrides maxlines for specific tools. The diff and symbols tools are truncated by default because their outputs can be very large.
Enforces phase completion, verifies required agents, requires a valid retrospective evidence bundle, logs events, and resets state; appends to events.jsonl with file locking
Catches TODOs, FIXMEs, stubs, placeholder text
Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential)
Enforces complexity, duplication, and test ratio limits
Architect-only: executes targeted reproduction/regression and exact git diff --check plus every mechanically applicable workspace/category/source build, typecheck, and lint obligation, then persists content-bound Stage A receipts before ordered feedback review gates
Offline security analysis, 68 rules, 8 languages
CycloneDX dependency tracking, 8 ecosystems
Reviewer-safe structured patch suggestion; supports format parameter ('json' or 'unified') where unified outputs valid unified diff with diff --git headers, hunks, and context
Extract exported symbols from source files; supports workspace (boolean) and name (string) parameters for multi-file symbol search
Tree-sitter validation across the configured language grammar map
Auto-detect and run tests; supports bail parameter to inject framework-specific bail flags for early exit on first failure
Global switch (default true).
Architect-only: writes mutation gate results atomically to .swarm/evidence/{phase}/mutation-gate.json; accepts verdict (PASS/WARN/FAIL/SKIP), kill rate metrics, and optional survived mutant details; normalizes uppercase-to-lowercase before persisting
Architect-only: validates the exact mandatory PR-review micro-lane ID set, requires completed provenance for all 11 repository-agnostic lanes, verifies the claimed merge base against an exact live base ref, rejects every NO-MATCH waiver, and atomically persists .swarm/pr-review/<runid>/trigger-eval.