Feature: Action CLI edge cases coverage
  As a developer
  I want to test edge cases and fallback paths in the action CLI
  So that all branches are thoroughly exercised

  Background:
    Given an action edge case CLI runner
    And an action edge case mocked lifecycle service

  # _print_action edge cases
  Scenario: Print action with no arguments shows none indicator
    Given an action edge case action with no arguments
    When I call action edge case print action
    Then the action edge case output should contain "(none)"

  Scenario: Print action with arguments shows formatted list
    Given an action edge case action with multiple arguments
    When I call action edge case print action
    Then the action edge case output should contain argument "target_coverage"
    And the action edge case output should contain argument "test_framework"
    And the action edge case output should contain "Target coverage percentage"

  Scenario: Print action with minimal description shows description line
    Given an action edge case action without short description
    When I call action edge case print action
    Then the action edge case output should contain "Minimal"

  # Create command edge cases (config-only)
  Scenario: Create action from config with multiple arguments
    Given an action edge case config with multiple args
    When I run action edge case create with config
    Then the action edge case create should succeed
    And the action edge case service should receive 2 arguments

  Scenario: Create action from config with read-only flag
    Given an action edge case config with read-only
    When I run action edge case create with config
    Then the action edge case create should succeed
    And the action edge case service should receive read_only true

  Scenario: Create action from config with long_description
    Given an action edge case config with long description
    When I run action edge case create with config
    Then the action edge case create should succeed
    And the action edge case service should receive long description "Detailed documentation text"

  # List command with state filters
  Scenario: List actions with state filter available
    Given there are action edge case existing actions
    When I run action edge case list with state "available"
    Then the action edge case list should succeed
    And the action edge case service list should be called with available state

  Scenario: List actions with state filter archived
    Given there are action edge case existing actions
    When I run action edge case list with state "archived"
    Then the action edge case list should succeed
    And the action edge case service list should be called with archived state

  # Show command edge cases
  Scenario: Show action succeeds with name lookup
    Given an action edge case that is findable by name
    When I run action edge case show with name "local/name-only-action"
    Then the action edge case show should succeed
    And the action edge case service should have used get_action_by_name

  Scenario: Show action raises abort when name lookup fails
    Given an action edge case where name lookup fails
    When I run action edge case show with name "nonexistent"
    Then the action edge case show should abort with not found

  # Archive command edge cases
  Scenario: Archive command succeeds with name lookup
    Given an action edge case action findable by name for archive
    When I run action edge case archive with name "local/name-only-available"
    Then the action edge case archive should succeed
    And the action edge case service should have used get_action_by_name

  Scenario: Archive command not found aborts
    Given an action edge case where name lookup fails for archive
    When I run action edge case archive with name "nonexistent"
    Then the action edge case archive should abort with not found
