@ritualai/cli 0.11.0 → 0.24.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/dist/commands/doctor.js +59 -23
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +33 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.js +114 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agents/providers.js +44 -4
- package/dist/lib/agents/providers.js.map +1 -1
- package/dist/lib/memory-update.js +158 -0
- package/dist/lib/memory-update.js.map +1 -0
- package/dist/lib/uninstall-plan.js +102 -0
- package/dist/lib/uninstall-plan.js.map +1 -0
- package/package.json +1 -1
- package/skills/claude-code/ritual/.ritual-bundle.json +2 -2
- package/skills/claude-code/ritual/SKILL.md +14 -11
- package/skills/claude-code/ritual/manifest.json +0 -5
- package/skills/claude-code/ritual/references/async-polling.md +5 -5
- package/skills/claude-code/ritual/references/build-flow.md +513 -494
- package/skills/claude-code/ritual/references/change-preflight.md +81 -0
- package/skills/claude-code/ritual/references/cli-output-contract.md +2 -2
- package/skills/claude-code/ritual/references/context-pulse-flow.md +0 -1
- package/skills/claude-code/ritual/references/lite-flow.md +2781 -0
- package/skills/claude-code/ritual/references/scoring-fallback.md +1 -1
- package/skills/codex/ritual/.ritual-bundle.json +2 -2
- package/skills/codex/ritual/SKILL.md +14 -11
- package/skills/codex/ritual/manifest.json +0 -5
- package/skills/codex/ritual/references/async-polling.md +5 -5
- package/skills/codex/ritual/references/build-flow.md +513 -494
- package/skills/codex/ritual/references/change-preflight.md +81 -0
- package/skills/codex/ritual/references/cli-output-contract.md +2 -2
- package/skills/codex/ritual/references/context-pulse-flow.md +0 -1
- package/skills/codex/ritual/references/lite-flow.md +2781 -0
- package/skills/codex/ritual/references/scoring-fallback.md +1 -1
- package/skills/cursor/ritual/.ritual-bundle.json +2 -2
- package/skills/cursor/ritual/SKILL.md +14 -11
- package/skills/cursor/ritual/manifest.json +0 -5
- package/skills/cursor/ritual/references/async-polling.md +5 -5
- package/skills/cursor/ritual/references/build-flow.md +513 -494
- package/skills/cursor/ritual/references/change-preflight.md +81 -0
- package/skills/cursor/ritual/references/cli-output-contract.md +2 -2
- package/skills/cursor/ritual/references/context-pulse-flow.md +0 -1
- package/skills/cursor/ritual/references/lite-flow.md +2781 -0
- package/skills/cursor/ritual/references/scoring-fallback.md +1 -1
- package/skills/gemini/ritual/.ritual-bundle.json +2 -2
- package/skills/gemini/ritual/SKILL.md +14 -11
- package/skills/gemini/ritual/manifest.json +0 -5
- package/skills/gemini/ritual/references/async-polling.md +5 -5
- package/skills/gemini/ritual/references/build-flow.md +513 -494
- package/skills/gemini/ritual/references/change-preflight.md +81 -0
- package/skills/gemini/ritual/references/cli-output-contract.md +2 -2
- package/skills/gemini/ritual/references/context-pulse-flow.md +0 -1
- package/skills/gemini/ritual/references/lite-flow.md +2781 -0
- package/skills/gemini/ritual/references/scoring-fallback.md +1 -1
- package/skills/kiro/ritual/.ritual-bundle.json +2 -2
- package/skills/kiro/ritual/SKILL.md +14 -11
- package/skills/kiro/ritual/manifest.json +0 -5
- package/skills/kiro/ritual/references/async-polling.md +5 -5
- package/skills/kiro/ritual/references/build-flow.md +513 -494
- package/skills/kiro/ritual/references/change-preflight.md +81 -0
- package/skills/kiro/ritual/references/cli-output-contract.md +2 -2
- package/skills/kiro/ritual/references/context-pulse-flow.md +0 -1
- package/skills/kiro/ritual/references/lite-flow.md +2781 -0
- package/skills/kiro/ritual/references/scoring-fallback.md +1 -1
- package/skills/vscode/ritual/.ritual-bundle.json +2 -2
- package/skills/vscode/ritual/SKILL.md +14 -11
- package/skills/vscode/ritual/manifest.json +0 -5
- package/skills/vscode/ritual/references/async-polling.md +5 -5
- package/skills/vscode/ritual/references/build-flow.md +513 -494
- package/skills/vscode/ritual/references/change-preflight.md +81 -0
- package/skills/vscode/ritual/references/cli-output-contract.md +2 -2
- package/skills/vscode/ritual/references/context-pulse-flow.md +0 -1
- package/skills/vscode/ritual/references/lite-flow.md +2781 -0
- package/skills/vscode/ritual/references/scoring-fallback.md +1 -1
- package/skills/claude-code/ritual/references/discovery-classification.md +0 -175
- package/skills/codex/ritual/references/discovery-classification.md +0 -175
- package/skills/cursor/ritual/references/discovery-classification.md +0 -175
- package/skills/gemini/ritual/references/discovery-classification.md +0 -175
- package/skills/kiro/ritual/references/discovery-classification.md +0 -175
- package/skills/vscode/ritual/references/discovery-classification.md +0 -175
|
@@ -51,7 +51,7 @@ Use explicit **[USER PAUSE]** only at decision gates. Pause when the user must c
|
|
|
51
51
|
|
|
52
52
|
### CLI and async guardrails
|
|
53
53
|
|
|
54
|
-
Follow `references/cli-output-contract.md` for terminal output, dense-list formatting, user-facing vocabulary, and the no-internal-step-label rule. Follow `references/async-polling.md` for every long-running server operation.
|
|
54
|
+
Follow `references/cli-output-contract.md` for terminal output, dense-list formatting, user-facing vocabulary, and the no-internal-step-label rule. Follow `references/async-polling.md` for every long-running server operation. Whenever the user asks to **change or add** something via free text (refine sub-problems, reframe scope, add an anti-goal), follow `references/change-preflight.md` — restate the request and show the exact instruction before calling the mutating tool, and wait for confirmation. It is a hard pause even in auto-mode.
|
|
55
55
|
|
|
56
56
|
#### Step 0 — Auto-mode heads-up (informational, NOT a pause)
|
|
57
57
|
|
|
@@ -107,6 +107,17 @@ Persist `auditMode` to `Exploration.metadata.auditMode` at `create_exploration`
|
|
|
107
107
|
|
|
108
108
|
#### Step 1 — Pick a workspace
|
|
109
109
|
|
|
110
|
+
<!-- skill-options:no-gate-change: connection-freshness ping check is a non-interactive warn, adds no user-facing gate or option -->
|
|
111
|
+
**Connection freshness check (one-time, warn-only) — fire on your FIRST MCP call this session.** Alongside the first `list_workspaces` call below, call `mcp__ritual__ping` **once** and inspect the returned identity:
|
|
112
|
+
|
|
113
|
+
- If the response is **missing `gitSha` or `toolContractHash`**, or reports **`version: "1.0.0"`** (the legacy hardcoded value), the user is connected to an **outdated / legacy Ritual MCP** — emit exactly ONE line, then continue normally (warn-only, never block):
|
|
114
|
+
|
|
115
|
+
`⚠ Connected to an outdated Ritual MCP (no build identity) — some build features may be unavailable. Run \`ritual doctor\` to check, then \`ritual init\` if it flags a refresh.`
|
|
116
|
+
|
|
117
|
+
- Otherwise (identity present and not legacy), say nothing and proceed.
|
|
118
|
+
|
|
119
|
+
Do this **at most once per session** — don't re-ping on later steps.
|
|
120
|
+
|
|
110
121
|
Resolution order:
|
|
111
122
|
|
|
112
123
|
1. **Project-bound workspace (preferred).** Check for a `.ritual/config.json` at the project root (you can use the Read tool — the file is a small JSON with `workspaceId` + `workspaceName`). If it exists, that's the workspace this repo is bound to. Use it without pausing.
|
|
@@ -278,7 +289,7 @@ Steps:
|
|
|
278
289
|
- Use the state badge to decide which step to jump to (see "Suggested next action" column above).
|
|
279
290
|
- Skip ahead in this skill — don't re-run Steps 2-9 for an exploration that already has them done.
|
|
280
291
|
- For `ready` or `in_flight` states, jump directly to Step 10 (build brief generation).
|
|
281
|
-
- For `awaiting_admin`, jump to Step 9 (review +
|
|
292
|
+
- For `awaiting_admin`, jump to Step 9 (review + `proceed`). Only an admin can move it forward; collaborators see the recs and proceed only if they're explicitly authorized to implement ahead.
|
|
282
293
|
- For `implemented_ahead`, surface the situation to the user and ask what to do — typically the admin reconciles by either approving the recs post-hoc (no code change needed) or updating the recs to match shipped reality.
|
|
283
294
|
- **For `done` or `in_flight` — branch-existence sanity check FIRST.** *(CLI Tenet #9 — sanity-check the world before trusting the database.)* The state badge is computed from `ImplementationRecord` rows in the KG. If the KG was seeded from synthetic/bootstrap data (a common state in early pilot deployments), the record can assert a PR/branch that doesn't exist in this repo. Before treating the exploration as ✓ shipped, verify:
|
|
284
295
|
|
|
@@ -885,6 +896,55 @@ If the user says "skip" / "none" / "later", proceed silently to Step 4. Do NOT p
|
|
|
885
896
|
|
|
886
897
|
The user can always come back later with `/ritual context-pulse <exploration>` to see the current Reference Grounding score, OR drag refs in mid-flow (e.g. at Step 8 if the agentic run surfaces a question that a PRD would have answered).
|
|
887
898
|
|
|
899
|
+
#### Step 3.9 — Classify the work item + pick the lead persona
|
|
900
|
+
|
|
901
|
+
Before generating sub-problems, settle **what job this is** and **whose lens leads it** — both shape
|
|
902
|
+
everything downstream, so they come first. **You** classify the job (you have the repo open — you're the
|
|
903
|
+
best-informed classifier, and doing it here saves a backend LLM call); the server returns the lenses.
|
|
904
|
+
|
|
905
|
+
1. **Classify the request** into ONE development work-item slug, using the user's raw ask + your code
|
|
906
|
+
recon:
|
|
907
|
+
|
|
908
|
+
```text
|
|
909
|
+
understand-codebase-area · design-technical-approach · create-implementation-plan ·
|
|
910
|
+
build-frontend-feature · build-backend-service · integrate-api · create-docs-site ·
|
|
911
|
+
refactor-code · debug-production-issue · improve-performance · add-tests · prepare-release
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
(Use `build-feature` only when the ask is a generic build that none of the specific jobs fit.) Pick the
|
|
915
|
+
single best match — e.g. "add OAuth to the dashboard" → `build-backend-service`; "the checkout page is
|
|
916
|
+
slow" → `improve-performance`; "clean up the payments module" → `refactor-code`.
|
|
917
|
+
|
|
918
|
+
2. **Call `mcp__ritual__work_item`** with that `jtbd` (and `entry_use_case` if known). It returns
|
|
919
|
+
`{ workItemLabel, deliverableTemplate, recommended, options: [{ persona, label, whenToChoose }] }` —
|
|
920
|
+
deterministic, no LLM, already biased by the user's `ritual init` persona.
|
|
921
|
+
|
|
922
|
+
3. **Present the work item + lens options** as a `(label + description)` bottom-drawer choice picker
|
|
923
|
+
(same shape as discovery picks, per `references/cli-output-contract.md`), recommended lens first and
|
|
924
|
+
marked:
|
|
925
|
+
|
|
926
|
+
```text
|
|
927
|
+
This looks like: Build backend service / API → Service Build Brief
|
|
928
|
+
Who's leading it? (recommended: Backend Developer)
|
|
929
|
+
|
|
930
|
+
1. Backend Developer — Best when you care about API contracts, data, transactions, scaling. ← recommended
|
|
931
|
+
2. Developer — Best when you care about feasibility, implementation correctness, shippability.
|
|
932
|
+
3. Eng Lead — Best when you care about technical approach, risk, sequencing, review.
|
|
933
|
+
|
|
934
|
+
Reply `use` to lead as Backend Developer, a number to switch, or name a lens.
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
4. **Default = the recommended lens.** An ambiguous reply (`use`/`ok`/`go`) accepts it. If the user says
|
|
938
|
+
the *work item* is wrong ("no, this is a refactor"), re-classify and call `work_item` again. If they
|
|
939
|
+
switch the *lens*, that's a change → run the change pre-flight (`references/change-preflight.md`) to
|
|
940
|
+
confirm before adopting it.
|
|
941
|
+
|
|
942
|
+
5. **Remember the chosen `persona` slug** — you pass it through to `create_exploration` as `lead_persona`
|
|
943
|
+
at Step 6. (It also carries into the generation prompts once persona-aware generation ships; for now
|
|
944
|
+
it's persisted + surfaced.)
|
|
945
|
+
|
|
946
|
+
Keep this light — one drawer, recommended pre-selected; most users accept. Don't belabour it.
|
|
947
|
+
|
|
888
948
|
#### Step 4 — Generate sub-problems
|
|
889
949
|
|
|
890
950
|
##### 4.1 First draft
|
|
@@ -938,6 +998,8 @@ Only the title line gets the number. Put a blank line between candidates. Do not
|
|
|
938
998
|
|
|
939
999
|
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.
|
|
940
1000
|
|
|
1001
|
+
**Pre-flight (mandatory):** before calling `refine_considerations`, run the change pre-flight in `references/change-preflight.md` — restate the change in the user's terms, show the exact `change_prompt` you're about to send, and wait for `yes`. This is a hard pause (even in auto-mode) and fires on every such request, including one-word ones. Do not call the tool until the user confirms.
|
|
1002
|
+
|
|
941
1003
|
Call `mcp__ritual__refine_considerations` with:
|
|
942
1004
|
- `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
1005
|
- `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.
|
|
@@ -1006,6 +1068,8 @@ Rules:
|
|
|
1006
1068
|
|
|
1007
1069
|
If the user asks for a refinement:
|
|
1008
1070
|
|
|
1071
|
+
**Pre-flight (mandatory):** before calling `refine_problem_statement`, run the change pre-flight in `references/change-preflight.md` — restate the change in the user's terms, show the exact `change_prompt` you're about to send, and wait for `yes`. This is a hard pause (even in auto-mode) and fires on every refinement request, including a one-word `tighten`/`broaden`. Do not call the tool until the user confirms.
|
|
1072
|
+
|
|
1009
1073
|
Call `mcp__ritual__refine_problem_statement` with:
|
|
1010
1074
|
- `workspace_id`, `raw_input`, `considerations`, `sources` — unchanged. (Same `sources` as the original generate call — keeps the KG anchor stable.)
|
|
1011
1075
|
- `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.
|
|
@@ -1026,7 +1090,7 @@ When the user locks the frame, store the final text as `problem_statement` for S
|
|
|
1026
1090
|
|
|
1027
1091
|
Generate a short name (≤60 chars) from the scope — typically the noun phrase, not the full HMW. E.g. "Reduce T2 customer churn in Q3" → name `T2 churn reduction (Q3)`.
|
|
1028
1092
|
|
|
1029
|
-
|
|
1093
|
+
Create the exploration immediately once the frame is locked — the work item + lead persona were already settled at Step 3.9, so do not add a *further* confirmation here. If a name is ambiguous, **choose the shortest clear noun phrase and continue without pausing** — the name is editable later and shouldn't become a decision gate. Do NOT rely on "proceed on Enter" or empty input in agent chat (see `references/cli-output-contract.md` § Surface-aware continuation prompts).
|
|
1030
1094
|
|
|
1031
1095
|
User-visible before the call, if needed:
|
|
1032
1096
|
|
|
@@ -1040,6 +1104,8 @@ Call `mcp__ritual__create_exploration` with:
|
|
|
1040
1104
|
- `problem_statement` (the scope from Step 5)
|
|
1041
1105
|
- `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.
|
|
1042
1106
|
- `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.
|
|
1107
|
+
- `jtbd` — **REQUIRED for `/ritual build`.** The work-item slug you classified at **Step 3.9** (e.g. `'build-backend-service'`, `'refactor-code'`, or `'build-feature'` for a generic build). Tags the exploration's job-to-be-done so the workflow surfaces the build-brief → code-plan → implement → PR deliverable phase across every surface (the Spark panel, etc.), not the generic produce-deliverable flow. Omit only if this is a non-build exploration (defaults to `produce-deliverable`).
|
|
1108
|
+
- `lead_persona` — the lens slug the user chose at **Step 3.9** (e.g. `'backend-developer'`). Pass the chosen `persona` from `work_item`. Omit only if Step 3.9 was skipped — the server then resolves the jtbd's canonical lens. Unknown slugs are ignored server-side.
|
|
1043
1109
|
|
|
1044
1110
|
Store `exploration_id`. Move the progress header from Scope to Discovery:
|
|
1045
1111
|
|
|
@@ -1097,6 +1163,7 @@ Surface a single compact summary after all registrations resolve:
|
|
|
1097
1163
|
|
|
1098
1164
|
**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
1165
|
|
|
1166
|
+
<!-- lite:skip-start reason="unpicked-consideration preservation is not part of lite" -->
|
|
1100
1167
|
#### Step 6.5 — Preserve unpicked considerations without cluttering the workspace
|
|
1101
1168
|
|
|
1102
1169
|
Unpicked or dismissed considerations are useful signal, but automatically creating sibling explorations can clutter the workspace. Do **not** fork sibling explorations by default.
|
|
@@ -1123,6 +1190,7 @@ If sibling creation is confirmed, call:
|
|
|
1123
1190
|
|
|
1124
1191
|
Then summarize the created siblings in the dense-list format. Do not pause after creation; return to the primary build flow.
|
|
1125
1192
|
|
|
1193
|
+
<!-- lite:skip-end -->
|
|
1126
1194
|
#### Step 7 — Discovery questions
|
|
1127
1195
|
|
|
1128
1196
|
Longest phase because generation is async + the user picks per-Area. (Internally the API field is `matter_id`; user-facing copy always says Area.)
|
|
@@ -1131,16 +1199,22 @@ Longest phase because generation is async + the user picks per-Area. (Internally
|
|
|
1131
1199
|
|
|
1132
1200
|
1. Call `mcp__ritual__suggest_discovery_questions(exploration_id)` (Step 7.1) — no user input needed; just kick it off.
|
|
1133
1201
|
2. Poll `mcp__ritual__get_discovery_state(exploration_id)` until `ready: true` (Step 7.2).
|
|
1134
|
-
3. Render the
|
|
1135
|
-
4. `[USER PAUSE]` — the user picks Areas
|
|
1136
|
-
5.
|
|
1137
|
-
6.
|
|
1138
|
-
|
|
1202
|
+
3. Render the **Area rail + Area 1's questions together** and walk Area-by-Area per § 7.3.1 (the rail orients; a rail with NO questions under it — a bare index — is the failure mode).
|
|
1203
|
+
4. `[USER PAUSE]` — the user picks questions across Areas (**floor: 6 to run; aim for 15–20; no cap**), or types `accept shortlist`.
|
|
1204
|
+
5. Commit all picked Areas in ONE `mcp__ritual__accept_discovery_questions_batch` call (Step 7.4) — never one parallel call per Area.
|
|
1205
|
+
6. Optionally capture anti-goals (Step 7.5), then proceed to Step 8 and render the *"Reply `run` to continue"* CTA.
|
|
1206
|
+
|
|
1207
|
+
**Picking is a deliberate step-through, not a bulk action (load-bearing):** the user going Area by Area and choosing the questions that matter IS the value of discovery — that per-question judgment shapes the whole downstream chain. So **nudge the user to step through and pick**; don't lead with bulk shortcuts.
|
|
1208
|
+
- **Nudge to step through.** Walk the user Area-by-Area (drop into Area 1, `next`/`prev`) and invite deliberate picks per Area, with `show more` to expand an Area. The framing is "which of these should we dig into?", not "want all of them?".
|
|
1209
|
+
- **Floor (HARD): at least 6 questions** across any Areas — below this, do NOT commit or proceed (tell them how many more to pick and keep them in the picker). There is NO "skip discovery" path — the agentic run needs a real question set to develop answers against. **Good coverage (SOFT): 15–20 questions** — nudge toward it on the Summary, but never block once ≥6. **No upper cap** — picking many (or all) is a legitimate explicit choice, never a default or fallback. (Uncovered scope is handled downstream when recommendations + requirements are generated and audited, so a thin set is the failure mode to prevent.)
|
|
1210
|
+
- **The default is the shortlist, never "all."** For a user who doesn't want to step through every Area, **`accept shortlist` (the 6–10 highest-leverage questions)** is the convenience default. An ambiguous reply (`proceed`, `go`, `ok`) at this gate means **accept the shortlist** — never silently accept everything.
|
|
1211
|
+
- **Taking all IS allowed — but only as an explicit user choice, never the default or a fallback.** If the user genuinely says "take all" / "all of them", honor it and commit them; that's a legitimate choice, not an error. Just never *offer* "I'll take all" as the default, and never auto-fall-back to it. (Worth mentioning once, not as a gate: every accepted question is answered individually in the agentic run, so accepting all of them across every Area means many more questions to answer and a much longer run — but it's the user's call.)
|
|
1139
1212
|
|
|
1140
1213
|
**Forbidden behaviors:**
|
|
1141
1214
|
|
|
1142
|
-
- Calling `start_agentic_run` before
|
|
1215
|
+
- Calling `start_agentic_run` before at least 6 discovery picks have been committed for this exploration (via `accept_discovery_questions_batch`, or `accept_discovery_questions`). There is no skip-discovery exception.
|
|
1143
1216
|
- Silently auto-picking all generated questions and proceeding to Step 8 — observed in agent output 2026-05-15 as "the engineering-mode default is to run, which skips the per-question picker." There is no such default; the picker is mandatory.
|
|
1217
|
+
- **Offering "or I'll default to taking all of them" (or any accept-all fallback), then committing the full set on an ambiguous reply** — observed 2026-06-05 (a `proceed` at this gate → `accept_discovery_questions_batch` with all 68 questions → a ~25-min run the user never chose). Accept-all is a legitimate choice **only when the user explicitly asks for it** — it is NEVER the default you offer, and NEVER the fallback. The default you offer + fall back to is always **`accept shortlist`** (6–10). An ambiguous reply (`proceed`/`go`/`ok`) at the pick gate means **accept the shortlist**, not the full set. Lead by nudging the user to step through Areas and pick deliberately.
|
|
1144
1218
|
- Rendering "Next: run discovery through recommendations / Reply `run` to continue" anywhere in the chat before Step 7.4 has completed.
|
|
1145
1219
|
|
|
1146
1220
|
The picker is **not** a UI suggestion — it's the load-bearing decision gate where the user expresses what to investigate. Skipping it converts the agentic run into an automated "answer everything" pass and erases the user's judgment.
|
|
@@ -1160,29 +1234,40 @@ Generating discovery questions for each area…
|
|
|
1160
1234
|
|
|
1161
1235
|
Loop:
|
|
1162
1236
|
- Call `mcp__ritual__get_discovery_state(exploration_id)`
|
|
1163
|
-
- If `ready: false`, wait
|
|
1237
|
+
- If `ready: false`, wait 10 seconds, poll again
|
|
1164
1238
|
- If `ready: true`, exit loop
|
|
1165
1239
|
|
|
1166
|
-
Don't poll faster than every
|
|
1240
|
+
Don't poll faster than every 10 seconds (matches the Spark UI's 10s discovery cadence). Follow the global polling rule above: single `Bash sleep 10` per iteration and a one-line update every ~2 polls (~20s). Polling heartbeats are exempt from the Build rail rule per `references/cli-output-contract.md` § Build progress anchor — does NOT apply to.
|
|
1167
1241
|
|
|
1168
|
-
##### 7.3 —
|
|
1242
|
+
##### 7.3 — Matter-walk picker (Area rail + selected Area's questions → walk with `next`/`prev` → Summary)
|
|
1169
1243
|
|
|
1170
1244
|
The state contains `matters[]`, each with `id`, `name`, and `questions[]`. Internally these are `matter`s; user-facing copy ALWAYS calls them **Areas**.
|
|
1171
1245
|
|
|
1172
|
-
|
|
1246
|
+
This MIRRORS the Spark `/discover` picker exactly: Spark shows a **tab bar of all Areas with one tab selected AND that tab's questions already rendered below it**. The CLI does the same in text — every render shows a compact **Area rail** (all Areas, the current one marked, with running picked counts) **and, directly beneath it, the current Area's questions**. The user picks questions, then moves between Areas with `next`/`prev`, and finally lands on a **Summary** grouped by Area before committing. Seeing each Area's questions and choosing deliberately IS the value of discovery.
|
|
1247
|
+
|
|
1248
|
+
The two failure modes this contract prevents:
|
|
1249
|
+
- **A bare Area index** — the rail (or a "pick an Area" menu) with **no questions under it**. The rail without its current Area's questions is exactly the removed model; always render the questions inline. (This is the failure d3 caught on 2026-06-07: the agent rendered the Area list alone.)
|
|
1250
|
+
- **A full dump** — every Area's questions in one message. Only the **current** Area's questions render per turn.
|
|
1251
|
+
|
|
1252
|
+
**Turn boundaries (load-bearing — this is a multi-turn walk, not a one-shot render).** Render the rail + **exactly ONE Area's questions per turn**. After rendering, **STOP and end your turn** — wait for the user's reply (`numbers` / `next` / `prev` / `skip` / `done`). Each of `next` / `prev` / `done` produces the **next render in a NEW turn**, never appended to the current message. You already hold every Area's questions from `get_discovery_state` — that is NOT license to render the whole walk or multiple Areas' questions in a single message. The rail lists Area *names + counts* (cheap orientation); only the current Area's *questions* render. One Area → STOP → reply → next Area. The Summary (§ 7.3.3) is likewise its own turn.
|
|
1173
1253
|
|
|
1174
1254
|
###### 7.3.0 — Compute per-Area recommendations + the global shortlist (internal, not user-facing)
|
|
1175
1255
|
|
|
1176
|
-
|
|
1256
|
+
Three things surface, **none auto-applied**:
|
|
1257
|
+
- **(a) The Area rail** — every Area's name + its running picked count. Cheap orientation (names + counts, NOT their questions), shown above the current Area's questions from the very first render. This is the legitimate, always-visible "tab bar" — it is NOT the forbidden bare index, *because the current Area's questions always render beneath it*.
|
|
1258
|
+
- **(b) The per-Area ★ recommended set** (3–4 questions) — computed for the Area you are currently showing.
|
|
1259
|
+
- **(c) The global shortlist** (6–10 across all Areas) — computed only when the user types `accept shortlist`.
|
|
1260
|
+
|
|
1261
|
+
The user always picks; nothing is auto-committed.
|
|
1177
1262
|
|
|
1178
|
-
**Per-Area recommended
|
|
1263
|
+
**Per-Area recommended set** (the ★ set, for the Area currently shown):
|
|
1179
1264
|
|
|
1180
1265
|
- Pick the top 3–4 questions per Area most likely to shape the recommendations, based on the problem statement, locked sub-problems from Step 4, and the codebase recon context from Step 3. Bias toward questions whose absence would force later stages to invent consequential facts.
|
|
1181
1266
|
- Area has **< 4 questions**: all are recommended.
|
|
1182
1267
|
- Area has **4–7 questions**: top 3 are recommended.
|
|
1183
1268
|
- Area has **8+ questions**: top 4 are recommended.
|
|
1184
1269
|
|
|
1185
|
-
**Global shortlist** (what `accept shortlist` accepts
|
|
1270
|
+
**Global shortlist** (what `accept shortlist` accepts — available from any Area or the Summary):
|
|
1186
1271
|
|
|
1187
1272
|
- Pick **6–10 questions TOTAL across all Areas**, biased toward questions most likely to change recommendations.
|
|
1188
1273
|
- Preserve Area diversity by default — at least one question from each Area where the per-Area recommended set was non-empty, unless the scope is clearly concentrated (e.g. one Area dominates the recon evidence).
|
|
@@ -1191,246 +1276,197 @@ Two computations happen before the index renders. Both stay internal — they sh
|
|
|
1191
1276
|
|
|
1192
1277
|
Neither set is auto-applied. The user still picks per Area, or uses `accept shortlist` as a power path that bypasses the area-by-area drill.
|
|
1193
1278
|
|
|
1194
|
-
###### 7.3.1 —
|
|
1279
|
+
###### 7.3.1 — First render: Area rail + Area 1's questions (the walk begins)
|
|
1195
1280
|
|
|
1196
|
-
|
|
1281
|
+
Open ON Area 1 with the **rail above and Area 1's questions below it** — never the rail alone. The rail lists every Area (current one marked, picked count per Area); the questions are Area 1's ★ recommended set. Full phase rail on this first message (we just entered Discovery); subsequent Area messages use the in-phase chip.
|
|
1197
1282
|
|
|
1198
1283
|
```text
|
|
1199
1284
|
Ritual build
|
|
1200
1285
|
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1201
1286
|
|
|
1202
|
-
Question picking
|
|
1203
|
-
|
|
1204
|
-
Ritual generated questions across {N} areas for the {M} locked sub-problems:
|
|
1205
|
-
{first sub-problem name} + {second sub-problem name}.
|
|
1206
|
-
|
|
1207
|
-
Pick an Area to review. I'll show the 3–4 questions most likely to change
|
|
1208
|
-
the implementation plan.
|
|
1209
|
-
|
|
1210
|
-
Areas:
|
|
1211
|
-
|
|
1212
|
-
1. {Area name 1} {N} recommended · {N} total
|
|
1213
|
-
2. {Area name 2} {N} recommended · {N} total
|
|
1214
|
-
3. {Area name 3} {N} recommended · {N} total
|
|
1215
|
-
...
|
|
1216
|
-
|
|
1217
|
-
Reply with an Area number, `accept shortlist`, or `skip discovery`.
|
|
1218
|
-
Inside an Area, use `show more` to see the rest.
|
|
1219
|
-
```
|
|
1220
|
-
|
|
1221
|
-
Number alignment: right-pad the Area name to a consistent column so the counts line up vertically. Drop the `accept shortlist` token when no Area has recommendations (rare; just show the area-number + `skip discovery` CTAs).
|
|
1222
|
-
|
|
1223
|
-
**Rendering anti-pattern (load-bearing) — the Areas index renders ONLY area names + counts. Observed violations 2026-05-15:**
|
|
1287
|
+
Question picking · Area 1 of {N} · {Area name} picked so far: 0
|
|
1224
1288
|
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
1. Wishlist Visibility Contract (10 qs)
|
|
1289
|
+
Areas ● {Area name 1} ○ {Area name 2} ○ {Area name 3} ○ {Area name 4} ○ {Area name 5}
|
|
1290
|
+
● current · ✓N after a name = picked in that Area · move with `next` / `prev`
|
|
1228
1291
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1292
|
+
Ritual generated questions across {N} areas for {M} locked sub-problems.
|
|
1293
|
+
I'll walk you through each — aim for 15–20 total (6 minimum to run, no cap).
|
|
1231
1294
|
|
|
1232
|
-
|
|
1233
|
-
```
|
|
1234
|
-
No. This invents question previews the SKILL never asked for, AND uses overlapping numbering (`1. {area}` and `1. {question preview}`) that creates ambiguity — when the user replies `5`, neither side can tell what they meant. Single numbering stream: areas only.
|
|
1235
|
-
|
|
1236
|
-
- ❌ Free-form bullet lists, "for your convenience" question summaries, or any text under the area line beyond `{N} recommended · {N} total`.
|
|
1237
|
-
|
|
1238
|
-
- ❌ Adding a "TL;DR" / "highlights" section above or below the Areas list.
|
|
1295
|
+
Showing the {k} most likely to change the plan ({total} in this Area):
|
|
1239
1296
|
|
|
1240
|
-
|
|
1297
|
+
1. {recommended question 1, wrapped readably}
|
|
1298
|
+
2. {recommended question 2, wrapped readably}
|
|
1299
|
+
3. {recommended question 3, wrapped readably}
|
|
1241
1300
|
|
|
1301
|
+
pick numbers (e.g. `1,3`) · `suggested` (these ★) · `add <your question>` · `show more` ({total−k} more)
|
|
1302
|
+
walk `next` · `prev` · `skip` · `done` (≥6) · `accept shortlist`
|
|
1242
1303
|
```
|
|
1243
|
-
Areas:
|
|
1244
|
-
|
|
1245
|
-
1. {Area name} {N} recommended · {N} total
|
|
1246
|
-
2. {Area name} {N} recommended · {N} total
|
|
1247
|
-
...
|
|
1248
|
-
```
|
|
1249
|
-
|
|
1250
|
-
If the user wants to see questions, they pick an Area number — that's what § 7.3.2 (Area detail) is for. **Do not pre-empt their drill choice with question previews.** Same rule as Step 9.1's "use server preview verbatim, do not free-form-summarize on top."
|
|
1251
|
-
|
|
1252
|
-
**Why `accept shortlist`, not `accept recommended`:**
|
|
1253
|
-
|
|
1254
|
-
- "Recommended" is ambiguous (recommended per Area? globally? by category? recommended *recs* later in the flow?). The discovery picker uses **shortlist** explicitly because the shortlist is global (6–10 questions across all Areas, computed in § 7.3.0) — distinct from per-Area recommended counts shown alongside each Area, and distinct from the later `accept recommended` action that accepts implementation themes in Step 9.
|
|
1255
|
-
- This creates a clean vocabulary split: **discovery = `accept shortlist`** (questions), **recommendations = `accept recommended`** (themes).
|
|
1256
|
-
|
|
1257
|
-
**Don't advertise global `show all` at the index.** Showing every question across every Area can be a screen-flooding wall. The escape hatch the user actually needs is **`show more` inside an Area** (lazy expansion per Area), not a global dump. Accept `show all` as a reply but don't list it as a visible CTA on the index.
|
|
1258
|
-
|
|
1259
|
-
###### 7.3.2 — Area detail (one Area's questions)
|
|
1260
|
-
|
|
1261
|
-
When the user picks an Area number, show that Area's **top recommended questions** by default. Hold the rest behind `show more`. In-phase chip, NOT full rail (rail was emitted on the index).
|
|
1262
1304
|
|
|
1263
|
-
|
|
1264
|
-
Question picking · {Area name}
|
|
1265
|
-
|
|
1266
|
-
Showing {N} recommended questions out of {total}.
|
|
1305
|
+
**Single numbering stream — number the QUESTIONS only; the rail Areas are NOT numbered.** The 2026-05-15 failure numbered Areas AND question previews in one view, so a reply of `5` was ambiguous. Here the rail uses `●`/`○` markers + names (no numbers) and you move it with `next`/`prev` — the only numbered list is the current Area's questions, so a bare number is never ambiguous. Wrap long question text readably. The `picked so far` count, the rail markers/`✓N` counts, and the `Area i of N` breadcrumb all update on every render of the walk.
|
|
1267
1306
|
|
|
1268
|
-
|
|
1307
|
+
**Why `accept shortlist`, not `accept recommended`:** "recommended" is ambiguous (per-Area? global?). The picker uses **shortlist** for the global 6–10 power path (§ 7.3.0), keeping a clean vocabulary split: **discovery = `accept shortlist`** (questions), **recommendation review = `proceed`** (Step 9). The ★ marks the per-Area recommended set; `suggested` picks it.
|
|
1269
1308
|
|
|
1270
|
-
|
|
1309
|
+
###### 7.3.2 — Within an Area (pick, then move)
|
|
1271
1310
|
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
Reply with numbers like `1,2` to pick, `show more` to see all {total},
|
|
1275
|
-
or `skip` to leave this Area without picks.
|
|
1276
|
-
```
|
|
1311
|
+
**Every render in this section keeps the `Areas …` rail line on top** (current Area marked, `✓N` counts updated) — it's omitted from the snippets below only for brevity. Never re-render an Area's questions without the rail above them.
|
|
1277
1312
|
|
|
1278
|
-
`
|
|
1313
|
+
- **`numbers`** (e.g. `1,3` or `1,2,5`): add those questions to the picked set, re-render this Area (rail + questions) with `✓` on the picked rows + the updated `picked so far`, then prompt `next` / `prev` / `done`.
|
|
1314
|
+
- **`suggested`**: pick this Area's recommended (★) set in one go.
|
|
1315
|
+
- **`show more`**: reveal the rest, grouped Recommended / More (lazy per-Area expansion — never a global dump):
|
|
1279
1316
|
|
|
1280
1317
|
```text
|
|
1281
|
-
Question picking · {Area name}
|
|
1318
|
+
Question picking · {Area name} picked so far: {T}
|
|
1282
1319
|
|
|
1283
1320
|
Recommended:
|
|
1284
|
-
|
|
1285
|
-
1. {recommended question 1}
|
|
1321
|
+
1. {recommended question 1} ✓
|
|
1286
1322
|
2. {recommended question 2}
|
|
1287
1323
|
3. {recommended question 3}
|
|
1288
1324
|
|
|
1289
1325
|
More questions:
|
|
1290
|
-
|
|
1291
1326
|
4. {non-recommended question 1}
|
|
1292
1327
|
5. {non-recommended question 2}
|
|
1293
|
-
6. {non-recommended question 3}
|
|
1294
|
-
7. {non-recommended question 4}
|
|
1295
1328
|
...
|
|
1296
1329
|
|
|
1297
|
-
Reply
|
|
1330
|
+
Reply numbers (e.g. `1,4`), `next`, `prev`, or `skip`.
|
|
1298
1331
|
```
|
|
1299
1332
|
|
|
1300
|
-
|
|
1333
|
+
- **`next` / `prev`**: move to the next / previous Area (picks preserved). At the last Area, `next` goes to the Summary (§ 7.3.3).
|
|
1334
|
+
- **`skip`**: leave this Area with no picks, advance to `next`.
|
|
1335
|
+
- **`done`**: jump straight to the Summary (allowed from any Area).
|
|
1336
|
+
- **`pause`**: stop here — state is saved, nothing committed.
|
|
1337
|
+
- **`show all`**: accepted as a reply (expands every Area's questions into one long list) but NOT advertised on the CTA line — per-Area `show more` is the default, not a global wall.
|
|
1338
|
+
- **`add <your question>`** (e.g. `add How should we handle partial refunds?`): add a USER-AUTHORED question to THIS Area. **Pre-flight format-validate it locally first:** it must read as a single, clear question (non-empty, interrogative or ends with `?`, ≤ ~200 chars). If it's malformed (a statement, a fragment, multiple questions, too long), say what's off and ask them to rephrase — do NOT hold a malformed one. When valid, **hold it locally** for this Area and re-render the Area (rail + questions) with it shown as `+ (your) {text}` beneath the questions, `picked so far` incremented. It counts toward the floor/target like any pick. It is NOT written to the server yet — every custom question is persisted in ONE batch at `commit` (§ 7.4).
|
|
1301
1339
|
|
|
1302
|
-
|
|
1340
|
+
###### 7.3.3 — Summary (after the last Area, or on `done`) — the review-before-commit gate
|
|
1303
1341
|
|
|
1304
|
-
|
|
1305
|
-
Question picking
|
|
1342
|
+
Render all picks grouped by Area. This MIRRORS Spark's Summary tab and is the gate where the user confirms before the run. Use `✓` picked / `—` none / `□` untouched. NEVER strikethrough (renders inconsistently across terminals).
|
|
1306
1343
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1344
|
+
```text
|
|
1345
|
+
Question picking · Summary {T} picked
|
|
1346
|
+
|
|
1347
|
+
✓ 1. {Area name 1} {n} picked
|
|
1348
|
+
– {picked question}
|
|
1349
|
+
– {picked question}
|
|
1350
|
+
— 2. {Area name 2} none picked
|
|
1351
|
+
✓ 3. {Area name 3} {n} picked
|
|
1352
|
+
– {picked question}
|
|
1313
1353
|
...
|
|
1314
1354
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1355
|
+
{if T < 15} A good set is usually 15–20 — you've picked {T}. Reply an Area
|
|
1356
|
+
number to add more, `more` to suggest new Areas, or `commit`.
|
|
1357
|
+
{if T ≥ 15} Reply `commit` to run discovery on these {T} questions, an Area
|
|
1358
|
+
number to adjust, `more` for new Areas, or `pause` to stop.
|
|
1317
1359
|
```
|
|
1318
1360
|
|
|
1319
|
-
|
|
1361
|
+
**The minimum model — floor 6 HARD, good 15–20 SOFT, no cap:**
|
|
1320
1362
|
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1363
|
+
- **`commit` with T < 6** → REFUSE (hard floor). *"Pick at least 6 to run discovery — you have {T}, choose {6−T} more,"* then return to the Summary (or the Area they were on). No skip path; do NOT call `accept_discovery_questions_batch` or `start_agentic_run`.
|
|
1364
|
+
- **`commit` with 6 ≤ T < 15** → allowed. Proceed to § 7.4 after the one-line "good is 15–20" nudge — do NOT re-nag or block.
|
|
1365
|
+
- **`commit` with T ≥ 15** → proceed to § 7.4.
|
|
1366
|
+
- **An Area number** at the Summary → re-open that Area's questions (picks preserved), then return here.
|
|
1367
|
+
|
|
1368
|
+
**Held custom questions + pending new Areas render in the Summary** so the user reviews everything before `commit`: a held custom question shows under its Area as `+ (your) {text}`; a pending agent-suggested new Area shows at the bottom as `+ (new) {name} {n} questions`. They count toward `{T}`. All are persisted at `commit` (§ 7.4).
|
|
1369
|
+
|
|
1370
|
+
- **`more`** at the Summary → the user wants broader coverage. **Suggest 2–3 NEW candidate Areas inline yourself** — each a short name + 3–4 questions — authored from the problem statement, the locked scope, and the Areas already shown, chosen to fill **gaps** the current Areas miss. Label the candidates with **LETTERS (`A`, `B`, `C`) — not numbers** — to avoid colliding with the question-number stream, and ask which to add (`letters`, e.g. `A` or `A,C`, or `none`). Picked candidates become **pending new Areas held locally** (persisted at `commit`). Do NOT call a server "generate-more" endpoint — you have the context, so propose directly (it's faster). **Never auto-add — the user picks.**
|
|
1325
1371
|
|
|
1326
|
-
###### 7.3.4 — Power paths from the
|
|
1372
|
+
###### 7.3.4 — Power paths (available from any Area or the Summary)
|
|
1327
1373
|
|
|
1328
|
-
- **`accept shortlist
|
|
1329
|
-
-
|
|
1330
|
-
-
|
|
1374
|
+
- **`accept shortlist`**: accept the 6–10-question global shortlist computed in § 7.3.0 — the fast path for a user who doesn't want to walk every Area. Group those by their owning Area, commit them in ONE `accept_discovery_questions_batch` call (§ 7.4 — one entry per Area), and proceed to Step 7.5. Intentionally NOT "top 3–4 of every Area" (which would scale to 24–32 picks and reintroduce the "no triage signal" problem). The shortlist is the quick minimal set; the walk is how a user reaches the 15–20 good-coverage range.
|
|
1375
|
+
- **`show all`**: accepted as a reply but NOT advertised on the CTA line. Expands every Area's questions into one long list. Use only when the user explicitly asks — the per-Area `show more` is the default.
|
|
1376
|
+
- **`done`**: jump to the Summary from any Area to review + `commit`.
|
|
1377
|
+
- **Below the floor** (fewer than 6 picked on `commit`): do NOT proceed. Reply with how many more are needed and return to the Summary — e.g. *"Pick at least 6 to run discovery — you've picked 3, choose 3 more."* There is no skip path. (6–14 is allowed with the soft nudge; ≥15 is the good-coverage target — see § 7.3.3.)
|
|
1331
1378
|
|
|
1332
1379
|
###### 7.3.5 — What NOT to say
|
|
1333
1380
|
|
|
1334
1381
|
- DO NOT add machinery copy like *"The answer engine will then investigate them via codebase recon and surface clarifying questions for you to review."* The user only needs to know that picking them triggers investigation.
|
|
1335
1382
|
- DO NOT use `Press Enter` anywhere in this picker (see § Surface-aware continuation prompts).
|
|
1336
|
-
- DO NOT say `lock` for the picking confirmation; use `done`
|
|
1337
|
-
- DO NOT
|
|
1383
|
+
- DO NOT say `lock` for the picking confirmation; use `done` (to the Summary) then `commit`.
|
|
1384
|
+
- DO NOT number Areas and questions in the same view — one numbering stream (the current Area's questions). The breadcrumb `Area i of N` carries position; it is not a pickable number.
|
|
1338
1385
|
|
|
1339
1386
|
###### Legacy alias notes
|
|
1340
1387
|
|
|
1341
|
-
- `suggest` (legacy per-Area shortcut) is now
|
|
1342
|
-
- `accept recommended` (legacy global shortcut): if a user types this, treat it as `accept shortlist
|
|
1388
|
+
- `suggest` (legacy per-Area shortcut) is now spelled **`suggested`** — picks the current Area's recommended (★) set. If a user types `suggest` inside an Area, treat it the same.
|
|
1389
|
+
- `accept recommended` (legacy global shortcut): at the DISCOVERY stage, if a user types this, treat it as `accept shortlist` and surface a one-line note that the discovery-stage token is `accept shortlist` (questions). (At Step 9 the recommendation-review CTA is `proceed`, not `accept recommended`.)
|
|
1343
1390
|
- `all` (legacy fourth option) remains removed (see § Removed below).
|
|
1344
1391
|
|
|
1345
1392
|
###### Removed: `all` (the old fourth option)
|
|
1346
1393
|
|
|
1347
1394
|
The legacy `all` shortcut was removed because in practice it produced low-signal selections — picking everything is indistinguishable from not discriminating, which makes Reasoning Readiness scoring less meaningful at the boundary and pushes recommendation generation against a noisy answer set. Users who really did mean "everything" can still type the full number list (e.g. `1,2,3,4,5`) — but that requires conscious intent rather than a one-keystroke default. If you see a SKILL or external reference still mentioning `all`, it's stale.
|
|
1348
1395
|
|
|
1349
|
-
##### 7.4 — Commit picks (
|
|
1396
|
+
##### 7.4 — Commit picks (ONE batch call across all Areas)
|
|
1350
1397
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1398
|
+
**load-bearing — forbidden behavior:** do NOT fan out one
|
|
1399
|
+
`accept_discovery_questions` call per Area in parallel. Each per-Area call
|
|
1400
|
+
does several DB round-trips; firing them concurrently exhausts the server's
|
|
1401
|
+
connection pool and returns 503s on the later Areas (observed in prod). The
|
|
1402
|
+
batch endpoint exists precisely to avoid this — use it.
|
|
1355
1403
|
|
|
1356
|
-
|
|
1404
|
+
Call `mcp__ritual__accept_discovery_questions_batch` **once** with every
|
|
1405
|
+
Area's picks in a single atomic request:
|
|
1406
|
+
- `state_id` (from the discovery state)
|
|
1407
|
+
- `picks[]` — one entry per Area the user picked in, each `{ matter_id, question_ids[] }`
|
|
1357
1408
|
|
|
1358
1409
|
```ts
|
|
1359
|
-
//
|
|
1360
|
-
await
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
);
|
|
1410
|
+
// ONE call. All Areas, one atomic transaction, one successor state.
|
|
1411
|
+
await accept_discovery_questions_batch(state_id, [
|
|
1412
|
+
{ matter_id: areaA.matter_id, question_ids: areaA.question_ids },
|
|
1413
|
+
{ matter_id: areaB.matter_id, question_ids: areaB.question_ids },
|
|
1414
|
+
// …one entry per Area with at least one pick
|
|
1415
|
+
]);
|
|
1365
1416
|
```
|
|
1366
1417
|
|
|
1418
|
+
Use the single-Area `accept_discovery_questions` ONLY when the user picked in
|
|
1419
|
+
exactly one Area. If for some reason you must use it across several Areas
|
|
1420
|
+
(e.g. the batch tool is unavailable), call it **sequentially** (`await` each
|
|
1421
|
+
in turn) — never in parallel.
|
|
1422
|
+
|
|
1367
1423
|
User-facing: emit ONE status line for the whole commit, not one per Area:
|
|
1368
1424
|
|
|
1369
1425
|
```text
|
|
1370
1426
|
Saving picks across {N} Areas…
|
|
1371
1427
|
```
|
|
1372
1428
|
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
After question picking, check for scope mismatch only when one of these triggers fires:
|
|
1378
|
-
|
|
1379
|
-
- Pick-rate < 40%
|
|
1380
|
-
- Matter coverage <= 50%
|
|
1381
|
-
- Pick-rate = 100%
|
|
1382
|
-
- Picks concentrate heavily in one matter while the scope spans several concerns
|
|
1429
|
+
The batch call is all-or-nothing — validation fails the whole request if any
|
|
1430
|
+
pick is malformed, so there's no partial-success state to reconcile. Areas the
|
|
1431
|
+
user chose not to pick from are simply left unpicked.
|
|
1383
1432
|
|
|
1384
|
-
If
|
|
1433
|
+
**If there are NO held custom questions or pending new Areas, proceed to anti-goals.**
|
|
1385
1434
|
|
|
1386
|
-
|
|
1435
|
+
###### 7.4.1 — Persist held custom questions + new Areas (only if any were held)
|
|
1387
1436
|
|
|
1388
|
-
|
|
1437
|
+
Custom questions (`add`, § 7.3.2) and pending new Areas (`more`, § 7.3.3) were held
|
|
1438
|
+
LOCALLY during the walk because `add_discovery_question` needs a **workspace** matter id,
|
|
1439
|
+
which only exists after the batch above materialized the picked Areas. Persist them now,
|
|
1440
|
+
AFTER the batch call:
|
|
1389
1441
|
|
|
1390
|
-
|
|
1442
|
+
1. **Resolve workspace matter ids.** Call `mcp__ritual__get_exploration(exploration_id)` and
|
|
1443
|
+
map each Area **name** → its workspace `matters[i].id`. (The batch only materialized Areas
|
|
1444
|
+
the user picked AI questions in.)
|
|
1445
|
+
2. **For each Area that has held custom questions:**
|
|
1446
|
+
- if a workspace matter for that name exists → use its id;
|
|
1447
|
+
- if not (a custom-only Area, or a pending new Area) → `mcp__ritual__create_discovery_matter(exploration_id, name)` first, use the returned id.
|
|
1448
|
+
- then call `mcp__ritual__add_discovery_question(exploration_id, matter_id, text)` for each held question — **SEQUENTIALLY** (`await` each), never in parallel (same connection-pool caution as the batch).
|
|
1449
|
+
3. **For each pending new Area** (from `more`): `create_discovery_matter(...)` then `add_discovery_question(...)` per its questions, sequentially.
|
|
1391
1450
|
|
|
1392
|
-
|
|
1451
|
+
One status line for the whole persist step (not one per question):
|
|
1393
1452
|
|
|
1394
1453
|
```text
|
|
1395
|
-
|
|
1396
|
-
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1397
|
-
|
|
1398
|
-
Scope check
|
|
1399
|
-
|
|
1400
|
-
{One-line summary of which pattern fired — e.g. "You picked 4 of 32 questions, mostly in retention."}
|
|
1401
|
-
|
|
1402
|
-
How should I treat the unpicked areas?
|
|
1403
|
-
|
|
1404
|
-
1. Out of scope — tighten the current scope around what you picked.
|
|
1405
|
-
2. Later phase — keep the broad scope, but mark unpicked areas as phase-later candidates.
|
|
1406
|
-
3. Open questions — keep the broad scope and treat unpicked areas as context debt.
|
|
1407
|
-
4. Pick more — return to question picking before continuing.
|
|
1408
|
-
|
|
1409
|
-
Reply with `1`, `2`, `3`, or `4`. Reply `pause` to stop here.
|
|
1410
|
-
```
|
|
1411
|
-
|
|
1412
|
-
Use `references/discovery-classification.md` for the branch handlers, pulse templates, and no-discrimination case. Do not preview score deltas in the question-picking menu; let the pulse explain the consequence after the user chooses.
|
|
1413
|
-
|
|
1414
|
-
For Branch 2, append an exact block to `recon_context` before build brief generation:
|
|
1415
|
-
|
|
1416
|
-
```markdown
|
|
1417
|
-
## Explicit phase-later candidates
|
|
1418
|
-
|
|
1419
|
-
These were intentionally deferred by the user during discovery. They are not context debt. Include them in the Build Brief under "Phase Candidates / Deferrable Items."
|
|
1420
|
-
|
|
1421
|
-
- {matter/question}
|
|
1422
|
-
Reason: {user choice or inferred dependency}
|
|
1423
|
-
Related RB/source: {optional}
|
|
1454
|
+
Adding your {M} question(s) across {K} Area(s)…
|
|
1424
1455
|
```
|
|
1425
1456
|
|
|
1457
|
+
Only after all holds are persisted, proceed to anti-goals. The floor (≥6) counts
|
|
1458
|
+
custom + AI questions together — never `start_agentic_run` before the held questions are
|
|
1459
|
+
written.
|
|
1426
1460
|
|
|
1427
1461
|
##### 7.5 — Optional: capture out-of-scope items
|
|
1428
1462
|
|
|
1429
1463
|
If the user mentioned things they DON'T want investigated ("don't touch enterprise SSO", "skip pricing"), capture them as anti-goals.
|
|
1430
1464
|
|
|
1465
|
+
**Pre-flight (mandatory):** before calling `set_anti_goals`, run the change pre-flight in `references/change-preflight.md` — restate the out-of-scope items you heard and show the exact anti-goal `text` array you're about to send, then wait for `yes`. A misread anti-goal poisons rec-gen and the R4 audit downstream, so this hard pause (even in auto-mode) applies even when the user's phrasing seemed clear. Do not call the tool until the user confirms.
|
|
1466
|
+
|
|
1431
1467
|
Call `mcp__ritual__set_anti_goals(exploration_id, [{ text, reason? }, ...])`.
|
|
1432
1468
|
|
|
1433
|
-
Skip silently if no anti-goals were mentioned.
|
|
1469
|
+
Skip silently if no anti-goals were mentioned. (No mention = nothing to confirm; the pre-flight only runs when the user actually states out-of-scope items.)
|
|
1434
1470
|
|
|
1435
1471
|
**Pulse (Step 7.4 done — and again after 7.5 if anti-goals were set):** Emit a pulse — decision resolution and (if 7.5 ran) assumption safety just moved. Compact format unless this crosses Under-specified → Exploration-safe.
|
|
1436
1472
|
|
|
@@ -1530,7 +1566,7 @@ Pick whichever fits the user's flow — they're equivalent in content. Do not in
|
|
|
1530
1566
|
|
|
1531
1567
|
##### 8.1 — Polling loop
|
|
1532
1568
|
|
|
1533
|
-
Poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep
|
|
1569
|
+
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.
|
|
1534
1570
|
|
|
1535
1571
|
**On the FIRST poll only** (not every poll), prepend one line that locks the "background execution is default" mental model:
|
|
1536
1572
|
|
|
@@ -1631,356 +1667,146 @@ For each question's loop:
|
|
|
1631
1667
|
|
|
1632
1668
|
**Pulse (Step 8 done):** Emit a pulse — decision resolution moved significantly (answers complete, draft recommendations now exist). Render full if this crosses Under-specified → Exploration-safe, else compact.
|
|
1633
1669
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
**Use `mcp__ritual__get_recommendations_preview(exploration_id)` for the Step 9.1 landing screen.** It returns a server-rendered preview with `previewText` (terminal-formatted, hard-wrapped at 78 cols — print verbatim), `idMap` (`R1..RN` → uuid lookup for resolving `accept R3` / `detail R7`), `actions` (role-aware structured command list), `categoryGroups` (structured grouped list for non-terminal surfaces), `actionHint`, `scopeLine`, and `totalCount`. The server already handles role detection (admin vs collaborator) and filters out `approved`/`rejected` recs.
|
|
1637
|
-
|
|
1638
|
-
Use `mcp__ritual__get_recommendations(exploration_id)` (the raw array) only when you need fields not in the preview — full `metadata.acceptance_criteria[]`, `metadata.explainability` rationale chain, `metadata.labels[]`, etc. The detail card in 9.3 (`detail R{N}`) loads from the raw tool keyed by the uuid you got from `idMap`.
|
|
1639
|
-
|
|
1640
|
-
Each raw rec includes:
|
|
1670
|
+
<!-- lite:keep-start -->
|
|
1641
1671
|
|
|
1642
|
-
|
|
1643
|
-
- `metadata.category.name` — **the load-bearing grouping key** (one rec → one category)
|
|
1644
|
-
- `metadata.acceptance_criteria[]` — concrete pass conditions
|
|
1645
|
-
- `metadata.explainability` — `rationale` (chained `→` arrow string), `faq_references[]`, `problem_alignment`, `inferred_elements`, optional `initial_input_analysis`
|
|
1646
|
-
- `metadata.labels[]` — secondary tags
|
|
1647
|
-
|
|
1648
|
-
**Role model — load-bearing**: only **admins** can accept recommendations (call `accept_recommendations`). **Collaborators** can read, comment, and proceed to implement, but they cannot move recs from `draft`/`pending_review` to `approved`. The preview API handles this automatically — the `actions` list and `actionHint` are gated on the caller's workspace role; admins see `accept recommended` while everyone else sees `request admin review` plus the optional `continue` (implement-ahead) path. Respect what the preview returns; don't substitute it.
|
|
1649
|
-
|
|
1650
|
-
If you don't already know the user's role on this workspace, prefer the workspace member endpoint or cached role from `/ritual init`. When unavailable, ask plainly: *"Are you the workspace admin or a collaborator?"* Do not attempt acceptance blindly unless the user explicitly says to accept.
|
|
1651
|
-
|
|
1652
|
-
**Vocabulary**: do NOT use "Reasoning chain" or "reasoning_chain" in user-facing copy. The user-visible label is **"Why this"** — a 4-line Problem / Discovery / Tradeoff / Recommendation breakdown derived from the rationale field. "Reasoning chain" sounds like internal model chain-of-thought; "Why this" is product-native.
|
|
1653
|
-
|
|
1654
|
-
**Vocabulary anti-pattern — load-bearing**: recommendations are grouped by **category** (`metadata.category.name`). They are **NEVER** grouped by `matter` or by `Area`. Those are **discovery-phase concepts** — the matter / Area is where DISCOVERY QUESTIONS live; recommendations are synthesized across all matters and grouped by the category the LLM assigns (themes like "Token security & replay", "Atomicity & architecture", etc.). The internal DB field `matter_id` does not appear in the recommendation surface and **must never appear in user-facing copy** at this step. Anti-pattern observed in agent output: *"44 recs grouped by matter"* — the right framing is *"44 recs grouped by category"* (with categoryGroups returned by the preview API doing the work). If you find yourself referring to recommendation groups as "Areas" or "matters," stop and re-read this paragraph.
|
|
1655
|
-
|
|
1656
|
-
**Action-menu anti-pattern — load-bearing**: the **blessed action set at the Step 9 acceptance gate** is exactly:
|
|
1672
|
+
#### Step 9 — Review recommendations (category walk)
|
|
1657
1673
|
|
|
1658
|
-
- `accept
|
|
1659
|
-
- `request admin review` — collaborator path, notifies workspace admin
|
|
1660
|
-
- `drop R{N}` — remove one rec from the set before accepting
|
|
1661
|
-
- `drill R{N}` — show one rec's full detail card
|
|
1662
|
-
- `comment R{N}` — leave feedback on a specific rec
|
|
1663
|
-
- `pause` — stop here; user can resume via `/ritual resume`
|
|
1674
|
+
This is the most-read screen in the build flow, and — as of 2026-06-08 — a **non-blocking review**. Recommendations are **auto-accepted at generation** (created `approved`); the artifacts that depend on them (requirements, the deliverable doc, and — for developer-function jobs — the build brief) are **already being generated** the moment rec-gen completes. Step 9 is the user's chance to **read and refine** the set, not an accept-or-reject gate. Replying `proceed` records that a human reviewed it (stamps `reviewedAt` / `reviewedBy`) and continues to the build brief — it never blocks, and there is **no reject path here**.
|
|
1664
1675
|
|
|
1665
|
-
|
|
1676
|
+
The review is a **category walk**, mirroring Spark's recommendation drawer: the user moves through one **category** at a time, sees each recommendation in that category in full (title, description, and the "Why this" reasoning), and can refine any one of them in place before continuing.
|
|
1666
1677
|
|
|
1667
|
-
**
|
|
1678
|
+
**Data source.** Use `mcp__ritual__get_recommendations(exploration_id)` (the raw array) — the walk shows full per-rec content, so you need the fields a titles-only preview omits:
|
|
1668
1679
|
|
|
1669
|
-
-
|
|
1670
|
-
-
|
|
1671
|
-
-
|
|
1672
|
-
-
|
|
1673
|
-
|
|
1674
|
-
If the rec set looks wrong, the right responses are: surface the anomaly explicitly, ask the user how to proceed, and consult `mcp__ritual__get_recommendation_attestation` for the quality audit's `duplicateTitlePrefixes` signal. Don't paper over with an invented action.
|
|
1675
|
-
|
|
1676
|
-
##### 9.1 — Landing screen: server-rendered preview (primary path)
|
|
1680
|
+
- top-level: `id`, `title`, `content` (the description / summary), `status`, `priority`, `points`, `confidence`
|
|
1681
|
+
- `metadata.category.name` — **the load-bearing grouping key** (one rec → one category)
|
|
1682
|
+
- `metadata.explainability` — `rationale` (chained `→` arrow string), `faq_references[]`, `problem_alignment`, `inferred_elements`
|
|
1683
|
+
- `metadata.acceptance_criteria[]` — concrete pass conditions (optional to surface; see § 9.1)
|
|
1677
1684
|
|
|
1678
|
-
|
|
1685
|
+
Assign stable `R1..RN` IDs **globally across all categories** in page order (NOT restarting per-category), and remember the `R{N}` → `id` map so you can resolve `edit R{N}` to the rec UUID for the MCP calls.
|
|
1679
1686
|
|
|
1680
|
-
**
|
|
1687
|
+
**Vocabulary — load-bearing:**
|
|
1681
1688
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
2. Response shape:
|
|
1686
|
-
{
|
|
1687
|
-
terminalPreviewText: "...", // present for surface=terminal (default)
|
|
1688
|
-
uiPreview: { // always present
|
|
1689
|
-
stage: "recommendations",
|
|
1690
|
-
stageIndex: 4, stageCount: 6,
|
|
1691
|
-
scopeLine, stats, categoryGroups,
|
|
1692
|
-
idMap, actions
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
3. Print response.terminalPreviewText VERBATIM. Do not re-render,
|
|
1697
|
-
re-wrap, re-number, or add a leading "Here are your recommendations..."
|
|
1698
|
-
line. The server already laid out the build rail, scope, grouped recs,
|
|
1699
|
-
and role-aware action hint at 78-col wrap.
|
|
1700
|
-
|
|
1701
|
-
4. Remember response.uiPreview.idMap so you can resolve user input — when
|
|
1702
|
-
they reply `accept R3` or `detail R7`, look up `R{N}` → uuid in
|
|
1703
|
-
idMap and use that uuid in the follow-up MCP call (accept_recommendations,
|
|
1704
|
-
get_recommendations).
|
|
1705
|
-
|
|
1706
|
-
5. response.uiPreview.actions is for mobile/web button rendering — terminal
|
|
1707
|
-
flow ignores it (action hint copy is already inside terminalPreviewText).
|
|
1708
|
-
Each action carries `style: "primary" | "secondary"` so a non-terminal
|
|
1709
|
-
UI knows which is the call-to-action.
|
|
1710
|
-
```
|
|
1689
|
+
- Recommendations are grouped by **category** (`metadata.category.name`). They are **NEVER** grouped by `matter` or by `Area` — those are discovery-phase concepts. `matter_id` must never appear in user-facing copy. Anti-pattern observed in agent output: *"44 recs grouped by matter"* — the right framing is *"44 recs across K categories."*
|
|
1690
|
+
- Do NOT use "Reasoning chain" / "reasoning_chain" in user-facing copy. The user-visible label is **"Why this"** — a short Problem / Discovery / Tradeoff distillation derived from the `rationale` field, NOT the literal `→` arrow chain (that's the model's internal scratchpad shape).
|
|
1711
1691
|
|
|
1712
|
-
|
|
1692
|
+
**Action set — load-bearing (exactly three, no freelancing):**
|
|
1713
1693
|
|
|
1714
|
-
|
|
1694
|
+
- `edit R{N} <your change>` — refine one recommendation: regenerate its title / description / reasoning from a plain-language ask, **preview** the change, then **apply** it. (§ 9.2)
|
|
1695
|
+
- `next` — move to the next category. (§ 9.3)
|
|
1696
|
+
- `proceed` — mark the set reviewed and continue to the build brief, from any category. (§ 9.3)
|
|
1715
1697
|
|
|
1716
|
-
|
|
1717
|
-
2. **Drops the R-IDs** — a free-form bullet list erases the stable `R{N}` references the user needs to reply with `accept R3` / `drill R7` / `comment R12`. The user then types `view 10` (positional) thinking that's stable; it's not.
|
|
1718
|
-
3. **Invents grouping labels** — free-form rendering tempts the agent to label groups as "Areas" or "matters" (already covered by the vocabulary anti-pattern above).
|
|
1698
|
+
**Do NOT freelance other actions.** There is **no `drop` / reject** (recs are auto-accepted and the review is non-blocking — a rec the user dislikes is refined with `edit`, or simply left as-is), **no `comment`**, and **no separate `drill` / `detail`** (full content is already on screen). Reject none of these by inventing compounds either (`dedupe`, `accept the survivors`, `merge similar`, `open the admin UI` — all forbidden). If the rec set itself looks wrong (e.g. apparent duplicates), surface the anomaly explicitly and consult `mcp__ritual__get_recommendation_attestation` (`duplicateTitlePrefixes`) — don't paper over it with an invented action.
|
|
1719
1699
|
|
|
1720
|
-
|
|
1700
|
+
##### 9.1 — The walk: one category per turn
|
|
1721
1701
|
|
|
1722
|
-
**
|
|
1702
|
+
**[USER PAUSE]** Render the **current category only**, then stop and wait for the user's reply. One category per turn — never dump every category's full content in a single message (that's the wall-of-text failure mode; the walk is what keeps a 13-rec set readable). The first render opens with the full rail; subsequent categories use the in-phase chip.
|
|
1723
1703
|
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
```text
|
|
1727
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1728
|
-
STEP 9.1 RENDERING CONTRACT (FALLBACK) — non-negotiable
|
|
1729
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1730
|
-
|
|
1731
|
-
Use this contract ONLY if get_recommendations_preview is unavailable
|
|
1732
|
-
(older MCP server) or returns an error. Otherwise, print the preview
|
|
1733
|
-
verbatim per the Primary path above.
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
Landing view is for SELECTION, not reading. Full prose belongs in 9.3.
|
|
1737
|
-
|
|
1738
|
-
✓ DO:
|
|
1739
|
-
- Number categories `1.`, `2.`, `3.` … `K.` in page order
|
|
1740
|
-
- Assign recommendations stable `R1`, `R2`, … `RN` IDs GLOBALLY across
|
|
1741
|
-
all categories (NOT restart per-category — so `detail R7` is
|
|
1742
|
-
unambiguous without naming the category)
|
|
1743
|
-
- Show recommendation TITLES ONLY at the landing
|
|
1744
|
-
- Indent recs 3 spaces under their category
|
|
1745
|
-
- One blank line between categories
|
|
1746
|
-
- Include compact scope line above the list
|
|
1747
|
-
- End with the action block (`accept recommended` etc.)
|
|
1748
|
-
|
|
1749
|
-
✗ DO NOT:
|
|
1750
|
-
- Do NOT render recs as a flat `1..N` list with no category structure
|
|
1751
|
-
- Do NOT use raw numeric rec IDs like `1.`, `2.`, `3.` — use `R1`, `R2`, `R3`
|
|
1752
|
-
- Do NOT show recommendation `content` / summary text at the landing
|
|
1753
|
-
- Do NOT show acceptance criteria, rationale, tactics, or references at
|
|
1754
|
-
the landing — those are 9.3 detail-card content
|
|
1755
|
-
- Do NOT omit category numbering (the prefix is what separates this
|
|
1756
|
-
from a wall-of-text grouped list)
|
|
1757
|
-
- Do NOT invent a "raw / deduped" framing line — the API does not return
|
|
1758
|
-
pre-dedup counts. Use `{N} recommendations across {K} categories.`
|
|
1759
|
-
|
|
1760
|
-
OBSERVED FAILURE — never render this:
|
|
1761
|
-
|
|
1762
|
-
Recommendations (13)
|
|
1763
|
-
|
|
1764
|
-
1. Backfill legacy data to fail-closed PRIVATE visibility
|
|
1765
|
-
Add a constrained `visibility` field with DB default PRIVATE...
|
|
1766
|
-
|
|
1767
|
-
2. Codify actor-state rights around owner-only mutation
|
|
1768
|
-
Define a single permission matrix across PRIVATE/SHARED/PUBLIC...
|
|
1769
|
-
|
|
1770
|
-
3. Centralize object permissions across storefront and dashboard
|
|
1771
|
-
Reusable `can_view_wishlist` / `can_edit_wishlist` methods...
|
|
1772
|
-
|
|
1773
|
-
Why wrong:
|
|
1774
|
-
- Looks grouped only implicitly; categories not visible as headers
|
|
1775
|
-
- Uses `1..N` numeric IDs (should be `R1..RN`)
|
|
1776
|
-
- Dumps `content` summaries — defeats the purpose of a landing view
|
|
1777
|
-
- `detail R7` no longer maps to a stable ID
|
|
1778
|
-
|
|
1779
|
-
PREFLIGHT — before printing 9.1 output, self-check:
|
|
1780
|
-
□ Did I group by `metadata.category.name`?
|
|
1781
|
-
□ Did I prefix each category with `1.`, `2.`, … `K.`?
|
|
1782
|
-
□ Did I assign global `R1..RN` IDs across categories?
|
|
1783
|
-
□ Did I show titles only (no summaries / no rationale)?
|
|
1784
|
-
□ Is there a compact scope line above the list?
|
|
1785
|
-
□ Does my action block use `R{N}` references that match the IDs above?
|
|
1786
|
-
|
|
1787
|
-
If any answer is no, FIX BEFORE PRINTING.
|
|
1788
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1789
|
-
```
|
|
1790
|
-
|
|
1791
|
-
Full rail at the landing (Recommendations stage opens):
|
|
1704
|
+
First category (rail shown):
|
|
1792
1705
|
|
|
1793
1706
|
```text
|
|
1794
1707
|
Ritual build
|
|
1795
1708
|
✓ Context ✓ Scope ✓ Discovery ● Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1796
1709
|
|
|
1797
1710
|
Scope:
|
|
1798
|
-
{one-line compressed scope — ~80-120 chars; truncate
|
|
1799
|
-
statement at a natural clause boundary, no ellipsis}
|
|
1800
|
-
|
|
1801
|
-
Recommendations ready
|
|
1711
|
+
{one-line compressed scope — ~80-120 chars; truncate at a clause boundary, no ellipsis}
|
|
1802
1712
|
|
|
1803
|
-
{N} recommendations across {K} categories.
|
|
1713
|
+
{N} recommendations across {K} categories. They're accepted by default —
|
|
1714
|
+
review and refine any, or proceed anytime.
|
|
1804
1715
|
|
|
1805
|
-
1
|
|
1806
|
-
R1 {title}
|
|
1807
|
-
R2 {title}
|
|
1716
|
+
Category 1/{K} — {category name}
|
|
1808
1717
|
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
R5 {title}
|
|
1718
|
+
R1 {title}
|
|
1719
|
+
{content — the description, wrapped at terminal width, 1-3 lines}
|
|
1720
|
+
Why this: {one-line Problem→Discovery→Tradeoff distillation, plain prose}
|
|
1813
1721
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1722
|
+
R2 {title}
|
|
1723
|
+
{description}
|
|
1724
|
+
Why this: {...}
|
|
1816
1725
|
|
|
1817
|
-
|
|
1726
|
+
Pulse: Reasoning Readiness ~88% · Context Debt 12% (implementation-ready)
|
|
1818
1727
|
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
Recommended: reply `accept recommended` to approve these {N} and generate
|
|
1822
|
-
the build brief.
|
|
1823
|
-
|
|
1824
|
-
Or reply:
|
|
1825
|
-
- `detail R7` to inspect one recommendation
|
|
1826
|
-
- `drop R8` to remove one before accepting
|
|
1827
|
-
- `change R3: <edit>` to revise one
|
|
1828
|
-
- `hold` to stop here
|
|
1728
|
+
Reply edit R{N} <your change> · next (Category 2/{K}) · proceed (build brief)
|
|
1829
1729
|
```
|
|
1830
1730
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
- **Categories are numbered `1..K`** (their position on the page). **Recommendations get stable `R1..RN` IDs** across the whole set. The numbering is for reading orientation; the user references recs by `R{N}`, not by category number.
|
|
1834
|
-
- **One blank line between categories**; titles indent at 3 spaces (so the eye lands on the category name first, then the R-IDs scan down).
|
|
1835
|
-
- **Pulse uses full labels** per `references/cli-output-contract.md` § Pulse tier labels.
|
|
1836
|
-
- **`accept recommended`** is the visible CTA — NOT `accept all`. "Recommended" frames the action as "the curated set you see on screen"; "all" sounds like a bulk operation over deduped/hidden/raw recs.
|
|
1837
|
-
- **Surface 4 actions at first render — not more.** The four above (`detail R{N}`, `drop R{N}`, `change R{N}: <edit>`, `hold`) cover the decisive cases. Less-frequent actions stay discoverable but off-screen at the landing:
|
|
1838
|
-
- **`add <topic>`** lets the user request an additional recommendation on the fly (e.g. `add telemetry` → agent calls `regenerate_recommendation` with a new rec hint, or asks the user to clarify what's missing). Surface it in `help` or on the 9.3 detail card, NOT in the landing action line — too many actions at once weakens the selection screen. If the backing API doesn't yet support targeted single-rec addition, prompt the user with: "I can add a rec for `{topic}` by regenerating the full set with that pinned — that takes ~30s. Or hold the current set and add manually via the web UI."
|
|
1839
|
-
- **`show scope`** to expand the full problem statement (covered in 9.2).
|
|
1840
|
-
|
|
1841
|
-
##### 9.2 — `show scope` handling
|
|
1842
|
-
|
|
1843
|
-
When the user replies `show scope`, expand to the full problem statement (no rail repetition — this is a sub-view inside the same phase, use the in-phase chip):
|
|
1731
|
+
Subsequent categories (in-phase chip, no full rail):
|
|
1844
1732
|
|
|
1845
1733
|
```text
|
|
1846
|
-
Recommendations ·
|
|
1734
|
+
Recommendations · Category 2/{K} — {category name}
|
|
1847
1735
|
|
|
1848
|
-
{
|
|
1736
|
+
R3 {title}
|
|
1737
|
+
{description}
|
|
1738
|
+
Why this: {...}
|
|
1849
1739
|
|
|
1850
|
-
|
|
1851
|
-
recommendation actions.
|
|
1852
|
-
```
|
|
1740
|
+
...
|
|
1853
1741
|
|
|
1854
|
-
|
|
1742
|
+
Reply edit R{N} <your change> · next (Category 3/{K}) · proceed (build brief)
|
|
1743
|
+
```
|
|
1855
1744
|
|
|
1856
|
-
|
|
1745
|
+
Notes:
|
|
1857
1746
|
|
|
1858
|
-
|
|
1859
|
-
|
|
1747
|
+
- **Global `R{N}` IDs** continue across categories (Category 2 starts at R3 if Category 1 held R1–R2). The R-ID is how the user references a rec in `edit R{N}`; never restart numbering per category.
|
|
1748
|
+
- **`content` (the description) and "Why this" ARE shown** at the walk — unlike the old titles-only landing. That's deliberate: the user reads and refines in place. Keep each rec to title + 1–3 description lines + one "Why this" line. If a rec's `acceptance_criteria` are short and genuinely useful you may add a single `Pass: {...}` line, but don't pad — the walk must stay scannable.
|
|
1749
|
+
- **One blank line between recs**; indent rec bodies under their `R{N}` so the eye lands on the title first.
|
|
1750
|
+
- **`proceed` is the primary CTA** and is offered on every category — the user never has to walk all categories to continue.
|
|
1751
|
+
- **On the last category**, the action line drops `next`; if the user types `next` there, reply: "That was the last category — reply `proceed` to continue, or `edit R{N}` to refine one."
|
|
1860
1752
|
|
|
1861
|
-
|
|
1753
|
+
##### 9.2 — `edit R{N} <ask>`: preview, then apply
|
|
1862
1754
|
|
|
1863
|
-
|
|
1864
|
-
{metadata.category.name}
|
|
1755
|
+
This mirrors Spark's "Revise → Preview Revision → Apply revision" exactly: the change is **previewed before anything persists**.
|
|
1865
1756
|
|
|
1866
|
-
|
|
1867
|
-
{
|
|
1757
|
+
1. Resolve `R{N}` → rec UUID from the walk's ID map.
|
|
1758
|
+
2. Call `mcp__ritual__suggest_recommendation_edit({ recommendation_id, instruction: "<the user's ask, verbatim>" })`. This runs an LLM and returns a **transient proposal** — nothing is mutated yet. It carries `id` (the proposal id), `summary` ("what changed"), and `diff[]` of `{ field, before, after }` where `field` is `title`, `description`, or `chain.<idx>`.
|
|
1759
|
+
3. **[USER PAUSE]** Render the preview and wait:
|
|
1868
1760
|
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
- Discovery: {one-line distillation from metadata.explainability.faq_references[0].insight}
|
|
1872
|
-
- Tradeoff: {one-line distillation from rationale's "Tradeoffs (...)" segment}
|
|
1873
|
-
- Recommendation: {one-line distillation from rationale's "Recommendation (...)" segment}
|
|
1761
|
+
```text
|
|
1762
|
+
Recommendations · R{N} — proposed revision
|
|
1874
1763
|
|
|
1875
|
-
|
|
1876
|
-
- {short imperative — derived from metadata.acceptance_criteria where actionable}
|
|
1877
|
-
- {short imperative}
|
|
1878
|
-
- {short imperative}
|
|
1764
|
+
What changed: {proposal.summary}
|
|
1879
1765
|
|
|
1880
|
-
|
|
1881
|
-
- {
|
|
1882
|
-
|
|
1883
|
-
- {metadata.acceptance_criteria[N]}
|
|
1766
|
+
Title
|
|
1767
|
+
- {before}
|
|
1768
|
+
+ {after}
|
|
1884
1769
|
|
|
1885
|
-
|
|
1886
|
-
- {
|
|
1887
|
-
|
|
1770
|
+
Description
|
|
1771
|
+
- {before}
|
|
1772
|
+
+ {after}
|
|
1888
1773
|
|
|
1889
|
-
|
|
1774
|
+
Why this — step {i}
|
|
1775
|
+
- {before}
|
|
1776
|
+
+ {after}
|
|
1890
1777
|
|
|
1891
|
-
|
|
1892
|
-
If you only want a subset, `drop` the recs you don't want first, then `accept recommended`.
|
|
1778
|
+
Reply apply (save this revision) · discard (keep the original)
|
|
1893
1779
|
```
|
|
1894
1780
|
|
|
1895
|
-
|
|
1896
|
-
|
|
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.
|
|
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.
|
|
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").
|
|
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).
|
|
1901
|
-
- `back` returns to the landing summary, NOT to a new fetch — the agent should cache the recs from the landing call and re-render.
|
|
1781
|
+
- Render ONLY the `diff` fields that are present. Map `field: "title"` → `Title`, `"description"` → `Description`, `"chain.<idx>"` → `Why this — step {idx+1}`.
|
|
1782
|
+
- If the proposal's `diff` is empty (the LLM found no meaningful change), say so plainly and return to the category view unchanged — don't fabricate a diff.
|
|
1902
1783
|
|
|
1903
|
-
|
|
1784
|
+
4. On `apply`: call `mcp__ritual__apply_recommendation_proposal({ recommendation_id, proposal_id })`. It persists a new version, replays the reasoning chain, and returns the applied proposal. Re-fetch the rec (`get_recommendations`) and **re-render the current category with R{N} updated in place**, then continue the walk (action line `edit R{N} <change> · next · proceed`).
|
|
1785
|
+
On `discard`: return to the current category unchanged — nothing was persisted.
|
|
1904
1786
|
|
|
1905
|
-
|
|
1787
|
+
Editing is non-destructive and does not advance the flow — the user can `edit` several recs, across categories, before `proceed`.
|
|
1906
1788
|
|
|
1907
|
-
|
|
1908
|
-
|---|---|---|
|
|
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. |
|
|
1912
|
-
| `detail R{N}` | Render the detail card for that rec | None (in-memory) |
|
|
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 |
|
|
1914
|
-
| `drop R{N}` | Mark that rec rejected | `update_recommendation` with status=rejected, OR add a "deliberately excluded" note for the brief generator |
|
|
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 |
|
|
1916
|
-
| `show scope` | Expand the scope reference | None (in-memory) |
|
|
1917
|
-
| `hold` | Stop here without accepting | None (exits the flow; user can resume later) |
|
|
1918
|
-
|
|
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.
|
|
1789
|
+
##### 9.3 — `next` and `proceed`
|
|
1922
1790
|
|
|
1923
|
-
|
|
1924
|
-
- `
|
|
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.
|
|
1926
|
-
|
|
1927
|
-
##### 9.A — Branch A: admin replies `accept recommended`
|
|
1928
|
-
|
|
1929
|
-
Call `mcp__ritual__accept_recommendations(exploration_id)`. Response includes counts (`promoted`, `alreadyApproved`, `skipped`, `transitionedToComplete`). Show the full rail at this completion state — Recommendations is done, Build brief comes next:
|
|
1791
|
+
- **`next`** → render the next category per § 9.1 (in-phase chip). After the last category, prompt `proceed`.
|
|
1792
|
+
- **`proceed`** (from any category) → call `mcp__ritual__accept_recommendations({ exploration_id })`. Under the non-blocking model this **records the human review** (stamps `reviewedAt` / `reviewedBy`) and advances; it is NOT a draft→approved promotion (the recs are already `approved`). The downstream artifacts were queued at rec-gen time, so this returns fast. Then show the completion rail and continue to Step 9.5:
|
|
1930
1793
|
|
|
1931
1794
|
```text
|
|
1932
1795
|
Ritual build
|
|
1933
1796
|
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ● Build brief ○ Implementation (Your agent)
|
|
1934
1797
|
|
|
1935
|
-
|
|
1798
|
+
Reviewed {N} recommendations.
|
|
1936
1799
|
|
|
1937
1800
|
View: https://app.ritualapp.cloud/e/{exploration_id}
|
|
1938
1801
|
|
|
1939
|
-
Next:
|
|
1802
|
+
Next: preparing the build brief…
|
|
1940
1803
|
```
|
|
1941
1804
|
|
|
1942
|
-
**Pulse (recommendations
|
|
1805
|
+
**Pulse (recommendations reviewed):** emit a pulse — this is almost always a state-tier crossing into **Recommendation-ready**. Render full.
|
|
1943
1806
|
|
|
1944
1807
|
Continue to Step 9.5 (`Wait for requirements`).
|
|
1945
1808
|
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
Same landing screen as 9.1, but the action block changes — collaborators can request admin review instead of accepting directly:
|
|
1949
|
-
|
|
1950
|
-
```text
|
|
1951
|
-
Ritual build
|
|
1952
|
-
✓ Context ✓ Scope ✓ Discovery ● Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1953
|
-
|
|
1954
|
-
Scope:
|
|
1955
|
-
{compact scope}
|
|
1956
|
-
|
|
1957
|
-
Admin acceptance pending
|
|
1958
|
-
|
|
1959
|
-
These recommendations are in {status — draft / pending_review}. Only an
|
|
1960
|
-
admin can formally accept them.
|
|
1961
|
-
|
|
1962
|
-
1. {Category 1}
|
|
1963
|
-
R1 {title}
|
|
1964
|
-
R2 {title}
|
|
1965
|
-
|
|
1966
|
-
...
|
|
1967
|
-
|
|
1968
|
-
Recommended: reply `request admin review` to send these for approval.
|
|
1969
|
-
Or reply `detail R7`, `change R3: <edit>`, `drop R8`, or `hold`.
|
|
1970
|
-
|
|
1971
|
-
(If your team allows it, you can continue to implementation before admin
|
|
1972
|
-
acceptance — Ritual will mark the exploration as `implemented_ahead` so
|
|
1973
|
-
the admin can reconcile later. Reply `continue` to take that path.)
|
|
1974
|
-
```
|
|
1975
|
-
|
|
1976
|
-
Note the THREE-tier CTA structure for collaborators:
|
|
1977
|
-
1. `request admin review` — the recommended path (notifies admin, no implementation yet)
|
|
1978
|
-
2. `continue` — implement-ahead-of-acceptance (logs as `implemented_ahead`; admin can reconcile later)
|
|
1979
|
-
3. `hold` — stop entirely
|
|
1980
|
-
|
|
1981
|
-
The `request admin review` action maps to the workspace notification endpoint (or falls back to a Slack/email DM the agent surfaces as a copyable message). The `implemented_ahead` path is documented in Step 11 / 12.
|
|
1982
|
-
|
|
1983
|
-
If the user picks `continue`, proceed to Step 9.5. The `sync_implementation` call in Step 12 will automatically snapshot the rec status via the A1.5 column.
|
|
1809
|
+
<!-- lite:keep-end -->
|
|
1984
1810
|
|
|
1985
1811
|
#### Step 9.5 — Wait for requirements (auto-triggered by Step 9)
|
|
1986
1812
|
|
|
@@ -2012,11 +1838,11 @@ Steps:
|
|
|
2012
1838
|
| Response | Action |
|
|
2013
1839
|
|---|---|
|
|
2014
1840
|
| `status === 'READY'` | Proceed to Step 10 |
|
|
2015
|
-
| `exists === false` (still null) for 3+ polls | The fire-and-forget hasn't reached the DB yet, OR
|
|
1841
|
+
| `exists === false` (still null) for 3+ polls | The fire-and-forget hasn't reached the DB yet, OR `proceed` (accept_recommendations) hasn't run yet (no LLM call yet). After several polls either keep polling OR proceed to Step 10 — the API auto-triggers generation inline if the set is still missing when the brief is requested (adds ~30s to the brief call but never hard-fails). |
|
|
2016
1842
|
| `status === 'GENERATING'` | Keep polling |
|
|
2017
1843
|
| `status === 'FAILED'` | Surface `errorMessage` to the user; offer to retry by calling `generate_build_brief` directly (which will auto-trigger a fresh generation), OR by hitting `POST /requirements?force=true` via the web UI |
|
|
2018
1844
|
|
|
2019
|
-
4. **Special case —
|
|
1845
|
+
4. **Special case — `proceed` not yet called (accept_recommendations hasn't run):** if the user jumped ahead without the rec-review `proceed`, there's no fire-and-forget auto-trigger from that path. 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. (Note: auto-finalize at rec-gen completion usually already queued requirements, so this case is rare.)
|
|
2020
1846
|
|
|
2021
1847
|
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
1848
|
|
|
@@ -2210,15 +2036,15 @@ Call `mcp__ritual__generate_build_brief` with:
|
|
|
2210
2036
|
- `recon_context` — the Step 3 `codebase_context_packet` plus any explicit phase/later candidates from discovery. Do not pass raw recon notes. This grounds "Codebase Anchors" in real file paths while keeping agent hypotheses auditable and non-authoritative.
|
|
2211
2037
|
- `sources` — the **same** file-path array passed to `generate_considerations` and `generate_problem_statement` in Steps 4–5. Critical for KG consistency: the brief's "Previously Deferred" section only populates when overlapping prior implementations exist on these files.
|
|
2212
2038
|
|
|
2213
|
-
Returns the
|
|
2039
|
+
Returns **immediately** with `status: 'GENERATING'` (synthesis runs in the background — poll per Step 10b) UNLESS it's a cache hit, which returns `status: 'READY'` with the brief markdown directly. The brief is **idempotent on (exploration, icp)** — same recommendation+requirement hashes return the cached READY row. Pass `force: true` only when a prompt-version update requires re-generation (also returns `GENERATING` → poll).
|
|
2214
2040
|
|
|
2215
|
-
##### 10b —
|
|
2041
|
+
##### 10b — Status polling (CLI Tenet #8)
|
|
2216
2042
|
|
|
2217
|
-
`generate_build_brief`
|
|
2043
|
+
`generate_build_brief` is **fire-and-poll**: it returns almost immediately with `status: 'GENERATING'` (the synthesis runs server-side in the background) — NOT the finished brief. A cache hit returns `status: 'READY'` directly; treat that as done. So you no longer wait on a local timeout — you poll the status from the start.
|
|
2218
2044
|
|
|
2219
|
-
**Don't
|
|
2045
|
+
**Don't treat the GENERATING response as the brief, and don't re-call generate to "check".** Poll the status:
|
|
2220
2046
|
|
|
2221
|
-
1.
|
|
2047
|
+
1. After `generate_build_brief` returns `GENERATING` (or on the rare local timeout), call `mcp__ritual__get_build_brief_status(exploration_id, icp)`.
|
|
2222
2048
|
2. Poll using the standard async polling rule: one `Bash sleep 5` per poll iteration, then a fresh status call. Print a brief "still generating…" update every ~3 polls when the status is unchanged.
|
|
2223
2049
|
3. Exit conditions:
|
|
2224
2050
|
|
|
@@ -2394,6 +2220,7 @@ Branch by user response. The CTA on screen is `go`, but accept these as synonyms
|
|
|
2394
2220
|
|
|
2395
2221
|
**Pulse (Step 10 done):** Emit a pulse — this often crosses into **Implementation-ready** (90%+). Render full when that crossing happens. Use the build-brief celebration line: `✓ Build brief ready — discovery has become an implementation path.` If still below 90% (e.g. brief flagged residual debt), surface that in the pulse line itself and propose addressing it before coding.
|
|
2396
2222
|
|
|
2223
|
+
<!-- lite:skip-start reason="optional UX brief review is not part of lite" -->
|
|
2397
2224
|
#### Step 10.5 — Optional UX brief review (entered ONLY when the user picks `ux-review` at Step 10d)
|
|
2398
2225
|
|
|
2399
2226
|
This step is opt-in. If the user picked `go` at Step 10d, skip directly to Step 11. The `ux-review` path is reached only when the user explicitly asks for it at the Step 10d gate — there is no auto-gating in this MVP (later iterations may use Stage E's UI-surface classifier to suggest the path automatically; see `backlog_design_recon_stage_e.md`).
|
|
@@ -2487,6 +2314,8 @@ Steps:
|
|
|
2487
2314
|
|
|
2488
2315
|
**Pulse (Step 10.5 done):** Re-emit the Step 10 pulse if the review surfaced material gaps or mismatches — Readiness can dip back below 90% when significant UX work is flagged that the brief didn't capture. If the review came back clean (zero mismatches, zero gaps, zero new-work), keep the existing pulse — the brief was already implementation-ready.
|
|
2489
2316
|
|
|
2317
|
+
<!-- lite:skip-end -->
|
|
2318
|
+
<!-- lite:keep-start -->
|
|
2490
2319
|
#### Step 11 — Implement
|
|
2491
2320
|
|
|
2492
2321
|
This step happens **inside** the same `/ritual build` chat if the agent is also the coding agent (Claude Code / Cursor / etc.), or hand-off if the user is implementing themselves.
|
|
@@ -2577,9 +2406,23 @@ The user is now in plan mode (from Step 11.0.5). The agent must:
|
|
|
2577
2406
|
|
|
2578
2407
|
1. **Load `BUILD-BRIEF.md`** as the first input. If `BUILD-BRIEF-VERIFICATION.md` exists, load it too — every `contradicted` and `not_found` entry becomes an explicit constraint in the plan ("the brief claimed X but the code does Y; the plan must reconcile / not assume X"). If `UX-REVIEW.md` exists alongside `BUILD-BRIEF.md` (the user opted into Step 10.5), use the "Plan Mode Prompt" block at its bottom as the FIRST input — its numbered list of mismatches / gaps / new-work surfaces is the tailored agenda. The generic plan-mode template is the fallback for when only the brief exists.
|
|
2579
2408
|
|
|
2580
|
-
2. **
|
|
2409
|
+
2. **Load the SCOPE CONTRACT as hard constraints (the load-bearing step — prevention, not just detection).** The brief read (`get_build_brief_status` → `scopeContractResolved`, or the `generate_build_brief` response) carries the SAME typed contract Ritual will audit your plan against at Step 11.1.6. Treat it as binding and put it at the TOP of the plan-mode prompt verbatim:
|
|
2410
|
+
|
|
2411
|
+
> **Scope contract — your plan must honour this (it will be audited):**
|
|
2412
|
+
> - **MUST cover** (one or more plan steps each, and cite the requirement): {each `scopeContractResolved.inScope[].text`}
|
|
2413
|
+
> - **Do NOT implement — deferred to a LATER PR** (out of scope for this change): {each `deferred[].text`}
|
|
2414
|
+
> - **Do NOT cross — non-goals**: {each `antiGoals[].text`}
|
|
2415
|
+
> - **Open questions — do NOT silently implement; flag if you must touch**: {each `discoveryGates[].text`}
|
|
2416
|
+
|
|
2417
|
+
This is what makes plan mode deliver on the promise of the brief (which delivers on the recs). Feeding the contract in UP FRONT prevents the divergences Step 11.1.6 would otherwise have to catch and send back.
|
|
2581
2418
|
|
|
2582
|
-
3. **
|
|
2419
|
+
3. **Produce a numbered implementation plan** that:
|
|
2420
|
+
- has **one or more steps covering EVERY in-scope requirement** above (map each step to the requirement id it implements — this is the coverage the audit checks),
|
|
2421
|
+
- implements **none** of the deferred items and crosses **none** of the non-goals,
|
|
2422
|
+
- puts the RBs, any verification contradictions, and any UX "new work" surfaces at the top,
|
|
2423
|
+
- names the specific files / functions / new modules each step touches — concrete enough that the user can spot a mistake before any edit.
|
|
2424
|
+
|
|
2425
|
+
4. **Stay in plan mode until the user accepts the plan.** Do NOT switch to edit/auto-accept mode until the user explicitly approves the plan in plan mode (Claude Code's "accept plan" affordance, or the user typing `accept` / `looks good` / `go`).
|
|
2583
2426
|
|
|
2584
2427
|
##### 11.1.5 — Optional: save the implementation plan as a markdown artifact
|
|
2585
2428
|
|
|
@@ -2622,6 +2465,87 @@ Save this plan to `IMPLEMENTATION-PLAN.md` before coding? (y/N)
|
|
|
2622
2465
|
|
|
2623
2466
|
**Why this matters:** `BUILD-BRIEF.md` is the Ritual requirements artifact (what + why). `IMPLEMENTATION-PLAN.md` is the agent's concrete execution strategy (how). For non-trivial implementations, saving both gives reviewers a useful bridge from requirement to code — and gives `/ritual lineage` queries a richer trail to surface on future builds touching the same files.
|
|
2624
2467
|
|
|
2468
|
+
<!-- lite:skip-start reason="optional plan-fidelity audit is not part of lite" -->
|
|
2469
|
+
##### 11.1.6 — Optional: audit the plan against the brief (Audit 3 / plan-fidelity)
|
|
2470
|
+
|
|
2471
|
+
After plan mode produces the plan and **before any code edits**, you can audit the plan against the build brief's frozen **scope contract** (its in-scope requirements, discovery-gate requirements, and anti-goals). This is **Audit 3 / R6** — the downstream bookend to the Step 9.6 recs audit. It's non-circular by construction: the contract derives from discovery/recs, never the plan, so a flagged divergence is a real drift, not a tautology.
|
|
2472
|
+
|
|
2473
|
+
**Gate behavior by build mode** (from Step 0.1's `auditMode`):
|
|
2474
|
+
|
|
2475
|
+
- **`normal` (default):** offer it; default is to skip (most plans are faithful).
|
|
2476
|
+
- **`audited`:** recommend it (default yes).
|
|
2477
|
+
- **`strict`:** run it automatically (no prompt), and treat an `anti_goal_violation` as blocking.
|
|
2478
|
+
|
|
2479
|
+
**Rendering contract — verbatim (normal / audited modes):**
|
|
2480
|
+
|
|
2481
|
+
```text
|
|
2482
|
+
Plan ready — audit it against the brief before coding?
|
|
2483
|
+
|
|
2484
|
+
Ritual can check this plan against BUILD-BRIEF.md's scope contract — flagging
|
|
2485
|
+
anything the plan drops (a brief requirement no step covers), sneaks in
|
|
2486
|
+
(out-of-scope work), or that crosses a non-goal — before you write code.
|
|
2487
|
+
|
|
2488
|
+
Reply `audit-plan` to run it, or `proceed` to start implementing.
|
|
2489
|
+
```
|
|
2490
|
+
|
|
2491
|
+
[USER PAUSE] Branch on response:
|
|
2492
|
+
|
|
2493
|
+
- **`audit-plan`** (or auto, in `strict` mode): call
|
|
2494
|
+
`mcp__ritual__audit_plan(exploration_id, plan_content)` where `plan_content`
|
|
2495
|
+
is the implementation plan plan mode just produced (the same text you'd save to
|
|
2496
|
+
`IMPLEMENTATION-PLAN.md`). The server normalizes it to plan operations and runs
|
|
2497
|
+
R6 against the brief's scope contract. It's async — the tool polls to
|
|
2498
|
+
completion and returns a thin payload:
|
|
2499
|
+
- `audit_status: "ok"` (no divergences) → tell the user the plan is faithful to
|
|
2500
|
+
the brief and continue to Step 11.2.
|
|
2501
|
+
- `audit_status: "needs_attention"` → render each divergence (`divergence_kind`
|
|
2502
|
+
+ the `plan_op` and/or `brief_reference` it concerns + `rationale`). Group by
|
|
2503
|
+
kind: **missing_brief_decision** ("the brief asked for X; no plan step covers
|
|
2504
|
+
it" — computed deterministically from coverage), **out_of_scope_addition**
|
|
2505
|
+
("step N does X, which maps to nothing in the brief"), **premature_implementation**
|
|
2506
|
+
("step N implements X, which the brief deferred to a LATER phase/PR — not this
|
|
2507
|
+
one"), **scope_creep** ("step N covers X but does substantially more"). Then
|
|
2508
|
+
pause: *"Revise the plan to address these (back to plan mode), or proceed and
|
|
2509
|
+
accept the divergences? Reply `revise` or `proceed`."*
|
|
2510
|
+
- `audit_status: "blocked"` (an `anti_goal_violation`) → surface it prominently:
|
|
2511
|
+
*"⚠ The plan advances something the brief explicitly forbids: {evidence}. This
|
|
2512
|
+
crosses a non-goal you set during discovery."* In `strict` mode this blocks —
|
|
2513
|
+
require `revise` or an explicit `override` with a one-line justification. In
|
|
2514
|
+
other modes, strongly recommend `revise`.
|
|
2515
|
+
- On `revise`: the audit response carries a ready-to-paste **`revision_directive`**
|
|
2516
|
+
(assembled from the structured `revisions[]`, blockers first — each is a
|
|
2517
|
+
`request_plan_revision` repair keyed to a specific divergence). Feed that
|
|
2518
|
+
directive **verbatim** back into plan mode as the revision agenda (back to
|
|
2519
|
+
Step 11.1, keeping the scope contract from 11.1's step 2 in force), let plan
|
|
2520
|
+
mode produce a revised plan, then **re-run `audit_plan` on the revised plan**.
|
|
2521
|
+
This is the runtime repair loop: `audit_plan` → `revise` → `audit_plan`.
|
|
2522
|
+
- **Cap it at 2 revision rounds.** If divergences remain after the 2nd
|
|
2523
|
+
revision, stop looping and surface the residual divergences to the user with
|
|
2524
|
+
a decision: *"These divergences persist after 2 revisions — accept them
|
|
2525
|
+
(they'll be logged), or stop here? Reply `accept` or `pause`."* Don't churn.
|
|
2526
|
+
- On `proceed` / `override` / `accept`: continue to Step 11.2. Treat each
|
|
2527
|
+
accepted divergence as a **`confirm_intentional_divergence`** — record it as a
|
|
2528
|
+
Step 12 `sync_implementation` decision (`area` = the requirement/anti-goal,
|
|
2529
|
+
`choice` = "intentionally diverged: {why}", `source_recommendation_id` = the
|
|
2530
|
+
`brief_reference.id`) so the override is captured in lineage rather than lost.
|
|
2531
|
+
A persistent *anti-goal violation* the user keeps overriding is a signal the
|
|
2532
|
+
BRIEF (or its anti-goals) is wrong — surface that, don't just bury it.
|
|
2533
|
+
- **`proceed`** (or anything else): skip the audit and continue to Step 11.2. Do
|
|
2534
|
+
not re-prompt.
|
|
2535
|
+
|
|
2536
|
+
**Rules:**
|
|
2537
|
+
|
|
2538
|
+
- **Requires a READY BuildBrief with a scope contract.** Briefs synthesized before
|
|
2539
|
+
the scope-contract feature lack one; if `audit_plan` returns a 400 about a
|
|
2540
|
+
missing contract, regenerate the brief (`generate_build_brief force:true`) or
|
|
2541
|
+
skip the audit — don't block the build on it.
|
|
2542
|
+
- **Advisory, not auto-repair.** R6 surfaces divergences; the fix is always a
|
|
2543
|
+
human-in-the-loop plan revision or an explicit accept. Never silently rewrite
|
|
2544
|
+
the plan.
|
|
2545
|
+
- **Don't dump the raw normalized plan ops** into the chat — surface the
|
|
2546
|
+
divergences (the signal), not the methodology.
|
|
2547
|
+
|
|
2548
|
+
<!-- lite:skip-end -->
|
|
2625
2549
|
##### 11.2 — Implement
|
|
2626
2550
|
|
|
2627
2551
|
1. Use the standard coding-loop tools (Edit/Write/Bash/etc.) to execute the accepted plan.
|
|
@@ -2669,40 +2593,55 @@ If the user says "y" / "push" / "open PR":
|
|
|
2669
2593
|
3. `gh pr create --base <default-branch> --title <…> --body <…>`.
|
|
2670
2594
|
4. Surface the PR URL to the user.
|
|
2671
2595
|
|
|
2596
|
+
**Write the PR body for a maintainer who has never heard of Ritual.** Lead with what changed, *where to look* (in review order), *why*, and *how to verify* — so a reviewer can move fast and trust the change. Ritual lineage goes at the bottom, not the top. Fill every section from real artifacts (brief decisions, the diff, the test files); never leave a `<placeholder>` in the posted body.
|
|
2597
|
+
|
|
2672
2598
|
**PR body template:**
|
|
2673
2599
|
|
|
2674
2600
|
```markdown
|
|
2675
|
-
##
|
|
2601
|
+
## What this PR does
|
|
2676
2602
|
|
|
2677
|
-
<2-3
|
|
2603
|
+
<2-3 plain sentences: the change + the problem it solves, derived from the build brief's Goal>
|
|
2678
2604
|
|
|
2679
|
-
##
|
|
2605
|
+
## Where to look (review order)
|
|
2680
2606
|
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
| … | | |
|
|
2607
|
+
1. `<path>` — <the load-bearing change; start here>
|
|
2608
|
+
2. `<path>` — <how it integrates>
|
|
2609
|
+
3. `<path>` — <schema/data changes, if any>
|
|
2610
|
+
<ordered load-bearing → plumbing, so review time goes where it matters>
|
|
2686
2611
|
|
|
2687
|
-
##
|
|
2612
|
+
## Why / key decisions
|
|
2688
2613
|
|
|
2689
|
-
- <
|
|
2690
|
-
- <coverage notes if non-trivial>
|
|
2614
|
+
- <decision + the trade-off / alternative rejected — the 1-3 calls a reviewer might second-guess, taken from the brief's decisions>
|
|
2691
2615
|
|
|
2692
|
-
##
|
|
2616
|
+
## How to verify
|
|
2693
2617
|
|
|
2694
|
-
-
|
|
2695
|
-
-
|
|
2696
|
-
- Implementation plan: see `IMPLEMENTATION-PLAN.md` *(only include this line if Step 11.1.5 actually wrote the file — agent execution strategy alongside the brief)*
|
|
2697
|
-
- Deferrals intentionally punted: <count, with one-line each>
|
|
2618
|
+
- Automated: <test files + how to run them>
|
|
2619
|
+
- Manual: <steps a reviewer runs locally to see it work>
|
|
2698
2620
|
|
|
2699
|
-
|
|
2621
|
+
## Scope & follow-ups
|
|
2622
|
+
|
|
2623
|
+
- In scope: <what this PR delivers>
|
|
2624
|
+
- Out of scope / deferred: <intentional punts, one line each — so reviewers don't flag them as gaps>
|
|
2625
|
+
|
|
2626
|
+
## Risk / blast radius
|
|
2627
|
+
|
|
2628
|
+
- <backward-compat, migration ordering, perf — what could break in prod>
|
|
2629
|
+
|
|
2630
|
+
## Ritual lineage
|
|
2631
|
+
|
|
2632
|
+
- Exploration: [<exploration name>](<EXPLORATION_URL>) · Build brief: `BUILD-BRIEF.md` (committed for reviewer reference) · Requirements satisfied: <N/M>
|
|
2633
|
+
- Implementation plan: see `IMPLEMENTATION-PLAN.md` *(only if Step 11.1.5 wrote it)*
|
|
2634
|
+
|
|
2635
|
+
Ritual-Exploration: <exploration_id>
|
|
2700
2636
|
|
|
2701
2637
|
🪷 Generated via [Ritual](https://ritual.work) — closing the loop with `sync_implementation` after merge.
|
|
2702
2638
|
```
|
|
2703
2639
|
|
|
2640
|
+
> **`<EXPLORATION_URL>` MUST be environment-correct — never hardcode `app.ritualapp.cloud`.** Use the server-resolved exploration URL the MCP returns (built from the server's `WEB_URL`). Hardcoding production breaks the link for **dev** builds (the exploration lives in the dev DB) and for **self-hosted / single-tenant enterprise** deployments (the exploration lives on the customer's own Ritual instance, not Ritual's SaaS). If the MCP response does not carry a URL, derive the base from your Ritual auth issuer rather than assuming production. Same rule for the `Ritual-Exploration-Url` commit trailer.
|
|
2641
|
+
|
|
2704
2642
|
If the user is implementing manually: hand off the brief + the branch-strategy note ("create a feature branch off `main` — don't commit to trunk"), tell them you'll be ready to run `sync_implementation` when they're done.
|
|
2705
2643
|
|
|
2644
|
+
<!-- lite:keep-end -->
|
|
2706
2645
|
#### Step 12 — Close the loop with `sync_implementation`
|
|
2707
2646
|
|
|
2708
2647
|
##### 12.0 — What this step does (in product terms)
|
|
@@ -2741,7 +2680,7 @@ Call `mcp__ritual__sync_implementation` with:
|
|
|
2741
2680
|
- `deferrals[]` — for things you intentionally punted (`rb_id`, `description`, `reason`, `severity`, `related_files[]`, `related_modules[]`)
|
|
2742
2681
|
- `gate_verdict`, `adherence_rate` — your own self-reported quality signals
|
|
2743
2682
|
|
|
2744
|
-
The A1.5 snapshot column auto-captures each linked recommendation's status at the moment of sync — so if you implemented
|
|
2683
|
+
The A1.5 snapshot column auto-captures each linked recommendation's status at the moment of sync — so if you implemented before the rec review's `proceed` (while the rec was still un-reviewed), the timeline is preserved automatically.
|
|
2745
2684
|
|
|
2746
2685
|
When sync_implementation succeeds, the response includes:
|
|
2747
2686
|
|
|
@@ -2773,7 +2712,7 @@ any touched file to trace this back later.
|
|
|
2773
2712
|
|
|
2774
2713
|
The `Implemented:` line surfaces a representative slice of WHAT got implemented (concrete area:choice pairs from the underlying `decisions[]` payload) rather than a labeled count. Per the vocabulary rule in `cli-output-contract.md`: the word "decisions" is not surfaced as a user-facing label; the artifacts ARE the signal.
|
|
2775
2714
|
|
|
2776
|
-
If any anchor's `recommendationStatusAtImplementation` is NOT `approved` (i.e. the
|
|
2715
|
+
If any anchor's `recommendationStatusAtImplementation` is NOT `approved` (i.e. implemented before the rec review's `proceed`), add a callout — still frame in implementation/recommendation terms. Append this block BELOW the completion message (no separate rail; the rail is already rendered at the top):
|
|
2777
2716
|
|
|
2778
2717
|
```text
|
|
2779
2718
|
⚠ {M} of the recommendations were implemented while still in {status}
|
|
@@ -2850,7 +2789,85 @@ Reply `1`, `2`, or `3`. Reply `pause` to stop here.
|
|
|
2850
2789
|
|
|
2851
2790
|
If the saved payload's `commits[]` matches current git state, proceed silently to the retry.
|
|
2852
2791
|
|
|
2853
|
-
|
|
2792
|
+
<!-- lite:keep-start -->
|
|
2793
|
+
#### Step 13 — Suggest the next job to be done
|
|
2794
|
+
|
|
2795
|
+
The loop just closed (Step 12). Rather than stop cold and make the user
|
|
2796
|
+
re-bootstrap context for whatever they do next, offer the **next best job to be
|
|
2797
|
+
done** — a NEW discovery exploration in THIS workspace, so the knowledge graph,
|
|
2798
|
+
deferrals, and prior explorations you just built keep compounding. This is
|
|
2799
|
+
forward motion, never required work.
|
|
2800
|
+
|
|
2801
|
+
##### 13.1 — Generate the suggestion set
|
|
2802
|
+
|
|
2803
|
+
Call `mcp__ritual__suggest_next_job` with `{ exploration_id }` (the
|
|
2804
|
+
just-finished exploration). It returns 1 primary + up to 2 alternatives. Each is
|
|
2805
|
+
a NEW exploration that runs its own discovery — it is **never** "go implement the
|
|
2806
|
+
recommendations you already have" (that's the coding agent's job — `/ritual
|
|
2807
|
+
resume` on this same exploration). Each suggestion carries:
|
|
2808
|
+
|
|
2809
|
+
- `jtbd` + `label` — the job, already picked
|
|
2810
|
+
- `reasoning` — the concrete signal it cites (a deferral, an unaddressed recommendation, or the natural lifecycle continuation)
|
|
2811
|
+
- `descriptionSeed` — a first-person "what to explore" framing to pre-fill the next exploration's problem box
|
|
2812
|
+
- `recommendedPersona`, `sourceRecommendationId`, `id`
|
|
2813
|
+
|
|
2814
|
+
Also returned: `recommendationsAddressed` (false ⇒ this exploration still has
|
|
2815
|
+
clear-to-implement work that ships via `resume`, not a next job).
|
|
2816
|
+
|
|
2817
|
+
- **If `suggestions` is empty** (or the call errors) → say nothing about next jobs; drop straight to 13.3. Never block the closed-loop completion on this.
|
|
2818
|
+
|
|
2819
|
+
##### 13.2 — Present the picker
|
|
2820
|
+
|
|
2821
|
+
**[USER PAUSE]** Render the standard list-picker (primary first, marked ★):
|
|
2822
|
+
|
|
2823
|
+
```text
|
|
2824
|
+
Next job to be done
|
|
2825
|
+
|
|
2826
|
+
{exploration name} is shipped and logged. To keep building on what this
|
|
2827
|
+
workspace now knows, here's the next discovery worth running:
|
|
2828
|
+
|
|
2829
|
+
★ 1. {primary label}
|
|
2830
|
+
{primary reasoning}
|
|
2831
|
+
|
|
2832
|
+
2. {alt1 label}
|
|
2833
|
+
{alt1 reasoning}
|
|
2834
|
+
|
|
2835
|
+
3. {alt2 label}
|
|
2836
|
+
{alt2 reasoning}
|
|
2837
|
+
|
|
2838
|
+
Reply `1`, `2`, or `3` to start it — the job's already picked, so you'll go
|
|
2839
|
+
straight to framing what to explore. Reply `skip` to stop here.
|
|
2840
|
+
```
|
|
2841
|
+
|
|
2842
|
+
Only render lines for the suggestions actually returned (there may be just a
|
|
2843
|
+
primary, or a primary + 1). If `recommendationsAddressed` is `false`, add ONE
|
|
2844
|
+
line below the picker — lean on the coding agent, don't turn Ritual into a
|
|
2845
|
+
backlog manager:
|
|
2846
|
+
|
|
2847
|
+
```text
|
|
2848
|
+
({N} item{s} from this exploration are clear to implement — say `resume` to continue shipping them here.)
|
|
2849
|
+
```
|
|
2850
|
+
|
|
2851
|
+
**[USER PAUSE — required, do not auto-answer]** Wait for the user's reply.
|
|
2852
|
+
|
|
2853
|
+
##### 13.2.1 — On pick (`1` / `2` / `3`)
|
|
2854
|
+
|
|
2855
|
+
The picked suggestion is a NEW exploration in the SAME workspace with the job
|
|
2856
|
+
already chosen — so **advance, don't re-bootstrap**:
|
|
2857
|
+
|
|
2858
|
+
1. Skip the work-item / job pick entirely (Steps 0–4) — `jtbd` is already set by the suggestion.
|
|
2859
|
+
2. Go to **Step 5 (problem frame)** using the suggestion's `descriptionSeed` as the DRAFT "what are you trying to explore?" — present it as an editable starting point, not a blank box. Let the user refine it.
|
|
2860
|
+
3. At **Step 6 (`create_exploration`)**, pass `from_next_job_suggestion_id` = the picked suggestion's `id`. The server links the new exploration to its parent + source recommendation, defaults the `jtbd` from the suggestion, and marks the suggestion started (it stops showing as an open next job, and the originating recommendation now reads as handed off).
|
|
2861
|
+
- If `create_exploration` returns **409** (this next job was already started), don't create a duplicate — tell the user it's already in progress and offer to open that exploration instead.
|
|
2862
|
+
4. Continue the normal flow from **Step 7 (discovery)**.
|
|
2863
|
+
|
|
2864
|
+
##### 13.2.2 — On `skip`
|
|
2865
|
+
|
|
2866
|
+
Acknowledge and drop to 13.3. The suggestion set is persisted — a later `ritual
|
|
2867
|
+
graph status` or re-run of `/ritual build` in this workspace can surface it
|
|
2868
|
+
again; nothing is lost.
|
|
2869
|
+
|
|
2870
|
+
##### 13.3 — Follow-up pointer
|
|
2854
2871
|
|
|
2855
2872
|
If they want to check the state at any time, point them at:
|
|
2856
2873
|
|
|
@@ -2858,9 +2875,10 @@ If they want to check the state at any time, point them at:
|
|
|
2858
2875
|
|
|
2859
2876
|
Or: re-run `/ritual build` in this workspace later — the existing-work check will surface this exploration with its new `done` state badge, and any future build whose `sources` overlap will pull in the decisions + deferrals you just logged as priorContext.
|
|
2860
2877
|
|
|
2878
|
+
<!-- lite:keep-end -->
|
|
2861
2879
|
### Failure modes & recovery
|
|
2862
2880
|
|
|
2863
|
-
**Discovery generation hangs (>5 min polling without `ready: true`)**: ask the user — wait longer
|
|
2881
|
+
**Discovery generation hangs (>5 min polling without `ready: true`)**: ask the user — wait longer, or retry (`suggest_discovery_questions` again, new task)? Discovery questions are required (the user must pick at least 6 to run), so there is no skip-and-proceed option; if generation can't produce questions, surface the failure rather than running with none.
|
|
2864
2882
|
|
|
2865
2883
|
**Agentic run fails or stalls**: surface the error, offer retry or stop.
|
|
2866
2884
|
|
|
@@ -2908,8 +2926,9 @@ This subcommand exclusively uses Ritual MCP tools, in the order they appear:
|
|
|
2908
2926
|
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
2927
|
24g. `mcp__ritual__get_audit_chain` (Step 9.6 — fetch the full chain trail for review/lineage; cli 0.10.0+)
|
|
2910
2928
|
25. `mcp__ritual__sync_implementation` (Step 12)
|
|
2929
|
+
26. `mcp__ritual__suggest_next_job` (Step 13.1 — propose the next discovery job after the loop closes; `create_exploration` at Step 13.2.1 takes `from_next_job_suggestion_id` to record the handoff)
|
|
2911
2930
|
|
|
2912
|
-
|
|
2931
|
+
36 of the 48 Ritual MCP tools (cli 0.10.0+: the 3 audit tools — `audit_recommendations`, `apply_repair`, `get_audit_chain` — joined the linear flow at Step 9.6 (audit-suite.md § Audit 1); cli 0.22.0+: `suggest_next_job` joined at Step 13 to close-then-continue the loop). The other 12 (`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`, `get_next_job`) are situational, not part of the linear build flow (`get_next_job` re-reads a persisted next-job set; the flow itself only needs `suggest_next_job`).
|
|
2913
2932
|
|
|
2914
2933
|
**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.
|
|
2915
2934
|
|
|
@@ -2918,8 +2937,8 @@ This subcommand exclusively uses Ritual MCP tools, in the order they appear:
|
|
|
2918
2937
|
When `/ritual build` completes, the exploration is in COMPLETE state with accepted recommendations AND a build brief has been generated AND (if the agent implemented in-chat) `sync_implementation` has been called. The full close-the-loop cycle now lives inside this skill — there's no separate downstream `/ritual-builder-spec` step required.
|
|
2919
2938
|
|
|
2920
2939
|
Variants:
|
|
2921
|
-
-
|
|
2922
|
-
-
|
|
2940
|
+
- One person runs the whole flow: Steps 1 → 13, no handoff. Step 9 is a uniform non-blocking review (recs are auto-accepted; `proceed` records the review and continues).
|
|
2941
|
+
- Implementation lands before the rec review/`proceed`: the `sync_implementation` snapshot freezes that timeline and the exploration shows `⚠ implemented_ahead` until reconciled (see Step 12).
|
|
2923
2942
|
- Resume mid-flow: the existing-work check surfaces explorations with state badges and jumps directly to the right phase. (Or, for the "I just want to pick up" intent, see `/ritual resume` below.)
|
|
2924
2943
|
|
|
2925
2944
|
---
|