@ritualai/cli 0.36.22 → 0.36.28

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 (39) hide show
  1. package/dist/commands/build.js +5 -0
  2. package/dist/commands/build.js.map +1 -1
  3. package/dist/commands/init.js +10 -3
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/lib/pat-store.js +106 -35
  6. package/dist/lib/pat-store.js.map +1 -1
  7. package/dist/lib/update-notice.js +26 -0
  8. package/dist/lib/update-notice.js.map +1 -0
  9. package/package.json +1 -1
  10. package/skills/claude-code/ritual/.ritual-bundle.json +3 -3
  11. package/skills/claude-code/ritual/SKILL.md +1 -1
  12. package/skills/claude-code/ritual/references/build-flow.md +24 -11
  13. package/skills/claude-code/ritual/references/cli-output-contract.md +4 -3
  14. package/skills/claude-code/ritual/references/lite-flow.md +25 -12
  15. package/skills/codex/ritual/.ritual-bundle.json +3 -3
  16. package/skills/codex/ritual/SKILL.md +1 -1
  17. package/skills/codex/ritual/references/build-flow.md +24 -11
  18. package/skills/codex/ritual/references/cli-output-contract.md +4 -3
  19. package/skills/codex/ritual/references/lite-flow.md +25 -12
  20. package/skills/cursor/ritual/.ritual-bundle.json +3 -3
  21. package/skills/cursor/ritual/SKILL.md +1 -1
  22. package/skills/cursor/ritual/references/build-flow.md +24 -11
  23. package/skills/cursor/ritual/references/cli-output-contract.md +4 -3
  24. package/skills/cursor/ritual/references/lite-flow.md +25 -12
  25. package/skills/gemini/ritual/.ritual-bundle.json +3 -3
  26. package/skills/gemini/ritual/SKILL.md +1 -1
  27. package/skills/gemini/ritual/references/build-flow.md +24 -11
  28. package/skills/gemini/ritual/references/cli-output-contract.md +4 -3
  29. package/skills/gemini/ritual/references/lite-flow.md +25 -12
  30. package/skills/kiro/ritual/.ritual-bundle.json +3 -3
  31. package/skills/kiro/ritual/SKILL.md +1 -1
  32. package/skills/kiro/ritual/references/build-flow.md +24 -11
  33. package/skills/kiro/ritual/references/cli-output-contract.md +4 -3
  34. package/skills/kiro/ritual/references/lite-flow.md +25 -12
  35. package/skills/vscode/ritual/.ritual-bundle.json +3 -3
  36. package/skills/vscode/ritual/SKILL.md +1 -1
  37. package/skills/vscode/ritual/references/build-flow.md +24 -11
  38. package/skills/vscode/ritual/references/cli-output-contract.md +4 -3
  39. package/skills/vscode/ritual/references/lite-flow.md +25 -12
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "0.36.22",
3
- "builtAt": "2026-06-15T13:28:31.790Z",
4
- "skillsHash": "8a8905aae549"
2
+ "cliVersion": "0.36.28",
3
+ "builtAt": "2026-06-15T15:33:01.454Z",
4
+ "skillsHash": "2019cd011119"
5
5
  }
@@ -3,7 +3,7 @@ name: ritual
3
3
  description: "Use when an engineer wants a coding agent to plan or build a feature, refactor, or implementation-heavy change that depends on context the agent can't infer on its own — strategic intent, constraints, prior decisions, and trade-offs that live in the user's head. Ritual runs a structured exploration to surface that context through targeted discovery questions, combines it with codebase signals and prior explorations, and delivers a validated build brief (sub-problems, recommendations, dependencies) — additional context to fold into plan mode before the agent writes code. Prefer this over jumping straight to implementation or plan mode when the problem is ambiguous, cross-cutting, or has non-obvious constraints. Subcommands: build (full planning-to-sync cycle — default for new features), resume (continue an in-flight exploration), lineage (file-path KG history — what decisions shaped this code), context-pulse (readiness and context-debt scoring — is this safe to build yet?)."
4
4
  argument-hint: "[subcommand] <args> (e.g. 'build Reduce T2 churn in Q3', 'resume', 'lineage src/checkout/views.py', 'context-pulse Add billing export')"
5
5
  user-invocable: true
6
- stamp: 8a8905aae549
6
+ stamp: 2019cd011119
7
7
  ---
8
8
 
9
9
  # /ritual
@@ -837,6 +837,8 @@ Store the final sub-problems for Step 5 — they go into `considerations[]`.
837
837
 
838
838
  #### Step 5 — Generate problem frame
839
839
 
840
+ <!-- skill-options:no-gate-change: Step 5 adds a render-only rule (do not surface follow_up_questions / an "open questions" preview / fuzzy-meta at the frame gate); the frame's pause + options + Reply line are unchanged. -->
841
+
840
842
  ##### 5.1 First draft
841
843
 
842
844
  Call `mcp__ritual__generate_problem_statement` with:
@@ -879,6 +881,7 @@ Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboa
879
881
  ```
880
882
 
881
883
  Rules:
884
+ - **Render ONLY the four blocks above** — Problem frame, Optimize for, References, and the Reply line. Nothing else. The `generate_problem_statement` response may include `follow_up_questions` and quality scores: those are for YOUR internal awareness, never for display. Do NOT add an "Open questions" / "what discovery will resolve" section, do NOT preview or list discovery questions here, and do NOT editorialize about what's "still fuzzy" or "what the next step pins down." Discovery is the next step and owns open questions; the frame is a lock-point, not a discovery preview. Surfacing them here both pre-empts Step 7 and clutters the gate.
882
885
  - Do not show the old versioned scope heading.
883
886
  - Do not show `Engineering problem:` as the heading; use `Problem frame`.
884
887
  - Do not say `ship it` unless the user used that language first.
@@ -1672,9 +1675,16 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
1672
1675
 
1673
1676
  <!-- skill-options:no-gate-change: adds a convergence note at the top of the rec-wait — both answerers (local coding agent vs Ritual server) poll get_recommendations_preview until ≥1 rec; the only difference is who produced the answers. No new pause gate or Step header; the run/pause gate + its options are unchanged. -->
1674
1677
 
1675
- **Both answerers converge here — once the run is underway, poll until recommendations exist.** The job from this point on is the SAME regardless of who produced the answers: poll `mcp__ritual__get_recommendations_preview(exploration_id)` until it returns **at least one recommendation**, then continue to Step 9. The *only* difference between the two paths is the **answerer** — the **local coding agent** (you, when repo-linked) vs **Ritual's server agentic run** — and that only changes how you reach this wait (agent-answered → straight to the rec poll; server → poll the run to `COMPLETED` first, then the recs). Never render the Step 9 landing, and never call `accept_recommendations`, from a zero-rec read.
1678
+ <!-- skill-options:no-gate-change: Step 8.1 rec-wait polls get_exploration_status.recommendationsStatus (not_started|generating|ready|empty|failed); on `failed` it offers retry_recommendations (re-enqueues rec-gen only). Render-only signal + an offered action, no pause/option/Step-header change. -->
1679
+ **Both answerers converge here — once the run is underway, poll until recommendations are READY.** The job from this point on is the SAME regardless of who produced the answers. **Poll the authoritative signal: `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus`.** It removes the guesswork that bit us before — it is unambiguous:
1680
+ - `not_started` / `generating` → **keep polling.** A zero `recommendationCount` here is NORMAL — generation is enqueued/in flight, NEVER a "miss." (Older servers may omit the field; if `recommendationsStatus` is absent, fall back to polling `get_recommendations_preview` until ≥1.)
1681
+ - `ready` → recommendations exist. Fetch them (`get_recommendations_preview`) and continue to Step 9.
1682
+ - `empty` → generation FINISHED with genuinely zero recs (rare, real terminal state). Surface it plainly — do NOT render a fake Step 9 landing, do NOT re-run.
1683
+ - `failed` → generation exhausted its auto-retries (terminal). Surface it with the one-line `recommendationsError` if present, and **offer to retry** — on a `yes`, call `mcp__ritual__retry_recommendations(exploration_id)` (re-enqueues ONLY rec-gen on the existing answers; status returns to `generating`, resume polling). Do NOT call `start_agentic_run` (that re-answers the whole exploration) and do NOT auto-retry without asking.
1684
+
1685
+ The *only* difference between the two answerer paths — **local coding agent** (you, repo-linked) vs **Ritual's server agentic run** — is how you reach this wait (agent-answered → straight to the status poll; server → poll the run to `COMPLETED` first, then the status). Never render the Step 9 landing, and never call `accept_recommendations`, from anything but `ready`.
1676
1686
 
1677
- **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_recommendations_preview(exploration_id)` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it returns **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing and never call `accept_recommendations` from a zero-rec read; if 10+ min pass with zero rows, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1687
+ **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it reads `ready`, then fetch + continue to Step 9. `generating` → keep polling; `empty` → genuine zero-rec terminal; NEVER render the Step 9 landing or call `accept_recommendations` from anything but `ready`; if 10+ min pass still `generating`, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1678
1688
 
1679
1689
  **Server fallback path** (you called `start_agentic_run`): poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 20` (constant 20 — matches Spark's 20s agentic cadence; never escalate)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays a constant 20; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`, but a fixed `20` is non-escalating and under 30 → guard-safe. Agentic runs CAN exceed 5 min for large explorations — if you see status still running past ~5 min of polling, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
1680
1690
 
@@ -1686,15 +1696,18 @@ Then print progress only when `progress_pct` or `current_step` changes, or every
1686
1696
 
1687
1697
  > Agentic run: {progress_pct}% — {current_step}
1688
1698
 
1689
- When `status` is `COMPLETED`: **wait for recommendation ROWS before Step 9.** The run reporting
1699
+ When `status` is `COMPLETED`: **wait for `recommendationsStatus: ready` before Step 9.** The run reporting
1690
1700
  `completed` does NOT mean recommendations exist yet — rec generation is a separate queued job that
1691
- lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12:
1692
- an agent rendered "0 recommendations across 0 categories" and vacuously proceeded). Poll
1693
- `mcp__ritual__get_recommendations_preview(exploration_id)` on the standard cadence (`Bash sleep 20`
1694
- per iteration, "still generating recommendations…" line every ~3 polls) until the preview returns
1695
- **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing — and
1696
- never call `accept_recommendations` — from a zero-rec read. If 10+ minutes pass with zero rows,
1697
- surface that as an anomaly instead of proceeding.
1701
+ lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12
1702
+ and 2026-06-15). Poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` on
1703
+ the standard cadence (`Bash sleep 20` per iteration, "still generating recommendations…" line every
1704
+ ~3 polls): `generating` keep polling; `ready` continue to Step 9; `empty` → genuine zero-rec
1705
+ terminal, surface it. NEVER render the Step 9 landing — and never call `accept_recommendations` —
1706
+ from anything but `ready`. If 10+ minutes pass still `generating`, surface that as an anomaly
1707
+ instead of proceeding.
1708
+
1709
+ <!-- skill-options:no-gate-change: Step 8.1 adds a load-bearing clause closing the "zero-rec = generation miss → re-run / reroute" loophole; tightens the existing wait-for-rows rule only — no pause, option, or Step header added or changed. -->
1710
+ **A zero-rec read is NEVER a "generation miss," and re-running is NOT a recovery (load-bearing).** The run reporting `completed` only means *answering* finished — recommendation synthesis is a SEPARATE async job that may still be in flight, so zero rows means **not yet**, never **failed**. Do NOT relabel it a "generation miss" / "the synthesizer came back empty" / "0 recommendations" and act on that: do NOT call `start_agentic_run` again to "regenerate" (the answers are already committed — a re-run re-answers the whole exploration from scratch, burns a full pipeline, and can double-generate), and do NOT propose "routing around" synthesis by building a plan from the raw discovery answers. Just keep polling `get_exploration_status.recommendationsStatus` until `ready` (or `empty` — the rare genuine terminal). The synthesizer is almost never the problem — being early in the async window (`generating`) is. The ONLY escalation, and only after the 10-min ceiling still `generating`, is to surface it as an anomaly and offer `/ritual status` or the web app — never an automatic re-run, never a reroute.
1698
1711
  When `status` is `COMPLETED_WITH_ERRORS`: tell the user, then apply the same wait-for-rows rule — partial recommendations may still be useful.
1699
1712
  When `status` is `FAILED`: surface the error message, ask if they want to retry (`start_agentic_run` again with same exploration_id) or stop.
1700
1713
  When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): continue to Step 8.5.
@@ -1841,7 +1854,7 @@ or proceed to your {Deliverable}.
1841
1854
 
1842
1855
  {…every category, every rec, one line each…}
1843
1856
 
1844
- Pulse: Reasoning Readiness ~88% · Context Debt 12% · +16% (recommendations ready)
1857
+ Pulse: Reasoning Readiness ~88% · Context Debt 12% 16% (recommendations ready)
1845
1858
 
1846
1859
  A few assumptions are still unverified — the build brief is what locks them down.
1847
1860
  Reply drill R{N} (read one in full) · edit R{N} <your change> · proceed (generate the {Deliverable})
@@ -307,6 +307,7 @@ When you need to wait for async server work (requirements generation, build brie
307
307
  This rule applies to: Step 9.5 (`get_requirement_set_status`), Step 10b (`get_build_brief_status` on timeout), and any future status-poll surface.
308
308
 
309
309
  <!-- skill-options:no-gate-change: pulse render gains a delta + next-lift line; no decision gate, option, or pause is added or changed -->
310
+ <!-- skill-options:no-gate-change: pulse delta now renders as a Context Debt directional drop (Context Debt N% ↓M%) instead of a bare · +N%, so the movement reads as debt going down; render-only, no gate/option/pause change -->
310
311
 
311
312
  #### Inline pulses — surface reasoning readiness climbing as context debt drops
312
313
 
@@ -319,11 +320,11 @@ The pulse rule and visual specs live in the [§ /ritual context-pulse](#ritual-c
319
320
  ```text
