1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
//! The `[assistant]` section: optional, and about ACCOUNTS only.
//!
//! # The section is optional, and a stock server serves the assistant
//!
//! RULED 2026-08-29 (Tom, "it needs to work out of the box"): a first install
//! runs the assistant with no configuration, no environment variables and no
//! second process. The harness catalogue ships as DATA in
//! [`aion_integration_acp::catalogue`] — id, launch line, install hint — so
//! there is no command, no path, no working directory and no timeout for an
//! operator to type, and nothing to get wrong before the first message.
//!
//! What is left in this section is the one thing the product genuinely cannot
//! know: which named LOGIN ACCOUNTS a deployment wants offered on a harness, and
//! which environment variables select each one. Everything else that used to
//! live here — `default_harness`, `spawn_timeout_ms`, `turn_timeout_ms`,
//! `event_buffer`, and every per-harness `command` / `args` / `cwd` /
//! `env_pass` / `permission` / `exit_grace_ms` / `tool_confinement` — is
//! RETIRED, not defaulted: see the round-2 amendment. A file that still carries
//! one is refused at load naming the key, because a knob that is silently
//! ignored is worse than one that is gone.
//!
//! # Accounts carry NAMES on both sides
//!
//! An account's `env` maps the variable name the CHILD gets to the variable name
//! it is READ FROM in the server's own environment:
//!
//! ```toml
//! [[assistant.harness]]
//! name = "claude-code"
//!
//! [[assistant.harness.account]]
//! name = "work"
//! env = { CLAUDE_CONFIG_DIR = "AION_CLAUDE_WORK_DIR" }
//! ```
//!
//! Both sides are names. No value is ever written into this file: a value in a
//! document gets committed, diffed and deployed, and the value here would be
//! pointing at somebody's login state. The value comes from the server's own
//! environment at spawn, and a declared source name the server does not carry is
//! a TYPED ABSENCE at spawn rather than an empty string handed to an agent.
//!
//! A credential-shaped variable NAME is still refused at load. A credential is
//! the harness's own login state on disk, never ours to carry: the operator logs
//! the harness in on the server host, under that account's config directory, and
//! this server neither prompts for nor stores one.
use BTreeMap;
use Deserialize;
/// The validating resolution: every `[assistant]` refusal, and the pass that
/// turns the wire shapes below into the resolved ones.
/// The `[assistant]` section — entirely optional.
///
/// [`Default`] is the empty section, which is what a server with no
/// `[assistant]` at all gets, and it is a COMPLETE configuration: every
/// catalogue harness is offered, none of them declares an account, and sessions
/// are served. Absence is not darkness here.
///
/// `deny_unknown_fields` is what refuses a retired knob by name: a file carrying
/// `turn_timeout_ms` is told that no such key exists rather than being loaded
/// with a value nothing reads.
/// The accounts declared on ONE catalogue harness, from
/// `[[assistant.harness]]`.
///
/// It declares no launch of its own: `name` selects a harness the build already
/// ships, and everything else about how that harness is started is the
/// catalogue's.
/// One named login account, from `[[assistant.harness.account]]`.
/// The `[assistant]` section, validated.
///
/// [`Default`] is the stock server: no accounts declared anywhere. It is not a
/// dark form and there is no `enabled` flag — whether a session can be opened is
/// a question about the STORE and about which catalogue harness the operator
/// picked, both answered where those facts are, not by a config field.
/// One catalogue harness's declared accounts, validated.
/// One named login account, validated.