Context
The consecutive message tests verify interaction counts (e.g., length(agent_responses) == 2) but don't assert that interactions are in correct sequence order. A broken sequence generator could produce valid counts but corrupt LLM conversation history.
Missing Invariant
Interactions must be monotonically ordered by sequence. Specifically:
- UserMessage1.sequence < AgentResponse1.sequence < AgentCompleted1.sequence < UserMessage2.sequence < AgentResponse2.sequence < AgentCompleted2.sequence
- For tool call flows: ToolCall.sequence < ToolResult.sequence
Proposed Enhancement
In the existing consecutive message tests, add assertions that:
- All interaction sequences are strictly increasing
- Each message type appears in the expected position relative to others
File
apps/frontman_server/test/frontman_server/tasks/execution_test.exs
Context
The consecutive message tests verify interaction counts (e.g.,
length(agent_responses) == 2) but don't assert that interactions are in correct sequence order. A broken sequence generator could produce valid counts but corrupt LLM conversation history.Missing Invariant
Interactions must be monotonically ordered by sequence. Specifically:
Proposed Enhancement
In the existing consecutive message tests, add assertions that:
File
apps/frontman_server/test/frontman_server/tasks/execution_test.exs