3 Commits

Author SHA1 Message Date
HAL9000 6141d2a36d fix(agents/graphs): unblock TDD validate tests + read-only _should_retry + max_context_files
CI / lint (pull_request) Successful in 42s
CI / quality (pull_request) Successful in 1m2s
CI / security (pull_request) Successful in 1m12s
CI / typecheck (pull_request) Successful in 1m19s
CI / build (pull_request) Successful in 47s
CI / helm (pull_request) Successful in 51s
CI / push-validation (pull_request) Successful in 25s
CI / unit_tests (pull_request) Successful in 5m57s
CI / docker (pull_request) Successful in 1m40s
CI / integration_tests (pull_request) Successful in 9m35s
CI / coverage (pull_request) Successful in 12m42s
CI / status-check (pull_request) Successful in 4s
- 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
2026-06-14 16:34:44 -04:00
HAL9000 c9691c0d5d fix(feature/tests): Add missing step handlers and fix TDD tags for PlanGenerationGraph validate tests
- 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
2026-06-14 16:34:44 -04:00
HAL9000 0d015623f2 fix(agents/graphs/plan_generation): _validate always passes for code longer than 10 characters, making LLM validation ineffective
Fix PlanGenerationGraph._validate to respect LLM responses: require PASS and no FAIL.
Added Behave TDD tests features/tdd_plan_generation_validate_logic.feature and helper step file.

ISSUES CLOSED: #10746
2026-06-14 16:34:44 -04:00