UAT: ResourceTypeConfigSchema accepts copy_on_write sandbox strategy but spec defines filesystem_copy — strategy name mismatch #2987

Open
opened 2026-04-05 03:16:00 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: fix/resource-type-schema-sandbox-strategy-names
  • Commit Message: fix(resource): align ResourceTypeConfigSchema sandbox strategy names with spec
  • Milestone: v3.7.0
  • Parent Epic: #398

Bug Report

Feature Area: Configuration Files — Resource Type Configuration Files Schema

Spec Reference: Global Configuration Keys section, sandbox.strategy key:

"Accepted values: git_worktree (create a git worktree for isolation), filesystem_copy (copy the project directory), transaction_rollback (for database resources), none (no isolation)"

Expected Behavior (per spec)

The sandbox_strategy field in resource type YAML configuration files should accept: git_worktree, filesystem_copy, transaction_rollback, none.

Actual Behavior

src/cleveragents/resource/schema.py defines _VALID_STRATEGIES as:

_VALID_STRATEGIES = frozenset(
    {
        "git_worktree",
        "copy_on_write",        # ← NOT in spec
        "transaction_rollback",
        "snapshot",             # ← NOT in spec
        "none",
    }
)

The spec-defined value filesystem_copy is absent from the valid strategies set. Instead, copy_on_write is accepted (which is not in the spec). Additionally, snapshot is accepted but not defined in the spec's sandbox strategy list.

Steps to Reproduce

  1. Create a resource type YAML with sandbox_strategy: filesystem_copy
  2. Run agents resource type add --config resource_type.yaml
  3. Observe: Validation fails with "Invalid sandbox_strategy 'filesystem_copy'" even though this is the spec-defined value

Conversely:

  1. Create a resource type YAML with sandbox_strategy: copy_on_write
  2. Run agents resource type add --config resource_type.yaml
  3. Observe: Validation passes even though copy_on_write is not in the spec

Impact

  • Users following the spec documentation cannot register resource types with filesystem_copy strategy
  • The global config key sandbox.strategy accepts filesystem_copy (per spec) but the resource type config schema rejects it
  • Inconsistency between global config accepted values and resource type config accepted values

Code Location

src/cleveragents/resource/schema.py_VALID_STRATEGIES constant (approximately line 40-48)

Fix Direction

Update _VALID_STRATEGIES to match the spec:

_VALID_STRATEGIES = frozenset(
    {
        "git_worktree",
        "filesystem_copy",      # spec-defined
        "transaction_rollback",
        "none",
    }
)

Subtasks

  • Confirm exact line numbers and current content of _VALID_STRATEGIES in src/cleveragents/resource/schema.py
  • Update _VALID_STRATEGIES to replace copy_on_write and snapshot with filesystem_copy per spec
  • Search codebase for any other references to copy_on_write or snapshot strategy strings that may also need updating
  • Update or add Behave BDD unit test scenarios covering all four valid strategy values and rejection of copy_on_write/snapshot
  • Verify nox -e lint, nox -e typecheck, nox -e unit_tests, and nox -e coverage_report all pass

