plexus.cli.procedure.test_hypothesis_with_insights_context module

Tests for hypothesis phase behavior with insights context.

Ensures that when hypothesis phase runs after insights phase: 1. Insights nodes are excluded from hypothesis count (don’t trigger skip) 2. Insights context is included in the agent prompt 3. Previous hypothesis context is included in the agent prompt 4. New hypotheses can be generated based on insights

plexus.cli.procedure.test_hypothesis_with_insights_context.mock_client()

Create a mock PlexusDashboardClient.

plexus.cli.procedure.test_hypothesis_with_insights_context.mock_nodes_with_insights()

Create a realistic set of nodes: - 1 root node - 2 hypothesis nodes (below threshold of 3) - 1 insights node

This should NOT trigger the skip logic since we only have 2 hypothesis nodes.

plexus.cli.procedure.test_hypothesis_with_insights_context.procedure_service(mock_client)

Create a ProcedureService instance with mocked client.

async plexus.cli.procedure.test_hypothesis_with_insights_context.test_get_existing_experiment_nodes_includes_insights_context(procedure_service, mock_nodes_with_insights)

Test that _get_existing_experiment_nodes includes insights in formatted context.

async plexus.cli.procedure.test_hypothesis_with_insights_context.test_hypothesis_skip_logic_excludes_insights(procedure_service, mock_nodes_with_insights, mock_client)

Test that insights nodes don’t count toward hypothesis skip threshold.

async plexus.cli.procedure.test_hypothesis_with_insights_context.test_hypothesis_skip_logic_with_enough_hypotheses(procedure_service, mock_nodes_with_insights, mock_client)

Test that 3+ hypothesis nodes (excluding insights) triggers skip logic.

async plexus.cli.procedure.test_hypothesis_with_insights_context.test_insights_context_ordering(procedure_service, mock_nodes_with_insights)

Test that insights appear BEFORE hypotheses in context (priority ordering).

async plexus.cli.procedure.test_hypothesis_with_insights_context.test_multiple_insights_rounds_ordering(procedure_service)

Test that multiple insights nodes are ordered by round number.