Feature-based config: split monolithic config.toml into modular files #745

Closed
opened 2026-10-27 13:37:34 +00:00 by sam · 0 comments
Owner

Sam's explicit directive: move to feature-based YAML config files in conf.d/ (Linux convention) instead of one monolithic config.toml.\n\n## Design\n\n- ~/.config/archie/config.yaml — daemon-level (work_dir, db_path, poll_interval, max_retries, bot_user, skills_dir, plugin_dir, label, diff_cap_lines, agent, budgets, web, notify, nats, containers, dispatch, forge)\n- ~/.config/archie/conf.d/gateway.yaml — chat channels, platform configs\n- ~/.config/archie/conf.d/tools.yaml — MCP servers, tool policy\n- ~/.config/archie/conf.d/memory.yaml — memory provider config\n- ~/.config/archie/conf.d/models.yaml — LLM providers and model role mappings\n- ~/.config/archie/conf.d/identities.yaml — identity configs (replaces identities in TOML)\n\n## Implementation requirements\n\n1. New function: LoadDir(baseDir, overlayDir string) (Config, error)\n2. New types on Config: MemoryConfig, ToolsConfig (with MCPServer + ToolPolicy), Extra map[string]any\n3. Feature files as top-level YAML keys (memory.yaml has provider, provider_config, session_ttl; tools.yaml has mcp_servers, tool_policy; models.yaml has models, providers, etc.)\n4. Legacy support: if config.yaml absent, fall back to config.toml via existing Load function\n5. Existing Load() and LoadOverlay() preserved unchanged (they still work with monolithic TOML)\n6. Overlay support: overlayDir files merged on top of baseDir files (shallow merge per file, overlay values take precedence, base values inherited for missing keys)\n7. Validation: unknown feature files error (prevent typos like config.gaeway.yaml), duplicate feature files error (same name in root and conf.d/), malformed YAML errors\n8. Missing feature files mean feature disabled (zero values, no error)\n9. YAML parser: gopkg.in/yaml.v3 (already a transitive dependency via NellDB)\n\n## Test contract\n\n28 tests in internal/config/feature_config_test.go define the COMPLETE spec. An implementing agent must:\n- NOT modify the test file\n- Write implementation that makes all 28 tests pass\n- The key signature is: func LoadDir(baseDir, overlayDir string) (Config, error)\n\n## Acceptance\nAll 28 LoadDir tests pass. Existing Load/LoadOverlay tests pass. go build ./... clean. No config.toml parsing capability is lost.

Acceptance Criteria

A new feature (e.g. MCP) can be configured by adding one new TOML file. No changes to existing config parsing code are needed. Legacy monolithic config.toml still works.


Imported from beads archie-core-1786637495565-220-164b9018 · GitHub #241 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-08

Sam's explicit directive: move to feature-based YAML config files in conf.d/ (Linux convention) instead of one monolithic config.toml.\n\n## Design\n\n- ~/.config/archie/config.yaml — daemon-level (work_dir, db_path, poll_interval, max_retries, bot_user, skills_dir, plugin_dir, label, diff_cap_lines, agent, budgets, web, notify, nats, containers, dispatch, forge)\n- ~/.config/archie/conf.d/gateway.yaml — chat channels, platform configs\n- ~/.config/archie/conf.d/tools.yaml — MCP servers, tool policy\n- ~/.config/archie/conf.d/memory.yaml — memory provider config\n- ~/.config/archie/conf.d/models.yaml — LLM providers and model role mappings\n- ~/.config/archie/conf.d/identities.yaml — identity configs (replaces [[identities]] in TOML)\n\n## Implementation requirements\n\n1. New function: LoadDir(baseDir, overlayDir string) (Config, error)\n2. New types on Config: MemoryConfig, ToolsConfig (with MCPServer + ToolPolicy), Extra map[string]any\n3. Feature files as top-level YAML keys (memory.yaml has provider, provider_config, session_ttl; tools.yaml has mcp_servers, tool_policy; models.yaml has models, providers, etc.)\n4. Legacy support: if config.yaml absent, fall back to config.toml via existing Load function\n5. Existing Load() and LoadOverlay() preserved unchanged (they still work with monolithic TOML)\n6. Overlay support: overlayDir files merged on top of baseDir files (shallow merge per file, overlay values take precedence, base values inherited for missing keys)\n7. Validation: unknown feature files error (prevent typos like config.gaeway.yaml), duplicate feature files error (same name in root and conf.d/), malformed YAML errors\n8. Missing feature files mean feature disabled (zero values, no error)\n9. YAML parser: gopkg.in/yaml.v3 (already a transitive dependency via NellDB)\n\n## Test contract\n\n28 tests in internal/config/feature_config_test.go define the COMPLETE spec. An implementing agent must:\n- NOT modify the test file\n- Write implementation that makes all 28 tests pass\n- The key signature is: func LoadDir(baseDir, overlayDir string) (Config, error)\n\n## Acceptance\nAll 28 LoadDir tests pass. Existing Load/LoadOverlay tests pass. go build ./... clean. No config.toml parsing capability is lost. ### Acceptance Criteria A new feature (e.g. MCP) can be configured by adding one new TOML file. No changes to existing config parsing code are needed. Legacy monolithic config.toml still works. --- _Imported from beads `archie-core-1786637495565-220-164b9018` · GitHub #241 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumfeature labels 2026-10-27 13:37:34 +00:00
sam self-assigned this 2026-10-27 13:37:34 +00:00
sam closed this issue 2026-10-27 13:37:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#745