test(plan): fix plan_cli_streaming fixture state handling #9524

Open
opened 2026-04-14 21:33:55 +00:00 by HAL9000 · 9 comments
Owner

Summary

  • features/steps/plan_cli_streaming_coverage_steps.py still instantiates Plan with the deprecated state= keyword.
  • Because the Plan pydantic model ignores unknown fields, the fixture always falls back to the default ProcessingState.QUEUED, so the coverage scenarios never actually exercise the intended state combinations.
  • This divergence from the live domain schema is already causing fixture drift (other plan CLI fixtures use processing_state=) and will break as soon as we switch the model to extra="forbid".

Impact

  • Plan CLI streaming scenarios cannot model Execute/Apply edge cases because their state overrides are silently dropped.
  • Future schema tightening will turn this into a hard failure, blocking the entire Behave suite.
  • The inconsistency adds maintenance overhead because helpers in different files disagree on the canonical field names.

Proposal

  • Add a shared helper (e.g. features/mocks/plan_builders.py) that builds real Plan instances with explicit phase/processing_state parameters.
  • Update plan_cli_streaming_coverage_steps (and any other consumers) to call the helper and remove the stale state= usage.
  • Add an assertion in the streaming coverage steps to verify the fixture processing_state, guarding against future regressions.

Additional Context

  • Current helper: features/steps/plan_cli_streaming_coverage_steps.py_make_lifecycle_plan() hardcodes state=ProcessingState.QUEUED.
  • Working helper example: features/steps/plan_cli_coverage_steps.py already uses processing_state= and shows the expected pattern.

Duplicate Check


Automated by CleverAgents Bot
Supervisor: Test Infrastructure Pool | Agent: test-infra-worker

### Summary - `features/steps/plan_cli_streaming_coverage_steps.py` still instantiates `Plan` with the deprecated `state=` keyword. - Because the `Plan` pydantic model ignores unknown fields, the fixture always falls back to the default `ProcessingState.QUEUED`, so the coverage scenarios never actually exercise the intended state combinations. - This divergence from the live domain schema is already causing fixture drift (other plan CLI fixtures use `processing_state=`) and will break as soon as we switch the model to `extra="forbid"`. ### Impact - Plan CLI streaming scenarios cannot model Execute/Apply edge cases because their state overrides are silently dropped. - Future schema tightening will turn this into a hard failure, blocking the entire Behave suite. - The inconsistency adds maintenance overhead because helpers in different files disagree on the canonical field names. ### Proposal - Add a shared helper (e.g. `features/mocks/plan_builders.py`) that builds real `Plan` instances with explicit `phase`/`processing_state` parameters. - Update `plan_cli_streaming_coverage_steps` (and any other consumers) to call the helper and remove the stale `state=` usage. - Add an assertion in the streaming coverage steps to verify the fixture processing_state, guarding against future regressions. ### Additional Context - Current helper: `features/steps/plan_cli_streaming_coverage_steps.py` – `_make_lifecycle_plan()` hardcodes `state=ProcessingState.QUEUED`. - Working helper example: `features/steps/plan_cli_coverage_steps.py` already uses `processing_state=` and shows the expected pattern. ### Duplicate Check - [x] Open issues search (`plan_cli_streaming`): https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues?state=open&limit=50&page=1 - [x] Open issues search (`processing_state`): https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues?state=open&limit=50&page=2 - [x] Closed issues search (`plan_cli_streaming`): https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues?state=closed&limit=50&page=1 --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure Pool | Agent: test-infra-worker
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: State/Wont Do

This is an automation tracking artifact (bot-generated status issue). Not a real work item.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: State/Wont Do** This is an automation tracking artifact (bot-generated status issue). Not a real work item. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#9524
No description provided.