plexus.cli.procedure.test_service_root_node module

Unit tests for ProcedureService programmatic root node logic.

These tests ensure that: 1. Root nodes are created programmatically when missing 2. Existing root nodes are not duplicated 3. AI agents cannot create root-level nodes 4. Root nodes are populated with champion score configuration

class plexus.cli.procedure.test_service_root_node.TestProcedureServiceRootNodeLogic

Bases: object

Test cases for programmatic root node logic.

setup_method()

Set up test fixtures.

test_ai_agent_cannot_create_root_nodes()

Test that AI agents are prevented from creating root-level nodes.

async test_champion_config_retrieval_failure_fallback()

Test fallback behavior when champion config cannot be retrieved.

async test_create_root_node_when_missing()

Test that root node is created programmatically when missing.

async test_do_not_create_duplicate_root_node()

Test that existing root node is not duplicated.

async test_error_handling_in_structure_ensuring()

Test that errors in structure ensuring don’t fail the entire procedure run.

async test_idempotent_behavior_with_existing_root()

Test that existing root nodes are not duplicated.

async test_update_root_node_missing_config()

Test that existing root node is updated if missing score configuration.