Skip to content

Commit e0e7068

Browse files
committed
docs: align tui slash command specs
1 parent 39398c3 commit e0e7068

10 files changed

Lines changed: 322 additions & 65 deletions

specs/L2/goal/L2-DES-GOAL-001-ralph-loop-goals.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ active_baseline: no
66
supersedes:
77
superseded_by:
88
owner: Assistant
9-
last_updated: 2026-05-23
9+
last_updated: 2026-05-25
1010
---
1111

1212
# L2-DES-GOAL-001 — Ralph Loop Goals
1313

1414
## Purpose
1515

16-
Refine the Ralph Loop goal requirement into a durable, bounded, autonomous goal loop that can be controlled by the user, observed by clients, resumed after restart, and executed by the server without polluting the visible transcript with hidden continuation prompts.
16+
Refine the Ralph Loop goal requirement into a durable, optionally bounded, autonomous goal loop that can be controlled by the user, observed by clients, resumed after restart, and executed by the server without polluting the visible transcript with hidden continuation prompts.
1717

1818
## Background / Context
1919

20-
A normal chat turn is request-response: the user submits input, the program works, and the turn stops. A Ralph Loop goal changes that interaction model. The user sets a durable objective once, and the program continues across turns while the goal is active, verified incomplete, unpaused, and within budget.
20+
A normal chat turn is request-response: the user submits input, the program works, and the turn stops. A Ralph Loop goal changes that interaction model. The user sets a durable objective once, and the program continues across turns while the goal is active, verified incomplete, unpaused, and within any configured budget or stop policy.
2121

2222
The goal feature must remain user-owned. The model may work toward the objective and report completion or blockers, but it must not silently rewrite the objective, expand the budget, or hide why the loop is continuing.
2323

@@ -48,11 +48,11 @@ Historical goal records remain auditable. A new goal may replace a prior non-ter
4848

4949
The goal loop should:
5050

51-
- Persist the objective, status, budget, usage, progress, and blocker state.
51+
- Persist the objective, status, optional budget, usage, progress, and blocker state.
5252
- Inject hidden goal context into model invocations while the goal is active.
5353
- Start autonomous continuation turns only when the session is idle and policy permits.
5454
- Account token and time usage incrementally.
55-
- Stop automatically when complete, blocked, paused, canceled, or budget-limited.
55+
- Stop automatically when complete, blocked, paused, canceled, or limited by a configured budget or stop policy.
5656
- Explain to the user why work continues or why it stopped.
5757

5858
## State Model
@@ -103,7 +103,7 @@ canceled
103103

104104
## User Sovereignty
105105

106-
The user owns objective text, explicit budget, pause/resume, cancellation, clear, and replacement.
106+
The user owns objective text, explicit optional budget, pause/resume, cancellation, clear, and replacement.
107107

108108
Model-facing goal tools should be narrower than client or slash-command controls. The model may report:
109109

@@ -209,6 +209,8 @@ Runtime state may be lost on restart. Recovery reconstructs durable goal state f
209209

210210
Budget accounting should happen incrementally rather than only at turn end.
211211

212+
The first milestone does not assign a default token, time, or turn budget when the user creates a goal through `/goal <objective>`. When no explicit budget is configured, accounting still records usage for display, recovery, and future limits, but absence of a budget must not by itself transition the goal to `budget_limited`.
213+
212214
Accounting points:
213215

214216
- Turn start: capture baselines.
@@ -226,7 +228,7 @@ goal_token_delta = non_cached_input_tokens + output_tokens
226228

227229
Cached input tokens are excluded because they represent reused context rather than newly consumed context cost for the current goal. If a provider reports reasoning tokens separately, the model usage normalization layer must state whether they are already included in `output_tokens`. Goal accounting must not double-count reasoning tokens.
228230

229-
Budget transitions should be atomic at the projection layer. A successful accounting operation should increment usage and switch `active` to `budget_limited` in one logical operation when the limit is reached.
231+
Budget transitions should be atomic at the projection layer. A successful accounting operation should increment usage and switch `active` to `budget_limited` in one logical operation when a configured limit is reached.
230232

231233
## Continuation Loop
232234

@@ -277,7 +279,8 @@ Conceptual hidden context:
277279
<goal_context>
278280
<status>active</status>
279281
<untrusted_objective>...</untrusted_objective>
280-
<budget tokens_used="12500" token_budget="50000" tokens_remaining="37500" />
282+
<usage tokens_used="12500" turns_used="4" />
283+
<budget configured="false" />
281284
<progress>...</progress>
282285
<instructions>
283286
Continue working toward the active session goal.
@@ -291,6 +294,7 @@ Rules:
291294

