feat(plan): implement real revert-mode re-execution from decision point #1153

Merged
brent.edwards merged 2 commits from feat/844-revert-mode-re-execution into master 2026-03-28 00:57:51 +00:00
Member

Summary

Implements the full revert-mode re-execution pipeline from the specification (§ Correction Flow, Revert Mode), enabling agents plan correct --mode=revert to truly re-execute from the targeted decision point rather than only logically marking decisions as superseded.

Changes

  • Resource rollback: CorrectionService.execute_revert now delegates to CheckpointService.rollback_to_checkpoint when a decision-aligned checkpoint exists, performing real git reset --hard in the sandbox. Gracefully degrades when checkpointing is unavailable.
  • Reasoning rollback: Extracts actor_state_ref from the target decision's ContextSnapshot for downstream LangGraph actor restoration.
  • Guidance injection: Generates a user_intervention decision ID for callers to record correction guidance in the decision tree.
  • Phase transition: Signals that the plan should re-enter Strategize via phase_transition_target="strategize" on the result.
  • Model extension: Added checkpoint_restored, actor_state_ref, user_intervention_decision_id, and phase_transition_target fields to CorrectionResult with backward-compatible defaults.
  • Dispatch update: execute_correction now accepts and forwards a decisions parameter.

Design Approach

Uses a signal-based architecture: rather than having CorrectionService directly manipulate plan state or LangGraph actors, the enhanced execute_revert returns signal fields on CorrectionResult that downstream consumers use for the full pipeline. This preserves separation of concerns.

Tests

  • Behave: 16 new BDD scenarios in features/revert_re_execution.feature
  • Robot: 7 integration tests in robot/revert_re_execution.robot
  • Coverage: 98% (above 97% threshold)

Quality Gates

Gate Status
nox -s lint Pass
nox -s typecheck Pass (0 errors)
nox -s unit_tests Pass (12376 scenarios, 0 failed)
nox -s integration_tests Pass (1631 passed, 3 pre-existing failures #647)
nox -s e2e_tests Pass (37 passed)
nox -s coverage_report Pass (98%)

Closes #844

## Summary Implements the full revert-mode re-execution pipeline from the specification (§ Correction Flow, Revert Mode), enabling `agents plan correct --mode=revert` to truly re-execute from the targeted decision point rather than only logically marking decisions as superseded. ### Changes - **Resource rollback**: `CorrectionService.execute_revert` now delegates to `CheckpointService.rollback_to_checkpoint` when a decision-aligned checkpoint exists, performing real `git reset --hard` in the sandbox. Gracefully degrades when checkpointing is unavailable. - **Reasoning rollback**: Extracts `actor_state_ref` from the target decision's `ContextSnapshot` for downstream LangGraph actor restoration. - **Guidance injection**: Generates a `user_intervention` decision ID for callers to record correction guidance in the decision tree. - **Phase transition**: Signals that the plan should re-enter Strategize via `phase_transition_target="strategize"` on the result. - **Model extension**: Added `checkpoint_restored`, `actor_state_ref`, `user_intervention_decision_id`, and `phase_transition_target` fields to `CorrectionResult` with backward-compatible defaults. - **Dispatch update**: `execute_correction` now accepts and forwards a `decisions` parameter. ### Design Approach Uses a signal-based architecture: rather than having `CorrectionService` directly manipulate plan state or LangGraph actors, the enhanced `execute_revert` returns signal fields on `CorrectionResult` that downstream consumers use for the full pipeline. This preserves separation of concerns. ### Tests - **Behave**: 16 new BDD scenarios in `features/revert_re_execution.feature` - **Robot**: 7 integration tests in `robot/revert_re_execution.robot` - **Coverage**: 98% (above 97% threshold) ### Quality Gates | Gate | Status | |------|--------| | `nox -s lint` | Pass | | `nox -s typecheck` | Pass (0 errors) | | `nox -s unit_tests` | Pass (12376 scenarios, 0 failed) | | `nox -s integration_tests` | Pass (1631 passed, 3 pre-existing failures #647) | | `nox -s e2e_tests` | Pass (37 passed) | | `nox -s coverage_report` | Pass (98%) | Closes #844
brent.edwards added this to the v3.2.0 milestone 2026-03-24 22:17:40 +00:00
Owner

Code Review Note

Unable to review — the branch feat/844-revert-mode-re-execution was not found on the remote. Please verify the branch exists and has been pushed.

## Code Review Note **Unable to review** — the branch `feat/844-revert-mode-re-execution` was not found on the remote. Please verify the branch exists and has been pushed.
brent.edwards force-pushed feat/844-revert-mode-re-execution from bb0f5f6426
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / unit_tests (pull_request) Failing after 2m43s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m42s
CI / typecheck (pull_request) Successful in 3m54s
CI / security (pull_request) Successful in 4m1s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 6m34s
CI / e2e_tests (pull_request) Successful in 11m10s
CI / coverage (pull_request) Successful in 11m56s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-regression (pull_request) Successful in 59m48s
to 28f9883963
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 19s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m18s
CI / quality (pull_request) Successful in 3m53s
CI / typecheck (pull_request) Successful in 3m55s
CI / security (pull_request) Successful in 4m10s
CI / integration_tests (pull_request) Successful in 9m6s
CI / unit_tests (pull_request) Successful in 9m20s
CI / docker (pull_request) Successful in 1m37s
CI / e2e_tests (pull_request) Successful in 11m47s
CI / benchmark-regression (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
2026-03-28 00:19:28 +00:00
Compare
brent.edwards force-pushed feat/844-revert-mode-re-execution from 28f9883963
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 19s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m18s
CI / quality (pull_request) Successful in 3m53s
CI / typecheck (pull_request) Successful in 3m55s
CI / security (pull_request) Successful in 4m10s
CI / integration_tests (pull_request) Successful in 9m6s
CI / unit_tests (pull_request) Successful in 9m20s
CI / docker (pull_request) Successful in 1m37s
CI / e2e_tests (pull_request) Successful in 11m47s
CI / benchmark-regression (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
to 4af22f8ac2
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 21s
CI / build (pull_request) Successful in 40s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 3m45s
CI / typecheck (pull_request) Successful in 3m57s
CI / security (pull_request) Successful in 4m9s
CI / integration_tests (pull_request) Successful in 6m54s
CI / unit_tests (pull_request) Successful in 7m5s
CI / docker (pull_request) Successful in 1m18s
CI / e2e_tests (pull_request) Successful in 11m38s
CI / coverage (pull_request) Successful in 11m42s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 54m15s
2026-03-28 00:32:41 +00:00
Compare
brent.edwards deleted branch feat/844-revert-mode-re-execution 2026-03-28 00:57:52 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core!1153
No description provided.