Definition of Done

  • _VALID_STRATEGIES in src/cleveragents/resource/schema.py contains exactly {"git_worktree", "filesystem_copy", "transaction_rollback", "none"}
  • copy_on_write and snapshot are no longer accepted as valid sandbox strategies in resource type config
  • filesystem_copy is accepted as a valid sandbox strategy in resource type config
  • BDD scenarios cover all four spec-defined strategies and rejection of non-spec values
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/resource-type-schema-sandbox-strategy-names` - **Commit Message**: `fix(resource): align ResourceTypeConfigSchema sandbox strategy names with spec` - **Milestone**: v3.7.0 - **Parent Epic**: #398 ## Bug Report **Feature Area:** Configuration Files — Resource Type Configuration Files Schema **Spec Reference:** Global Configuration Keys section, `sandbox.strategy` key: > "Accepted values: `git_worktree` (create a git worktree for isolation), `filesystem_copy` (copy the project directory), `transaction_rollback` (for database resources), `none` (no isolation)" ### Expected Behavior (per spec) The `sandbox_strategy` field in resource type YAML configuration files should accept: `git_worktree`, `filesystem_copy`, `transaction_rollback`, `none`. ### Actual Behavior `src/cleveragents/resource/schema.py` defines `_VALID_STRATEGIES` as: ```python _VALID_STRATEGIES = frozenset( { "git_worktree", "copy_on_write", # ← NOT in spec "transaction_rollback", "snapshot", # ← NOT in spec "none", } ) ``` The spec-defined value `filesystem_copy` is **absent** from the valid strategies set. Instead, `copy_on_write` is accepted (which is not in the spec). Additionally, `snapshot` is accepted but not defined in the spec's sandbox strategy list. ### Steps to Reproduce 1. Create a resource type YAML with `sandbox_strategy: filesystem_copy` 2. Run `agents resource type add --config resource_type.yaml` 3. Observe: Validation fails with "Invalid sandbox_strategy 'filesystem_copy'" even though this is the spec-defined value Conversely: 1. Create a resource type YAML with `sandbox_strategy: copy_on_write` 2. Run `agents resource type add --config resource_type.yaml` 3. Observe: Validation passes even though `copy_on_write` is not in the spec ### Impact - Users following the spec documentation cannot register resource types with `filesystem_copy` strategy - The global config key `sandbox.strategy` accepts `filesystem_copy` (per spec) but the resource type config schema rejects it - Inconsistency between global config accepted values and resource type config accepted values ### Code Location `src/cleveragents/resource/schema.py` — `_VALID_STRATEGIES` constant (approximately line 40-48) ### Fix Direction Update `_VALID_STRATEGIES` to match the spec: ```python _VALID_STRATEGIES = frozenset( { "git_worktree", "filesystem_copy", # spec-defined "transaction_rollback", "none", } ) ``` ## Subtasks - [ ] Confirm exact line numbers and current content of `_VALID_STRATEGIES` in `src/cleveragents/resource/schema.py` - [ ] Update `_VALID_STRATEGIES` to replace `copy_on_write` and `snapshot` with `filesystem_copy` per spec - [ ] Search codebase for any other references to `copy_on_write` or `snapshot` strategy strings that may also need updating - [ ] Update or add Behave BDD unit test scenarios covering all four valid strategy values and rejection of `copy_on_write`/`snapshot` - [ ] Verify `nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, and `nox -e coverage_report` all pass ## Definition of Done - [ ] `_VALID_STRATEGIES` in `src/cleveragents/resource/schema.py` contains exactly `{"git_worktree", "filesystem_copy", "transaction_rollback", "none"}` - [ ] `copy_on_write` and `snapshot` are no longer accepted as valid sandbox strategies in resource type config - [ ] `filesystem_copy` is accepted as a valid sandbox strategy in resource type config - [ ] BDD scenarios cover all four spec-defined strategies and rejection of non-spec values - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 03:18:16 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Transition completed: Issue #2987 from State/Verified to State/In Progress.

Preconditions:

  • Previous state: State/Verified (not Paused) — ok
  • Blocked label not present or not applicable for this transition.

Actions taken:

  • Removed labels: State/Verified
  • Added labels: State/In Progress

Notes:

  • Blocker: N/A
  • If further adjustments are needed, let me know.

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

Transition completed: Issue #2987 from State/Verified to State/In Progress. Preconditions: - Previous state: State/Verified (not Paused) — ok - Blocked label not present or not applicable for this transition. Actions taken: - Removed labels: State/Verified - Added labels: State/In Progress Notes: - Blocker: N/A - If further adjustments are needed, let me know. --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-state-updater
Author
Owner

Starting implementation on branch fix/resource-type-schema-sandbox-strategy-names.

Analysis complete:

  • _VALID_STRATEGIES in src/cleveragents/resource/schema.py contains copy_on_write and snapshot (not in spec)
  • Spec (line 30588) defines valid values as: git_worktree, filesystem_copy, transaction_rollback, none
  • Also need to update docs/schema/resource_type.schema.yaml, examples/resource-types/*.yaml, and BDD tests

Difficulty assessment: Low → starting at sonnet tier.


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

Starting implementation on branch `fix/resource-type-schema-sandbox-strategy-names`. **Analysis complete:** - `_VALID_STRATEGIES` in `src/cleveragents/resource/schema.py` contains `copy_on_write` and `snapshot` (not in spec) - Spec (line 30588) defines valid values as: `git_worktree`, `filesystem_copy`, `transaction_rollback`, `none` - Also need to update `docs/schema/resource_type.schema.yaml`, `examples/resource-types/*.yaml`, and BDD tests Difficulty assessment: Low → starting at sonnet tier. --- **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
Reference
cleveragents/cleveragents-core#2987
No description provided.