@ritualai/cli 0.7.9 → 0.7.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 (49) hide show
  1. package/dist/commands/init.js +74 -45
  2. package/dist/commands/init.js.map +1 -1
  3. package/dist/commands/login.js +20 -18
  4. package/dist/commands/login.js.map +1 -1
  5. package/dist/lib/identity-banner.js +2 -1
  6. package/dist/lib/identity-banner.js.map +1 -1
  7. package/dist/lib/oidc.js +19 -10
  8. package/dist/lib/oidc.js.map +1 -1
  9. package/dist/lib/welcome-banner.js +9 -12
  10. package/dist/lib/welcome-banner.js.map +1 -1
  11. package/dist/lib/workspace-flow.js +11 -5
  12. package/dist/lib/workspace-flow.js.map +1 -1
  13. package/package.json +1 -1
  14. package/skills/claude-code/ritual/references/async-polling.md +43 -9
  15. package/skills/claude-code/ritual/references/build-flow.md +695 -144
  16. package/skills/claude-code/ritual/references/cli-output-contract.md +181 -8
  17. package/skills/claude-code/ritual/references/context-pulse-flow.md +3 -3
  18. package/skills/claude-code/ritual/references/discovery-classification.md +3 -3
  19. package/skills/claude-code/ritual/references/resume-flow.md +2 -0
  20. package/skills/codex/ritual/references/async-polling.md +43 -9
  21. package/skills/codex/ritual/references/build-flow.md +695 -144
  22. package/skills/codex/ritual/references/cli-output-contract.md +181 -8
  23. package/skills/codex/ritual/references/context-pulse-flow.md +3 -3
  24. package/skills/codex/ritual/references/discovery-classification.md +3 -3
  25. package/skills/codex/ritual/references/resume-flow.md +2 -0
  26. package/skills/cursor/ritual/references/async-polling.md +43 -9
  27. package/skills/cursor/ritual/references/build-flow.md +695 -144
  28. package/skills/cursor/ritual/references/cli-output-contract.md +181 -8
  29. package/skills/cursor/ritual/references/context-pulse-flow.md +3 -3
  30. package/skills/cursor/ritual/references/discovery-classification.md +3 -3
  31. package/skills/cursor/ritual/references/resume-flow.md +2 -0
  32. package/skills/gemini/ritual/references/async-polling.md +43 -9
  33. package/skills/gemini/ritual/references/build-flow.md +695 -144
  34. package/skills/gemini/ritual/references/cli-output-contract.md +181 -8
  35. package/skills/gemini/ritual/references/context-pulse-flow.md +3 -3
  36. package/skills/gemini/ritual/references/discovery-classification.md +3 -3
  37. package/skills/gemini/ritual/references/resume-flow.md +2 -0
  38. package/skills/kiro/ritual/references/async-polling.md +43 -9
  39. package/skills/kiro/ritual/references/build-flow.md +695 -144
  40. package/skills/kiro/ritual/references/cli-output-contract.md +181 -8
  41. package/skills/kiro/ritual/references/context-pulse-flow.md +3 -3
  42. package/skills/kiro/ritual/references/discovery-classification.md +3 -3
  43. package/skills/kiro/ritual/references/resume-flow.md +2 -0
  44. package/skills/vscode/ritual/references/async-polling.md +43 -9
  45. package/skills/vscode/ritual/references/build-flow.md +695 -144
  46. package/skills/vscode/ritual/references/cli-output-contract.md +181 -8
  47. package/skills/vscode/ritual/references/context-pulse-flow.md +3 -3
  48. package/skills/vscode/ritual/references/discovery-classification.md +3 -3
  49. package/skills/vscode/ritual/references/resume-flow.md +2 -0
@@ -63,6 +63,176 @@ Do not ask for confirmation after safe defaults. State the default and give a li
63
63
 
64
64
  **Internal step labels:** Do not expose decimal workflow labels like `Step 1.5`, `Step 7.4.5`, or MCP/tool-step names in user-facing prompts. They are for the skill, not the CLI. Use natural phase language instead: `checking existing explorations`, `choosing a template`, `code recon`, `question picking`, `build brief`, `admin review`, `implementation`, or `sync`. Step numbers are acceptable only in compact progress headings when they help orient the user; avoid them in choice prompts, error messages, and user-facing examples inside this skill.
