Skip to main content

lean_ctx/core/config/
model.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(clippy::wildcard_imports)]
4use super::*;
5fn default_true() -> bool {
6    true
7}
8
9/// Global lean-ctx configuration loaded from `config.toml`, merged with project-local overrides.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11#[serde(default)]
12pub struct Config {
13    pub ultra_compact: bool,
14    #[serde(default, deserialize_with = "serde_defaults::deserialize_tee_mode")]
15    pub tee_mode: TeeMode,
16    /// Verbosity of the reactive recovery footer on compressed output
17    /// (`off|minimal|full`, default `minimal`). See [`RecoveryHints`].
18    #[serde(default)]
19    pub recovery_hints: RecoveryHints,
20    #[serde(default)]
21    pub output_density: OutputDensity,
22    pub checkpoint_interval: u32,
23    pub excluded_commands: Vec<String>,
24    pub passthrough_urls: Vec<String>,
25    pub custom_aliases: Vec<AliasEntry>,
26    /// Output formats that are already compact/token-oriented and must be
27    /// preserved verbatim instead of being recompressed (#342). Matched against
28    /// the *output shape* (not the command name), so any tool emitting the
29    /// format is covered without enumerating commands in `excluded_commands`.
30    /// Default: `["toon"]`. Set to `[]` to disable and always recompress.
31    #[serde(default = "serde_defaults::default_preserve_compact_formats")]
32    pub preserve_compact_formats: Vec<String>,
33    /// Opt-in: apply the lossless JSON crusher to *verbatim* data commands
34    /// (`gh api`, `jq`, `kubectl get -o json`, `curl` JSON). Off by default, so
35    /// those outputs stay byte-for-byte verbatim. When on, an array-heavy JSON
36    /// payload the crusher can at least halve is reshaped into a compact, fully
37    /// reconstructible form; everything else stays verbatim. See
38    /// [`Config::crush_verbatim_json_enabled`] (#936).
39    #[serde(default)]
40    pub crush_verbatim_json: bool,
41    /// Commands taking longer than this threshold (ms) are recorded in the slow log.
42    /// Set to 0 to disable slow logging.
43    pub slow_command_threshold_ms: u64,
44    #[serde(default = "serde_defaults::default_theme")]
45    pub theme: String,
46    /// Privacy-safe default-on telemetry with explicit and environment opt-outs.
47    #[serde(default)]
48    pub telemetry: TelemetryConfig,
49    #[serde(default)]
50    pub cloud: CloudConfig,
51    #[serde(default)]
52    pub gain: GainConfig,
53    /// Model declaration for measured-vs-estimated cost reporting (MCP-only IDEs).
54    #[serde(default)]
55    pub cost: CostConfig,
56    #[serde(default)]
57    pub decision_loop: DecisionLoopConfig,
58    /// User-controlled never-lossy zones (#1570 P4): protected file globs
59    /// and `<protect>` span handling.
60    #[serde(default)]
61    pub protection: ProtectionConfig,
62    /// Code-health engine: cognitive complexity, naming, coupling, edit-gate.
63    #[serde(default)]
64    pub code_health: CodeHealthConfig,
65    #[serde(default)]
66    pub autonomy: AutonomyConfig,
67    #[serde(default)]
68    pub providers: ProvidersConfig,
69    #[serde(default)]
70    pub knowledge_routing: KnowledgeRoutingConfig,
71    #[serde(default)]
72    pub proxy: ProxyConfig,
73    /// Conversation-history compression (`[conversation]`, opt-in; #1123).
74    #[serde(default)]
75    pub conversation: ConversationConfig,
76    /// Proxy-layer response shaping (`[response_shaping]`, #1125).
77    #[serde(default)]
78    pub response_shaping: ResponseShapingConfig,
79    #[serde(default)]
80    pub ocla: OclaConfig,
81    /// Global-only, explicit consent and independent pins for optional local code.
82    #[serde(default)]
83    pub intelligence_runtime: IntelligenceRuntimeConfig,
84    /// Counterfactual Shadow Mode reporting (`[shadow]`), opt-in.
85    #[serde(default)]
86    pub shadow: ShadowConfig,
87    /// User-only value display (`[value_display]`): status line, recaps,
88    /// prompt segment, milestones. Never reaches the model context.
89    #[serde(default)]
90    pub value_display: ValueDisplayConfig,
91    /// Generalized L1/L2/L3 cache settings (`[cache]`).
92    #[serde(default)]
93    pub cache: CacheConfig,
94    #[serde(default)]
95    pub agents: sections::AgentsConfig,
96    /// Whether the API proxy is enabled. Tri-state:
97    /// - None: undecided (fresh install, will prompt on interactive setup)
98    /// - Some(true): user opted in, proxy managed by lean-ctx
99    /// - Some(false): user opted out, never touch proxy or endpoints
100    #[serde(default)]
101    pub proxy_enabled: Option<bool>,
102    #[serde(default)]
103    pub proxy_port: Option<u16>,
104    /// Proxy reachability timeout in milliseconds. Default: 200.
105    /// Override via LEAN_CTX_PROXY_TIMEOUT_MS env var.
106    #[serde(default)]
107    pub proxy_timeout_ms: Option<u64>,
108    /// Strict proxy auth: when true, authenticate ONLY via the Bearer token
109    /// (`LEAN_CTX_PROXY_TOKEN`) and disable the provider-API-key fallback. Default
110    /// false keeps the loopback-friendly behavior where any local AI tool's own
111    /// provider key authenticates (the proxy never injects upstream credentials —
112    /// it forwards the caller's key verbatim). Enable on shared/multi-user hosts to
113    /// require the token; clients must then send `Authorization: Bearer [REDACTED:Authorization header]
114    #[serde(default)]
115    pub proxy_require_token: bool,
116    /// Skip ALL proxy authentication on loopback-bound listeners (#755).
117    /// When true **and** the proxy binds a loopback address, every request is
118    /// accepted without a Bearer token or provider API key — MCP clients,
119    /// browser dashboards, and CLI tools all work without auth setup.
120    /// Ignored on non-loopback binds (gateway mode always requires auth).
121    /// Env override: `LEAN_CTX_PROXY_LOOPBACK_OPEN`.
122    #[serde(default)]
123    pub proxy_loopback_open: bool,
124    /// Bind address for the proxy listener (gateway mode, enterprise#8).
125    /// Default `None` = `127.0.0.1` — local-safe, nothing changes for existing
126    /// installs. Set `"0.0.0.0"` (or a specific interface IP) to serve a whole
127    /// org from one host; any non-loopback bind hard-disables the provider-key
128    /// auth fallback (Bearer token becomes mandatory) and enables the
129    /// `proxy_allowed_hosts` Host-header allowlist. Env override:
130    /// `LEAN_CTX_PROXY_BIND_HOST`. An unparseable value falls back to loopback,
131    /// never to an open bind.
132    #[serde(default)]
133    pub proxy_bind_host: Option<String>,
134    /// Host-header allowlist for a non-loopback proxy bind (gateway mode):
135    /// DNS-rebinding protection. Entries are hostnames or IPs without port
136    /// (e.g. `"gateway.example.com"`). Loopback names are always allowed.
137    /// Ignored (loopback-only guard, today's behavior) while the bind is
138    /// loopback. Empty + non-loopback bind = only loopback Host headers pass,
139    /// so configure this when exposing the gateway.
140    #[serde(default)]
141    pub proxy_allowed_hosts: Vec<String>,
142    /// Proxy-wide request rate limit in requests/second (token bucket, burst =
143    /// 2x). `None` (default) = unlimited on a loopback bind — today's behavior —
144    /// and 50 rps with burst 100 on a non-loopback bind (gateway mode ships a
145    /// sane floor, enterprise#37). `0` disables the limiter even in gateway
146    /// mode (explicit opt-out).
147    #[serde(default)]
148    pub proxy_max_rps: Option<u32>,
149    /// Require Bearer-token authentication for the dashboard. Default `true`:
150    /// the dashboard generates (or uses the pinned) token and rejects `/api/*`
151    /// and `/metrics` without it. Set to `false` to run the dashboard with **no
152    /// auth token** — useful for a local/Docker setup where managing a token is
153    /// inconvenient. No-auth mode is not unprotected: cross-origin and CSRF
154    /// attacks from a malicious local website are blocked by request-header
155    /// validation instead (`Sec-Fetch-Site`, `Origin`/`Host` same-origin, and a
156    /// `Host` allowlist against DNS rebinding — see `dashboard::no_auth_request_ok`).
157    /// Override per-run via the `--no-auth` / `--auth=<bool>` flag or the
158    /// `LEAN_CTX_DASHBOARD_AUTH` env var.
159    #[serde(default = "serde_defaults::default_true")]
160    pub dashboard_auth: bool,
161    /// Provider prompt-cache hit rate for net-of-injection calculation (#1104).
162    /// Anthropic ~90%, OpenAI ~50%. Default 0.75 (conservative cross-provider).
163    #[serde(default)]
164    pub dashboard_cache_hit_rate: Option<f64>,
165    #[serde(default = "serde_defaults::default_buddy_enabled")]
166    pub buddy_enabled: bool,
167    #[serde(default = "serde_defaults::default_true")]
168    pub enable_wakeup_ctx: bool,
169    /// File globs delivered verbatim: native reads skip the hook redirect and
170    /// automatic `ctx_read` modes return them in full (#60).
171    #[serde(default)]
172    pub redirect_exclude: Vec<String>,
173    /// Tools to exclude from the MCP tool list returned by list_tools.
174    /// Accepts exact tool names (e.g. `["ctx_graph", "ctx_agent"]`).
175    /// Empty by default — all tools listed, no behaviour change.
176    #[serde(default)]
177    pub disabled_tools: Vec<String>,
178    /// Prefer the host agent's native editor over lean-ctx edit operations (#454).
179    /// When true, the lean-ctx edit tool(s) (see [`EDIT_TOOL_NAMES`]) are neither
180    /// advertised in `list_tools` nor dispatchable (direct or via `ctx_call`), so
181    /// the agent falls back to the host's built-in editing UI. Reads / search /
182    /// shell / memory tools are unaffected. Override via
183    /// `LEAN_CTX_PREFER_NATIVE_EDITOR=1`.
184    #[serde(default)]
185    pub prefer_native_editor: bool,
186    /// Tool categories to activate by default for dynamic-tool-capable clients.
187    /// Values: "core" (always on), "arch", "debug", "memory", "metrics", "session".
188    /// Example: `default_tool_categories = ["core", "arch", "memory"]`
189    /// Override via LCTX_DEFAULT_CATEGORIES env var (comma-separated).
190    /// Empty = lean-ctx default (`core`). Add `session` explicitly to evaluate
191    /// experimental local collaboration tools.
192    #[serde(default)]
193    pub default_tool_categories: Vec<String>,
194    /// Disable all automatic read-mode degradation (auto_degrade + context_gate pressure).
195    /// When true, lean-ctx never downgrades requested read modes regardless of pressure.
196    /// Override via LCTX_NO_DEGRADE=1 env var.
197    #[serde(default)]
198    pub no_degrade: bool,
199    /// Legacy opt-in delta preference. Concrete per-call full/lines requests
200    /// take precedence and stay fresh; this cannot replace their content with
201    /// a delta. Use mode=auto or mode=diff for reduced re-reads.
202    /// Retained for configuration compatibility. LCTX_DELTA_EXPLICIT=1/0 overrides.
203    #[serde(default)]
204    pub delta_explicit: bool,
205    /// Persistent profile name. Checked after LEAN_CTX_PROFILE env var.
206    /// Set via `lean-ctx config set profile passthrough` or editing config.toml.
207    #[serde(default)]
208    pub profile: Option<String>,
209    /// Active task-specific Context Kit. `LEAN_CTX_KIT` takes precedence.
210    /// Set with `lean-ctx kit load <name>`.
211    #[serde(default)]
212    pub active_kit: Option<String>,
213    /// Named configuration overlay selected from `[profiles.<name>]`.
214    /// `LEAN_CTX_CONFIG_PROFILE` takes precedence over this persisted selector.
215    #[serde(default)]
216    pub config_profile: Option<String>,
217    /// Partial configuration overlays keyed by profile name. Each overlay is
218    /// recursively merged over the base configuration at load time.
219    #[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")]
220    pub profiles: std::collections::BTreeMap<String, toml::Table>,
221    /// Tool visibility profile: "minimal" (5), "standard" (15), or "power" (all).
222    /// Override via LEAN_CTX_TOOL_PROFILE env var.
223    /// Existing installs default to "power" (backward compat).
224    #[serde(default)]
225    pub tool_profile: Option<String>,
226    /// Explicit list of enabled tool names. Used only when no tool_profile is pinned (tool_profile takes precedence); leave tool_profile unset to apply this list.
227    /// The universal invoker `ctx_call` stays advertised so unlisted tools remain
228    /// reachable — add `ctx_call` to `disabled_tools` to make this allowlist authoritative.
229    /// Example: `tools_enabled = ["ctx_read", "ctx_shell", "ctx_search"]`
230    #[serde(default)]
231    pub tools_enabled: Vec<String>,
232    /// Active context persona (`persona-spec-v1`). Selects the domain bundle —
233    /// tool surface, read-mode/compressor/chunker defaults, intent taxonomy,
234    /// sensitivity floor. Override via `LEAN_CTX_PERSONA`. Defaults to `coding`.
235    #[serde(default)]
236    pub persona: Option<String>,
237    #[serde(default)]
238    pub loop_detection: LoopDetectionConfig,
239    /// Controls where lean-ctx installs agent rule files.
240    /// Values: "both" (default), "global" (home-dir only), "project" (repo-local only).
241    /// Override via LEAN_CTX_RULES_SCOPE env var.
242    #[serde(default)]
243    pub rules_scope: Option<String>,
244    /// Controls how rules are injected for shared-instruction-file agents.
245    /// Values: "shared" (default, marker block in CLAUDE.md/CODEBUDDY.md/AGENTS.md/GEMINI.md),
246    /// "dedicated" (never touch those files; use each agent's config-driven
247    /// auto-load: SessionStart hook / instructions[] / context.fileName, #343), or
248    /// "off" (write no rules file at all — for hosts that supply their own
249    /// tool-steering workflow or phase-isolated/non-caching harnesses, #361).
250    /// Override via LEAN_CTX_RULES_INJECTION env var.
251    #[serde(default)]
252    pub rules_injection: Option<String>,
253    /// Mirror the host IDE's tool-permission rules onto lean-ctx's own MCP tools.
254    /// Values: "off" (default) or "on". When "on", lean-ctx reads the active
255    /// IDE's permission config (v1: OpenCode) and applies the equivalent
256    /// deny/ask/allow decision to the matching lean-ctx tool — so `ctx_shell`
257    /// honors your `bash`/`rm *` rules instead of bypassing them.
258    /// Override via LEAN_CTX_PERMISSION_INHERITANCE env var.
259    #[serde(default)]
260    pub permission_inheritance: Option<String>,
261    /// Extra glob patterns to ignore in graph/overview/preload (repo-local).
262    /// Example: `["externals/**", "target/**", "temp/**"]`
263    #[serde(default)]
264    pub extra_ignore_patterns: Vec<String>,
265    /// Controls agent output verbosity via instructions injection.
266    /// Values: "off" (default), "lite", "full", "ultra".
267    /// Override via LEAN_CTX_TERSE_AGENT env var.
268    #[serde(default)]
269    pub terse_agent: TerseAgent,
270    /// Unified compression level (replaces separate terse_agent + output_density).
271    /// Values: "off" (default), "lite", "standard", "max".
272    /// Override via LEAN_CTX_COMPRESSION env var.
273    #[serde(default)]
274    pub compression_level: CompressionLevel,
275    /// Science-driven cognitive features mode (#science).
276    #[serde(default)]
277    pub cognitive_mode: CognitiveMode,
278    /// Global compression intensity 0.0 (lossless) – 1.0 (max), mapped onto the
279    /// read modes / entropy / IB stages (see `core::aggressiveness`). `None`
280    /// (default) keeps each mode's built-in default. Override via the
281    /// `LEAN_CTX_AGGRESSIVENESS` env var or the `ctx_read` `aggressiveness` arg.
282    #[serde(default)]
283    pub compression_aggressiveness: Option<f64>,
284    /// Archive configuration for zero-loss compression.
285    #[serde(default)]
286    pub archive: ArchiveConfig,
287    /// Memory policy (knowledge/episodic/procedural/lifecycle budgets & thresholds).
288    #[serde(default)]
289    pub memory: MemoryPolicy,
290    /// Additional paths allowed by PathJail (absolute).
291    /// Useful for multi-project workspaces where the jail root is a parent directory.
292    /// Override via LEAN_CTX_ALLOW_PATH env var (path-list separator).
293    #[serde(default)]
294    pub allow_paths: Vec<String>,
295    /// Allow jailed tool access to home-level IDE config dirs (~/.cursor, VS Code,
296    /// Cline/Roo, JetBrains, …). Tri-state: `None` = not asked yet (setup prompts
297    /// once), `Some(false)` = declined, `Some(true)` = opted in. Those dirs can
298    /// expose other agents' sessions, MCP configs and credentials, so the effective
299    /// default is off. `~/.lean-ctx` (own data dir) is always allowed. The opt-in
300    /// set is registry-derived, covering every supported editor. Override via
301    /// LEAN_CTX_ALLOW_IDE_DIRS=1.
302    #[serde(default)]
303    pub allow_ide_config_dirs: Option<bool>,
304    /// Extra project roots for multi-root workspaces.
305    /// Tools like ctx_tree and ctx_search can scan across all roots in a single call.
306    /// These paths are automatically added to PathJail's allow-list.
307    /// Override via LEAN_CTX_EXTRA_ROOTS env var (path-list separator).
308    #[serde(default)]
309    pub extra_roots: Vec<String>,
310    /// Read-only roots: sibling subtrees the agent may READ but never WRITE.
311    /// Reads resolve as if they were extra_roots; every write tool (edit, refactor,
312    /// handoff/session export, memory compaction) is default-denied inside these
313    /// paths. Useful for reference repos mounted next to the project.
314    /// Override via LEAN_CTX_READ_ONLY_ROOTS env var (path-list separator).
315    #[serde(default)]
316    pub read_only_roots: Vec<String>,
317    /// Extra trusted roots OUTSIDE `$HOME` that lean-ctx may follow when an agent
318    /// config file/dir (`~/.claude.json`, `~/.codex/config.toml`, …) is a symlink
319    /// pointing there (#596). Empty by default → the strict `$HOME`-only boundary
320    /// stays in force (a planted symlink can never redirect a config write out of
321    /// the user's home, preserving the GL#442 symlink-hijack protection). Add a
322    /// parent like `/opt/dotfiles` only for a location you own and trust. Like
323    /// `extra_roots`, security-sensitive: stripped from untrusted project-local
324    /// configs. Override via LEAN_CTX_ALLOW_SYMLINK_ROOTS env var (path-list sep).
325    #[serde(default)]
326    pub allow_symlink_roots: Vec<String>,
327    /// Enable content-defined chunking (Rabin-Karp) for cache-optimal output ordering.
328    /// Stable chunks are emitted first to maximize prompt cache hits.
329    #[serde(default)]
330    pub content_defined_chunking: bool,
331    /// Skip session/knowledge/gotcha blocks in MCP instructions to minimize token overhead.
332    /// Override via LEAN_CTX_MINIMAL env var.
333    ///
334    /// Default `true` (deliberate): initialize-time instructions stay byte-stable
335    /// across sessions, which keeps the provider prompt-cache prefix warm (#498)
336    /// and holds the fixed per-session cost at the `doctor overhead --gate`
337    /// budget. Session continuity is NOT lost — the wakeup briefing (task,
338    /// findings, knowledge) is delivered through the first tool call's
339    /// `--- AUTO CONTEXT ---` block instead, which only bills when the agent
340    /// actually works. Set to `false` to additionally inject the ACTIVE SESSION
341    /// / PROJECT MEMORY blocks directly into the MCP `initialize` instructions.
342    /// #1540: this key never disables the archive/ephemeral firewall — only
343    /// the `LEAN_CTX_MINIMAL` env escape hatch skips that safety net.
344    #[serde(default)]
345    pub minimal_overhead: bool,
346    /// Opt-in: substitute long identifiers with short α-codes (+ a `§MAP` table)
347    /// in `aggressive` reads for projects with >50 source files. Off by default —
348    /// the abbreviated form is confusing for editing/refactoring, where the agent
349    /// needs the real package and symbol names. Enable for max exploration savings.
350    #[serde(default)]
351    pub symbol_map_auto: bool,
352    /// Opt-in: bias `auto` toward structure-first reads (`map`) for medium code
353    /// files on a cold read. Off by default — interactive sessions keep the
354    /// conservative `full` floor that avoids a follow-up body read. Enable for
355    /// phase-isolated harnesses (no warm-session cache payback), where a cold
356    /// `full` read is pure overhead and structure-first reads aid localization.
357    /// Override via the LEAN_CTX_STRUCTURE_FIRST env var.
358    #[serde(default)]
359    pub structure_first: bool,
360    /// Progressive disclosure for first-time reads (LCLM arXiv 2606.09659).
361    /// When true (default), large files default to compact overviews on first read:
362    ///     - Below progressive_threshold_lines: full content
363    ///     - Below progressive_signatures_max_lines: signatures mode
364    ///     - Above: map (manifest) mode
365    /// Models can always bypass with explicit mode= or lines= parameters.
366    /// Override via LEAN_CTX_PROGRESSIVE_DISCLOSURE env var.
367    #[serde(default = "serde_defaults::default_true")]
368    pub progressive_disclosure: bool,
369    /// Files with fewer lines than this threshold are always delivered in full.
370    /// Default: 100 lines.
371    #[serde(default = "serde_defaults::default_progressive_threshold_lines")]
372    pub progressive_threshold_lines: u32,
373    /// Files between threshold and this limit get signatures mode.
374    /// Files above get map (manifest) mode. Default: 500 lines.
375    #[serde(default = "serde_defaults::default_progressive_signatures_max")]
376    pub progressive_signatures_max: u32,
377    /// Opt-in: let the adaptive *learning* signals (predictor, bandit, heatmap,
378    /// adaptive policy, bounce/path memory) participate in `auto` mode
379    /// resolution. Off by default (#683): the default cascade is a deterministic
380    /// function of (file, task) — only capability guards and the size/task
381    /// heuristic decide — which keeps output byte-stable for provider prompt
382    /// caching (#498) and avoids per-read disk I/O from the learning stores.
383    /// Override via the LEAN_CTX_AUTO_MODE_LEARNING env var.
384    #[serde(default)]
385    pub auto_mode_learning: bool,
386    /// Team server URL for opt-in savings roll-up.
387    /// Set via `lean-ctx config set team_url https://...` or `[team] url` in config.toml.
388    /// Override via LEAN_CTX_TEAM_URL env var.
389    #[serde(default)]
390    pub team_url: Option<String>,
391    /// Bearer token for the team server (Authorization header on savings push /
392    /// pull). Set via `lean-ctx config set team_token <tok>` or `team_token` in
393    /// config.toml. Override via the LEAN_CTX_TEAM_TOKEN env var.
394    #[serde(default)]
395    pub team_token: Option<String>,
396    /// Opt-in: when true, the running daemon periodically pushes this machine's
397    /// signed savings batch to `team_url` so the team roll-up fills itself (no
398    /// manual `savings push` per dev). Off by default; requires `team_url` +
399    /// `team_token`. Set via `lean-ctx config set team_auto_push true`.
400    #[serde(default)]
401    pub team_auto_push: bool,
402    /// Enable human-readable activity journal (~/.lean-ctx/journal.md).
403    #[serde(default)]
404    pub journal_enabled: bool,
405    /// Opt-in: auto-persist interesting findings as knowledge facts.
406    #[serde(default)]
407    pub auto_capture: bool,
408    /// Hybrid search weights (BM25/dense/candidates).
409    #[serde(default)]
410    pub search: crate::core::hybrid_search::HybridConfig,
411    /// Code-graph settings, including traversal (co-access) edges (#289).
412    #[serde(default)]
413    pub graph: GraphConfig,
414    /// Index-time file filters (#735): include/exclude globs + gitignore
415    /// handling, applied by every index builder via `core::index_filter`.
416    #[serde(default)]
417    pub index: IndexConfig,
418    /// Skillify miner settings (#290): codify recurring patterns into rules.
419    #[serde(default)]
420    pub skillify: SkillifyConfig,
421    /// AI session-summary settings (#292): periodic, semantically-recallable summaries.
422    #[serde(default)]
423    pub summaries: SummariesConfig,
424    /// Optional LLM enhancement (query expansion, contradiction explanation).
425    #[serde(default)]
426    pub llm: crate::core::llm_enhance::LlmConfig,
427    /// Semantic-embedding engine settings (which local ONNX model to use).
428    #[serde(default)]
429    pub embedding: EmbeddingConfig,
430    /// Disable shell hook injection (the _lc() function that wraps CLI commands).
431    /// Override via LEAN_CTX_NO_HOOK env var.
432    #[serde(default)]
433    pub shell_hook_disabled: bool,
434    /// Shadow mode (default: true): denies native Read/Grep/Glob at the
435    /// permission level, forcing agents to use ctx_* MCP tools for maximum
436    /// compression. Without this, many harnesses silently prefer native tools,
437    /// negating lean-ctx's token savings. Disable with `shadow_mode = false`.
438    /// Native Shell/Bash coverage is governed separately by `shell_hook_mode`.
439    #[serde(default = "serde_defaults::default_true")]
440    pub shadow_mode: bool,
441    /// Shell hook mode (#1278): how the PreToolUse shell hook treats native
442    /// Bash/Shell calls.
443    /// - `rewrite` (default): rewrite known read/search/list commands to
444    ///   lean-ctx equivalents; anything unrecognized passes through raw.
445    /// - `deny`: block native shell calls outright so every command goes
446    ///   through `ctx_shell` (same fail-opens as the deny hook: lean-ctx
447    ///   disabled, MCP daemon dead, explicit shadow-only tool surface).
448    /// - `auto`: currently equals `rewrite`; reserved for a future default flip.
449    ///
450    /// Env override: `LEAN_CTX_SHELL_HOOK_MODE`. Lives in config.toml, so the
451    /// choice survives reinstalls and updates.
452    #[serde(default)]
453    pub shell_hook_mode: Option<String>,
454    /// Per-turn tool-precedence reinjection (#1288): the UserPromptSubmit hook
455    /// emits a one-line `additionalContext` reminder that ctx_* tools are the
456    /// mandated path, so it always post-dates any session-level harness
457    /// instruction preferring native Bash. `on` | `off` | `auto` (default:
458    /// auto = active only while `shadow_mode` is on). Env override:
459    /// `LEAN_CTX_PROMPT_REINJECT`. Costs ~45 tokens per turn when active.
460    #[serde(default)]
461    pub prompt_reinject: Option<String>,
462    /// Global hook mode override. When set, overrides the per-agent auto-detection.
463    /// - `replace`: Native Read/Grep/Glob/Shell denied, lean-ctx MCP is the only path
464    /// - `hybrid`: MCP + shell hooks for compression (legacy)
465    /// - `mcp`: MCP server only, no hooks
466    ///
467    /// Default: unset (auto-detect per agent via `recommend_hook_mode`)
468    #[serde(default)]
469    pub hook_mode: Option<String>,
470    /// MCP tool surface mode. Controls how many tools `tools/list` advertises.
471    /// - `auto` (default): shadow-only (`ctx_call` only) for hook-covered
472    ///   clients, full lazy-core surface for all others.
473    /// - `mcp`: always advertise the full lazy-core/profile surface.
474    /// - `shadow`: always advertise only `ctx_call` (requires installed hooks).
475    #[serde(default)]
476    pub tool_surface: Option<String>,
477    /// Opt-in (#520): write a human-readable debug log of intercepted MCP tool
478    /// calls and hook routing decisions (lean-ctx vs native, with reasons) to
479    /// `<state_dir>/logs/debug.log`. Override via the LEAN_CTX_DEBUG_LOG env var.
480    #[serde(default)]
481    pub debug_log: bool,
482    /// Controls when the shell hook auto-activates aliases.
483    /// - `agents-only`: (Default since #699) Aliases only active when an AI
484    ///   agent env var is detected — transparent in plain human terminals.
485    /// - `always`: Aliases active in every interactive shell (pre-#699 default).
486    /// - `off`: Aliases never auto-activate (user must call `lean-ctx-on` manually).
487    ///
488    /// Override via `LEAN_CTX_SHELL_ACTIVATION` env var.
489    #[serde(default)]
490    pub shell_activation: ShellActivation,
491    /// Do not install agent CLI aliases (`claude`, `codex`, `gemini`,
492    /// `codebuddy`) into `~/.zshrc` / `~/.bashrc` during `onboard` / `setup`.
493    /// Existing alias blocks are removed when this is toggled on (#754).
494    /// Does NOT affect the shell compression hook (`_lc()`) — use
495    /// `shell_hook_disabled` for that. Orthogonal to `shell_activation` which
496    /// controls *when* aliases activate, not *whether* they are installed.
497    #[serde(default)]
498    pub skip_agent_aliases: bool,
499    /// Controls the native-Read → `ctx_read` redirect hook (#637).
500    /// - `auto`: (Default) redirect everywhere except hosts with a native
501    ///   read-before-write guard (Claude Code / CodeBuddy), where the path-swap
502    ///   would break native Write/Edit.
503    /// - `on`: always redirect (legacy behavior).
504    /// - `off`: never redirect native Read.
505    ///
506    /// Override via the `LEAN_CTX_READ_REDIRECT` env var.
507    #[serde(default)]
508    pub read_redirect: ReadRedirect,
509    /// Controls the PostToolUse native-Read re-read dedup (GL #1140).
510    /// - `auto`: (Default) replace only re-reads of unchanged files, and only on
511    ///   guard hosts (Claude Code / CodeBuddy) where the PreToolUse redirect is
512    ///   disabled — the guard-safe way to win the dedup savings back.
513    /// - `on`: dedup wherever the PostToolUse hook fires.
514    /// - `off`: never replace a Read result.
515    ///
516    /// Override via the `LEAN_CTX_READ_DEDUP` env var.
517    #[serde(default)]
518    pub read_dedup: ReadDedup,
519    /// Disable the daily version check against leanctx.com/version.txt.
520    /// Override via LEAN_CTX_NO_UPDATE_CHECK env var.
521    #[serde(default)]
522    pub update_check_disabled: bool,
523    #[serde(default)]
524    pub updates: UpdatesConfig,
525    /// Fixed-context budget accounting for `doctor overhead` / `gain` (#964).
526    #[serde(default)]
527    pub context: ContextConfig,
528    /// Maximum BM25 cache file size in MB. Indexes exceeding this are quarantined on load
529    /// and refused on save. Override via LEAN_CTX_BM25_MAX_CACHE_MB env var.
530    #[serde(default = "serde_defaults::default_bm25_max_cache_mb")]
531    pub bm25_max_cache_mb: u64,
532    /// Maximum number of files scanned by the lightweight JSON graph index.
533    /// 0 = unlimited (default). Set >0 to cap for constrained systems.
534    #[serde(default = "serde_defaults::default_graph_index_max_files")]
535    pub graph_index_max_files: u64,
536    /// Maximum number of files indexed into the BM25 corpus; the semantic index
537    /// chunks the same corpus (#737), so this bounds semantic coverage too.
538    /// 0 = unlimited. Default 5000 (MAX_BM25_FILES).
539    #[serde(default = "serde_defaults::default_bm25_max_files")]
540    pub bm25_max_files: u64,
541    /// Controls RAM vs feature trade-off. Values: "low", "balanced" (default), "performance".
542    /// Override via LEAN_CTX_MEMORY_PROFILE env var.
543    #[serde(default)]
544    pub memory_profile: MemoryProfile,
545    /// Controls how aggressively memory is freed when idle.
546    /// Values: "shared" (default, 1h TTL), "aggressive" (5 min TTL for low-memory devices).
547    /// Override via LEAN_CTX_MEMORY_CLEANUP env var.
548    #[serde(default)]
549    pub memory_cleanup: MemoryCleanup,
550    /// How the code graph uses local semantic backends (language servers, a
551    /// live JetBrains IDE). Values: "off", "auto" (default: only backends that
552    /// are already running), "eager" (may start language servers).
553    /// Override via LEAN_CTX_SEMANTIC_MODE env var.
554    #[serde(default)]
555    pub semantic_mode: SemanticMode,
556    /// Soft process-RSS target as a percentage of system RAM (default: 5).
557    /// The guardian throttles and evicts above it, but this is not an OS hard cap.
558    /// Use a cgroup/container MemoryMax when strict isolation is required.
559    /// Override via LEAN_CTX_MAX_RAM_PERCENT env var.
560    #[serde(default = "serde_defaults::default_max_ram_percent")]
561    pub max_ram_percent: u8,
562    /// Per-process RSS target (MB) of each stdio MCP server; the guardian uses
563    /// the lower of this and `max_ram_percent` (default 512, 0 = percent only).
564    /// Hosts like the Codex app-server keep one server per loaded thread alive
565    /// for days, so a percentage of a large machine's RAM alone is too loose.
566    /// Override via LEAN_CTX_MCP_MAX_RSS_MB env var.
567    #[serde(default = "serde_defaults::default_mcp_max_rss_mb")]
568    pub mcp_max_rss_mb: u64,
569    /// Exit a stdio MCP server after this many minutes without a tool call
570    /// (0 = never, the default). Off by default because some hosts (Codex)
571    /// do not restart an exited server: the resumed thread then loses
572    /// lean-ctx until the host restarts. Idle servers release their caches
573    /// either way (`memory_cleanup`). Override via LEAN_CTX_MCP_IDLE_EXIT_MINUTES.
574    #[serde(default)]
575    pub mcp_idle_exit_minutes: u64,
576    /// Simplified disk budget (MB). When set and detail values are at defaults,
577    /// distributes proportionally: archive=25%, bm25=10%, remainder for stores.
578    /// 0 = disabled (use individual settings). Override via LEAN_CTX_MAX_DISK_MB.
579    #[serde(default)]
580    pub max_disk_mb: u64,
581    /// Auto-purge data older than this many days. 0 = disabled.
582    /// Flows into archive.max_age_hours and lifecycle idle TTL.
583    #[serde(default)]
584    pub max_staleness_days: u32,
585    /// Retention window for explicit session cleanup. This is independent from
586    /// archive retention and always preserves the newest session per project.
587    /// Override via LEAN_CTX_SESSION_RETENTION_DAYS.
588    #[serde(default = "serde_defaults::default_session_retention_days")]
589    pub session_retention_days: u32,
590    /// Cap on the rayon worker threads used by the CPU-heavy index build
591    /// (call graph etc.). 0 = rayon default (all cores). Set >0 to bound
592    /// per-instance CPU so a fleet of concurrent sessions can't saturate the
593    /// host on startup. Override via LEANCTX_INDEX_THREADS env var.
594    #[serde(default)]
595    pub max_index_threads: usize,
596    /// Controls visibility of token savings footers in tool output.
597    /// Values: "never" (default), "always" (show on every response), "auto" (legacy compatibility).
598    /// Override via LEAN_CTX_SAVINGS_FOOTER or LEAN_CTX_SHOW_SAVINGS=1|0 env var.
599    #[serde(default)]
600    pub savings_footer: SavingsFooter,
601    /// Controls compression annotation style in savings footers.
602    /// Values: "quantized" (default, round to 10% buckets), "full" (exact %), "none" (suppress all).
603    /// Override via LEAN_CTX_COMPRESSION_ANNOTATION env var.
604    #[serde(default)]
605    pub compression_annotation: CompressionAnnotation,
606    /// Minimum savings percentage to emit a footer annotation. Below this threshold,
607    /// annotations are suppressed (the savings are too small to be worth the token cost).
608    /// Default: 5 (suppress annotations for savings below 5%).
609    #[serde(default = "serde_defaults::default_annotation_threshold_pct")]
610    pub annotation_threshold_pct: u8,
611    /// In-band behavior hints (heavy full/raw reads, search→read→search
612    /// chains): "auto" (default, one hint per pattern per session) or "off".
613    /// Detections are always counted for `tools health`, hints or not.
614    /// "off" also drops the OUTPUT-HINT line from a task-filtered
615    /// `ctx_overview`: that line shapes the assistant's answer rather than
616    /// reporting a retrieval result, so it belongs to the same switch (#1763).
617    #[serde(default = "serde_defaults::default_behavior_nudges")]
618    pub behavior_nudges: String,
619    /// Maximum fresh tokens per single tool response (turn budget).
620    /// 0 = unlimited. Default: 4096. Prevents context bloat from oversized responses.
621    /// Override via LEAN_CTX_TURN_FRESH_LIMIT env var.
622    #[serde(default = "serde_defaults::default_turn_fresh_limit")]
623    pub turn_fresh_limit: usize,
624    /// Turn budget for a response the caller explicitly asked to be verbatim
625    /// (`ctx_read` with `raw=true` or `mode="raw"`). 0 = unlimited.
626    /// Default: 32768. Override via LEAN_CTX_TURN_FRESH_LIMIT_VERBATIM.
627    ///
628    /// The ordinary `turn_fresh_limit` is a compression backstop for output the
629    /// agent did not size itself. A verbatim read is the documented recovery
630    /// path out of compression (#1582); capping it at the same 4096 tokens made
631    /// that path unreachable for any file above ~16 KB.
632    #[serde(default = "serde_defaults::default_turn_fresh_limit_verbatim")]
633    pub turn_fresh_limit_verbatim: usize,
634    /// Maximum cumulative fresh tokens per session. 0 = unlimited.
635    /// Default: 200000. Progressive compression kicks in at 50/75/90%.
636    /// Override via LEAN_CTX_SESSION_TOKEN_LIMIT env var.
637    #[serde(default = "serde_defaults::default_session_token_limit")]
638    pub session_token_limit: usize,
639    /// Explicit project root override. When set, lean-ctx uses this instead of auto-detection.
640    /// This prevents accidental home-directory scans when running from $HOME.
641    /// Override via LEAN_CTX_PROJECT_ROOT env var.
642    #[serde(default)]
643    pub project_root: Option<String>,
644    /// LSP server overrides. Map language name to custom binary path.
645    /// Example: `[lsp]\nrust = "/opt/rust-analyzer"\npython = "~/.venvs/main/bin/pylsp"`
646    #[serde(default)]
647    pub lsp: std::collections::HashMap<String, String>,
648    /// Per-IDE allowed paths. Restricts which directories lean-ctx will scan/index for each IDE.
649    /// Example: `[ide_paths]\ncursor = ["/home/user/projects/app1"]\ncodex = ["/home/user/codex"]`
650    /// When set, only these paths are indexed for the matching agent. Global `allow_paths` still applies.
651    #[serde(default)]
652    pub ide_paths: HashMap<String, Vec<String>>,
653    /// Custom model context window overrides.
654    /// Example: `[model_context_windows]\n"my-custom-model" = 500000`
655    #[serde(default)]
656    pub model_context_windows: HashMap<String, usize>,
657    /// Controls how much detail tool responses include.
658    ///
659    /// - `full` (default): complete compressed output
660    /// - `headers_only`: metadata line only (path, mode, token count)
661    ///
662    /// Override via `LEAN_CTX_RESPONSE_VERBOSITY` env var.
663    #[serde(default)]
664    pub response_verbosity: ResponseVerbosity,
665    /// Bypass hint mode. When agents use native Read/Grep instead of lean-ctx tools,
666    /// a hint is appended to the next tool response.
667    /// Values: "on" (default), "off", "aggressive" (hint on every call, no cooldown).
668    /// Override via LEAN_CTX_BYPASS_HINTS env var.
669    #[serde(default)]
670    pub bypass_hints: Option<String>,
671    /// Cache policy for ctx_read. Controls behavior on cache hits.
672    /// Values: "aggressive" (default, 13-tok stubs + compaction-aware reset),
673    /// "safe" (delivers map instead of stub), "off" (no caching, always disk read).
674    /// Override via LEAN_CTX_CACHE_POLICY env var.
675    #[serde(default)]
676    pub cache_policy: Option<String>,
677    /// Token budget for the in-memory `ctx_read` cache. When the cached total
678    /// plus an incoming read would exceed this, lean-ctx evicts the least-valuable
679    /// entries *immediately* (RRF: recency × frequency × size) so the read always
680    /// proceeds — eviction is never deferred to the staleness TTL. `0` uses the
681    /// built-in default (2M). `LEAN_CTX_CACHE_MAX_TOKENS` env var overrides this.
682    #[serde(default)]
683    pub cache_max_tokens: usize,
684    /// Cross-project boundary policy.
685    /// Controls whether cross-project search/import is allowed and whether access is audited.
686    #[serde(default)]
687    pub boundary_policy: crate::core::memory_boundary::BoundaryPolicy,
688    #[serde(default)]
689    pub secret_detection: SecretDetectionConfig,
690    /// Per-item sensitivity model with a uniform policy floor (#212).
691    /// Disabled by default → fully no-op until `sensitivity.enabled = true`.
692    #[serde(default)]
693    pub sensitivity: crate::core::sensitivity::SensitivityConfig,
694    /// Context Gateway admission (`[context_gateway]`): built-in detectors
695    /// that run on every governed source before caching or compression.
696    /// On by default. Global-only: a project-local file cannot weaken it.
697    #[serde(default)]
698    pub context_gateway: crate::core::context_admission::ContextGatewayConfig,
699    /// MCP Tool-Catalog Gateway (#210): aggregate + query-route downstream MCP
700    /// servers. Global-only (never merged from project-local config) and a full
701    /// no-op until `gateway.enabled = true`.
702    #[serde(default)]
703    pub gateway: crate::core::mcp_catalog::GatewayConfig,
704    /// Self-hosted org gateway server (`[gateway_server]`, enterprise#20):
705    /// deployment parameters for the usage cockpit — seat count for the
706    /// org-wide projection, display label, and the central admin API the local
707    /// cockpit may read from. All optional; absent = local-only behavior.
708    #[serde(default)]
709    pub gateway_server: GatewayServerConfig,
710    /// Enterprise Suite connection (`[enterprise]`): connects this Runtime to
711    /// a LeanCTX Enterprise Gateway for economics tracking and model routing.
712    #[serde(default)]
713    pub enterprise: EnterpriseConfig,
714    /// Deprecated: auto-reroot is now always active when the jail root is
715    /// suspicious, None, or has no project marker. Kept for config-file
716    /// backward compatibility but no longer controls behavior.
717    #[serde(default = "default_true")]
718    pub allow_auto_reroot: bool,
719    /// Verbatim binary path/expression for generated agent-hook commands
720    /// (#708). Users who sync agent settings (`~/.claude/settings.json`, …)
721    /// across machines with different usernames need an env-based form like
722    /// `$HOME/.local/bin/lean-ctx` — agent hosts run hook commands through a
723    /// shell, which expands it. When set (env `LEAN_CTX_HOOK_BINARY` wins,
724    /// then this key), every hook writer emits the value verbatim instead of
725    /// the machine-absolute exe path, so `init`/`doctor --fix`/`update` stop
726    /// rewriting synced files into sync ping-pong. Autostart plists/services
727    /// and daemon spawns are NOT affected — launchd/systemd do not expand
728    /// shell variables, so those keep the real absolute path. Empty (default)
729    /// = automatic absolute-path resolution (#367).
730    #[serde(default)]
731    pub hook_binary: Option<String>,
732    /// Disable PathJail entirely by setting `path_jail = false` in config.toml.
733    /// Useful in container/Docker environments where the sandbox is the boundary.
734    /// (The former `LEAN_CTX_NO_JAIL=1` env override was removed in v3.7.3.)
735    #[serde(default)]
736    pub path_jail: Option<bool>,
737    /// What the enforced jail admits besides the project + allow-lists:
738    /// `home` (default — every project below `$HOME`, read-only, except dot
739    /// entries, `~/Library`, `~/AppData`) or `project`. See `core::pathjail_scope`.
740    #[serde(default)]
741    pub path_jail_scope: Option<String>,
742    /// Sandbox level for code execution (ctx_exec).
743    /// 0 = subprocess only (current), 1 = OS-level restriction (Seatbelt/Landlock).
744    /// Override via LEAN_CTX_SANDBOX_LEVEL env var.
745    #[serde(default)]
746    pub sandbox_level: u8,
747    /// When true, large tool outputs (>4000 chars) are stored as references
748    /// and a short URI is returned instead of the full content.
749    /// Override via LEAN_CTX_REFERENCE_RESULTS env var.
750    #[serde(default)]
751    pub reference_results: bool,
752    /// Default per-agent token budget. 0 means unlimited.
753    /// Override per-agent via ctx_session or programmatically.
754    #[serde(default)]
755    pub agent_token_budget: usize,
756    /// Optional shell command allowlist. When non-empty, only commands whose base binary
757    /// is in this list are permitted by ctx_shell. Empty = disable allowlist (allow all).
758    /// Default includes common dev tools. Set to `[]` to disable.
759    /// Override via LEAN_CTX_SHELL_ALLOWLIST env var (comma-separated).
760    #[serde(default = "default_shell_allowlist")]
761    pub shell_allowlist: Vec<String>,
762
763    /// Extra commands MERGED on top of the effective `shell_allowlist` without replacing
764    /// the defaults. Setting `shell_allowlist` replaces the whole built-in list (a common
765    /// footgun); entries here are purely additive, which is what `lean-ctx allow <cmd>`
766    /// writes. Only applied in restricted mode (when the base allowlist is non-empty).
767    #[serde(default)]
768    pub shell_allowlist_extra: Vec<String>,
769
770    /// When true, block command substitution ($(), backticks) and process substitution
771    /// (<(), >()) in shell arguments. When false (default), only warn via tracing.
772    /// Default false preserves backward compatibility — set true for maximum security.
773    #[serde(default)]
774    pub shell_strict_mode: bool,
775
776    /// GH #1419 follow-up: scope a multi-word `shell_allowlist`/
777    /// `shell_allowlist_extra` entry to the exact subcommand/prefix it names
778    /// (`"git status"` no longer grants the whole `git` binary). Default
779    /// `true` (the secure grammar); set `false` to fall back to the old
780    /// base-binary-only matching as a compat/rollback path. Trust-gated: an
781    /// untrusted workspace cannot weaken this via a local override. Override
782    /// via `LEAN_CTX_SHELL_ALLOWLIST_SUBCOMMAND_SCOPING`.
783    #[serde(default = "serde_defaults::default_true")]
784    pub shell_allowlist_subcommand_scoping: bool,
785
786    /// Shell-security mode for ctx_shell / `lean-ctx -c` command gating (GL #788):
787    /// `enforce` (default, secure), `warn` (run checks, log violations, never
788    /// block) or `off` (skip the allowlist + dangerous-pattern blocks entirely —
789    /// a deliberate opt-out; compression stays active). Override via
790    /// LEAN_CTX_SHELL_SECURITY. `None` resolves to `enforce`.
791    #[serde(default)]
792    pub shell_security: Option<String>,
793
794    /// Default shell-command timeout in seconds for *normal* commands. `None`
795    /// resolves to the built-in 2-minute default; heavy builds/tests use
796    /// [`Config::shell_heavy_timeout_secs`]. Override via
797    /// `LEAN_CTX_SHELL_TIMEOUT_SECS` (`LEAN_CTX_SHELL_TIMEOUT_MS` still wins over
798    /// both, in milliseconds).
799    #[serde(default)]
800    pub shell_timeout_secs: Option<u64>,
801
802    /// Shell-command timeout in seconds for *heavy* commands (cargo build/test,
803    /// make, docker build, git commit/push, …). `None` resolves to the built-in
804    /// 10-minute ceiling. Override via `LEAN_CTX_SHELL_HEAVY_TIMEOUT_SECS`.
805    #[serde(default)]
806    pub shell_heavy_timeout_secs: Option<u64>,
807
808    /// Extra command prefixes that get the heavy timeout ceiling. Merged with
809    /// the built-in list. Useful for project-specific long-running scripts.
810    /// Example: `shell_heavy_prefixes = ["python3 ", "./scripts/"]`
811    #[serde(default)]
812    pub shell_heavy_prefixes: Vec<String>,
813    /// When true, `ctx_shell` accepts shell file-write redirects (`>`, `>>`,
814    /// `tee`, heredoc-to-file, `curl -o`, `wget` default mode). Default false —
815    /// the native Write/Edit tool is preferred. Opt-in for power users who want
816    /// classic shell syntax; the real command gating (allowlist,
817    /// dangerous-pattern and interpreter-eval blocks) still applies. Override
818    /// via `LEAN_CTX_SHELL_ALLOW_WRITES=1`.
819    #[serde(default)]
820    pub shell_allow_writes: bool,
821    /// Absolute paths where shell redirects and `tee` may capture output.
822    /// Empty uses the operating system's temporary directories. Project files
823    /// remain denied even when a configured path overlaps the project root.
824    #[serde(default)]
825    pub write_allow_paths: Vec<String>,
826
827    /// #814: opt-in to allow `python3 -c`, `node -e`, etc. in ctx_shell.
828    /// Default `false` — inline code is blocked because it leaves no auditable
829    /// artifact. Override via `LEAN_CTX_SHELL_ALLOW_INLINE_SCRIPTS=1`.
830    #[serde(default)]
831    pub shell_allow_inline_scripts: bool,
832
833    /// Setup behavior: controls what gets injected during setup and updates.
834    #[serde(default)]
835    pub setup: SetupConfig,
836    #[serde(default)]
837    pub solution: super::solution::SolutionConfig,
838    #[serde(default)]
839    pub provenance: super::provenance::ProvenanceConfig,
840    pub cross_agent: super::provenance::CrossAgentConfig,
841}