320
321
  {…the step's content…}
321
322
 
322
- Pulse: Reasoning Readiness 58% · Context Debt 42% · +3% (scope locked)
323
+ Pulse: Reasoning Readiness 58% · Context Debt 42% 3% (scope locked)
323
324
  Reply proceed (run discovery → recommendations) · expert · pause
324
325
  ```
325
326
 
326
- - **Score line** (top of the message). Full capitalized labels — `Reasoning Readiness` and `Context Debt`, NOT lowercase. The **`· +N%` delta is MANDATORY** on every pulse after the first (the first pulse has no prior, so it shows just the baseline + reason). The delta is the visible-progress signal never drop it. Show `+0%` honestly if a step didn't move the score, and `−N%` on a regression (rare; render full then).
327
+ - **Score line** (top of the message). Full capitalized labels — `Reasoning Readiness` and `Context Debt`, NOT lowercase. The progress delta attaches to **Context Debt as a directional drop** — `Context Debt 42% ↓3%` — so the movement reads unambiguously as debt going DOWN. (A bare `· +3%` sitting next to the debt figure reads like debt went UP by 3, the opposite of progress — that's the confusion this avoids.) The delta is **MANDATORY** on every pulse after the first (the first pulse has no prior just the baseline + reason). Use `↓N%` when debt drops (the normal, good case), `↑N%` on a regression (rare; render full then), and `±0%` when a step didn't move the score. Never drop it — it's the visible-progress signal. (Readiness climbing and debt dropping are the same move — `Reasoning Readiness + Context Debt = 100%` so the debt-drop arrow IS the readiness-gain signal, just framed the way users read it.)
327
328
  - **Lift bridge** (ONE sentence, immediately ABOVE the action/CTA line — NOT under the score). This is the load-bearing piece: it turns the score into a reason to proceed. Three requirements:
328
329
  1. **Plain language for the gap — NEVER the internal dimension name.** The lowest dimension from `score_context_pulse`'s breakdown picks the message, but the user sees what it MEANS, not the label:
329
330
  | lowest dimension (internal) | what the user reads (plain) |
@@ -335,7 +336,7 @@ The pulse rule and visual specs live in the [§ /ritual context-pulse](#ritual-c
335
336
  2. **Name the NEXT STEP as the resolver, explicitly.** The bridge must make clear that the action the user is about to take is what closes the gap — `that's exactly what the next step, discovery, resolves` / `code recon next grounds it` / `the build brief locks those down`. The bridge and the forward-CTA below it name the SAME move — one story.
336
337
  3. **Terse + declarative** — no `now let me help you improve this` assistant/affect register (`cli-experience-tenets.md`).
337
338
  On the LAST scoreable step (Step 10, implementation-ready), there's no further lift — the bridge becomes the readiness statement: `The brief is your build path — implement when ready.`
338
- - **Full (with bars + Reasoning Readiness / Context Debt / Context Surface labels)** when crossing a state-tier boundary, jumping ≥15%, or regressing. Full mode keeps the same `+N%` delta on the score line and the same lift bridge above the CTA.
339
+ - **Full (with bars + Reasoning Readiness / Context Debt / Context Surface labels)** when crossing a state-tier boundary, jumping ≥15%, or regressing. Full mode keeps the same `Context Debt N% ↓M%` delta on the score line and the same lift bridge above the CTA.
339
340
  - The score line goes near the top of the step's message; the lift bridge goes right before the action line. Both are additive, not replacements.
340
341
  - 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.
341
342
 
@@ -1,5 +1,5 @@
1
1
  <!-- GENERATED from references/build-flow.md by apps/cli/scripts/generate-lite-flow.js — DO NOT EDIT. -->
2
- <!-- source-sha: 49db57c7a618c67e -->
2
+ <!-- source-sha: 890b590159dbb59d -->
3
3
 
4
4
  # /ritual lite — fast build (generated; do not edit)
5
5
 
@@ -929,6 +929,8 @@ Store the final sub-problems for Step 5 — they go into `considerations[]`.
929
929
 
930
930
  #### Step 5 — Generate problem frame
931
931
 
932
+ <!-- skill-options:no-gate-change: Step 5 adds a render-only rule (do not surface follow_up_questions / an "open questions" preview / fuzzy-meta at the frame gate); the frame's pause + options + Reply line are unchanged. -->
933
+
932
934
  ##### 5.1 First draft
933
935
 
934
936
  Call `mcp__ritual__generate_problem_statement` with:
@@ -971,6 +973,7 @@ Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboa
971
973
  ```
972
974
 
973
975
  Rules:
976
+ - **Render ONLY the four blocks above** — Problem frame, Optimize for, References, and the Reply line. Nothing else. The `generate_problem_statement` response may include `follow_up_questions` and quality scores: those are for YOUR internal awareness, never for display. Do NOT add an "Open questions" / "what discovery will resolve" section, do NOT preview or list discovery questions here, and do NOT editorialize about what's "still fuzzy" or "what the next step pins down." Discovery is the next step and owns open questions; the frame is a lock-point, not a discovery preview. Surfacing them here both pre-empts Step 7 and clutters the gate.
974
977
  - Do not show the old versioned scope heading.
975
978
  - Do not show `Engineering problem:` as the heading; use `Problem frame`.
976
979
  - Do not say `ship it` unless the user used that language first.
@@ -1736,9 +1739,16 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
1736
1739
 
1737
1740
  <!-- skill-options:no-gate-change: adds a convergence note at the top of the rec-wait — both answerers (local coding agent vs Ritual server) poll get_recommendations_preview until ≥1 rec; the only difference is who produced the answers. No new pause gate or Step header; the run/pause gate + its options are unchanged. -->
1738
1741
 
1739
- **Both answerers converge here — once the run is underway, poll until recommendations exist.** The job from this point on is the SAME regardless of who produced the answers: poll `mcp__ritual__get_recommendations_preview(exploration_id)` until it returns **at least one recommendation**, then continue to Step 9. The *only* difference between the two paths is the **answerer** — the **local coding agent** (you, when repo-linked) vs **Ritual's server agentic run** — and that only changes how you reach this wait (agent-answered → straight to the rec poll; server → poll the run to `COMPLETED` first, then the recs). Never render the Step 9 landing, and never call `accept_recommendations`, from a zero-rec read.
1742
+ <!-- skill-options:no-gate-change: Step 8.1 rec-wait polls get_exploration_status.recommendationsStatus (not_started|generating|ready|empty|failed); on `failed` it offers retry_recommendations (re-enqueues rec-gen only). Render-only signal + an offered action, no pause/option/Step-header change. -->
1743
+ **Both answerers converge here — once the run is underway, poll until recommendations are READY.** The job from this point on is the SAME regardless of who produced the answers. **Poll the authoritative signal: `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus`.** It removes the guesswork that bit us before — it is unambiguous:
1744
+ - `not_started` / `generating` → **keep polling.** A zero `recommendationCount` here is NORMAL — generation is enqueued/in flight, NEVER a "miss." (Older servers may omit the field; if `recommendationsStatus` is absent, fall back to polling `get_recommendations_preview` until ≥1.)
1745
+ - `ready` → recommendations exist. Fetch them (`get_recommendations_preview`) and continue to Step 9.
1746
+ - `empty` → generation FINISHED with genuinely zero recs (rare, real terminal state). Surface it plainly — do NOT render a fake Step 9 landing, do NOT re-run.
1747
+ - `failed` → generation exhausted its auto-retries (terminal). Surface it with the one-line `recommendationsError` if present, and **offer to retry** — on a `yes`, call `mcp__ritual__retry_recommendations(exploration_id)` (re-enqueues ONLY rec-gen on the existing answers; status returns to `generating`, resume polling). Do NOT call `start_agentic_run` (that re-answers the whole exploration) and do NOT auto-retry without asking.
1748
+
1749
+ The *only* difference between the two answerer paths — **local coding agent** (you, repo-linked) vs **Ritual's server agentic run** — is how you reach this wait (agent-answered → straight to the status poll; server → poll the run to `COMPLETED` first, then the status). Never render the Step 9 landing, and never call `accept_recommendations`, from anything but `ready`.
1740
1750
 
1741
- **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_recommendations_preview(exploration_id)` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it returns **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing and never call `accept_recommendations` from a zero-rec read; if 10+ min pass with zero rows, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1751
+ **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it reads `ready`, then fetch + continue to Step 9. `generating` → keep polling; `empty` → genuine zero-rec terminal; NEVER render the Step 9 landing or call `accept_recommendations` from anything but `ready`; if 10+ min pass still `generating`, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1742
1752
 
1743
1753
  **Server fallback path** (you called `start_agentic_run`): poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 20` (constant 20 — matches Spark's 20s agentic cadence; never escalate)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays a constant 20; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`, but a fixed `20` is non-escalating and under 30 → guard-safe. Agentic runs CAN exceed 5 min for large explorations — if you see status still running past ~5 min of polling, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
1744
1754
 
@@ -1750,15 +1760,18 @@ Then print progress only when `progress_pct` or `current_step` changes, or every
1750
1760
 
1751
1761
  > Agentic run: {progress_pct}% — {current_step}
1752
1762
 
1753
- When `status` is `COMPLETED`: **wait for recommendation ROWS before Step 9.** The run reporting
1763
+ When `status` is `COMPLETED`: **wait for `recommendationsStatus: ready` before Step 9.** The run reporting
1754
1764
  `completed` does NOT mean recommendations exist yet — rec generation is a separate queued job that
1755
- lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12:
1756
- an agent rendered "0 recommendations across 0 categories" and vacuously proceeded). Poll
1757
- `mcp__ritual__get_recommendations_preview(exploration_id)` on the standard cadence (`Bash sleep 20`
1758
- per iteration, "still generating recommendations…" line every ~3 polls) until the preview returns
1759
- **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing — and
1760
- never call `accept_recommendations` — from a zero-rec read. If 10+ minutes pass with zero rows,
1761
- surface that as an anomaly instead of proceeding.
1765
+ lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12
1766
+ and 2026-06-15). Poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` on
1767
+ the standard cadence (`Bash sleep 20` per iteration, "still generating recommendations…" line every
1768
+ ~3 polls): `generating` keep polling; `ready` continue to Step 9; `empty` → genuine zero-rec
1769
+ terminal, surface it. NEVER render the Step 9 landing — and never call `accept_recommendations` —
1770
+ from anything but `ready`. If 10+ minutes pass still `generating`, surface that as an anomaly
1771
+ instead of proceeding.
1772
+
1773
+ <!-- skill-options:no-gate-change: Step 8.1 adds a load-bearing clause closing the "zero-rec = generation miss → re-run / reroute" loophole; tightens the existing wait-for-rows rule only — no pause, option, or Step header added or changed. -->
1774
+ **A zero-rec read is NEVER a "generation miss," and re-running is NOT a recovery (load-bearing).** The run reporting `completed` only means *answering* finished — recommendation synthesis is a SEPARATE async job that may still be in flight, so zero rows means **not yet**, never **failed**. Do NOT relabel it a "generation miss" / "the synthesizer came back empty" / "0 recommendations" and act on that: do NOT call `start_agentic_run` again to "regenerate" (the answers are already committed — a re-run re-answers the whole exploration from scratch, burns a full pipeline, and can double-generate), and do NOT propose "routing around" synthesis by building a plan from the raw discovery answers. Just keep polling `get_exploration_status.recommendationsStatus` until `ready` (or `empty` — the rare genuine terminal). The synthesizer is almost never the problem — being early in the async window (`generating`) is. The ONLY escalation, and only after the 10-min ceiling still `generating`, is to surface it as an anomaly and offer `/ritual status` or the web app — never an automatic re-run, never a reroute.
1762
1775
  When `status` is `COMPLETED_WITH_ERRORS`: tell the user, then apply the same wait-for-rows rule — partial recommendations may still be useful.
1763
1776
  When `status` is `FAILED`: surface the error message, ask if they want to retry (`start_agentic_run` again with same exploration_id) or stop.
1764
1777
  When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): continue to Step 8.5.
@@ -1905,7 +1918,7 @@ or proceed to your {Deliverable}.
1905
1918
 
1906
1919
  {…every category, every rec, one line each…}
1907
1920
 
1908
- Pulse: Reasoning Readiness ~88% · Context Debt 12% · +16% (recommendations ready)
1921
+ Pulse: Reasoning Readiness ~88% · Context Debt 12% 16% (recommendations ready)
1909
1922
 
1910
1923
  A few assumptions are still unverified — the build brief is what locks them down.
1911
1924
  Reply drill R{N} (read one in full) · edit R{N} <your change> · proceed (generate the {Deliverable})
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "0.36.22",
3
- "builtAt": "2026-06-15T13:28:31.790Z",
4
- "skillsHash": "8a8905aae549"
2
+ "cliVersion": "0.36.28",
3
+ "builtAt": "2026-06-15T15:33:01.454Z",
4
+ "skillsHash": "2019cd011119"
5
5
  }
@@ -3,7 +3,7 @@ name: ritual
3
3
  description: "Use when an engineer wants a coding agent to plan or build a feature, refactor, or implementation-heavy change that depends on context the agent can't infer on its own — strategic intent, constraints, prior decisions, and trade-offs that live in the user's head. Ritual runs a structured exploration to surface that context through targeted discovery questions, combines it with codebase signals and prior explorations, and delivers a validated build brief (sub-problems, recommendations, dependencies) — additional context to fold into plan mode before the agent writes code. Prefer this over jumping straight to implementation or plan mode when the problem is ambiguous, cross-cutting, or has non-obvious constraints. Subcommands: build (full planning-to-sync cycle — default for new features), resume (continue an in-flight exploration), lineage (file-path KG history — what decisions shaped this code), context-pulse (readiness and context-debt scoring — is this safe to build yet?)."
4
4
  argument-hint: "[subcommand] <args> (e.g. 'build Reduce T2 churn in Q3', 'resume', 'lineage src/checkout/views.py', 'context-pulse Add billing export')"
5
5
  user-invocable: true
6
- stamp: 8a8905aae549
6
+ stamp: 2019cd011119
7
7
  ---
8
8
 
9
9
  # /ritual
@@ -837,6 +837,8 @@ Store the final sub-problems for Step 5 — they go into `considerations[]`.
837
837
 
838
838
  #### Step 5 — Generate problem frame
839
839
 
840
+ <!-- skill-options:no-gate-change: Step 5 adds a render-only rule (do not surface follow_up_questions / an "open questions" preview / fuzzy-meta at the frame gate); the frame's pause + options + Reply line are unchanged. -->
841
+
840
842
  ##### 5.1 First draft
841
843
 
842
844
  Call `mcp__ritual__generate_problem_statement` with:
@@ -879,6 +881,7 @@ Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboa
879
881
  ```
