@yahyahammad/venastine 0.3.8 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/.env.example +19 -19
  2. package/CONFIG_ARCHITECTURE.md +2139 -2002
  3. package/LICENSE +201 -201
  4. package/README.md +1043 -1034
  5. package/agents/builtin/compactor.md +75 -75
  6. package/agents/builtin/explore.md +77 -77
  7. package/agents/builtin/pipeline-reviewer.md +100 -100
  8. package/agents/builtin/plan.md +106 -106
  9. package/agents/builtin/review.md +74 -74
  10. package/agents/manager.py +261 -261
  11. package/agents/subagent_tool.py +472 -472
  12. package/agents/tui_commands.py +238 -146
  13. package/bin/venastine.mjs +584 -528
  14. package/bin/venastine.py +73 -71
  15. package/cli_commands.py +848 -835
  16. package/config.yaml +64 -0
  17. package/config_edit.py +1301 -1301
  18. package/config_schema.py +987 -966
  19. package/config_update.py +749 -749
  20. package/core/agent_activity.py +256 -256
  21. package/core/ansi.py +452 -452
  22. package/core/approval.py +137 -137
  23. package/core/call_view.py +364 -364
  24. package/core/cancel.py +121 -121
  25. package/core/chatgpt_auth.py +747 -747
  26. package/core/claims_view.py +107 -107
  27. package/core/client.py +2756 -2715
  28. package/core/commands.py +464 -454
  29. package/core/compaction.py +1735 -1735
  30. package/core/config_loader.py +1982 -1982
  31. package/core/connect.py +686 -686
  32. package/core/events.py +123 -123
  33. package/core/file_mentions.py +280 -280
  34. package/core/interaction.py +411 -411
  35. package/core/loop.py +2566 -2566
  36. package/core/memory.py +482 -482
  37. package/core/pipeline_models.py +190 -190
  38. package/core/provider_errors.py +274 -234
  39. package/core/reasoning/authorization.py +130 -130
  40. package/core/reasoning/base.py +219 -219
  41. package/core/reasoning/confidence_scoring.py +484 -484
  42. package/core/reasoning/events.py +149 -149
  43. package/core/reasoning/orchestrator.py +1561 -1561
  44. package/core/reasoning/output_writer.py +345 -345
  45. package/core/reasoning/payload_validation.py +524 -524
  46. package/core/reasoning/pipeline_storage.py +427 -427
  47. package/core/reasoning/scholar.py +467 -458
  48. package/core/reasoning/source_corpus.py +433 -433
  49. package/core/reasoning/source_scoring.py +855 -855
  50. package/core/replay.py +315 -315
  51. package/core/shell_sessions.py +1553 -1553
  52. package/credentials.py +307 -307
  53. package/database.py +333 -333
  54. package/docs/PRIVACY.md +78 -78
  55. package/docs/SECURITY.md +114 -108
  56. package/docs/THIRD_PARTY_NOTICES.md +148 -148
  57. package/env_secrets.py +118 -118
  58. package/json_store.py +343 -343
  59. package/logging_setup.py +295 -295
  60. package/main.py +3433 -3433
  61. package/mcp_client/client.py +780 -733
  62. package/mcp_client/config.py +484 -484
  63. package/mcp_client/registration.py +343 -343
  64. package/memories/manager.py +147 -147
  65. package/memories/tui_commands.py +319 -239
  66. package/package.json +303 -303
  67. package/project_init/config_files.py +282 -282
  68. package/project_init/generator.py +728 -728
  69. package/project_init/manifest.py +418 -418
  70. package/project_init/tui_commands.py +147 -147
  71. package/prompts/critic_pass.md +24 -24
  72. package/prompts/revalidate.md +25 -25
  73. package/prompts/revise.md +17 -17
  74. package/prompts/source_grounding.md +66 -66
  75. package/prompts/system_prompts.py +316 -316
  76. package/providers.json.example +94 -94
  77. package/pyproject.toml +149 -149
  78. package/requirements.txt +314 -295
  79. package/safety/policy_enforcement.py +1082 -1082
  80. package/security/askpass.py +419 -419
  81. package/security/capability.py +207 -207
  82. package/security/confine.py +484 -484
  83. package/security/hosted.py +182 -182
  84. package/security/permissions.py +237 -237
  85. package/security/protected_paths.py +501 -501
  86. package/security/sandbox.py +4108 -4108
  87. package/skills/builtin/math/formal-specification.md +67 -67
  88. package/skills/builtin/math/numerical-methods.md +66 -66
  89. package/skills/builtin/research/experiment-design.md +62 -62
  90. package/skills/builtin/research/reproducibility.md +55 -55
  91. package/skills/builtin/research/source-evaluation.md +70 -70
  92. package/skills/builtin/research/statistical-inference.md +63 -63
  93. package/skills/builtin/research/technical-writing.md +59 -59
  94. package/skills/builtin/software/code-review.md +61 -61
  95. package/skills/builtin/software/debugging.md +61 -61
  96. package/skills/builtin/software/test-design.md +67 -67
  97. package/skills/tui_commands.py +110 -110
  98. package/storage.py +1338 -1338
  99. package/tools/base.py +465 -465
  100. package/tools/builtin/_math_common.py +667 -667
  101. package/tools/builtin/_net_common.py +1145 -267
  102. package/tools/builtin/_page_text.py +490 -0
  103. package/tools/builtin/_pdf_text.py +113 -0
  104. package/tools/builtin/arxiv.py +685 -681
  105. package/tools/builtin/fetch_url.py +639 -371
  106. package/tools/builtin/file_ops.py +720 -720
  107. package/tools/builtin/geometry.py +184 -184
  108. package/tools/builtin/load_skill.py +76 -76
  109. package/tools/builtin/pin.py +227 -227
  110. package/tools/builtin/probability_stats.py +224 -224
  111. package/tools/builtin/project_docs.py +464 -464
  112. package/tools/builtin/remember.py +175 -175
  113. package/tools/builtin/shell.py +980 -980
  114. package/tools/builtin/todo.py +149 -149
  115. package/tools/builtin/web_search.py +402 -328
  116. package/tools/context.py +159 -159
  117. package/tools/isolation.py +387 -387
  118. package/tools/registry.py +1252 -1242
  119. package/tui/app.py +8372 -8307
  120. package/tui/app.tcss +754 -739
  121. package/tui/commands.py +26 -26
  122. package/tui/diffs.py +286 -286
  123. package/tui/history.py +128 -128
  124. package/tui/hosted_driver.py +102 -102
  125. package/tui/markdown.py +1329 -1329
  126. package/tui/meters.py +364 -364
  127. package/tui/ravens.py +146 -146
  128. package/tui/screens.py +1255 -1197
  129. package/tui/themes.py +599 -599
  130. package/tui/widgets.py +3861 -3796