292295
- User-provided objective text must be XML-escaped.
293296
- User-provided objective text should be placed inside an explicitly untrusted tag such as `untrusted_objective`.
297+
- If no budget is configured, hidden goal context should state that no explicit budget is configured or omit limit fields; it must not fabricate a default budget.
294298
- Hidden goal context must not render as an ordinary transcript turn.
295299
- The context snapshot must be auditable through JSONL records or context snapshot references.
296300
- The hidden context may be serialized with provider-specific roles during request construction, but that serialization does not make it a transcript item.
@@ -361,8 +365,8 @@ The `/goal` slash command is the primary TUI entry point for goal control.
361365

362366
The TUI should support:
363367

364-
- Opening a current-goal panel with objective, status, progress, blockers, verification, and budget.
365-
- Creating a goal when none exists.
368+
- Opening a current-goal panel with objective, status, progress, blockers, verification, and budget where available.
369+
- Creating a goal directly from `/goal <objective>` when none exists, with no default budget prompt.
366370
- Explicitly replacing an existing non-terminal goal after confirmation.
367371
- Pausing and resuming goal continuation.
368372
- Canceling, clearing, or user-marking completion.
@@ -393,6 +397,7 @@ After restart, the server must not blindly continue just because the last durabl
393397
- Autonomous continuation uses the normal execution engine and produces normal turn records.
394398
- Hidden goal context is auditable but not rendered as a user transcript turn.
395399
- Budget accounting must not double-count cached input or separately reported reasoning tokens.
400+
- A goal created without an explicit budget has no default token, time, or turn budget.
396401
- Every subscribed client receives canonical goal updates when any client or model-facing tool changes the goal.
397402

398403
## Traceability
@@ -419,3 +424,5 @@ After restart, the server must not blindly continue just because the last durabl
419424
| Revision | Date | Author | Change Type | Notes |
420425
|---:|---|---|---|---|
421426
| 1 | 2026-05-23 | Assistant | Initial | Initial Ralph Loop goal architecture with JSONL source of truth, optional SQLite projection, bounded continuation loop, budget accounting, model-tool limits, and `/goal` integration. |
427+
| 1 | 2026-05-25 | Human | Refinement | Set first-milestone `/goal <objective>` creation to default to no explicit budget. |
428+
| 1 | 2026-05-25 | Assistant | Refinement | Clarified that budget fields are optional, usage accounting still occurs without a configured budget, and hidden context must not fabricate a default budget. |

specs/L2/tui/L2-DES-TUI-002-modern-tui-shell-layout.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ active_baseline: no
66
supersedes:
77
superseded_by:
88
owner: Assistant
9-
last_updated: 2026-05-23
9+
last_updated: 2026-05-25
1010
---
1111

1212
# L2-DES-TUI-002 — Modern TUI Shell Layout
@@ -33,6 +33,7 @@ This document defines the high-level visual structure and responsive behavior. S
3333
- `L2-DES-TUI-003` defines composer and input-mode behavior.
3434
- `L2-DES-TUI-004` defines streaming transcript and state rendering.
3535
- `L2-DES-TUI-005` defines terminal lifecycle safety.
36+
- `L2-DES-TUI-006` defines the full transcript alternate-screen overlay entered by `Ctrl+T`.
3637

3738
## Design Requirement
3839

@@ -214,6 +215,7 @@ Clients may optimistically render local input, but canonical state comes from th
214215
| related-to | L2-DES-TUI-003 | 1 | specs/L2/tui/L2-DES-TUI-003-composer-and-input-modes.md | Composer and input mode behavior fills the shell's bottom regions. |
215216
| related-to | L2-DES-TUI-004 | 1 | specs/L2/tui/L2-DES-TUI-004-streaming-transcript-and-state.md | Streaming transcript cells and state indicators populate the shell. |
216217
| related-to | L2-DES-TUI-005 | 1 | specs/L2/tui/L2-DES-TUI-005-terminal-lifecycle-safety.md | Terminal lifecycle behavior constrains inline and alternate-screen shell modes. |
218+
| related-to | L2-DES-TUI-006 | 1 | specs/L2/tui/L2-DES-TUI-006-full-transcript-alternate-screen.md | Defines the alternate-screen transcript review surface entered from the inline shell. |
217219
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
218220

