- features/steps/tdd_plan_generation_validate_steps.py: drop duplicate
@given/@then registrations (live in plan_generation_langgraph_coverage_
steps.py; redefinition caused AmbiguousStep errors crashing all 8
behave-parallel workers); have the @when step feed the docstring as the
FakeListLLM response so each scenario tests _validate()'s parsing of a
specific PASS/FAIL signal rather than the input code.
- features/tdd_plan_generation_validate_logic.feature: add the required
@tdd_issue tag alongside @tdd_issue_10746 (enforced by
features/environment.py); tighten scenario 4 wording to remove the
reference to the obsolete length guard.
- robot/plan_generation_graph.robot: drop assertion for handle_retry node
(retry is a conditional edge, not a fifth node) and update node-count
check from 5 to 4; update Should Retry test to assert _should_retry does
NOT mutate state (read-only contract for LangGraph conditional edges).
- src/cleveragents/agents/graphs/plan_generation.py:
* _validate: persist retry_count increment in return dict (FAIL path and
exception path) so LangGraph propagates it through the state graph.
* _should_retry: remove state mutation (conditional-edge functions are
read-only in LangGraph; mutations were silently dropped, causing
retry_count to remain 0 forever and the graph to loop infinitely).
Adjust comparison to retry_count <= max_retries because _validate has
already incremented before _should_retry runs.
* __init__: add max_context_files parameter (default 5, validated > 0)
and wire it into _format_context_summary in place of the hardcoded 5,
implementing the configurable-limits contract tested by
features/agent_configurable_limits.feature.
ISSUES CLOSED: #10746
- Added Given step handler 'I have a langgraph PlanGenerationGraph instance'
to create a PlanGenerationGraph with FakeListLLM in the test setup.
- Added Then step handler 'the langgraph validation status should be "{status}"'
to assert PASS/FAIL results from _validate().
- Fixed TDD tag format: replaced '@tdd_issue @tdd_issue_10746' with '@tdd_issue_10746'
per project convention (single tdd tag, not two).
These changes resolve all three review blocking issues for PR #10867:
1. Missing Given step handler causing test execution failures.
2. Missing Then step handler causing Behave StepDefinitionNotFoundError.
3. TDD tag format violation preventing CI from properly tagging tests.
The core code fix (removing length-based bypass in _validate) was already
correctly implemented and does not need changes.
ISSUES CLOSED: #10867