UAT: snapshot sandbox strategy raises NotImplementedError — spec-defined strategy is unimplemented #4142

Open
opened 2026-04-06 10:45:15 +00:00 by freemo · 4 comments
Owner

Metadata

  • Branch: fix/sandbox-snapshot-strategy
  • Commit Message: feat(sandbox): implement snapshot sandbox strategy
  • Milestone: (none — backlog)
  • Parent Epic: #362 (Security & Safety Hardening)

Bug Report

What Was Tested

The snapshot sandbox strategy — one of the six sandbox strategies defined in the spec.

Expected Behavior (from spec)

Per docs/specification.md §Sandbox:

The sandbox strategy is defined per resource type. Six strategies are supported: git_worktree, copy_on_write, transaction_rollback, snapshot, overlay, none.

The snapshot strategy should create a filesystem snapshot of the resource before execution, allowing rollback to the pre-execution state.

Actual Behavior

SandboxFactory.create_sandbox() in src/cleveragents/infrastructure/sandbox/factory.py raises NotImplementedError when snapshot is requested:

if sandbox_strategy == STRATEGY_SNAPSHOT:
    raise NotImplementedError("Snapshot sandbox not yet implemented")

The factory docstring explicitly notes:

"snapshot" raises NotImplementedError.

Additionally, the devcontainer.py handler notes:

# F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory.

Impact

  • Any resource type that specifies snapshot as its sandbox strategy will fail at execution time
  • The spec lists snapshot as a valid strategy but it cannot be used
  • Resource type definitions that reference snapshot will silently fail when a plan tries to execute

Code Location

  • src/cleveragents/infrastructure/sandbox/factory.pycreate_sandbox() method, STRATEGY_SNAPSHOT branch
  • src/cleveragents/resource/handlers/devcontainer.py — comment at line 151 noting the limitation

Steps to Reproduce

from cleveragents.infrastructure.sandbox.factory import SandboxFactory
factory = SandboxFactory()
factory.create_sandbox("resource-1", "/tmp/test", "snapshot")
# Raises: NotImplementedError: Snapshot sandbox not yet implemented

Subtasks

  • Implement SnapshotSandbox class in src/cleveragents/infrastructure/sandbox/
  • Register SnapshotSandbox in SandboxFactory.create_sandbox()
  • Add snapshot to _IMPLEMENTED_STRATEGIES frozenset
  • Add BDD scenario testing snapshot sandbox creation and rollback
  • Update _SUPPORTED_STRATEGIES to include snapshot for appropriate resource types

Definition of Done

  • SandboxFactory.create_sandbox("id", "/path", "snapshot") returns a SnapshotSandbox instance
  • SnapshotSandbox supports prepare(), commit(), and rollback() operations
  • BDD scenario covers snapshot creation and rollback
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone (active UAT cycle). 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**: `fix/sandbox-snapshot-strategy` - **Commit Message**: `feat(sandbox): implement snapshot sandbox strategy` - **Milestone**: _(none — backlog)_ - **Parent Epic**: #362 (Security & Safety Hardening) ## Bug Report ### What Was Tested The `snapshot` sandbox strategy — one of the six sandbox strategies defined in the spec. ### Expected Behavior (from spec) Per `docs/specification.md` §Sandbox: > The sandbox strategy is defined per resource type. Six strategies are supported: `git_worktree`, `copy_on_write`, `transaction_rollback`, `snapshot`, `overlay`, `none`. The `snapshot` strategy should create a filesystem snapshot of the resource before execution, allowing rollback to the pre-execution state. ### Actual Behavior `SandboxFactory.create_sandbox()` in `src/cleveragents/infrastructure/sandbox/factory.py` raises `NotImplementedError` when `snapshot` is requested: ```python if sandbox_strategy == STRATEGY_SNAPSHOT: raise NotImplementedError("Snapshot sandbox not yet implemented") ``` The factory docstring explicitly notes: > `"snapshot"` raises `NotImplementedError`. Additionally, the `devcontainer.py` handler notes: ```python # F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory. ``` ### Impact - Any resource type that specifies `snapshot` as its sandbox strategy will fail at execution time - The spec lists `snapshot` as a valid strategy but it cannot be used - Resource type definitions that reference `snapshot` will silently fail when a plan tries to execute ### Code Location - `src/cleveragents/infrastructure/sandbox/factory.py` — `create_sandbox()` method, `STRATEGY_SNAPSHOT` branch - `src/cleveragents/resource/handlers/devcontainer.py` — comment at line 151 noting the limitation ### Steps to Reproduce ```python from cleveragents.infrastructure.sandbox.factory import SandboxFactory factory = SandboxFactory() factory.create_sandbox("resource-1", "/tmp/test", "snapshot") # Raises: NotImplementedError: Snapshot sandbox not yet implemented ``` ## Subtasks - [ ] Implement `SnapshotSandbox` class in `src/cleveragents/infrastructure/sandbox/` - [ ] Register `SnapshotSandbox` in `SandboxFactory.create_sandbox()` - [ ] Add `snapshot` to `_IMPLEMENTED_STRATEGIES` frozenset - [ ] Add BDD scenario testing snapshot sandbox creation and rollback - [ ] Update `_SUPPORTED_STRATEGIES` to include `snapshot` for appropriate resource types ## Definition of Done - [ ] `SandboxFactory.create_sandbox("id", "/path", "snapshot")` returns a `SnapshotSandbox` instance - [ ] `SnapshotSandbox` supports `prepare()`, `commit()`, and `rollback()` operations - [ ] BDD scenario covers snapshot creation and rollback - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone _(active UAT cycle)_. 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
Author
Owner