219221
## Revision Notes
@@ -225,3 +227,4 @@ Clients may optimistically render local input, but canonical state comes from th
225227
| 1 | 2026-05-23 | Human | Refinement | Clarified that `` is a single leading marker, not a rail repeated through the full cell. |
226228
| 1 | 2026-05-23 | Human | Refinement | Updated working indicator examples to use the spinner frame style and kept consecutive read calls on separate Explore lines. |
227229
| 1 | 2026-05-23 | Human | Refinement | Clarified that multi-line composer and user-message background bands may repeat `` on content lines, but not on padding rows. |
230+
| 1 | 2026-05-25 | Assistant | Refinement | Linked the shell layout to the `Ctrl+T` full transcript alternate-screen design. |

specs/L2/tui/L2-DES-TUI-003-composer-and-input-modes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ active_baseline: no
66
supersedes:
77
superseded_by:
88
owner: Assistant
9-
last_updated: 2026-05-23
9+
last_updated: 2026-05-25
1010
---
1111

1212
# L2-DES-TUI-003 — Composer And Input Modes
@@ -261,6 +261,7 @@ Slash-command inline rendering:
261261
- Parameters or placeholder text following the matched slash command use muted foreground color.
262262
- If the typed slash command does not match an existing command, the composer should not apply matched-command coloring.
263263
- Inline command coloring is presentational only. Command parsing and validation still happen when the user confirms or submits the command.
264+
- For `/goal`, free-form text after the command is the objective. Pressing Enter submits that objective directly to the goal command instead of opening a budget prompt or create wizard.
264265

265266
Example matched slash command with parameter hint:
266267

@@ -346,3 +347,5 @@ Rules:
346347
| 1 | 2026-05-23 | Human | Refinement | Removed `/diff` from the slash-command catalog. |
347348
| 1 | 2026-05-23 | Human | Refinement | Changed `/btw` from active-turn injection to a side conversation in an ephemeral fork. |
348349
| 1 | 2026-05-23 | Human | Refinement | Added `/goal` as the TUI entry point for Ralph Loop goals. |
350+
| 1 | 2026-05-25 | Human | Refinement | Clarified that `/goal <objective>` submits the following text as the objective without a default budget prompt. |
351+
| 1 | 2026-05-25 | Assistant | Refinement | Added composer-level handling guidance for direct `/goal` objective submission. |

specs/L2/tui/L2-DES-TUI-004-streaming-transcript-and-state.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ Rules:
299299
- The `Run` cell replaces or follows the `Running` cell when the command completes.
300300
- `Run` output is compressed by default.
301301
- The `` relationship marker connects the command title to its output summary.
302-
- Pressing `Ctrl+T` enters full-screen alternate mode for reviewing the full transcript and full output.
302+
- Pressing `Ctrl+T` enters the full-screen alternate transcript mode defined by `L2-DES-TUI-006` for reviewing the full transcript and full output.
303303
- The compressed output should show enough lines to explain the result and must indicate hidden line counts.
304304

305305
### Context And Compaction Cells
@@ -310,14 +310,14 @@ Compaction lifecycle cells must use these exact visible labels:
310310

311311
```text
312312
┃ Manual Compaction Started
313-
Automatically Compaction Started
313+
Automatic Compaction Started
314314
┃ Compaction Done
315315
```
316316

317317
Rules:
318318

319319
- `Manual Compaction Started` appears when compaction starts because the user requested it, such as through `/compact`.
320-
- `Automatically Compaction Started` appears when compaction starts because context pressure crossed the configured threshold.
320+
- `Automatic Compaction Started` appears when compaction starts because context pressure crossed the configured threshold.
321321
- `Compaction Done` appears when a compaction event completes successfully and the active context snapshot has been updated.
322322
- These cells are transcript-area status cells, not assistant messages, user messages, or model-visible context content.
323323
- Inline rendering should preserve the exact label text. Counts, token estimates, or summary inspection affordances may be available in an expanded detail view, but must not change the inline label.
@@ -414,7 +414,7 @@ The TUI should map canonical server events into visible state.
414414
| `question.requested` | Question prompt appears and bottom status shows waiting for answer. |
415415
| `background_process_updated` | Background process strip and transcript state update. |
416416
| `usage_updated` | Header/context or turn usage display updates. |
417-
| `context_updated` with compaction start | Transcript area shows `Manual Compaction Started` or `Automatically Compaction Started` based on compaction trigger source. |
417+
| `context_updated` with compaction start | Transcript area shows `Manual Compaction Started` or `Automatic Compaction Started` based on compaction trigger source. |
418418
| `context_updated` with compaction completion | Transcript area shows `Compaction Done` and context pressure display updates. |
419419
| `context_updated` without lifecycle change | Context pressure display updates. |
420420
| `error_reported` | Error cell appears with phase and recovery action. |
@@ -519,6 +519,7 @@ Rules:
519519
| related-to | L2-DES-TOOL-001 | 1 | specs/L2/tool/L2-DES-TOOL-001-built-in-tool-system.md | Tool lifecycle, command descriptions, and result summaries feed tool cells. |
520520
| related-to | L2-DES-APP-004 | 1 | specs/L2/app/L2-DES-APP-004-observability-architecture.md | Diagnostic fields provide recovery and phase display. |
521521
| related-to | L2-DES-CONTEXT-002 | 1 | specs/L2/context/L2-DES-CONTEXT-002-context-compaction.md | Compaction lifecycle records render as transcript-area status cells. |
522+
| related-to | L2-DES-TUI-006 | 1 | specs/L2/tui/L2-DES-TUI-006-full-transcript-alternate-screen.md | Defines full transcript alternate-screen projection, live-tail sync, and pager controls. |
522523
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
523524

