feat(checkpoints): implement auto-checkpoint creation with configurable triggers and retention policy #8915

Open
opened 2026-04-14 04:02:44 +00:00 by HAL9000 · 3 comments
Owner

Metadata

  • Commit message: feat(checkpoints): implement auto-checkpoint creation with configurable triggers and retention policy
  • Branch name: feat/m4/checkpoint-auto-triggers

Background and Context

Epic #4973 (Checkpoint & Rollback System — Plan State Persistence) requires that checkpoints can be automatically created at configurable execution milestones. Currently, the sandbox.checkpoint.auto-create-on config key is not registered, and auto-checkpoint triggers are not wired into the plan execution pipeline.

UAT issue #6010 identified that checkpoint auto-trigger names and config key namespace mismatch the spec. This issue implements the full auto-checkpoint infrastructure: config key registration, trigger wiring into the execution pipeline, and a retention policy to prevent unbounded checkpoint storage growth.

This issue blocks Epic #4973.

Acceptance Criteria

  • sandbox.checkpoint.auto-create-on config key is registered and validated
  • Auto-checkpoint triggers fire at configurable execution milestones (e.g., before_step, after_subplan, on_error)
  • Auto-checkpoint trigger names match the spec exactly (no namespace mismatch)
  • Checkpoints created by auto-triggers are persisted to the checkpoints DB table
  • Retention policy enforces a configurable maximum number of checkpoints per plan
  • Old checkpoints beyond the retention limit are pruned automatically
  • Unit tests (Behave) cover auto-trigger scenarios for each supported trigger event
  • Integration test (Robot) verifies auto-checkpoint creation during plan execution
  • Test coverage >= 97% for all new/modified modules

Subtasks

  • Register sandbox.checkpoint.auto-create-on config key with validation
  • Define supported trigger event names per spec (e.g., before_step, after_subplan, on_error)
  • Wire auto-checkpoint trigger into ExecutePhase at each supported event point
  • Implement CheckpointService.auto_create_if_configured() method
  • Implement retention policy enforcement in CheckpointService (prune old checkpoints)
  • Add max_checkpoints_per_plan config key for retention limit
  • Write Behave unit tests for each trigger event and retention pruning
  • Write Robot integration test for auto-checkpoint during plan execution
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage >= 97%)
  • Code reviewed and approved
  • Documentation updated if needed
  • No regressions introduced

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message:** `feat(checkpoints): implement auto-checkpoint creation with configurable triggers and retention policy` - **Branch name:** `feat/m4/checkpoint-auto-triggers` ## Background and Context Epic #4973 (Checkpoint & Rollback System — Plan State Persistence) requires that checkpoints can be automatically created at configurable execution milestones. Currently, the `sandbox.checkpoint.auto-create-on` config key is not registered, and auto-checkpoint triggers are not wired into the plan execution pipeline. UAT issue #6010 identified that checkpoint auto-trigger names and config key namespace mismatch the spec. This issue implements the full auto-checkpoint infrastructure: config key registration, trigger wiring into the execution pipeline, and a retention policy to prevent unbounded checkpoint storage growth. This issue blocks Epic #4973. ## Acceptance Criteria - [ ] `sandbox.checkpoint.auto-create-on` config key is registered and validated - [ ] Auto-checkpoint triggers fire at configurable execution milestones (e.g., `before_step`, `after_subplan`, `on_error`) - [ ] Auto-checkpoint trigger names match the spec exactly (no namespace mismatch) - [ ] Checkpoints created by auto-triggers are persisted to the `checkpoints` DB table - [ ] Retention policy enforces a configurable maximum number of checkpoints per plan - [ ] Old checkpoints beyond the retention limit are pruned automatically - [ ] Unit tests (Behave) cover auto-trigger scenarios for each supported trigger event - [ ] Integration test (Robot) verifies auto-checkpoint creation during plan execution - [ ] Test coverage >= 97% for all new/modified modules ## Subtasks - [ ] Register `sandbox.checkpoint.auto-create-on` config key with validation - [ ] Define supported trigger event names per spec (e.g., `before_step`, `after_subplan`, `on_error`) - [ ] Wire auto-checkpoint trigger into `ExecutePhase` at each supported event point - [ ] Implement `CheckpointService.auto_create_if_configured()` method - [ ] Implement retention policy enforcement in `CheckpointService` (prune old checkpoints) - [ ] Add `max_checkpoints_per_plan` config key for retention limit - [ ] Write Behave unit tests for each trigger event and retention pruning - [ ] Write Robot integration test for auto-checkpoint during plan execution - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage >= 97%) - [ ] Code reviewed and approved - [ ] Documentation updated if needed - [ ] No regressions introduced --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.3.0 milestone 2026-04-14 04:03:44 +00:00
Author
Owner

Triage Decision [AUTO-OWNR-4]

Verified

Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'.

  • Type: Feature
  • MoSCoW: Must Have — v3.3.0 checkpoint acceptance criteria
  • Priority: Medium
  • Milestone: v3.3.0

Automated by CleverAgents Bot
Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor

## Triage Decision [AUTO-OWNR-4] **Verified** ✅ Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'. - **Type:** Feature - **MoSCoW:** Must Have — v3.3.0 checkpoint acceptance criteria - **Priority:** Medium - **Milestone:** v3.3.0 --- **Automated by CleverAgents Bot** Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor
Author
Owner

Triage Decision [AUTO-OWNR-4]

Verified

Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'.

  • Type: Feature
  • MoSCoW: Must Have — v3.3.0 checkpoint acceptance criteria
  • Priority: Medium
  • Milestone: v3.3.0

Automated by CleverAgents Bot
Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor

## Triage Decision [AUTO-OWNR-4] **Verified** ✅ Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'. - **Type:** Feature - **MoSCoW:** Must Have — v3.3.0 checkpoint acceptance criteria - **Priority:** Medium - **Milestone:** v3.3.0 --- **Automated by CleverAgents Bot** Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor
Author
Owner

Triage Decision [AUTO-OWNR-4]

Verified

Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'.

  • Type: Feature
  • MoSCoW: Must Have — v3.3.0 checkpoint acceptance criteria
  • Priority: Medium
  • Milestone: v3.3.0

Automated by CleverAgents Bot
Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor

## Triage Decision [AUTO-OWNR-4] **Verified** ✅ Auto-checkpoint creation is part of v3.3.0 acceptance criteria: 'Checkpoint creation and rollback (plan rollback) functional'. - **Type:** Feature - **MoSCoW:** Must Have — v3.3.0 checkpoint acceptance criteria - **Priority:** Medium - **Milestone:** v3.3.0 --- **Automated by CleverAgents Bot** Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
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.

Reference
cleveragents/cleveragents-core#8915
No description provided.