Feature: Built-in Resource Type Configurations
  As a CleverAgents developer
  I want built-in resource type YAMLs (git-checkout, fs-directory) to validate
  So that M1-critical resource types are available out of the box

  # ── Schema validation ─────────────────────────────────────

  Scenario: git-checkout YAML validates against schema
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should be valid
    And the builtin schema name should be "git-checkout"

  Scenario: fs-directory YAML validates against schema
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should be valid
    And the builtin schema name should be "fs-directory"

  # ── Sandbox strategy ──────────────────────────────────────

  Scenario: git-checkout has correct sandbox strategy
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema sandbox_strategy should be "git_worktree"

  Scenario: fs-directory has correct sandbox strategy
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema sandbox_strategy should be "copy_on_write"

  # ── Parent types ──────────────────────────────────────────

  Scenario: fs-directory has correct parent types
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema parent_types should contain "git-checkout"
    And the builtin schema parent_types should contain "fs-directory"

  Scenario: git-checkout has no parent types
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should have empty parent_types

  # ── Unnamespaced built-ins ────────────────────────────────

  Scenario: Both built-ins are unnamespaced
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema name should not contain "/"
    And the builtin schema built_in should be true

  Scenario: fs-directory is unnamespaced
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema name should not contain "/"
    And the builtin schema built_in should be true

  # ── Capabilities ──────────────────────────────────────────

  Scenario: Built-in types have capabilities
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin capabilities should have read true
    And the builtin capabilities should have write true
    And the builtin capabilities should have sandbox true
    And the builtin capabilities should have checkpoint true

  Scenario: fs-directory has no checkpoint capability
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin capabilities should have read true
    And the builtin capabilities should have write true
    And the builtin capabilities should have sandbox true
    And the builtin capabilities should have checkpoint false

  # ── Domain model loading ──────────────────────────────────

  Scenario: git-checkout YAML loads as domain model
    Given the built-in git-checkout YAML file
    When I load the built-in YAML as a ResourceTypeSpec
    Then the builtin domain model should be valid
    And the builtin domain model name should be "git-checkout"

  Scenario: fs-directory YAML loads as domain model
    Given the built-in fs-directory YAML file
    When I load the built-in YAML as a ResourceTypeSpec
    Then the builtin domain model should be valid
    And the builtin domain model name should be "fs-directory"

  # ── CLI arguments ─────────────────────────────────────────

  Scenario: git-checkout has path and branch cli_args
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should have 2 cli_args
    And the builtin first cli_arg name should be "path"
    And the builtin second cli_arg name should be "branch"

  Scenario: fs-directory has path cli_arg only
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should have 1 cli_args
    And the builtin first cli_arg name should be "path"

  # ── Child types ───────────────────────────────────────────

  Scenario: git-checkout has correct child types
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema child_types should contain "git"
    And the builtin schema child_types should contain "fs-directory"

  Scenario: fs-directory has correct child types
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema child_types should contain "fs-directory"
    And the builtin schema child_types should contain "fs-file"

  # ── Handler ───────────────────────────────────────────────

  Scenario: git-checkout has handler reference
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema handler should be "cleveragents.resource.handlers.git_checkout"

  Scenario: fs-directory has handler reference
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema handler should be "cleveragents.resource.handlers.fs_directory:FsDirectoryHandler"

  # ── Auto-discovery ────────────────────────────────────────

  Scenario: git-checkout has auto-discovery enabled
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema auto_discovery should be enabled

  Scenario: fs-directory has auto-discovery enabled
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema auto_discovery should be enabled

  # ── Resource kind ─────────────────────────────────────────

  Scenario: Both built-ins are physical resources
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema resource_kind should be "physical"

  Scenario: fs-directory is physical
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema resource_kind should be "physical"
