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

2 Commits

Author SHA1 Message Date
brent.edwards 4af22f8ac2 fix(tests): stabilize revert re-execution step fixtures
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:39 +00:00
brent.edwards 8e5b871103 feat(plan): implement real revert-mode re-execution from decision point
Enhanced CorrectionService.execute_revert to implement the full revert-mode
re-execution pipeline from the specification (§ Correction Flow, Revert Mode):

1. Resource rollback: When a CheckpointService is wired and a decision-aligned
   checkpoint exists, delegates to rollback_to_checkpoint for real git reset.
   Gracefully degrades when checkpointing is unavailable (returns False).

2. Reasoning rollback: Extracts actor_state_ref from the target decision's
   context_snapshot and returns it in the result for downstream LangGraph
   checkpoint restoration.

3. Guidance injection: Generates a user_intervention decision ID so callers
   can record the correction guidance in the decision tree.

4. Phase transition: Signals that the plan should re-enter Strategize via
   phase_transition_target="strategize" on the result.

Added four new fields to CorrectionResult: checkpoint_restored, actor_state_ref,
user_intervention_decision_id, and phase_transition_target — all with backward-
compatible defaults. Extended execute_correction dispatch to forward the new
decisions parameter.

Tests: 16 Behave BDD scenarios (features/revert_re_execution.feature) covering
checkpoint restoration, actor state recovery, phase transition, error paths,
subtree selectivity, and dispatch integration. 7 Robot Framework integration
tests (robot/revert_re_execution.robot). Coverage: 98% (above 97% threshold).

ISSUES CLOSED: #844
2026-03-28 00:32:39 +00:00