feat(plan): implement agents plan correct with revert and append correction modes #9799

Merged
HAL9000 merged 6 commits from feat/plan-correct-revert-append-modes into master 2026-06-14 11:05:47 +00:00

6 Commits

Author SHA1 Message Date
HAL9000 c1c6eea90c fix(cli,tests): catch typer.Exit in actor commands and fix test step init
CI / push-validation (pull_request) Successful in 37s
CI / build (pull_request) Successful in 54s
CI / helm (pull_request) Successful in 57s
CI / lint (pull_request) Successful in 1m17s
CI / typecheck (pull_request) Successful in 1m22s
CI / quality (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 1m31s
CI / unit_tests (pull_request) Successful in 7m0s
CI / docker (pull_request) Successful in 1m55s
CI / integration_tests (pull_request) Successful in 10m39s
CI / coverage (pull_request) Successful in 13m11s
CI / status-check (pull_request) Successful in 3s
- actor.py, actor_run.py: extend except to catch typer.Exit alongside
  click.exceptions.Exit so unknown actor name exits are not swallowed by
  the generic Exception handler, causing wrong exit codes in integration tests
- db_repositories_cov_r3_steps.py: initialize context.drcov3_error = None
  before the try block so the @then assertion does not raise AttributeError
  on the successful-prune path
- plan_correct_revert_append_modes_steps.py: fix import path from
  src.cleveragents to cleveragents (package installs without the src. prefix)
2026-06-14 06:43:09 -04:00
controller-ci-rerun 736700e387 chore: re-trigger CI [controller] 2026-06-14 06:43:09 -04:00
controller-ci-rerun a9648ffba5 chore: re-trigger CI [controller] 2026-06-14 06:43:09 -04:00
HAL9000 c2f024e8a6 fix(plan): resolve AmbiguousStep errors in plan correct BDD steps
Consolidate the four extended @when variants (with guidance, without
--yes, with --yes, with --dry-run) into a single @when step that reads
option flags from context variables set by @given steps. Behave's
registration-time conflict detection uses re.search without end anchors,
so the base mode "{mode}" pattern falsely matched all four longer
variants as prefixes.

Also:
- Add decision ID validation to the @when step so the "decision not
  found" scenario actually raises an error instead of silently passing
- Rename "affected decisions" @then step to avoid pattern collision with
  the identical step already defined in correction_flows_steps.py
- Fix ruff format violations (wrapped long decorator and assertion lines)

ISSUES CLOSED: #9286
2026-06-14 06:43:09 -04:00
controller-ci-rerun d5a5f720ae chore: re-trigger CI [controller] 2026-06-14 06:43:09 -04:00
HAL9000 82890e8e58 feat(plan): implement agents plan correct with revert and append correction modes
Add BDD feature file and step definitions for plan correction functionality.
Implements support for both revert mode (prunes decision tree and re-executes LLM)
and append mode (adds guidance without re-executing).

Features:
- Revert mode with confirmation prompt and --yes flag support
- Append mode with guidance text support
- Dry-run mode for impact analysis
- Plan and decision ID validation
- Non-correctable plan state rejection
- Decision tree persistence to database

ISSUES CLOSED: #9286
2026-06-14 06:43:09 -04:00