# core/config — AGENTS.md ## Purpose TOML configuration loading and live-reload: defines `CorrexConfig` (the top-level config shape), operator/project profiles, agent instructions, and read/write helpers. ## Ownership CORREX kernel team. Config schema changes affect all consumers — coordinate with `apps/server` and `apps/cli`. ## Local Contracts - `CorrexConfig` — top-level `@Serializable` config data class. - `ConfigHolder` — mutable live config reference, updated on reload. - `ConfigLoader` — reads TOML from disk; `CorrexConfigWriter` writes it back. - `EditableConfig` — partial config for live patch operations (used by the TUI config editor). - `OperatorProfile` — operator-level persona and behavior settings. - `ProjectProfile` / `ProjectProfileLoader` / `ProjectProfileWriter` — project-scoped profile; loaded at session bind time. - Project-profile commands support flat aliases plus toolchain-specific TOML tables such as `[commands.node]`; nested entries bind into replay-safe dotted keys (for example `node.build`). - `AgentInstructions` / `AgentInstructionsLoader` — per-role prompt fragments loaded from config. ## Work Guidance - Config is read from disk; it is not event-sourced. Do not add event/state/reducer structures here. - `ConfigHolder` is the shared mutable reference injected into consumers. Never read the file directly in domain code — always go through `ConfigHolder`. - `CorrexConfigWriter` regenerates TOML from the in-memory model; round-tripping loses comments by design. - `[git]` is opt-in server transport configuration (`enabled`, `remote`, `base_branch`, optional `author`); it is off by default. - `[orchestration].review_loop_max_cycles` bounds review→rework cycles before recovery escalation; default `3`. - `ModelConfig.contextSize` defaults to 24,576 tokens; explicit `context_size` remains the operator override for smaller local-model windows. ## Verification ```bash ./gradlew :core:config:test --rerun-tasks ``` ## Child DOX Index No child AGENTS.md (leaf module).