Files
cleveragents-core/robot/sandbox_checkpoint_smoke.robot
freemo 0ca1303927 feat(sandbox): add checkpoint and rollback hooks
Introduce a lightweight checkpoint/rollback system for sandbox state
during plan execute and apply flows.  CheckpointManager snapshots
the sandbox working directory before each phase and can restore it
on failure, giving the execution engine a reliable undo mechanism.

Key changes:
- SandboxCheckpoint model, Checkpointable protocol, and
  CheckpointManager in infrastructure/sandbox/checkpoint.py
- PlanExecutor gains optional checkpoint_manager with pre/post
  execute hooks and automatic rollback on failure
- PlanApplyService gains optional checkpoint_manager with pre-apply
  checkpoint and rollback helper
- 12 BDD scenarios (features/sandbox_checkpoints.feature)
- 5 Robot Framework smoke tests (robot/sandbox_checkpoint_smoke.robot)
- ASV benchmarks for creation, rollback, and listing operations
- Reference documentation in docs/reference/sandbox.md

ISSUES CLOSED: #183
2026-02-27 23:08:55 +00:00

46 lines
2.3 KiB
Plaintext

*** Settings ***
Documentation Smoke tests for sandbox checkpoint and rollback hooks.
... Covers M4 checkpoint infrastructure: creation, rollback, listing.
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER_SCRIPT} robot/helper_sandbox_checkpoint.py
*** Test Cases ***
Verify Checkpoint Creation During Execute
[Documentation] Create a checkpoint before execute and verify its fields
[Tags] sandbox checkpoint create
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} checkpoint-create cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} checkpoint-create-ok
Verify Rollback After Failed Apply
[Documentation] Snapshot sandbox, modify files, rollback, verify restoration
[Tags] sandbox checkpoint rollback
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} checkpoint-rollback cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} checkpoint-rollback-ok
Verify Checkpoint Listing Order
[Documentation] Create multiple checkpoints and verify ordering
[Tags] sandbox checkpoint listing
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} checkpoint-listing cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} checkpoint-listing-ok
Verify Checkpoint Deletion
[Documentation] Create and delete a checkpoint, verify removal
[Tags] sandbox checkpoint delete
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} checkpoint-delete cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} checkpoint-delete-ok
Verify PlanExecutor Checkpoint Integration
[Documentation] PlanExecutor accepts optional checkpoint_manager
[Tags] sandbox checkpoint integration
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} executor-integration cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} executor-integration-ok