Skip to content

Repository files navigation

Opencode Mutation & Robustness Tester

Overview

This repository demonstrates using Opencode and its subagents to generate targeted code mutations and then run the test-suite against those mutants to evaluate and improve coding-agent robustness.

Why this exists

  • Purpose: measure how well coding agents (and test suites) detect and recover from realistic code mutations.
  • Approach: have an automated mutator subagent create small, focused changes to src/ modules and a tester subagent run pytest against the mutated variants to surface behavioral divergences.

How it works

  1. A mutator subagent produces a mutated variant of an existing module (for example src/numerical_integration_mutated.py).
  2. The mutator records metadata/handshake information for the tester.
  3. A tester subagent runs the test-suite (pytest) against the mutated module and records pass/fail outcomes.
  4. Failures indicate divergences; these are used to evaluate and harden the coding-agent workflows.

Quickstart

  • Install dev deps (if needed): pip install -e "[dev]"
  • Run tests: pytest
  • Run opencode: opencode
  • use prompt for simple test: run @code-mutator on numerical_integration_orig.py then run @code-tester on the mutated script

Repository layout

  • src/ — source modules (original and mutated variants)
  • tests/ — unit tests that validate expected behavior
  • .opencode/ — opencode configuration and agent scripts
  • .opencode/opencode.json - agent configuration

Developer commands

  • pytest
  • ruff check .
  • ruff format .
  • ruff check . && pytest

Notes

  • This repo is a local simulation of Opencode-style subagent interactions and is intended for experimentation and evaluation rather than production use.
  • Python 3.10+ is recommended.

License

Provided as-is for experimentation.

About

An LLM mutator to help create preventitve measures for AI coding agents

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages