Feature: Filesystem Resource Type Configurations
  As a CleverAgents developer
  I want fs-mount, fs-directory, and fs-file resource types
  So that filesystem resources have proper hierarchy and discovery

  # ── fs-mount schema validation ─────────────────────────────

  Scenario: fs-mount YAML loads and validates against schema
    Given the built-in fs-mount 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-mount"

  Scenario: fs-mount has correct resource kind
    Given the built-in fs-mount YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema resource_kind should be "physical"

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

  Scenario: fs-mount is user addable
    Given the built-in fs-mount YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema user_addable should be true

  Scenario: fs-mount is built-in
    Given the built-in fs-mount YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema built_in should be true

  Scenario: fs-mount has path cli_arg
    Given the built-in fs-mount 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"

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

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

  Scenario: fs-mount has correct handler
    Given the built-in fs-mount YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema handler should be "cleveragents.resource.handlers.fs_mount"

  Scenario: fs-mount has correct capabilities
    Given the built-in fs-mount 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

  # ── fs-mount auto-discovery ────────────────────────────────

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

  Scenario: fs-mount auto-discovery has fs-directory rule
    Given the built-in fs-mount YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin auto_discovery should have rule for "fs-directory"

  # ── fs-mount domain model ─────────────────────────────────

  Scenario: fs-mount YAML loads as domain model
    Given the built-in fs-mount 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-mount"

  # ── fs-directory updated constraints ──────────────────────

  Scenario: fs-directory has fs-file child type
    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-file"

  Scenario: fs-directory has fs-symlink child type
    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-symlink"

  Scenario: fs-directory has fs-hardlink child type
    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-hardlink"

  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

  Scenario: fs-directory auto-discovery has fs-directory rule
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin auto_discovery should have rule for "fs-directory"

  Scenario: fs-directory auto-discovery has fs-file rule
    Given the built-in fs-directory YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin auto_discovery should have rule for "fs-file"

  # ── fs-file schema validation ─────────────────────────────

  Scenario: fs-file YAML loads and validates against schema
    Given the built-in fs-file 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-file"

  Scenario: fs-file has correct resource kind
    Given the built-in fs-file YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema resource_kind should be "physical"

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

  Scenario: fs-file is not user addable
    Given the built-in fs-file YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema user_addable should be false

  Scenario: fs-file is built-in
    Given the built-in fs-file YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema built_in should be true

  Scenario: fs-file has no cli_args
    Given the built-in fs-file YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should have 0 cli_args

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

  Scenario: fs-file has no child types
    Given the built-in fs-file YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin schema should have empty child_types

  Scenario: fs-file has correct capabilities
    Given the built-in fs-file 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 false
    And the builtin capabilities should have checkpoint false

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

  Scenario: fs-file YAML loads as domain model
    Given the built-in fs-file 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-file"

  # ── git-checkout auto-discovery rules ─────────────────────

  Scenario: git-checkout auto-discovery has fs-directory rule
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin auto_discovery should have rule for "fs-directory"

  Scenario: git-checkout auto-discovery has git rule
    Given the built-in git-checkout YAML file
    When I load the built-in YAML via from_yaml_file
    Then the builtin auto_discovery should have rule for "git"
