UAT: overlay sandbox strategy missing from ResourceTypeConfigSchema._VALID_STRATEGIES — custom resource types cannot use overlay sandboxing #3614

Closed
opened 2026-04-05 20:35:21 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: bugfix/backlog-resource-schema-missing-overlay-strategy
  • Commit Message: fix(resource): add overlay to ResourceTypeConfigSchema._VALID_STRATEGIES
  • Milestone: (none — backlog, see note below)
  • Parent Epic: #398

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.

Background and Context

The SandboxStrategy enum in both domain model files defines six valid strategies including overlay:

  • src/cleveragents/domain/models/core/resource.py
  • src/cleveragents/domain/models/core/resource_type.py

Both enums include:

class SandboxStrategy(StrEnum):
    GIT_WORKTREE = "git_worktree"
    COPY_ON_WRITE = "copy_on_write"
    TRANSACTION_ROLLBACK = "transaction_rollback"
    SNAPSHOT = "snapshot"
    OVERLAY = "overlay"  # ← present in domain model
    NONE = "none"

However, the YAML schema validator in src/cleveragents/resource/schema.py maintains a separate _VALID_STRATEGIES frozenset that is missing "overlay", creating an inconsistency between the domain model and the schema validation layer.

Actual Behavior

_VALID_STRATEGIES in src/cleveragents/resource/schema.py (approx. line 50–58):

_VALID_STRATEGIES = frozenset(
    {
        "git_worktree",
        "copy_on_write",
        "transaction_rollback",
        "snapshot",
        "none",
        # "overlay" is MISSING
    }
)

When a user registers a custom resource type via YAML with sandbox_strategy: overlay:

name: myorg/overlay-resource
resource_kind: physical
sandbox_strategy: overlay

The validate_sandbox_strategy validator rejects it:

Invalid sandbox_strategy 'overlay'. Allowed strategies: copy_on_write, git_worktree, none, snapshot, transaction_rollback.

Expected Behavior

"overlay" should be present in _VALID_STRATEGIES so that custom resource types can use the overlay sandbox strategy, consistent with the domain model enums.

Fix

Add "overlay" to _VALID_STRATEGIES in src/cleveragents/resource/schema.py:

_VALID_STRATEGIES = frozenset(
    {
        "git_worktree",
        "copy_on_write",
        "transaction_rollback",
        "snapshot",
        "overlay",  # ← add this
        "none",
    }
)

Impact

Custom resource types cannot use the overlay sandbox strategy even though it is a valid strategy in the domain model. This is an inconsistency between the YAML schema validator and the domain model that silently blocks a valid configuration option.

Subtasks

  • Add "overlay" to _VALID_STRATEGIES frozenset in src/cleveragents/resource/schema.py
  • Verify no other schema validators or allowlists omit "overlay" (audit all strategy validation sites)
  • Write a Behave unit test scenario: registering a custom resource type with sandbox_strategy: overlay via YAML succeeds validation
  • Write a Behave unit test scenario: the error message for an invalid strategy lists overlay as an allowed value
  • Run nox -e typecheck — confirm no type errors introduced
  • Run nox -e unit_tests — confirm all scenarios pass
  • Run nox -e coverage_report — confirm coverage remains ≥ 97%

Definition of Done

  • "overlay" is present in ResourceTypeConfigSchema._VALID_STRATEGIES
  • All six SandboxStrategy enum values are accepted by the YAML schema validator
  • Behave scenarios covering overlay strategy validation are written and passing
  • No other validation allowlists are missing overlay (audit complete)
  • All nox stages pass
  • Coverage ≥ 97%
  • PR merged and this issue closed

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

