Files
cleveragents-core/robot/sandbox_checkpoint_smoke.robot
freemo 0ca1303927
CI / lint (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 29s
CI / security (pull_request) Successful in 54s
CI / typecheck (pull_request) Successful in 59s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 25s
CI / integration_tests (pull_request) Successful in 4m33s
CI / benchmark-regression (pull_request) Successful in 22m32s
CI / unit_tests (pull_request) Successful in 30m28s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 1h39m42s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 20s
CI / build (push) Successful in 24s
CI / security (push) Successful in 28s
CI / typecheck (push) Successful in 1m0s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 4m35s
CI / benchmark-publish (push) Successful in 13m36s
CI / coverage (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / docker (push) Has been cancelled
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