@ritualai/cli 0.6.0 → 0.7.1
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/README.md +45 -16
- package/dist/index.js +0 -0
- package/dist/lib/oidc.js +60 -3
- package/dist/lib/oidc.js.map +1 -1
- package/package.json +73 -64
- package/skills/claude-code/ritual/DESIGN.md +35 -0
- package/skills/claude-code/ritual/SKILL.md +43 -370
- package/skills/claude-code/ritual/agents/openai.yaml +5 -0
- package/skills/claude-code/ritual/references/async-polling.md +26 -0
- package/skills/claude-code/ritual/references/build-flow.md +1449 -0
- package/skills/claude-code/ritual/references/cli-output-contract.md +135 -0
- package/skills/claude-code/ritual/references/context-pulse-flow.md +356 -0
- package/skills/claude-code/ritual/references/discovery-classification.md +175 -0
- package/skills/claude-code/ritual/references/lineage-flow.md +152 -0
- package/skills/claude-code/ritual/references/resume-flow.md +156 -0
- package/skills/claude-code/ritual/references/scoring-fallback.md +125 -0
- package/skills/codex/ritual/DESIGN.md +35 -0
- package/skills/codex/ritual/SKILL.md +43 -370
- package/skills/codex/ritual/agents/openai.yaml +5 -0
- package/skills/codex/ritual/references/async-polling.md +26 -0
- package/skills/codex/ritual/references/build-flow.md +1449 -0
- package/skills/codex/ritual/references/cli-output-contract.md +135 -0
- package/skills/codex/ritual/references/context-pulse-flow.md +356 -0
- package/skills/codex/ritual/references/discovery-classification.md +175 -0
- package/skills/codex/ritual/references/lineage-flow.md +152 -0
- package/skills/codex/ritual/references/resume-flow.md +156 -0
- package/skills/codex/ritual/references/scoring-fallback.md +125 -0
- package/skills/cursor/ritual/DESIGN.md +35 -0
- package/skills/cursor/ritual/SKILL.md +43 -370
- package/skills/cursor/ritual/agents/openai.yaml +5 -0
- package/skills/cursor/ritual/references/async-polling.md +26 -0
- package/skills/cursor/ritual/references/build-flow.md +1449 -0
- package/skills/cursor/ritual/references/cli-output-contract.md +135 -0
- package/skills/cursor/ritual/references/context-pulse-flow.md +356 -0
- package/skills/cursor/ritual/references/discovery-classification.md +175 -0
- package/skills/cursor/ritual/references/lineage-flow.md +152 -0
- package/skills/cursor/ritual/references/resume-flow.md +156 -0
- package/skills/cursor/ritual/references/scoring-fallback.md +125 -0
- package/skills/gemini/ritual/DESIGN.md +35 -0
- package/skills/gemini/ritual/SKILL.md +43 -370
- package/skills/gemini/ritual/agents/openai.yaml +5 -0
- package/skills/gemini/ritual/references/async-polling.md +26 -0
- package/skills/gemini/ritual/references/build-flow.md +1449 -0
- package/skills/gemini/ritual/references/cli-output-contract.md +135 -0
- package/skills/gemini/ritual/references/context-pulse-flow.md +356 -0
- package/skills/gemini/ritual/references/discovery-classification.md +175 -0
- package/skills/gemini/ritual/references/lineage-flow.md +152 -0
- package/skills/gemini/ritual/references/resume-flow.md +156 -0
- package/skills/gemini/ritual/references/scoring-fallback.md +125 -0
- package/skills/kiro/ritual/DESIGN.md +35 -0
- package/skills/kiro/ritual/SKILL.md +43 -370
- package/skills/kiro/ritual/agents/openai.yaml +5 -0
- package/skills/kiro/ritual/references/async-polling.md +26 -0
- package/skills/kiro/ritual/references/build-flow.md +1449 -0
- package/skills/kiro/ritual/references/cli-output-contract.md +135 -0
- package/skills/kiro/ritual/references/context-pulse-flow.md +356 -0
- package/skills/kiro/ritual/references/discovery-classification.md +175 -0
- package/skills/kiro/ritual/references/lineage-flow.md +152 -0
- package/skills/kiro/ritual/references/resume-flow.md +156 -0
- package/skills/kiro/ritual/references/scoring-fallback.md +125 -0
- package/skills/vscode/ritual/DESIGN.md +35 -0
- package/skills/vscode/ritual/SKILL.md +43 -370
- package/skills/vscode/ritual/agents/openai.yaml +5 -0
- package/skills/vscode/ritual/references/async-polling.md +26 -0
- package/skills/vscode/ritual/references/build-flow.md +1449 -0
- package/skills/vscode/ritual/references/cli-output-contract.md +135 -0
- package/skills/vscode/ritual/references/context-pulse-flow.md +356 -0
- package/skills/vscode/ritual/references/discovery-classification.md +175 -0
- package/skills/vscode/ritual/references/lineage-flow.md +152 -0
- package/skills/vscode/ritual/references/resume-flow.md +156 -0
- package/skills/vscode/ritual/references/scoring-fallback.md +125 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Discovery classification reference
|
|
2
|
+
|
|
3
|
+
Loaded only when `/ritual build` question picking triggers scope classification.
|
|
4
|
+
|
|
5
|
+
##### 7.4.5 — Scope Classification Check (conditional)
|
|
6
|
+
|
|
7
|
+
When the user picks discovery questions, the gap between **what the problem statement asks about** and **what the user actually chose to investigate** is the agent's first concrete read on whether the scope is genuinely narrow, deliberately sequenced, or under-engaged. This step makes that gap visible — but ONLY when the signal warrants it.
|
|
8
|
+
|
|
9
|
+
**Design principle (locked):** *Don't make the user optimize the score. Let the score explain what just happened.* The menu asks a plain product question; the pulse confirms the consequence afterward. Never preview deltas inside the choice menu.
|
|
10
|
+
|
|
11
|
+
###### Per-question typed status
|
|
12
|
+
|
|
13
|
+
Once Step 7.4 lands, the agent tracks an in-session status for every surfaced question. Statuses are ephemeral (not persisted to the DB yet — that's a follow-up); they carry through this `/ritual build` session only:
|
|
14
|
+
|
|
15
|
+
| Status | Meaning |
|
|
16
|
+
|---|---|
|
|
17
|
+
| **`picked`** | User selected for active investigation (passed to `start_agentic_run`) |
|
|
18
|
+
| **`deferred`** | Deliberate phase-2 candidate; surfaces in build brief's "Phase Candidates" section. NOT context debt. |
|
|
19
|
+
| **`dropped`** | Removed from scope; problem statement gets narrowed to exclude this concern. |
|
|
20
|
+
| **`unreviewed`** | Default state for every surfaced question until the user classifies it. Counts toward debt if the user proceeds to Step 8 without resolving. |
|
|
21
|
+
|
|
22
|
+
`picked` is set automatically by the per-matter accept calls in 7.4. The other three are set by the Step 7.4.5 branches below.
|
|
23
|
+
|
|
24
|
+
###### Conditional trigger
|
|
25
|
+
|
|
26
|
+
Step 7.4.5 fires **only** when at least one of these holds — otherwise proceed silently to 7.5:
|
|
27
|
+
|
|
28
|
+
- **Pick-rate < 40%** (picked / total_surfaced)
|
|
29
|
+
- **Matter coverage ≤ 50%** (matters with ≥ 1 pick / total matters)
|
|
30
|
+
- **Pick-rate = 100%** (no-discrimination signal — see "no-discrimination case" below)
|
|
31
|
+
- **Concentration heuristic**: a single matter holds ≥ 60% of the picks while the problem statement spans multiple distinct concerns
|
|
32
|
+
|
|
33
|
+
If none hold, the user's scope intent is already obvious; don't add a check. Continue to Step 7.5.
|
|
34
|
+
|
|
35
|
+
###### Signal mapping
|
|
36
|
+
|
|
37
|
+
Before surfacing the prompt, the agent maps which problem-statement concerns are covered by the picks. Concerns are derived from the problem statement's noun-phrases (loose keyword-match against matter names is sufficient for MVP; LLM-rated mapping is a follow-up). For each unpicked matter, identify which problem-statement concern(s) it represents.
|
|
38
|
+
|
|
39
|
+
Output the analysis in plain language — three paragraphs (data → qualitative pattern → gap statement). Em-dash separating stats reads better than parenthetical. Example with real numbers (from the django-oscar GDPR exploration testing):
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
You picked 8 of 73 questions across 4 of 8 matters — an 11% pick-rate
|
|
43
|
+
with 50% matter coverage.
|
|
44
|
+
|
|
45
|
+
Your picks concentrate on the structural foundation: what the data is,
|
|
46
|
+
where it lives, immutability, and retention categories.
|
|
47
|
+
|
|
48
|
+
Your problem statement also mentions erasure mechanics, scheduled cleanup
|
|
49
|
+
jobs, DSAR APIs, and audit observability. Those areas are currently
|
|
50
|
+
unpicked.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The **dominant theme phrase** ("structural foundation: what the data is, where it lives, immutability, and retention categories" in the example) is computed once here and reused in Option 1's prompt below — that keeps the user's decision concrete instead of abstract.
|
|
54
|
+
|
|
55
|
+
###### The 4-option prompt (plain language only — no score previews)
|
|
56
|
+
|
|
57
|
+
Reuse the dominant-theme phrase from the analysis paragraph in Option 1 so the user reads the *narrowed scope* in product terms before deciding, not after.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
How should I treat the unpicked areas?
|
|
61
|
+
|
|
62
|
+
1. Out of scope — tighten the problem statement around {dominant theme
|
|
63
|
+
from analysis paragraph: e.g. "data structure, storage, immutability,
|
|
64
|
+
and retention categories"}.
|
|
65
|
+
Unpicked concerns are dropped from the current HMW.
|
|
66
|
+
|
|
67
|
+
2. Later phase — keep the broad scope, but mark unpicked matters as
|
|
68
|
+
phase-2 candidates surfaced in the build brief.
|
|
69
|
+
Use this when the unpicked work depends on the picked foundation
|
|
70
|
+
being settled first.
|
|
71
|
+
|
|
72
|
+
3. Open questions — keep the broad scope and treat unpicked areas as
|
|
73
|
+
context debt to revisit.
|
|
74
|
+
|
|
75
|
+
4. Pick more — return to Step 7.3 and add picks before continuing.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Copy notes:**
|
|
79
|
+
- "the current HMW" (not "the HMW") — Branch 1 is present-cycle, not permanent. Reduces commitment-anxiety.
|
|
80
|
+
- "treat unpicked areas as context debt" (not "Unpicked counts as context debt") — grammatical, less terse.
|
|
81
|
+
- Option 2's "Use this when..." stays as a separate declarative sentence — less leading than a parenthetical, but still teaches the right sequencing intuition.
|
|
82
|
+
- Option 4 uses "return to" not "loop back to" — cleaner agent voice.
|
|
83
|
+
|
|
84
|
+
###### Per-branch handlers
|
|
85
|
+
|
|
86
|
+
**Branch 1 — Out of scope (tighten):**
|
|
87
|
+
1. Mark all unpicked questions across all matters as `dropped`.
|
|
88
|
+
2. Call `mcp__ritual__refine_problem_statement` with `change_prompt`: *"Narrow the scope to focus only on {comma-joined matter names of picked matters}. Drop concerns related to {comma-joined names of dropped matters}."*
|
|
89
|
+
3. Emit post-choice pulse — **reuse the same dominant-theme phrase** that appeared in the analysis paragraph + Option 1's prompt, so the user sees their choice acknowledged in the exact words they read:
|
|
90
|
+
```
|
|
91
|
+
✓ Tightened the problem statement around {dominant theme — same phrase as analysis paragraph + Option 1 prompt}.
|
|
92
|
+
Pulse: {readiness}% readiness · {debt}% debt · +{delta}% (feature clarity ↑ from narrower scope)
|
|
93
|
+
```
|
|
94
|
+
Concrete example matching the django-oscar GDPR exploration: *"✓ Tightened the problem statement around data structure, storage, immutability, and retention categories."* — names what survived, not abstract *"the structural picks"*.
|
|
95
|
+
|
|
96
|
+
**Branch 2 — Later phase (defer):**
|
|
97
|
+
1. Mark all unpicked questions across all matters as `deferred`.
|
|
98
|
+
2. No problem statement change (broad scope preserved).
|
|
99
|
+
3. Emit post-choice pulse — **note the second-field label is `deferred`, not `debt`**:
|
|
100
|
+
```
|
|
101
|
+
✓ {N} unpicked questions marked as phase-2 candidates.
|
|
102
|
+
Pulse: {readiness}% readiness · {deferred}% deferred · +{delta}% (decision resolution ↑ from deliberate deferral)
|
|
103
|
+
```
|
|
104
|
+
The `deferred` label (instead of `debt`) is load-bearing — deliberate sequencing is NOT a liability, and the pulse line should reflect that. Same number, different character.
|
|
105
|
+
4. At Step 10c (build brief generation), the deferred matters MUST appear in the brief's *"Phase Candidates / Deferrable Items"* section. The agent appends the `deferred[]` set to the `generate_build_brief` `recon_context` payload as supplementary "explicit phase-2 candidates set by the user during discovery." The main `recon_context` payload remains the `codebase_context_packet`.
|
|
106
|
+
|
|
107
|
+
**Branch 3 — Open questions (debt):**
|
|
108
|
+
1. Mark all unpicked questions as `unreviewed` (their default state — no change).
|
|
109
|
+
2. No problem statement change.
|
|
110
|
+
3. Emit post-choice pulse — uses the `debt` label:
|
|
111
|
+
```
|
|
112
|
+
✓ {N} unpicked questions marked as context debt.
|
|
113
|
+
Pulse: {readiness}% readiness · {debt}% debt · +0% (open questions remain unresolved)
|
|
114
|
+
```
|
|
115
|
+
Avoid words like *"status quo"* — phrase it as a state, not a non-event.
|
|
116
|
+
4. The next `/ritual context-pulse` will surface the unresolved questions as top debt sources.
|
|
117
|
+
|
|
118
|
+
**Branch 4 — Pick more (loop):**
|
|
119
|
+
1. No status change.
|
|
120
|
+
2. No pulse.
|
|
121
|
+
3. Surface the unpicked matters in a numbered list grouped by matter:
|
|
122
|
+
```
|
|
123
|
+
Returning to question picking. Unpicked matters and questions:
|
|
124
|
+
|
|
125
|
+
M5 — Erasure Anonymization Contract (10 questions)
|
|
126
|
+
M6 — Scheduled Cleanup Idempotency (8 questions)
|
|
127
|
+
M7 — DSAR Attribution Interfaces (9 questions)
|
|
128
|
+
M8 — Compliance Audit Observability (8 questions)
|
|
129
|
+
|
|
130
|
+
Pick any subset. Same per-matter accept flow as Step 7.4.
|
|
131
|
+
```
|
|
132
|
+
4. After new picks land, re-evaluate the trigger conditions. If still met, fire 7.4.5 again. Otherwise proceed to 7.5.
|
|
133
|
+
|
|
134
|
+
###### The no-discrimination case (100% pick-rate)
|
|
135
|
+
|
|
136
|
+
If trigger fired because pick-rate = 100% (user picked every question), the prompt shape is gentler — there's no "unpicked areas" to classify. Instead:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
You picked everything (73/73 questions).
|
|
140
|
+
|
|
141
|
+
That may mean every question is genuinely relevant — the breadth is real.
|
|
142
|
+
Or it may mean we haven't narrowed the investigation yet. Pick one:
|
|
143
|
+
|
|
144
|
+
1. Proceed broadly — run all questions through the agentic pipeline. The
|
|
145
|
+
build brief will be wide; recommendations cover everything.
|
|
146
|
+
|
|
147
|
+
2. Sharper first pass — let me suggest 5-10 highest-leverage questions
|
|
148
|
+
that would give you the most signal per LLM call. The rest become
|
|
149
|
+
phase-2 candidates.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If user picks (1): proceed silently to Step 7.5. No pulse change.
|
|
153
|
+
If user picks (2): agent ranks the 73 questions by leverage (LLM call OR heuristic: questions earlier in each matter tend to be foundational), surfaces the top 5-10, user re-confirms picks, others become `deferred`. Fall back to Branch 2's behavior.
|
|
154
|
+
|
|
155
|
+
###### Two-score model in the pulse (CP3 update)
|
|
156
|
+
|
|
157
|
+
Once Step 7.4.5 has run, the `/ritual context-pulse` Step CP3 formula reads from the typed-status counts:
|
|
158
|
+
|
|
159
|
+
- **Decision Resolution (current scope):** `picked / (picked + unreviewed)`. Excludes `deferred` + `dropped`. Reaches near-100% if the user classified everything (picked, deferred, or dropped) — judgment rewarded.
|
|
160
|
+
- **Total-problem Coverage:** `(picked + deferred + dropped) / total`. Shows how much of the original surfaced space has been *classified at all*, regardless of how. Surfaces in the full pulse as an annotation; `unreviewed` count is the implicit debt.
|
|
161
|
+
|
|
162
|
+
Compact pulse continues to lead with the single readiness · {debt|deferred} · delta line per the per-branch templates above. Full pulse adds the breakdown:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Reasoning readiness: 72%
|
|
166
|
+
Context debt: 12% (4 questions unreviewed)
|
|
167
|
+
Context deferred: 16% (12 questions phase-2 candidates)
|
|
168
|
+
Context surface: Recommendation-ready
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
When `Context deferred` is zero, omit that line (CLI Tenet #6 — silence on no-data).
|
|
172
|
+
|
|
173
|
+
###### After Step 7.4.5 completes
|
|
174
|
+
|
|
175
|
+
Continue to Step 7.5 (anti-goals capture) per the existing flow.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
## /ritual lineage
|
|
2
|
+
|
|
3
|
+
**"Show me the history on these files."** The user gives the agent a file path (or a directory, or a set of paths) and the agent surfaces every prior exploration, recommendation, decision, and deferral that touched those files — pulled from the workspace's knowledge graph.
|
|
4
|
+
|
|
5
|
+
Output: a per-file timeline of decisions + deferrals + the explorations they came from, with PR numbers + dates + status snapshots. The user reads this **before** they make code changes to avoid re-litigating a settled decision or re-introducing a known deferral.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### When to use
|
|
9
|
+
|
|
10
|
+
- Engineer is about to touch a file they don't know the history of — *"who's been here? what did they decide? what did they punt?"*
|
|
11
|
+
- Code review: reviewer wants to know the lineage of a suggested change.
|
|
12
|
+
- Onboarding: new engineer wants to understand why a module exists in its current shape.
|
|
13
|
+
- Pre-implementation: planning a refactor; want to surface deferrals that might block the new approach.
|
|
14
|
+
|
|
15
|
+
When **not** to use:
|
|
16
|
+
- The user wants to start a new exploration → that's `/ritual build`.
|
|
17
|
+
- The user wants a workspace-wide tour (no specific files in mind) → just ask the agent in plain English; the codebase + KG are reachable via the standard MCP read tools (`list_explorations`, `query_knowledge_graph`, etc.).
|
|
18
|
+
|
|
19
|
+
### Input shapes
|
|
20
|
+
|
|
21
|
+
The lineage flow accepts paths several ways — pick the one that best matches what the user provided:
|
|
22
|
+
|
|
23
|
+
| What the user gave you | What to do |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `lineage src/checkout/views.py` | Single explicit file path |
|
|
26
|
+
| `lineage src/checkout/views.py src/oscar/apps/order/models.py` | Multiple explicit paths |
|
|
27
|
+
| `lineage src/checkout/` | Directory — `Glob` it for source files (cap at ~20 to keep the query bounded) |
|
|
28
|
+
| `lineage` (no arg) | **Infer from context.** Use, in order: (a) files the user has been discussing this session, (b) files in their most recent `git diff HEAD~1..HEAD` or `git status`, (c) ask the user explicitly |
|
|
29
|
+
| `lineage <pasted file contents>` | The user pasted code, not a path. Try `Grep` for a unique-looking signature line to locate the file, OR ask which file it's from |
|
|
30
|
+
|
|
31
|
+
For the "no arg" case, surface what you're going to query before you query it:
|
|
32
|
+
|
|
33
|
+
> I'll look up lineage on these files (from your recent edits):
|
|
34
|
+
> - `src/checkout/views.py`
|
|
35
|
+
> - `src/oscar/apps/order/models.py`
|
|
36
|
+
> - `src/oscar/apps/order/utils.py`
|
|
37
|
+
>
|
|
38
|
+
> Proceed? **(y / change the list / abort)**
|
|
39
|
+
|
|
40
|
+
CLI Tenet #2 — one recommended action, single escape hatch.
|
|
41
|
+
|
|
42
|
+
### Workflow
|
|
43
|
+
|
|
44
|
+
#### Step L1 — Resolve files
|
|
45
|
+
|
|
46
|
+
Given the user's input shape, produce a final `sources[]` array of file paths. Normalize relative-to-repo-root (the KG stores paths that way).
|
|
47
|
+
|
|
48
|
+
If the list ends up empty (e.g. directory glob matched nothing, or the user's pasted code can't be located): surface a clear message and exit — *"I couldn't resolve any files to look up. Try giving me an explicit path."*
|
|
49
|
+
|
|
50
|
+
#### Step L2 — Query the knowledge graph
|
|
51
|
+
|
|
52
|
+
Call `mcp__ritual__query_knowledge_graph(workspace_id, sources=[paths])`. This is the same tool `/ritual build`'s Steps 4 / 5 / 10 use for KG injection — the difference here is the user-facing output is the QUERY RESULT, not silent priorContext.
|
|
53
|
+
|
|
54
|
+
The response shape includes:
|
|
55
|
+
- `decisions[]` — each with `area`, `choice`, `sourceRecommendationId`, `recommendationStatusAtImplementation`, `relatedFiles[]`, `createdAt`, `explorationId`, `explorationName`, `prNumber`/`prUrl` (from the linked `ImplementationRecord`)
|
|
56
|
+
- `deferrals[]` — each with `rbId`, `description`, `severity`, `reason`, `relatedFiles[]`, `createdAt`, `explorationId`, `explorationName`, `status` (open / addressed / dismissed)
|
|
57
|
+
- `implementationCount` — totals per file (handy for the summary line)
|
|
58
|
+
|
|
59
|
+
Read-tier, no LLM cost. Snappy (single DB query).
|
|
60
|
+
|
|
61
|
+
#### Step L3 — Render the per-file timeline
|
|
62
|
+
|
|
63
|
+
Start with a compact summary header:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Lineage found for {files_with_lineage}/{total_files} files:
|
|
67
|
+
- {D} decisions
|
|
68
|
+
- {F} open deferrals
|
|
69
|
+
- {I} prior implementations
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Omit any zero-valued line except when all counts are zero.
|
|
73
|
+
|
|
74
|
+
For each file in `sources[]`, render a compact timeline:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
src/oscar/apps/checkout/views.py
|
|
78
|
+
· 2026-05-12 — Decision: gateway-form branching (RB-6)
|
|
79
|
+
from "Guest checkout → registration attribution"
|
|
80
|
+
PR #5012 · status when shipped: approved
|
|
81
|
+
· 2026-04-28 — Deferral: rate-limit per-tenant [major]
|
|
82
|
+
from "Multi-tenant rate limiting"
|
|
83
|
+
Open · 14 days old · "out of scope for v1; revisit when traffic >100req/s/tenant"
|
|
84
|
+
· 2026-03-15 — Decision: session-cookie checkout state
|
|
85
|
+
from "Anonymous checkout v1"
|
|
86
|
+
PR #4827 · status when shipped: approved
|
|
87
|
+
|
|
88
|
+
Touched by 1 open deferral · 2 logged decisions
|
|
89
|
+
|
|
90
|
+
src/oscar/apps/order/models.py
|
|
91
|
+
· 2026-04-30 — Decision: snapshot vs FK on order.user
|
|
92
|
+
from "Guest checkout → registration attribution"
|
|
93
|
+
PR #5012 · status when shipped: approved
|
|
94
|
+
|
|
95
|
+
Touched by 0 open deferrals · 1 logged decision
|
|
96
|
+
|
|
97
|
+
src/oscar/apps/order/utils.py
|
|
98
|
+
· (no lineage logged — this file hasn't been touched by a Ritual exploration yet)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Rules for the output (CLI Tenets #1, #3, #6):
|
|
102
|
+
|
|
103
|
+
- **Sort each file's events newest-first.** Engineers care most about the latest decision.
|
|
104
|
+
- **One-line-per-event in the listing**, with a 1-line "rationale" or "reason" subline only when present and short. Don't paste full RB descriptions inline — surface the headline and let the user drill in if they want.
|
|
105
|
+
- **Cap each file at the 5 most recent events.** If there are more, add a footer: *"… 8 more events on this file. Drill in? (y/N)"*. Surface only on user request.
|
|
106
|
+
- **Silence on no-data per file** — if a file has zero events, emit one line acknowledging that (so the user knows the file was checked, not skipped). Don't render empty event lists.
|
|
107
|
+
- **Highlight open deferrals.** They're the actionable signal: code about to be changed may collide with something the prior exploration explicitly deferred.
|
|
108
|
+
|
|
109
|
+
If `kgContextUsed.implementationCount === 0` across all files (no lineage anywhere), say so plainly and exit:
|
|
110
|
+
|
|
111
|
+
> No lineage found for these files in this workspace.
|
|
112
|
+
>
|
|
113
|
+
> Likely reasons:
|
|
114
|
+
> - These files have not gone through Ritual yet.
|
|
115
|
+
> - Prior work was not synced with `sync_implementation`.
|
|
116
|
+
>
|
|
117
|
+
> Next: proceed normally, or start `/ritual build` if this work should become part of workspace memory.
|
|
118
|
+
|
|
119
|
+
#### Step L4 — Single recommended next step
|
|
120
|
+
|
|
121
|
+
End with one cheap call-to-action (CLI Tenet #12). The right action depends on what the lineage showed:
|
|
122
|
+
|
|
123
|
+
| Lineage shape | Recommended next step |
|
|
124
|
+
|---|---|
|
|
125
|
+
| Open deferrals touching files the user is about to change | *"⚠ {N} open deferral{s} overlap your scope. Before you write code: want me to surface the full deferral context (`/ritual build` brief with `sources` set to these files)?"* |
|
|
126
|
+
| Decisions shipped recently (< 30 days) the user might collide with | *"Recent decisions on these files. Want me to fetch the full build brief from the source exploration? (it's still cached)"* |
|
|
127
|
+
| Old, stable decisions only | *"Lineage looks settled. Anything else, or are you good to proceed?"* |
|
|
128
|
+
| No lineage | *"Nothing on these files yet. Drag in different files or start a fresh `/ritual build` exploration if you want to log this work into the workspace."* |
|
|
129
|
+
|
|
130
|
+
### Tools used
|
|
131
|
+
|
|
132
|
+
Single-tool subcommand:
|
|
133
|
+
|
|
134
|
+
1. `mcp__ritual__query_knowledge_graph` (Step L2 — the whole flow hangs on this)
|
|
135
|
+
2. Agent filesystem tools (`Glob`, `Read`) for resolving directory inputs / pasted-code inputs in Step L1.
|
|
136
|
+
|
|
137
|
+
Optional onward calls if the user pivots to action (Step L4):
|
|
138
|
+
- `mcp__ritual__generate_build_brief` if they want the full brief with deferrals surfaced
|
|
139
|
+
- `mcp__ritual__get_exploration` if they want to drill into one of the source explorations
|
|
140
|
+
|
|
141
|
+
No new MCP tools required. `/ritual lineage` is a thin formatter over `query_knowledge_graph`.
|
|
142
|
+
|
|
143
|
+
### Relationship to `/ritual build`'s priorContext block
|
|
144
|
+
|
|
145
|
+
Same underlying data, opposite direction:
|
|
146
|
+
|
|
147
|
+
- **Inside `/ritual build`**: lineage flows in as *silent priorContext* — the LLM sees prior decisions + deferrals when synthesizing considerations / problem statement / build brief. The user never sees the raw KG query.
|
|
148
|
+
- **As `/ritual lineage`**: lineage IS the experience. The agent surfaces the raw KG query, formatted, to the user. No LLM synthesis on top.
|
|
149
|
+
|
|
150
|
+
When a user is mid-`/ritual build` and wants to drill into one of the prior implementations the brief mentioned, that's the natural moment to suggest: *"Want me to run `/ritual lineage` on these files for full context?"*
|
|
151
|
+
|
|
152
|
+
---
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
## /ritual resume
|
|
2
|
+
|
|
3
|
+
**"Pick up where I left off."** Promotes `/ritual build`'s Step 1.5 ("resume vs start") to a first-class command for users who already know they want to continue something, not start fresh.
|
|
4
|
+
|
|
5
|
+
Output: the user lands on the right step of an existing exploration's `/ritual build` flow — no new exploration created, no fresh-start path offered.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### When to use
|
|
9
|
+
|
|
10
|
+
- The user types `/ritual resume` with no args (the common case): they want to see their in-flight explorations and pick one.
|
|
11
|
+
- The user types `/ritual resume <exploration_id_or_name>`: they already know which one; jump straight to its right step.
|
|
12
|
+
- A user came back to the repo after time away and isn't sure what they had going.
|
|
13
|
+
|
|
14
|
+
When **not** to use:
|
|
15
|
+
- The user wants to start something new → that's `/ritual build`.
|
|
16
|
+
- The user wants to understand the workspace at a higher level (no specific exploration in mind) → just ask the agent in plain English (*"walk me through this workspace"* / *"trace the auth flow"*) — no slash-command needed.
|
|
17
|
+
|
|
18
|
+
### Workflow
|
|
19
|
+
|
|
20
|
+
#### Step R1 — Pick a workspace
|
|
21
|
+
|
|
22
|
+
Same as `/ritual build` Step 1. Project-pinned workspace from `.ritual/config.json` is preferred. If no pin and the user has multiple workspaces, ask which one.
|
|
23
|
+
|
|
24
|
+
If the workspace has **zero explorations**: tell the user politely and pivot.
|
|
25
|
+
|
|
26
|
+
> No in-flight explorations in this workspace yet. Want me to start a fresh one? **Run `/ritual build <your problem>`.**
|
|
27
|
+
|
|
28
|
+
End the flow here. Don't bounce them into `/ritual build` automatically — explicit user intent beats implicit handoff.
|
|
29
|
+
|
|
30
|
+
#### Step R2 — Surface in-flight explorations with state badges
|
|
31
|
+
|
|
32
|
+
Call `mcp__ritual__list_explorations(workspace_id)`. Sort by most-recently-updated. Drop archived. Cap at 5 in the user-facing summary.
|
|
33
|
+
|
|
34
|
+
If exactly one in-flight exploration is recent and clearly the likely target, lead with it instead of forcing a picker:
|
|
35
|
+
|
|
36
|
+
> Likely resume target:
|
|
37
|
+
> **{name}** — last touched {time}. Next: {natural-language next action}.
|
|
38
|
+
>
|
|
39
|
+
> Resume this? (Y/n, or `list`)
|
|
40
|
+
|
|
41
|
+
If there are multiple plausible targets, group by state badge and show:
|
|
42
|
+
|
|
43
|
+
> Here's what you have in flight in **{workspace.name}**:
|
|
44
|
+
>
|
|
45
|
+
> **📍 still in discovery** (1)
|
|
46
|
+
> - **{name}** — {first 80 chars of problemStatement}
|
|
47
|
+
> *Last touched {N} {days/hours} ago. Next: continue sub-problem generation.*
|
|
48
|
+
>
|
|
49
|
+
> **💬 waiting on admin to accept recommendations** (2)
|
|
50
|
+
> - **{name}** — {…}
|
|
51
|
+
> *Last touched {N} days ago. Next: admin reviews + accepts in Step 9.*
|
|
52
|
+
> - **{name}** — {…}
|
|
53
|
+
> *…*
|
|
54
|
+
>
|
|
55
|
+
> **✅ ready to implement** (1)
|
|
56
|
+
> - **{name}** — {…}
|
|
57
|
+
> *Last touched {N} days ago. Next: generate the build brief.*
|
|
58
|
+
>
|
|
59
|
+
> **Which one do you want to resume? (give me the number/name, or "none" to exit)**
|
|
60
|
+
|
|
61
|
+
State badge → user-facing label + suggested next step (same table as `/ritual build` Step 1.5):
|
|
62
|
+
|
|
63
|
+
| Glyph | State | User-facing label | Jump to |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| 📍 | `in_progress` | "still in discovery" | Continue discovery |
|
|
66
|
+
| 💬 | `awaiting_admin` | "waiting on admin to accept recommendations" | Admin review |
|
|
67
|
+
| ✅ | `ready` | "ready to implement" | Generate the build brief |
|
|
68
|
+
| 🛠 | `in_flight` | "implementation in progress" | Refresh the build brief on remaining work |
|
|
69
|
+
| ✓ | `done` | "fully shipped" | Suggest `/ritual lineage` on the files OR `/ritual drift` (when shipped) to check for new changes since |
|
|
70
|
+
| ⚠ | `implemented_ahead` | "code shipped before admin acceptance" | Surface to user, ask admin to reconcile |
|
|
71
|
+
|
|
72
|
+
Silence on no-data (CLI Tenet #6): if a state bucket is empty, don't render it. Don't print "**🛠 implementation in progress** (0)".
|
|
73
|
+
|
|
74
|
+
#### Step R3 — Branch-existence sanity check (`done` / `in_flight` only)
|
|
75
|
+
|
|
76
|
+
Same as `/ritual build` Step 1.5 step 5's CLI Tenet #9 check. Before treating an exploration as ✓ done, verify the implementation record's branch / PR actually exists locally or remotely:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git rev-parse --verify "origin/${implementationRecord.branch}" 2>/dev/null \
|
|
80
|
+
|| gh pr view "${implementationRecord.prNumber}" --json state 2>/dev/null
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If neither resolves, surface as a single-action proposal:
|
|
84
|
+
|
|
85
|
+
> Note: per the KG this is shipped on `{branch}` (PR #{num}), but I don't see that branch in this repo or remote. The implementation record may be bootstrap/synthetic data.
|
|
86
|
+
>
|
|
87
|
+
> Treat as ready-to-implement-for-real? **(y/N, or tell me what's actually shipped)**
|
|
88
|
+
|
|
89
|
+
#### Step R3.5 — Implementation footprint check (`ready` / `in_flight` only)
|
|
90
|
+
|
|
91
|
+
The KG can't distinguish "brief generated, no code yet" from "implementation done but not yet synced" from "implementation was started and then dropped." All three look like state `ready` (or `in_flight`) because no `ImplementationRecord` row exists yet — that's only written on `sync_implementation`.
|
|
92
|
+
|
|
93
|
+
When the KG asserts `ready` or `in_flight`, do a **footprint check** using the `Ritual-Exploration: <id>` commit trailer mandated by Tenet #14 (Step 11.2). The trailer is a stable anchor in git history that survives branch deletion (lives in reflog for ~30 days) and persists across machines via push.
|
|
94
|
+
|
|
95
|
+
Run these probes:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Probe A — any commits anywhere in this repo's git history attributed to this exploration?
|
|
99
|
+
git log --all --grep="Ritual-Exploration: ${exploration_id}" --oneline 2>/dev/null
|
|
100
|
+
|
|
101
|
+
# Probe B — the heuristic feature-branch from Step 11.0 (try both naming conventions)
|
|
102
|
+
git rev-parse --verify "feat/${exploration_slug}" 2>/dev/null
|
|
103
|
+
git rev-parse --verify "ritual/${exploration_short_id}" 2>/dev/null
|
|
104
|
+
git rev-parse --verify "origin/feat/${exploration_slug}" 2>/dev/null
|
|
105
|
+
|
|
106
|
+
# Probe C — any PR (open, closed, or merged) attributed to this exploration?
|
|
107
|
+
gh pr list --search "Ritual-Exploration: ${exploration_id}" --state all --json number,state,title,headRefName,mergedAt 2>/dev/null
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Cross-reference findings against the KG state:
|
|
111
|
+
|
|
112
|
+
| KG state | Footprint found | What happened | What to surface |
|
|
113
|
+
|---|---|---|---|
|
|
114
|
+
| `ready` | None | User hasn't started coding | "Brief ready, no code yet. Pick up at Step 11 (Implement)?" |
|
|
115
|
+
| `ready` | Branch + commits with trailer | Mid-implementation, unsynced | "I see {N} commits on `{branch}` attributed to this exploration. Continue coding, run the gate, or `sync_implementation` now?" |
|
|
116
|
+
| `ready` | Open PR with trailer | PR open, awaiting review/merge | "PR #{N} is open ({state}, {head_ref}). Wait for merge, or sync the current state of the branch?" |
|
|
117
|
+
| `ready` | Merged PR with trailer, no impl record | PR merged but `sync_implementation` was skipped | "PR #{N} merged on {date} but `sync_implementation` was never called. Want me to sync from the PR now? *(this is the `/ritual sync <pr-url>` backlog flavor — for now, walk the user through Step 12 manually using the PR's commits + decisions.)*" |
|
|
118
|
+
| `ready` | **Only orphan commits in `git log --all` (no live branch / no live PR)** | **Work was dropped — branch deleted, reset, or stashed-then-discarded** | "⚠ I see {N} commits attributed to this exploration in your git history from {N} days ago, but the branch is gone and no PR was opened. Looks like the implementation was started and dropped. Want me to: **(a)** show you the orphan commits so you can recover them (`git cherry-pick`), OR **(b)** start fresh implementation from the brief?" |
|
|
119
|
+
| `in_flight` | Branch + commits match KG `branch` field | Implementation in progress (normal mid-loop state) | Continue per the state badge's suggested next step (refresh brief on remaining work). |
|
|
120
|
+
| `in_flight` | KG says branch X, but Probe B says different branch Y carries the commits | Branch was renamed/rebased after KG was last updated | "KG says `{x}` but I see Ritual-attributed commits on `{y}`. Update the KG branch name, or use `{y}` for the rest of this flow?" |
|
|
121
|
+
|
|
122
|
+
**The dropped-work case (row 5) is the load-bearing one.** Without this check, the user re-runs `/ritual build` and the agent silently regenerates the brief, never telling the user they lost a day of work that's still recoverable from the reflog.
|
|
123
|
+
|
|
124
|
+
**Skip the probes when:**
|
|
125
|
+
|
|
126
|
+
- The exploration was just created in this same session — no time to have orphan commits.
|
|
127
|
+
- The user just synced (the `done` / `in_flight` state badge was set within the last few minutes).
|
|
128
|
+
- The exploration is in a state where the footprint check doesn't apply (`in_progress`, `awaiting_admin`, `implemented_ahead`).
|
|
129
|
+
|
|
130
|
+
#### Step R4 — Jump to the right `/ritual build` step
|
|
131
|
+
|
|
132
|
+
Once the user picks (and the sanity check passes), invoke the `/ritual build` flow internally with `exploration_id` set and skip ahead to the step the badge maps to. **Don't re-prompt for workspace, template, scope, considerations, or problem statement** — that work already exists on the exploration.
|
|
133
|
+
|
|
134
|
+
End the flow with the same "next step" prompt `/ritual build` would have at that step. The user sees `/ritual resume` as a thin shortcut; behind the scenes it just teleports them into `/ritual build`'s middle.
|
|
135
|
+
|
|
136
|
+
### Tools used
|
|
137
|
+
|
|
138
|
+
Read-tier subset of `/ritual build`'s tools:
|
|
139
|
+
|
|
140
|
+
1. `mcp__ritual__list_workspaces` (R1, fallback only)
|
|
141
|
+
2. `mcp__ritual__list_explorations` (R2 — the core read)
|
|
142
|
+
3. `mcp__ritual__get_exploration` (R3, to fetch the `implementationRecord` for the branch check)
|
|
143
|
+
4. Whatever `/ritual build` would use from the jump-in step onward (R4)
|
|
144
|
+
|
|
145
|
+
No new MCP tools required. `/ritual resume` is a thin orchestration over what already exists.
|
|
146
|
+
|
|
147
|
+
### Relationship to `/ritual build` Step 1.5
|
|
148
|
+
|
|
149
|
+
They share the same logic. The difference is **user intent at invocation time**:
|
|
150
|
+
|
|
151
|
+
- `/ritual build` is "I'm starting something" — Step 1.5 is a *check* ("oh wait, you might already have this") before going further.
|
|
152
|
+
- `/ritual resume` is "I'm continuing something" — there's no fresh-start path; if the user really wants fresh, they exit and run `/ritual build`.
|
|
153
|
+
|
|
154
|
+
Result: the same MCP calls, the same state-badge table, but different framing for the user. Two clear front doors instead of one ambiguous one.
|
|
155
|
+
|
|
156
|
+
---
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Context pulse fallback scoring reference
|
|
2
|
+
|
|
3
|
+
Loaded only if `mcp__ritual__score_context_pulse` is unavailable, errors, or the MCP server is older than the canonical scoring API. Server-side scoring remains authoritative for new pulses.
|
|
4
|
+
|
|
5
|
+
#### Step CP3 — Compute the dimensions (fallback only)
|
|
6
|
+
|
|
7
|
+
Skip this step when the preferred path (CP2 — `score_context_pulse`) succeeded — the server returns identical dimension scores. This is the specification for the **fallback path** and the canonical reference for what the server-side scoring engine computes.
|
|
8
|
+
|
|
9
|
+
Use this deterministic table. Each dimension scores 0–100; final score is the weighted sum.
|
|
10
|
+
|
|
11
|
+
**Scoring model versions:**
|
|
12
|
+
|
|
13
|
+
- **v1 (MVP-1 / MVP-2 PR 1)** — 4 dimensions: Feature Clarity 30%, Decision Resolution 30%, Repo Grounding 25%, Assumption Safety 15%.
|
|
14
|
+
- **v2 (MVP-2 PR 2, current canonical)** — 6 dimensions, repo split + assumption reframe + validation readiness added. Weights below.
|
|
15
|
+
|
|
16
|
+
The server returns `dimensionsVersion` on every pulse so callers know which shape they're reading. Old pulses retain their original version; new pulses use the current canonical model.
|
|
17
|
+
|
|
18
|
+
##### Feature Clarity — 25% (kept across versions)
|
|
19
|
+
|
|
20
|
+
| Signal (parse the exploration's `problemStatement`) | Points |
|
|
21
|
+
|---|---:|
|
|
22
|
+
| Problem statement is non-empty + ≥ 50 chars | 20 |
|
|
23
|
+
| Actor / target user is named (heuristic: pronouns like "user", "admin", "engineer", or a named role) | 15 |
|
|
24
|
+
| Desired behavior is described (verb phrase like "export", "view", "configure") | 15 |
|
|
25
|
+
| Acceptance criteria are present (heuristic: bulleted "should" / "must" / "given/when/then") | 25 |
|
|
26
|
+
| Non-goals or constraints are present | 10 |
|
|
27
|
+
| Edge cases are mentioned | 10 |
|
|
28
|
+
| Success metric is mentioned (numbers, time bounds, error rates) | 5 |
|
|
29
|
+
|
|
30
|
+
##### Decision Resolution — 20% (kept across versions; weight reduced from 30%)
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
score = (accepted_recs / total_recs) × 60
|
|
34
|
+
+ (picked_questions / (picked_questions + unreviewed_questions)) × 40
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The discovery component uses the **typed-status formula** introduced in Step 7.4.5: a question that's `picked` is "in active investigation"; `deferred` is "deliberate phase-2"; `dropped` is "removed from scope"; `unreviewed` is the only one that counts toward unresolved. `deferred + dropped` are EXCLUDED from the denominator — they represent decisions the user made, not unresolved ambiguity.
|
|
38
|
+
|
|
39
|
+
Fallbacks: `total_recs === 0` → use only the discovery component scaled to 100. `total_questions === 0` → use only the rec component scaled to 100. Both zero → score 0.
|
|
40
|
+
|
|
41
|
+
##### Code Grounding — 15% (v2 — split from Repo Grounding)
|
|
42
|
+
|
|
43
|
+
| Signal | Points |
|
|
44
|
+
|---|---:|
|
|
45
|
+
| `sources[]` array on the exploration is non-empty (≥ 3 paths) | 25 |
|
|
46
|
+
| ≥ 5 paths (deeper recon) | 15 |
|
|
47
|
+
| `query_knowledge_graph(sources).implementationCount > 0` (prior impls touch overlapping files) | 30 |
|
|
48
|
+
| Decisions logged on overlapping files (KG `decisions[]` non-empty) | 20 |
|
|
49
|
+
| Deferrals on overlapping files surfaced (KG `deferrals[]` returned) | 10 |
|
|
50
|
+
|
|
51
|
+
##### Reference Grounding — 10% (v2 — split from Repo Grounding)
|
|
52
|
+
|
|
53
|
+
| Signal | Points |
|
|
54
|
+
|---|---:|
|
|
55
|
+
| `mcp__ritual__list_knowledge_sources` returns ≥ 1 KnowledgeSource attached | 25 per ref, cap 75 (3 refs) |
|
|
56
|
+
| At least one ref has `extractionStatus = COMPLETED` (Pass 1 snippets exist; the source is queryable) | +25 |
|
|
57
|
+
|
|
58
|
+
Lower weight than Code Grounding because a single high-quality PRD gets the user to a meaningful baseline; diminishing returns past 3 since more refs add review surface area without making the feature clearer.
|
|
59
|
+
|
|
60
|
+
##### Assumption Load — 10% (v2 — reframed from Assumption Safety)
|
|
61
|
+
|
|
62
|
+
**Inverted semantic: HIGH = MORE assumptions (worse).** The readiness composer uses `(100 - load)` internally so the weighted sum stays "high readiness = good." Inversion is intentional — load is what the user can act on (reduce it), whereas "safety" was passive.
|
|
63
|
+
|
|
64
|
+
User-facing render rule: never show Assumption Load as a positive progress bar without labeling that lower is better. Prefer `Assumption load: 30% (lower is better)` or render the inverted readiness contribution instead. Do not make a higher Assumption Load visually look like progress.
|
|
65
|
+
|
|
66
|
+
| Signal | Load |
|
|
67
|
+
|---|---:|
|
|
68
|
+
| No anti-goals declared at all | 80 base |
|
|
69
|
+
| 1–2 anti-goals (some explicit boundaries) | 50 base |
|
|
70
|
+
| 3+ anti-goals (boundaries are mapped) | 20 base |
|
|
71
|
+
| Each assumption-flag word in the problem statement: `assume`, `assuming`, `presumably`, `probably`, `should be`, `expected to` | +5 each, cap +20 |
|
|
72
|
+
|
|
73
|
+
##### Validation Readiness — 20% (v2 — NEW)
|
|
74
|
+
|
|
75
|
+
Testability. Can an engineer reading this know how to verify success? This dimension catches problem statements that sound clear but leave acceptance ambiguous.
|
|
76
|
+
|
|
77
|
+
| Signal (parse `problemStatement`) | Points |
|
|
78
|
+
|---|---:|
|
|
79
|
+
| AC bullets (should/must/given-when-then) | 25 |
|
|
80
|
+
| Quantitative success metric (%, ms, p95, etc.) | 25 |
|
|
81
|
+
| Explicit expected output / response shape (`returns`, `renders`, `output`, `format`, `schema`) | 20 |
|
|
82
|
+
| Failure / error mode handling (`rollback`, `retry`, `abort`, `failure`, `timeout`, `crash`) | 15 |
|
|
83
|
+
| Edge case enumeration (`edge case`, `never`, `already`, `missing`, `conflict`, `partial`) | 15 |
|
|
84
|
+
|
|
85
|
+
**Contradiction Risk** is reserved for MVP-2 PR 3 (`--explain` flag) — it requires an LLM call in the hot path, which is intentionally outside the deterministic guarantee of CP3.
|
|
86
|
+
|
|
87
|
+
#### Step CP4 — Compose the final score
|
|
88
|
+
|
|
89
|
+
**v2 (current canonical):**
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
readiness = round(
|
|
93
|
+
0.25 × feature_clarity
|
|
94
|
+
+ 0.20 × decision_resolution
|
|
95
|
+
+ 0.15 × code_grounding
|
|
96
|
+
+ 0.10 × reference_grounding
|
|
97
|
+
+ 0.10 × (100 - assumption_load) ← inverted
|
|
98
|
+
+ 0.20 × validation_readiness
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
debt = 100 - readiness
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**v1 (legacy back-compat — only computed when scoring a v1 pulse for trend continuity):**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
readiness = round(
|
|
108
|
+
0.30 × feature_clarity
|
|
109
|
+
+ 0.30 × decision_resolution
|
|
110
|
+
+ 0.25 × repo_grounding
|
|
111
|
+
+ 0.15 × assumption_safety
|
|
112
|
+
)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The server populates BOTH sets of typed columns + the canonical `breakdown` JSON on every v2 write, so analytics queries against the legacy columns still work.
|
|
116
|
+
|
|
117
|
+
State tier lookup:
|
|
118
|
+
|
|
119
|
+
| Readiness | State | Recommended next action |
|
|
120
|
+
|---:|---|---|
|
|
121
|
+
| 0–30 | Raw ask | Frame the problem first. |
|
|
122
|
+
| 30–55 | Under-specified | Run discovery. |
|
|
123
|
+
| 55–75 | Exploration-safe | Get to recommendations. Don't implement yet. |
|
|
124
|
+
| 75–90 | Recommendation-ready | Generate the build brief, then implement. |
|
|
125
|
+
| 90+ | Implementation-ready | Safe to code. |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Ritual skill design notes
|
|
2
|
+
|
|
3
|
+
This file is for humans reviewing or maintaining the Ritual skill. Runtime instructions live in `SKILL.md` and `references/*.md`.
|
|
4
|
+
|
|
5
|
+
## Product intent
|
|
6
|
+
|
|
7
|
+
Ritual helps coding agents avoid jumping straight into implementation when the feature depends on context the agent cannot infer on its own: strategic intent, constraints, prior decisions, trade-offs, and non-obvious scope boundaries.
|
|
8
|
+
|
|
9
|
+
The workflow surfaces that context through targeted discovery questions, combines it with codebase signals and prior explorations, and produces a validated build brief before code is written.
|
|
10
|
+
|
|
11
|
+
## Why split the skill
|
|
12
|
+
|
|
13
|
+
The previous monolithic `SKILL.md` mixed runtime instructions with design rationale, fallback formulas, version history, and long branch handlers. That made it harder for an agent to follow the right path at runtime.
|
|
14
|
+
|
|
15
|
+
The split version keeps:
|
|
16
|
+
|
|
17
|
+
- `SKILL.md` as a dispatcher/control plane
|
|
18
|
+
- `references/*` as runtime procedure files loaded only when needed
|
|
19
|
+
- `DESIGN.md` as rationale and maintenance notes
|
|
20
|
+
|
|
21
|
+
## Retired `/ritual recon`
|
|
22
|
+
|
|
23
|
+
`/ritual recon` is intentionally not part of the vNext command surface. Its former workspace-history value is covered by `/ritual resume`; its file-decision-history value is covered by `/ritual lineage`; and its repo-reading behavior is normal coding-agent behavior in plain English.
|
|
24
|
+
|
|
25
|
+
## Context packet principle
|
|
26
|
+
|
|
27
|
+
The coding agent should contribute local codebase understanding, but not decide final scope itself. After recon, it produces a `codebase_context_packet` containing facts, evidence, hypotheses, confidence, scope pressure, corrections, and open questions. MCP/tooling remains responsible for generating and ranking final sub-problems and scope.
|
|
28
|
+
|
|
29
|
+
## Context pulse principle
|
|
30
|
+
|
|
31
|
+
Context pulse answers: can a reasoning system act safely on this yet? The primary user-facing score is Reasoning Readiness; Context Debt is the inverse. Server-side scoring is canonical for new pulses. Fallback formulas are only for older MCP servers or error recovery.
|
|
32
|
+
|
|
33
|
+
## Host assumptions
|
|
34
|
+
|
|
35
|
+
Designed primarily for Claude Code-style coding-agent sessions with filesystem, git, shell, and MCP access. Adapt commands as needed for Cursor or other agents with equivalent tools.
|