880
882
 
881
883
  Rules:
884
+ - **Render ONLY the four blocks above** — Problem frame, Optimize for, References, and the Reply line. Nothing else. The `generate_problem_statement` response may include `follow_up_questions` and quality scores: those are for YOUR internal awareness, never for display. Do NOT add an "Open questions" / "what discovery will resolve" section, do NOT preview or list discovery questions here, and do NOT editorialize about what's "still fuzzy" or "what the next step pins down." Discovery is the next step and owns open questions; the frame is a lock-point, not a discovery preview. Surfacing them here both pre-empts Step 7 and clutters the gate.
882
885
  - Do not show the old versioned scope heading.
883
886
  - Do not show `Engineering problem:` as the heading; use `Problem frame`.
884
887
  - Do not say `ship it` unless the user used that language first.
@@ -1672,9 +1675,16 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
1672
1675
 
1673
1676
  <!-- skill-options:no-gate-change: adds a convergence note at the top of the rec-wait — both answerers (local coding agent vs Ritual server) poll get_recommendations_preview until ≥1 rec; the only difference is who produced the answers. No new pause gate or Step header; the run/pause gate + its options are unchanged. -->
1674
1677
 
1675
- **Both answerers converge here — once the run is underway, poll until recommendations exist.** The job from this point on is the SAME regardless of who produced the answers: poll `mcp__ritual__get_recommendations_preview(exploration_id)` until it returns **at least one recommendation**, then continue to Step 9. The *only* difference between the two paths is the **answerer** — the **local coding agent** (you, when repo-linked) vs **Ritual's server agentic run** — and that only changes how you reach this wait (agent-answered → straight to the rec poll; server → poll the run to `COMPLETED` first, then the recs). Never render the Step 9 landing, and never call `accept_recommendations`, from a zero-rec read.
1678
+ <!-- skill-options:no-gate-change: Step 8.1 rec-wait polls get_exploration_status.recommendationsStatus (not_started|generating|ready|empty|failed); on `failed` it offers retry_recommendations (re-enqueues rec-gen only). Render-only signal + an offered action, no pause/option/Step-header change. -->
1679
+ **Both answerers converge here — once the run is underway, poll until recommendations are READY.** The job from this point on is the SAME regardless of who produced the answers. **Poll the authoritative signal: `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus`.** It removes the guesswork that bit us before — it is unambiguous:
1680
+ - `not_started` / `generating` → **keep polling.** A zero `recommendationCount` here is NORMAL — generation is enqueued/in flight, NEVER a "miss." (Older servers may omit the field; if `recommendationsStatus` is absent, fall back to polling `get_recommendations_preview` until ≥1.)
1681
+ - `ready` → recommendations exist. Fetch them (`get_recommendations_preview`) and continue to Step 9.
1682
+ - `empty` → generation FINISHED with genuinely zero recs (rare, real terminal state). Surface it plainly — do NOT render a fake Step 9 landing, do NOT re-run.
1683
+ - `failed` → generation exhausted its auto-retries (terminal). Surface it with the one-line `recommendationsError` if present, and **offer to retry** — on a `yes`, call `mcp__ritual__retry_recommendations(exploration_id)` (re-enqueues ONLY rec-gen on the existing answers; status returns to `generating`, resume polling). Do NOT call `start_agentic_run` (that re-answers the whole exploration) and do NOT auto-retry without asking.
1684
+
1685
+ The *only* difference between the two answerer paths — **local coding agent** (you, repo-linked) vs **Ritual's server agentic run** — is how you reach this wait (agent-answered → straight to the status poll; server → poll the run to `COMPLETED` first, then the status). Never render the Step 9 landing, and never call `accept_recommendations`, from anything but `ready`.
1676
1686
 
