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
//! **The role's two tuning knobs** (DESIGN §9.4, bl-23bd): how much reasoning
//! its model calls request, and whether they ask the provider's priority lane.
//!
//! Both are optional fields of the same `roles.<r>` assignment `/model` writes
//! (litany ARCH §4.3, upstream bl-acba and bl-f587), on the same lineage,
//! through the same `litany config` commit — so this is a sibling of
//! [`pick`](super::pick), not a widening of it. Two gestures rather than a
//! wider `/model` for two reasons that agree: REMOTE §3 makes a new op free and
//! a changed shape a version bump, and a toggle that forced the operator to
//! restate provider and model would be a knob you cannot reach without
//! re-asserting two facts you did not come to change.
//!
//! **They carry the operator's vocabulary, and no dialect's.** `effort` and
//! `priority` are what the config says; `reasoning_effort`, `thinking.budget_tokens`,
//! `service_tier`, `flex` and `batch` are wire spellings that stay inside the
//! adapter, exactly as litany's own ARCH §4.3 rules. yog spells neither — it
//! writes the config's two words and the engine resolves the rest.
//!
//! **No capability gate stands on the write.** The §9.4 rows state whether a
//! provider takes each knob ([`ProviderRowView`](crate::config_edit::brazen::ProviderRowView)),
//! and that fact decides whether a *control* is offered — never whether a write
//! is allowed. The config field is always lawful, a level a model declines is
//! the provider's own refusal in the §7.3 banner, and refusing here would be a
//! surface refusing on the strength of a question that went unanswered (§9.4's
//! caveat discipline, the rule `is_unknown_row` keeps).
//!
//! **Off is the absent field, and there is no third spelling.** litany reads
//! `effort` and `priority` as `Option`s and states that `false` and omitted are
//! one fact; writing `priority: false` would be a second spelling of absence
//! that the engine would read identically and an operator would read as a
//! third state. So `off` **removes the line**
//! ([`remove_field`](super::grammar::remove_field)), which is also what makes
//! the gesture idempotent: turning off what is already off is the same world.
use ;
use crateGrammarError;
/// A role's requested reasoning-effort level — the closed vocabulary litany's
/// `effort:` takes, in its own lowercase spelling.
///
/// yog's own enum rather than a re-export, for litany's stated reason one layer
/// down: the engine defines its own instead of re-exporting brazen's because the
/// linked crate's type does not carry what it needs, and here the crate's type
/// is not on litany's public surface at all. The bridge is
/// [`as_str`](Self::as_str) and [`parse`](Self::parse), one match each, and the
/// three words are the contract — a fourth level is an upstream act first.
/// What `/effort`'s level word may be, said once so the line's refusal, the
/// codec's refusal and the help page cannot disagree.
pub const LEVELS: &str = "low|medium|high|off";
/// The §9.4 tuning family: one gesture per knob, folded onto one carrier.
///
/// One variant on the §8.5 roster over two, the fold the monitor's, the
/// fleet's, the routing leg's, the §3.8 fan's and the `bl` family's each take
/// (§12): every layer beneath reads these two as a pair — one line reader, one
/// codec file, one executor, one help section, one file written — so the
/// carrier says what those layers already say. The fold is in the carrier and
/// never in the surface: each still spells as its own slash verb and its own
/// envelope `op`, which is what makes a new op free of a version bump.
/// The `providers.yaml` text one tuning gesture produces, or a decline —
/// [`plan`](super::plan)'s sibling, and pure in exactly the same way: text in,
/// whole text out, no disk and no network.
///
/// **It gates nothing itself, and that is the point.** The value is closed at
/// the line and at the codec, so nothing unspellable reaches here; the role is
/// required by the two grammar primitives below, both of which refuse an entry
/// the file does not declare with one sentence. An earlier draft checked the
/// role here as well, so that the *clear* path could not report success for a
/// write that reached nothing — but that made one rule live in two places and
/// left the primitives' own refusal untested. The asymmetry belongs where the
/// lines are: the entry must exist, the field need not.
///
/// It carries **no provider gate** either: see this module's note on why a
/// capability decides a control and never a write.
/// One knob set: the field is written whether or not the role already carried
/// it, which is the whole of what an *optional* assignment field needs and the
/// whole of why [`grammar::upsert_field`] had to exist.
/// One knob cleared: the line goes, and a role that never carried it is
/// returned as it stands — while a role that is not there refuses, which is the
/// asymmetry [`grammar::remove_field`] owns.