ryo-mutations
Status: experimental. APIs may change in v0.x. Part of the ryo workspace — AST-centric Rust programming for AI agents.
Code transformation primitives for Rust source. Unified Mutation trait
with validation, serialization, and parallel-execution support. Mutations are
organised into modules by intent: basic (add / remove / rename / visibility),
refactor (extract / inline / split / merge), idiom (unwrap → ?,
loops → iterators, Default), clippy, analyzer (rust-analyzer LSP),
and debugger.
Install
Quickstart
use ;
let mutation = AddField ;
// Validate before applying
let result = mutation.validate;
if result.max_severity >= Conflict
API Summary
| Module | Purpose |
|---|---|
basic::* |
Fundamental AST edits (add / remove / rename / visibility) |
refactor::* |
Structural transformations |
idiom::* |
Idiomatic Rust pattern rewrites |
clippy::* |
Clippy lint integration |
analyzer::* |
rust-analyzer LSP integration |
debugger::* |
Debug logging utilities |
serializable::* |
Mutation serialization for plan files |
| Validation type | Use case |
|---|---|
AllowAll |
FactionBoard / speculative execution |
BlockFatalOnly |
Speculative execution (block only fatal) |
BlockConflicts |
Sequential execution |
Strict |
Debugging (block all issues) |
Status
Experimental. The Writer side of ryo is still evolving — APIs in this crate may change between v0.x releases. Production-quality stability is deferred to v1.0.
License
Licensed under either of Apache-2.0 or MIT at your option.