1677
- **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_recommendations_preview(exploration_id)` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it returns **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing and never call `accept_recommendations` from a zero-rec read; if 10+ min pass with zero rows, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1687
+ **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it reads `ready`, then fetch + continue to Step 9. `generating` → keep polling; `empty` → genuine zero-rec terminal; NEVER render the Step 9 landing or call `accept_recommendations` from anything but `ready`; if 10+ min pass still `generating`, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1678
1688
 
1679
1689
  **Server fallback path** (you called `start_agentic_run`): poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 20` (constant 20 — matches Spark's 20s agentic cadence; never escalate)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays a constant 20; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`, but a fixed `20` is non-escalating and under 30 → guard-safe. Agentic runs CAN exceed 5 min for large explorations — if you see status still running past ~5 min of polling, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
1680
1690
 
@@ -1686,15 +1696,18 @@ Then print progress only when `progress_pct` or `current_step` changes, or every
1686
1696
 
1687
1697
  > Agentic run: {progress_pct}% — {current_step}
1688
1698
 
1689
- When `status` is `COMPLETED`: **wait for recommendation ROWS before Step 9.** The run reporting
1699
+ When `status` is `COMPLETED`: **wait for `recommendationsStatus: ready` before Step 9.** The run reporting
1690
1700
  `completed` does NOT mean recommendations exist yet — rec generation is a separate queued job that
1691
- lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12:
1692
- an agent rendered "0 recommendations across 0 categories" and vacuously proceeded). Poll
1693
- `mcp__ritual__get_recommendations_preview(exploration_id)` on the standard cadence (`Bash sleep 20`
1694
- per iteration, "still generating recommendations…" line every ~3 polls) until the preview returns
1695
- **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing — and
1696
- never call `accept_recommendations` — from a zero-rec read. If 10+ minutes pass with zero rows,
1697
- surface that as an anomaly instead of proceeding.
1701
+ lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12
1702
+ and 2026-06-15). Poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` on
1703
+ the standard cadence (`Bash sleep 20` per iteration, "still generating recommendations…" line every
1704
+ ~3 polls): `generating` keep polling; `ready` continue to Step 9; `empty` → genuine zero-rec
1705
+ terminal, surface it. NEVER render the Step 9 landing — and never call `accept_recommendations` —
1706
+ from anything but `ready`. If 10+ minutes pass still `generating`, surface that as an anomaly
1707
+ instead of proceeding.
1708
+
1709
+ <!-- skill-options:no-gate-change: Step 8.1 adds a load-bearing clause closing the "zero-rec = generation miss → re-run / reroute" loophole; tightens the existing wait-for-rows rule only — no pause, option, or Step header added or changed. -->
1710
+ **A zero-rec read is NEVER a "generation miss," and re-running is NOT a recovery (load-bearing).** The run reporting `completed` only means *answering* finished — recommendation synthesis is a SEPARATE async job that may still be in flight, so zero rows means **not yet**, never **failed**. Do NOT relabel it a "generation miss" / "the synthesizer came back empty" / "0 recommendations" and act on that: do NOT call `start_agentic_run` again to "regenerate" (the answers are already committed — a re-run re-answers the whole exploration from scratch, burns a full pipeline, and can double-generate), and do NOT propose "routing around" synthesis by building a plan from the raw discovery answers. Just keep polling `get_exploration_status.recommendationsStatus` until `ready` (or `empty` — the rare genuine terminal). The synthesizer is almost never the problem — being early in the async window (`generating`) is. The ONLY escalation, and only after the 10-min ceiling still `generating`, is to surface it as an anomaly and offer `/ritual status` or the web app — never an automatic re-run, never a reroute.
1698
1711
  When `status` is `COMPLETED_WITH_ERRORS`: tell the user, then apply the same wait-for-rows rule — partial recommendations may still be useful.
1699
1712
  When `status` is `FAILED`: surface the error message, ask if they want to retry (`start_agentic_run` again with same exploration_id) or stop.
1700
1713
  When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): continue to Step 8.5.
@@ -1841,7 +1854,7 @@ or proceed to your {Deliverable}.
1841
1854
 
1842
1855
  {…every category, every rec, one line each…}
1843
1856
 
1844
- Pulse: Reasoning Readiness ~88% · Context Debt 12% · +16% (recommendations ready)
1857
+ Pulse: Reasoning Readiness ~88% · Context Debt 12% 16% (recommendations ready)
1845
1858
 
1846
1859
  A few assumptions are still unverified — the build brief is what locks them down.
1847
1860
  Reply drill R{N} (read one in full) · edit R{N} <your change> · proceed (generate the {Deliverable})
@@ -307,6 +307,7 @@ When you need to wait for async server work (requirements generation, build brie
307
307
  This rule applies to: Step 9.5 (`get_requirement_set_status`), Step 10b (`get_build_brief_status` on timeout), and any future status-poll surface.
308
308
 
309
309
  <!-- skill-options:no-gate-change: pulse render gains a delta + next-lift line; no decision gate, option, or pause is added or changed -->
310
+ <!-- skill-options:no-gate-change: pulse delta now renders as a Context Debt directional drop (Context Debt N% ↓M%) instead of a bare · +N%, so the movement reads as debt going down; render-only, no gate/option/pause change -->
310
311
 
311
312
  #### Inline pulses — surface reasoning readiness climbing as context debt drops
312
313
 
@@ -319,11 +320,11 @@ The pulse rule and visual specs live in the [§ /ritual context-pulse](#ritual-c
319
320
  ```text
