UAT: DevcontainerHandler uses SandboxStrategy.NONE instead of spec-required snapshot — container sandbox isolation is not enforced #2130

Open
opened 2026-04-03 04:19:26 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: feat/container-snapshot-sandbox-strategy
  • Commit Message: feat(sandbox): implement container snapshot strategy for devcontainer-instance
  • Milestone: v3.7.0
  • Parent Epic: #825

Bug Report

What Was Tested

The sandbox strategy used by DevcontainerHandler for devcontainer-instance resources.

Expected Behavior (from spec)

Per docs/specification.md lines 24984-24985:

| container-instance | snapshot | Container commit/checkpoint |
| devcontainer-instance (inherits container-instance) | snapshot (inherited) | Container commit/checkpoint (inherited) |

Per docs/specification.md line 25144:

| devcontainer-instance (inherits container-instance) | DevcontainerHandler | ✓ | ✓ | ✓ | snapshot (inherited) |

Per the resource type definition at line 35109:

sandbox_strategy: "container_snapshot"

The spec requires devcontainer-instance to use the snapshot sandbox strategy (inherited from container-instance), which provides container commit/checkpoint for rollback during plan execution.

Actual Behavior (from code)

In src/cleveragents/resource/handlers/devcontainer.py lines 151-155:

# F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory.
# The container IS the sandbox for devcontainer-instance, so NONE is
# semantically correct until a dedicated container-snapshot strategy
# is implemented.
_default_strategy = SandboxStrategy.NONE

The handler uses SandboxStrategy.NONE because SandboxFactory has not yet implemented the snapshot strategy. This means:

  1. No container commit/checkpoint is created during plan execution
  2. Rollback of container state changes is not possible
  3. The sandbox boundary algebra is broken — devcontainer-instance is not treated as a sandbox boundary

Root Cause

SandboxFactory does not implement the snapshot strategy for containers. The handler was temporarily changed to NONE as a workaround, but this is a spec violation that affects plan safety guarantees.

Code Location

  • src/cleveragents/resource/handlers/devcontainer.py, line 155: _default_strategy = SandboxStrategy.NONE
  • src/cleveragents/infrastructure/sandbox/: SandboxFactory (missing snapshot implementation)
  • docs/reference/devcontainer_resources.md, line 251: Known limitation "Sandbox strategy (F22/F25)"

Impact

  • Plans executing inside devcontainers cannot be rolled back if they fail during the Apply phase
  • The spec's checkpoint/rollback guarantees do not apply to devcontainer execution environments
  • The sandbox boundary algebra (sandbox_boundary(r)) incorrectly treats devcontainer-instance as non-sandboxable

Severity

High — This affects the core safety model of plan execution. The spec's "sandbox + checkpoint safety model for safe, reversible execution" is a core capability that is not functioning for devcontainer resources.

Subtasks

  • Implement snapshot strategy in SandboxFactory for container resources
  • Update DevcontainerHandler._default_strategy to SandboxStrategy.SNAPSHOT
  • Add unit tests for container snapshot sandbox creation
  • Add integration test for plan rollback inside a devcontainer
  • Remove the "Sandbox strategy (F22/F25)" known limitation from docs/reference/devcontainer_resources.md

Definition of Done

  • DevcontainerHandler._default_strategy is SandboxStrategy.SNAPSHOT
  • SandboxFactory successfully creates container snapshots for devcontainer-instance resources
  • Plan execution inside a devcontainer can be rolled back
  • All existing tests continue to pass
  • All nox stages pass
  • Coverage >= 97%
  • The associated PR is merged

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

## Metadata - **Branch**: `feat/container-snapshot-sandbox-strategy` - **Commit Message**: `feat(sandbox): implement container snapshot strategy for devcontainer-instance` - **Milestone**: v3.7.0 - **Parent Epic**: #825 ## Bug Report ### What Was Tested The sandbox strategy used by `DevcontainerHandler` for `devcontainer-instance` resources. ### Expected Behavior (from spec) Per `docs/specification.md` lines 24984-24985: ``` | container-instance | snapshot | Container commit/checkpoint | | devcontainer-instance (inherits container-instance) | snapshot (inherited) | Container commit/checkpoint (inherited) | ``` Per `docs/specification.md` line 25144: ``` | devcontainer-instance (inherits container-instance) | DevcontainerHandler | ✓ | ✓ | ✓ | snapshot (inherited) | ``` Per the resource type definition at line 35109: ```yaml sandbox_strategy: "container_snapshot" ``` The spec requires `devcontainer-instance` to use the `snapshot` sandbox strategy (inherited from `container-instance`), which provides container commit/checkpoint for rollback during plan execution. ### Actual Behavior (from code) In `src/cleveragents/resource/handlers/devcontainer.py` lines 151-155: ```python # F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory. # The container IS the sandbox for devcontainer-instance, so NONE is # semantically correct until a dedicated container-snapshot strategy # is implemented. _default_strategy = SandboxStrategy.NONE ``` The handler uses `SandboxStrategy.NONE` because `SandboxFactory` has not yet implemented the `snapshot` strategy. This means: 1. No container commit/checkpoint is created during plan execution 2. Rollback of container state changes is not possible 3. The sandbox boundary algebra is broken — `devcontainer-instance` is not treated as a sandbox boundary ### Root Cause `SandboxFactory` does not implement the `snapshot` strategy for containers. The handler was temporarily changed to `NONE` as a workaround, but this is a spec violation that affects plan safety guarantees. ### Code Location - `src/cleveragents/resource/handlers/devcontainer.py`, line 155: `_default_strategy = SandboxStrategy.NONE` - `src/cleveragents/infrastructure/sandbox/`: `SandboxFactory` (missing `snapshot` implementation) - `docs/reference/devcontainer_resources.md`, line 251: Known limitation "Sandbox strategy (F22/F25)" ### Impact - Plans executing inside devcontainers cannot be rolled back if they fail during the Apply phase - The spec's checkpoint/rollback guarantees do not apply to devcontainer execution environments - The sandbox boundary algebra (`sandbox_boundary(r)`) incorrectly treats `devcontainer-instance` as non-sandboxable ### Severity **High** — This affects the core safety model of plan execution. The spec's "sandbox + checkpoint safety model for safe, reversible execution" is a core capability that is not functioning for devcontainer resources. ## Subtasks - [ ] Implement `snapshot` strategy in `SandboxFactory` for container resources - [ ] Update `DevcontainerHandler._default_strategy` to `SandboxStrategy.SNAPSHOT` - [ ] Add unit tests for container snapshot sandbox creation - [ ] Add integration test for plan rollback inside a devcontainer - [ ] Remove the "Sandbox strategy (F22/F25)" known limitation from `docs/reference/devcontainer_resources.md` ## Definition of Done - [ ] `DevcontainerHandler._default_strategy` is `SandboxStrategy.SNAPSHOT` - [ ] `SandboxFactory` successfully creates container snapshots for `devcontainer-instance` resources - [ ] Plan execution inside a devcontainer can be rolled back - [ ] All existing tests continue to pass - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] The associated PR is merged --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:19:31 +00:00
freemo self-assigned this 2026-04-03 16:58:03 +00:00
Author
Owner

MoSCoW classification: Must Have

Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix.


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

MoSCoW classification: **Must Have** Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
Reference
cleveragents/cleveragents-core#2130
No description provided.