TRIAGE: v3.0.0 Foundation - High Priority

This automated issue identifies a critical gap: a spec-defined sandbox strategy that raises NotImplementedError. While labeled Medium priority, this should be elevated as it blocks any resource using the snapshot strategy.

Rationale:

  • Core sandbox functionality is incomplete
  • Spec-defined feature that fails at runtime
  • Blocks execution for any resources using snapshot strategy
  • Should be elevated from Priority/Medium to Priority/High
  • Essential for minimal working sandbox system

Recommendation: Upgrade priority and assign to v3.0.0 foundation milestone as this represents missing core functionality, not just a nice-to-have improvement.

**TRIAGE: v3.0.0 Foundation - High Priority** This automated issue identifies a critical gap: a spec-defined sandbox strategy that raises NotImplementedError. While labeled Medium priority, this should be elevated as it blocks any resource using the snapshot strategy. **Rationale:** - Core sandbox functionality is incomplete - Spec-defined feature that fails at runtime - Blocks execution for any resources using snapshot strategy - Should be elevated from Priority/Medium to Priority/High - Essential for minimal working sandbox system **Recommendation:** Upgrade priority and assign to v3.0.0 foundation milestone as this represents missing core functionality, not just a nice-to-have improvement.
freemo added this to the v3.3.0 milestone 2026-04-06 17:48:49 +00:00
Author
Owner

Milestone Triage Decision: Moved to Backlog

This security logging issue has been moved out of v3.3.0 during aggressive milestone triage. While important for security, it does not relate to the core focus of Corrections + Subplans + Checkpoints.

Reasoning:

  • v3.3.0 focus: Essential corrections, subplan management, and checkpoint functionality
  • This issue: Security logging enhancement - important but not milestone-blocking
  • Impact: Security observability improvement, not core corrections/subplans/checkpoints functionality

Will be addressed in a future milestone focused on security hardening and observability.

**Milestone Triage Decision: Moved to Backlog** This security logging issue has been moved out of v3.3.0 during aggressive milestone triage. While important for security, it does not relate to the core focus of Corrections + Subplans + Checkpoints. **Reasoning:** - v3.3.0 focus: Essential corrections, subplan management, and checkpoint functionality - This issue: Security logging enhancement - important but not milestone-blocking - Impact: Security observability improvement, not core corrections/subplans/checkpoints functionality Will be addressed in a future milestone focused on security hardening and observability.
freemo removed this from the v3.3.0 milestone 2026-04-06 20:42:38 +00:00
Owner

Label compliance fix applied:

  • Removed conflicting label: Priority/Medium
  • Kept: Priority/High
  • Reason: Issue had two conflicting Priority/* labels. Per CONTRIBUTING.md, only one Priority/* label is allowed. Keeping the higher-priority label.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Removed conflicting label: `Priority/Medium` - Kept: `Priority/High` - Reason: Issue had two conflicting Priority/* labels. Per CONTRIBUTING.md, only one Priority/* label is allowed. Keeping the higher-priority label. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
HAL9000 self-assigned this 2026-04-08 18:51:50 +00:00
HAL9000 added this to the v3.6.0 milestone 2026-04-08 18:51:50 +00:00
Owner

Issue assigned to @HAL9000 and milestone set to v3.6.0.

Milestone Rationale: Snapshot sandbox strategy is part of the security and safety hardening scope. v3.6.0 covers security features.

Assignment Rationale: Default assignment to HAL9000 to maintain velocity.


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

Issue assigned to @HAL9000 and milestone set to **v3.6.0**. **Milestone Rationale**: Snapshot sandbox strategy is part of the security and safety hardening scope. v3.6.0 covers security features. **Assignment Rationale**: Default assignment to HAL9000 to maintain velocity. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4142
No description provided.