320
321
  {…the step's content…}
321
322
 
322
- Pulse: Reasoning Readiness 58% · Context Debt 42% · +3% (scope locked)
323
+ Pulse: Reasoning Readiness 58% · Context Debt 42% 3% (scope locked)
323
324
  Reply proceed (run discovery → recommendations) · expert · pause
324
325
  ```
325
326
 
326
- - **Score line** (top of the message). Full capitalized labels — `Reasoning Readiness` and `Context Debt`, NOT lowercase. The **`· +N%` delta is MANDATORY** on every pulse after the first (the first pulse has no prior, so it shows just the baseline + reason). The delta is the visible-progress signal never drop it. Show `+0%` honestly if a step didn't move the score, and `−N%` on a regression (rare; render full then).
327
+ - **Score line** (top of the message). Full capitalized labels — `Reasoning Readiness` and `Context Debt`, NOT lowercase. The progress delta attaches to **Context Debt as a directional drop** — `Context Debt 42% ↓3%` — so the movement reads unambiguously as debt going DOWN. (A bare `· +3%` sitting next to the debt figure reads like debt went UP by 3, the opposite of progress — that's the confusion this avoids.) The delta is **MANDATORY** on every pulse after the first (the first pulse has no prior just the baseline + reason). Use `↓N%` when debt drops (the normal, good case), `↑N%` on a regression (rare; render full then), and `±0%` when a step didn't move the score. Never drop it — it's the visible-progress signal. (Readiness climbing and debt dropping are the same move — `Reasoning Readiness + Context Debt = 100%` so the debt-drop arrow IS the readiness-gain signal, just framed the way users read it.)
327
328
  - **Lift bridge** (ONE sentence, immediately ABOVE the action/CTA line — NOT under the score). This is the load-bearing piece: it turns the score into a reason to proceed. Three requirements:
328
329
  1. **Plain language for the gap — NEVER the internal dimension name.** The lowest dimension from `score_context_pulse`'s breakdown picks the message, but the user sees what it MEANS, not the label:
329
330
  | lowest dimension (internal) | what the user reads (plain) |
@@ -335,7 +336,7 @@ The pulse rule and visual specs live in the [§ /ritual context-pulse](#ritual-c
335
336
  2. **Name the NEXT STEP as the resolver, explicitly.** The bridge must make clear that the action the user is about to take is what closes the gap — `that's exactly what the next step, discovery, resolves` / `code recon next grounds it` / `the build brief locks those down`. The bridge and the forward-CTA below it name the SAME move — one story.
336
337
  3. **Terse + declarative** — no `now let me help you improve this` assistant/affect register (`cli-experience-tenets.md`).
337
338
  On the LAST scoreable step (Step 10, implementation-ready), there's no further lift — the bridge becomes the readiness statement: `The brief is your build path — implement when ready.`
338
- - **Full (with bars + Reasoning Readiness / Context Debt / Context Surface labels)** when crossing a state-tier boundary, jumping ≥15%, or regressing. Full mode keeps the same `+N%` delta on the score line and the same lift bridge above the CTA.
339
+ - **Full (with bars + Reasoning Readiness / Context Debt / Context Surface labels)** when crossing a state-tier boundary, jumping ≥15%, or regressing. Full mode keeps the same `Context Debt N% ↓M%` delta on the score line and the same lift bridge above the CTA.
339
340
  - The score line goes near the top of the step's message; the lift bridge goes right before the action line. Both are additive, not replacements.
340
341
  - 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.
341
342
 
@@ -1,5 +1,5 @@
1
1
  <!-- GENERATED from references/build-flow.md by apps/cli/scripts/generate-lite-flow.js — DO NOT EDIT. -->
2
- <!-- source-sha: 49db57c7a618c67e -->
2
+ <!-- source-sha: 890b590159dbb59d -->
3
3
 
4
4
  # /ritual lite — fast build (generated; do not edit)
5
5
 
@@ -929,6 +929,8 @@ Store the final sub-problems for Step 5 — they go into `considerations[]`.
929
929
 
930
930
  #### Step 5 — Generate problem frame
931
931
 
932
+ <!-- skill-options:no-gate-change: Step 5 adds a render-only rule (do not surface follow_up_questions / an "open questions" preview / fuzzy-meta at the frame gate); the frame's pause + options + Reply line are unchanged. -->
933
+
932
934
  ##### 5.1 First draft
933
935
 
934
936
  Call `mcp__ritual__generate_problem_statement` with:
@@ -971,6 +973,7 @@ Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboa
971
973
  ```
972
974
 
973
975
  Rules:
976
+ - **Render ONLY the four blocks above** — Problem frame, Optimize for, References, and the Reply line. Nothing else. The `generate_problem_statement` response may include `follow_up_questions` and quality scores: those are for YOUR internal awareness, never for display. Do NOT add an "Open questions" / "what discovery will resolve" section, do NOT preview or list discovery questions here, and do NOT editorialize about what's "still fuzzy" or "what the next step pins down." Discovery is the next step and owns open questions; the frame is a lock-point, not a discovery preview. Surfacing them here both pre-empts Step 7 and clutters the gate.
974
977
  - Do not show the old versioned scope heading.
975
978
  - Do not show `Engineering problem:` as the heading; use `Problem frame`.
976
979
  - Do not say `ship it` unless the user used that language first.
@@ -1736,9 +1739,16 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
1736
1739
 
1737
1740
  <!-- skill-options:no-gate-change: adds a convergence note at the top of the rec-wait — both answerers (local coding agent vs Ritual server) poll get_recommendations_preview until ≥1 rec; the only difference is who produced the answers. No new pause gate or Step header; the run/pause gate + its options are unchanged. -->
1738
1741
 
1739
- **Both answerers converge here — once the run is underway, poll until recommendations exist.** The job from this point on is the SAME regardless of who produced the answers: poll `mcp__ritual__get_recommendations_preview(exploration_id)` until it returns **at least one recommendation**, then continue to Step 9. The *only* difference between the two paths is the **answerer** — the **local coding agent** (you, when repo-linked) vs **Ritual's server agentic run** — and that only changes how you reach this wait (agent-answered → straight to the rec poll; server → poll the run to `COMPLETED` first, then the recs). Never render the Step 9 landing, and never call `accept_recommendations`, from a zero-rec read.
1742
+ <!-- skill-options:no-gate-change: Step 8.1 rec-wait polls get_exploration_status.recommendationsStatus (not_started|generating|ready|empty|failed); on `failed` it offers retry_recommendations (re-enqueues rec-gen only). Render-only signal + an offered action, no pause/option/Step-header change. -->
1743
+ **Both answerers converge here — once the run is underway, poll until recommendations are READY.** The job from this point on is the SAME regardless of who produced the answers. **Poll the authoritative signal: `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus`.** It removes the guesswork that bit us before — it is unambiguous:
1744
+ - `not_started` / `generating` → **keep polling.** A zero `recommendationCount` here is NORMAL — generation is enqueued/in flight, NEVER a "miss." (Older servers may omit the field; if `recommendationsStatus` is absent, fall back to polling `get_recommendations_preview` until ≥1.)
1745
+ - `ready` → recommendations exist. Fetch them (`get_recommendations_preview`) and continue to Step 9.
1746
+ - `empty` → generation FINISHED with genuinely zero recs (rare, real terminal state). Surface it plainly — do NOT render a fake Step 9 landing, do NOT re-run.
1747
+ - `failed` → generation exhausted its auto-retries (terminal). Surface it with the one-line `recommendationsError` if present, and **offer to retry** — on a `yes`, call `mcp__ritual__retry_recommendations(exploration_id)` (re-enqueues ONLY rec-gen on the existing answers; status returns to `generating`, resume polling). Do NOT call `start_agentic_run` (that re-answers the whole exploration) and do NOT auto-retry without asking.
1748
+
1749
+ The *only* difference between the two answerer paths — **local coding agent** (you, repo-linked) vs **Ritual's server agentic run** — is how you reach this wait (agent-answered → straight to the status poll; server → poll the run to `COMPLETED` first, then the status). Never render the Step 9 landing, and never call `accept_recommendations`, from anything but `ready`.
1740
1750
 
1741
- **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_recommendations_preview(exploration_id)` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it returns **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing and never call `accept_recommendations` from a zero-rec read; if 10+ min pass with zero rows, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1751
+ **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it reads `ready`, then fetch + continue to Step 9. `generating` → keep polling; `empty` → genuine zero-rec terminal; NEVER render the Step 9 landing or call `accept_recommendations` from anything but `ready`; if 10+ min pass still `generating`, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1742
1752
 
1743
1753
  **Server fallback path** (you called `start_agentic_run`): poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 20` (constant 20 — matches Spark's 20s agentic cadence; never escalate)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays a constant 20; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`, but a fixed `20` is non-escalating and under 30 → guard-safe. Agentic runs CAN exceed 5 min for large explorations — if you see status still running past ~5 min of polling, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
1744
1754
 
@@ -1750,15 +1760,18 @@ Then print progress only when `progress_pct` or `current_step` changes, or every
1750
1760
 
1751
1761
  > Agentic run: {progress_pct}% — {current_step}
1752
1762
 
1753
- When `status` is `COMPLETED`: **wait for recommendation ROWS before Step 9.** The run reporting
1763
+ When `status` is `COMPLETED`: **wait for `recommendationsStatus: ready` before Step 9.** The run reporting
1754
1764
  `completed` does NOT mean recommendations exist yet — rec generation is a separate queued job that
1755
- lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12:
1756
- an agent rendered "0 recommendations across 0 categories" and vacuously proceeded). Poll
1757
- `mcp__ritual__get_recommendations_preview(exploration_id)` on the standard cadence (`Bash sleep 20`
1758
- per iteration, "still generating recommendations…" line every ~3 polls) until the preview returns
1759
- **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing — and
1760
- never call `accept_recommendations` — from a zero-rec read. If 10+ minutes pass with zero rows,
1761
- surface that as an anomaly instead of proceeding.
1765
+ lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12
1766
+ and 2026-06-15). Poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` on
1767
+ the standard cadence (`Bash sleep 20` per iteration, "still generating recommendations…" line every
1768
+ ~3 polls): `generating` keep polling; `ready` continue to Step 9; `empty` → genuine zero-rec
1769
+ terminal, surface it. NEVER render the Step 9 landing — and never call `accept_recommendations` —
1770
+ from anything but `ready`. If 10+ minutes pass still `generating`, surface that as an anomaly
1771
+ instead of proceeding.
1772
+
1773
+ <!-- skill-options:no-gate-change: Step 8.1 adds a load-bearing clause closing the "zero-rec = generation miss → re-run / reroute" loophole; tightens the existing wait-for-rows rule only — no pause, option, or Step header added or changed. -->
1774
+ **A zero-rec read is NEVER a "generation miss," and re-running is NOT a recovery (load-bearing).** The run reporting `completed` only means *answering* finished — recommendation synthesis is a SEPARATE async job that may still be in flight, so zero rows means **not yet**, never **failed**. Do NOT relabel it a "generation miss" / "the synthesizer came back empty" / "0 recommendations" and act on that: do NOT call `start_agentic_run` again to "regenerate" (the answers are already committed — a re-run re-answers the whole exploration from scratch, burns a full pipeline, and can double-generate), and do NOT propose "routing around" synthesis by building a plan from the raw discovery answers. Just keep polling `get_exploration_status.recommendationsStatus` until `ready` (or `empty` — the rare genuine terminal). The synthesizer is almost never the problem — being early in the async window (`generating`) is. The ONLY escalation, and only after the 10-min ceiling still `generating`, is to surface it as an anomaly and offer `/ritual status` or the web app — never an automatic re-run, never a reroute.
1762
1775
  When `status` is `COMPLETED_WITH_ERRORS`: tell the user, then apply the same wait-for-rows rule — partial recommendations may still be useful.
1763
1776
  When `status` is `FAILED`: surface the error message, ask if they want to retry (`start_agentic_run` again with same exploration_id) or stop.
1764
1777
  When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): continue to Step 8.5.
@@ -1905,7 +1918,7 @@ or proceed to your {Deliverable}.
1905
1918
 
1906
1919
  {…every category, every rec, one line each…}
1907
1920
 
1908
- Pulse: Reasoning Readiness ~88% · Context Debt 12% · +16% (recommendations ready)
1921
+ Pulse: Reasoning Readiness ~88% · Context Debt 12% 16% (recommendations ready)
1909
1922
 
1910
1923
  A few assumptions are still unverified — the build brief is what locks them down.
1911
1924
  Reply drill R{N} (read one in full) · edit R{N} <your change> · proceed (generate the {Deliverable})
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "0.36.22",
3
- "builtAt": "2026-06-15T13:28:31.790Z",
4
- "skillsHash": "8a8905aae549"
2
+ "cliVersion": "0.36.28",
3
+ "builtAt": "2026-06-15T15:33:01.454Z",
4
+ "skillsHash": "2019cd011119"
5
5
  }
@@ -3,7 +3,7 @@ name: ritual
3
3
  description: "Use when an engineer wants a coding agent to plan or build a feature, refactor, or implementation-heavy change that depends on context the agent can't infer on its own — strategic intent, constraints, prior decisions, and trade-offs that live in the user's head. Ritual runs a structured exploration to surface that context through targeted discovery questions, combines it with codebase signals and prior explorations, and delivers a validated build brief (sub-problems, recommendations, dependencies) — additional context to fold into plan mode before the agent writes code. Prefer this over jumping straight to implementation or plan mode when the problem is ambiguous, cross-cutting, or has non-obvious constraints. Subcommands: build (full planning-to-sync cycle — default for new features), resume (continue an in-flight exploration), lineage (file-path KG history — what decisions shaped this code), context-pulse (readiness and context-debt scoring — is this safe to build yet?)."
4
4
  argument-hint: "[subcommand] <args> (e.g. 'build Reduce T2 churn in Q3', 'resume', 'lineage src/checkout/views.py', 'context-pulse Add billing export')"
5
5
  user-invocable: true
6
- stamp: 8a8905aae549
6
+ stamp: 2019cd011119
7
7
  ---
8
8
 
9
9
  # /ritual
@@ -837,6 +837,8 @@ Store the final sub-problems for Step 5 — they go into `considerations[]`.
837
837
 
838
838
  #### Step 5 — Generate problem frame
839
839
 
840
+ <!-- skill-options:no-gate-change: Step 5 adds a render-only rule (do not surface follow_up_questions / an "open questions" preview / fuzzy-meta at the frame gate); the frame's pause + options + Reply line are unchanged. -->
841
+
840
842
  ##### 5.1 First draft
841
843
 
842
844
  Call `mcp__ritual__generate_problem_statement` with:
@@ -879,6 +881,7 @@ Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboa
879
881
  ```
