Feature: Settings class spec-required env var fields
  The Settings class must expose fields for all spec-required environment
  variables: CLEVERAGENTS_SERVER_URL, CLEVERAGENTS_SERVER_TOKEN,
  CLEVERAGENTS_FORMAT, and CLEVERAGENTS_DEFAULT_ESTIMATION_ACTOR.

  Background:
    Given no CleverAgents spec-field env vars are set

  # ── server_url ──────────────────────────────────────────────────────────────

  Scenario: server_url defaults to None when env var is absent
    When I instantiate Settings for spec fields
    Then settings.server_url should be None

  Scenario: server_url reads CLEVERAGENTS_SERVER_URL from environment
    Given the environment variable "CLEVERAGENTS_SERVER_URL" is set to "https://ca.example.com"
    When I instantiate Settings for spec fields
    Then settings.server_url should be "https://ca.example.com"

  Scenario: server_url accepts any string value
    Given the environment variable "CLEVERAGENTS_SERVER_URL" is set to "http://localhost:9000"
    When I instantiate Settings for spec fields
    Then settings.server_url should be "http://localhost:9000"

  # ── server_token ─────────────────────────────────────────────────────────────

  Scenario: server_token defaults to None when env var is absent
    When I instantiate Settings for spec fields
    Then settings.server_token should be None

  Scenario: server_token reads CLEVERAGENTS_SERVER_TOKEN from environment
    Given the environment variable "CLEVERAGENTS_SERVER_TOKEN" is set to "secret-token-abc"
    When I instantiate Settings for spec fields
    Then settings.server_token should be "secret-token-abc"

  Scenario: server_token accepts any string value
    Given the environment variable "CLEVERAGENTS_SERVER_TOKEN" is set to "bearer-xyz-789"
    When I instantiate Settings for spec fields
    Then settings.server_token should be "bearer-xyz-789"

  # ── format ───────────────────────────────────────────────────────────────────

  Scenario: format defaults to None when env var is absent
    When I instantiate Settings for spec fields
    Then settings.format should be None

  Scenario: format reads CLEVERAGENTS_FORMAT from environment
    Given the environment variable "CLEVERAGENTS_FORMAT" is set to "json"
    When I instantiate Settings for spec fields
    Then settings.format should be "json"

  Scenario: format accepts any string value
    Given the environment variable "CLEVERAGENTS_FORMAT" is set to "markdown"
    When I instantiate Settings for spec fields
    Then settings.format should be "markdown"

  # ── default_estimation_actor ─────────────────────────────────────────────────

  Scenario: default_estimation_actor defaults to None when env var is absent
    When I instantiate Settings for spec fields
    Then settings.default_estimation_actor should be None

  Scenario: default_estimation_actor reads CLEVERAGENTS_DEFAULT_ESTIMATION_ACTOR from environment
    Given the environment variable "CLEVERAGENTS_DEFAULT_ESTIMATION_ACTOR" is set to "gpt-estimator"
    When I instantiate Settings for spec fields
    Then settings.default_estimation_actor should be "gpt-estimator"

  Scenario: default_estimation_actor accepts any string value
    Given the environment variable "CLEVERAGENTS_DEFAULT_ESTIMATION_ACTOR" is set to "claude-estimator"
    When I instantiate Settings for spec fields
    Then settings.default_estimation_actor should be "claude-estimator"

  # ── model_fields presence ────────────────────────────────────────────────────

  Scenario: all four spec fields appear in Settings.model_fields
    When I inspect Settings.model_fields
    Then "server_url" should be present in model_fields
    And "server_token" should be present in model_fields
    And "format" should be present in model_fields
    And "default_estimation_actor" should be present in model_fields

  # ── type annotation ──────────────────────────────────────────────────────────

  Scenario: all four spec fields are typed as str or None
    When I instantiate Settings for spec fields
    Then settings.server_url should be of type str or None
    And settings.server_token should be of type str or None
    And settings.format should be of type str or None
    And settings.default_estimation_actor should be of type str or None
