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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
//! brazen's effective provider table, projected (DESIGN §5.1 #20/#21, §8.3).
//!
//! One row per provider `bz` would route to, read from `bz --list-providers
//! --json` — the **linked** brazen's own serde projection (§16.7 W10), not a
//! scan of the config text. yog re-implements none of it: the `name` column
//! names the row, the `auth` column names its credential model, the `protocol`
//! column names its wire dialect, and the `credential` column names the secret
//! a run would actually reach for — all four spelled by brazen's own serde
//! renames.
//!
//! **What the tool capability means for a yog turn lives beside it** in
//! [`capability`]: the refusal itself (bl-3d22) and the dead step's route back
//! to it (bl-5252). Since bl-b6c9 the JUDGEMENT is not there either — it is
//! brazen's [`tools`](ProviderRow::tools) column (upstream bl-5053), so a
//! dialect this build was never compiled against is judged by the crate that
//! owns the encoder. This module owns the columns; that one owns the sentence a
//! refusal is worded in.
//!
//! **`auth` is the login capability.** brazen's `Provider::oauth` is documented
//! `present exactly when auth = "oauth2"` — resolution pairs the two or fails
//! (→78), so `auth == "oauth2"` *is* "this row has an `oauth` block", answered by
//! the crate that owns the invariant. `bz --login` serves oauth rows only, so
//! every other spelling is a row it can only refuse. That is the whole of the
//! capability question the Login surface asks (§8.3), which is why nothing here
//! reclassifies a row: it reads a column.
//!
//! **The rendered row is derived here too** ([`ProviderRowView`], bl-402f), not
//! in the pane: `auth` plus the §5.1 #22 presence read is the whole of what a
//! surface can say about a provider, so the words that say it live beside the
//! columns they read. The §8.3 Login pane is the one **painted** seat at it
//! (bl-20cb retired the §9.5 config copy); the boundary's `Providers` reply and
//! §9.4's remedy sentence read the same derivation without repainting the row.
//!
//! **`device` is the flow capability.** The column names the headless sign-in a
//! row serves, in brazen's own `device.style` spelling. `authorize_url`/
//! `token_url` are required fields of every `oauth` block while `device` is
//! optional, so the **browser** flow stays the floor every oauth row can serve
//! and this column says which rows do better: [`ProviderRow::headless_login`] is
//! the whole of the branch, read once at the spawn (§8.3 rule 1 as amended by
//! bl-61bf; [`crate::login`]).
/// brazen's `auth` spelling for an OAuth row (`AuthId::OAuth2`'s serde rename).
const OAUTH2: &str = "oauth2";
/// The keyless spelling: the row needs no credential at all (a local runtime,
/// or a host CLI that carries its own).
const NONE: &str = "none";
/// The two keyed spellings: the secret is a *config* value, not a bz-stored
/// credential, so the operator's move is an edit and never a sign-in.
const API_KEY: &str = "api_key";
const BEARER: &str = "bearer";
/// brazen's `credential` spelling for a row that needs none at all — its
/// `auth = "none"` arm, answered before any store is consulted. A keyless row
/// is a local runtime or a host CLI carrying its own sign-in, so this says
/// nothing about whether that runtime is *there* — see the §8.1 sign-in gate
/// (`boundary::dispatch::signin`), the one consumer that cares.
pub const NOT_REQUIRED: &str = "not required";
/// brazen's `credential` spelling for a row with no credential to use: its
/// `fetch_cred` found nothing. **The one spelling that is a refusal** — every
/// other, this build's four known ones and any this build has never heard of,
/// leaves the row able to answer, and no surface refuses on the strength of a
/// question that went unanswered.
pub const MISSING: &str = "missing";
/// One row of the effective provider table (§5.1 #20/#21) — the columns yog
/// consumes, verbatim from brazen's `--list-providers --json` object.
/// One provider row as the operator reads it: what it is called, its credential
/// fact in words, and either the Login verb (`blocked == None`) or the reason
/// there is none. **One derivation, one painted seat** — the §8.3 Login pane
/// renders this struct and, since bl-20cb, nothing else does: a second surface
/// painting the same row was two renderings of one fact, and the seat that keeps
/// it is the one whose verb the row is about.
/// The effective table as the rendered rows, in listing order. Every fact a
/// surface states about a provider is a column of the row itself (bl-dba3), so
/// this is a projection and takes nothing beside the table.
/// Parse `bz --list-providers --json`
/// (`{"providers":[{"name":…,"protocol":…,"auth":…},…]}`) into rows, in listing
/// order — which IS brazen's routing order. A non-object or shapeless payload
/// folds to no rows, never an error; a row missing any column folds to an empty
/// string for it (an unnamed row is unroutable, an unknown auth model is not
/// `oauth2`, and an unreadable protocol answers nothing about tools, so all
/// three degrade without a branch).
/// The `name` column alone, in listing order — the whole answer a caller that
/// only asks "which rows exist" needs (§9.4's pick gate, §9.5's provider
/// control). Kept here so the
/// projection has one home: a caller that mapped the rows itself would be a
/// second place that knows which column names a row.
/// One boolean column of a listing row, `false` when absent or not a boolean.
///
/// **Absent is `false`, and that is the honest reading rather than a shrug.**
/// The column is a *capability declaration*: a listing that does not carry it
/// has declared nothing, and a surface that offered the control anyway would be
/// advertising a knob nothing has said this row can take — the inverse of the
/// rule the string columns keep, where a question that went unanswered is never
/// a refusal. The asymmetry is the direction of the claim: an unanswered
/// question may not *block* a row, and it may not *grant* it a control either.
/// One string column of a listing row, or `""` when absent or not a string.
pub use dialect_decline;