rho-coding-agent 3.12.0

A fast Rust agent harness with a small footprint and opinionated defaults
Documentation
use pretty_assertions::assert_eq;

use super::STARLARK_VERSION;

// Covers: a Starlark dependency update must also update the frozen planner identity.
// Owner: workflow plan freeze policy.
#[test]
fn frozen_planner_version_matches_starlark_dependency() {
    let manifest: toml::Value = toml::from_str(include_str!("../../../Cargo.toml")).unwrap();
    let dependency = manifest
        .get("dependencies")
        .and_then(|dependencies| dependencies.get("starlark"))
        .and_then(toml::Value::as_str);
    let expected = format!("={STARLARK_VERSION}");

    assert_eq!(dependency, Some(expected.as_str()));
}

// Covers: a plan frozen for the removed cursor runtime says it must be planned
// again before recheck looks at its frozen executable, which may be gone.
// Owner: workflow plan recheck.
#[test]
fn recheck_refuses_a_retired_runtime_before_its_executable() {
    use crate::workflow::{
        test_support::{agent_node, workflow},
        AgentRuntime, ResolvedNode, WorkspaceAccess,
    };

    let mut graph = workflow(vec![agent_node("review", &[], WorkspaceAccess::ReadOnly)]);
    for resolved in graph.resolved_nodes.values_mut() {
        if let ResolvedNode::Agent(agent) = resolved {
            agent.runtime = AgentRuntime::RetiredCursor;
            agent.executable = Some("/gone/cursor-agent".to_owned());
            agent.executable_identity = None;
        }
    }

    let error = super::recheck_frozen_graph(
        &graph,
        /*config_path*/ None,
        /*search_path*/ None,
        crate::workspace::ProjectTrusts::UNTRUSTED,
    )
    .unwrap_err();
    assert_eq!(
        error.to_string(),
        "frozen agent 'reviewer' was planned for the retired cursor runtime; plan the workflow again"
    );
}