Expand description
§Module: project_config
Project-level configuration loaded from .agent-doc/config.toml.
Shared between binary and library for consistent project config handling.
§Spec
- Defines
ProjectConfig: per-project settings (tmux_session, components). - Defines
ComponentConfig: per-component patch configuration (mode, timestamps, hooks). load_project()reads and parses the project config file. On absence, I/O error, or parse error, returnsProjectConfig::default()and emits a warning to stderr (never panics).project_tmux_session()is a convenience wrapper returning the configured tmux session name.save_project()serialisesProjectConfigto TOML and writes it to.agent-doc/config.toml, creating the directory if needed.
§Agentic Contracts
- Never panics on missing config:
load_project()returns defaults when the file is absent. - Project config errors are non-fatal: errors are surfaced as stderr warnings, not propagated.
- Atomic-safe directory creation:
save_project()callscreate_dir_allbefore writing.
Structs§
- Component
Config - Component patch configuration (mode, timestamps, max entries, hooks).
- Project
Config - Project-level configuration, read from
.agent-doc/config.tomlrelative to CWD.
Functions§
- load_
project - Load project config from
.agent-doc/config.tomlin CWD, or return defaults. Also performs one-time migration from legacycomponents.tomlif present. - project_
tmux_ session - Get the project’s configured tmux session (convenience helper).
- save_
project - Save project config to
.agent-doc/config.toml. - update_
project_ tmux_ session - Update the project’s configured tmux session. Called when the configured session is dead and we fall back to a different one.