feat(concurrency): add plan resume #424

Merged
freemo merged 1 commit 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 force-pushed feature/m4-concurrency-resume from f76e32baf9
Some checks failed
CI / quality (pull_request) Successful in 20s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 25s
CI / security (pull_request) Successful in 35s
CI / build (pull_request) Successful in 29s
CI / typecheck (pull_request) Successful in 56s
CI / integration_tests (pull_request) Failing after 4m22s
CI / unit_tests (pull_request) Successful in 8m15s
CI / docker (pull_request) Successful in 38s
CI / benchmark-regression (pull_request) Successful in 18m15s
CI / coverage (pull_request) Successful in 57m0s
to 3e73aa4b20
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / lint (pull_request) Failing after 20s
CI / security (pull_request) Successful in 28s
CI / typecheck (pull_request) Successful in 35s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 2m49s
CI / unit_tests (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
2026-02-25 18:03:28 +00:00
Compare
freemo force-pushed feature/m4-concurrency-resume from 92b38bae2d
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 16s
CI / lint (pull_request) Failing after 19s
CI / typecheck (pull_request) Successful in 36s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / security (pull_request) Successful in 41s
CI / integration_tests (pull_request) Failing after 4m11s
CI / unit_tests (pull_request) Successful in 18m50s
CI / docker (pull_request) Has been skipped
to 800da42a8d
Some checks failed
CI / lint (pull_request) Successful in 21s
CI / security (pull_request) Successful in 49s
CI / typecheck (pull_request) Successful in 1m4s
CI / quality (pull_request) Successful in 35s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 26s
CI / integration_tests (pull_request) Successful in 5m33s
CI / unit_tests (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
2026-02-25 18:32:49 +00:00
Compare
freemo force-pushed feature/m4-concurrency-resume from 800da42a8d
Some checks failed
CI / lint (pull_request) Successful in 21s
CI / security (pull_request) Successful in 49s
CI / typecheck (pull_request) Successful in 1m4s
CI / quality (pull_request) Successful in 35s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 26s
CI / integration_tests (pull_request) Successful in 5m33s
CI / unit_tests (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
to c4f71e930d
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 21s
CI / build (pull_request) Successful in 23s
CI / typecheck (pull_request) Successful in 39s
CI / security (pull_request) Successful in 50s
CI / integration_tests (pull_request) Successful in 4m4s
CI / unit_tests (pull_request) Successful in 9m15s
CI / docker (pull_request) Successful in 1m0s
CI / benchmark-regression (pull_request) Successful in 23m41s
CI / coverage (pull_request) Successful in 43m24s
CI / lint (push) Successful in 22s
CI / build (push) Successful in 24s
CI / quality (push) Successful in 27s
CI / typecheck (push) Successful in 44s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 55s
CI / integration_tests (push) Successful in 4m16s
CI / benchmark-publish (push) Successful in 14m39s
CI / unit_tests (push) Successful in 24m24s
CI / docker (push) Successful in 1m1s
CI / coverage (push) Successful in 45m36s
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
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#328 feat(concurrency): add plan resume
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!424
No description provided.