Feature: Resource Registry Domain Model As a developer I want spec-aligned Resource Registry domain models So that resources are tracked with proper types, capabilities, and relationships # PhysVirt enum Scenario: PhysVirt has exactly two values Then the PhysVirt enum should have values "physical, virtual" Scenario: PhysVirt physical value Given a PhysVirt value of "physical" Then the PhysVirt string value should be "physical" Scenario: PhysVirt virtual value Given a PhysVirt value of "virtual" Then the PhysVirt string value should be "virtual" Scenario: PhysVirt rejects invalid value When I try to create a PhysVirt with value "hybrid" Then a resource validation error should be raised # SandboxStrategy enum Scenario: SandboxStrategy has exactly five values Then the SandboxStrategy enum should have values "git_worktree, copy_on_write, transaction_rollback, snapshot, none" Scenario Outline: SandboxStrategy accepts valid values Given a SandboxStrategy value of "" Then the SandboxStrategy string value should be "" Examples: | strategy | | git_worktree | | copy_on_write | | transaction_rollback | | snapshot | | none | Scenario: SandboxStrategy rejects overlay When I try to create a SandboxStrategy with value "overlay" Then a resource validation error should be raised Scenario: SandboxStrategy rejects versioning When I try to create a SandboxStrategy with value "versioning" Then a resource validation error should be raised # ResourceCapabilities model Scenario: ResourceCapabilities defaults Given default ResourceCapabilities Then the capability readable should be true And the capability writable should be true And the capability sandboxable should be true And the capability checkpointable should be false Scenario: ResourceCapabilities with custom values Given ResourceCapabilities with readable false and checkpointable true Then the capability readable should be false And the capability writable should be true And the capability sandboxable should be true And the capability checkpointable should be true Scenario: ResourceCapabilities is frozen Given default ResourceCapabilities When I try to mutate a ResourceCapabilities field Then a resource validation error should be raised # Resource model - creation Scenario: Create a minimal physical resource Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" Then the resource resource_id should be "01HZQX7K8M3N4P5R6S7T8V9W0X" And the resource type name should be "git-checkout" And the resource classification should be "physical" And the resource name should be empty And the resource description should be empty And the resource properties should be empty And the resource parents should be empty And the resource children should be empty And the resource linked_projects should be empty And the resource created_at should be set And the resource updated_at should be set Scenario: Create a full resource with all fields Given a full Resource with id "01HZQX7K8M3N4P5R6S7T8V9W0X" name "local/my-repo" type "git-checkout" classification "physical" description "Main repo" Then the resource name should be "local/my-repo" And the resource description should be "Main repo" Scenario: Resource with sandbox strategy override Given a Resource with sandbox strategy "git_worktree" Then the resource sandbox strategy should be "git_worktree" Scenario: Resource with capabilities Given a Resource with sandboxable false and checkpointable true Then the resource can_sandbox should be false And the resource can_checkpoint should be true # Resource model - validation Scenario: Resource rejects invalid ULID When I try to create a Resource with resource_id "invalid-ulid" Then a resource validation error should be raised Scenario: Resource rejects empty resource_type_name When I try to create a Resource with empty resource_type_name Then a resource validation error should be raised Scenario: Resource rejects empty string name When I try to create a Resource with empty string name Then a resource validation error should be raised Scenario: Resource accepts None name Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" Then the resource name should be empty # Resource model - domain properties Scenario: Physical resource is_physical Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" Then the resource is_physical should be true And the resource is_virtual should be false Scenario: Virtual resource is_virtual Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git" and classification "virtual" Then the resource is_physical should be false And the resource is_virtual should be true Scenario: Read-only resource Given a Resource with writable false Then the resource is_read_only should be true Scenario: Writable resource Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" Then the resource is_read_only should be false # Resource model - frozen Scenario: Resource is frozen Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" When I try to mutate a Resource field Then a resource validation error should be raised # Resource model - with_updated_at Scenario: with_updated_at returns new instance Given a Resource with resource_id "01HZQX7K8M3N4P5R6S7T8V9W0X" type "git-checkout" and classification "physical" When I call with_updated_at on the resource Then the new resource should have a different updated_at And the new resource should have the same resource_id # Resource model - content_hash and location Scenario: Resource with content_hash Given a Resource with content_hash "sha256:abc123" Then the resource content_hash should be "sha256:abc123" Scenario: Resource with location Given a Resource with location "/home/user/repos/main" Then the resource location should be "/home/user/repos/main" Scenario: Resource rejects empty location string When I try to create a Resource with empty location Then a resource validation error should be raised # Resource model - parents and children Scenario: Resource with parents and children Given a Resource with parents and children Then the resource should have 1 parent And the resource should have 2 children