@ritualai/cli 0.7.9 → 0.7.11
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 +113 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +198 -45
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +20 -18
- package/dist/commands/login.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/identity-banner.js +2 -1
- package/dist/lib/identity-banner.js.map +1 -1
- package/dist/lib/node-managers.js +114 -0
- package/dist/lib/node-managers.js.map +1 -0
- package/dist/lib/npm-registry.js +107 -0
- package/dist/lib/npm-registry.js.map +1 -0
- package/dist/lib/oidc.js +19 -10
- package/dist/lib/oidc.js.map +1 -1
- package/dist/lib/skill-bundles.js +62 -0
- package/dist/lib/skill-bundles.js.map +1 -0
- package/dist/lib/skill-manifest.js +53 -0
- package/dist/lib/skill-manifest.js.map +1 -0
- package/dist/lib/welcome-banner.js +9 -12
- package/dist/lib/welcome-banner.js.map +1 -1
- package/dist/lib/workspace-flow.js +11 -5
- package/dist/lib/workspace-flow.js.map +1 -1
- package/package.json +1 -1
- package/skills/claude-code/ritual/.ritual-bundle.json +4 -0
- package/skills/claude-code/ritual/references/async-polling.md +43 -9
- package/skills/claude-code/ritual/references/build-flow.md +764 -150
- package/skills/claude-code/ritual/references/cli-output-contract.md +181 -8
- package/skills/claude-code/ritual/references/context-pulse-flow.md +3 -3
- package/skills/claude-code/ritual/references/discovery-classification.md +3 -3
- package/skills/claude-code/ritual/references/resume-flow.md +2 -0
- package/skills/codex/ritual/.ritual-bundle.json +4 -0
- package/skills/codex/ritual/references/async-polling.md +43 -9
- package/skills/codex/ritual/references/build-flow.md +764 -150
- package/skills/codex/ritual/references/cli-output-contract.md +181 -8
- package/skills/codex/ritual/references/context-pulse-flow.md +3 -3
- package/skills/codex/ritual/references/discovery-classification.md +3 -3
- package/skills/codex/ritual/references/resume-flow.md +2 -0
- package/skills/cursor/ritual/.ritual-bundle.json +4 -0
- package/skills/cursor/ritual/references/async-polling.md +43 -9
- package/skills/cursor/ritual/references/build-flow.md +764 -150
- package/skills/cursor/ritual/references/cli-output-contract.md +181 -8
- package/skills/cursor/ritual/references/context-pulse-flow.md +3 -3
- package/skills/cursor/ritual/references/discovery-classification.md +3 -3
- package/skills/cursor/ritual/references/resume-flow.md +2 -0
- package/skills/gemini/ritual/.ritual-bundle.json +4 -0
- package/skills/gemini/ritual/references/async-polling.md +43 -9
- package/skills/gemini/ritual/references/build-flow.md +764 -150
- package/skills/gemini/ritual/references/cli-output-contract.md +181 -8
- package/skills/gemini/ritual/references/context-pulse-flow.md +3 -3
- package/skills/gemini/ritual/references/discovery-classification.md +3 -3
- package/skills/gemini/ritual/references/resume-flow.md +2 -0
- package/skills/kiro/ritual/.ritual-bundle.json +4 -0
- package/skills/kiro/ritual/references/async-polling.md +43 -9
- package/skills/kiro/ritual/references/build-flow.md +764 -150
- package/skills/kiro/ritual/references/cli-output-contract.md +181 -8
- package/skills/kiro/ritual/references/context-pulse-flow.md +3 -3
- package/skills/kiro/ritual/references/discovery-classification.md +3 -3
- package/skills/kiro/ritual/references/resume-flow.md +2 -0
- package/skills/vscode/ritual/.ritual-bundle.json +4 -0
- package/skills/vscode/ritual/references/async-polling.md +43 -9
- package/skills/vscode/ritual/references/build-flow.md +764 -150
- package/skills/vscode/ritual/references/cli-output-contract.md +181 -8
- package/skills/vscode/ritual/references/context-pulse-flow.md +3 -3
- package/skills/vscode/ritual/references/discovery-classification.md +3 -3
- package/skills/vscode/ritual/references/resume-flow.md +2 -0
|
@@ -12,17 +12,23 @@ The Ritual data model uses product-research terminology. This skill translates t
|
|
|
12
12
|
|---|---|
|
|
13
13
|
| **scope** | `problemStatement` |
|
|
14
14
|
| **sub-problem** | `consideration` |
|
|
15
|
-
| **
|
|
15
|
+
| **Area** (NOT "matter") | `matter` |
|
|
16
16
|
| **discovery question** | `question` |
|
|
17
17
|
| **recommendation** | `recommendation` |
|
|
18
18
|
|
|
19
19
|
When the user says "tighten the scope," call `generate_problem_statement(...)` with their refinement. When you tell the user "I picked these sub-problems," you mean the items you put in `considerations[]`. The tools don't change; only the language to the user does.
|
|
20
20
|
|
|
21
|
+
**On "Area" vs "matter":** the API field is `matter` for historical reasons. The user-facing label is **Area** because it's plainer and reads less research-y in a developer flow. NEVER surface "matter" or "matter.name" in user-facing copy — use "Area" / "Area name" instead.
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
### Runtime contracts
|
|
23
25
|
|
|
24
26
|
Before running this flow, apply `references/cli-output-contract.md` and `references/async-polling.md`. Keep raw recon internal, pass the `codebase_context_packet` downstream, and show the user only the compact `recon_digest`.
|
|
25
27
|
|
|
28
|
+
**Build rail is load-bearing.** Every top-level user-facing message below MUST begin with the 6-stage build rail per `references/cli-output-contract.md` § Build progress anchor. Examples in this file show the rail in context; the canonical stage table + `progressHeader(stage)` spec lives in the output contract. Do not drop the rail to save space.
|
|
29
|
+
|
|
30
|
+
For narrow/mobile chat surfaces, use the **compact progress anchor** defined in `references/cli-output-contract.md` § Build progress anchor (the `Ritual build · 2/6 Scope` chip) instead of forcing the full six-stage rail to wrap. Same contract, different rendering.
|
|
31
|
+
|
|
26
32
|
### When to use
|
|
27
33
|
|
|
28
34
|
- The user describes a new feature, refactor, migration, or implementation-heavy change that needs planning before coding
|
|
@@ -96,7 +102,6 @@ Recommended: turn off auto-mode before continuing.
|
|
|
96
102
|
|
|
97
103
|
Regardless of which option the user picks, treat every subsequent `[USER PAUSE]` in this flow as a hard stop. Do not infer answers from context, do not pick a "reasonable default," do not press on without an actual user reply. The user picking option 2 means *they accept the trade-off* — it does NOT grant you permission to auto-answer the gates that come next.
|
|
98
104
|
|
|
99
|
-
#### Step 1
|
|
100
105
|
#### Step 1 — Pick a workspace
|
|
101
106
|
|
|
102
107
|
Resolution order:
|
|
@@ -392,7 +397,7 @@ Steps:
|
|
|
392
397
|
> **{candidate.name}** *(LLM confidence: {Math.round(candidate.llmConfidence * 100)}%)*
|
|
393
398
|
> - *"{candidate.problemStatement first 120 chars, no ellipsis padding}..."*
|
|
394
399
|
> - Why I think it overlaps: {candidate.llmRationale}
|
|
395
|
-
> - URL: `https://
|
|
400
|
+
> - URL: `https://app.ritualapp.cloud/e/{candidate.explorationId}`
|
|
396
401
|
> {endfor}
|
|
397
402
|
>
|
|
398
403
|
> **Choose:**
|
|
@@ -481,6 +486,17 @@ Proceed to Step 3 once a template is selected. No extra confirmation is required
|
|
|
481
486
|
|
|
482
487
|
Before generating considerations, gather codebase context so the sub-problems land specific to *this* code, not generic. The goal is not to show the user every fact you found; the goal is to ground downstream MCP calls and expose only decision-relevant findings in the CLI.
|
|
483
488
|
|
|
489
|
+
**Capability Boundary Check (load-bearing):** If recon detects a mismatch between the user's ask and what THIS repo can actually implement — typically because the feature spans systems (backend service, mobile app, billing provider, email worker, schema migrations) that aren't present in the current checkout — DO NOT invent the missing systems and DO NOT continue as if the repo is complete. Run the boundary-check pause described in § 3.2 below before proceeding to scope. Frame the missing half as a normal architecture boundary, not a failure: *"This repo looks like the frontend side of a larger feature,"* not *"I could not find backend dependencies."* The user has not done anything wrong; the agent is asking how to scope the work.
|
|
490
|
+
|
|
491
|
+
Common boundary mismatches to detect:
|
|
492
|
+
|
|
493
|
+
- Full-stack feature ask + frontend-only repo (UI present, no API/service code)
|
|
494
|
+
- Mobile feature ask + no API client contract or backend
|
|
495
|
+
- Billing/payments feature + no payment service / subscription code
|
|
496
|
+
- Email/notification feature + no worker / job / email-provider integration
|
|
497
|
+
- Auth/session feature + no user mutation / session backend
|
|
498
|
+
- Data/analytics feature + no schema, migration, or storage layer
|
|
499
|
+
|
|
484
500
|
##### 3.0 — Check for a pre-build context seed
|
|
485
501
|
|
|
486
502
|
Before doing fresh recon, check whether the user already seeded one via `/ritual context-pulse`. Glob for `CONTEXT-*.md` at the repo root.
|
|
@@ -584,12 +600,12 @@ If no seed file is found, OR the seed's `## The ask` doesn't match the current `
|
|
|
584
600
|
- No `guest_session_id` column was found in the inspected conversion models; scope may need to use the actual guest attribution identifiers.
|
|
585
601
|
```
|
|
586
602
|
|
|
587
|
-
Example `recon_digest
|
|
603
|
+
Example `recon_digest` — single-path case (low ambiguity):
|
|
588
604
|
|
|
589
605
|
```text
|
|
590
|
-
Code recon
|
|
606
|
+
Code recon
|
|
591
607
|
|
|
592
|
-
|
|
608
|
+
Repo signals:
|
|
593
609
|
- `apps/conversions/abstract_models.py` — append-only conversion events.
|
|
594
610
|
- `apps/conversions/outbox.py` — async publish/retry lifecycle.
|
|
595
611
|
- `apps/order/models.py` — raw guest email surface.
|
|
@@ -600,16 +616,128 @@ If no seed file is found, OR the seed's `## The ask` doesn't match the current `
|
|
|
600
616
|
Scope correction:
|
|
601
617
|
- I did not find `guest_session_id` in the inspected models.
|
|
602
618
|
|
|
603
|
-
|
|
619
|
+
Pulse: Reasoning Readiness ~55% · Context Debt 45% (initial ask + code recon)
|
|
620
|
+
|
|
621
|
+
Next: attach PRDs/tickets if they should shape scope, or `proceed` to continue.
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
Example `recon_digest` — ambiguity case (multiple plausible interpretations):
|
|
625
|
+
|
|
626
|
+
When recon surfaces two materially different product/implementation paths for the same ask, name them both, **mark one as recommended with a one-line reason**, and pause with a concrete reply syntax. Do not expose raw tier labels (use the translations from `references/cli-output-contract.md`).
|
|
627
|
+
|
|
628
|
+
```text
|
|
629
|
+
Code recon
|
|
630
|
+
|
|
631
|
+
Repo signals:
|
|
632
|
+
- `GatewayForm` already supports "create account before checkout," but
|
|
633
|
+
redirects away from checkout to `customer:register`. There is no inline
|
|
634
|
+
or post-order account path today.
|
|
635
|
+
- Guest checkout is already wired through order placement:
|
|
636
|
+
`CheckoutSessionData.set_guest_email()`, `AbstractOrder.guest_email`, and
|
|
637
|
+
`build_submission()` preserve guest identity.
|
|
638
|
+
- `RegisterUserMixin` is the reusable account-creation surface:
|
|
639
|
+
user creation, `user_registered`, login, and registration email.
|
|
640
|
+
- `OrderPlacementMixin` and `post_checkout` are the clean hooks for
|
|
641
|
+
creating or claiming an account at order placement.
|
|
642
|
+
|
|
643
|
+
Constraint:
|
|
644
|
+
- Oscar's dynamic class loading via `get_class()` is the extension
|
|
645
|
+
pattern here. Implement with subclass-overridable views/mixins, not
|
|
646
|
+
monkey-patches.
|
|
647
|
+
|
|
648
|
+
Ambiguity to resolve:
|
|
649
|
+
"Join while booking" maps to two plausible features.
|
|
650
|
+
|
|
651
|
+
1. Inline registration at checkout
|
|
652
|
+
Let new customers register on the checkout page itself instead of
|
|
653
|
+
being redirected to `/accounts/register/`.
|
|
654
|
+
|
|
655
|
+
2. Post-order account creation — recommended
|
|
656
|
+
Let guests place the order as today, then claim the order by
|
|
657
|
+
setting a password on the thank-you page. Preserves guest checkout
|
|
658
|
+
and fits Oscar's `OrderPlacementMixin` / `post_checkout` hooks.
|
|
659
|
+
|
|
660
|
+
Pulse: Reasoning Readiness ~35% · Context Debt 65% (scope not locked yet)
|
|
661
|
+
|
|
662
|
+
Next: reply `2` for the recommended post-order path, `1` for inline
|
|
663
|
+
registration, or describe a different intent. Reply `pause` to stop here.
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
Notes on the ambiguity-case shape:
|
|
667
|
+
- **"Repo signals"** (not "Found" or "Key surfaces") signals these are the evidence behind the recommendation.
|
|
668
|
+
- **Recommendation goes after the option name on the SAME line**, with a single concise reason on the line below. This keeps the options scannable in a decision moment.
|
|
669
|
+
- **`Next:` is a single line** ending in a concrete reply syntax (`reply N`), not an open-ended question. Lead with the recommended default; the escape hatch comes last.
|
|
670
|
+
- **The pulse line uses the user-facing label**, never the raw tier identifier.
|
|
671
|
+
|
|
672
|
+
Example `recon_digest` — Capability Boundary Check (feature spans systems not in this repo):
|
|
673
|
+
|
|
674
|
+
When the user's ask requires capabilities that aren't present in this repo (frontend-only repo asked for full-stack feature, mobile repo with no API contract, etc.), surface the boundary as a normal architecture fact and give the user three concrete scoping options. NEVER continue as if the repo can implement the missing half; NEVER invent the missing systems.
|
|
675
|
+
|
|
676
|
+
```text
|
|
677
|
+
Code recon
|
|
678
|
+
|
|
679
|
+
Action needed
|
|
680
|
+
|
|
681
|
+
This feature likely spans another repo or service.
|
|
682
|
+
Add the backend/API context, or choose a narrower scope.
|
|
683
|
+
|
|
684
|
+
Repo boundary:
|
|
685
|
+
- This repo contains the checkout UI and guest checkout flow.
|
|
686
|
+
- I found no backend account-creation endpoint, user/order linking
|
|
687
|
+
mutation, email job, or migration layer.
|
|
688
|
+
- So the full "join while booking" feature likely spans this repo plus
|
|
689
|
+
an API/backend service.
|
|
690
|
+
|
|
691
|
+
Can build here:
|
|
692
|
+
- Checkout/thank-you page UI
|
|
693
|
+
- Password capture or account-claim form
|
|
694
|
+
- API client integration point
|
|
695
|
+
- Mocked frontend tests
|
|
696
|
+
- Empty/error/success states
|
|
697
|
+
|
|
698
|
+
Needs outside context:
|
|
699
|
+
- Endpoint that creates or claims the account
|
|
700
|
+
- Contract for linking a guest order to a user
|
|
701
|
+
- Auth/session behavior after claim
|
|
702
|
+
- Email/verification behavior, if required
|
|
703
|
+
|
|
704
|
+
How should I scope this?
|
|
705
|
+
|
|
706
|
+
1. Frontend-only
|
|
707
|
+
Build the UI against an existing API. I'll ask for the endpoint/
|
|
708
|
+
contract next.
|
|
709
|
+
|
|
710
|
+
2. Contract-first — recommended if the API is not settled
|
|
711
|
+
Define the API contract and frontend integration here, then produce
|
|
712
|
+
a backend build brief for the missing service work.
|
|
713
|
+
|
|
714
|
+
3. Add backend repo/context
|
|
715
|
+
Pause here while you point me at the backend repo or docs, then I'll
|
|
716
|
+
recon the full path.
|
|
717
|
+
|
|
718
|
+
Pulse: Reasoning Readiness ~30% · Context Debt 70% (repo boundary unresolved)
|
|
719
|
+
|
|
720
|
+
Next: reply `2` for contract-first, `1` for frontend-only, or `3` to add
|
|
721
|
+
backend context. If you already know the API, paste the endpoint or
|
|
722
|
+
contract and I'll continue.
|
|
604
723
|
```
|
|
605
724
|
|
|
725
|
+
Notes on the boundary-check shape:
|
|
726
|
+
- **Lead with an "Action needed" callout block** that names the boundary in one sentence + the user's choice in one sentence. This is a load-bearing decision gate — leading with the callout (rather than the data) makes the gate pop in scrollback. Use this callout style only for boundary checks and other high-importance gates; ordinary recon stays in the standard `recon_digest` shape.
|
|
727
|
+
- **"Repo boundary:" not "I couldn't find…"** — frame the missing half as an architecture fact, not as a failure or as something the user did wrong. The agent is asking how to scope, not reporting an error.
|
|
728
|
+
- **"Can build here:" + "Needs outside context:"** are paired sections — they tell the user the explicit IN/OUT split for THIS repo so they can make an informed scoping decision. Don't merge them into one bullet list.
|
|
729
|
+
- **Three scoping options, recommendation on option 2 by default** — frontend-only / contract-first / add-context covers the realistic decision space. Mark "Contract-first" as recommended when the API surface is not yet defined; mark "Frontend-only" recommended when the user signaled they already have a stable API.
|
|
730
|
+
- **The pulse line stays parenthetical** with a user-facing reason (`repo boundary unresolved`), per the Pulse tier labels rule in `references/cli-output-contract.md`.
|
|
731
|
+
- **Internal classification (not user-facing):** track each candidate piece against the boundary as `in_repo_buildable`, `external_dependency_known`, `external_dependency_unknown`, `needs_additional_repo`, or `contract_first_candidate`. These shape how downstream scoring + build-brief generation handle the missing half once the user picks an option. None of these labels should appear in user-facing copy.
|
|
732
|
+
|
|
606
733
|
##### 3.2 — Surface the digest and continue
|
|
607
734
|
|
|
608
735
|
Surface only `recon_digest` by default. Do **not** dump `raw_recon_notes` or the full `codebase_context_packet` to the CLI unless the user asks for detail.
|
|
609
736
|
|
|
610
737
|
Pause only if:
|
|
611
738
|
- recon contradicts the user's stated scope,
|
|
612
|
-
- there are multiple plausible implementation areas and choosing wrong would waste work,
|
|
739
|
+
- there are multiple plausible implementation areas and choosing wrong would waste work (use the ambiguity-case `recon_digest` shape above),
|
|
740
|
+
- **recon shows the feature spans systems not in this repo** (use the Capability Boundary Check `recon_digest` shape above — frontend-only repo, missing API/service, etc.),
|
|
613
741
|
- a legal/product/business constraint is required before generation,
|
|
614
742
|
- the user explicitly asked to review recon before continuing.
|
|
615
743
|
|
|
@@ -646,21 +774,22 @@ Knowledge sources are a feature multiplier, not a mandatory gate. Ask for PRDs/t
|
|
|
646
774
|
- the feature has legal, privacy, billing, permissions, enterprise, analytics, migration, or compliance constraints,
|
|
647
775
|
- code recon found implementation surfaces but not product intent.
|
|
648
776
|
|
|
649
|
-
When triggered, frame references as an optional booster, not a mandatory phase. The happy path is to continue.
|
|
777
|
+
When triggered, frame references as an optional booster, not a mandatory phase. The happy path is to continue. Keep the prompt tight — the user's decision here is simply "attach context or continue":
|
|
650
778
|
|
|
651
779
|
```text
|
|
652
780
|
Optional: add non-code context before scope generation.
|
|
653
781
|
|
|
654
|
-
Because this touches {
|
|
655
|
-
|
|
656
|
-
Next: we'll generate a list of suggested problems to pick from.
|
|
782
|
+
Because this touches {constraint}, PRDs, tickets, designs, incidents, or
|
|
783
|
+
customer requests may change what we prioritize.
|
|
657
784
|
|
|
658
|
-
|
|
785
|
+
Reply `go` to continue with code context only.
|
|
659
786
|
Or paste files/text/URLs to attach context first.
|
|
660
|
-
|
|
787
|
+
Reply `pause` to stop here.
|
|
661
788
|
```
|
|
662
789
|
|
|
663
|
-
Accept
|
|
790
|
+
Accept (alias) `go`, `g`, `generate`, `continue`, `skip`, `next`, or `none` as proceed. Per `references/cli-output-contract.md` § Surface-aware continuation prompts, do NOT treat empty input as proceed inside agent chat — chat surfaces can't reliably observe an empty message. Wait only if the user provides refs, asks a question, or types `pause` / `stop`.
|
|
791
|
+
|
|
792
|
+
Process language like *"Next: we'll generate a list of suggested problems to pick from"* used to live here — removed because the decision at this moment is "attach context or continue," not a preview of what comes next. The follow-up step's framing belongs in the follow-up step, not stacked on this prompt.
|
|
664
793
|
|
|
665
794
|
If none of the triggers apply, do **not** block. Print a non-blocking line and proceed:
|
|
666
795
|
|
|
@@ -797,6 +926,8 @@ Reply with:
|
|
|
797
926
|
|
|
798
927
|
Only the title line gets the number. Put a blank line between candidates. Do not show version labels like `(v1)` in CLI output.
|
|
799
928
|
|
|
929
|
+
**Why `all` is allowed here but NOT in discovery question picking:** sub-problem selection is a SCOPE-LOCKING decision — picking `all` means "the full surfaced scope is what we're solving for," which is a legitimate, declarative choice (often the right one when the agent has surfaced a tight 3-5 sub-problem set). Discovery question picking is INVESTIGATION TRIAGE — picking `all` there is a low-signal "I haven't discriminated yet" answer that pollutes the answer set and weakens readiness scoring. The removal of `all` in Step 7.3 is discovery-specific; don't propagate it backwards to Step 4.
|
|
930
|
+
|
|
800
931
|
##### 4.2 Iteration loop
|
|
801
932
|
|
|
802
933
|
If the user asks for a refinement (anything that isn't "all" / specific picks / "these are good"):
|
|
@@ -852,10 +983,10 @@ Optimize for:
|
|
|
852
983
|
|
|
853
984
|
References:
|
|
854
985
|
- {RB/decision/exploration label} — {one-line meaning}
|
|
855
|
-
Source: {exploration title or id}{ optional ': https://
|
|
986
|
+
Source: {exploration title or id}{ optional ': https://app.ritualapp.cloud/e/{exploration_id}' if available}
|
|
856
987
|
- {reference}
|
|
857
988
|
|
|
858
|
-
|
|
989
|
+
Reply `use` to use this frame and review discovery questions.
|
|
859
990
|
Or reply with edits, e.g. `tighten`, `broaden`, `focus on outbox`, `drop dashboard`, or `pause`.
|
|
860
991
|
```
|
|
861
992
|
|
|
@@ -863,7 +994,8 @@ Rules:
|
|
|
863
994
|
- Do not show the old versioned scope heading.
|
|
864
995
|
- Do not show `Engineering problem:` as the heading; use `Problem frame`.
|
|
865
996
|
- Do not say `ship it` unless the user used that language first.
|
|
866
|
-
-
|
|
997
|
+
- Visible CTA is `use`. Accept `lock`, `l`, `go`, `continue`, or `next` as aliases for backwards-compat — do NOT display them. Per `references/cli-output-contract.md` § Surface-aware continuation prompts, do NOT treat empty input as proceed inside agent chat.
|
|
998
|
+
- `lock` is demoted to alias only: "lock" sounded final/irrevocable for a frame that's very much iterable; `use` carries the right tone.
|
|
867
999
|
|
|
868
1000
|
##### 5.2 Iteration loop
|
|
869
1001
|
|
|
@@ -882,13 +1014,13 @@ The returned text becomes the new current draft. Show it using the same `Problem
|
|
|
882
1014
|
|
|
883
1015
|
When the user locks the frame, store the final text as `problem_statement` for Step 6.
|
|
884
1016
|
|
|
885
|
-
**Pulse (Step 5 done):** Emit a pulse — feature clarity just jumped. Compute per `/ritual context-pulse` § Step CP3. Render full if this crosses Raw ask → Under-specified, else compact.
|
|
1017
|
+
**Pulse (Step 5 done):** Emit a pulse — feature clarity just jumped. Compute per `/ritual context-pulse` § Step CP3. Render full if this crosses Raw ask → Under-specified, else compact. Translate raw tier labels into user-facing copy per `references/cli-output-contract.md` § Pulse tier labels — never expose `RAW_ASK` / `UNDER_SPECIFIED` / etc. directly.
|
|
886
1018
|
|
|
887
1019
|
#### Step 6 — Create the exploration
|
|
888
1020
|
|
|
889
1021
|
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)`.
|
|
890
1022
|
|
|
891
|
-
Do not add another confirmation if the user just
|
|
1023
|
+
Do not add another confirmation if the user just accepted the problem frame. Create the exploration immediately after the user replies `use`/`proceed`. 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).
|
|
892
1024
|
|
|
893
1025
|
User-visible before the call, if needed:
|
|
894
1026
|
|
|
@@ -908,7 +1040,7 @@ Store `exploration_id`. Move the progress header from Scope to Discovery:
|
|
|
908
1040
|
Ritual build
|
|
909
1041
|
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
910
1042
|
|
|
911
|
-
Exploration created. Track progress at https://
|
|
1043
|
+
Exploration created. Track progress at https://app.ritualapp.cloud/e/{exploration_id}
|
|
912
1044
|
|
|
913
1045
|
Next: generate discovery questions to resolve the implementation trade-offs.
|
|
914
1046
|
```
|
|
@@ -959,13 +1091,18 @@ Then summarize the created siblings in the dense-list format. Do not pause after
|
|
|
959
1091
|
|
|
960
1092
|
#### Step 7 — Discovery questions
|
|
961
1093
|
|
|
962
|
-
Longest phase because generation is async + the user picks per-
|
|
1094
|
+
Longest phase because generation is async + the user picks per-Area. (Internally the API field is `matter_id`; user-facing copy always says Area.)
|
|
963
1095
|
|
|
964
1096
|
##### 7.1 — Kick off
|
|
965
1097
|
|
|
966
|
-
Call `mcp__ritual__suggest_discovery_questions(exploration_id)`. Returns immediately with `task_id`. Tell the user:
|
|
1098
|
+
Call `mcp__ritual__suggest_discovery_questions(exploration_id)`. Returns immediately with `task_id`. Tell the user with the full rail (we just entered the Discovery phase):
|
|
967
1099
|
|
|
968
|
-
|
|
1100
|
+
```text
|
|
1101
|
+
Ritual build
|
|
1102
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1103
|
+
|
|
1104
|
+
Generating discovery questions for each area…
|
|
1105
|
+
```
|
|
969
1106
|
|
|
970
1107
|
##### 7.2 — Poll until ready
|
|
971
1108
|
|
|
@@ -974,66 +1111,185 @@ Loop:
|
|
|
974
1111
|
- If `ready: false`, wait 5 seconds, poll again
|
|
975
1112
|
- If `ready: true`, exit loop
|
|
976
1113
|
|
|
977
|
-
Don't poll faster than every 5 seconds. Follow the global polling rule above: single `Bash sleep 5` per iteration and a one-line update every ~3 polls (~15s).
|
|
1114
|
+
Don't poll faster than every 5 seconds. Follow the global polling rule above: single `Bash sleep 5` per iteration and a one-line update every ~3 polls (~15s). Polling heartbeats are exempt from the Build rail rule per `references/cli-output-contract.md` § Build progress anchor — does NOT apply to.
|
|
1115
|
+
|
|
1116
|
+
##### 7.3 — Area-first picker (Areas index → drill into an Area → return to index)
|
|
1117
|
+
|
|
1118
|
+
The state contains `matters[]`, each with `id`, `name`, and `questions[]`. Internally these are `matter`s; user-facing copy ALWAYS calls them **Areas**.
|
|
1119
|
+
|
|
1120
|
+
DO NOT lead with a curated cross-area question list. It reads as the agent having pre-selected the answer and asking the user to rubber-stamp; the user's job at this moment is scanning the space and picking where to spend investigation. Use a two-level picker: Areas index first, then per-Area question detail, then back to the index with status markers.
|
|
978
1121
|
|
|
979
|
-
|
|
1122
|
+
###### 7.3.0 — Compute per-Area recommendations + the global shortlist (internal, not user-facing)
|
|
980
1123
|
|
|
981
|
-
|
|
1124
|
+
Two computations happen before the index renders. Both stay internal — they show up as counts on the index, not as auto-applied picks.
|
|
1125
|
+
|
|
1126
|
+
**Per-Area recommended counts** (what to suggest when the user drills into an Area):
|
|
1127
|
+
|
|
1128
|
+
- 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.
|
|
1129
|
+
- Area has **< 4 questions**: all are recommended.
|
|
1130
|
+
- Area has **4–7 questions**: top 3 are recommended.
|
|
1131
|
+
- Area has **8+ questions**: top 4 are recommended.
|
|
1132
|
+
|
|
1133
|
+
**Global shortlist** (what `accept shortlist` accepts when used from the index):
|
|
1134
|
+
|
|
1135
|
+
- Pick **6–10 questions TOTAL across all Areas**, biased toward questions most likely to change recommendations.
|
|
1136
|
+
- 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).
|
|
1137
|
+
- Cap at 10 even when the per-Area recommended sets sum to more. The point of the shortlist is to give the user a clean "the highest-signal triage set across the whole space" — picking 24–32 questions because 8 Areas each have 3–4 recommended brings back the "no triage signal" problem under a new name.
|
|
1138
|
+
- If the per-Area recommended sets sum to ≤10, the shortlist IS just the union (no further trimming).
|
|
1139
|
+
|
|
1140
|
+
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.
|
|
1141
|
+
|
|
1142
|
+
###### 7.3.1 — Areas index (landing)
|
|
1143
|
+
|
|
1144
|
+
Full rail + intro + numbered Areas list with `{recommended} recommended · {total} total` per Area. NO question text on this screen — just the surface map. This is the first message of the picker; the rail has already been emitted, so subsequent area-detail messages use the in-phase chip.
|
|
982
1145
|
|
|
983
1146
|
```text
|
|
984
|
-
|
|
1147
|
+
Ritual build
|
|
1148
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1149
|
+
|
|
1150
|
+
Question picking
|
|
1151
|
+
|
|
1152
|
+
Ritual generated questions across {N} areas for the {M} locked sub-problems:
|
|
1153
|
+
{first sub-problem name} + {second sub-problem name}.
|
|
1154
|
+
|
|
1155
|
+
Pick an Area to review. I'll show the 3–4 questions most likely to change
|
|
1156
|
+
the implementation plan.
|
|
985
1157
|
|
|
986
|
-
|
|
987
|
-
|
|
1158
|
+
Areas:
|
|
1159
|
+
|
|
1160
|
+
1. {Area name 1} {N} recommended · {N} total
|
|
1161
|
+
2. {Area name 2} {N} recommended · {N} total
|
|
1162
|
+
3. {Area name 3} {N} recommended · {N} total
|
|
988
1163
|
...
|
|
989
1164
|
|
|
990
|
-
|
|
1165
|
+
Reply with an Area number, `accept shortlist`, or `skip discovery`.
|
|
1166
|
+
Inside an Area, use `show more` to see the rest.
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
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).
|
|
1170
|
+
|
|
1171
|
+
**Why `accept shortlist`, not `accept recommended`:**
|
|
991
1172
|
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1173
|
+
- "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.
|
|
1174
|
+
- This creates a clean vocabulary split: **discovery = `accept shortlist`** (questions), **recommendations = `accept recommended`** (themes).
|
|
1175
|
+
|
|
1176
|
+
**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.
|
|
1177
|
+
|
|
1178
|
+
###### 7.3.2 — Area detail (one Area's questions)
|
|
1179
|
+
|
|
1180
|
+
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).
|
|
1181
|
+
|
|
1182
|
+
```text
|
|
1183
|
+
Question picking · {Area name}
|
|
1184
|
+
|
|
1185
|
+
Showing {N} recommended questions out of {total}.
|
|
1186
|
+
|
|
1187
|
+
1. {question 1, wrapped readably}
|
|
1188
|
+
|
|
1189
|
+
2. {question 2, wrapped readably}
|
|
1190
|
+
|
|
1191
|
+
3. {question 3, wrapped readably}
|
|
1192
|
+
|
|
1193
|
+
Reply with numbers like `1,2` to pick, `show more` to see all {total},
|
|
1194
|
+
or `skip` to leave this Area without picks.
|
|
995
1195
|
```
|
|
996
1196
|
|
|
997
|
-
|
|
1197
|
+
`show more` reveals the rest of the questions, formatted in two groups (Recommended / More):
|
|
1198
|
+
|
|
1199
|
+
```text
|
|
1200
|
+
Question picking · {Area name}
|
|
1201
|
+
|
|
1202
|
+
Recommended:
|
|
1203
|
+
|
|
1204
|
+
1. {recommended question 1}
|
|
1205
|
+
2. {recommended question 2}
|
|
1206
|
+
3. {recommended question 3}
|
|
998
1207
|
|
|
999
|
-
|
|
1208
|
+
More questions:
|
|
1209
|
+
|
|
1210
|
+
4. {non-recommended question 1}
|
|
1211
|
+
5. {non-recommended question 2}
|
|
1212
|
+
6. {non-recommended question 3}
|
|
1213
|
+
7. {non-recommended question 4}
|
|
1214
|
+
...
|
|
1000
1215
|
|
|
1001
|
-
|
|
1216
|
+
Reply with numbers like `1,2,5`, or `skip`.
|
|
1217
|
+
```
|
|
1002
1218
|
|
|
1003
|
-
|
|
1004
|
-
- If the matter has **fewer than 4 questions**, pick all of them.
|
|
1005
|
-
- If the matter has **4 to 7 questions**, pick 3.
|
|
1006
|
-
- If the matter has **8+ questions**, pick 4.
|
|
1219
|
+
###### 7.3.3 — Return to Areas index with status markers
|
|
1007
1220
|
|
|
1008
|
-
After
|
|
1221
|
+
After the user picks for an Area (or skips), return to the Areas index with status markers reflecting what's been resolved. Use `✓` for picked, `–` for skipped, `□` for not-yet-touched. NEVER use strikethrough — it renders inconsistently across terminals.
|
|
1009
1222
|
|
|
1010
1223
|
```text
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1224
|
+
Question picking
|
|
1225
|
+
|
|
1226
|
+
Areas:
|
|
1227
|
+
|
|
1228
|
+
✓ 1. {Area name 1} {N} picked
|
|
1229
|
+
□ 2. {Area name 2} {N} recommended · {N} total
|
|
1230
|
+
□ 3. {Area name 3} {N} recommended · {N} total
|
|
1231
|
+
– 4. {Area name 4} skipped
|
|
1232
|
+
...
|
|
1015
1233
|
|
|
1016
|
-
Reply
|
|
1234
|
+
Reply with another Area number, or `done` to investigate the {total picked}
|
|
1235
|
+
picked questions. Reply `pause` to stop here.
|
|
1236
|
+
```
|
|
1237
|
+
|
|
1238
|
+
When EVERY Area has been resolved (picked or skipped), shift the CTA from "another Area number" to:
|
|
1239
|
+
|
|
1240
|
+
```text
|
|
1241
|
+
All Areas reviewed. Reply `done` to investigate the {total picked}
|
|
1242
|
+
picked questions. Reply `pause` to stop here.
|
|
1017
1243
|
```
|
|
1018
1244
|
|
|
1019
|
-
|
|
1245
|
+
###### 7.3.4 — Power paths from the index
|
|
1020
1246
|
|
|
1021
|
-
|
|
1247
|
+
- **`accept shortlist`** (from the index, before picking any Area): accept the 6–10-question global shortlist computed in § 7.3.0. Group those by their owning Area, then call `accept_discovery_questions` once per Area (in parallel per § 7.4) with the shortlisted IDs for that Area. Skip straight to Step 7.4 commit + Step 7.4.5 classification. This is intentionally NOT "top 3–4 of every Area" — that would scale to 24–32 picks on a wide exploration and reintroduce the "no triage signal" problem the area-first picker exists to fix.
|
|
1248
|
+
- `show all` (from the index): accepted as a reply but NOT advertised on the CTA line. Expands into a single long list view across all Areas. Use only when the user explicitly asks — the area-first index is the default.
|
|
1249
|
+
- `skip discovery` (from the index, before any picks): treat ALL Areas as skipped. The classification check in Step 7.4.5 will surface this as a deliberate choice.
|
|
1022
1250
|
|
|
1023
|
-
|
|
1251
|
+
###### 7.3.5 — What NOT to say
|
|
1252
|
+
|
|
1253
|
+
- 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.
|
|
1254
|
+
- DO NOT use `Press Enter` anywhere in this picker (see § Surface-aware continuation prompts).
|
|
1255
|
+
- DO NOT say `lock` for the picking confirmation; use `done` from the index.
|
|
1256
|
+
- DO NOT show full question text in the index — only Area names + counts.
|
|
1257
|
+
|
|
1258
|
+
###### Legacy alias notes
|
|
1259
|
+
|
|
1260
|
+
- `suggest` (legacy per-Area shortcut) is now the implicit per-Area recommendation — the index already shows recommended counts and `accept shortlist` is the global power path. If a user still types `suggest` inside an Area, treat it as "pick the recommended set for this Area."
|
|
1261
|
+
- `accept recommended` (legacy global shortcut): if a user types this, treat it as `accept shortlist`. Surface a one-line note that the discovery-stage token is `accept shortlist` (questions); `accept recommended` is reserved for Step 9's theme acceptance.
|
|
1262
|
+
- `all` (legacy fourth option) remains removed (see § Removed below).
|
|
1024
1263
|
|
|
1025
1264
|
###### Removed: `all` (the old fourth option)
|
|
1026
1265
|
|
|
1027
1266
|
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.
|
|
1028
1267
|
|
|
1029
|
-
##### 7.4 — Commit picks per
|
|
1268
|
+
##### 7.4 — Commit picks (one call per Area, dispatched in parallel)
|
|
1030
1269
|
|
|
1031
|
-
For each
|
|
1270
|
+
For each Area where the user picked at least one question, call `mcp__ritual__accept_discovery_questions` with:
|
|
1032
1271
|
- `state_id` (from the discovery state)
|
|
1033
|
-
- `matter_id`
|
|
1034
|
-
- `question_ids[]` (the picks for THIS
|
|
1272
|
+
- `matter_id` (the API field; user-facing this is the Area)
|
|
1273
|
+
- `question_ids[]` (the picks for THIS Area)
|
|
1274
|
+
|
|
1275
|
+
The API enforces per-matter atomicity — there is no cross-matter batch endpoint today (filed as backlog: `accept_discovery_questions_batch`). To minimize wall-clock latency when the user picked across many Areas, **dispatch the per-Area calls in parallel** with `Promise.all` rather than awaiting each one sequentially:
|
|
1276
|
+
|
|
1277
|
+
```ts
|
|
1278
|
+
// Parallel, NOT sequential.
|
|
1279
|
+
await Promise.all(
|
|
1280
|
+
pickedAreas.map((area) =>
|
|
1281
|
+
accept_discovery_questions(state_id, area.matter_id, area.question_ids),
|
|
1282
|
+
),
|
|
1283
|
+
);
|
|
1284
|
+
```
|
|
1285
|
+
|
|
1286
|
+
User-facing: emit ONE status line for the whole commit, not one per Area:
|
|
1287
|
+
|
|
1288
|
+
```text
|
|
1289
|
+
Saving picks across {N} Areas…
|
|
1290
|
+
```
|
|
1035
1291
|
|
|
1036
|
-
|
|
1292
|
+
If any individual call fails, log the Area name + error inline and continue with the rest — partial success is acceptable here. The next step's classification check will surface anything that didn't land.
|
|
1037
1293
|
|
|
1038
1294
|
##### 7.4.5 — Classify unpicked areas when the signal warrants it
|
|
1039
1295
|
|
|
@@ -1046,15 +1302,24 @@ After question picking, check for scope mismatch only when one of these triggers
|
|
|
1046
1302
|
|
|
1047
1303
|
If no trigger fires, proceed silently to anti-goals.
|
|
1048
1304
|
|
|
1049
|
-
If a trigger fires, summarize the pattern in plain language and ask the user to classify unpicked areas:
|
|
1305
|
+
If a trigger fires, summarize the pattern in plain language and ask the user to classify unpicked areas. This is a top-level decision gate that closes the picker sub-views, so the full rail returns:
|
|
1050
1306
|
|
|
1051
1307
|
```text
|
|
1308
|
+
Ritual build
|
|
1309
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1310
|
+
|
|
1311
|
+
Scope check
|
|
1312
|
+
|
|
1313
|
+
{One-line summary of which pattern fired — e.g. "You picked 4 of 32 questions, mostly in retention."}
|
|
1314
|
+
|
|
1052
1315
|
How should I treat the unpicked areas?
|
|
1053
1316
|
|
|
1054
|
-
1. Out of scope — tighten the current scope around what you picked.
|
|
1055
|
-
2. Later phase — keep the broad scope, but mark unpicked areas as phase-later candidates.
|
|
1056
|
-
3. Open questions — keep the broad scope and treat unpicked areas as context debt.
|
|
1057
|
-
4. Pick more — return to question picking before continuing.
|
|
1317
|
+
1. Out of scope — tighten the current scope around what you picked.
|
|
1318
|
+
2. Later phase — keep the broad scope, but mark unpicked areas as phase-later candidates.
|
|
1319
|
+
3. Open questions — keep the broad scope and treat unpicked areas as context debt.
|
|
1320
|
+
4. Pick more — return to question picking before continuing.
|
|
1321
|
+
|
|
1322
|
+
Reply with `1`, `2`, `3`, or `4`. Reply `pause` to stop here.
|
|
1058
1323
|
```
|
|
1059
1324
|
|
|
1060
1325
|
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.
|
|
@@ -1089,13 +1354,19 @@ The agentic pipeline runs sourcing → answers → recommendations. For engineer
|
|
|
1089
1354
|
For `engineering`, `delivery`, and `operations` roles, show:
|
|
1090
1355
|
|
|
1091
1356
|
```text
|
|
1092
|
-
|
|
1357
|
+
Ritual build
|
|
1358
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1093
1359
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1360
|
+
Run discovery
|
|
1361
|
+
|
|
1362
|
+
Ritual will source answers for the picked questions, then generate
|
|
1363
|
+
recommendations. This usually takes a few minutes.
|
|
1364
|
+
|
|
1365
|
+
Reply `run` to continue.
|
|
1366
|
+
Reply `pause` to stop here.
|
|
1096
1367
|
```
|
|
1097
1368
|
|
|
1098
|
-
|
|
1369
|
+
Visible CTA is `run`. Accept `r`, `go`, `continue`, or `next` as aliases. Per `references/cli-output-contract.md` § Surface-aware continuation prompts, do NOT treat empty input as proceed inside agent chat.
|
|
1099
1370
|
|
|
1100
1371
|
Call `mcp__ritual__start_agentic_run` with:
|
|
1101
1372
|
- `scope_type: 'exploration'`
|
|
@@ -1104,17 +1375,23 @@ Call `mcp__ritual__start_agentic_run` with:
|
|
|
1104
1375
|
For `product`, `design`, or explicitly PRD-style flows, answer review may be useful. Offer two choices without time estimates:
|
|
1105
1376
|
|
|
1106
1377
|
```text
|
|
1107
|
-
|
|
1378
|
+
Ritual build
|
|
1379
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1108
1380
|
|
|
1109
|
-
|
|
1110
|
-
2. Run through recommendations — fastest path to a recommendation set.
|
|
1381
|
+
Run discovery
|
|
1111
1382
|
|
|
1112
|
-
|
|
1383
|
+
How do you want to run discovery?
|
|
1384
|
+
|
|
1385
|
+
1. Stop after answers — review and refine the generated answers
|
|
1386
|
+
before recommendations.
|
|
1387
|
+
2. Run through recommendations — fastest path to a recommendation set.
|
|
1388
|
+
|
|
1389
|
+
Reply `1` or `2`. Reply `pause` to stop here.
|
|
1113
1390
|
```
|
|
1114
1391
|
|
|
1115
1392
|
If they pick 1, call `start_agentic_run` with `stop_after: 'answers'` and continue to Step 8.5 when it pauses. If they pick 2, call without `stop_after` and continue to Step 9 when complete.
|
|
1116
1393
|
|
|
1117
|
-
Poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`:
|
|
1394
|
+
Poll `mcp__ritual__get_agentic_run(run_id)` using `references/async-polling.md`: **`Bash sleep 5` (always 5 — never escalate to 15/20/25)** per iteration, then a fresh status call. Even if the run takes 2+ minutes, the sleep value stays 5; the harness blocks chained-shorter-sleeps-at-increasing-N just like it blocks `sleep ≥ 30`. 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. Print progress only when `progress_pct` or `current_step` changes, or every ~3 polls if unchanged:
|
|
1118
1395
|
|
|
1119
1396
|
> Agentic run: {progress_pct}% — {current_step}
|
|
1120
1397
|
|
|
@@ -1125,11 +1402,58 @@ When `status` is `PAUSED_FOR_REVIEW` (product/design answer-review mode only): c
|
|
|
1125
1402
|
|
|
1126
1403
|
If user wants to abort mid-flight: `mcp__ritual__cancel_agentic_run(run_id)`.
|
|
1127
1404
|
|
|
1128
|
-
#### Step 8.5 —
|
|
1405
|
+
#### Step 8.5 — Run Agentic Exploration (product/design answer-review mode only)
|
|
1406
|
+
|
|
1407
|
+
When the pipeline pauses at `PAUSED_FOR_REVIEW`, the exploration is at step `REVIEWING_ANSWERS`. Every Area's questions have v1 answers + at least one clarifying question per consideration, but nothing has been committed for recommendation generation yet.
|
|
1408
|
+
|
|
1409
|
+
**The agent walks the user through each question one at a time as part of the running agentic exploration.** Render the full rail at the **landing** (the first answer-review message), then use the in-phase chip on subsequent per-question views.
|
|
1410
|
+
|
|
1411
|
+
**On naming:** this step is **Run Agentic Exploration** in user-facing copy and section headings — NOT "Per-answer iteration" (the old internal label). The phase the user is in is "the agentic exploration is running and pausing for your input on each answer before recommendations generate." That's what the heading should say.
|
|
1412
|
+
|
|
1413
|
+
Landing (first question, full rail + intro):
|
|
1414
|
+
|
|
1415
|
+
```text
|
|
1416
|
+
Ritual build
|
|
1417
|
+
✓ Context ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1418
|
+
|
|
1419
|
+
Run Agentic Exploration
|
|
1420
|
+
|
|
1421
|
+
Ritual drafted answers for {totalQuestions} questions across {N} Areas.
|
|
1422
|
+
For each question, you can submit the v1 answer or iterate with a
|
|
1423
|
+
follow-up. When all questions are submitted, Ritual generates
|
|
1424
|
+
recommendations.
|
|
1425
|
+
|
|
1426
|
+
────────────────────────────────────────────────────────────────────
|
|
1427
|
+
|
|
1428
|
+
Discovery — question 1 of {total}: {Area name}
|
|
1429
|
+
|
|
1430
|
+
Q: {question.text}
|
|
1431
|
+
|
|
1432
|
+
v1 answer:
|
|
1433
|
+
{currentDraft, first 400 chars …}
|
|
1434
|
+
|
|
1435
|
+
My follow-up: {first consideration's latest assistant message}
|
|
1436
|
+
|
|
1437
|
+
Reply `submit` to lock in v1, or reply with text to iterate.
|
|
1438
|
+
Reply `pause` to stop here.
|
|
1439
|
+
```
|
|
1440
|
+
|
|
1441
|
+
Each subsequent per-question view uses the in-phase chip only (no full rail):
|
|
1442
|
+
|
|
1443
|
+
```text
|
|
1444
|
+
Discovery — question 2 of {total}: {Area name}
|
|
1445
|
+
|
|
1446
|
+
Q: {question.text}
|
|
1129
1447
|
|
|
1130
|
-
|
|
1448
|
+
v1 answer:
|
|
1449
|
+
{...}
|
|
1450
|
+
|
|
1451
|
+
My follow-up: {...}
|
|
1452
|
+
|
|
1453
|
+
Reply `submit` or reply with text to iterate.
|
|
1454
|
+
```
|
|
1131
1455
|
|
|
1132
|
-
|
|
1456
|
+
For each question's loop:
|
|
1133
1457
|
|
|
1134
1458
|
1. **Fetch the state.** Call `mcp__ritual__get_answer_state({ question_id })`. Returns:
|
|
1135
1459
|
- The question text
|
|
@@ -1137,20 +1461,10 @@ When the pipeline pauses at `PAUSED_FOR_REVIEW`, the exploration is at step `REV
|
|
|
1137
1461
|
- The considerations (sub-aspects) with their chat sessions
|
|
1138
1462
|
- The latest assistant message per consideration — this is the **first clarifying question** the answer engine already generated during Phase 3
|
|
1139
1463
|
|
|
1140
|
-
2. **Present
|
|
1464
|
+
2. **Present using the landing-or-chip shape above.** Two choices, that's it (no "skip"):
|
|
1141
1465
|
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
> **Q:** {question.text}
|
|
1145
|
-
>
|
|
1146
|
-
> **v1 answer:**
|
|
1147
|
-
> {currentDraft, first 400 chars …}
|
|
1148
|
-
>
|
|
1149
|
-
> **My follow-up:** {first consideration's latest assistant message}
|
|
1150
|
-
>
|
|
1151
|
-
> Two options:
|
|
1152
|
-
> 1. **submit** — you're happy with v1; lock it in and move to the next question
|
|
1153
|
-
> 2. **iterate** — answer my follow-up OR tell me what's wrong with v1 (free-text). I'll regenerate.
|
|
1466
|
+
- **submit** — happy with v1; lock it in and move to the next question
|
|
1467
|
+
- **iterate** (any free-text reply) — answers the follow-up OR explains what's wrong with v1; the answer engine regenerates
|
|
1154
1468
|
|
|
1155
1469
|
3. **Branch on user's choice:**
|
|
1156
1470
|
|
|
@@ -1172,55 +1486,274 @@ When the pipeline pauses at `PAUSED_FOR_REVIEW`, the exploration is at step `REV
|
|
|
1172
1486
|
|
|
1173
1487
|
**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.
|
|
1174
1488
|
|
|
1175
|
-
#### Step 9 — Review and accept recommendations (role-aware)
|
|
1489
|
+
#### Step 9 — Review and accept recommendations (grouped, role-aware)
|
|
1176
1490
|
|
|
1177
|
-
Call `mcp__ritual__get_recommendations(exploration_id)`. Response is an array of recommendations
|
|
1491
|
+
Call `mcp__ritual__get_recommendations(exploration_id)`. Response is an array of recommendations. Each rec includes:
|
|
1492
|
+
|
|
1493
|
+
- top-level: `id`, `title`, `content` (summary), `status`, `priority`, `points`, `confidence`
|
|
1494
|
+
- `metadata.category.name` — **the load-bearing grouping key** (one rec → one category)
|
|
1495
|
+
- `metadata.acceptance_criteria[]` — concrete pass conditions
|
|
1496
|
+
- `metadata.explainability` — `rationale` (chained `→` arrow string), `faq_references[]`, `problem_alignment`, `inferred_elements`, optional `initial_input_analysis`
|
|
1497
|
+
- `metadata.labels[]` — secondary tags
|
|
1178
1498
|
|
|
1179
1499
|
**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`. Respect this so a collaborator running `/ritual build` doesn't hit a 403 mid-flow and lose context.
|
|
1180
1500
|
|
|
1181
1501
|
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.
|
|
1182
1502
|
|
|
1183
|
-
|
|
1503
|
+
**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.
|
|
1504
|
+
|
|
1505
|
+
##### 9.1 — Landing screen: grouped category summary + compact scope
|
|
1506
|
+
|
|
1507
|
+
The recommendations review is the most-read screen in the whole build flow.
|
|
1508
|
+
|
|
1509
|
+
```text
|
|
1510
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1511
|
+
STEP 9.1 RENDERING CONTRACT — non-negotiable
|
|
1512
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1513
|
+
|
|
1514
|
+
Landing view is for SELECTION, not reading. Full prose belongs in 9.3.
|
|
1515
|
+
|
|
1516
|
+
✓ DO:
|
|
1517
|
+
- Number categories `1.`, `2.`, `3.` … `K.` in page order
|
|
1518
|
+
- Assign recommendations stable `R1`, `R2`, … `RN` IDs GLOBALLY across
|
|
1519
|
+
all categories (NOT restart per-category — so `detail R7` is
|
|
1520
|
+
unambiguous without naming the category)
|
|
1521
|
+
- Show recommendation TITLES ONLY at the landing
|
|
1522
|
+
- Indent recs 3 spaces under their category
|
|
1523
|
+
- One blank line between categories
|
|
1524
|
+
- Include compact scope line above the list
|
|
1525
|
+
- End with the action block (`accept recommended` etc.)
|
|
1526
|
+
|
|
1527
|
+
✗ DO NOT:
|
|
1528
|
+
- Do NOT render recs as a flat `1..N` list with no category structure
|
|
1529
|
+
- Do NOT use raw numeric rec IDs like `1.`, `2.`, `3.` — use `R1`, `R2`, `R3`
|
|
1530
|
+
- Do NOT show recommendation `content` / summary text at the landing
|
|
1531
|
+
- Do NOT show acceptance criteria, rationale, tactics, or references at
|
|
1532
|
+
the landing — those are 9.3 detail-card content
|
|
1533
|
+
- Do NOT omit category numbering (the prefix is what separates this
|
|
1534
|
+
from a wall-of-text grouped list)
|
|
1535
|
+
- Do NOT invent a "raw / deduped" framing line — the API does not return
|
|
1536
|
+
pre-dedup counts. Use `{N} recommendations across {K} categories.`
|
|
1537
|
+
|
|
1538
|
+
OBSERVED FAILURE — never render this:
|
|
1539
|
+
|
|
1540
|
+
Recommendations (13)
|
|
1541
|
+
|
|
1542
|
+
1. Backfill legacy data to fail-closed PRIVATE visibility
|
|
1543
|
+
Add a constrained `visibility` field with DB default PRIVATE...
|
|
1544
|
+
|
|
1545
|
+
2. Codify actor-state rights around owner-only mutation
|
|
1546
|
+
Define a single permission matrix across PRIVATE/SHARED/PUBLIC...
|
|
1547
|
+
|
|
1548
|
+
3. Centralize object permissions across storefront and dashboard
|
|
1549
|
+
Reusable `can_view_wishlist` / `can_edit_wishlist` methods...
|
|
1550
|
+
|
|
1551
|
+
Why wrong:
|
|
1552
|
+
- Looks grouped only implicitly; categories not visible as headers
|
|
1553
|
+
- Uses `1..N` numeric IDs (should be `R1..RN`)
|
|
1554
|
+
- Dumps `content` summaries — defeats the purpose of a landing view
|
|
1555
|
+
- `detail R7` no longer maps to a stable ID
|
|
1556
|
+
|
|
1557
|
+
PREFLIGHT — before printing 9.1 output, self-check:
|
|
1558
|
+
□ Did I group by `metadata.category.name`?
|
|
1559
|
+
□ Did I prefix each category with `1.`, `2.`, … `K.`?
|
|
1560
|
+
□ Did I assign global `R1..RN` IDs across categories?
|
|
1561
|
+
□ Did I show titles only (no summaries / no rationale)?
|
|
1562
|
+
□ Is there a compact scope line above the list?
|
|
1563
|
+
□ Does my action block use `R{N}` references that match the IDs above?
|
|
1564
|
+
|
|
1565
|
+
If any answer is no, FIX BEFORE PRINTING.
|
|
1566
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1567
|
+
```
|
|
1568
|
+
|
|
1569
|
+
Full rail at the landing (Recommendations stage opens):
|
|
1570
|
+
|
|
1571
|
+
```text
|
|
1572
|
+
Ritual build
|
|
1573
|
+
✓ Context ✓ Scope ✓ Discovery ● Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1574
|
+
|
|
1575
|
+
Scope:
|
|
1576
|
+
{one-line compressed scope — ~80-120 chars; truncate the full problem
|
|
1577
|
+
statement at a natural clause boundary, no ellipsis}
|
|
1578
|
+
|
|
1579
|
+
Recommendations ready
|
|
1580
|
+
|
|
1581
|
+
{N} recommendations across {K} categories.
|
|
1582
|
+
|
|
1583
|
+
1. {Category 1 name}
|
|
1584
|
+
R1 {title}
|
|
1585
|
+
R2 {title}
|
|
1586
|
+
|
|
1587
|
+
2. {Category 2 name}
|
|
1588
|
+
R3 {title}
|
|
1589
|
+
R4 {title}
|
|
1590
|
+
R5 {title}
|
|
1591
|
+
|
|
1592
|
+
3. {Category 3 name}
|
|
1593
|
+
R6 {title}
|
|
1594
|
+
|
|
1595
|
+
...
|
|
1596
|
+
|
|
1597
|
+
Pulse: Reasoning Readiness ~88% · Context Debt 12% · +26% (implementation-ready)
|
|
1598
|
+
|
|
1599
|
+
Recommended: reply `accept recommended` to approve these {N} and generate
|
|
1600
|
+
the build brief.
|
|
1601
|
+
|
|
1602
|
+
Or reply:
|
|
1603
|
+
- `detail R7` to inspect one recommendation
|
|
1604
|
+
- `drop R8` to remove one before accepting
|
|
1605
|
+
- `change R3: <edit>` to revise one
|
|
1606
|
+
- `hold` to stop here
|
|
1607
|
+
```
|
|
1608
|
+
|
|
1609
|
+
Notes:
|
|
1610
|
+
|
|
1611
|
+
- **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.
|
|
1612
|
+
- **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).
|
|
1613
|
+
- **Pulse uses full labels** per `references/cli-output-contract.md` § Pulse tier labels.
|
|
1614
|
+
- **`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.
|
|
1615
|
+
- **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:
|
|
1616
|
+
- **`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."
|
|
1617
|
+
- **`show scope`** to expand the full problem statement (covered in 9.2).
|
|
1618
|
+
|
|
1619
|
+
##### 9.2 — `show scope` handling
|
|
1620
|
+
|
|
1621
|
+
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):
|
|
1622
|
+
|
|
1623
|
+
```text
|
|
1624
|
+
Recommendations · Scope (full)
|
|
1625
|
+
|
|
1626
|
+
{full problemStatement, wrapped at terminal width}
|
|
1627
|
+
|
|
1628
|
+
Reply `back` to return to the recommendations list, or any of the regular
|
|
1629
|
+
recommendation actions.
|
|
1630
|
+
```
|
|
1631
|
+
|
|
1632
|
+
##### 9.3 — Detail card (when user replies `detail R{N}`)
|
|
1633
|
+
|
|
1634
|
+
In-phase chip + focused single-rec card. Use the LABELED-BLOCK shape per `references/cli-output-contract.md` § Dense list format. The "Why this" block REPLACES the `rationale` chained-arrow string — render it as 4 named lines, not the literal `Problem → Discovery → Tradeoff → Recommendation` arrow chain (which is the LLM's internal scratchpad shape, not user-facing).
|
|
1184
1635
|
|
|
1185
1636
|
```text
|
|
1186
|
-
|
|
1637
|
+
Recommendations — R7
|
|
1187
1638
|
|
|
1188
|
-
|
|
1189
|
-
Signal: discovery has completed and recommendations now exist for this scope.
|
|
1639
|
+
R7. {title}
|
|
1190
1640
|
|
|
1191
|
-
|
|
1641
|
+
Category:
|
|
1642
|
+
{metadata.category.name}
|
|
1192
1643
|
|
|
1193
|
-
|
|
1644
|
+
Recommendation:
|
|
1645
|
+
{content — direct, actionable summary; 2-4 sentences}
|
|
1194
1646
|
|
|
1195
|
-
|
|
1647
|
+
Why this:
|
|
1648
|
+
- Problem: {one-line distillation from metadata.explainability.problem_alignment}
|
|
1649
|
+
- Discovery: {one-line distillation from metadata.explainability.faq_references[0].insight}
|
|
1650
|
+
- Tradeoff: {one-line distillation from rationale's "Tradeoffs (...)" segment}
|
|
1651
|
+
- Recommendation: {one-line distillation from rationale's "Recommendation (...)" segment}
|
|
1652
|
+
|
|
1653
|
+
Tactics:
|
|
1654
|
+
- {short imperative — derived from metadata.acceptance_criteria where actionable}
|
|
1655
|
+
- {short imperative}
|
|
1656
|
+
- {short imperative}
|
|
1657
|
+
|
|
1658
|
+
Acceptance criteria:
|
|
1659
|
+
- {metadata.acceptance_criteria[0]}
|
|
1660
|
+
- {metadata.acceptance_criteria[1]}
|
|
1661
|
+
- {metadata.acceptance_criteria[N]}
|
|
1662
|
+
|
|
1663
|
+
References:
|
|
1664
|
+
- {file path or RB id from metadata.explainability.faq_references / referenced_faq_ids}
|
|
1665
|
+
- {reference}
|
|
1196
1666
|
|
|
1197
|
-
|
|
1667
|
+
Reply `drop R7`, `change R7: <edit>`, or `back`.
|
|
1198
1668
|
|
|
1199
|
-
|
|
1669
|
+
To move forward, reply `accept recommended` from the summary.
|
|
1670
|
+
If you only want a subset, `drop` the recs you don't want first, then `accept recommended`.
|
|
1200
1671
|
```
|
|
1201
1672
|
|
|
1202
|
-
|
|
1673
|
+
Notes on the detail card:
|
|
1674
|
+
|
|
1675
|
+
- **Single-rec accept is NOT a visible CTA here** — the SKILL deliberately omits `accept R7`. The backing API only supports accept-all (`accept_recommendations`) today; surfacing `accept R7` would teach the user a command the system can't fulfill. When a single-rec accept endpoint lands (see backlog), re-introduce it here.
|
|
1676
|
+
- 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.
|
|
1677
|
+
- `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").
|
|
1678
|
+
- `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).
|
|
1679
|
+
- `back` returns to the landing summary, NOT to a new fetch — the agent should cache the recs from the landing call and re-render.
|
|
1680
|
+
|
|
1681
|
+
##### 9.4 — Action handling
|
|
1682
|
+
|
|
1683
|
+
Visible CTAs in 9.1 / 9.3 map to MCP/API actions. Some are direct, some require interpretation. The agent maps free-text replies to these actions:
|
|
1684
|
+
|
|
1685
|
+
| User reply | Action | Backing call |
|
|
1686
|
+
|---|---|---|
|
|
1687
|
+
| `accept recommended` | Accept ALL recs currently on screen | `mcp__ritual__accept_recommendations(exploration_id)` (admin only — see Branch B) |
|
|
1688
|
+
| `detail R{N}` | Render the detail card for that rec | None (in-memory) |
|
|
1689
|
+
| `accept R{N}` (from detail) | Mark that single rec approved | **No direct single-rec API today — NOT shown as a visible CTA.** If user types it anyway, explain: "I can accept all 11 now via `accept recommended`, or you can `drop` the ones you don't want first." See backlog. |
|
|
1690
|
+
| `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 |
|
|
1691
|
+
| `drop R{N}` | Mark that rec rejected | `update_recommendation` with status=rejected, OR add a "deliberately excluded" note for the brief generator |
|
|
1692
|
+
| `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 |
|
|
1693
|
+
| `show scope` | Expand the scope reference | None (in-memory) |
|
|
1694
|
+
| `hold` | Stop here without accepting | None (exits the flow; user can resume later) |
|
|
1695
|
+
|
|
1696
|
+
Don't display all aliases. Display the four most-likely-needed: `accept recommended`, `detail R{N}`, `drop R{N}`, `hold`. Show `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).
|
|
1697
|
+
|
|
1698
|
+
**Backlog notes** (referenced for the agent so it doesn't over-promise):
|
|
1699
|
+
- Single-rec `accept R7` from the detail card doesn't have a direct API endpoint — today the user can either accept ALL or none. Surface this honestly: "I can accept all 11 now, or you can drop the ones you don't want and then accept the rest."
|
|
1700
|
+
- `add <topic>` requires a regenerate with a pinned topic — that's a forthcoming `regenerate_recommendation` improvement; until then it's a full regeneration cycle.
|
|
1203
1701
|
|
|
1204
|
-
|
|
1702
|
+
##### 9.A — Branch A: admin replies `accept recommended`
|
|
1205
1703
|
|
|
1206
|
-
Call `mcp__ritual__accept_recommendations(exploration_id)`. Response includes counts (`promoted`, `alreadyApproved`, `skipped`, `transitionedToComplete`). Show:
|
|
1704
|
+
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:
|
|
1207
1705
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1706
|
+
```text
|
|
1707
|
+
Ritual build
|
|
1708
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ● Build brief ○ Implementation (Your agent)
|
|
1709
|
+
|
|
1710
|
+
Accepted {N} recommendations.
|
|
1711
|
+
|
|
1712
|
+
View: https://app.ritualapp.cloud/e/{exploration_id}
|
|
1713
|
+
|
|
1714
|
+
Next: generating the build brief…
|
|
1715
|
+
```
|
|
1210
1716
|
|
|
1211
1717
|
**Pulse (recommendations accepted):** Emit a pulse — this is almost always a state-tier crossing into **Recommendation-ready**. Render full.
|
|
1212
1718
|
|
|
1213
|
-
Continue to Step 9.5.
|
|
1719
|
+
Continue to Step 9.5 (`Wait for requirements`).
|
|
1214
1720
|
|
|
1215
|
-
|
|
1721
|
+
##### 9.B — Branch B: user is a collaborator (no admin acceptance available)
|
|
1216
1722
|
|
|
1217
|
-
|
|
1723
|
+
Same landing screen as 9.1, but the action block changes — collaborators can request admin review instead of accepting directly:
|
|
1218
1724
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1725
|
+
```text
|
|
1726
|
+
Ritual build
|
|
1727
|
+
✓ Context ✓ Scope ✓ Discovery ● Recommendations ○ Build brief ○ Implementation (Your agent)
|
|
1728
|
+
|
|
1729
|
+
Scope:
|
|
1730
|
+
{compact scope}
|
|
1731
|
+
|
|
1732
|
+
Admin acceptance pending
|
|
1733
|
+
|
|
1734
|
+
These recommendations are in {status — draft / pending_review}. Only an
|
|
1735
|
+
admin can formally accept them.
|
|
1736
|
+
|
|
1737
|
+
1. {Category 1}
|
|
1738
|
+
R1 {title}
|
|
1739
|
+
R2 {title}
|
|
1740
|
+
|
|
1741
|
+
...
|
|
1742
|
+
|
|
1743
|
+
Recommended: reply `request admin review` to send these for approval.
|
|
1744
|
+
Or reply `detail R7`, `change R3: <edit>`, `drop R8`, or `hold`.
|
|
1745
|
+
|
|
1746
|
+
(If your team allows it, you can continue to implementation before admin
|
|
1747
|
+
acceptance — Ritual will mark the exploration as `implemented_ahead` so
|
|
1748
|
+
the admin can reconcile later. Reply `continue` to take that path.)
|
|
1749
|
+
```
|
|
1750
|
+
|
|
1751
|
+
Note the THREE-tier CTA structure for collaborators:
|
|
1752
|
+
1. `request admin review` — the recommended path (notifies admin, no implementation yet)
|
|
1753
|
+
2. `continue` — implement-ahead-of-acceptance (logs as `implemented_ahead`; admin can reconcile later)
|
|
1754
|
+
3. `hold` — stop entirely
|
|
1755
|
+
|
|
1756
|
+
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.
|
|
1224
1757
|
|
|
1225
1758
|
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.
|
|
1226
1759
|
|
|
@@ -1245,8 +1778,9 @@ Steps:
|
|
|
1245
1778
|
```
|
|
1246
1779
|
|
|
1247
1780
|
Polling rules in this harness:
|
|
1248
|
-
-
|
|
1781
|
+
- **`Bash sleep 5` per poll. Always 5. Never escalate to 15/20/25.** The harness blocks chained sleeps, `sleep ≥ 30`, AND successive `sleep N` calls across turns at increasing N. One short sleep per turn dodges all three guards AND keeps the user-facing progress feel live.
|
|
1249
1782
|
- **Update the user every ~3 polls** with a "still generating…" line so they know you haven't stalled.
|
|
1783
|
+
- If polling crosses ~5 minutes, switch to the `Monitor` + `until <check>; do sleep 2; done` pattern from `references/async-polling.md` § Long waits.
|
|
1250
1784
|
|
|
1251
1785
|
3. **Exit conditions:**
|
|
1252
1786
|
|
|
@@ -1312,7 +1846,7 @@ When the brief content is in hand (from generate OR polling), **don't dump 300 l
|
|
|
1312
1846
|
```markdown
|
|
1313
1847
|
<!--
|
|
1314
1848
|
Generated by Ritual
|
|
1315
|
-
Exploration: https://
|
|
1849
|
+
Exploration: https://app.ritualapp.cloud/e/{exploration_id}
|
|
1316
1850
|
Build brief id: {brief_id}
|
|
1317
1851
|
Do not remove this header; it preserves implementation lineage.
|
|
1318
1852
|
-->
|
|
@@ -1365,15 +1899,29 @@ When the brief content is in hand (from generate OR polling), **don't dump 300 l
|
|
|
1365
1899
|
|
|
1366
1900
|
##### 10d — Confirm and proceed (CLI Tenet #2, #12)
|
|
1367
1901
|
|
|
1368
|
-
End Step 10 with a single recommended action plus a cheap escape hatch — never a 3-way option bloom.
|
|
1902
|
+
End Step 10 with a single recommended action plus a cheap escape hatch — never a 3-way option bloom. Full rail (this is a decision gate that closes the Build brief phase):
|
|
1903
|
+
|
|
1904
|
+
```text
|
|
1905
|
+
Ritual build
|
|
1906
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ● Build brief ○ Implementation (Your agent)
|
|
1907
|
+
|
|
1908
|
+
Build brief ready
|
|
1369
1909
|
|
|
1370
|
-
|
|
1910
|
+
`BUILD-BRIEF.md` is on disk. Skim the RBs + anchors, then decide:
|
|
1371
1911
|
|
|
1372
|
-
|
|
1912
|
+
· `go` — ready to implement; move to coding
|
|
1913
|
+
· `refine` — something's off; tell me what and I'll regenerate
|
|
1914
|
+
· `drill {N}` — drill into RB-{N} before deciding
|
|
1373
1915
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1916
|
+
Reply `pause` to stop here.
|
|
1917
|
+
```
|
|
1918
|
+
|
|
1919
|
+
Branch by user response. Accept `go`, `y`, `yes`, `proceed`, `continue`, `next` as the visible-CTA path (do not display all aliases):
|
|
1920
|
+
|
|
1921
|
+
- **`go` / proceed / yes / y**: continue to Step 11.
|
|
1922
|
+
- **`refine`**: ask what's off, then call `generate_build_brief` with `force: true` after applying their feedback to the exploration (typically a recommendation re-accept or a requirement adjustment via the web UI).
|
|
1923
|
+
- **`drill {N}`**: open RB-{N} in the markdown, discuss inline, then loop back to the gate above.
|
|
1924
|
+
- **`pause`**: stop here. The brief is on disk; the user can resume with `/ritual resume`.
|
|
1377
1925
|
|
|
1378
1926
|
**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.
|
|
1379
1927
|
|
|
@@ -1381,6 +1929,21 @@ Branch by user response:
|
|
|
1381
1929
|
|
|
1382
1930
|
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.
|
|
1383
1931
|
|
|
1932
|
+
The Implementation phase landing — full rail (the rail moves to Implementation for the first time):
|
|
1933
|
+
|
|
1934
|
+
```text
|
|
1935
|
+
Ritual build
|
|
1936
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ● Implementation (Your agent)
|
|
1937
|
+
|
|
1938
|
+
Implementation (Your agent)
|
|
1939
|
+
|
|
1940
|
+
The build brief is on disk. From here, your agent codes against the
|
|
1941
|
+
RB list. Ritual will track commits via the `Ritual-Exploration:` trailer
|
|
1942
|
+
so they link back to this exploration when you sync.
|
|
1943
|
+
|
|
1944
|
+
Next: I'll create a feature branch, then start on RB-1.
|
|
1945
|
+
```
|
|
1946
|
+
|
|
1384
1947
|
##### 11.0 — Branch strategy (CLI Tenet #13)
|
|
1385
1948
|
|
|
1386
1949
|
**Never commit to `main` / `master` from an agent workflow.** Before writing a single line of code:
|
|
@@ -1427,7 +1990,7 @@ feat(<area>): <one-line headline>
|
|
|
1427
1990
|
<short body — what changed, why, key trade-off>
|
|
1428
1991
|
|
|
1429
1992
|
Ritual-Exploration: <exploration_id>
|
|
1430
|
-
Ritual-Exploration-Url: https://
|
|
1993
|
+
Ritual-Exploration-Url: https://app.ritualapp.cloud/e/<exploration_id>
|
|
1431
1994
|
Ritual-RBs-Satisfied: RB-1, RB-2, RB-7
|
|
1432
1995
|
```
|
|
1433
1996
|
|
|
@@ -1480,7 +2043,7 @@ If the user says "y" / "push" / "open PR":
|
|
|
1480
2043
|
|
|
1481
2044
|
## Exploration
|
|
1482
2045
|
|
|
1483
|
-
- Exploration: [<exploration name>](https://
|
|
2046
|
+
- Exploration: [<exploration name>](https://app.ritualapp.cloud/e/<exploration_id>)
|
|
1484
2047
|
- Build brief: see `BUILD-BRIEF.md` (committed in this PR for reviewer reference)
|
|
1485
2048
|
- Deferrals intentionally punted: <count, with one-line each>
|
|
1486
2049
|
|
|
@@ -1495,14 +2058,27 @@ If the user is implementing manually: hand off the brief + the branch-strategy n
|
|
|
1495
2058
|
|
|
1496
2059
|
##### 12.0 — What this step does (in product terms)
|
|
1497
2060
|
|
|
1498
|
-
Before asking for permission, frame the call in language the user can act on. `sync_implementation` is not just an API call — it's the moment the workspace's knowledge graph absorbs what you just shipped.
|
|
2061
|
+
Before asking for permission, frame the call in language the user can act on. `sync_implementation` is not just an API call — it's the moment the workspace's knowledge graph absorbs what you just shipped. Full rail (this is a top-level decision gate that ends the build flow):
|
|
1499
2062
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
2063
|
+
```text
|
|
2064
|
+
Ritual build
|
|
2065
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ● Implementation (Your agent)
|
|
2066
|
+
|
|
2067
|
+
Log implementation
|
|
2068
|
+
|
|
2069
|
+
I'm about to log this implementation into the workspace's knowledge graph. After this:
|
|
2070
|
+
|
|
2071
|
+
· The exploration's state flips to ✓ done (or ⚠ implemented-ahead if
|
|
2072
|
+
any recs weren't approved when shipped).
|
|
2073
|
+
· The implementation gets linked back to the recommendations it
|
|
2074
|
+
implements — so future `/ritual build` calls touching
|
|
2075
|
+
`{first 2 of filesChanged}` will see this implementation as priorContext.
|
|
2076
|
+
· The {M} open deferrals you intentionally punted get logged with
|
|
2077
|
+
their reasons — peers can see them in `/ritual lineage` on these
|
|
2078
|
+
files later.
|
|
2079
|
+
|
|
2080
|
+
Reply `log` to confirm, `hold off`, or `adjust` to edit the list first.
|
|
2081
|
+
```
|
|
1506
2082
|
|
|
1507
2083
|
This framing replaces "I need to call sync_implementation, OK?" — which is jargon. The user should know what they're approving in product terms (CLI Tenet #4 — cite the specific signal). Note the vocabulary rule in `cli-output-contract.md` — do not surface "decisions" / "{N} decisions" as a user-facing label here; frame the moment as logging the **implementation** itself.
|
|
1508
2084
|
|
|
@@ -1525,32 +2101,58 @@ When sync_implementation succeeds, the response includes:
|
|
|
1525
2101
|
- `decisionsCount`, `deferralsCount` — totals for the summary line
|
|
1526
2102
|
- `webUrl` — clickable link to the exploration's implementation record in the web UI
|
|
1527
2103
|
|
|
1528
|
-
**Surface ALL of this to the user**, not just "ok logged." This is the visible signal that the loop closed.
|
|
2104
|
+
**Surface ALL of this to the user**, not just "ok logged." This is the visible signal that the loop closed. Full rail (this is the completion state for the whole `/ritual build` flow):
|
|
1529
2105
|
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
2106
|
+
```text
|
|
2107
|
+
Ritual build
|
|
2108
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ✓ Implementation (Your agent)
|
|
2109
|
+
|
|
2110
|
+
✓ Logged implementation for {exploration name}
|
|
2111
|
+
|
|
2112
|
+
· Implemented: {first 2 area:choice pairs from decisions[],
|
|
2113
|
+
e.g. "auth: OAuth not SAML; data-model: tenant-scoped indexes"}
|
|
2114
|
+
· {deferralsCount} deferral{s} registered: {first 1, e.g. "[major]
|
|
2115
|
+
Rate-limit per-tenant — out of scope for v1"}
|
|
2116
|
+
· View: {webUrl}
|
|
2117
|
+
|
|
2118
|
+
Future `/ritual build` calls touching `{first 2 of filesChanged}` will
|
|
2119
|
+
now see this implementation in their priorContext block.
|
|
2120
|
+
|
|
2121
|
+
Next: nothing required — the loop is closed. Run `/ritual lineage` on
|
|
2122
|
+
any touched file to trace this back later.
|
|
2123
|
+
```
|
|
1536
2124
|
|
|
1537
2125
|
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.
|
|
1538
2126
|
|
|
1539
|
-
If any anchor's `recommendationStatusAtImplementation` is NOT `approved` (i.e. the Branch B path), add a callout — still frame in implementation/recommendation terms:
|
|
2127
|
+
If any anchor's `recommendationStatusAtImplementation` is NOT `approved` (i.e. the Branch B path), 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):
|
|
1540
2128
|
|
|
1541
|
-
|
|
2129
|
+
```text
|
|
2130
|
+
⚠ {M} of the recommendations were implemented while still in {status}
|
|
2131
|
+
state — the exploration now shows `implemented_ahead`. An admin should
|
|
2132
|
+
review + accept the recs to close the gap.
|
|
2133
|
+
```
|
|
1542
2134
|
|
|
1543
2135
|
The closing sentence is the most important one: it tells the user **what just happened in the system** in product-level terms. Without it, sync_implementation feels like a write-only black hole. With it, the user understands they just contributed to the workspace's memory.
|
|
1544
2136
|
|
|
1545
2137
|
**If `sync_implementation` fails:** do not drop the structured implementation data. Write the intended payload to `.ritual/pending-sync/<exploration-id>.json` and tell the user exactly what was not logged.
|
|
1546
2138
|
|
|
1547
|
-
User-visible:
|
|
2139
|
+
User-visible (full rail — sync failure is a top-level state):
|
|
1548
2140
|
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
2141
|
+
```text
|
|
2142
|
+
Ritual build
|
|
2143
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ● Implementation (Your agent)
|
|
2144
|
+
|
|
2145
|
+
Sync failed (recoverable)
|
|
2146
|
+
|
|
2147
|
+
`sync_implementation` failed: {error summary}
|
|
2148
|
+
|
|
2149
|
+
Saved the intended sync payload to `.ritual/pending-sync/<exploration-id>.json`.
|
|
2150
|
+
Nothing about your implementation was lost — the failure is on the
|
|
2151
|
+
logging side, not the code side.
|
|
2152
|
+
|
|
2153
|
+
Next: run `/ritual resume` later to see + retry pending syncs, or
|
|
2154
|
+
re-run `sync_implementation` now if the cause was transient.
|
|
2155
|
+
```
|
|
1554
2156
|
|
|
1555
2157
|
Create `.ritual/pending-sync/` if needed. **Ensure the directory is gitignored** — the saved payload contains `decisions[].rationale` text the user typed and commit-level data that shouldn't end up in shared repo history. On the first failed sync, also write `.ritual/pending-sync/.gitignore` with `*` so the directory itself is committed but its contents aren't (gives teammates the breadcrumb that pending syncs exist without leaking contents):
|
|
1556
2158
|
|
|
@@ -1572,16 +2174,28 @@ Before re-invoking `sync_implementation` on a saved payload:
|
|
|
1572
2174
|
2. Run `git log --pretty=format:%H` against the payload's `branch`.
|
|
1573
2175
|
3. Compare: if there are commit SHAs in `git log` that AREN'T in the payload's `commits[]`, the payload is stale.
|
|
1574
2176
|
|
|
1575
|
-
If stale, surface to the user:
|
|
2177
|
+
If stale, surface to the user with the full rail (top-level decision gate):
|
|
1576
2178
|
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
2179
|
+
```text
|
|
2180
|
+
Ritual build
|
|
2181
|
+
✓ Context ✓ Scope ✓ Discovery ✓ Recommendations ✓ Build brief ● Implementation (Your agent)
|
|
2182
|
+
|
|
2183
|
+
Pending sync is stale
|
|
2184
|
+
|
|
2185
|
+
This pending sync was saved {N} day(s) ago. Since then you've added
|
|
2186
|
+
{M} more commit(s) to `{branch}` that aren't in the saved payload.
|
|
2187
|
+
Retrying as-is would log a partial picture — the work done since the
|
|
2188
|
+
failure would NOT be attributed to this exploration.
|
|
2189
|
+
|
|
2190
|
+
Options:
|
|
2191
|
+
|
|
2192
|
+
1. Retry as-is — log what was saved; you can sync the new commits later.
|
|
2193
|
+
2. Regenerate — re-run from scratch with the current state. This is
|
|
2194
|
+
usually right when there's been substantive work since the failure.
|
|
2195
|
+
3. Show me — print the {M} new commits so I can decide.
|
|
2196
|
+
|
|
2197
|
+
Reply `1`, `2`, or `3`. Reply `pause` to stop here.
|
|
2198
|
+
```
|
|
1585
2199
|
|
|
1586
2200
|
**[USER PAUSE — required, do not auto-answer]** Wait for response. Option 2 is usually right when there's been substantive work; option 1 is fine for small follow-up commits the user wants attributed to the next sync.
|
|
1587
2201
|
|