880
882
 
881
883
  Rules:
884
+ - **Render ONLY the four blocks above** — Problem frame, Optimize for, References, and the Reply line. Nothing else. The `generate_problem_statement` response may include `follow_up_questions` and quality scores: those are for YOUR internal awareness, never for display. Do NOT add an "Open questions" / "what discovery will resolve" section, do NOT preview or list discovery questions here, and do NOT editorialize about what's "still fuzzy" or "what the next step pins down." Discovery is the next step and owns open questions; the frame is a lock-point, not a discovery preview. Surfacing them here both pre-empts Step 7 and clutters the gate.
882
885
  - Do not show the old versioned scope heading.
883
886
  - Do not show `Engineering problem:` as the heading; use `Problem frame`.
884
887
  - Do not say `ship it` unless the user used that language first.
@@ -1672,9 +1675,16 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
1672
1675
 
1673
1676
  <!-- skill-options:no-gate-change: adds a convergence note at the top of the rec-wait — both answerers (local coding agent vs Ritual server) poll get_recommendations_preview until ≥1 rec; the only difference is who produced the answers. No new pause gate or Step header; the run/pause gate + its options are unchanged. -->
1674
1677
 
1675
- **Both answerers converge here — once the run is underway, poll until recommendations exist.** The job from this point on is the SAME regardless of who produced the answers: poll `mcp__ritual__get_recommendations_preview(exploration_id)` until it returns **at least one recommendation**, then continue to Step 9. The *only* difference between the two paths is the **answerer** — the **local coding agent** (you, when repo-linked) vs **Ritual's server agentic run** — and that only changes how you reach this wait (agent-answered → straight to the rec poll; server → poll the run to `COMPLETED` first, then the recs). Never render the Step 9 landing, and never call `accept_recommendations`, from a zero-rec read.
1678
+ <!-- skill-options:no-gate-change: Step 8.1 rec-wait polls get_exploration_status.recommendationsStatus (not_started|generating|ready|empty|failed); on `failed` it offers retry_recommendations (re-enqueues rec-gen only). Render-only signal + an offered action, no pause/option/Step-header change. -->
1679
+ **Both answerers converge here — once the run is underway, poll until recommendations are READY.** The job from this point on is the SAME regardless of who produced the answers. **Poll the authoritative signal: `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus`.** It removes the guesswork that bit us before — it is unambiguous:
1680
+ - `not_started` / `generating` → **keep polling.** A zero `recommendationCount` here is NORMAL — generation is enqueued/in flight, NEVER a "miss." (Older servers may omit the field; if `recommendationsStatus` is absent, fall back to polling `get_recommendations_preview` until ≥1.)
1681
+ - `ready` → recommendations exist. Fetch them (`get_recommendations_preview`) and continue to Step 9.
1682
+ - `empty` → generation FINISHED with genuinely zero recs (rare, real terminal state). Surface it plainly — do NOT render a fake Step 9 landing, do NOT re-run.
1683
+ - `failed` → generation exhausted its auto-retries (terminal). Surface it with the one-line `recommendationsError` if present, and **offer to retry** — on a `yes`, call `mcp__ritual__retry_recommendations(exploration_id)` (re-enqueues ONLY rec-gen on the existing answers; status returns to `generating`, resume polling). Do NOT call `start_agentic_run` (that re-answers the whole exploration) and do NOT auto-retry without asking.
1684
+
1685
+ The *only* difference between the two answerer paths — **local coding agent** (you, repo-linked) vs **Ritual's server agentic run** — is how you reach this wait (agent-answered → straight to the status poll; server → poll the run to `COMPLETED` first, then the status). Never render the Step 9 landing, and never call `accept_recommendations`, from anything but `ready`.
1676
1686
 
