Skip to content

Latest commit

 

History

History
183 lines (135 loc) · 6.64 KB

File metadata and controls

183 lines (135 loc) · 6.64 KB
feature Profile-Only Architecture + Ad-hoc Mode
spec Simplify configuration by removing [default] and [providers] sections. All configuration lives in [profiles.*]. Ad-hoc mode via -P for execution without config.

Feature 13: Profile-Only Architecture

Description: Remove [default] and [providers], centralize everything in [profiles.*]

Phase 1: Struct Changes

  • 13.01 Remove DefaultConfig struct from src/config/mod.rs
  • 13.02 Remove ProviderConfig struct from src/config/mod.rs
  • 13.03 Simplify Config struct (remove default and providers fields)
  • 13.04 Ensure ProfileConfig has all required fields with proper defaults

Phase 2: Loader Changes

  • 13.05 Remove merge logic for [default] section in src/config/loader.rs
  • 13.06 Remove merge logic for [providers] section in src/config/loader.rs
  • 13.07 Simplify overlay to only merge: profiles, behavior, context, update, commands, aliases

Phase 3: Access Method Changes

  • 13.08 Refactor api_key() to fetch from active profile (with ENV fallback)
  • 13.09 Refactor base_url() to fetch from active profile (with ENV fallback)
  • 13.10 Refactor active_provider() to fetch from active profile
  • 13.11 Refactor active_model() to fetch from active profile
  • 13.12 Remove or refactor apply_profile() method
  • 13.13 Refactor with_cli_overrides() for new architecture

Phase 4: Default Profile Logic

  • 13.14 Remove default_profile = "first" from DEFAULT_CONFIG_TEMPLATE
  • 13.15 Remove default_profile generation in Quick Setup (init_config)
  • 13.16 Add logic to clear default_profile when deleting the default profile
  • 13.17 Verify active_profile() fallback logic works correctly

Phase 5: CLI Validation & Ad-hoc Mode

  • 13.18 Add validation: -p and -P are mutually exclusive
  • 13.19 Add validation: -P requires -k or ASK_{PROVIDER}_API_KEY
  • 13.20 Implement ad-hoc mode: create virtual profile when -P is used
  • 13.21 Add ASK_PROFILE env var support (equivalent to -p)
  • 13.22 Add validation: ASK_PROFILE and ASK_PROVIDER are mutually exclusive

Phase 6: Interactive Menu Updates

  • 13.23 Update "Edit default settings" to edit default/first profile
  • 13.24 Remove "Manage API keys" option (API keys managed via profiles)
  • 13.25 Update "View current config" to not show [default]/[providers]

Phase 7: Template Updates

  • 13.26 Update DEFAULT_CONFIG_TEMPLATE with new structure
  • 13.27 Update --make-config output

Phase 8: Tests

  • 13.28 Remove tests for [providers] and [default]
  • 13.29 Add tests for ad-hoc mode (-P + -k)
  • 13.30 Add tests for -p + -P error
  • 13.31 Add tests for implicit default_profile (first profile)
  • 13.32 Add tests for ENV validation (ASK_PROFILE + ASK_PROVIDER error)

Phase 9: Documentation

  • 13.33 Update README.md with new config structure
  • 13.34 Update CODEBASE.md with architectural changes
  • 13.35 Add ADR-021: Profile-Only Architecture
  • 13.36 Update --help-env with new ENV list

Feature 14: Unified Thinking Levels

Description: Unified abstract thinking levels (low, medium, high) across providers

  • 14.01 Map abstract levels to token budgets in Anthropic provider
  • 14.02 Unify thinking levels in interactive config menu
  • 14.03 Update CLI parser to handle string values for --think flag
  • 14.04 Implement normalization logic in each provider
  • 14.05 Add integration tests for --think flag variants
  • 14.06 Add ADR-022: Unified Thinking Levels

Feature 15: Recursive Configuration Discovery

Description: Support finding ask.toml by traversing up the directory tree (like git/cargo)

  • 15.01 Refactor find_local_config to search recursively upwards
  • 15.02 Ensure load_aliases_only also supports recursive discovery
  • 15.03 Add tests for configuration discovery in subdirectories
  • 15.04 Update documentation regarding project-local configuration

Feature 16: Global History & Advanced Context Management

Description: Global access to conversation history across all directories

  • 16.01 Add ask history --global to list all saved contexts - Commit hash: 9ec05e9
  • 16.02 Add ability to view a specific history by ID or path - Commit hash: e689674
  • 16.03 Implement search across all stored conversations - Commit hash: 340afad8c0236972673a163ab3532fb1325fa0d2
  • 16.04 Add automatic summary/title generation for contexts
  • 16.05 Add command to prune histories of deleted directories - Commit hash: 340afad8c0236972673a163ab3532fb1325fa0d2

Feature 17: Update Check Refinement

Description: Limit aggressive update checks and respect configured intervals

  • 17.01 Limit aggressive update checks to once per hour
  • 17.02 Ensure normal update checks respect check_interval_hours config
  • 17.03 Add unit tests for update check timing logic

Legend

  • Complete
  • [~] In progress
  • Not started

Notes

Environment Variables (Final)

ENV Description
ASK_PROFILE Select profile (like -p)
ASK_PROVIDER Ad-hoc mode (like -P)
ASK_MODEL Override model
ASK_GEMINI_API_KEY Gemini API key
ASK_OPENAI_API_KEY OpenAI API key
ASK_ANTHROPIC_API_KEY Anthropic API key
ASK_GEMINI_BASE_URL Gemini base URL
ASK_OPENAI_BASE_URL OpenAI base URL
ASK_ANTHROPIC_BASE_URL Anthropic base URL
ASK_STREAM Override streaming
ASK_TIMEOUT Override timeout

Precedence Order

CLI flags (-p, -P, -m, -k)
    ↓
ENVs (ASK_PROFILE, ASK_PROVIDER, ASK_MODEL, ASK_*_API_KEY)
    ↓
Profile config ([profiles.*])
    ↓
Hardcoded defaults

Final Config Structure

# Optional: only when user explicitly sets it
# default_profile = "personal"

[profiles.personal]
provider = "gemini"
model = "gemini-3-flash-preview"
api_key = "AIza..."
stream = true

[profiles.work]
provider = "openai"
model = "gpt-5"
api_key = "sk-..."

[behavior]
auto_execute = false
confirm_destructive = true
timeout = 30

[context]
max_age_minutes = 30
max_messages = 20

[update]
auto_check = true

[aliases]
q = "--raw --no-color"

[commands.cm]
system = "Generate commit message"