ryo-executor 0.1.0

[experimental] Mutation execution engine for RYO - parallel execution, conflict detection, workspace management
Documentation
//! PluginConverter: Converts PluginTransform MutationSpec to WASM plugin execution
//!
//! This is a skeleton implementation for future WASM plugin support.
//! The actual WASM runtime integration will be implemented when the
//! plugin infrastructure is ready.
//!
//! See docs/wasm-plugin-architecture.md for the full design.

use crate::engine::ASTRegApply;
use crate::executor::registry::converter::{ConvertError, MutationConverter};
use crate::executor::registry::converters::ResolveTargetSymbol;
use crate::executor::spec::MutationSpec;
use ryo_analysis::AnalysisContext;

/// Converter for PluginTransform MutationSpec
///
/// This converter handles WASM plugin-based transformations.
/// Currently returns a "not implemented" error as the WASM runtime
/// is not yet integrated.
pub struct PluginConverter;

impl PluginConverter {
    pub fn new() -> Self {
        Self {}
    }
}

// PluginConverter uses the default implementation of ResolveTargetSymbol
impl ResolveTargetSymbol for PluginConverter {}

impl Default for PluginConverter {
    fn default() -> Self {
        Self::new()
    }
}

impl MutationConverter for PluginConverter {
    fn spec_kinds(&self) -> &'static [&'static str] {
        &["PluginTransform"]
    }

    fn convert_v2(
        &self,
        _spec: &MutationSpec,
        _ctx: &AnalysisContext,
    ) -> Result<Vec<Box<dyn ASTRegApply>>, ConvertError> {
        // WASM plugin runtime not yet implemented
        Err(ConvertError::V2NotSupported)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_plugin_converter_spec_kinds() {
        let converter = PluginConverter::new();
        assert_eq!(converter.spec_kinds(), &["PluginTransform"]);
    }
}