Feature: Consolidated Cli Misc
  Combined scenarios from: cli_config_jinja_port, system_cli_uncovered_branches

  # ============================================================
  # Originally from: cli_config_jinja_port.feature
  # Feature: Actor-first port of v2 CLI/config/Jinja suites
  # ============================================================

  # ============================================================
  # Originally from: system_cli_uncovered_branches.feature
  # Feature: System CLI uncovered branches
  # ============================================================

  Scenario: system cli branch git_sha returns unknown on non-zero exit
    Given system cli branch module is loaded
    When system cli branch git_sha subprocess returns non-zero exit code
    Then system cli branch result should equal "unknown"

    # L107-109: DB path exists, compute size

  Scenario: system cli branch build_info_data computes db size when file exists
    Given system cli branch module is loaded
    When system cli branch build_info_data is called with existing database file
    Then system cli branch storage db_size should contain "MB"

    # L112-113: exception during db size computation

  Scenario: system cli branch build_info_data returns unknown on db stat exception
    Given system cli branch module is loaded
    When system cli branch build_info_data is called with db stat raising exception
    Then system cli branch storage db_size should equal "unknown"

    # L116-118: log_dir exists with files

  Scenario: system cli branch build_info_data computes log size when dir exists
    Given system cli branch module is loaded
    When system cli branch build_info_data is called with existing log directory
    Then system cli branch storage logs should contain "MB"

    # L145-147: config exists but not readable

  Scenario: system cli branch check_config_file returns ERROR when not readable
    Given system cli branch module is loaded
    When system cli branch check_config_file is called with unreadable config
    Then system cli branch check status should be "error"
    And system cli branch check details should be "not readable"

    # L166->174 + L174-175: data dir exists but not writable

  Scenario: system cli branch check_data_dir returns ERROR when not writable
    Given system cli branch module is loaded
    When system cli branch check_data_dir is called with non-writable directory
    Then system cli branch check status should be "error"
    And system cli branch check details should be "not writable"

    # L166->174: data dir does not exist

  Scenario: system cli branch check_data_dir returns WARN when dir missing
    Given system cli branch module is loaded
    When system cli branch check_data_dir is called with missing directory
    Then system cli branch check status should be "warn"

    # L192-194: sqlite DB exists but not writable

  Scenario: system cli branch check_database returns ERROR when db not writable
    Given system cli branch module is loaded
    When system cli branch check_database is called with non-writable sqlite db
    Then system cli branch check status should be "error"
    And system cli branch check details should be "locked or not writable"

    # L257-258: free disk < 0.5 GB

  Scenario: system cli branch check_disk_space returns ERROR when critically low
    Given system cli branch module is loaded
    When system cli branch check_disk_space reports less than half GB free
    Then system cli branch check status should be "error"
    And system cli branch check details should contain "critically low"

    # L263-264: free disk < 1.0 GB

  Scenario: system cli branch check_disk_space returns WARN when low
    Given system cli branch module is loaded
    When system cli branch check_disk_space reports less than one GB free
    Then system cli branch check status should be "warn"
    And system cli branch check details should contain "low"

    # L274-275: OSError in disk check

  Scenario: system cli branch check_disk_space returns WARN on OSError
    Given system cli branch module is loaded
    When system cli branch check_disk_space raises OSError
    Then system cli branch check status should be "warn"
    And system cli branch check details should be "unable to check"

    # L291->300: _check_git subprocess returns non-zero

  Scenario: system cli branch check_git returns ERROR on non-zero exit
    Given system cli branch module is loaded
    When system cli branch check_git subprocess returns non-zero exit code
    Then system cli branch check status should be "error"
    And system cli branch check details should be "not found"

    # L324-325: _check_file_permissions data dir not exists

  Scenario: system cli branch check_file_permissions WARN when data dir missing
    Given system cli branch module is loaded
    When system cli branch check_file_permissions with missing data dir
    Then system cli branch check status should be "warn"
    And system cli branch check details should be "data dir does not exist"

    # L331->333->334: readable but not writable

  Scenario: system cli branch check_file_permissions readable not writable
    Given system cli branch module is loaded
    When system cli branch check_file_permissions with readable not writable dir
    Then system cli branch check status should be "error"
    And system cli branch check details should be "data dir r"

    # L331->333: not readable and not writable (no access)

  Scenario: system cli branch check_file_permissions no access
    Given system cli branch module is loaded
    When system cli branch check_file_permissions with no access dir
    Then system cli branch check status should be "error"
    And system cli branch check details should be "data dir no access"

    # L417->420: render_version_rich with no dependencies

  Scenario: system cli branch render_version_rich skips deps panel when empty
    Given system cli branch module is loaded
    When system cli branch render_version_rich is called with no dependencies
    Then system cli branch no exception should be raised

    # L448->452: render_info_rich with no storage

  Scenario: system cli branch render_info_rich skips storage panel when empty
    Given system cli branch module is loaded
    When system cli branch render_info_rich is called with no storage
    Then system cli branch no exception should be raised