1677
- **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_recommendations_preview(exploration_id)` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it returns **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing and never call `accept_recommendations` from a zero-rec read; if 10+ min pass with zero rows, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1687
+ **Agent-answered path (default):** you already wrote + `submit_all_answers`'d, so there's no agentic run to poll — go straight to the recommendation wait: poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` (`Bash sleep 20` per iteration, a "still generating recommendations…" line every ~3 polls) until it reads `ready`, then fetch + continue to Step 9. `generating` → keep polling; `empty` → genuine zero-rec terminal; NEVER render the Step 9 landing or call `accept_recommendations` from anything but `ready`; if 10+ min pass still `generating`, surface it as an anomaly. (Skip the `get_agentic_run` polling below — that's the server-fallback path.)
1678
1688
 
1679
1689
  **Server fallback path** (you called `start_agentic_run`): poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 20` (constant 20 — matches Spark's 20s agentic cadence; never escalate)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays a constant 20; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`, but a fixed `20` is non-escalating and under 30 → guard-safe. Agentic runs CAN exceed 5 min for large explorations — if you see status still running past ~5 min of polling, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
1680
1690
 
@@ -1686,15 +1696,18 @@ Then print progress only when `progress_pct` or `current_step` changes, or every
1686
1696
 
1687
1697
  > Agentic run: {progress_pct}% — {current_step}
1688
1698
 
1689
- When `status` is `COMPLETED`: **wait for recommendation ROWS before Step 9.** The run reporting
1699
+ When `status` is `COMPLETED`: **wait for `recommendationsStatus: ready` before Step 9.** The run reporting
1690
1700
  `completed` does NOT mean recommendations exist yet — rec generation is a separate queued job that
1691
- lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12:
1692
- an agent rendered "0 recommendations across 0 categories" and vacuously proceeded). Poll
1693
- `mcp__ritual__get_recommendations_preview(exploration_id)` on the standard cadence (`Bash sleep 20`
1694
- per iteration, "still generating recommendations…" line every ~3 polls) until the preview returns
1695
- **at least one recommendation**, then continue to Step 9. NEVER render the Step 9 landing — and
1696
- never call `accept_recommendations` — from a zero-rec read. If 10+ minutes pass with zero rows,
1697
- surface that as an anomaly instead of proceeding.
1701
+ lands MINUTES later (the 2026-06-05 premature-accept incident class; observed again live 2026-06-12
1702
+ and 2026-06-15). Poll `mcp__ritual__get_exploration_status(exploration_id).recommendationsStatus` on
1703
+ the standard cadence (`Bash sleep 20` per iteration, "still generating recommendations…" line every
1704
+ ~3 polls): `generating` keep polling; `ready` continue to Step 9; `empty` → genuine zero-rec
1705
+ terminal, surface it. NEVER render the Step 9 landing — and never call `accept_recommendations` —
1706
+ from anything but `ready`. If 10+ minutes pass still `generating`, surface that as an anomaly
1707
+ instead of proceeding.
1708
+
1709
+ <!-- skill-options:no-gate-change: Step 8.1 adds a load-bearing clause closing the "zero-rec = generation miss → re-run / reroute" loophole; tightens the existing wait-for-rows rule only — no pause, option, or Step header added or changed. -->
1710
+ **A zero-rec read is NEVER a "generation miss," and re-running is NOT a recovery (load-bearing).** The run reporting `completed` only means *answering* finished — recommendation synthesis is a SEPARATE async job that may still be in flight, so zero rows means **not yet**, never **failed**. Do NOT relabel it a "generation miss" / "the synthesizer came back empty" / "0 recommendations" and act on that: do NOT call `start_agentic_run` again to "regenerate" (the answers are already committed — a re-run re-answers the whole exploration from scratch, burns a full pipeline, and can double-generate), and do NOT propose "routing around" synthesis by building a plan from the raw discovery answers. Just keep polling `get_exploration_status.recommendationsStatus` until `ready` (or `empty` — the rare genuine terminal). The synthesizer is almost never the problem — being early in the async window (`generating`) is. The ONLY escalation, and only after the 10-min ceiling still `generating`, is to surface it as an anomaly and offer `/ritual status` or the web app — never an automatic re-run, never a reroute.
1698
1711
  When `status` is `COMPLETED_WITH_ERRORS`: tell the user, then apply the same wait-for-rows rule — partial recommendations may still be useful.
1699
1712
  When `status` is `FAILED`: surface the error message, ask if they want to retry (`start_agentic_run` again with same exploration_id) or stop.
1700
1713
  When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): continue to Step 8.5.
@@ -1841,7 +1854,7 @@ or proceed to your {Deliverable}.
1841
1854
 
1842
1855
  {…every category, every rec, one line each…}
1843
1856
 
1844
- Pulse: Reasoning Readiness ~88% · Context Debt 12% · +16% (recommendations ready)
1857
+ Pulse: Reasoning Readiness ~88% · Context Debt 12% 16% (recommendations ready)
1845
1858
 
1846
1859
  A few assumptions are still unverified — the build brief is what locks them down.
1847
1860
  Reply drill R{N} (read one in full) · edit R{N} <your change> · proceed (generate the {Deliverable})