Skip to main content

ConfigSource

Trait ConfigSource 

Source
pub trait ConfigSource:
    Send
    + Sync
    + 'static {
    // Required methods
    fn show(&self) -> Vec<ConfigShowRow>;
    fn doctor(&self) -> Vec<ConfigDoctorFinding>;
}
Expand description

Read-only trait over the operator’s on-disk config + its secret-resolution state. Kept read-only at this layer because write paths (zero init, zero pair) already live in dedicated non-interactive entrypoints; the TUI should never silently rewrite config.toml.

Implementations:

  • Production: ConfigAdapter in zero/src/main.rs wraps zero_config::load_config + keychain lookups.
  • Tests: MockConfig below is the in-memory double used by dispatch_integration.rs.

Required Methods§

Source

fn show(&self) -> Vec<ConfigShowRow>

Rows for /config show. Order is preserved verbatim in the rendered output — the adapter decides the column order so it can group identity → engine → guardrails → display without the dispatcher needing to know the schema.

Source

fn doctor(&self) -> Vec<ConfigDoctorFinding>

Findings for /config doctor. Return order is preserved; the adapter is responsible for ordering (errors first is a reasonable default, but the trait does not mandate it because a “summary then detail” shape is sometimes clearer).

Implementors§