Feature: TUI persona registry coverage
  Additional scenarios that exercise previously uncovered code paths
  in the PersonaRegistry class (registry.py).

  Background:
    Given a fresh temporary persona registry

  Scenario: persona_path rejects name that resolves outside personas directory
    When I call persona_path with a path-traversal name bypassing validation
    Then persona_path should raise ValueError with "Invalid persona name"

  Scenario: list_personas skips files with non-dict YAML content
    Given I create a persona YAML file "notadict" with content that parses to a list
    And I save a valid registry persona "keeper" with actor "local/mock-actor"
    When I list all registry personas
    Then the registry persona list should contain "keeper"
    And the registry persona list should not contain "notadict"

  Scenario: get returns None for persona file with non-dict YAML content
    Given I create a persona YAML file "badformat" with content that parses to a string
    When I get persona "badformat" from the registry
    Then the get result should be None

  Scenario: validate_cycle_order skips self when checking duplicates
    Given I save a valid registry persona "alpha" with actor "local/mock-actor" and cycle order 2
    When I re-save registry persona "alpha" with actor "local/mock-actor" and cycle order 2
    Then the re-save should succeed without error

  Scenario: delete returns False for non-existent persona
    When I delete persona "ghost" from the registry
    Then tprcov the delete result should be False

  Scenario: export_persona raises ValueError for non-existent persona
    When I export persona "nonexistent" to "out.yaml"
    Then the export should raise ValueError with "Persona not found"

  Scenario: export_persona writes file for existing persona
    Given I save a valid registry persona "exportable" with actor "local/mock-actor"
    When I export persona "exportable" to a valid relative path
    Then the exported file should exist and contain persona data

  Scenario: import_persona reads file and saves persona to registry
    Given I create a valid persona YAML file at a relative path for import
    When I import a persona from the relative path
    Then the imported persona should be saved in the registry
    And the imported persona name should be "imported-test"

  Scenario: import_persona raises ValueError for non-dict YAML file
    Given I create a non-dict YAML file at a relative path for import
    When I import a persona from the non-dict file
    Then the import should raise ValueError with "Invalid persona file"

  Scenario: load_state returns empty dict when state file has non-dict YAML
    Given I write non-dict YAML to the state file
    When I load registry state
    Then the loaded state should be an empty dict