package/tui/app.tcss CHANGED
@@ -1,739 +1,754 @@
1
- /* ROADMAP_v2 §16. Colours come from the active theme's variables rather
2
- than literals, so all eight themes restyle this without edits. */
3
-
4
- #main {
5
- width: 1fr;
6
- }
7
-
8
- /* IT SCROLLS, because a Vertical does not (batch 59). Textual's Vertical
9
- is `overflow: hidden hidden`, so the sidebar silently dropped whatever
10
- did not fit. Measured at the 24-row floor with a todo list and a
11
- research run both live: `max_scroll_y` was 11 -- eleven rows the
12
- container had already computed and clipped anyway -- #todo-panel lost
13
- three rows and #research-progress was ENTIRELY off screen, its header
14
- drawn on the last visible row with its whole body gone.
15
-
16
- `overflow-y` on the CONTAINER, not a swap to VerticalScroll. That class
17
- is `can_focus=True` and binds up/down/home/end/pageup/pagedown, which
18
- would add a tab stop and take the arrows batch 55 gave the suggestion
19
- panel. The trade, named rather than discovered later: this scrolls by
20
- wheel and not by keyboard. EP3's sibling rule (a consent surface must
21
- not be mouse-only) does not reach here -- no decision is made in the
22
- sidebar, and every figure in it is also said in the transcript.
23
-
24
- `scrollbar-size-vertical: 1` because the budget is tiny. Measured: 19
25
- usable columns when everything fits, 18 while the bar is up, against 17
26
- at textual's default 2. The width is CONDITIONAL either way -- widgets
27
- reflow by a column when the bar appears. */
28
- #sidebar {
29
- width: 22;
30
- border-left: solid $panel;
31
- padding: 1;
32
- overflow-y: auto;
33
- scrollbar-size-vertical: 1;
34
- }
35
-
36
- /* Section 47. The switcher holding the live transcript and the read-only
37
- view. Both children stay mounted; only `current` changes -- which is what
38
- lets a running turn keep writing to the live pane while a stored thread is
39
- on screen, with nothing to buffer and nothing to flush on the way back. */
40
- #pane {
41
- height: 1fr;
42
- }
43
-
44
- #transcript {
45
- height: 1fr;
46
- border: solid $panel;
47
- padding: 0 1;
48
- }
49
-
50
- /* The accent border is the whole affordance: at a glance this is not the
51
- conversation you are having. The prompt is disabled underneath it, so the
52
- read-only rule is visible rather than merely true. */
53
- #thread-view {
54
- height: 1fr;
55
- border: solid $accent;
56
- padding: 0 1;
57
- }
58
-
59
- /* The lineage trail. `height: auto` and hidden until the viewer opens, so
60
- the live conversation costs no row for a trail it does not need -- the
61
- GoalBanner rule, which every conditional row in #main follows. */
62
- /* ROADMAP_v3 §49 (SS14). THE SAME BOX as #transcript and #thread-view --
63
- `border: solid` and `padding: 0 1` -- and that is load-bearing rather
64
- than tidy: a hidden pane measures 0 and borrows the on-screen pane's
65
- width (Transcript._region_width), so four panes that are not the same
66
- box would each write at another one's width. The accent border is
67
- #thread-view's affordance, for #thread-view's reason: at a glance this
68
- is not the conversation you are having. */
69
- #session-view {
70
- height: 1fr;
71
- border: solid $accent;
72
- padding: 0 1;
73
- }
74
-
75
- /* ROADMAP_v3 §55 (TR10). One tool call: the whole command and what it
76
- printed. The FOURTH pane, and the same box for the paragraph above --
77
- `test_the_panes_measure_the_same_width_when_shown` holds that, and a
78
- different gutter here would silently rewrap every row the live
79
- transcript wrote while this one was up. Accent border, same reason:
80
- this is not the conversation you are having. */
81
- #call-view {
82
- height: 1fr;
83
- border: solid $accent;
84
- padding: 0 1;
85
- }
86
-
87
- #thread-crumb {
88
- height: auto;
89
- padding: 0 1;
90
- /* One line, elided rather than wrapped: a trail that reflowed
91
- would take a second row from the transcript below it. The
92
- ellipsis is the point -- the segment you are standing on is
93
- the last one, so the cut belongs at the far end. Moved off
94
- the Rich Text for `#agent-panel`'s reason. */
95
- text-wrap: nowrap;
96
- text-overflow: ellipsis;
97
- }
98
-
99
- /* Batch 55, the slash-command suggestions. Directly above the prompt
100
- because it is the last child in #main's flow and #prompt is docked out
101
- of that flow -- so it opens UPWARDS with no layer and no offset.
102
-
103
- `height: auto` with a `max-height` again, and the cap is arithmetic:
104
- SUGGEST_MAX_ROWS is 8, plus two border rows is 10, which at the 24-row
105
- floor leaves the transcript nine rows while the panel is up. The widget
106
- budgets itself to those 8 rows, so the cap is a backstop rather than a
107
- clip -- if it ever clips, the budget is wrong.
108
-
109
- No `overflow-y`. A panel that scrolled would be a second thing to
110
- navigate inside a thing being navigated. */
111
- #slash-suggest {
112
- height: auto;
113
- max-height: 10;
114
- border: solid $primary;
115
- padding: 0 1;
116
- /* The count, `4 of 26 - /help for all`. Muted for #prompt's reason:
117
- it is a hint about the list, not a heading over it. */
118
- border-title-color: $text-muted;
119
- /* Batch 62's key hints, on the bottom border. STATED, and measured
120
- rather than assumed: an unstyled subtitle renders in $primary --
121
- the border's own green -- so without this the hint would be
122
- brighter than the count above it on the same box, and the less
123
- important of the two labels would be the louder one. No
124
- `border-subtitle-align`: textual already defaults a subtitle to
125
- the right, which is the corner #prompt's meter uses one box
126
- down, so titles sit left and status sits right throughout. */
127
- border-subtitle-color: $text-muted;
128
- /* `render()` pads every row to the panel width itself, and the
129
- pin on that arithmetic is a test that no drawn row is wider
130
- than the panel. This is the net under it, moved off the Rich
131
- Text for `#agent-panel`'s reason: a row that ever does
132
- overrun clips visibly instead of reflowing into a height the
133
- budget did not count. */
134
- text-wrap: nowrap;
135
- text-overflow: clip;
136
- }
137
-
138
- /* Batch 54. `height: auto` with a `max-height` -- batch 49's shape, for
139
- batch 49's reason. A definite height would reserve four rows whether or
140
- not anything is typed, and this box's whole point is that it is one row
141
- until it isn't; auto also means the transcript gets those rows back the
142
- moment a turn is submitted. The cap is what stops a pasted essay from
143
- eating the transcript: 6 is the border plus four text rows, so a fully
144
- extended prompt still leaves 18 of the 24-row floor above it, and past
145
- four rows the box scrolls instead of growing.
146
-
147
- `padding: 0 1` is stated rather than inherited. TextArea's own default
148
- is `0 1` and the Input this replaced was `0 2`; naming it is what keeps
149
- the typed text's left edge where a reader already has it. */
150
- #prompt {
151
- dock: bottom;
152
- border: solid $primary;
153
- height: auto;
154
- max-height: 6;
155
- padding: 0 1;
156
- /* The placeholder, carried by the border title rather than TextArea's
157
- native in-box one (assigning both drew it twice). Muted
158
- is already this sheet's vocabulary for a hint (#usage-line,
159
- #todo-panel, #research-progress), so it reads as one rather than
160
- as a heading. */
161
- border-title-color: $text-muted;
162
- }
163
-
164
- #raven {
165
- height: 5;
166
- color: $accent;
167
- content-align: center middle;
168
- }
169
-
170
- /* §40. Hidden unless a shipped protection is off; auto height so it
171
- costs nothing in the shipped posture. $error because the one thing it
172
- must not read as is decoration. */
173
- #posture-badge {
174
- height: auto;
175
- color: $error;
176
- text-style: bold;
177
- padding: 1 0 0 0;
178
- }
179
-
180
- /* Batch 59's agent stack. Auto height and hidden until there is an active
181
- agent or a running spawn, so it costs no rows in the ordinary case --
182
- the same shape #posture-badge and #usage-line already use. No colours
183
- here: the panel renders through Rich styles resolved per draw
184
- (role_styles), which is what makes /theme reach it. */
185
- #agent-panel {
186
- height: auto;
187
- padding-top: 1;
188
- /* The rows are sized by the widget (AgentPanel.WIDTH lays out
189
- against 18) and must not be re-wrapped underneath it: a
190
- miscalculation should clip where it can be seen rather than
191
- reflow where it cannot. This used to be `no_wrap` /
192
- `overflow` on the Rich Text itself, which stopped meaning
193
- anything when the textual pin moved -- a Content carries
194
- neither flag and the conversion drops both. See
195
- `widgets.as_content`. */
196
- text-wrap: nowrap;
197
- text-overflow: clip;
198
- }
199
-
200
- /* ROADMAP_v3 §49 (SS14). The same box as #agent-panel above, because it is
201
- the same kind of widget in the same twenty columns: rows sized by the
202
- widget (SessionPanel.WIDTH, which is AgentPanel.WIDTH) and clipped rather
203
- than reflowed, for that block's reason. */
204
- #session-panel {
205
- height: auto;
206
- padding-top: 1;
207
- text-wrap: nowrap;
208
- text-overflow: clip;
209
- }
210
-
211
- #effort-raven {
212
- height: 2;
213
- color: $secondary;
214
- content-align: center middle;
215
- }
216
-
217
- /* #4 session usage line. Auto height and hidden until the first turn
218
- gives it figures, like the research panel above. */
219
- #usage-line {
220
- height: auto;
221
- padding-top: 1;
222
- color: $text-muted;
223
- }
224
-
225
- /* §22 live research view. Auto height so it takes no sidebar space until
226
- a run starts.
227
-
228
- THE CAP AND THE OVERFLOW ARE GONE (batch 59), and they were EP3's trap
229
- a second time. `Static` + `max-height` + `overflow-y: auto` reads as
230
- "clip it and let them scroll" and does neither: a Static's
231
- `virtual_size` follows its clamped box rather than its text, so
232
- `max_scroll_y` was 0 and the rows past the bound were not below the
233
- fold, they were gone. Measured here at one lost row with twenty passes
234
- and twelve claims; measured in tui/screens.py at nine lines in a
235
- seven-row block, which is the ScrollBox that fixed it there.
236
-
237
- The fix is the same shape: the bound belongs on a real scroll
238
- container, and #sidebar is now one. What still bounds this panel is
239
- ResearchProgress.ROWS -- a window over the passes, which is the half of
240
- that comment that was always true. */
241
- #research-progress {
242
- height: auto;
243
- padding-top: 1;
244
- color: $text-muted;
245
- }
246
-
247
- PermissionScreen {
248
- align: center middle;
249
- }
250
-
251
- /* Every modal screen gets one of these (#112). Nothing checked that a
252
- screen had both a type selector and an id block for its dialog, and
253
- five of nine never got the first -- they measured at x=0, y=0, pinned
254
- to the top-left corner of an 80x24 terminal. The viewport test in
255
- tests/test_tui.py pushes every modal the app defines; until batch 179
256
- it pushed only the ones its table listed, and SecretScreen, which came
257
- later and missed both the row and this rule, opened every masked
258
- prompt in the corner. */
259
-
260
- GrantPickerScreen {
261
- align: center middle;
262
- }
263
-
264
- SecretScreen {
265
- align: center middle;
266
- }
267
-
268
- NoticeScreen {
269
- align: center middle;
270
- }
271
-
272
- SubagentSignoffScreen {
273
- align: center middle;
274
- }
275
-
276
- ConfirmScreen {
277
- align: center middle;
278
- }
279
-
280
- ProjectKindScreen {
281
- align: center middle;
282
- }
283
-
284
- ReviewScreen {
285
- align: center middle;
286
- }
287
-
288
- #permission-dialog {
289
- /* A VERTICAL, not a grid (batch 49). §46 left this a two-column grid
290
- in which every child carried `column-span: 2`, so the second column
291
- held nothing but the Deny button -- and `grid-size` being static is
292
- the only reason the `with-headline` class existed, to tell the
293
- stylesheet whether the screen had composed three children or four.
294
- A Vertical does not need telling, so the template somebody had to
295
- keep in sync is gone rather than commented.
296
- The `1fr` row EP1 removed is still not to come back: a fractional
297
- row inside a `height: auto` container resolves to ZERO, and it is
298
- what made the payload absent from every permission modal this app
299
- had ever shown. What bounds a long payload is `max-height` on the
300
- ScrollBox -- see #permission-params-box for why not a definite
301
- `height`, which is what EP1 shipped and what took the buttons. */
302
- padding: 1 2;
303
- /* 90% with a cap, not a fixed 60 (§46, EP1). Width is what decides
304
- how many rows the notice and the reason cost, and those rows are
305
- what the command and the payload have to share -- at 60 the
306
- notice alone wrapped to three. Same shape as #claims-dialog and
307
- for the same reason (#112): align cannot centre something wider
308
- than an 80-column terminal, so the cap has to stay under it. */
309
- width: 90%;
310
- max-width: 96;
311
- height: auto;
312
- /* 22, which is what the deleted `.with-headline` block used: the
313
- four rows the pinned command takes are the reason that block
314
- existed, and with one template the taller shape sets the cap.
315
- Still inside the 24-row floor #112 pins, and `height: auto` means
316
- a short approval is nowhere near it -- `web_search` measures 14. */
317
- max-height: 22;
318
- border: thick $warning;
319
- background: $surface;
320
- }
321
-
322
- /* The blank row between blocks was `grid-gutter: 1 2` and a Vertical
323
- has no gutter, so it is a margin now. It is not decoration: §46 pinned
324
- the command OUTSIDE the payload precisely so the two read as separate
325
- claims about the call, and flush against each other they do not. */
326
- #permission-title {
327
- text-style: bold;
328
- margin-bottom: 1;
329
- }
330
-
331
- /* Section 47. Which run raised the question, when it was not the
332
- conversation itself. Muted and unbold: it qualifies the title rather
333
- than competing with it, and it sits directly under it because RA6
334
- reads a harness fact before anything the agent wrote.
335
-
336
- It eats the title's margin, so the pair reads as one heading rather
337
- than as two blocks -- which is what the margin exists to separate.
338
-
339
- ONE ID ACROSS THE THREE MODALS that can be asked from inside a run
340
- (batch 75: the sign-off and the model's own question joined the
341
- permission prompt). Ids are per-screen, so one rule styles all three
342
- and there is nothing to keep in step -- the same reason
343
- `screens.asker_label` is one function. */
344
- #permission-asker {
345
- color: $text-muted;
346
- margin-top: -1;
347
- margin-bottom: 1;
348
- }
349
-
350
- /* The pinned subject of the question (§46, EP1), and the split
351
- favours it deliberately: the payload below repeats the notice, the
352
- reason and the command itself, so rows spent here buy the one thing
353
- nothing else on the screen shows in full. Four is what a wrapped
354
- `docker run ... bash -c "..."` needs at this width, measured; past
355
- that it scrolls rather than growing, so a pathological command
356
- cannot eat the modal. Deliberately not $text-muted -- this is the
357
- one thing on the screen the reader must actually read. */
358
- #permission-command-box {
359
- height: auto;
360
- max-height: 4;
361
- margin-bottom: 1;
362
- }
363
-
364
- #permission-command {
365
- text-style: bold;
366
- }
367
-
368
- /* `auto` WITH a `max-height`, not a definite height (batch 49,
369
- amending EP3). EP3 got the Static half right -- a Static given
370
- `max-height` reports no content past the bound, so its hidden rows
371
- are gone rather than below the fold -- and the ScrollBox half wrong.
372
- A scrollable container asked for `height: auto` does NOT resolve to
373
- zero; EP1's `1fr` ROW did, and the box was measured inside one. With
374
- the row `auto`, a DEFINITE height bounds what the box draws and not
375
- what its parent reserves, so the row kept growing with the payload
376
- and pushed the decision bar past the dialog's own `max-height`, where
377
- it was clipped away -- on nine of fourteen modal shapes, `shell`'s
378
- among them. `auto` with a `max-height` reports the bound upward, and
379
- still shrinks to a two-line payload, which a definite height never
380
- did. Do not "restore" one:
381
- test_a_bounded_box_reserves_its_bound_not_its_content fails. */
382
- /* 7 rows, and NO margin below it -- the arithmetic is the point.
383
- A dialog capped at 22 has 18 rows inside it, and the title, its
384
- margin, the pinned command, its margin and the decision bar claim 11
385
- of them whether or not the payload wants more. Leaving the last
386
- blank row off buys the slack a title that wraps to two lines needs,
387
- which is the one length here that nothing bounds.
388
- Everything past row 7 is scrollable, and on the shell modal every
389
- line of it also appears above. */
390
- #permission-params-box {
391
- height: auto;
392
- max-height: 7;
393
- }
394
-
395
- #permission-params {
396
- height: auto;
397
- color: $text-muted;
398
- }
399
-
400
- /* THE DECISION BAR (batch 49). One rule for every consent surface,
401
- because the defect it answers was one defect on nine of them: the
402
- buttons were the LAST children of a dialog whose body could outgrow
403
- it, so they were what fell off. In a bar they are one child, and the
404
- bounded bodies above keep the sum inside the dialog.
405
- Centred rather than stretched: the dialog was always centred and its
406
- contents were not -- Allow sat flush against the left padding and a
407
- 16-wide Deny left ~22 dead columns beside it. Filling the columns
408
- instead would have made the permissive answer a target half the width
409
- of the modal. `height: auto` so a bar costs exactly its buttons. */
410
- #permission-buttons,
411
- #grant-buttons,
412
- #review-buttons,
413
- #question-buttons {
414
- height: auto;
415
- align: center middle;
416
- }
417
-
418
- #permission-buttons Button,
419
- #grant-buttons Button,
420
- #review-buttons Button,
421
- #question-buttons Button {
422
- margin: 0 1;
423
- }
424
-
425
- /* FOCUS WITHOUT `reverse` (batch 49). Textual's Button carries
426
- `text-style: $button-focus-text-style` when focused and this theme
427
- resolves that to `reverse`, which inverts the LABEL and nothing else
428
- -- so a focused green Allow drew its word as green on white and read
429
- as a highlighted selection rather than as the keyboard's position.
430
- Bold plus a lifted background tints the whole button instead, which
431
- is what a person actually looks for, and it composes with all
432
- fourteen palettes because both values come from the theme rather than
433
- from a literal (#116). */
434
- Button:focus {
435
- text-style: bold;
436
- background-tint: $foreground 25%;
437
- }
438
-
439
- /* The answer box lines up with the options above it (batch 49).
440
- Textual's Input takes a `tall` border on all four sides and a Button
441
- takes one on the top and bottom only, so at the same `x` the Input's
442
- left edge is drawn a column in from the option buttons' -- close
443
- enough to look like a mistake and far enough to see. Dropping the two
444
- side edges gives both widgets the same box, rather than giving the
445
- buttons a border they do not want. */
446
- #question-text,
447
- #review-note {
448
- border-left: none;
449
- border-right: none;
450
- }
451
-
452
- ThreadPickerScreen {
453
- align: center middle;
454
- }
455
-
456
- /* §26 claims view. Wider than the other dialogs because claim text is
457
- prose rather than a label, and primary-bordered rather than
458
- warning-bordered: this one only reads, it authorises nothing. */
459
- ClaimsScreen {
460
- align: center middle;
461
- }
462
-
463
- #claims-dialog {
464
- /* 90% with a cap, not a fixed width (#112): at 96 the dialog was
465
- wider than an 80-column terminal, and align: center middle cannot
466
- centre something wider than its container -- the right ~16
467
- columns, tail of every score: line included, sat off-screen. */
468
- width: 90%;
469
- max-width: 96;
470
- height: auto;
471
- max-height: 22;
472
- padding: 1 2;
473
- border: thick $primary;
474
- background: $surface;
475
- }
476
-
477
- #claims-title {
478
- text-style: bold;
479
- padding-bottom: 1;
480
- }
481
-
482
- /* The Static keeps the colour and the box keeps the bound (batch 49);
483
- `max-height` on the Static itself was EP3's truncation-without-scroll,
484
- on the one screen that exists to show every claim. */
485
- #claims-body-box {
486
- height: auto;
487
- max-height: 14;
488
- }
489
-
490
- /* §25 research grant picker. Warning-bordered like the permission modal
491
- rather than primary-bordered like the thread picker: both are
492
- authorization decisions, and looking like the neutral list-of-threads
493
- dialog would undersell what confirming here does. */
494
- #grant-dialog {
495
- width: 76;
496
- height: auto;
497
- max-height: 22;
498
- padding: 1 2;
499
- border: thick $warning;
500
- background: $surface;
501
- }
502
-
503
- #grant-title {
504
- text-style: bold;
505
- }
506
-
507
- #grant-help {
508
- padding-bottom: 1;
509
- color: $text-muted;
510
- }
511
-
512
- /* 8, not 14 (batch 49). A dialog has 18 rows inside it on the 24-row
513
- floor, and the title, the two-sentence help, the bar and this list
514
- have to share them -- at 14 the confirm button was off the bottom
515
- with twenty tools offered. */
516
- #grant-list {
517
- height: auto;
518
- max-height: 8;
519
- margin-bottom: 1;
520
- }
521
-
522
- /* Section 47's run picker, the keyboard route to what the sidebar
523
- offers on a click. Narrower than the thread picker because its rows
524
- are agent names and an indent rather than a uuid plus a preview,
525
- and it takes the accent border the read-only pane takes: both say
526
- the same thing, that what you are about to look at is not the
527
- conversation you are having. */
528
- #agent-picker-dialog {
529
- width: 48;
530
- height: auto;
531
- max-height: 20;
532
- padding: 1 2;
533
- border: thick $accent;
534
- background: $surface;
535
- }
536
-
537
- #agent-picker-title {
538
- text-style: bold;
539
- padding-bottom: 1;
540
- }
541
-
542
- #agent-picker-list {
543
- height: auto;
544
- max-height: 14;
545
- }
546
-
547
- /* Finished runs read muted. They open like any other row, so this is
548
- de-emphasis rather than a warning -- and a muted hue rather than the
549
- `dim` attribute, which is the transcript's vocabulary (test_themes
550
- pins it to the system role) while this list is a modal, where
551
- UNVERIFIED_COVERAGE already set the precedent that quiet names a
552
- different state rather than a broken one. */
553
- #agent-picker-list .finished {
554
- color: $text-muted;
555
- }
556
-
557
- AgentPickerScreen {
558
- align: center middle;
559
- }
560
-
561
- /* ROADMAP_v3 §49 (SS2): the kill picker. Wider than the run picker
562
- because its rows carry a command as well as a name, and a command cut
563
- at 48 columns is exactly the "which one is this?" the picker exists to
564
- answer. */
565
- #session-kill-dialog {
566
- width: 72;
567
- height: auto;
568
- max-height: 20;
569
- padding: 1 2;
570
- border: thick $accent;
571
- background: $surface;
572
- }
573
-
574
- #session-kill-title {
575
- text-style: bold;
576
- padding-bottom: 1;
577
- }
578
-
579
- #session-kill-list {
580
- height: auto;
581
- max-height: 14;
582
- }
583
-
584
- SessionKillScreen {
585
- align: center middle;
586
- }
587
-
588
- #thread-dialog {
589
- width: 70;
590
- height: auto;
591
- max-height: 24;
592
- padding: 1 2;
593
- border: thick $primary;
594
- background: $surface;
595
- }
596
-
597
- #thread-title {
598
- text-style: bold;
599
- padding-bottom: 1;
600
- }
601
-
602
- #thread-list {
603
- height: auto;
604
- max-height: 18;
605
- }
606
-
607
- /* §23 slice 2's question modal. Borrows the grant dialog's proportions --
608
- both are "read this, then choose" rather than "allow or deny" -- but
609
- takes the primary border rather than the warning one: this authorises
610
- nothing, it answers something. */
611
- QuestionScreen {
612
- align: center middle;
613
- }
614
-
615
- #question-dialog {
616
- width: 66;
617
- height: auto;
618
- /* The body is the MODEL's question -- the one length the app does
619
- not choose (#112). Without a max-height a long question pushed the
620
- dialog to 45 rows on a 24-row terminal, title off the top and the
621
- defer button off the bottom. */
622
- max-height: 22;
623
- padding: 1 2;
624
- border: thick $primary;
625
- background: $surface;
626
- }
627
-
628
- #question-title {
629
- text-style: bold;
630
- width: 100%;
631
- }
632
-
633
- #question-body-box {
634
- height: auto;
635
- max-height: 4;
636
- padding: 1 0;
637
- width: 100%;
638
- }
639
-
640
- #question-body {
641
- height: auto;
642
- width: 100%;
643
- }
644
-
645
- /* The single-select options. Bounded like the SelectionList the
646
- multi-select branch uses, and for the same reason -- four options of
647
- two lines each is 16 rows, and the dialog has 18. */
648
- #question-options {
649
- height: auto;
650
- max-height: 6;
651
- width: 100%;
652
- margin-bottom: 1;
653
- }
654
-
655
- /* FIXED WIDTH, and it is what stops the truncation (batch 49). At
656
- Button's default `width: auto` an option is as wide as its label
657
- unwrapped -- measured at 119 columns inside a 60-column dialog, so a
658
- long option was CUT at the dialog edge, and three options of
659
- different lengths gave three different right edges. At `width: 100%`
660
- the same label WRAPS to two centred lines and every option is the
661
- same size. Nothing is truncated anywhere: ask_user refuses an option
662
- too long to render rather than shortening it. */
663
- #question-options Button {
664
- width: 100%;
665
- }
666
-
667
- #question-help {
668
- color: $text-muted;
669
- padding-bottom: 1;
670
- width: 100%;
671
- }
672
-
673
- #question-list {
674
- height: auto;
675
- max-height: 6;
676
- margin-bottom: 1;
677
- }
678
-
679
- /* The sign-off's list is capped like the grant list it is modelled on:
680
- its length is the subagent's gated tool set, and uncapped it pushed
681
- the decision buttons off-screen (#112). Capped at 14 it still did --
682
- #112 bounded the list and nothing bounded the SUM, which is the
683
- defect batch 49 answers. */
684
- #signoff-list {
685
- height: auto;
686
- max-height: 8;
687
- margin-bottom: 1;
688
- }
689
-
690
- /* §20's review consent surface (#112). It had NO rules at all -- full
691
- screen, top-left, unbordered -- and its body carries reason and
692
- proposed straight from the reviewer model, so an uncapped body pushed
693
- the four decision buttons below the fold. Warning-bordered like
694
- permission/grant rather than primary like claims/question: this one
695
- AUTHORISES AN EDIT to a finished research run. */
696
- #review-dialog {
697
- width: 76;
698
- height: auto;
699
- max-height: 22;
700
- padding: 1 2;
701
- border: thick $warning;
702
- background: $surface;
703
- }
704
-
705
- #review-title {
706
- text-style: bold;
707
- }
708
-
709
- #review-body-box {
710
- height: auto;
711
- max-height: 8;
712
- }
713
-
714
- #review-body {
715
- height: auto;
716
- }
717
-
718
- /* §38's collapsed thinking line. `height: auto` and hidden until a span
719
- starts, so it costs no rows when tui.show_thinking is on -- the same
720
- arrangement the checklist below uses for its unfilled slots. */
721
- #thinking-indicator {
722
- height: auto;
723
- padding: 0 1;
724
- }
725
-
726
- /* §23 slice 2's checklist. `height: auto` so an empty list costs no rows in
727
- whichever slot tui.todo_position put it in -- the widget hides itself, and
728
- this is what makes the unused slots free.
729
-
730
- No `max-height`, no `overflow-y`: see #research-progress for why that
731
- pairing on a Static clips rather than scrolls (batch 59, EP3's trap).
732
- TodoPanel.ROWS is the bound. This panel also sits in the `top` and
733
- `bottom` slots inside #main, where nothing scrolls at all -- one more
734
- reason its own height must be honest rather than clamped. */
735
- #todo-panel {
736
- height: auto;
737
- padding: 0 1;
738
- color: $text-muted;
739
- }
1
+ /* ROADMAP_v2 §16. Colours come from the active theme's variables rather
2
+ than literals, so all eight themes restyle this without edits. */
3
+
4
+ #main {
5
+ width: 1fr;
6
+ }
7
+
8
+ /* IT SCROLLS, because a Vertical does not (batch 59). Textual's Vertical
9
+ is `overflow: hidden hidden`, so the sidebar silently dropped whatever
10
+ did not fit. Measured at the 24-row floor with a todo list and a
11
+ research run both live: `max_scroll_y` was 11 -- eleven rows the
12
+ container had already computed and clipped anyway -- #todo-panel lost
13
+ three rows and #research-progress was ENTIRELY off screen, its header
14
+ drawn on the last visible row with its whole body gone.
15
+
16
+ `overflow-y` on the CONTAINER, not a swap to VerticalScroll. That class
17
+ is `can_focus=True` and binds up/down/home/end/pageup/pagedown, which
18
+ would add a tab stop and take the arrows batch 55 gave the suggestion
19
+ panel. The trade, named rather than discovered later: this scrolls by
20
+ wheel and not by keyboard. EP3's sibling rule (a consent surface must
21
+ not be mouse-only) does not reach here -- no decision is made in the
22
+ sidebar, and every figure in it is also said in the transcript.
23
+
24
+ `scrollbar-size-vertical: 1` because the budget is tiny. Measured: 19
25
+ usable columns when everything fits, 18 while the bar is up, against 17
26
+ at textual's default 2. The width is CONDITIONAL either way -- widgets
27
+ reflow by a column when the bar appears. */
28
+ #sidebar {
29
+ width: 22;
30
+ border-left: solid $panel;
31
+ padding: 1;
32
+ overflow-y: auto;
33
+ scrollbar-size-vertical: 1;
34
+ }
35
+
36
+ /* Section 47. The switcher holding the live transcript and the read-only
37
+ view. Both children stay mounted; only `current` changes -- which is what
38
+ lets a running turn keep writing to the live pane while a stored thread is
39
+ on screen, with nothing to buffer and nothing to flush on the way back. */
40
+ #pane {
41
+ height: 1fr;
42
+ }
43
+
44
+ #transcript {
45
+ height: 1fr;
46
+ border: solid $panel;
47
+ padding: 0 1;
48
+ }
49
+
50
+ /* The accent border is the whole affordance: at a glance this is not the
51
+ conversation you are having. The prompt is disabled underneath it, so the
52
+ read-only rule is visible rather than merely true. */
53
+ #thread-view {
54
+ height: 1fr;
55
+ border: solid $accent;
56
+ padding: 0 1;
57
+ }
58
+
59
+ /* The lineage trail. `height: auto` and hidden until the viewer opens, so
60
+ the live conversation costs no row for a trail it does not need -- the
61
+ GoalBanner rule, which every conditional row in #main follows. */
62
+ /* ROADMAP_v3 §49 (SS14). THE SAME BOX as #transcript and #thread-view --
63
+ `border: solid` and `padding: 0 1` -- and that is load-bearing rather
64
+ than tidy: a hidden pane measures 0 and borrows the on-screen pane's
65
+ width (Transcript._region_width), so four panes that are not the same
66
+ box would each write at another one's width. The accent border is
67
+ #thread-view's affordance, for #thread-view's reason: at a glance this
68
+ is not the conversation you are having. */
69
+ #session-view {
70
+ height: 1fr;
71
+ border: solid $accent;
72
+ padding: 0 1;
73
+ }
74
+
75
+ /* ROADMAP_v3 §55 (TR10). One tool call: the whole command and what it
76
+ printed. The FOURTH pane, and the same box for the paragraph above --
77
+ `test_the_panes_measure_the_same_width_when_shown` holds that, and a
78
+ different gutter here would silently rewrap every row the live
79
+ transcript wrote while this one was up. Accent border, same reason:
80
+ this is not the conversation you are having. */
81
+ #call-view {
82
+ height: 1fr;
83
+ border: solid $accent;
84
+ padding: 0 1;
85
+ }
86
+
87
+ #thread-crumb {
88
+ height: auto;
89
+ padding: 0 1;
90
+ /* One line, elided rather than wrapped: a trail that reflowed
91
+ would take a second row from the transcript below it. The
92
+ ellipsis is the point -- the segment you are standing on is
93
+ the last one, so the cut belongs at the far end. Moved off
94
+ the Rich Text for `#agent-panel`'s reason. */
95
+ text-wrap: nowrap;
96
+ text-overflow: ellipsis;
97
+ }
98
+
99
+ /* Batch 55, the slash-command suggestions. Directly above the prompt
100
+ because it is the last child in #main's flow and #prompt is docked out
101
+ of that flow -- so it opens UPWARDS with no layer and no offset.
102
+
103
+ `height: auto` with a `max-height` again, and the cap is arithmetic:
104
+ SUGGEST_MAX_ROWS is 8, plus two border rows is 10, which at the 24-row
105
+ floor leaves the transcript nine rows while the panel is up. The widget
106
+ budgets itself to those 8 rows, so the cap is a backstop rather than a
107
+ clip -- if it ever clips, the budget is wrong.
108
+
109
+ No `overflow-y`. A panel that scrolled would be a second thing to
110
+ navigate inside a thing being navigated. */
111
+ #slash-suggest {
112
+ height: auto;
113
+ max-height: 10;
114
+ border: solid $primary;
115
+ padding: 0 1;
116
+ /* The count, `4 of 26 - /help for all`. Muted for #prompt's reason:
117
+ it is a hint about the list, not a heading over it. */
118
+ border-title-color: $text-muted;
119
+ /* Batch 62's key hints, on the bottom border. STATED, and measured
120
+ rather than assumed: an unstyled subtitle renders in $primary --
121
+ the border's own green -- so without this the hint would be
122
+ brighter than the count above it on the same box, and the less
123
+ important of the two labels would be the louder one. No
124
+ `border-subtitle-align`: textual already defaults a subtitle to
125
+ the right, which is the corner #prompt's meter uses one box
126
+ down, so titles sit left and status sits right throughout. */
127
+ border-subtitle-color: $text-muted;
128
+ /* `render()` pads every row to the panel width itself, and the
129
+ pin on that arithmetic is a test that no drawn row is wider
130
+ than the panel. This is the net under it, moved off the Rich
131
+ Text for `#agent-panel`'s reason: a row that ever does
132
+ overrun clips visibly instead of reflowing into a height the
133
+ budget did not count. */
134
+ text-wrap: nowrap;
135
+ text-overflow: clip;
136
+ }
137
+
138
+ /* Batch 54. `height: auto` with a `max-height` -- batch 49's shape, for
139
+ batch 49's reason. A definite height would reserve four rows whether or
140
+ not anything is typed, and this box's whole point is that it is one row
141
+ until it isn't; auto also means the transcript gets those rows back the
142
+ moment a turn is submitted. The cap is what stops a pasted essay from
143
+ eating the transcript: 6 is the border plus four text rows, so a fully
144
+ extended prompt still leaves 18 of the 24-row floor above it, and past
145
+ four rows the box scrolls instead of growing.
146
+
147
+ `padding: 0 1` is stated rather than inherited. TextArea's own default
148
+ is `0 1` and the Input this replaced was `0 2`; naming it is what keeps
149
+ the typed text's left edge where a reader already has it. */
150
+ #prompt {
151
+ dock: bottom;
152
+ border: solid $primary;
153
+ height: auto;
154
+ max-height: 6;
155
+ padding: 0 1;
156
+ /* The placeholder, carried by the border title rather than TextArea's
157
+ native in-box one (assigning both drew it twice). Muted
158
+ is already this sheet's vocabulary for a hint (#usage-line,
159
+ #todo-panel, #research-progress), so it reads as one rather than
160
+ as a heading. */
161
+ border-title-color: $text-muted;
162
+ }
163
+
164
+ #raven {
165
+ height: 5;
166
+ color: $accent;
167
+ content-align: center middle;
168
+ }
169
+
170
+ /* §40. Hidden unless a shipped protection is off; auto height so it
171
+ costs nothing in the shipped posture. $error because the one thing it
172
+ must not read as is decoration. */
173
+ #posture-badge {
174
+ height: auto;
175
+ color: $error;
176
+ text-style: bold;
177
+ padding: 1 0 0 0;
178
+ }
179
+
180
+ /* Batch 59's agent stack. Auto height and hidden until there is an active
181
+ agent or a running spawn, so it costs no rows in the ordinary case --
182
+ the same shape #posture-badge and #usage-line already use. No colours
183
+ here: the panel renders through Rich styles resolved per draw
184
+ (role_styles), which is what makes /theme reach it. */
185
+ #agent-panel {
186
+ height: auto;
187
+ padding-top: 1;
188
+ /* The rows are sized by the widget (AgentPanel.WIDTH lays out
189
+ against 18) and must not be re-wrapped underneath it: a
190
+ miscalculation should clip where it can be seen rather than
191
+ reflow where it cannot. This used to be `no_wrap` /
192
+ `overflow` on the Rich Text itself, which stopped meaning
193
+ anything when the textual pin moved -- a Content carries
194
+ neither flag and the conversion drops both. See
195
+ `widgets.as_content`. */
196
+ text-wrap: nowrap;
197
+ text-overflow: clip;
198
+ }
199
+
200
+ /* ROADMAP_v3 §49 (SS14). The same box as #agent-panel above, because it is
201
+ the same kind of widget in the same twenty columns: rows sized by the
202
+ widget (SessionPanel.WIDTH, which is AgentPanel.WIDTH) and clipped rather
203
+ than reflowed, for that block's reason. */
204
+ #session-panel {
205
+ height: auto;
206
+ padding-top: 1;
207
+ text-wrap: nowrap;
208
+ text-overflow: clip;
209
+ }
210
+
211
+ #effort-raven {
212
+ height: 2;
213
+ color: $secondary;
214
+ content-align: center middle;
215
+ }
216
+
217
+ /* #4 session usage line. Auto height and hidden until the first turn
218
+ gives it figures, like the research panel above. */
219
+ #usage-line {
220
+ height: auto;
221
+ padding-top: 1;
222
+ color: $text-muted;
223
+ }
224
+
225
+ /* ROADMAP_v3 §53 network meters, directly under the usage line it reads
226
+ with. Hidden while every meter is off. */
227
+ #network-line {
228
+ height: auto;
229
+ color: $text-muted;
230
+ }
231
+
232
+ /* §22 live research view. Auto height so it takes no sidebar space until
233
+ a run starts.
234
+
235
+ THE CAP AND THE OVERFLOW ARE GONE (batch 59), and they were EP3's trap
236
+ a second time. `Static` + `max-height` + `overflow-y: auto` reads as
237
+ "clip it and let them scroll" and does neither: a Static's
238
+ `virtual_size` follows its clamped box rather than its text, so
239
+ `max_scroll_y` was 0 and the rows past the bound were not below the
240
+ fold, they were gone. Measured here at one lost row with twenty passes
241
+ and twelve claims; measured in tui/screens.py at nine lines in a
242
+ seven-row block, which is the ScrollBox that fixed it there.
243
+
244
+ The fix is the same shape: the bound belongs on a real scroll
245
+ container, and #sidebar is now one. What still bounds this panel is
246
+ ResearchProgress.ROWS -- a window over the passes, which is the half of
247
+ that comment that was always true. */
248
+ #research-progress {
249
+ height: auto;
250
+ padding-top: 1;
251
+ color: $text-muted;
252
+ }
253
+
254
+ PermissionScreen {
255
+ align: center middle;
256
+ }
257
+
258
+ /* Every modal screen gets one of these (#112). Nothing checked that a
259
+ screen had both a type selector and an id block for its dialog, and
260
+ five of nine never got the first -- they measured at x=0, y=0, pinned
261
+ to the top-left corner of an 80x24 terminal. The viewport test in
262
+ tests/test_tui.py pushes every modal the app defines; until batch 179
263
+ it pushed only the ones its table listed, and SecretScreen, which came
264
+ later and missed both the row and this rule, opened every masked
265
+ prompt in the corner. */
266
+
267
+ GrantPickerScreen {
268
+ align: center middle;
269
+ }
270
+
271
+ SecretScreen {
272
+ align: center middle;
273
+ }
274
+
275
+ NoticeScreen {
276
+ align: center middle;
277
+ }
278
+
279
+ SubagentSignoffScreen {
280
+ align: center middle;
281
+ }
282
+
283
+ MemoryPickerScreen {
284
+ align: center middle;
285
+ }
286
+
287
+ ConfirmScreen {
288
+ align: center middle;
289
+ }
290
+
291
+ ProjectKindScreen {
292
+ align: center middle;
293
+ }
294
+
295
+ ReviewScreen {
296
+ align: center middle;
297
+ }
298
+
299
+ #permission-dialog {
300
+ /* A VERTICAL, not a grid (batch 49). §46 left this a two-column grid
301
+ in which every child carried `column-span: 2`, so the second column
302
+ held nothing but the Deny button -- and `grid-size` being static is
303
+ the only reason the `with-headline` class existed, to tell the
304
+ stylesheet whether the screen had composed three children or four.
305
+ A Vertical does not need telling, so the template somebody had to
306
+ keep in sync is gone rather than commented.
307
+ The `1fr` row EP1 removed is still not to come back: a fractional
308
+ row inside a `height: auto` container resolves to ZERO, and it is
309
+ what made the payload absent from every permission modal this app
310
+ had ever shown. What bounds a long payload is `max-height` on the
311
+ ScrollBox -- see #permission-params-box for why not a definite
312
+ `height`, which is what EP1 shipped and what took the buttons. */
313
+ padding: 1 2;
314
+ /* 90% with a cap, not a fixed 60 (§46, EP1). Width is what decides
315
+ how many rows the notice and the reason cost, and those rows are
316
+ what the command and the payload have to share -- at 60 the
317
+ notice alone wrapped to three. Same shape as #claims-dialog and
318
+ for the same reason (#112): align cannot centre something wider
319
+ than an 80-column terminal, so the cap has to stay under it. */
320
+ width: 90%;
321
+ max-width: 96;
322
+ height: auto;
323
+ /* 22, which is what the deleted `.with-headline` block used: the
324
+ four rows the pinned command takes are the reason that block
325
+ existed, and with one template the taller shape sets the cap.
326
+ Still inside the 24-row floor #112 pins, and `height: auto` means
327
+ a short approval is nowhere near it -- `web_search` measures 14. */
328
+ max-height: 22;
329
+ border: thick $warning;
330
+ background: $surface;
331
+ }
332
+
333
+ /* The blank row between blocks was `grid-gutter: 1 2` and a Vertical
334
+ has no gutter, so it is a margin now. It is not decoration: §46 pinned
335
+ the command OUTSIDE the payload precisely so the two read as separate
336
+ claims about the call, and flush against each other they do not. */
337
+ #permission-title {
338
+ text-style: bold;
339
+ margin-bottom: 1;
340
+ }
341
+
342
+ /* Section 47. Which run raised the question, when it was not the
343
+ conversation itself. Muted and unbold: it qualifies the title rather
344
+ than competing with it, and it sits directly under it because RA6
345
+ reads a harness fact before anything the agent wrote.
346
+
347
+ It eats the title's margin, so the pair reads as one heading rather
348
+ than as two blocks -- which is what the margin exists to separate.
349
+
350
+ ONE ID ACROSS THE THREE MODALS that can be asked from inside a run
351
+ (batch 75: the sign-off and the model's own question joined the
352
+ permission prompt). Ids are per-screen, so one rule styles all three
353
+ and there is nothing to keep in step -- the same reason
354
+ `screens.asker_label` is one function. */
355
+ #permission-asker {
356
+ color: $text-muted;
357
+ margin-top: -1;
358
+ margin-bottom: 1;
359
+ }
360
+
361
+ /* The pinned subject of the question (§46, EP1), and the split
362
+ favours it deliberately: the payload below repeats the notice, the
363
+ reason and the command itself, so rows spent here buy the one thing
364
+ nothing else on the screen shows in full. Four is what a wrapped
365
+ `docker run ... bash -c "..."` needs at this width, measured; past
366
+ that it scrolls rather than growing, so a pathological command
367
+ cannot eat the modal. Deliberately not $text-muted -- this is the
368
+ one thing on the screen the reader must actually read. */
369
+ #permission-command-box {
370
+ height: auto;
371
+ max-height: 4;
372
+ margin-bottom: 1;
373
+ }
374
+
375
+ #permission-command {
376
+ text-style: bold;
377
+ }
378
+
379
+ /* `auto` WITH a `max-height`, not a definite height (batch 49,
380
+ amending EP3). EP3 got the Static half right -- a Static given
381
+ `max-height` reports no content past the bound, so its hidden rows
382
+ are gone rather than below the fold -- and the ScrollBox half wrong.
383
+ A scrollable container asked for `height: auto` does NOT resolve to
384
+ zero; EP1's `1fr` ROW did, and the box was measured inside one. With
385
+ the row `auto`, a DEFINITE height bounds what the box draws and not
386
+ what its parent reserves, so the row kept growing with the payload
387
+ and pushed the decision bar past the dialog's own `max-height`, where
388
+ it was clipped away -- on nine of fourteen modal shapes, `shell`'s
389
+ among them. `auto` with a `max-height` reports the bound upward, and
390
+ still shrinks to a two-line payload, which a definite height never
391
+ did. Do not "restore" one:
392
+ test_a_bounded_box_reserves_its_bound_not_its_content fails. */
393
+ /* 7 rows, and NO margin below it -- the arithmetic is the point.
394
+ A dialog capped at 22 has 18 rows inside it, and the title, its
395
+ margin, the pinned command, its margin and the decision bar claim 11
396
+ of them whether or not the payload wants more. Leaving the last
397
+ blank row off buys the slack a title that wraps to two lines needs,
398
+ which is the one length here that nothing bounds.
399
+ Everything past row 7 is scrollable, and on the shell modal every
400
+ line of it also appears above. */
401
+ #permission-params-box {
402
+ height: auto;
403
+ max-height: 7;
404
+ }
405
+
406
+ #permission-params {
407
+ height: auto;
408
+ color: $text-muted;
409
+ }
410
+
411
+ /* THE DECISION BAR (batch 49). One rule for every consent surface,
412
+ because the defect it answers was one defect on nine of them: the
413
+ buttons were the LAST children of a dialog whose body could outgrow
414
+ it, so they were what fell off. In a bar they are one child, and the
415
+ bounded bodies above keep the sum inside the dialog.
416
+ Centred rather than stretched: the dialog was always centred and its
417
+ contents were not -- Allow sat flush against the left padding and a
418
+ 16-wide Deny left ~22 dead columns beside it. Filling the columns
419
+ instead would have made the permissive answer a target half the width
420
+ of the modal. `height: auto` so a bar costs exactly its buttons. */
421
+ #permission-buttons,
422
+ #grant-buttons,
423
+ #review-buttons,
424
+ #question-buttons {
425
+ height: auto;
426
+ align: center middle;
427
+ }
428
+
429
+ #permission-buttons Button,
430
+ #grant-buttons Button,
431
+ #review-buttons Button,
432
+ #question-buttons Button {
433
+ margin: 0 1;
434
+ }
435
+
436
+ /* FOCUS WITHOUT `reverse` (batch 49). Textual's Button carries
437
+ `text-style: $button-focus-text-style` when focused and this theme
438
+ resolves that to `reverse`, which inverts the LABEL and nothing else
439
+ -- so a focused green Allow drew its word as green on white and read
440
+ as a highlighted selection rather than as the keyboard's position.
441
+ Bold plus a lifted background tints the whole button instead, which
442
+ is what a person actually looks for, and it composes with all
443
+ fourteen palettes because both values come from the theme rather than
444
+ from a literal (#116). */
445
+ Button:focus {
446
+ text-style: bold;
447
+ background-tint: $foreground 25%;
448
+ }
449
+
450
+ /* The answer box lines up with the options above it (batch 49).
451
+ Textual's Input takes a `tall` border on all four sides and a Button
452
+ takes one on the top and bottom only, so at the same `x` the Input's
453
+ left edge is drawn a column in from the option buttons' -- close
454
+ enough to look like a mistake and far enough to see. Dropping the two
455
+ side edges gives both widgets the same box, rather than giving the
456
+ buttons a border they do not want. */
457
+ #question-text,
458
+ #review-note {
459
+ border-left: none;
460
+ border-right: none;
461
+ }
462
+
463
+ ThreadPickerScreen {
464
+ align: center middle;
465
+ }
466
+
467
+ /* §26 claims view. Wider than the other dialogs because claim text is
468
+ prose rather than a label, and primary-bordered rather than
469
+ warning-bordered: this one only reads, it authorises nothing. */
470
+ ClaimsScreen {
471
+ align: center middle;
472
+ }
473
+
474
+ #claims-dialog {
475
+ /* 90% with a cap, not a fixed width (#112): at 96 the dialog was
476
+ wider than an 80-column terminal, and align: center middle cannot
477
+ centre something wider than its container -- the right ~16
478
+ columns, tail of every score: line included, sat off-screen. */
479
+ width: 90%;
480
+ max-width: 96;
481
+ height: auto;
482
+ max-height: 22;
483
+ padding: 1 2;
484
+ border: thick $primary;
485
+ background: $surface;
486
+ }
487
+
488
+ #claims-title {
489
+ text-style: bold;
490
+ padding-bottom: 1;
491
+ }
492
+
493
+ /* The Static keeps the colour and the box keeps the bound (batch 49);
494
+ `max-height` on the Static itself was EP3's truncation-without-scroll,
495
+ on the one screen that exists to show every claim. */
496
+ #claims-body-box {
497
+ height: auto;
498
+ max-height: 14;
499
+ }
500
+
501
+ /* §25 research grant picker. Warning-bordered like the permission modal
502
+ rather than primary-bordered like the thread picker: both are
503
+ authorization decisions, and looking like the neutral list-of-threads
504
+ dialog would undersell what confirming here does. */
505
+ #grant-dialog {
506
+ width: 76;
507
+ height: auto;
508
+ max-height: 22;
509
+ padding: 1 2;
510
+ border: thick $warning;
511
+ background: $surface;
512
+ }
513
+
514
+ #grant-title {
515
+ text-style: bold;
516
+ }
517
+
518
+ #grant-help {
519
+ padding-bottom: 1;
520
+ color: $text-muted;
521
+ }
522
+
523
+ /* 8, not 14 (batch 49). A dialog has 18 rows inside it on the 24-row
524
+ floor, and the title, the two-sentence help, the bar and this list
525
+ have to share them -- at 14 the confirm button was off the bottom
526
+ with twenty tools offered. */
527
+ /* ROADMAP_v3 §59's memory picker shares the grant list's 8, for the same
528
+ 18 rows: a longer list scrolls inside the dialog instead of pushing
529
+ Forget and Cancel off the bottom. */
530
+ #grant-list,
531
+ #forget-list {
532
+ height: auto;
533
+ max-height: 8;
534
+ margin-bottom: 1;
535
+ }
536
+
537
+ /* Section 47's run picker, the keyboard route to what the sidebar
538
+ offers on a click. Narrower than the thread picker because its rows
539
+ are agent names and an indent rather than a uuid plus a preview,
540
+ and it takes the accent border the read-only pane takes: both say
541
+ the same thing, that what you are about to look at is not the
542
+ conversation you are having. */
543
+ #agent-picker-dialog {
544
+ width: 48;
545
+ height: auto;
546
+ max-height: 20;
547
+ padding: 1 2;
548
+ border: thick $accent;
549
+ background: $surface;
550
+ }
551
+
552
+ #agent-picker-title {
553
+ text-style: bold;
554
+ padding-bottom: 1;
555
+ }
556
+
557
+ #agent-picker-list {
558
+ height: auto;
559
+ max-height: 14;
560
+ }
561
+
562
+ /* Finished runs read muted. They open like any other row, so this is
563
+ de-emphasis rather than a warning -- and a muted hue rather than the
564
+ `dim` attribute, which is the transcript's vocabulary (test_themes
565
+ pins it to the system role) while this list is a modal, where
566
+ UNVERIFIED_COVERAGE already set the precedent that quiet names a
567
+ different state rather than a broken one. */
568
+ #agent-picker-list .finished {
569
+ color: $text-muted;
570
+ }
571
+
572
+ AgentPickerScreen {
573
+ align: center middle;
574
+ }
575
+
576
+ /* ROADMAP_v3 §49 (SS2): the kill picker. Wider than the run picker
577
+ because its rows carry a command as well as a name, and a command cut
578
+ at 48 columns is exactly the "which one is this?" the picker exists to
579
+ answer. */
580
+ #session-kill-dialog {
581
+ width: 72;
582
+ height: auto;
583
+ max-height: 20;
584
+ padding: 1 2;
585
+ border: thick $accent;
586
+ background: $surface;
587
+ }
588
+
589
+ #session-kill-title {
590
+ text-style: bold;
591
+ padding-bottom: 1;
592
+ }
593
+
594
+ #session-kill-list {
595
+ height: auto;
596
+ max-height: 14;
597
+ }
598
+
599
+ SessionKillScreen {
600
+ align: center middle;
601
+ }
602
+
603
+ #thread-dialog {
604
+ width: 70;
605
+ height: auto;
606
+ max-height: 24;
607
+ padding: 1 2;
608
+ border: thick $primary;
609
+ background: $surface;
610
+ }
611
+
612
+ #thread-title {
613
+ text-style: bold;
614
+ padding-bottom: 1;
615
+ }
616
+
617
+ #thread-list {
618
+ height: auto;
619
+ max-height: 18;
620
+ }
621
+
622
+ /* §23 slice 2's question modal. Borrows the grant dialog's proportions --
623
+ both are "read this, then choose" rather than "allow or deny" -- but
624
+ takes the primary border rather than the warning one: this authorises
625
+ nothing, it answers something. */
626
+ QuestionScreen {
627
+ align: center middle;
628
+ }
629
+
630
+ #question-dialog {
631
+ width: 66;
632
+ height: auto;
633
+ /* The body is the MODEL's question -- the one length the app does
634
+ not choose (#112). Without a max-height a long question pushed the
635
+ dialog to 45 rows on a 24-row terminal, title off the top and the
636
+ defer button off the bottom. */
637
+ max-height: 22;
638
+ padding: 1 2;
639
+ border: thick $primary;
640
+ background: $surface;
641
+ }
642
+
643
+ #question-title {
644
+ text-style: bold;
645
+ width: 100%;
646
+ }
647
+
648
+ #question-body-box {
649
+ height: auto;
650
+ max-height: 4;
651
+ padding: 1 0;
652
+ width: 100%;
653
+ }
654
+
655
+ #question-body {
656
+ height: auto;
657
+ width: 100%;
658
+ }
659
+
660
+ /* The single-select options. Bounded like the SelectionList the
661
+ multi-select branch uses, and for the same reason -- four options of
662
+ two lines each is 16 rows, and the dialog has 18. */
663
+ #question-options {
664
+ height: auto;
665
+ max-height: 6;
666
+ width: 100%;
667
+ margin-bottom: 1;
668
+ }
669
+
670
+ /* FIXED WIDTH, and it is what stops the truncation (batch 49). At
671
+ Button's default `width: auto` an option is as wide as its label
672
+ unwrapped -- measured at 119 columns inside a 60-column dialog, so a
673
+ long option was CUT at the dialog edge, and three options of
674
+ different lengths gave three different right edges. At `width: 100%`
675
+ the same label WRAPS to two centred lines and every option is the
676
+ same size. Nothing is truncated anywhere: ask_user refuses an option
677
+ too long to render rather than shortening it. */
678
+ #question-options Button {
679
+ width: 100%;
680
+ }
681
+
682
+ #question-help {
683
+ color: $text-muted;
684
+ padding-bottom: 1;
685
+ width: 100%;
686
+ }
687
+
688
+ #question-list {
689
+ height: auto;
690
+ max-height: 6;
691
+ margin-bottom: 1;
692
+ }
693
+
694
+ /* The sign-off's list is capped like the grant list it is modelled on:
695
+ its length is the subagent's gated tool set, and uncapped it pushed
696
+ the decision buttons off-screen (#112). Capped at 14 it still did --
697
+ #112 bounded the list and nothing bounded the SUM, which is the
698
+ defect batch 49 answers. */
699
+ #signoff-list {
700
+ height: auto;
701
+ max-height: 8;
702
+ margin-bottom: 1;
703
+ }
704
+
705
+ /* §20's review consent surface (#112). It had NO rules at all -- full
706
+ screen, top-left, unbordered -- and its body carries reason and
707
+ proposed straight from the reviewer model, so an uncapped body pushed
708
+ the four decision buttons below the fold. Warning-bordered like
709
+ permission/grant rather than primary like claims/question: this one
710
+ AUTHORISES AN EDIT to a finished research run. */
711
+ #review-dialog {
712
+ width: 76;
713
+ height: auto;
714
+ max-height: 22;
715
+ padding: 1 2;
716
+ border: thick $warning;
717
+ background: $surface;
718
+ }
719
+
720
+ #review-title {
721
+ text-style: bold;
722
+ }
723
+
724
+ #review-body-box {
725
+ height: auto;
726
+ max-height: 8;
727
+ }
728
+
729
+ #review-body {
730
+ height: auto;
731
+ }
732
+
733
+ /* §38's collapsed thinking line. `height: auto` and hidden until a span
734
+ starts, so it costs no rows when tui.show_thinking is on -- the same
735
+ arrangement the checklist below uses for its unfilled slots. */
736
+ #thinking-indicator {
737
+ height: auto;
738
+ padding: 0 1;
739
+ }
740
+
741
+ /* §23 slice 2's checklist. `height: auto` so an empty list costs no rows in
742
+ whichever slot tui.todo_position put it in -- the widget hides itself, and
743
+ this is what makes the unused slots free.
744
+
745
+ No `max-height`, no `overflow-y`: see #research-progress for why that
746
+ pairing on a Static clips rather than scrolls (batch 59, EP3's trap).
747
+ TodoPanel.ROWS is the bound. This panel also sits in the `top` and
748
+ `bottom` slots inside #main, where nothing scrolls at all -- one more
749
+ reason its own height must be honest rather than clamped. */
750
+ #todo-panel {
751
+ height: auto;
752
+ padding: 0 1;
753
+ color: $text-muted;
754
+ }