65
65
 
66
+ **Pulse tier labels:** Do not expose raw context-pulse tier identifiers (`RAW_ASK`, `UNDER_SPECIFIED`, `EXPLORED`, `READY`, etc.) in user-facing copy. They are scoring-engine internals, not CLI vocabulary. Translate every appearance into natural-language framing keyed to the phase:
67
+
68
+ | Raw tier | User-facing phrasing |
69
+ |---|---|
70
+ | `RAW_ASK` | `initial ask + code recon` or `scope not locked yet` |
71
+ | `UNDER_SPECIFIED` | `still under-specified` or `discovery in progress` |
72
+ | `EXPLORED` | `explored — recommendations under review` |
73
+ | `READY` | `ready for build brief` |
74
+
75
+ Use the parenthetical form when the surrounding sentence is the readiness/debt summary, for example: `Pulse: Reasoning Readiness ~35% · Context Debt 65% (scope not locked yet)`. The standalone form is acceptable in headings or status badges, e.g. `Phase: code recon`.
76
+
77
+ **Surface-aware continuation prompts:** Do NOT tell users to "Press Enter" inside `/ritual build` or `/ritual resume` when running in an agent chat surface (Claude Code, Cursor, Codex, etc.). Chat agents cannot reliably observe empty input — pressing Enter typically inserts a newline or sends nothing visible, and the agent has no callback for "user pressed Enter and didn't type anything." Telling the user to do that creates a stuck-flow trap.
78
+
79
+ | Surface | Continuation contract |
80
+ |---|---|
81
+ | **Agent chat** (`/ritual build`, `/ritual resume`, anywhere this SKILL drives the conversation) | Use an explicit reply token. The token IS the visible CTA. Empty input is NOT a valid proceed signal. |
82
+ | **Real interactive CLI** (`ritual init`, `ritual login`, `ritual whoami`, etc. — code calling `prompt(...)` against a real TTY) | `Press Enter` is fine; the CLI is actually reading stdin and an empty line is a meaningful signal. |
83
+
84
+ **Visible reply tokens per phase** (single visible CTA each — accept aliases internally but don't list them all):
85
+
86
+ | Phase | Visible token | Accepted aliases (internal) |
87
+ |---|---|---|
88
+ | Generate / proceed | `go` | `g`, `generate`, `continue`, `skip`, `none`, `next` |
89
+ | Accept the problem frame | `use` | `lock`, `l`, `go`, `continue`, `next` |
90
+ | Run discovery → recommendations | `run` | `r`, `go`, `continue`, `next` |
91
+ | Stop mid-flow | `pause` | `stop`, `cancel`, `exit` |
92
+
93
+ Why one visible token (not three): the user is in a decision moment, scanning. `Reply use to accept` is cleaner than `Press Enter or type lock or l or go or continue to accept`. Aliases are kindness; the displayed CTA is clarity.
94
+
95
+ **Why we demoted `lock`:** "lock" sounds final/irrevocable for a problem frame that is, in practice, very much iterable. `use` carries the right tone ("use this frame and continue"). Keep `lock` as a backwards-compat alias for users who learned the older copy; just don't display it.
96
+
97
+ **Vertical spacing — readable density:** User-facing messages get cramped fast when sections run together. The agent must render top-level user-facing messages with the following blank-line discipline so the eye can scan in glances:
98
+
99
+ | Between | Blank line? |
100
+ |---|---|
101
+ | Rail header → section title | ✅ one |
102
+ | Section title → body paragraph | ✅ one |
103
+ | Body paragraph → bullet list | ✅ one |
104
+ | Labeled section → next labeled section (`Repo signals:` → `Constraint:`) | ✅ one |
105
+ | Labeled section → its own bullets | ❌ none (label belongs ON TOP of its bullets) |
106
+ | Bullet → next bullet in the same list | ❌ none |
107
+ | Body content → pulse line | ✅ one |
108
+ | Pulse line → `Next:` block | ✅ one |
109
+ | Sub-view divider (e.g. landing → first per-matter view in the same message) | ✅ one + `────...` rule + ✅ one |
110
+
111
+ When in doubt, prefer one blank line over none. The cost of a tiny gap is unnoticeable; the cost of dense crammed prose is real reader friction. Do NOT insert two blank lines in a row — that creates dead space and breaks visual rhythm.
112
+
113
+ **Build progress anchor — load-bearing (never omit, render per surface):** Every TOP-LEVEL user-facing message in `/ritual build` and `/ritual resume` MUST begin with a progress anchor before any other content. The anchor is the user's only "where am I in the flow" signal; dropping it silently is worse than printing it redundantly. The agent was historically inferring the rail from examples and squeezing it out under any pressure — this rule makes it explicit, with the exact rendering chosen per surface so the anchor doesn't wrap badly on narrow chat or duplicate a persistent UI stepper.
114
+
115
+ **Surface-aware rendering** — the canonical six stages stay constant; only the visual changes:
116
+
117
+ | Surface | Rendering | When to use |
118
+ |---|---|---|
119
+ | **CLI / terminal** (current default) | Full two-line rail. `Ritual build` on line 1, `✓ Context ● Scope ○ Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)` on line 2. | Terminal scrollback has no persistent UI — the rail IS the anchor. |
120
+ | **Mobile chat / narrow chat** | Compact one-line chip. `Ritual build · 2/6 Scope`. Optionally add a second line: `Done: Context · Next: Discovery`. | Six-stage rail wraps and looks noisy inside chat bubbles. |
121
+ | **Rich app with persistent stepper** | Single-line stage label. `Scope` (or `Phase: Scope`). The app's pinned stepper above the conversation is the primary anchor; messages just need the current label. At phase transitions, resume points, and major decision gates, include the compact mobile-style chip even in rich-app surface for transcript portability. | The persistent UI carries the anchor; redundant chrome in every bubble is noise. |
122
+
123
+ **How the agent picks the surface:**
124
+
125
+ - Default to **CLI / terminal** rendering. This SKILL exists primarily to drive CLI surfaces (Claude Code, Cursor, Codex, etc. in their built-in terminals).
126
+ - If the host signals a non-terminal surface via context (mobile-app chat embedding, web-app chat UI, etc.), drop to the compact chip.
127
+ - The rule is: **progress anchor is mandatory; exact visual rendering is surface-specific.** Do NOT force the full six-stage rail when it will wrap.
128
+
129
+ **Applies to:**
130
+
131
+ - phase starts (a new stage opens)
132
+ - decision gates (the user is about to choose)
133
+ - recon summaries
134
+ - generated scope / question / recommendation / brief summaries
135
+ - resume handoff points
136
+ - completion states
137
+ - any user-facing pause prompt that closes a phase
138
+
139
+ **Does NOT apply to:**
140
+
141
+ - short polling keepalives (`Still generating…`)
142
+ - one-line follow-up acknowledgements inside the same phase (`Got it.` / `Saved.`)
143
+ - direct answers to user clarifying questions inside an ongoing exchange
144
+ - **sub-views inside a phase that iterate** (per-matter pickers in Discovery, per-recommendation reviews in Recommendations, per-answer iterations, etc.) — render the full rail once at the phase landing, then use a lightweight **in-phase chip** on subsequent sub-views
145
+
146
+ Soft rule of thumb: if the message is a top-level "here's where you are + what to do next," emit the rail. If it's a within-turn ack, a status heartbeat, or the next iteration of a sub-view the user is already cycling through, use the in-phase chip (or nothing) instead.
147
+
148
+ **In-phase chip** (for iterating sub-views inside a phase that has already shown the full rail):
149
+
150
+ ```text
151
+ Discovery — area 2 of 4: {matter.name}
152
+ ```
153
+
154
+ Or for per-recommendation review in Step 9:
155
+
156
+ ```text
157
+ Recommendations — 3 of 7: {recommendation title}
158
+ ```
159
+
160
+ The chip's job is "you're still in this phase, this is which item of the series" — orientation without the full chrome.
161
+
162
+ **Canonical stage table (single source of truth):**
163
+
164
+ | Stage | Active during… |
165
+ |--------------------|--------------------------------------------------------------------------------|
166
+ | `Context` | Workspace selection, resume/start check, template, knowledge sources, code recon |
167
+ | `Scope` | Problem frame + sub-problem generation/selection, until scope is locked |
168
+ | `Discovery` | Exploration creation, discovery questions, answers, question picking, answer review |
169
+ | `Recommendations` | Recommendation generation, review, admin/collaborator acceptance path |
170
+ | `Build brief` | Requirements + build brief generation/review |
171
+ | `Implementation (Your agent)` | Coding, branch/PR work, `sync_implementation` |
172
+
173
+ Note that the FIRST rail stage is `Context`, not `Recon`. `Context` is broader — workspace pick, resume check, template choice, knowledge sources, AND code recon all live there. Use `Code recon` as the SECTION title inside the stage when the active work is repo inspection (see `references/build-flow.md` § Step 3 examples), not as the rail label. There's also a naming hazard: `/ritual recon` was retired as a command surface, so reusing `Recon` at the rail level could imply it's a separate command.
174
+
175
+ **Canonical ordering (only the active marker moves):**
176
+
177
+ ```
178
+ Context → Scope → Discovery → Recommendations → Build brief → Implementation (Your agent)
179
+ ```
180
+
181
+ - Completed stages: `✓`
182
+ - Current stage: `●`
183
+ - Future stages: `○`
184
+
185
+ **Build rail spec (`progressHeader(stage)`) — CLI / terminal rendering:**
186
+
187
+ ```text
188
+ progressHeader("context") =>
189
+ Ritual build
190
+ ● Context ○ Scope ○ Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
191
+
192
+ progressHeader("scope") =>
193
+ Ritual build
194
+ ✓ Context ● Scope ○ Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
195
+
196
+ progressHeader("discovery") =>
197
+ Ritual build
198
+ ✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
199
+
200
+ progressHeader("recommendations") =>
201
+ Ritual build
202
+ ✓ Context ✓ Scope ✓ Discovery ● Recommendations ○ Build brief ○ Implementation (Your agent)
203
+
204
+ progressHeader("build-brief") =>
205
+ Ritual build
206
+ ✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ● Build brief ○ Implementation (Your agent)
207
+
208
+ progressHeader("implementation") =>
209
+ Ritual build
210
+ ✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ● Implementation (Your agent)
211
+ ```
212
+
213
+ **Compact chip spec — mobile chat / narrow chat:**
214
+
215
+ ```text
216
+ compactChip("context") => Ritual build · 1/6 Context
217
+ compactChip("scope") => Ritual build · 2/6 Scope
218
+ compactChip("discovery") => Ritual build · 3/6 Discovery
219
+ compactChip("recommendations")=> Ritual build · 4/6 Recommendations
220
+ compactChip("build-brief") => Ritual build · 5/6 Build brief
221
+ compactChip("implementation")=> Ritual build · 6/6 Implementation (Your agent)
222
+ ```
223
+
224
+ Optional second line at phase transitions, resumes, and decision gates:
225
+
226
+ ```text
227
+ Done: Context · Next: Discovery
228
+ ```
229
+
230
+ **Rich-app spec — persistent stepper:**
231
+
232
+ The host app pins a stepper above the conversation; the message only carries the stage label as a top-line header (e.g. `Scope` or `Phase: Scope`). At phase transitions, resumes, and decision gates, include the compact chip in the body even on rich-app surface so the transcript reads cleanly when exported.
233
+
234
+ All `/ritual build` and `/ritual resume` top-level messages in `references/build-flow.md` anchor to this spec — when a stage transitions, the existing examples advance the marker per the canonical ordering. If you need to rename a stage in the future, update this table first; everything else follows.
235
+
66
236
 
67
237
  ### CLI experience cheat-sheet
68
238
 
@@ -81,7 +251,7 @@ This skill drives a CLI surface where the user reads every line you print. Keep
81
251
 
82
252
  When you need to wait for async server work (requirements generation, build brief generation), this harness has hard rules:
83
253
 
84
- - **Use a single `Bash sleep 5` per poll iteration.** The harness blocks chained sleeps (`sleep 5; sleep 5`) and any `sleep ≥ 30`.
254
+ - **Use a single `Bash sleep 5` per poll iteration. ALWAYS 5. Never escalate.** The harness blocks chained sleeps (`sleep 5; sleep 5`), any `sleep ≥ 30`, AND successive `sleep N` calls across turns at increasing N (e.g. `sleep 5` → `sleep 15` → `sleep 20` — also blocked). Don't try to "back off" by raising the sleep value when the operation is slow; the duration is a constant.
85
255
  - **Between polls, take a fresh turn.** The model wakes up every 5s, makes a status call, decides whether to continue or exit. The user sees progress every 5 seconds; total wall time is the same.
86
256
  - **Update the user every ~3 polls (~15s)** with a one-line "still generating…" — don't go silent for a minute.
87
257
  - **For genuinely long waits (>5 min)**, use the harness's `Monitor` tool with an `until <check>; do sleep 2; done` pattern rather than the standard poll loop.
@@ -94,11 +264,14 @@ After **Steps 3, 5, 7.4, 8, 9, and 10**, emit a one-line **context pulse** showi
94
264
 
95
265
  The pulse rule and visual specs live in the [§ /ritual context-pulse](#ritual-context-pulse) section below — see *Step CP5 — visual modes*. TL;DR:
96
266
 
97
- - **Compact (single line)** is the default: `Pulse: 72% readiness · 28% debt · +24% (decision resolution)`
267
+ - **Compact (single line)** is the default. Use the full capitalized labels — `Reasoning Readiness` and `Context Debt` NOT lowercase `readiness` / `debt`:
268
+ - `Pulse: Reasoning Readiness 72% · Context Debt 28% · +24% (decision resolution)`
98
269
  - **Full (with bars + Reasoning Readiness / Context Debt / Context Surface labels)** when crossing a state-tier boundary, jumping ≥15%, or regressing
99
270
  - The pulse line goes BEFORE the existing "next step" prompt for that step — it's an additive line, not a replacement
100
271
  - Prefer `mcp__ritual__score_context_pulse` (one canonical server-side call, persisted for trend reporting); fall back to deterministic agent-side counts only if the tool errors. No LLM call in the hot path either way.
101
272
 
273
+ **Why full labels (load-bearing):** Users read `28% debt` as a vague accounting number. They read `Context Debt 28%` as a named concept with weight — the same name they'd see in `/ritual context-pulse`'s full view, in the score breakdown, in the docs. Consistency across compact and full forms means the user doesn't have to translate.
274
+
102
275
  The user can also invoke `/ritual context-pulse` directly anytime mid-flow to get a full breakdown.
103
276
 
104
277
 
@@ -164,9 +337,9 @@ Before the list exists, say:
164
337
  ```text
165
338
  Next: we'll generate a list of suggested problems to pick from.
166
339
 
167
- Press Enter or type `g` to generate the list.
340
+ Reply `go` to generate the list.
168
341
  Or paste files/text/URLs to attach context first.
169
- Type `pause` to stop here.
342
+ Reply `pause` to stop here.
170
343
  ```
171
344
 
172
345
  When showing generated sub-problems, never print versioned sub-problem headings. Use:
@@ -205,11 +378,11 @@ References:
205
378
  - {RB/decision/exploration label} — {one-line meaning}
206
379
  Source: {exploration title or id}{ optional URL if available}
207
380
 
208
- Press Enter or type `lock` to use this frame and review discovery questions.
381
+ Reply `use` to use this frame and review discovery questions.
209
382
  Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboard`, or `pause`.
210
383
  ```
211
384
 
212
- Accept empty input, `lock`, `l`, `go`, `continue`, or `next` as lock/proceed.
385
+ Visible CTA is `use`. Accept `lock`, `l`, `go`, `continue`, or `next` as backwards-compat aliases (do not display them). Per § Surface-aware continuation prompts, do NOT treat empty input as proceed inside agent chat.
213
386
 
214
387
  ### Engineering run mode
215
388
 
@@ -218,8 +391,8 @@ For engineering / agentic-coding templates, do not offer answers-only review and
218
391
  ```text
219
392
  Next: run discovery through recommendations.
220
393
 
221
- Press Enter or type `run` to continue.
222
- Type `pause` to stop here.
394
+ Reply `run` to continue.
395
+ Reply `pause` to stop here.
223
396
  ```
224
397
 
225
398
  ### Shipped work visibility
@@ -123,7 +123,7 @@ Sub-steps:
123
123
  <!-- Ritual context seed — generated {ISO date} -->
124
124
  <!-- Refreshed at {ISO datetime UTC} --> <!-- updated every re-pulse; bias toward freshness -->
125
125
  <!-- Generated by /ritual context-pulse "{feature description}" -->
126
- <!-- Pulse: {readiness}% reasoning readiness / {debt}% context debt — surface: {state-tier} -->
126
+ <!-- Pulse: Reasoning Readiness {readiness}% · Context Debt {debt}% — surface: {state-tier} -->
127
127
 
128
128
  # Context: {feature description}
129
129
 
@@ -248,10 +248,10 @@ Two visual modes, picked by context. The label terminology is tiered:
248
248
  | **Context Debt** | Both modes — inverse score | The product category framing |
249
249
  | **Context surface:** | Full-pulse state-tier label | The 5-tier classification (Raw ask / Under-specified / Exploration-safe / Recommendation-ready / Implementation-ready) |
250
250
 
251
- **Compact pulse** — single line, used by default for inline mid-`/ritual build` pulses when nothing dramatic happened this step. Uses shorthand `readiness` to keep the line tight:
251
+ **Compact pulse** — single line, used by default for inline mid-`/ritual build` pulses when nothing dramatic happened this step. Uses the full capitalized labels (NOT shorthand) for consistency with the full pulse and the docs:
252
252
 
253
253
  ```
254
- Pulse: 72% readiness · 28% debt · +24% (decision resolution)
254
+ Pulse: Reasoning Readiness 72% · Context Debt 28% · +24% (decision resolution)
255
255
  ```
256
256
 
257
257
  **Full pulse** — with bars + spelled-out labels, used when:
@@ -89,7 +89,7 @@ How should I treat the unpicked areas?
89
89
  3. Emit post-choice pulse — **reuse the same dominant-theme phrase** that appeared in the analysis paragraph + Option 1's prompt, so the user sees their choice acknowledged in the exact words they read:
90
90
  ```
91
91
  ✓ Tightened the problem statement around {dominant theme — same phrase as analysis paragraph + Option 1 prompt}.
92
- Pulse: {readiness}% readiness · {debt}% debt · +{delta}% (feature clarity ↑ from narrower scope)
92
+ Pulse: Reasoning Readiness {readiness}% · Context Debt {debt}% · +{delta}% (feature clarity ↑ from narrower scope)
93
93
  ```
94
94
  Concrete example matching the django-oscar GDPR exploration: *"✓ Tightened the problem statement around data structure, storage, immutability, and retention categories."* — names what survived, not abstract *"the structural picks"*.
95
95
 
@@ -99,7 +99,7 @@ How should I treat the unpicked areas?
99
99
  3. Emit post-choice pulse — **note the second-field label is `deferred`, not `debt`**:
100
100
  ```
101
101
  ✓ {N} unpicked questions marked as phase-2 candidates.
102
- Pulse: {readiness}% readiness · {deferred}% deferred · +{delta}% (decision resolution ↑ from deliberate deferral)
102
+ Pulse: Reasoning Readiness {readiness}% · Phase-later {deferred}% · +{delta}% (decision resolution ↑ from deliberate deferral)
103
103
  ```
104
104
  The `deferred` label (instead of `debt`) is load-bearing — deliberate sequencing is NOT a liability, and the pulse line should reflect that. Same number, different character.
105
105
  4. At Step 10c (build brief generation), the deferred matters MUST appear in the brief's *"Phase Candidates / Deferrable Items"* section. The agent appends the `deferred[]` set to the `generate_build_brief` `recon_context` payload as supplementary "explicit phase-2 candidates set by the user during discovery." The main `recon_context` payload remains the `codebase_context_packet`.
@@ -110,7 +110,7 @@ How should I treat the unpicked areas?
110
110
  3. Emit post-choice pulse — uses the `debt` label:
111
111
  ```
112
112
  ✓ {N} unpicked questions marked as context debt.
113
- Pulse: {readiness}% readiness · {debt}% debt · +0% (open questions remain unresolved)
113
+ Pulse: Reasoning Readiness {readiness}% · Context Debt {debt}% · +0% (open questions remain unresolved)
114
114
  ```
115
115
  Avoid words like *"status quo"* — phrase it as a state, not a non-event.
116
116
  4. The next `/ritual context-pulse` will surface the unresolved questions as top debt sources.
@@ -4,6 +4,8 @@
4
4
 
5
5
  Output: the user lands on the right step of an existing exploration's `/ritual build` flow — no new exploration created, no fresh-start path offered.
6
6
 
7
+ **Build rail is load-bearing here too.** Every top-level user-facing message in `/ritual resume` MUST begin with the 6-stage build rail per `references/cli-output-contract.md` § Build rail — both during the picker (rail at `● Context`) and once you teleport into the chosen exploration (rail at whatever stage that exploration is in).
8
+
7
9
 
8
10
  ### When to use
9
11
 
@@ -2,18 +2,52 @@
2
2
 
3
3
  Use this for every long-running Ritual/MCP operation: discovery generation, agentic runs, requirement generation, build brief generation, and future async status surfaces.
4
4
 
5
- ## Standard poll loop
6
-
7
- - Use a single `Bash sleep 5` per poll iteration.
8
- - Do not chain sleeps (`sleep 5; sleep 5`).
9
- - Do not use `sleep >= 30`.
10
- - Between polls, take a fresh turn: sleep, call status, decide continue/exit.
11
- - Print progress only when status/progress/current_step changes, or every ~3 polls (~15s).
5
+ ## Standard poll loop — single short sleep per turn, never escalate
6
+
7
+ - **`Bash sleep 5` per poll iteration. Always 5. Never escalate.** Even if the operation has been running for minutes, the value stays `5`. The reason: the harness blocks "chained shorter sleeps" — successive `sleep N` calls across turns at increasing N (e.g. `sleep 5` → `sleep 15` → `sleep 20` → `sleep 25`) trip the same guard as `sleep 30+`. Treat the sleep duration as a constant, NOT a backoff knob.
8
+ - **One sleep per turn**, not multiple in sequence. After `sleep 5`, take a fresh turn → call the status tool → decide continue or exit.
9
+ - **`sleep 30` is hard-blocked**, regardless of context.
10
+ - **Do NOT use semicolons to chain** (`sleep 5; sleep 5`) — also blocked.
11
+ - **The user sees progress every 5 seconds, total wall time is the same.** A slow operation taking 2 minutes is 24 turns of `sleep 5` + status, not 4 turns of `sleep 30`.
12
+ - Print progress only when status/progress/current_step changes, or every ~3 polls (~15s) if unchanged.
12
13
  - Keep updates to one line unless an error occurs.
13
14
 
14
- ## Long waits
15
+ ### Wrong vs right
16
+
17
+ **Wrong** (this is what trips the harness — note each call is a separate turn, the sleep duration creeps up):
18
+
19
+ ```
20
+ Turn 1: Bash sleep 5 → status: still running
21
+ Turn 2: Bash sleep 15 → status: still running ← creeping up
22
+ Turn 3: Bash sleep 20 → status: still running ← creeping up
23
+ Turn 4: Bash sleep 25 → BLOCKED ✗ "standalone sleep 25"
24
+ ```
25
+
26
+ The harness sees the pattern and blocks. The error message literally says: *"Do not chain shorter sleeps to work around this block."*
27
+
28
+ **Right** — sleep stays at 5s every iteration; the loop ends when status reports done:
29
+
30
+ ```
31
+ Turn 1: Bash sleep 5 → status: still running
32
+ Turn 2: Bash sleep 5 → status: still running
33
+ Turn 3: Bash sleep 5 → status: still running
34
+ Turn 4: Bash sleep 5 → status: still running
35
+ ...
36
+ Turn N: Bash sleep 5 → status: COMPLETED → exit loop
37
+ ```
38
+
39
+ User-facing: print `Still generating… ({percent}% if available)` every ~3 turns (~15s) when status hasn't changed, ONE line per progress change otherwise.
40
+
41
+ ## Long waits — when polling >5 min, use Monitor + `until` loop instead
42
+
43
+ For genuinely long waits (>5 minutes), DO NOT keep the standard poll loop running for that long — switch to the harness's `Monitor` tool with an `until <check>; do sleep 2; done` pattern. The `until` loop is one Bash call that internally checks + sleeps + retries, so it doesn't trip the "chained successive sleeps across turns" guard.
44
+
45
+ ```bash
46
+ # Inside a Monitor / single Bash call — NOT chained across turns.
47
+ until [ "$(curl -s ...status... | jq -r .status)" = "COMPLETED" ]; do sleep 2; done
48
+ ```
15
49
 
16
- For genuinely long waits (>5 minutes), use the harness's `Monitor` tool with an `until <check>; do sleep 2; done` pattern rather than the standard poll loop.
50
+ Pair this with `run_in_background: true` if appropriate — start the long-running watch, get a task id back, check on it later via TaskOutput rather than blocking the conversation.
17
51
 
18
52
  ## Timeout recovery
19
53