vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::time::{Duration, Instant};
use crate::spec::types::MutationClass;
use super::mutation_cargo::{assert_source_matches_original, run_cargo_test};
pub use super::probe::{canary_plus_to_minus, mutation_probe};

/// A single mutation the gate can apply to a source file.
///
/// Implementors live in `crate::adversarial::mutations`. Callers build an
/// `AppliedMutation` for every catalog entry they want to test and
/// pass them into `mutation_probe`. The trait is deliberately minimal
/// so the catalog can plug in without coupling to the gate's internals.
use super::{MutationApplyError};
pub trait AppliedMutation: Send + Sync {
    /// Short identifier, unique within a run. Used in report output.
    fn id(&self) -> &str;

    /// Human-readable description shown in failure messages.
    fn description(&self) -> &str;

    /// The mutation's class. Used by `mutation_probe` to filter which
    /// mutations to run against a given test.
    fn class(&self) -> MutationClass;

    /// Apply the mutation to the source string and return the mutated
    /// form. Returning `Err` means the mutation was not applicable to
    /// this file (not a test failure — a skip).
    fn apply(&self, source: &str) -> Result<String, MutationApplyError>;

    /// Suggested hint to the Prosecutor when this mutation survives.
    /// Returns a short, actionable sentence the agent can act on.
    fn hint(&self) -> String {
        format!(
            "test passed when I applied `{}`. Add an assertion that distinguishes the \
             original from the mutated behaviour.",
            self.description()
        )
    }
}