plexus.cli.procedure.test_phase_agent module

Test Phase Agent - Creates ScoreVersions from hypotheses

This agent handles the test phase of the SOP procedure workflow: 1. Pulls baseline score YAML to local cache 2. Creates temp copy of YAML for editing 3. Uses LLM with file editing tools to modify YAML based on hypothesis 4. Validates edited YAML via syntax check and predict tool 5. Pushes valid YAML to new ScoreVersion 6. Updates GraphNode metadata with scoreVersionId

class plexus.cli.procedure.test_phase_agent.TestPhaseAgent(client)

Bases: object

Agent for creating ScoreVersions that implement hypothesis ideas.

Initialize the TestPhaseAgent.

Args:

client: PlexusDashboardClient for API operations

__init__(client)

Initialize the TestPhaseAgent.

Args:

client: PlexusDashboardClient for API operations

cleanup()

Clean up temporary directory.

async execute(hypothesis_node, score_version_id: str, procedure_context: Dict[str, Any]) Dict[str, Any]

Execute the test phase for a single hypothesis node.

This creates a new ScoreVersion with YAML code that implements the hypothesis, validates it, and updates the node metadata.

Args:

hypothesis_node: GraphNode containing the hypothesis score_version_id: ID of baseline ScoreVersion to start from procedure_context: Context dict with scorecard/score info, docs, etc.

Returns:

Dict with success status, new score_version_id, and node_id