feat(concurrency): add plan resume #424

Merged
freemo merged 1 commits from feature/m4-concurrency-resume into master 2026-02-25 19:46:27 +00:00
Owner

Summary

Implement step-level progress persistence and plan resume with graceful shutdown handling. This allows interrupted or errored plan executions to be resumed from the last completed step instead of starting over, preserving progress and reducing wasted compute.

Changes

  • New domain models (domain/models/core/resume.py):
    • ResumeCheckpoint: recorded at each completed step, tied to a decision ID and sandbox snapshot.
    • ResumeMetadata: resume state carried on a Plan (last completed step, checkpoint list, interrupted flag).
    • ResumeEligibility: result of resume eligibility validation with structured reason codes.
    • ResumeSummary: output shown before resume execution (phase, step, decision_id).
    • ResumeIneligibleReason: enum for terminal-state and action-phase ineligibility.
  • New service (application/services/plan_resume_service.py):
    • PlanResumeService with validate_eligibility(), build_resume_summary(), resume_plan(dry_run), record_step_checkpoint(), record_shutdown(), and set_total_steps().
  • Modified:
    • domain/models/core/plan.py: added last_completed_step and last_checkpoint_id fields with CLI display dict surfacing.
    • domain/models/core/__init__.py: public exports for all new resume models.
    • cli/commands/plan.py: added plan resume CLI command with --dry-run flag and rich/json output formatting.
  • Documentation: Updated docs/adr/ADR-006-plan-lifecycle.md with resume behavior section covering eligibility, metadata, resume flow, graceful shutdown, examples, and error cases.
  • Testing:
    • 24 Behave scenarios in features/plan_resume.feature with step definitions in features/steps/plan_resume_steps.py.
    • 10 Robot Framework integration tests in robot/plan_resume.robot with helper in robot/helper_plan_resume.py.
    • ASV benchmarks in benchmarks/plan_resume_bench.py for resume overhead baseline.

Closes #328

## Summary Implement step-level progress persistence and plan resume with graceful shutdown handling. This allows interrupted or errored plan executions to be resumed from the last completed step instead of starting over, preserving progress and reducing wasted compute. ### Changes - **New domain models** (`domain/models/core/resume.py`): - `ResumeCheckpoint`: recorded at each completed step, tied to a decision ID and sandbox snapshot. - `ResumeMetadata`: resume state carried on a Plan (last completed step, checkpoint list, interrupted flag). - `ResumeEligibility`: result of resume eligibility validation with structured reason codes. - `ResumeSummary`: output shown before resume execution (phase, step, decision_id). - `ResumeIneligibleReason`: enum for terminal-state and action-phase ineligibility. - **New service** (`application/services/plan_resume_service.py`): - `PlanResumeService` with `validate_eligibility()`, `build_resume_summary()`, `resume_plan(dry_run)`, `record_step_checkpoint()`, `record_shutdown()`, and `set_total_steps()`. - **Modified:** - `domain/models/core/plan.py`: added `last_completed_step` and `last_checkpoint_id` fields with CLI display dict surfacing. - `domain/models/core/__init__.py`: public exports for all new resume models. - `cli/commands/plan.py`: added `plan resume` CLI command with `--dry-run` flag and rich/json output formatting. - **Documentation:** Updated `docs/adr/ADR-006-plan-lifecycle.md` with resume behavior section covering eligibility, metadata, resume flow, graceful shutdown, examples, and error cases. - **Testing:** - 24 Behave scenarios in `features/plan_resume.feature` with step definitions in `features/steps/plan_resume_steps.py`. - 10 Robot Framework integration tests in `robot/plan_resume.robot` with helper in `robot/helper_plan_resume.py`. - ASV benchmarks in `benchmarks/plan_resume_bench.py` for resume overhead baseline. Closes #328
freemo added this to the v3.1.0 milestone 2026-02-25 03:30:03 +00:00
freemo added the
Type
Feature
label 2026-02-25 03:30:20 +00:00
freemo force-pushed feature/m4-concurrency-resume from f76e32baf9 to 3e73aa4b20 2026-02-25 18:03:28 +00:00 Compare
freemo added a new dependency 2026-02-25 18:08:10 +00:00
freemo force-pushed feature/m4-concurrency-resume from 92b38bae2d to 800da42a8d 2026-02-25 18:32:49 +00:00 Compare
freemo force-pushed feature/m4-concurrency-resume from 800da42a8d to c4f71e930d 2026-02-25 19:00:16 +00:00 Compare
freemo merged commit c4f71e930d into master 2026-02-25 19:46:27 +00:00
freemo deleted branch feature/m4-concurrency-resume 2026-02-25 19:46:27 +00:00
freemo added the
State
Completed
label 2026-03-04 00:58:32 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Blocks
#328 feat(concurrency): add plan resume
cleveragents/cleveragents-core
Reference: cleveragents/cleveragents-core#424