@ritualai/cli 0.9.4 → 0.11.0
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.
- package/package.json +1 -1
- package/skills/claude-code/ritual/.ritual-bundle.json +2 -2
- package/skills/claude-code/ritual/references/build-flow.md +244 -16
- package/skills/codex/ritual/.ritual-bundle.json +2 -2
- package/skills/codex/ritual/references/build-flow.md +244 -16
- package/skills/cursor/ritual/.ritual-bundle.json +2 -2
- package/skills/cursor/ritual/references/build-flow.md +244 -16
- package/skills/gemini/ritual/.ritual-bundle.json +2 -2
- package/skills/gemini/ritual/references/build-flow.md +244 -16
- package/skills/kiro/ritual/.ritual-bundle.json +2 -2
- package/skills/kiro/ritual/references/build-flow.md +244 -16
- package/skills/vscode/ritual/.ritual-bundle.json +2 -2
- package/skills/vscode/ritual/references/build-flow.md +244 -16
|
@@ -85,6 +85,26 @@ Pausing discipline is still load-bearing — every `[USER PAUSE]` later in the f
|
|
|
85
85
|
|
|
86
86
|
The table is here so future contributors understand WHY the heads-up mentions Claude Code's Shift+Tab specifically — that's the dominant target client. If we add an elicitation-based picker (see `documents/architecture/selection-cursor-pattern.md` §"Future — MCP elicitation"), the auto-mode concern reduces further because elicitation form-mode requires actual user input regardless of agent mode.
|
|
87
87
|
|
|
88
|
+
##### Step 0.1 — Parse build-mode flags (load-bearing for Step 9.6, future Audit 2/3 gates)
|
|
89
|
+
|
|
90
|
+
Per `documents/architecture/audit-suite.md` § 7a, `/ritual build` accepts three audit-mode levels:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
/ritual build <problem> → auditMode = 'normal' (today's behavior, default proceed)
|
|
94
|
+
/ritual build --audited <problem> → auditMode = 'audited' (recommend at each gate)
|
|
95
|
+
/ritual build --audit=strict <problem> → auditMode = 'strict' (auto-run with 90s/chain time budget)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Aliases the SKILL accepts (for agent-friendly UX):
|
|
99
|
+
- `--audit` (no-equals form, treated identically to `--audited`)
|
|
100
|
+
- `audited` (bareword form, agent-friendly when users type conversationally)
|
|
101
|
+
|
|
102
|
+
At Step 0 (or whenever the agent first parses the user's `/ritual build` invocation), extract the audit-mode flag and store as `auditMode` in working memory. Default to `'normal'` if no flag present. The audit gate at Step 9.6 (and future Audits 2/3 at Steps 10b.5 + 11.1, ships in PRs B/C) read this variable to choose between three prompt styles.
|
|
103
|
+
|
|
104
|
+
If the user types `always audit for this build` mid-flow at the Step 9.6 prompt, upgrade `auditMode` from `'normal'` or `'audited'` → `'strict'` for any remaining audit gates in the same session. The upgrade is session-scoped (doesn't persist across `/ritual build` invocations).
|
|
105
|
+
|
|
106
|
+
Persist `auditMode` to `Exploration.metadata.auditMode` at `create_exploration` time (additive JSONB key — no schema migration) so `/ritual resume <exploration-id>` picks up the same mode the original build started with, and `/ritual lineage <exploration-id>` can render which gates ran + their outcomes.
|
|
107
|
+
|
|
88
108
|
#### Step 1 — Pick a workspace
|
|
89
109
|
|
|
90
110
|
Resolution order:
|
|
@@ -176,7 +196,7 @@ If the user replies `suggest` but the workspace has no prior explorations, expla
|
|
|
176
196
|
1. You just created the workspace in Step 1 (in-session creation — there are no explorations possible yet).
|
|
177
197
|
2. The bound workspace's `_count.explorations === 0` (server-side, read from the `list_workspaces` call in Step 1). This is authoritative against any source of mutation — web UI, other agents, out-of-band API calls.
|
|
178
198
|
|
|
179
|
-
If either fires, emit a single line and proceed straight to Step 2
|
|
199
|
+
If either fires, emit a single line and proceed straight to Step 2. **This skip covers ALL of Step 1.5 — including step 8 (the `check_exploration_overlap` call). No `list_explorations`, no `check_exploration_overlap`, no resume picker. There is nothing to compare against in an empty workspace; running either tool is pure overhead that resolves to "nothing here" after a wasted MCP roundtrip + LLM cost + an interactive permission prompt the user has to approve.**
|
|
180
200
|
|
|
181
201
|
> No prior work in this workspace — starting fresh.
|
|
182
202
|
|
|
@@ -405,7 +425,9 @@ Steps:
|
|
|
405
425
|
|
|
406
426
|
Don't run the suggester from an empty workspace — there's no priors signal yet, and the user opening Ritual for the first time has stronger user-driven intent than the suggester could offer.
|
|
407
427
|
|
|
408
|
-
8. **Before the user commits to "start fresh"** — if they DID say "start fresh"
|
|
428
|
+
8. **Before the user commits to "start fresh"** — if they DID say "start fresh" AND the workspace has existing explorations to compare against — run a **semantic overlap check** against the workspace. This catches the case where what the user is describing is a near-duplicate of something that already exists, BEFORE they burn LLM cost on Steps 4-5:
|
|
429
|
+
|
|
430
|
+
**Skip this overlap check entirely when the workspace has zero explorations.** Two signals count as proof the workspace is empty: (a) you just created the workspace in Step 1 (in-session creation), or (b) `list_workspaces._count.explorations === 0` for the bound workspace (server-side count from the Step 1 call). With zero existing explorations, there's literally nothing to overlap with — the call would return `candidates: []` after a wasted MCP roundtrip + LLM cost + (in interactive permission modes) a needless user approval prompt. This was an oversight in cli 0.9.3's empty-workspace skip path: the top of Step 1.5 correctly said "proceed straight to Step 2", but this step 8 instruction still ran the overlap check when there was nothing to overlap with. Fixed in cli 0.9.5.
|
|
409
431
|
|
|
410
432
|
Call `mcp__ritual__check_exploration_overlap(workspace_id, raw_input)`. Pass the user's full natural-language description of what they want to explore as `raw_input` — the SAME text you'd later pass to `generate_considerations`.
|
|
411
433
|
|
|
@@ -870,7 +892,7 @@ The user can always come back later with `/ritual context-pulse <exploration>` t
|
|
|
870
892
|
Call `mcp__ritual__generate_considerations` with:
|
|
871
893
|
- `workspace_id`
|
|
872
894
|
- `raw_input` (the user's problem + the Step 3 `codebase_context_packet` + any reference context, concatenated as described above)
|
|
873
|
-
- `template_id` (the
|
|
895
|
+
- `template_id` — **OPTIONAL.** Per Step 2 (server-side template resolution), the agent does NOT pick a template_id. Omit this field unless the user explicitly passed `--template-id` on the CLI; the server resolves the right template from `user.persona` → `workspace.defaultTemplateId` → system default and uses the same resolution chain `create_exploration` will use at Step 6. Passing it explicitly only matters when overriding the default.
|
|
874
896
|
- `sources` (the file path list from Step 3 step 7 — file-path strings only, e.g. `["apps/checkout/views.py", ...]`)
|
|
875
897
|
|
|
876
898
|
LLM call, ~5–10s. Returns 5–6 sub-problems — different framing axes the system should investigate. Track each one as `{ text, version: 1 }` in your working memory.
|
|
@@ -917,7 +939,8 @@ Only the title line gets the number. Put a blank line between candidates. Do not
|
|
|
917
939
|
The user may, at the Step 5 problem-statement gate, say something like "rethink the sub-problems" or "the framing is off — show me other angles." When that happens, call `mcp__ritual__refine_considerations` and re-render the sub-problem set + a fresh problem statement. In the default flow this path is unreachable; it exists for the explicit "rethink scope" escape hatch.
|
|
918
940
|
|
|
919
941
|
Call `mcp__ritual__refine_considerations` with:
|
|
920
|
-
- `workspace_id`, `raw_input`, `
|
|
942
|
+
- `workspace_id`, `raw_input`, `sources` — unchanged from the generate call. Critical: pass the SAME `sources` array each iteration so the KG-injected priorContext stays consistent.
|
|
943
|
+
- `template_id` — same rule as Step 4: omit unless the user explicitly overrode it. If you passed `template_id` to the original `generate_considerations` call, pass the same value here for symmetry; otherwise leave it off and let server-side resolution stay consistent across iterations.
|
|
921
944
|
- `change_prompt`: the user's request verbatim
|
|
922
945
|
- `selected`: items from prior versions the user kept (track `{ text, from_version }`, send just `text`)
|
|
923
946
|
- `dismissed`: items the user explicitly rejected
|
|
@@ -937,7 +960,7 @@ Call `mcp__ritual__generate_problem_statement` with:
|
|
|
937
960
|
- `workspace_id`
|
|
938
961
|
- `raw_input` (same augmented version from Step 4)
|
|
939
962
|
- `considerations` (the picks from Step 4)
|
|
940
|
-
- `template_id`
|
|
963
|
+
- `template_id` — OPTIONAL, same rule as Step 4. Omit unless the user explicitly overrode; server resolution stays consistent across `generate_considerations` → `generate_problem_statement` → `create_exploration`.
|
|
941
964
|
- `sources` (the same file-path list passed to generate_considerations — keeps the KG anchor consistent)
|
|
942
965
|
|
|
943
966
|
Returns a candidate problem statement plus optional follow-up questions and quality scores. For engineering / agentic-coding templates, translate the returned statement into a developer-oriented **problem frame** before showing it. Do not default to "How might we…" unless the selected template is product/design oriented or the user asks for HMW phrasing.
|
|
@@ -984,7 +1007,8 @@ Rules:
|
|
|
984
1007
|
If the user asks for a refinement:
|
|
985
1008
|
|
|
986
1009
|
Call `mcp__ritual__refine_problem_statement` with:
|
|
987
|
-
- `workspace_id`, `raw_input`, `considerations`, `
|
|
1010
|
+
- `workspace_id`, `raw_input`, `considerations`, `sources` — unchanged. (Same `sources` as the original generate call — keeps the KG anchor stable.)
|
|
1011
|
+
- `template_id` — same rule as Step 4 / Step 5.1: omit unless the user explicitly overrode; if you passed it to the original `generate_problem_statement` call, pass the same value here for symmetry.
|
|
988
1012
|
- `previous_problem_statement`: the FULL TEXT of the current best draft
|
|
989
1013
|
- `change_prompt`: the user's request verbatim
|
|
990
1014
|
- `version`: optional telemetry only; do not show version labels to the user
|
|
@@ -1014,7 +1038,7 @@ Call `mcp__ritual__create_exploration` with:
|
|
|
1014
1038
|
- `workspace_id`
|
|
1015
1039
|
- `name`
|
|
1016
1040
|
- `problem_statement` (the scope from Step 5)
|
|
1017
|
-
- `template_id` — **
|
|
1041
|
+
- `template_id` — **OPTIONAL.** Per Step 2, omit by default. The server resolves from `explicit dto.templateId → workspace.defaultTemplateId → user.persona → first SYSTEM template`, then forks the resolved template into a per-exploration Template row atomically inside this same `create_exploration` request. Pass `template_id` ONLY when the user explicitly overrides on the CLI (`/ritual build --template-id <id>`). If you passed `template_id` to Step 4's `generate_considerations`, pass the same value here so the LLM prompt context the considerations were generated under matches the exploration's stamped template. Do NOT read `.ritual/config.json` or invent a `template_id` from persona — the server does the resolution.
|
|
1018
1042
|
- `agentic: false` — **do NOT** pass `agentic: true`. We want explicit per-step control so the user gets to pick discovery questions in Step 7. Auto-agentic skips that.
|
|
1019
1043
|
|
|
1020
1044
|
Store `exploration_id`. Move the progress header from Scope to Discovery:
|
|
@@ -1046,6 +1070,33 @@ This keeps the repo root clean (CLI Tenet #1 — files for reference, not clutte
|
|
|
1046
1070
|
|
|
1047
1071
|
If `git mv` fails (file wasn't tracked yet): use plain `mv` instead — same outcome, the user just commits the move whenever they next commit.
|
|
1048
1072
|
|
|
1073
|
+
##### 6.2 — Register staged knowledge sources (load-bearing)
|
|
1074
|
+
|
|
1075
|
+
If Step 3.5 staged any knowledge sources in working memory (PRDs / tickets / transcripts / etc.), register them NOW that `exploration_id` exists. The staging step deliberately deferred the MCP call because `add_knowledge_source` requires an exploration to attach to — this is where the deferral resolves.
|
|
1076
|
+
|
|
1077
|
+
For each staged record from § 3.5.3, call `mcp__ritual__add_knowledge_source` with:
|
|
1078
|
+
|
|
1079
|
+
- `exploration_id` (from Step 6)
|
|
1080
|
+
- `source_content_type` (from the staged record)
|
|
1081
|
+
- `content` (the full text the agent obtained)
|
|
1082
|
+
- `title` (from the staged record)
|
|
1083
|
+
- `source_url` / `source_path` (whichever applies, optional)
|
|
1084
|
+
- `origin_feature: 'DISCOVERY'`
|
|
1085
|
+
|
|
1086
|
+
Fire these in parallel — they're independent inserts + async extraction kickoffs. Cap concurrency at 5 if the user staged more than that (rare).
|
|
1087
|
+
|
|
1088
|
+
Surface a single compact summary after all registrations resolve:
|
|
1089
|
+
|
|
1090
|
+
> Attached {N} knowledge source{s} to the exploration: {comma-separated titles, truncated to 80 chars total}. Extraction running in the background.
|
|
1091
|
+
|
|
1092
|
+
**Failure handling:** if any `add_knowledge_source` call fails (network / 4xx / 5xx), retry once. On a second failure, surface a one-line note and continue — do NOT block the build flow on a knowledge-source registration failure:
|
|
1093
|
+
|
|
1094
|
+
> ⚠ Couldn't register `{title}` ({error in 1 sentence}). The exploration is still usable; you can re-add the ref later with `/ritual context-pulse <exploration> --add-ref {path}`.
|
|
1095
|
+
|
|
1096
|
+
**Skip path:** if Step 3.5 was skipped (user said "skip" / "none" / "later"), there are no staged records and this step is a silent no-op. Do NOT prompt the user again — they already declined at Step 3.5.
|
|
1097
|
+
|
|
1098
|
+
**Why this lives at 6.2, not inside `create_exploration`:** sources are deliberately decoupled from the exploration row so a partial source-registration failure doesn't block exploration creation. Step 6 must always succeed if the underlying validation passes; Step 6.2 is best-effort on top.
|
|
1099
|
+
|
|
1049
1100
|
#### Step 6.5 — Preserve unpicked considerations without cluttering the workspace
|
|
1050
1101
|
|
|
1051
1102
|
Unpicked or dismissed considerations are useful signal, but automatically creating sibling explorations can clutter the workspace. Do **not** fork sibling explorations by default.
|
|
@@ -1843,7 +1894,7 @@ If you only want a subset, `drop` the recs you don't want first, then `accept re
|
|
|
1843
1894
|
|
|
1844
1895
|
Notes on the detail card:
|
|
1845
1896
|
|
|
1846
|
-
- **
|
|
1897
|
+
- **Per-rec and subset accept are first-class CTAs as of cli 0.9.6.** The MCP `accept_recommendations` tool now takes an optional `recommendation_ids: string[]` param: omit it to bulk-accept everything (legacy), or pass a subset to promote only those rec IDs. Surface `accept R7` (single from detail), `accept R5,R8,R12` (subset from landing), and `accept recommended` (all) as the three accept-shaped CTAs. The agent accumulates the approved subset across the one-by-one walk-through and submits ONE batch call at the end — not N individual calls.
|
|
1847
1898
|
- The 4-line "Why this" block is a transformation of the chained-arrow `rationale` string. The arrow chain is fine as a one-line summary at the very bottom if helpful, but the 4-named-line form is the primary readable shape.
|
|
1848
1899
|
- `Tactics` and `Acceptance criteria` are related but distinct: tactics are SHORT IMPERATIVE STEPS ("Call Django authenticate() / login() through configured backends"); acceptance criteria are PASS CONDITIONS ("Valid inline registration creates exactly one user and authenticates the session").
|
|
1849
1900
|
- `References` come from `metadata.explainability.faq_references` (subject + question text) AND `referenced_faq_ids` (which the agent can resolve back to the underlying source files / RBs if known).
|
|
@@ -1855,20 +1906,23 @@ Visible CTAs in 9.1 / 9.3 map to MCP/API actions. Some are direct, some require
|
|
|
1855
1906
|
|
|
1856
1907
|
| User reply | Action | Backing call |
|
|
1857
1908
|
|---|---|---|
|
|
1858
|
-
| `accept recommended` | Accept ALL recs currently on screen | `mcp__ritual__accept_recommendations(exploration_id)` (admin only
|
|
1909
|
+
| `accept recommended` | Accept ALL recs currently on screen | `mcp__ritual__accept_recommendations({ exploration_id })` (omit `recommendation_ids` — admin only, see Branch B) |
|
|
1910
|
+
| `accept R{N}` (from detail) | Mark that single rec approved (batch of 1) | `mcp__ritual__accept_recommendations({ exploration_id, recommendation_ids: [rec_uuid_for_R{N}] })`. Exploration stays in REVIEWING_RECOMMENDATIONS if other recs remain in draft/pending; transitions to COMPLETE once nothing remains. |
|
|
1911
|
+
| `accept R{N},R{M},R{P}` (subset from landing) | Mark that subset approved (batch of N) | `mcp__ritual__accept_recommendations({ exploration_id, recommendation_ids: [rec_uuids…] })`. Single round-trip — don't loop N calls. |
|
|
1859
1912
|
| `detail R{N}` | Render the detail card for that rec | None (in-memory) |
|
|
1860
|
-
| `accept R{N}` (from detail) | Mark that single rec approved | **No direct single-rec API today — NOT shown as a visible CTA.** If user types it anyway, explain: "I can accept all 11 now via `accept recommended`, or you can `drop` the ones you don't want first." See backlog. |
|
|
1861
1913
|
| `change R{N}: <edit>` | Regenerate that single rec with the user's hint | `mcp__ritual__regenerate_recommendation(recommendation_id, hint)` if available; else queue as a comment + ask the user to wait for re-gen |
|
|
1862
1914
|
| `drop R{N}` | Mark that rec rejected | `update_recommendation` with status=rejected, OR add a "deliberately excluded" note for the brief generator |
|
|
1863
1915
|
| `add <topic>` | Request a new rec on the topic | See § 9.1 note — typically requires full regenerate with the new topic pinned; SKILL surfaces the choice to the user before triggering |
|
|
1864
1916
|
| `show scope` | Expand the scope reference | None (in-memory) |
|
|
1865
1917
|
| `hold` | Stop here without accepting | None (exits the flow; user can resume later) |
|
|
1866
1918
|
|
|
1867
|
-
Don't display all aliases. Display the
|
|
1919
|
+
Don't display all aliases. Display the most-likely-needed: `accept recommended`, `accept R{N}` (single), `detail R{N}`, `drop R{N}`, `hold`. Show `accept R{N},R{M}` (subset), `change R{N}: <edit>`, and `add <topic>` in the detail card or as a one-line hint when the landing screen is presented for the second time (the user knows the basics by then).
|
|
1920
|
+
|
|
1921
|
+
**Subset-accept agent behavior — one call, not N:** when the user types `accept R5,R8,R12` (or accumulates approvals across the one-by-one walkthrough), the agent collects the rec UUIDs in memory and submits a SINGLE `accept_recommendations({ exploration_id, recommendation_ids })` call. Do not loop and call the tool once per rec — the API + downstream artifact-trigger is designed for one batch per "user is done with this set" event. Multiple calls inflate latency, multiply the triage-complete event emission, and cause duplicate auto-artifact queueing.
|
|
1868
1922
|
|
|
1869
1923
|
**Backlog notes** (referenced for the agent so it doesn't over-promise):
|
|
1870
|
-
- Single-rec `accept R7` from the detail card doesn't have a direct API endpoint — today the user can either accept ALL or none. Surface this honestly: "I can accept all 11 now, or you can drop the ones you don't want and then accept the rest."
|
|
1871
1924
|
- `add <topic>` requires a regenerate with a pinned topic — that's a forthcoming `regenerate_recommendation` improvement; until then it's a full regeneration cycle.
|
|
1925
|
+
- Per-rec MCP `reject` (status=rejected) doesn't have a dedicated MCP tool yet. For now, `drop R{N}` is handled via the web's per-rec PATCH OR by the user simply not including it in the batch-accept call (it stays in draft/pending until the user explicitly accepts or rejects it). Adding `reject_recommendation` MCP tool is on the backlog.
|
|
1872
1926
|
|
|
1873
1927
|
##### 9.A — Branch A: admin replies `accept recommended`
|
|
1874
1928
|
|
|
@@ -1964,7 +2018,176 @@ Steps:
|
|
|
1964
2018
|
|
|
1965
2019
|
4. **Special case — Branch B from Step 9 (collaborator did NOT call accept_recommendations):** there's no fire-and-forget auto-trigger because accept never ran. Skip the polling entirely and let Step 10's auto-trigger handle requirement generation inline. The brief call will take ~30s longer than it otherwise would.
|
|
1966
2020
|
|
|
1967
|
-
5. When `status === 'READY'`, tell the user one line ("Requirements ready
|
|
2021
|
+
5. When `status === 'READY'`, tell the user one line ("Requirements ready…") and continue to Step 9.6 (if anti-goals exist) OR directly to Step 10 (if no anti-goals, audit step is skipped silently).
|
|
2022
|
+
|
|
2023
|
+
#### Step 9.6 — Audit the recommendations + requirements against declared anti-goals (load-bearing — audit-repair loop)
|
|
2024
|
+
|
|
2025
|
+
Run a constraint-survival audit on the typed Recommendation + Requirement substrate BEFORE brief generation. The audit answers the question: *"Did the anti-goal directives the user declared actually constrain the recs+reqs, or are they decorative?"* — the R4 operator (constraint-perturbation) applied to the (anti-goals, recs+reqs, R4) triple per the audit-triple-framing rule.
|
|
2026
|
+
|
|
2027
|
+
**Why this is load-bearing**: an inert anti-goal — declared but not actually constraining anything in the recs+reqs — propagates downstream as an unconstrained brief. By Step 11 (implementation) it's too late; the agent codes against a substrate whose forbidden states were never enforced. The audit catches inert directives at the upstream typed substrate where the fix is cheap (rec content edit), not at the brief markdown where the fix is expensive (full regen).
|
|
2028
|
+
|
|
2029
|
+
**Skip condition**: if the exploration has zero anti-goals (`set_anti_goals` was never called OR all anti-goals are `confidence < 0.4`) OR no APPROVED recommendations exist OR the latest RequirementSet isn't READY, skip this step silently and continue to Step 10. The audit tool returns 404 in any of those cases; check the substrate state first if unsure.
|
|
2030
|
+
|
|
2031
|
+
**Build modes** (per `documents/architecture/audit-suite.md` § 7a) — the gate prompt below renders differently depending on which mode flag the user invoked:
|
|
2032
|
+
|
|
2033
|
+
| Mode | Prompt behavior | Default on enter |
|
|
2034
|
+
|---|---|---|
|
|
2035
|
+
| bare `/ritual build` | Compact opt-in: "Reply `audit` or `proceed`" | `proceed` |
|
|
2036
|
+
| `/ritual build --audited` | Elevated: "Recommended: run constraint-survival audit. Reply `audit`, `proceed`, or `always audit for this build`" | Awaits user input (no implicit default) |
|
|
2037
|
+
| `/ritual build --audit=strict` | Audit auto-runs; user sees results + repair menu, not the gate prompt | N/A (no gate prompt rendered) |
|
|
2038
|
+
|
|
2039
|
+
`auditMode` is read from working memory (set at Step 0 from the user's invocation flags). Mid-flow, `always audit for this build` upgrades the session to `--audit=strict` behavior for any remaining audit gates (Audit 2 at Step 10b.5, Audit 3 at Step 11.1 — both PR B/C).
|
|
2040
|
+
|
|
2041
|
+
**Strict mode time budget**: each audit chain runs up to 3 iterations of verifier calls (~5-15s per iteration × 3 = ~15-45s typical). Hard wall-clock cap of 90s per chain — on timeout, the gate degrades to `--audited` behavior (surface findings, let user decide rather than block the build).
|
|
2042
|
+
|
|
2043
|
+
### Step 9.6.1 — Render the gate prompt (mode-aware)
|
|
2044
|
+
|
|
2045
|
+
**For `bare` mode:**
|
|
2046
|
+
|
|
2047
|
+
```text
|
|
2048
|
+
Recommendations + requirements are ready. Optional constraint-survival audit available.
|
|
2049
|
+
|
|
2050
|
+
Reply `audit` to run, or `proceed` to skip to brief generation.
|
|
2051
|
+
```
|
|
2052
|
+
|
|
2053
|
+
**For `--audited` mode:**
|
|
2054
|
+
|
|
2055
|
+
```text
|
|
2056
|
+
Recommendations + requirements are ready.
|
|
2057
|
+
|
|
2058
|
+
Recommended: run constraint-survival audit before brief generation.
|
|
2059
|
+
This checks whether anti-goals survived into the recs + requirements.
|
|
2060
|
+
|
|
2061
|
+
Reply `audit`, `proceed`, or `always audit for this build`.
|
|
2062
|
+
```
|
|
2063
|
+
|
|
2064
|
+
**For `--audit=strict` mode:** SKIP the prompt; jump directly to Step 9.6.2 (run the audit).
|
|
2065
|
+
|
|
2066
|
+
### Step 9.6.2 — Run the audit (when chosen or in strict mode)
|
|
2067
|
+
|
|
2068
|
+
Render:
|
|
2069
|
+
|
|
2070
|
+
```text
|
|
2071
|
+
Auditing recs + requirements against {N} declared anti-goal{s}…
|
|
2072
|
+
```
|
|
2073
|
+
|
|
2074
|
+
Call `mcp__ritual__audit_recommendations({ exploration_id })` with the default config (threshold mode, 80% acceptance threshold, max 3 iterations). The response shape:
|
|
2075
|
+
|
|
2076
|
+
```json
|
|
2077
|
+
{
|
|
2078
|
+
"chain_id": "ac-...",
|
|
2079
|
+
"audit_status": "ok" | "needs_attention" | "blocked",
|
|
2080
|
+
"iteration": 1,
|
|
2081
|
+
"findings": [
|
|
2082
|
+
{
|
|
2083
|
+
"repair_id": "ri-...",
|
|
2084
|
+
"after_audit_id": "...",
|
|
2085
|
+
"severity": "blocker" | "high" | "medium" | "low",
|
|
2086
|
+
"directive_text": "Audit log must be append-only.",
|
|
2087
|
+
"status": "inert" | "omitted" | "weakened" | "contradicted",
|
|
2088
|
+
"gap_kind": "global_inert" | "local_gap" | "weak_coupling" | "contradiction",
|
|
2089
|
+
"affected_entities": [{"entity_type": "recommendation", "entity_id": "..."}],
|
|
2090
|
+
"message": "Anti-goal #2 is referenced but not by the entity it most-applies-to — ...",
|
|
2091
|
+
"auto_dispatchable": true | false
|
|
2092
|
+
}
|
|
2093
|
+
],
|
|
2094
|
+
"summary": {
|
|
2095
|
+
"total_constraints": 7,
|
|
2096
|
+
"survival_rate_percent": 57,
|
|
2097
|
+
"by_severity": { "blocker": 1, "high": 0, "medium": 2, "low": 0 },
|
|
2098
|
+
"by_gap_kind": { "global_inert": 1, "local_gap": 2, "weak_coupling": 0, "contradiction": 0 }
|
|
2099
|
+
},
|
|
2100
|
+
"decision_reason": "...",
|
|
2101
|
+
"attestation_digest": "sha256:...",
|
|
2102
|
+
"next_step_hint": "..."
|
|
2103
|
+
}
|
|
2104
|
+
```
|
|
2105
|
+
|
|
2106
|
+
### Step 9.6.3 — Render the findings + repair-action menu
|
|
2107
|
+
|
|
2108
|
+
Render based on `audit_status`:
|
|
2109
|
+
|
|
2110
|
+
**`audit_status: "ok"`** — survival rate met threshold AND no blockers. Render one line and proceed silently to Step 10:
|
|
2111
|
+
|
|
2112
|
+
```text
|
|
2113
|
+
✓ Audit passed: {survival_rate_percent}% of {total_constraints} anti-goals preserved. Chain accepted.
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
**`audit_status: "needs_attention"` or `"blocked"`** — surface the findings inline so the user sees them before deciding:
|
|
2117
|
+
|
|
2118
|
+
```text
|
|
2119
|
+
⚠ Audit — {iteration} of {max_iterations} — {audit_status}
|
|
2120
|
+
|
|
2121
|
+
{survival_rate_percent}% of {total_constraints} anti-goals preserved.
|
|
2122
|
+
Findings ({findings.length} total):
|
|
2123
|
+
{for each finding, severity-prefixed (⛔ blocker / ⚠ high / · medium / · low):}
|
|
2124
|
+
{severity_glyph} {repair_id} — {directive_text}
|
|
2125
|
+
status: {status} · gap: {gap_kind} · affects: {affected_entities.length} entit{ies/y}
|
|
2126
|
+
{message[:120]}…
|
|
2127
|
+
|
|
2128
|
+
Reply:
|
|
2129
|
+
· `resolve all` — apply all auto-dispatchable repairs, re-audit
|
|
2130
|
+
(recommended — your config has blocker findings
|
|
2131
|
+
set to always_resolve)
|
|
2132
|
+
· `resolve {repair_id}` — apply a single repair (good for inspection)
|
|
2133
|
+
· `waive {repair_id}: <reason>`
|
|
2134
|
+
— record explicit acceptance of one finding;
|
|
2135
|
+
document the gap and continue
|
|
2136
|
+
· `accept` — accept current substrate, document all remaining
|
|
2137
|
+
findings as gaps (BLOCKED while any
|
|
2138
|
+
blocker-severity finding remains; the chain
|
|
2139
|
+
config enforces this)
|
|
2140
|
+
· `show chain` — render the full audit chain trail
|
|
2141
|
+
(calls get_audit_chain)
|
|
2142
|
+
· `pause` — stop here; resume via /ritual resume
|
|
2143
|
+
```
|
|
2144
|
+
|
|
2145
|
+
**On `resolve all`** — for each `auto_dispatchable: true` finding, call `mcp__ritual__apply_repair({ repair_id, chain_id, after_audit_id })`. Each call returns:
|
|
2146
|
+
|
|
2147
|
+
```json
|
|
2148
|
+
{
|
|
2149
|
+
"action_id": "ra-...",
|
|
2150
|
+
"action": "apply",
|
|
2151
|
+
"status": "applied",
|
|
2152
|
+
"next_iteration_id": "...",
|
|
2153
|
+
"hint": "Re-audit ran (SurvivalReport ...). Call get_audit_chain with chain_id=... to see the updated trail and whether the chain accepted."
|
|
2154
|
+
}
|
|
2155
|
+
```
|
|
2156
|
+
|
|
2157
|
+
Apply-repair is sequential per finding; the server runs the next audit iteration inline after each successful apply, so just call them in order. After the last `auto_dispatchable: true` finding, call `mcp__ritual__get_audit_chain({ chain_id })` to fetch the final state and re-render the loop UX with the new survival rate. If `chain_status === 'accepted'` after this round, proceed to Step 10; otherwise re-render the findings (the chain may have iterated and produced new findings the next iteration surfaces).
|
|
2158
|
+
|
|
2159
|
+
**On `resolve {repair_id}`** — single-finding apply. Same dispatch shape; render the next iteration's findings on completion.
|
|
2160
|
+
|
|
2161
|
+
**On `waive {repair_id}: <reason>`** — `apply_repair({ repair_id, chain_id, after_audit_id, action: 'waive', waive_reason: '<reason>' })`. No re-audit; render confirmation + return to the loop UX.
|
|
2162
|
+
|
|
2163
|
+
**On `accept`** — only allowed when no `blocker`-severity findings remain (the L1 tool returns `audit_status: "blocked"` while they do). Surface a single confirm: *"Accepting substrate with {findings.length} documented gap(s). Proceed?"* On yes, proceed to Step 10. The audit chain's final state is recorded; future `/ritual lineage` on this exploration surfaces the chain trail + the gaps the user explicitly accepted.
|
|
2164
|
+
|
|
2165
|
+
**On `show chain`** — render the full trail (iterations + repairs + status) from `get_audit_chain`. Keep it compact: one line per iteration + one line per repair. Then re-render the loop UX so the user can pick their next action.
|
|
2166
|
+
|
|
2167
|
+
**On `pause`** — stop here. Chain stays `in_progress`; resume via `/ritual resume`.
|
|
2168
|
+
|
|
2169
|
+
**On `halt_unresolvable`** (chain reached `max_iterations` with unresolved must-resolve findings) — the L1 tool returns `audit_status: "blocked"` and the chain is terminated. Surface:
|
|
2170
|
+
|
|
2171
|
+
```text
|
|
2172
|
+
⛔ Audit halted after {max_iterations} iterations — {n_blockers} blocker(s) unresolved.
|
|
2173
|
+
|
|
2174
|
+
The repair loop didn't converge. Options:
|
|
2175
|
+
· `extend max-iterations <N>` — re-run the audit with a higher cap (creates a new chain)
|
|
2176
|
+
· `force accept` — proceed to Step 10 with the substrate as-is; remaining
|
|
2177
|
+
blockers are recorded on the chain trail but no longer
|
|
2178
|
+
gate the build flow
|
|
2179
|
+
· `pause` — stop here for human review
|
|
2180
|
+
```
|
|
2181
|
+
|
|
2182
|
+
**Special: contradiction-class findings** — when a finding has `gap_kind: "contradiction"`, it surfaces as `auto_dispatchable: false`. The repair (`replace_recommendation`) IS implemented and CAN be applied via `apply_repair {repair_id}`, but `resolve all` skips it because replacing a rec is a structural change worth explicit user consent. The SKILL should render contradiction findings with an explicit "needs review" prefix:
|
|
2183
|
+
|
|
2184
|
+
```text
|
|
2185
|
+
⛔ {repair_id} — CONTRADICTION — {directive_text}
|
|
2186
|
+
A rec actively violates this directive. `replace_recommendation` will regenerate the rec
|
|
2187
|
+
under the constraint. Confirm by replying `resolve {repair_id}` explicitly.
|
|
2188
|
+
```
|
|
2189
|
+
|
|
2190
|
+
**Verifier-generator separation**: the audit's verifier model is automatically resolved by the server to a different family than whichever model generated the recs — agents don't need to manage this; it's enforced at the API. The audit's attestation digest records both model ids for post-hoc auditability.
|
|
1968
2191
|
|
|
1969
2192
|
#### Step 10 — Generate the build brief
|
|
1970
2193
|
|
|
@@ -2655,7 +2878,7 @@ This subcommand exclusively uses Ritual MCP tools, in the order they appear:
|
|
|
2655
2878
|
4. `mcp__ritual__suggest_high_leverage_problems` (Step 1.5 step 6b — option 3, "help me find the highest-leverage thing")
|
|
2656
2879
|
5. `mcp__ritual__check_exploration_overlap` (Step 1.5 step 8 — pre-creation overlap detection before "start fresh")
|
|
2657
2880
|
5a. `mcp__ritual__archive_exploration` (Step 1.5 step 6a — soft-delete a duplicate/misfire when user picks `delete N` from the resume menu)
|
|
2658
|
-
6.
|
|
2881
|
+
6. ~~`mcp__ritual__list_templates`~~ — **REMOVED 2026-05-21 (CLI 0.9.0+).** Step 2 is now server-side template resolution; the tool is no longer registered on the MCP surface. Do not call it. See Step 2 § "Rewritten 2026-05-21" for the rationale.
|
|
2659
2882
|
7. `mcp__ritual__generate_considerations` (Step 4)
|
|
2660
2883
|
8. `mcp__ritual__refine_considerations` (Step 4.2, iteration only)
|
|
2661
2884
|
9. `mcp__ritual__generate_problem_statement` (Step 5)
|
|
@@ -2679,11 +2902,16 @@ This subcommand exclusively uses Ritual MCP tools, in the order they appear:
|
|
|
2679
2902
|
24. `mcp__ritual__generate_build_brief` (Step 10a)
|
|
2680
2903
|
24a. `mcp__ritual__get_build_brief_status` (Step 10b — timeout-recovery polling, OR proactive cache-hit check before 10a)
|
|
2681
2904
|
24d. `mcp__ritual__sync_brief_review` (Step 10b.5 — sync `BUILD-BRIEF-VERIFICATION.md` to KG; AND Step 10.5 — sync `UX-REVIEW.md` to KG)
|
|
2682
|
-
24b. `mcp__ritual__add_knowledge_source` (Step
|
|
2905
|
+
24b. `mcp__ritual__add_knowledge_source` (Step 6.2 — register staged knowledge sources after `create_exploration` returns `exploration_id`; staging happens at Step 3.5)
|
|
2683
2906
|
24c. `mcp__ritual__list_knowledge_sources` (used inline by Step 3.5 to show already-attached refs on resume; also called by `/ritual context-pulse` CP2 for Reference Grounding count)
|
|
2907
|
+
24e. `mcp__ritual__audit_recommendations` (Step 9.6 — start an audit chain on the (anti-goals, typed recs+reqs, R4) triple; cli 0.10.0+)
|
|
2908
|
+
24f. `mcp__ritual__apply_repair` (Step 9.6 — apply or waive a structured repair instruction returned by an audit iteration; cli 0.10.0+)
|
|
2909
|
+
24g. `mcp__ritual__get_audit_chain` (Step 9.6 — fetch the full chain trail for review/lineage; cli 0.10.0+)
|
|
2684
2910
|
25. `mcp__ritual__sync_implementation` (Step 12)
|
|
2685
2911
|
|
|
2686
|
-
|
|
2912
|
+
35 of the 46 Ritual MCP tools (cli 0.10.0+: the 3 new audit tools — `audit_recommendations`, `apply_repair`, `get_audit_chain` — joined the linear flow at Step 9.6 (audit-suite.md § Audit 1)). The other 11 (`ping`, `get_exploration`, `list_agentic_runs`, `add_collaborator`, `check_anti_goals`, `query_knowledge_graph`, `get_workspace_overview`, `get_knowledge_source`, `remove_knowledge_source`, `get_recommendation_attestation`, `score_context_pulse`) are situational, not part of the linear build flow.
|
|
2913
|
+
|
|
2914
|
+
**Note on `check_anti_goals` vs `audit_recommendations`:** these are distinct tools. `check_anti_goals` is the older, single-shot validation tool (read-tier; one LLM call, no chain rows) used ad-hoc to validate a proposal against an exploration's current anti-goal set. `audit_recommendations` (cli 0.10.0+, write-tier) starts a stateful `AuditChain` that runs R4 (constraint-perturbation) against a brief, produces structured `SurvivalReport` + `RepairInstruction` rows, and supports the apply/waive repair loop. Use `check_anti_goals` for one-shot proposal validation; use `audit_recommendations` for chain-tracked constraint-survival audits of a brief.
|
|
2687
2915
|
|
|
2688
2916
|
### After this subcommand
|
|
2689
2917
|
|