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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
//! The self-multiplex spine (DESIGN §16.7 W12). yog's own executable is the
//! physical target of every embedded-tool spawn: a `litany`/`bl`/`bz` leading
//! verb — `yog litany <argv…>`, `yog bl <argv…>`, `yog bz <argv…>` — dispatches
//! here, to the arm that calls the embedded crate's entrypoint exactly as each
//! upstream's own thin bin does (all three filled: W8/W10/W11), and so do
//! balls' two sibling plugin binaries — `yog bl-delivery <op> <phase>`,
//! `yog bl-tracker <op> <phase>` (bl-2930, the U-balls-3 seam) — spawned by
//! the embedded balls' own plugin chain through the `world/tools/` shims a
//! `yog bl prime` binds. Everything else — no args, `--editor-apply`,
//! `yog env`/`yog exec`, the GUI — is not a namespace and falls through
//! ([`dispatch`] returns `None`).
//!
//! **How a wave fills an arm.** Each namespace has one function, `fn run(args:
//! &[String]) -> i32`. A wave lands by replacing exactly that one function's
//! body with the crate call — **W8 filled [`bl::run`]** (`balls::run(&edge,
//! args)`), **W10 filled [`bz::run`]** ([`crate::bz_host`], brazen's own `main`
//! in this process), and **W11 filled [`litany::run`]** (litany's own thin exec
//! binding: parse `cmd::Cli`, run `Command::preludes` + `Command::run`, perform
//! the `Outcome` including the successor `exec`). The routing, argv slicing,
//! and exit plumbing here did not change — each wave also flipped its
//! namespace's [`Binary::self_multiplexed`](crate::cli_outbound::Binary)
//! switch, so spawns target `yog <namespace>` and reach the filled arm. The
//! two edits are the whole of a wave's spine work.
//!
//! **A substrate arm stands its process in the world** ([`crate::world::inhabit`],
//! §16.2, bl-81c9): the `bl` and `litany` arms fold the override set into their
//! own env, because the embedded crate reads `getenv` itself and spawns children
//! that do too, so no `Env` value reaches either — one spelling, one world. The
//! rest need no fold: `bz`'s state is per-**wall**, not per XDG (§16.2 as
//! amended); the plugin arms are spawned by a balls that folded already; and
//! `gesture`/`seat`/`tool-host` are yog's own code over a composed `Env`. It is
//! each arm's own act, not the router's, because the fold must land after that
//! arm's "touches nothing yet" point — for `litany` that is below the clap
//! parse, which is what keeps a probe and a bad verb world-free.
//!
//! `main.rs` (coverage-excluded) stays a thin call: `dispatch(&argv)` returns
//! `Some(code)` (the process exits with it) or `None` (the GUI/hatch path,
//! unchanged). All routing logic lives here, under test.
/// Dispatch on the leading verb-namespace (`argv[1]`): `Some(exit_code)` when it
/// names a namespace (the caller exits with it), `None` for anything else — no
/// args, `--editor-apply`, `env`/`exec`, or the GUI, all unchanged (§16.7 W12).
/// `argv` is the whole process argv; the namespace's arm receives `argv[2..]`.
///
/// The W9 refusal (`prime`/`sync`/`install`, reserved exit 91) is **gone**
/// (bl-2930): U-balls-3 landed the plugin-binary lib seam upstream
/// (`delivery_bin::run` / `tracker::run`), the [`bl_delivery`]/[`bl_tracker`]
/// arms answer it, and the `bl` arm hands balls the world's own shim as its
/// executable — so a `prime` binds a plugin chain that IS yog, and the whole
/// verb surface runs embedded. W12's per-arm "not embedded" codes were already
/// dead; now no yog-reserved `bl` exit code exists at all.
/// The whole top-level surface, in one place: the binary's own header and
/// flags (rendered by clap, so they are never restated here), then every
/// leading word yog answers to. Both come from [`help::COMMANDS`] — the same table every
/// per-command page is rendered from, whose `verb` is the const its dispatcher
/// routes on — so nothing here can drift from what runs. A row with no summary
/// is unadvertised (`tool-control`, a machine seam); balls' two plugin binaries
/// carry no row at all. The column is measured, not chosen: a line added
/// tomorrow aligns itself.
/// The router's table and its exhaustive per-namespace classification
/// (bl-4667) — split to its own file at §12's budget.
use Namespace;
/// The `gesture` arm (§8.5): the control boundary's deposit-and-wait sugar —
/// `yog gesture '<json>'` deposits into the composed world's gestures inbox
/// and waits for a consumer's reply ([`crate::boundary::sugar`]). The world
/// is composed here at the process edge, exactly as the GUI/headless paths
/// compose it (§16.2), so the sugar addresses the same nested state root.
/// The `litany` arm — **filled by W11**: litany's own thin exec binding, in
/// yog's process (see the module doc in `multiplex/litany.rs`).
/// The landing repair the `bl` arm runs on the way in (§16.3, bl-7e54): a
/// landing yog founded before balls' config home was nested carries a schedule
/// seeded from the operator's stale template, and balls re-seeds a landing only
/// when founding one. See the module doc.
/// The argv seat's help, read above the router (§8.5, bl-52ed) — the top-level
/// roster, every per-command page, and the discovery probe the namespace arms
/// answer world-free.
pub
/// The `bl-delivery` arm (bl-2930): balls' delivery plugin, in yog's process —
/// the upstream `pub` boundary ([`balls::delivery_bin::run`], U-balls-3) over
/// live env resolved here at the process edge, exactly as the shipped sibling
/// binary's `main` resolves it. Reached through the `world/tools/bl-delivery`
/// shim a `yog bl prime` binds into the checkout's `config/plugins/bin/`;
/// balls spawns it subprocess-uniform (§6) with the §7 wire on stdin.
/// The `bl-tracker` arm (bl-2930): balls' tracker plugin, in yog's process —
/// the upstream `pub` boundary ([`balls::tracker::run`]) over live env
/// resolved here, exactly as the shipped `bl-tracker` binary's `main` does.
/// Bound and spawned the same way as [`bl_delivery`].
/// The `bz` arm — **filled by W10**: [`crate::bz_host`] is `bz`'s own `main` in
/// yog's process, over the linked brazen's `native-host` shim.