ryo-suggest 0.1.0

[experimental] Pattern-based suggestion engine for RYO
Documentation

ryo-suggest

crates.io docs.rs License: MIT OR Apache-2.0

Status: experimental. APIs may change in v0.x. Part of the ryo workspace — AST-centric Rust programming for AI agents.

Continuous-refactoring suggestion engine. Detects code-improvement opportunities via pattern matching, then generates MutationSpecs that downstream ryo-executor can apply. Suggestions are categorised by safety level (Auto / Manual / Review) so callers can filter.

Install

cargo add ryo-suggest

Quickstart

use ryo_suggest::{SuggestService, SuggestRegistry, SuggestQuery, SafetyLevel};

let mut registry = SuggestRegistry::new();
registry.register(MyPattern::new());

let service = SuggestService::new(registry);
let count = service.detect(&ctx, &symbols);

let auto_safe = service.query(
    &SuggestQuery::all().with_max_safety(SafetyLevel::Auto)
);

for (id, _, _) in auto_safe {
    if let Some(specs) = service.to_mutation_specs(id, &ctx) {
        // Hand specs to ryo-executor
    }
}

API Summary

Item Purpose
SuggestRegistry Register pattern detectors
SuggestStore Persistent storage for opportunities
SuggestService Detect + query + spec generation
Suggest / SuggestOpportunity Suggestion data types
SuggestCategory / SafetyLevel Classification axes
SuggestQuery Filter builder

Status

Experimental. Suggestion data model and detection API are evolving. Production-quality stability is deferred to v1.0.

License

Licensed under either of Apache-2.0 or MIT at your option.