You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/L2/goal/L2-DES-GOAL-001-ralph-loop-goals.md
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,18 @@ active_baseline: no
6
6
supersedes:
7
7
superseded_by:
8
8
owner: Assistant
9
-
last_updated: 2026-05-23
9
+
last_updated: 2026-05-25
10
10
---
11
11
12
12
# L2-DES-GOAL-001 — Ralph Loop Goals
13
13
14
14
## Purpose
15
15
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.
17
17
18
18
## Background / Context
19
19
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.
21
21
22
22
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.
23
23
@@ -48,11 +48,11 @@ Historical goal records remain auditable. A new goal may replace a prior non-ter
48
48
49
49
The goal loop should:
50
50
51
-
- Persist the objective, status, budget, usage, progress, and blocker state.
51
+
- Persist the objective, status, optional budget, usage, progress, and blocker state.
52
52
- Inject hidden goal context into model invocations while the goal is active.
53
53
- Start autonomous continuation turns only when the session is idle and policy permits.
54
54
- 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.
56
56
- Explain to the user why work continues or why it stopped.
57
57
58
58
## State Model
@@ -103,7 +103,7 @@ canceled
103
103
104
104
## User Sovereignty
105
105
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.
107
107
108
108
Model-facing goal tools should be narrower than client or slash-command controls. The model may report:
109
109
@@ -209,6 +209,8 @@ Runtime state may be lost on restart. Recovery reconstructs durable goal state f
209
209
210
210
Budget accounting should happen incrementally rather than only at turn end.
211
211
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`.
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.
228
230
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.
- User-provided objective text must be XML-escaped.
293
296
- 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.
294
298
- Hidden goal context must not render as an ordinary transcript turn.
295
299
- The context snapshot must be auditable through JSONL records or context snapshot references.
296
300
- 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.
361
365
362
366
The TUI should support:
363
367
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.
366
370
- Explicitly replacing an existing non-terminal goal after confirmation.
367
371
- Pausing and resuming goal continuation.
368
372
- Canceling, clearing, or user-marking completion.
@@ -393,6 +397,7 @@ After restart, the server must not blindly continue just because the last durabl
393
397
- Autonomous continuation uses the normal execution engine and produces normal turn records.
394
398
- Hidden goal context is auditable but not rendered as a user transcript turn.
395
399
- 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.
396
401
- Every subscribed client receives canonical goal updates when any client or model-facing tool changes the goal.
397
402
398
403
## Traceability
@@ -419,3 +424,5 @@ After restart, the server must not blindly continue just because the last durabl
419
424
| Revision | Date | Author | Change Type | Notes |
420
425
|---:|---|---|---|---|
421
426
| 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. |
| 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. |
217
219
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
218
220
219
221
## Revision Notes
@@ -225,3 +227,4 @@ Clients may optimistically render local input, but canonical state comes from th
225
227
| 1 | 2026-05-23 | Human | Refinement | Clarified that `┃` is a single leading marker, not a rail repeated through the full cell. |
226
228
| 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. |
227
229
| 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. |
- Parameters or placeholder text following the matched slash command use muted foreground color.
262
262
- If the typed slash command does not match an existing command, the composer should not apply matched-command coloring.
263
263
- 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.
264
265
265
266
Example matched slash command with parameter hint:
266
267
@@ -346,3 +347,5 @@ Rules:
346
347
| 1 | 2026-05-23 | Human | Refinement | Removed `/diff` from the slash-command catalog. |
347
348
| 1 | 2026-05-23 | Human | Refinement | Changed `/btw` from active-turn injection to a side conversation in an ephemeral fork. |
348
349
| 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. |
Copy file name to clipboardExpand all lines: specs/L2/tui/L2-DES-TUI-004-streaming-transcript-and-state.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,7 +299,7 @@ Rules:
299
299
- The `Run` cell replaces or follows the `Running` cell when the command completes.
300
300
-`Run` output is compressed by default.
301
301
- 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.
303
303
- The compressed output should show enough lines to explain the result and must indicate hidden line counts.
304
304
305
305
### Context And Compaction Cells
@@ -310,14 +310,14 @@ Compaction lifecycle cells must use these exact visible labels:
310
310
311
311
```text
312
312
┃ Manual Compaction Started
313
-
┃ Automatically Compaction Started
313
+
┃ Automatic Compaction Started
314
314
┃ Compaction Done
315
315
```
316
316
317
317
Rules:
318
318
319
319
-`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.
321
321
-`Compaction Done` appears when a compaction event completes successfully and the active context snapshot has been updated.
322
322
- These cells are transcript-area status cells, not assistant messages, user messages, or model-visible context content.
323
323
- 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.
414
414
|`question.requested`| Question prompt appears and bottom status shows waiting for answer. |
415
415
|`background_process_updated`| Background process strip and transcript state update. |
416
416
|`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. |
418
418
|`context_updated` with compaction completion | Transcript area shows `Compaction Done` and context pressure display updates. |
419
419
|`context_updated` without lifecycle change | Context pressure display updates. |
420
420
|`error_reported`| Error cell appears with phase and recovery action. |
@@ -519,6 +519,7 @@ Rules:
519
519
| 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. |
520
520
| related-to | L2-DES-APP-004 | 1 | specs/L2/app/L2-DES-APP-004-observability-architecture.md | Diagnostic fields provide recovery and phase display. |
521
521
| 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. |
522
523
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
523
524
524
525
## Revision Notes
@@ -534,3 +535,4 @@ Rules:
534
535
| 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. |
535
536
| 1 | 2026-05-23 | Human | Refinement | Reconciled active work and interruption examples with the current transcript and working-indicator visual grammar. |
536
537
| 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`. |
Copy file name to clipboardExpand all lines: specs/L2/tui/L2-DES-TUI-005-terminal-lifecycle-safety.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ active_baseline: no
6
6
supersedes:
7
7
superseded_by:
8
8
owner: Assistant
9
-
last_updated: 2026-05-23
9
+
last_updated: 2026-05-25
10
10
---
11
11
12
12
# 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
25
25
-`L1-REQ-APP-007` requires inline mode and alternate full-screen mode where appropriate.
26
26
-`L1-REQ-TUI-007` requires stable layout across resize events.
27
27
-`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`.
28
29
29
30
## Design Requirement
30
31
@@ -84,6 +85,7 @@ Rules:
84
85
- Exiting alternate-screen mode must restore the normal screen and terminal modes.
85
86
- The same logical shell layout should be used inside alternate-screen mode.
86
87
- 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.
87
89
88
90
## Startup Rules
89
91
@@ -167,10 +169,12 @@ The message should be emitted only when useful and should not expose internal de
167
169
| 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. |
168
170
| 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. |
169
171
| 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. |
170
173
| specified-by | TBD | TBD | specs/L3/tui/TBD.md | L3 behavior has not been authored yet. |
171
174
172
175
## Revision Notes
173
176
174
177
| Revision | Date | Author | Change Type | Notes |
| 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