524525
## Revision Notes
@@ -534,3 +535,4 @@ Rules:
534535
| 1 | 2026-05-23 | Human | Refinement | Clarified that multi-line user-message background bands may repeat `` on content lines while padding rows remain background-only. |
535536
| 1 | 2026-05-23 | Human | Refinement | Reconciled active work and interruption examples with the current transcript and working-indicator visual grammar. |
536537
| 1 | 2026-05-25 | Human | Refinement | Added exact transcript-area labels for manual compaction start, automatic compaction start, and compaction completion. |
538+
| 1 | 2026-05-25 | Assistant | Refinement | Linked `Ctrl+T` full transcript review to `L2-DES-TUI-006`. |

specs/L2/tui/L2-DES-TUI-005-terminal-lifecycle-safety.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ active_baseline: no
66
supersedes:
77
superseded_by:
88
owner: Assistant
9-
last_updated: 2026-05-23
9+
last_updated: 2026-05-25
1010
---
1111

1212
# L2-DES-TUI-005 — Terminal Lifecycle Safety
@@ -25,6 +25,7 @@ The TUI runs inside a user's terminal. It may change terminal modes, render live
2525
- `L1-REQ-APP-007` requires inline mode and alternate full-screen mode where appropriate.
2626
- `L1-REQ-TUI-007` requires stable layout across resize events.
2727
- `L2-DES-TUI-002` defines the TUI shell used by inline and alternate-screen modes.
28+
- `L2-DES-TUI-006` defines one concrete alternate-screen overlay entered by `Ctrl+T`.
2829

2930
## Design Requirement
3031

@@ -84,6 +85,7 @@ Rules:
8485
- Exiting alternate-screen mode must restore the normal screen and terminal modes.
8586
- The same logical shell layout should be used inside alternate-screen mode.
8687
- If alternate-screen entry fails, the TUI should fall back to inline mode or fail with an understandable message.
88+
- Overlay-style alternate-screen surfaces, including full transcript review and the resume session browser, should return control to inline rendering through a single cleanup path that leaves alternate screen and schedules a fresh inline frame.
8789

8890
## Startup Rules
8991

@@ -167,10 +169,12 @@ The message should be emitted only when useful and should not expose internal de
167169
| related-to | L1-REQ-APP-007 | 1 | specs/L1/L1-REQ-APP-007-tui.md | Inline and alternate-screen modes are high-level TUI requirements. |
168170
| related-to | L1-REQ-TUI-007 | 1 | specs/L1/L1-REQ-TUI-007-responsive-layout-readability.md | Resize handling must preserve layout and safe exit behavior. |
169171
| related-to | L2-DES-TUI-002 | 1 | specs/L2/tui/L2-DES-TUI-002-modern-tui-shell-layout.md | Defines the shell layout whose live region must be cleaned up safely. |
172+
| related-to | L2-DES-TUI-006 | 1 | specs/L2/tui/L2-DES-TUI-006-full-transcript-alternate-screen.md | Defines a concrete alternate-screen overlay and its return-to-inline lifecycle. |
170173
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
171174

172175
## Revision Notes
173176

174177
| Revision | Date | Author | Change Type | Notes |
175178
|---:|---|---|---|---|
176179
| 1 | 2026-05-23 | Assistant | Initial | Initial terminal lifecycle safety design. |
180+
| 1 | 2026-05-25 | Assistant | Refinement | Linked terminal lifecycle safety to the current full transcript overlay and resume-browser alternate-screen cleanup path. |

0 commit comments

Comments
 (0)