Downcity
Configuration

Env and downcity.db Design

Explain how env, channel accounts, model pool, and project plugin config are separated

Env and downcity.db Design

Use one rule:

  • shared secrets and shared infrastructure live in ~/.downcity/downcity.db
  • project behavior lives in downcity.json

downcity.db owns

  • env_entries
  • channel_accounts
  • chat_auth_roles
  • chat_auth_role_permissions
  • chat_auth_channel_defaults
  • chat_auth_user_roles
  • model_providers
  • models
  • other console-owned encrypted settings

Project downcity.json owns

  • model.primary
  • services.*
  • plugins.*

Why

  • secrets should not be duplicated into project config
  • plugin enablement and plugin-owned dependency config are project behavior
  • console storage should not hide project-specific plugin state

Runtime load order

  1. read global env from downcity.db
  2. read agent-private env from downcity.db
  3. read project .env
  4. read project downcity.json
  5. resolve plugins.*
  6. resolve channel credentials, chat authorization rules, and model pool from downcity.db