UAT: Snapshot sandbox strategy raises NotImplementedError — spec describes it as a supported sandbox strategy #3921

Open
opened 2026-04-06 07:26:27 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: feat/sandbox-snapshot-strategy
  • Commit Message: feat(sandbox): implement snapshot sandbox strategy
  • Milestone: (none — backlog, see note below)
  • Parent Epic: #397

Background

The SandboxFactory in src/cleveragents/infrastructure/sandbox/factory.py defines "snapshot" as a valid sandbox strategy constant (STRATEGY_SNAPSHOT = "snapshot", line 37) and includes it in the valid strategies list (line 45), but raises NotImplementedError when the snapshot strategy is actually requested (line 160).

Per docs/specification.md, the sandbox + checkpoint safety model is listed as a core capability:

[x] A **sandbox + checkpoint** safety model for safe, reversible execution

The snapshot strategy should be a functional sandbox strategy. Currently, any code path that requests a snapshot sandbox will fail at runtime with an unhandled NotImplementedError, making this a misleading API.

Code location: src/cleveragents/infrastructure/sandbox/factory.py lines 37, 45, 82, 121, 160

Steps to reproduce:

  1. Read src/cleveragents/infrastructure/sandbox/factory.py
  2. Observe STRATEGY_SNAPSHOT = "snapshot" is defined as valid (line 37, included in valid strategies list line 45)
  3. Observe raise NotImplementedError("Snapshot sandbox not yet implemented") at line 160

Actual behavior:

# In src/cleveragents/infrastructure/sandbox/factory.py line 160:
raise NotImplementedError("Snapshot sandbox not yet implemented")

Impact: The snapshot sandbox strategy is advertised as valid (included in the valid strategies list) but raises NotImplementedError at runtime. Either the strategy should be removed from the valid list until implemented, or it should be implemented per the specification.

Subtasks

  • Write a failing Behave scenario in features/ that demonstrates the NotImplementedError when requesting a snapshot sandbox (TDD)
  • Implement the SnapshotSandbox class in src/cleveragents/infrastructure/sandbox/ with full static typing
  • Wire SnapshotSandbox into SandboxFactory to handle STRATEGY_SNAPSHOT (line 160)
  • Ensure SnapshotSandbox supports checkpoint creation and rollback per the spec's sandbox + checkpoint safety model
  • Add integration test in robot/ for snapshot sandbox lifecycle (create → checkpoint → rollback)
  • Update any relevant documentation or docstrings in factory.py
  • Verify all nox quality gates pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e coverage_report)

Definition of Done

  • SandboxFactory no longer raises NotImplementedError for the "snapshot" strategy
  • SnapshotSandbox is fully implemented and passes all Behave unit tests
  • Integration test in robot/ covers snapshot sandbox lifecycle
  • All code is statically typed with no # type: ignore suppressions
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `feat/sandbox-snapshot-strategy` - **Commit Message**: `feat(sandbox): implement snapshot sandbox strategy` - **Milestone**: *(none — backlog, see note below)* - **Parent Epic**: #397 ## Background The `SandboxFactory` in `src/cleveragents/infrastructure/sandbox/factory.py` defines `"snapshot"` as a valid sandbox strategy constant (`STRATEGY_SNAPSHOT = "snapshot"`, line 37) and includes it in the valid strategies list (line 45), but raises `NotImplementedError` when the snapshot strategy is actually requested (line 160). Per `docs/specification.md`, the sandbox + checkpoint safety model is listed as a core capability: > `[x] A **sandbox + checkpoint** safety model for safe, reversible execution` The snapshot strategy should be a functional sandbox strategy. Currently, any code path that requests a snapshot sandbox will fail at runtime with an unhandled `NotImplementedError`, making this a misleading API. **Code location**: `src/cleveragents/infrastructure/sandbox/factory.py` lines 37, 45, 82, 121, 160 **Steps to reproduce**: 1. Read `src/cleveragents/infrastructure/sandbox/factory.py` 2. Observe `STRATEGY_SNAPSHOT = "snapshot"` is defined as valid (line 37, included in valid strategies list line 45) 3. Observe `raise NotImplementedError("Snapshot sandbox not yet implemented")` at line 160 **Actual behavior**: ```python # In src/cleveragents/infrastructure/sandbox/factory.py line 160: raise NotImplementedError("Snapshot sandbox not yet implemented") ``` **Impact**: The snapshot sandbox strategy is advertised as valid (included in the valid strategies list) but raises `NotImplementedError` at runtime. Either the strategy should be removed from the valid list until implemented, or it should be implemented per the specification. ## Subtasks - [ ] Write a failing Behave scenario in `features/` that demonstrates the `NotImplementedError` when requesting a snapshot sandbox (TDD) - [ ] Implement the `SnapshotSandbox` class in `src/cleveragents/infrastructure/sandbox/` with full static typing - [ ] Wire `SnapshotSandbox` into `SandboxFactory` to handle `STRATEGY_SNAPSHOT` (line 160) - [ ] Ensure `SnapshotSandbox` supports checkpoint creation and rollback per the spec's sandbox + checkpoint safety model - [ ] Add integration test in `robot/` for snapshot sandbox lifecycle (create → checkpoint → rollback) - [ ] Update any relevant documentation or docstrings in `factory.py` - [ ] Verify all nox quality gates pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e coverage_report`) ## Definition of Done - [ ] `SandboxFactory` no longer raises `NotImplementedError` for the `"snapshot"` strategy - [ ] `SnapshotSandbox` is fully implemented and passes all Behave unit tests - [ ] Integration test in `robot/` covers snapshot sandbox lifecycle - [ ] All code is statically typed with no `# type: ignore` suppressions - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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#3921
No description provided.