Feature: Actor registry new coverage
  As a developer
  I want ActorRegistry thoroughly tested
  So that built-in actor generation and custom upsert stay stable

  Scenario: Registry initializes with service, provider registry, and settings
    Given a stubbed actor registry
    Then the registry should have an actor service
    And the registry should have a provider registry
    And the registry should have settings

  Scenario: _actor_name formats provider/model pair
    Given a stubbed actor registry
    When I format actor name for provider "openai" and model "gpt-4"
    Then the actor name should be "openai/gpt-4"

  Scenario: _build_graph_descriptor returns expected structure
    Given a stubbed actor registry
    When I build a graph descriptor for provider "openai" model "gpt-4" source "test"
    Then the descriptor should contain provider model and source

  Scenario: _canonical_blob fills defaults from config
    Given a stubbed actor registry
    When I build a canonical blob from a config and raw blob
    Then the blob should contain provider model and source keys

  Scenario: ensure_built_in_actors returns empty when no providers configured
    Given a stubbed actor registry with no configured providers
    When I ensure built-in actors
    Then the registry result should be an empty list

  Scenario: ensure_built_in_actors creates actors for configured providers
    Given a stubbed actor registry with configured providers
    When I ensure built-in actors
    Then the result should contain created actors
    And the default actor should be set

  Scenario: ensure_built_in_actors uses preferred provider when defaults match
    Given a stubbed actor registry with configured providers and provider defaults
    When I ensure built-in actors
    Then the preferred provider should be set as default

  Scenario: upsert_actor parses and persists a custom actor
    Given a stubbed actor registry with configured providers
    When I upsert a custom actor with name "local/test" and valid config
    Then the actor should be persisted via the service

  Scenario: upsert_actor raises ValidationError for unsafe config without flag
    Given a stubbed actor registry with configured providers
    When I upsert an actor with unsafe config but no unsafe flag
    Then a ValidationError should be raised

  Scenario: get_actor delegates to actor service
    Given a stubbed actor registry with configured providers
    When I get actor "local/test"
    Then the actor service get_actor should be called

  Scenario: list_actors delegates to actor service
    Given a stubbed actor registry with configured providers
    When I list actors
    Then the actor service list_actors should be called

  Scenario: remove_actor delegates to actor service
    Given a stubbed actor registry with configured providers
    When I remove actor "local/test"
    Then the actor service remove_actor should be called

  Scenario: set_default_actor delegates to actor service
    Given a stubbed actor registry with configured providers
    When I set default actor "local/test"
    Then the actor service set_default_actor should be called

  Scenario: get_default_actor delegates to actor service
    Given a stubbed actor registry with configured providers
    When I get default actor
    Then the actor service get_default_actor should be called
