Feature: Resource type extension interface
  As a third-party developer
  I want a stable extension interface for custom resource types
  So that I can add new resource types without modifying core code

  Scenario: ResourceStatus enum has all required values
    Given the resource extension interface is imported
    Then ResourceStatus should have value "PENDING"
    And ResourceStatus should have value "ACTIVE"
    And ResourceStatus should have value "FAILED"
    And ResourceStatus should have value "DEPROVISIONED"

  Scenario: ResourceStatus values are strings
    Given the resource extension interface is imported
    Then each ResourceStatus value should be a string

  Scenario: ResourceConfig can be instantiated with required fields
    Given the resource extension interface is imported
    When I create a ResourceConfig with name "my-resource" and type "custom/db"
    Then the ResourceConfig name should be "my-resource"
    And the ResourceConfig resource_type should be "custom/db"

  Scenario: ResourceConfig has optional properties field
    Given the resource extension interface is imported
    When I create a ResourceConfig with name "r1" and type "custom/t1"
    Then the ResourceConfig properties should be an empty dict by default

  Scenario: ResourceConfig accepts custom properties
    Given the resource extension interface is imported
    When I create a ResourceConfig with name "r2" type "custom/t2" and properties {"host": "localhost"}
    Then the ResourceConfig properties should contain "host" with value "localhost"

  Scenario: ResourceType is an abstract base class
    Given the resource extension interface is imported
    Then ResourceType should be an abstract class

  Scenario: ResourceType cannot be instantiated directly
    Given the resource extension interface is imported
    When I try to instantiate ResourceType directly
    Then a resource extension TypeError should be raised

  Scenario: ResourceType requires provision method
    Given the resource extension interface is imported
    When I define a resext class missing the provision method
    Then the resext class instantiation should raise TypeError

  Scenario: ResourceType requires deprovision method
    Given the resource extension interface is imported
    When I define a resext class missing the deprovision method
    Then the resext class instantiation should raise TypeError

  Scenario: ResourceType requires status method
    Given the resource extension interface is imported
    When I define a resext class missing the status method
    Then the resext class instantiation should raise TypeError

  Scenario: ResourceType requires validate_config method
    Given the resource extension interface is imported
    When I define a resext class missing the validate_config method
    Then the resext class instantiation should raise TypeError

  Scenario: ResourceType requires to_dict method
    Given the resource extension interface is imported
    When I define a resext class missing the to_dict method
    Then the resext class instantiation should raise TypeError

  Scenario: Concrete ResourceType subclass can be instantiated
    Given the resource extension interface is imported
    When I define a complete concrete ResourceType subclass
    Then it should be instantiable without errors

  Scenario: Concrete ResourceType provision returns ResourceStatus
    Given the resource extension interface is imported
    And I have a concrete ResourceType instance
    When I call provision with a valid ResourceConfig
    Then the resext result should be a ResourceStatus

  Scenario: Concrete ResourceType deprovision returns ResourceStatus
    Given the resource extension interface is imported
    And I have a concrete ResourceType instance
    When I call deprovision with a valid ResourceConfig
    Then the resext result should be a ResourceStatus

  Scenario: Concrete ResourceType status returns ResourceStatus
    Given the resource extension interface is imported
    And I have a concrete ResourceType instance
    When I call status with a valid ResourceConfig
    Then the resext result should be a ResourceStatus

  Scenario: Concrete ResourceType validate_config returns list
    Given the resource extension interface is imported
    And I have a concrete ResourceType instance
    When I call validate_config with a valid ResourceConfig
    Then the resext result should be a list

  Scenario: Concrete ResourceType to_dict returns dict
    Given the resource extension interface is imported
    And I have a concrete ResourceType instance
    When I call to_dict
    Then the resext result should be a dict

  Scenario: register_resource_type registers a class by name
    Given the resource extension interface is imported
    And the resext registry is cleared
    When I register a resext class as "custom/my-type"
    Then the resext registry should contain "custom/my-type"

  Scenario: register_resource_type rejects non-ResourceType classes
    Given the resource extension interface is imported
    And the resext registry is cleared
    When I try to register a non-resext class as "custom/bad-type"
    Then a resource extension TypeError should be raised

  Scenario: register_resource_type rejects duplicate names
    Given the resource extension interface is imported
    And the resext registry is cleared
    When I register a resext class as "custom/dup-type"
    And I try to register another resext class as "custom/dup-type"
    Then a resource extension ValueError should be raised

  Scenario: get_resource_type retrieves a registered class
    Given the resource extension interface is imported
    And the resext registry is cleared
    When I register a resext class as "custom/get-type"
    Then resext get_resource_type("custom/get-type") should return the class

  Scenario: get_resource_type returns None for unknown names
    Given the resource extension interface is imported
    And the resext registry is cleared
    Then resext get_resource_type("custom/unknown") should return None

  Scenario: list_resource_types returns all registered names
    Given the resource extension interface is imported
    And the resext registry is cleared
    When I register a resext class as "custom/list-type-a"
    And I register a resext class as "custom/list-type-b"
    Then resext list_resource_types should include "custom/list-type-a"
    And resext list_resource_types should include "custom/list-type-b"

  Scenario: All interface symbols are importable from cleveragents.resources
    Given the resource extension interface is imported
    Then ResourceType should be importable from cleveragents.resources
    And ResourceConfig should be importable from cleveragents.resources
    And ResourceStatus should be importable from cleveragents.resources
    And register_resource_type should be importable from cleveragents.resources
    And get_resource_type should be importable from cleveragents.resources
    And list_resource_types should be importable from cleveragents.resources