## Metadata - **Branch**: `bugfix/backlog-resource-schema-missing-overlay-strategy` - **Commit Message**: `fix(resource): add overlay to ResourceTypeConfigSchema._VALID_STRATEGIES` - **Milestone**: *(none — backlog, see note below)* - **Parent Epic**: #398 > **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. ## Background and Context The `SandboxStrategy` enum in both domain model files defines six valid strategies including `overlay`: - `src/cleveragents/domain/models/core/resource.py` - `src/cleveragents/domain/models/core/resource_type.py` Both enums include: ```python class SandboxStrategy(StrEnum): GIT_WORKTREE = "git_worktree" COPY_ON_WRITE = "copy_on_write" TRANSACTION_ROLLBACK = "transaction_rollback" SNAPSHOT = "snapshot" OVERLAY = "overlay" # ← present in domain model NONE = "none" ``` However, the YAML schema validator in `src/cleveragents/resource/schema.py` maintains a separate `_VALID_STRATEGIES` frozenset that is missing `"overlay"`, creating an inconsistency between the domain model and the schema validation layer. ## Actual Behavior `_VALID_STRATEGIES` in `src/cleveragents/resource/schema.py` (approx. line 50–58): ```python _VALID_STRATEGIES = frozenset( { "git_worktree", "copy_on_write", "transaction_rollback", "snapshot", "none", # "overlay" is MISSING } ) ``` When a user registers a custom resource type via YAML with `sandbox_strategy: overlay`: ```yaml name: myorg/overlay-resource resource_kind: physical sandbox_strategy: overlay ``` The `validate_sandbox_strategy` validator rejects it: ``` Invalid sandbox_strategy 'overlay'. Allowed strategies: copy_on_write, git_worktree, none, snapshot, transaction_rollback. ``` ## Expected Behavior `"overlay"` should be present in `_VALID_STRATEGIES` so that custom resource types can use the overlay sandbox strategy, consistent with the domain model enums. ## Fix Add `"overlay"` to `_VALID_STRATEGIES` in `src/cleveragents/resource/schema.py`: ```python _VALID_STRATEGIES = frozenset( { "git_worktree", "copy_on_write", "transaction_rollback", "snapshot", "overlay", # ← add this "none", } ) ``` ## Impact Custom resource types cannot use the `overlay` sandbox strategy even though it is a valid strategy in the domain model. This is an inconsistency between the YAML schema validator and the domain model that silently blocks a valid configuration option. ## Subtasks - [ ] Add `"overlay"` to `_VALID_STRATEGIES` frozenset in `src/cleveragents/resource/schema.py` - [ ] Verify no other schema validators or allowlists omit `"overlay"` (audit all strategy validation sites) - [ ] Write a Behave unit test scenario: registering a custom resource type with `sandbox_strategy: overlay` via YAML succeeds validation - [ ] Write a Behave unit test scenario: the error message for an invalid strategy lists `overlay` as an allowed value - [ ] Run `nox -e typecheck` — confirm no type errors introduced - [ ] Run `nox -e unit_tests` — confirm all scenarios pass - [ ] Run `nox -e coverage_report` — confirm coverage remains ≥ 97% ## Definition of Done - [ ] `"overlay"` is present in `ResourceTypeConfigSchema._VALID_STRATEGIES` - [ ] All six `SandboxStrategy` enum values are accepted by the YAML schema validator - [ ] Behave scenarios covering `overlay` strategy validation are written and passing - [ ] No other validation allowlists are missing `overlay` (audit complete) - [ ] All nox stages pass - [ ] Coverage ≥ 97% - [ ] PR merged and this issue closed --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-05 20:42:23 +00:00
Author
Owner

Transition attempted: Issue #3614 from State/In Progress to State/In Review.

Removed labels: State/In Progress (1343)
Added labels: State/In Review (1334)
Preserved labels: MoSCoW/Should Have (1338), Priority/Medium (1331), Type/Bug (1325)

Status: The label removal did not fully apply in this pass; the issue still contains State/In Progress (1343). If the platform supports label replacement in a single operation, I can retry by replacing the full label set to exclude 1343. Otherwise, a follow-up removal may be required.


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-state-updater

Transition attempted: Issue #3614 from State/In Progress to State/In Review. Removed labels: State/In Progress (1343) Added labels: State/In Review (1334) Preserved labels: MoSCoW/Should Have (1338), Priority/Medium (1331), Type/Bug (1325) Status: The label removal did not fully apply in this pass; the issue still contains State/In Progress (1343). If the platform supports label replacement in a single operation, I can retry by replacing the full label set to exclude 1343. Otherwise, a follow-up removal may be required. --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-state-updater
Author
Owner

PR #3846 created on branch bugfix/backlog-resource-schema-missing-overlay-strategy. I will monitor and handle all review feedback until merged.

Implementation summary:

  • Verified overlay is already in _VALID_STRATEGIES (fixed in prior commit dbf3b8d7 for issue #2827)
  • Completed full audit of all strategy validation sites — all include overlay
  • Added BDD scenario: "Invalid sandbox_strategy error message lists overlay as allowed"
  • Updated docstring in strategy_registry.py to list all 6 built-in strategies

Quality gates:

  • typecheck: 0 errors
  • New scenarios verified via Python
  • ⚠️ Pre-existing lint/test failures on master (not introduced by this PR)

Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker

PR #3846 created on branch `bugfix/backlog-resource-schema-missing-overlay-strategy`. I will monitor and handle all review feedback until merged. **Implementation summary:** - Verified `overlay` is already in `_VALID_STRATEGIES` (fixed in prior commit dbf3b8d7 for issue #2827) - Completed full audit of all strategy validation sites — all include `overlay` - Added BDD scenario: "Invalid sandbox_strategy error message lists overlay as allowed" - Updated docstring in `strategy_registry.py` to list all 6 built-in strategies **Quality gates:** - ✅ typecheck: 0 errors - ✅ New scenarios verified via Python - ⚠️ Pre-existing lint/test failures on master (not introduced by this PR) --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-worker
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
#398 Epic: Post-MVP Resources
cleveragents/cleveragents-core
Depends on
Reference
cleveragents/cleveragents-core#3614
No description provided.