@ritualai/cli 0.36.11 → 0.36.14
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/lite.js +102 -0
- package/dist/commands/lite.js.map +1 -0
- package/dist/commands/project.js +82 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agents/launch.js +21 -5
- package/dist/lib/agents/launch.js.map +1 -1
- package/dist/lib/okf-projection.js +118 -0
- package/dist/lib/okf-projection.js.map +1 -0
- package/dist/lib/worktree.js +87 -0
- package/dist/lib/worktree.js.map +1 -0
- package/package.json +1 -1
- package/skills/claude-code/ritual/.ritual-bundle.json +3 -3
- package/skills/claude-code/ritual/SKILL.md +1 -1
- package/skills/claude-code/ritual/references/build-flow.md +27 -1
- package/skills/claude-code/ritual/references/lite-flow.md +53 -2
- package/skills/codex/ritual/.ritual-bundle.json +3 -3
- package/skills/codex/ritual/SKILL.md +1 -1
- package/skills/codex/ritual/references/build-flow.md +27 -1
- package/skills/codex/ritual/references/lite-flow.md +53 -2
- package/skills/cursor/ritual/.ritual-bundle.json +3 -3
- package/skills/cursor/ritual/SKILL.md +1 -1
- package/skills/cursor/ritual/references/build-flow.md +27 -1
- package/skills/cursor/ritual/references/lite-flow.md +53 -2
- package/skills/gemini/ritual/.ritual-bundle.json +3 -3
- package/skills/gemini/ritual/SKILL.md +1 -1
- package/skills/gemini/ritual/references/build-flow.md +27 -1
- package/skills/gemini/ritual/references/lite-flow.md +53 -2
- package/skills/kiro/ritual/.ritual-bundle.json +3 -3
- package/skills/kiro/ritual/SKILL.md +1 -1
- package/skills/kiro/ritual/references/build-flow.md +27 -1
- package/skills/kiro/ritual/references/lite-flow.md +53 -2
- package/skills/vscode/ritual/.ritual-bundle.json +3 -3
- package/skills/vscode/ritual/SKILL.md +1 -1
- package/skills/vscode/ritual/references/build-flow.md +27 -1
- package/skills/vscode/ritual/references/lite-flow.md +53 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.liteCommand = liteCommand;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const colors_1 = require("../lib/colors");
|
|
6
|
+
const launch_1 = require("../lib/agents/launch");
|
|
7
|
+
const onboarding_state_1 = require("../lib/onboarding-state");
|
|
8
|
+
const prompt_1 = require("../lib/prompt");
|
|
9
|
+
const worktree_1 = require("../lib/worktree");
|
|
10
|
+
function repoRoot() {
|
|
11
|
+
try {
|
|
12
|
+
return (0, node_child_process_1.execSync)('git rev-parse --show-toplevel', { stdio: 'pipe', encoding: 'utf8' }).trim();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async function liteCommand(askParts, opts) {
|
|
19
|
+
const ask = (askParts ?? []).join(' ').trim();
|
|
20
|
+
const launchable = (0, launch_1.resolveLaunchableAgents)();
|
|
21
|
+
if (launchable.length === 0) {
|
|
22
|
+
console.log('');
|
|
23
|
+
console.log(` ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, 'The Ritual lite flow runs inside your coding agent.')}`);
|
|
24
|
+
console.log(' No terminal coding agent found (claude / agent / gemini / codex).');
|
|
25
|
+
console.log(' Install one, then re-run — or `ritual init` to wire up everything first.');
|
|
26
|
+
console.log('');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const picked = await pickAgent(launchable, opts.agent);
|
|
30
|
+
if (!picked)
|
|
31
|
+
return;
|
|
32
|
+
// ── autonomous discovery worktree ─────────────────────────────────────
|
|
33
|
+
if (opts.worktree) {
|
|
34
|
+
if (!ask) {
|
|
35
|
+
console.error(' ✗ `ritual lite --worktree` needs an ask: ritual lite "<feature>" --worktree');
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const root = repoRoot();
|
|
40
|
+
if (!root) {
|
|
41
|
+
console.error(' ✗ Not a git repo — a discovery worktree needs one. Run from inside the repo.');
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const wt = (0, worktree_1.createDiscoveryWorktree)(root, ask);
|
|
46
|
+
if (!wt.ok) {
|
|
47
|
+
console.error(` ✗ Couldn't create the discovery worktree: ${wt.error}`);
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log(` ${(0, colors_1.dim)('Discovery worktree')} ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, wt.branch)} ${(0, colors_1.dim)('→')} ${(0, colors_1.dim)(wt.worktreePath)}`);
|
|
53
|
+
console.log(` ${(0, colors_1.dim)('Running')} ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, picked.name)} ${(0, colors_1.dim)('autonomously to a build brief — no code, agent-authored.')}`);
|
|
54
|
+
console.log('');
|
|
55
|
+
process.exitCode = (0, launch_1.launchAgent)(picked, `/ritual lite --worktree ${ask}`, {
|
|
56
|
+
cwd: wt.worktreePath,
|
|
57
|
+
headless: true,
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// ── normal (attended) lite ────────────────────────────────────────────
|
|
62
|
+
console.log('');
|
|
63
|
+
console.log(` ${(0, colors_1.dim)('Launching')} ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, picked.name)} ${(0, colors_1.dim)('— the Ritual lite flow takes it from here.')}`);
|
|
64
|
+
console.log('');
|
|
65
|
+
process.exitCode = (0, launch_1.launchAgent)(picked, ask ? `/ritual lite ${ask}` : '/ritual lite');
|
|
66
|
+
}
|
|
67
|
+
async function pickAgent(launchable, forced) {
|
|
68
|
+
if (forced) {
|
|
69
|
+
const found = launchable.find((l) => l.providerId === forced);
|
|
70
|
+
if (!found) {
|
|
71
|
+
console.error(` ✗ Agent "${forced}" isn't launchable from this shell.`);
|
|
72
|
+
console.error(` Launchable here: ${launchable.map((l) => l.providerId).join(', ')}`);
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return found;
|
|
77
|
+
}
|
|
78
|
+
if (launchable.length === 1)
|
|
79
|
+
return launchable[0];
|
|
80
|
+
const state = (0, onboarding_state_1.readOnboardingState)();
|
|
81
|
+
const remembered = launchable.find((l) => l.providerId === state.preferredBuildAgent);
|
|
82
|
+
if (remembered)
|
|
83
|
+
return remembered;
|
|
84
|
+
if (!process.stdin.isTTY)
|
|
85
|
+
return launchable[0];
|
|
86
|
+
console.log('');
|
|
87
|
+
launchable.forEach((l, i) => console.log(` ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, `${i + 1}. ${l.name}`)}`));
|
|
88
|
+
console.log('');
|
|
89
|
+
let answer;
|
|
90
|
+
try {
|
|
91
|
+
answer = await (0, prompt_1.prompt)(` ${(0, colors_1.color)(colors_1.RITUAL_TEAL, '›')} press Enter to use ${launchable[0].name} — or pick a number: `);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
console.log('\n Cancelled.');
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const n = Number.parseInt(answer.trim(), 10);
|
|
98
|
+
const chosen = Number.isInteger(n) && n >= 1 && n <= launchable.length ? launchable[n - 1] : launchable[0];
|
|
99
|
+
(0, onboarding_state_1.updateOnboardingState)({ preferredBuildAgent: chosen.providerId });
|
|
100
|
+
return chosen;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=lite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lite.js","sourceRoot":"","sources":["../../src/commands/lite.ts"],"names":[],"mappings":";;AAsCA,kCAyDC;AA/FD,2DAA8C;AAC9C,0CAAmE;AACnE,iDAI8B;AAC9B,8DAAqF;AACrF,0CAAuC;AACvC,8CAA0D;AAqB1D,SAAS,QAAQ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mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.projectCommand = projectCommand;
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const api_client_1 = require("../lib/api-client");
|
|
10
|
+
const config_1 = require("../lib/config");
|
|
11
|
+
const colors_1 = require("../lib/colors");
|
|
12
|
+
const okf_projection_1 = require("../lib/okf-projection");
|
|
13
|
+
function repoRoot() {
|
|
14
|
+
try {
|
|
15
|
+
return (0, node_child_process_1.execSync)('git rev-parse --show-toplevel', { stdio: 'pipe', encoding: 'utf8' }).trim();
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return process.cwd();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function projectCommand(explorationId, opts) {
|
|
22
|
+
if (!explorationId) {
|
|
23
|
+
console.error(' ✗ Usage: ritual project <exploration-id> [--out <dir>]');
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const token = await (0, config_1.getValidAccessToken)();
|
|
28
|
+
if (token.kind === 'not-signed-in') {
|
|
29
|
+
console.error(' ✗ Not signed in. Run `ritual login` first.');
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (token.kind === 're-auth-required') {
|
|
34
|
+
console.error(` ✗ Session expired (${token.reason}). Run \`ritual login\` to re-auth.`);
|
|
35
|
+
process.exitCode = 1;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const api = new api_client_1.ApiClient({ issuer: token.creds.issuer, accessToken: token.accessToken });
|
|
39
|
+
const id = encodeURIComponent(explorationId);
|
|
40
|
+
let exploration;
|
|
41
|
+
let briefContent = null;
|
|
42
|
+
let scopeContract = null;
|
|
43
|
+
let recommendations = [];
|
|
44
|
+
try {
|
|
45
|
+
exploration = await api.get(`/explorations/${id}/status`);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
console.error(` ✗ Couldn't load exploration ${explorationId}: ${err.message}`);
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Brief + scope contract (best-effort — a brief may not exist yet).
|
|
53
|
+
try {
|
|
54
|
+
const brief = await api.get(`/explorations/${id}/build-brief`);
|
|
55
|
+
briefContent = brief?.content ?? null;
|
|
56
|
+
scopeContract = brief?.scopeContractResolved ?? null;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
/* no brief yet — projection still writes identity + recs */
|
|
60
|
+
}
|
|
61
|
+
// Recommendations (best-effort).
|
|
62
|
+
try {
|
|
63
|
+
recommendations = (await api.get(`/explorations/${id}/recommendations`)) ?? [];
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
recommendations = [];
|
|
67
|
+
}
|
|
68
|
+
const outDir = node_path_1.default.resolve(opts.out ?? node_path_1.default.join(repoRoot(), '.ritual'));
|
|
69
|
+
const data = {
|
|
70
|
+
exploration,
|
|
71
|
+
briefContent,
|
|
72
|
+
scopeContract,
|
|
73
|
+
recommendations,
|
|
74
|
+
generatedAt: new Date().toISOString(),
|
|
75
|
+
};
|
|
76
|
+
const written = (0, okf_projection_1.writeOkfProjection)(outDir, data);
|
|
77
|
+
console.log('');
|
|
78
|
+
console.log(` ${(0, colors_1.dim)('Projected')} ${(0, colors_1.boldColor)(colors_1.RITUAL_TEAL, exploration.name ?? explorationId)} ${(0, colors_1.dim)('→')} ${(0, colors_1.dim)(outDir)}`);
|
|
79
|
+
written.forEach((f) => console.log(` ${(0, colors_1.dim)('·')} .ritual/${f}`));
|
|
80
|
+
console.log('');
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/commands/project.ts"],"names":[],"mappings":";;;;;AA4BA,wCAw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I,CAAC,CAAC;IAEjD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACV,KAAK,IAAA,YAAG,EAAC,WAAW,CAAC,IAAI,IAAA,kBAAS,EAAC,oBAAW,EAAE,WAAW,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,IAAA,YAAG,EAAC,GAAG,CAAC,IAAI,IAAA,YAAG,EAAC,MAAM,CAAC,EAAE,CAC/G,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAA,YAAG,EAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ const whoami_1 = require("./commands/whoami");
|
|
|
9
9
|
const refresh_1 = require("./commands/refresh");
|
|
10
10
|
const init_1 = require("./commands/init");
|
|
11
11
|
const build_1 = require("./commands/build");
|
|
12
|
+
const lite_1 = require("./commands/lite");
|
|
13
|
+
const project_1 = require("./commands/project");
|
|
12
14
|
const doctor_1 = require("./commands/doctor");
|
|
13
15
|
const uninstall_1 = require("./commands/uninstall");
|
|
14
16
|
// 2026-05-15 (PR D) — `ritual status [--watch]` instant snapshot of
|
|
@@ -99,6 +101,25 @@ program
|
|
|
99
101
|
.option('--agent <id>', 'Launch a specific agent (claude-code, cursor, gemini, codex)')
|
|
100
102
|
.addHelpText('after', () => (0, help_style_1.ritualBuildExamplesHelp)())
|
|
101
103
|
.action(build_1.buildCommand);
|
|
104
|
+
// `ritual lite "<ask>" [--worktree]` — the fast / unattended counterpart.
|
|
105
|
+
// Plain: launches the agent with `/ritual lite <ask>` (fewer pauses).
|
|
106
|
+
// `--worktree`: spins a git worktree and runs `/ritual lite --worktree` HEADLESS
|
|
107
|
+
// in it — the autonomous discovery worktree (runs to a build brief, no code).
|
|
108
|
+
program
|
|
109
|
+
.command('lite [ask...]')
|
|
110
|
+
.description('Start a Ritual lite build (fewer pauses); --worktree runs autonomous discovery in a git worktree')
|
|
111
|
+
.option('--agent <id>', 'Launch a specific agent (claude-code, cursor, gemini, codex)')
|
|
112
|
+
.option('--worktree', 'Spin a git worktree and run autonomous discovery (to a build brief, no code) headless in it')
|
|
113
|
+
.action(lite_1.liteCommand);
|
|
114
|
+
// `ritual project <exploration-id>` — materialize an exploration's reasoning
|
|
115
|
+
// from the live graph into a `.ritual/` OKF projection (index + build-brief +
|
|
116
|
+
// scope-contract + recommendations + log). The discovery worktree calls this
|
|
117
|
+
// after the brief so the developer reads the reasoning as files on landing.
|
|
118
|
+
program
|
|
119
|
+
.command('project <exploration-id>')
|
|
120
|
+
.description('Project an exploration’s reasoning into a local .ritual/ tree (build brief, scope contract, recommendations)')
|
|
121
|
+
.option('--out <dir>', 'Output directory (default: <repo>/.ritual)')
|
|
122
|
+
.action(project_1.projectCommand);
|
|
102
123
|
const loginCmd = program
|
|
103
124
|
.command('login')
|
|
104
125
|
.description('Authenticate with Ritual via your browser')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,iDAAiF;AACjF,4CAAgD;AAChD,8CAAkD;AAClD,8CAAkD;AAClD,gDAAoD;AACpD,0CAA8C;AAC9C,4CAAgD;AAChD,8CAAkD;AAClD,oDAAwD;AACxD,oEAAoE;AACpE,kEAAkE;AAClE,kEAAkE;AAClE,oEAAoE;AACpE,iEAAiE;AACjE,iEAAiE;AACjE,6BAA6B;AAC7B,8CAAkD;AAClD,4CAAsD;AACtD,qDAA4D;AAC5D,kEAAkE;AAClE,oEAAoE;AACpE,+DAA+D;AAC/D,iEAAiE;AACjE,oEAAoE;AACpE,oEAAoE;AACpE,oCAAoC;AACpC,qEAAqE;AAErE,MAA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D;AACpD,IAAA,8CAAuB,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IACrD,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -10,12 +10,14 @@ exports.AGENT_LAUNCHERS = [
|
|
|
10
10
|
name: 'Claude Code',
|
|
11
11
|
bins: ['claude'],
|
|
12
12
|
args: (prompt) => [prompt],
|
|
13
|
+
headlessArgs: (prompt) => ['-p', prompt],
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
16
|
providerId: 'cursor',
|
|
16
17
|
name: 'Cursor CLI',
|
|
17
18
|
bins: ['agent', 'cursor-agent'],
|
|
18
19
|
args: (prompt) => [prompt],
|
|
20
|
+
headlessArgs: (prompt) => ['-p', prompt],
|
|
19
21
|
},
|
|
20
22
|
{
|
|
21
23
|
providerId: 'gemini',
|
|
@@ -24,12 +26,14 @@ exports.AGENT_LAUNCHERS = [
|
|
|
24
26
|
// -i / --prompt-interactive: start interactive WITH the prompt.
|
|
25
27
|
// A bare positional prompt would run headless and exit.
|
|
26
28
|
args: (prompt) => ['-i', prompt],
|
|
29
|
+
headlessArgs: (prompt) => [prompt],
|
|
27
30
|
},
|
|
28
31
|
{
|
|
29
32
|
providerId: 'codex',
|
|
30
33
|
name: 'Codex CLI',
|
|
31
34
|
bins: ['codex'],
|
|
32
35
|
args: (prompt) => [prompt],
|
|
36
|
+
headlessArgs: (prompt) => ['exec', prompt],
|
|
33
37
|
},
|
|
34
38
|
];
|
|
35
39
|
/** Providers we detect but cannot launch from a shell (IDE surfaces). */
|
|
@@ -55,16 +59,28 @@ function resolveLaunchableAgents() {
|
|
|
55
59
|
for (const l of exports.AGENT_LAUNCHERS) {
|
|
56
60
|
const bin = l.bins.find(binOnPath);
|
|
57
61
|
if (bin)
|
|
58
|
-
out.push({
|
|
62
|
+
out.push({
|
|
63
|
+
providerId: l.providerId,
|
|
64
|
+
name: l.name,
|
|
65
|
+
bin,
|
|
66
|
+
args: l.args,
|
|
67
|
+
headlessArgs: l.headlessArgs,
|
|
68
|
+
});
|
|
59
69
|
}
|
|
60
70
|
return out;
|
|
61
71
|
}
|
|
62
72
|
/**
|
|
63
|
-
* Spawn the agent
|
|
64
|
-
* inherited — the agent takes over the terminal;
|
|
73
|
+
* Spawn the agent with the Ritual flow preloaded. Interactive by default
|
|
74
|
+
* (stdio inherited — the agent takes over the terminal); `headless: true` runs
|
|
75
|
+
* it unattended to completion. `cwd` runs it in a different directory (a
|
|
76
|
+
* discovery worktree). Returns its exit code.
|
|
65
77
|
*/
|
|
66
|
-
function launchAgent(agent, prompt) {
|
|
67
|
-
const
|
|
78
|
+
function launchAgent(agent, prompt, opts = {}) {
|
|
79
|
+
const argv = opts.headless ? agent.headlessArgs(prompt) : agent.args(prompt);
|
|
80
|
+
const result = (0, node_child_process_1.spawnSync)(agent.bin, argv, {
|
|
81
|
+
stdio: 'inherit',
|
|
82
|
+
...(opts.cwd ? { cwd: opts.cwd } : {}),
|
|
83
|
+
});
|
|
68
84
|
return result.status ?? 0;
|
|
69
85
|
}
|
|
70
86
|
//# sourceMappingURL=launch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../src/lib/agents/launch.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../src/lib/agents/launch.ts"],"names":[],"mappings":";;;AAgHA,0DAcC;AAmBD,kCAWC;AA5JD,2DAAyD;AAmD5C,QAAA,eAAe,GAAoB;IAC/C;QACC,UAAU,EAAE,aAAa;QACzB,IAAI,EAAE,aAAa;QACnB,IAAI,EA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+1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renderIndex = renderIndex;
|
|
7
|
+
exports.renderScopeContract = renderScopeContract;
|
|
8
|
+
exports.renderBuildBrief = renderBuildBrief;
|
|
9
|
+
exports.renderRecommendation = renderRecommendation;
|
|
10
|
+
exports.renderLog = renderLog;
|
|
11
|
+
exports.writeOkfProjection = writeOkfProjection;
|
|
12
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
const DO_NOT_EDIT = '<!-- GENERATED projection of the Ritual graph — DO NOT EDIT. Authoritative for portable context + identity; the live graph (ritual status / MCP) is authoritative for CURRENT state. Regenerate: ritual project <exploration-id>. -->';
|
|
15
|
+
function autonomyBanner(e) {
|
|
16
|
+
return e.autonomousDiscovery
|
|
17
|
+
? '> ⚠ **Autonomously discovered** — the answers behind this were agent-authored and **not human-reviewed**. Read with appropriate skepticism; you are the author of any code.\n'
|
|
18
|
+
: '';
|
|
19
|
+
}
|
|
20
|
+
function scopeSection(title, items) {
|
|
21
|
+
if (!items || items.length === 0)
|
|
22
|
+
return `## ${title}\n\n_(none)_\n`;
|
|
23
|
+
const lines = items.map((i) => `- ${(i.text ?? '').trim()}${i.id ? ` <sub>\`${i.id}\`</sub>` : ''}`);
|
|
24
|
+
return `## ${title}\n\n${lines.join('\n')}\n`;
|
|
25
|
+
}
|
|
26
|
+
function renderIndex(d) {
|
|
27
|
+
const e = d.exploration;
|
|
28
|
+
return [
|
|
29
|
+
DO_NOT_EDIT,
|
|
30
|
+
'',
|
|
31
|
+
`# ${e.name ?? 'Exploration'}`,
|
|
32
|
+
'',
|
|
33
|
+
autonomyBanner(e),
|
|
34
|
+
`- **Exploration:** \`${e.id ?? ''}\``,
|
|
35
|
+
`- **Job to be done:** ${e.workItemLabel ?? e.jtbd ?? '(unknown)'}`,
|
|
36
|
+
`- **Spawned via:** ${e.spawnOrigin ?? 'direct'}`,
|
|
37
|
+
`- **Recommendations:** ${e.recommendationCount ?? d.recommendations?.length ?? 0}`,
|
|
38
|
+
`- **Projected at:** ${d.generatedAt}`,
|
|
39
|
+
'',
|
|
40
|
+
'## Files',
|
|
41
|
+
'- [`build-brief.md`](./build-brief.md) — the implementation brief',
|
|
42
|
+
'- [`scope-contract.md`](./scope-contract.md) — in-scope / deferred / anti-goals',
|
|
43
|
+
'- [`recommendations/`](./recommendations) — the recommendations + reasoning',
|
|
44
|
+
'',
|
|
45
|
+
'Run `ritual status` (or the Ritual MCP) for live state — these files are a snapshot.',
|
|
46
|
+
'',
|
|
47
|
+
].join('\n');
|
|
48
|
+
}
|
|
49
|
+
function renderScopeContract(d) {
|
|
50
|
+
const s = d.scopeContract ?? {};
|
|
51
|
+
return [
|
|
52
|
+
DO_NOT_EDIT,
|
|
53
|
+
'',
|
|
54
|
+
'# Scope contract (frozen)',
|
|
55
|
+
'',
|
|
56
|
+
scopeSection('In scope', s.inScope),
|
|
57
|
+
scopeSection('Discovery gates (resolve before/within the build)', s.discoveryGates),
|
|
58
|
+
scopeSection('Deferred (do NOT implement)', s.deferred),
|
|
59
|
+
scopeSection('Anti-goals (must NOT cross)', s.antiGoals),
|
|
60
|
+
].join('\n');
|
|
61
|
+
}
|
|
62
|
+
function renderBuildBrief(d) {
|
|
63
|
+
const body = (d.briefContent ?? '').trim();
|
|
64
|
+
return [
|
|
65
|
+
DO_NOT_EDIT,
|
|
66
|
+
'',
|
|
67
|
+
autonomyBanner(d.exploration),
|
|
68
|
+
body || '_Build brief not available yet._',
|
|
69
|
+
'',
|
|
70
|
+
].join('\n');
|
|
71
|
+
}
|
|
72
|
+
function renderRecommendation(r) {
|
|
73
|
+
return [
|
|
74
|
+
DO_NOT_EDIT,
|
|
75
|
+
'',
|
|
76
|
+
`# ${r.title ?? 'Recommendation'}`,
|
|
77
|
+
'',
|
|
78
|
+
`- **Status:** ${r.status ?? 'unknown'}`,
|
|
79
|
+
r.id ? `- **Id:** \`${r.id}\`` : '',
|
|
80
|
+
'',
|
|
81
|
+
(r.summary ?? r.content ?? '').trim() || '_(no summary)_',
|
|
82
|
+
'',
|
|
83
|
+
]
|
|
84
|
+
.filter((l) => l !== '')
|
|
85
|
+
.join('\n');
|
|
86
|
+
}
|
|
87
|
+
function renderLog(d) {
|
|
88
|
+
return [
|
|
89
|
+
DO_NOT_EDIT,
|
|
90
|
+
'',
|
|
91
|
+
'# Log',
|
|
92
|
+
'',
|
|
93
|
+
`- ${d.generatedAt} — projected exploration \`${d.exploration.id ?? ''}\` into .ritual/ (ritual project).`,
|
|
94
|
+
'',
|
|
95
|
+
].join('\n');
|
|
96
|
+
}
|
|
97
|
+
/** Filesystem-safe id for a per-rec filename. */
|
|
98
|
+
function recFile(r, i) {
|
|
99
|
+
const id = (r.id ?? `rec-${i + 1}`).replace(/[^a-zA-Z0-9_-]/g, '');
|
|
100
|
+
return `${id || `rec-${i + 1}`}.md`;
|
|
101
|
+
}
|
|
102
|
+
/** Write the full `.ritual/` OKF projection tree. Returns the files written. */
|
|
103
|
+
function writeOkfProjection(outDir, d) {
|
|
104
|
+
const written = [];
|
|
105
|
+
const write = (rel, content) => {
|
|
106
|
+
const full = node_path_1.default.join(outDir, rel);
|
|
107
|
+
node_fs_1.default.mkdirSync(node_path_1.default.dirname(full), { recursive: true });
|
|
108
|
+
node_fs_1.default.writeFileSync(full, content.endsWith('\n') ? content : `${content}\n`);
|
|
109
|
+
written.push(rel);
|
|
110
|
+
};
|
|
111
|
+
write('index.md', renderIndex(d));
|
|
112
|
+
write('build-brief.md', renderBuildBrief(d));
|
|
113
|
+
write('scope-contract.md', renderScopeContract(d));
|
|
114
|
+
write('log.md', renderLog(d));
|
|
115
|
+
(d.recommendations ?? []).forEach((r, i) => write(node_path_1.default.join('recommendations', recFile(r, i)), renderRecommendation(r)));
|
|
116
|
+
return written;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=okf-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okf-projection.js","sourceRoot":"","sources":["../../src/lib/okf-projection.ts"],"names":[],"mappings":";;;;;AAmEA,kCAsBC;AAED,kDAYC;AAED,4CASC;AAED,oDAcC;AAED,8BASC;AASD,gDAiBC;AAvKD,sDAAyB;AACzB,0DAA6B;AAmD7B,MAAM,WAAW,GAChB,uOAAuO,CAAC;AAEzO,SAAS,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,CAAC,mBAAmB;QAC3B,CAAC,CAAC,+KAA+K;QACjL,CAAC,CAAC,EAAE,CAAC;AACP,CAAC;AAED,SAAS,YAAY,CAAC,KAAa,EAAE,KAAsB;IAC1D,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,KAAK,gBAAgB,CAAC;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrG,OAAO,MAAM,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC/C,CAAC;AAED,SAAgB,WAAW,CAAC,CAAoB;IAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;IACxB,OAAO;QACN,WAAW;QACX,EAAE;QACF,KAAK,CAAC,CAAC,IAAI,IAAI,aAAa,EAAE;QAC9B,EAAE;QACF,cAAc,CAAC,CAAC,CAAC;QACjB,wBAAwB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI;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AAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,iBAAE,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,KAAK,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,KAAK,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC1C,KAAK,CAAC,mBAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3E,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DISCOVERY_WORKTREE_PREFIX = void 0;
|
|
7
|
+
exports.slugFromAsk = slugFromAsk;
|
|
8
|
+
exports.discoveryBranch = discoveryBranch;
|
|
9
|
+
exports.discoveryWorktreePath = discoveryWorktreePath;
|
|
10
|
+
exports.resolveDiscoveryWorktree = resolveDiscoveryWorktree;
|
|
11
|
+
exports.createDiscoveryWorktree = createDiscoveryWorktree;
|
|
12
|
+
const node_child_process_1 = require("node:child_process");
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
/**
|
|
15
|
+
* Discovery-worktree helpers (unchosen-options → discovery worktrees, 2026-06-14).
|
|
16
|
+
*
|
|
17
|
+
* When a developer parks an unchosen option for background discovery, the agent
|
|
18
|
+
* spins a git worktree and launches `/ritual lite --worktree` headless in it
|
|
19
|
+
* (autonomous discovery → build brief, no code). This module owns the
|
|
20
|
+
* deterministic naming + the `git worktree add`.
|
|
21
|
+
*
|
|
22
|
+
* The pure helpers (slug + path + branch derivation) are unit-tested; the
|
|
23
|
+
* `git`-touching `createDiscoveryWorktree` is the thin integration wrapper.
|
|
24
|
+
*/
|
|
25
|
+
/** Branch/path prefix for discovery worktrees. */
|
|
26
|
+
exports.DISCOVERY_WORKTREE_PREFIX = 'ritual-discover';
|
|
27
|
+
/**
|
|
28
|
+
* Deterministic, filesystem-safe slug from a free-text ask. Lowercased,
|
|
29
|
+
* non-alphanumerics collapsed to single dashes, trimmed, capped at 48 chars.
|
|
30
|
+
* Falls back to 'discovery' when the ask has no usable characters.
|
|
31
|
+
*/
|
|
32
|
+
function slugFromAsk(ask) {
|
|
33
|
+
const slug = (ask ?? '')
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
36
|
+
.replace(/^-+|-+$/g, '')
|
|
37
|
+
.slice(0, 48)
|
|
38
|
+
.replace(/-+$/g, '');
|
|
39
|
+
return slug || 'discovery';
|
|
40
|
+
}
|
|
41
|
+
/** The branch name for a discovery worktree. */
|
|
42
|
+
function discoveryBranch(slug) {
|
|
43
|
+
return `${exports.DISCOVERY_WORKTREE_PREFIX}/${slug}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Where the worktree checkout lives. A SIBLING of the repo (git forbids a
|
|
47
|
+
* worktree nested inside the main worktree), under `<repo>.<prefix>/<slug>`,
|
|
48
|
+
* so several discovery worktrees for one repo group together and never collide
|
|
49
|
+
* with the repo's own tree.
|
|
50
|
+
*/
|
|
51
|
+
function discoveryWorktreePath(repoRoot, slug) {
|
|
52
|
+
const parent = node_path_1.default.dirname(repoRoot);
|
|
53
|
+
const base = node_path_1.default.basename(repoRoot);
|
|
54
|
+
return node_path_1.default.join(parent, `${base}.${exports.DISCOVERY_WORKTREE_PREFIX}`, slug);
|
|
55
|
+
}
|
|
56
|
+
/** Resolve the (slug, branch, path) triple for an ask without touching git. */
|
|
57
|
+
function resolveDiscoveryWorktree(repoRoot, ask) {
|
|
58
|
+
const slug = slugFromAsk(ask);
|
|
59
|
+
return {
|
|
60
|
+
slug,
|
|
61
|
+
branch: discoveryBranch(slug),
|
|
62
|
+
worktreePath: discoveryWorktreePath(repoRoot, slug),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create the discovery worktree via `git worktree add <path> -b <branch>` off
|
|
67
|
+
* the current HEAD. Integration wrapper — the deterministic naming above is
|
|
68
|
+
* what's unit-tested. Returns ok:false with stderr on failure (e.g. the branch
|
|
69
|
+
* already exists / the path is occupied) so the caller can surface it.
|
|
70
|
+
*/
|
|
71
|
+
function createDiscoveryWorktree(repoRoot, ask) {
|
|
72
|
+
const wt = resolveDiscoveryWorktree(repoRoot, ask);
|
|
73
|
+
const result = (0, node_child_process_1.spawnSync)('git', ['worktree', 'add', wt.worktreePath, '-b', wt.branch], {
|
|
74
|
+
cwd: repoRoot,
|
|
75
|
+
stdio: 'pipe',
|
|
76
|
+
encoding: 'utf8',
|
|
77
|
+
});
|
|
78
|
+
if (result.status === 0) {
|
|
79
|
+
return { ...wt, ok: true };
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
...wt,
|
|
83
|
+
ok: false,
|
|
84
|
+
error: (result.stderr || result.error?.message || 'git worktree add failed').trim(),
|
|
85
|
+
};
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O;QACN,IAAI;QACJ,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC;QAC7B,YAAY,EAAE,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC;KACnD,CAAC;AACH,CAAC;AAOD;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,QAAgB,EAAE,GAAW;IACpE,MAAM,EAAE,GAAG,wBAAwB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,IAAA,8BAAS,EAAC,KAAK,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE;QACtF,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KAChB,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO;QACN,GAAG,EAAE;QACL,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,yBAAyB,CAAC,CAAC,IAAI,EAAE;KACnF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ritualai/cli",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.14",
|
|
4
4
|
"description": "Ritual CLI — scaffold AI coding agent skills + register MCP servers. Connects Claude Code, Cursor, Windsurf, Kiro, Gemini CLI, VS Code/Copilot, and Codex to Ritual Cloud.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -3,7 +3,7 @@ name: ritual
|
|
|
3
3
|
description: "Use when an engineer wants a coding agent to plan or build a feature, refactor, or implementation-heavy change that depends on context the agent can't infer on its own — strategic intent, constraints, prior decisions, and trade-offs that live in the user's head. Ritual runs a structured exploration to surface that context through targeted discovery questions, combines it with codebase signals and prior explorations, and delivers a validated build brief (sub-problems, recommendations, dependencies) — additional context to fold into plan mode before the agent writes code. Prefer this over jumping straight to implementation or plan mode when the problem is ambiguous, cross-cutting, or has non-obvious constraints. Subcommands: build (full planning-to-sync cycle — default for new features), resume (continue an in-flight exploration), lineage (file-path KG history — what decisions shaped this code), context-pulse (readiness and context-debt scoring — is this safe to build yet?)."
|
|
4
4
|
argument-hint: "[subcommand] <args> (e.g. 'build Reduce T2 churn in Q3', 'resume', 'lineage src/checkout/views.py', 'context-pulse Add billing export')"
|
|
5
5
|
user-invocable: true
|
|
6
|
-
stamp:
|
|
6
|
+
stamp: ee9a77046c96
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# /ritual
|
|
@@ -554,7 +554,33 @@ Steps:
|
|
|
554
554
|
f. **If the user picks one (1-N):**
|
|
555
555
|
- Set the chosen candidate's `summary` as the `raw_input` for the rest of the flow.
|
|
556
556
|
- **Skip Step 1.5 step 8 (overlap check)** — the user just picked from system suggestions explicitly grounded in workspace state; a fresh overlap pass would be redundant noise.
|
|
557
|
-
-
|
|
557
|
+
- **Run the unchosen-candidates gate (f.1) BEFORE continuing**, then continue to Step 2.
|
|
558
|
+
|
|
559
|
+
<!-- skill-options:no-gate-change: f.1 is an OPTIONAL skippable sub-prompt nested in Step 1.5 step 6 (default skip); adds no tracked pause gate or Step header, so the structural fingerprint is unchanged (check-skill-options-contract green). -->
|
|
560
|
+
f.1 **Unchosen-candidates gate (2026-06-14, unchosen-options → discovery worktrees).** The candidates the user did NOT pick are paths worth not silently dropping. Render ONE compact, SKIPPABLE prompt — for each unchosen candidate, the user can spin up **discovery now** (a background worktree reasons it to a build brief) or **log it as a future job**. Promote DELIBERATELY: the default is to drop. (This gate is itself skipped in autonomous/worktree mode — never spawn discovery recursively.)
|
|
561
|
+
|
|
562
|
+
```text
|
|
563
|
+
You picked #{k}. The other {M} — want to keep any going?
|
|
564
|
+
• `discover <nums>` — spin up discovery NOW in a background git worktree: an agent reasons it
|
|
565
|
+
end-to-end to a build brief (reasoning only, no code). e.g. `discover 1`
|
|
566
|
+
• `next-job <nums>` — just log it as a future job (a draft exploration in this workspace; nothing runs)
|
|
567
|
+
• `skip` — drop them (default)
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
Resolve the reply, then continue to Step 2 for the picked candidate:
|
|
571
|
+
- **`discover <nums>`** → for each, run `ritual lite "{candidate.summary}" --worktree` **in the
|
|
572
|
+
BACKGROUND** (do not block the build — use your shell's background/async execution). It spins a
|
|
573
|
+
git worktree and runs autonomous discovery to a brief there; tell the user where (`<repo>.ritual-discover/<slug>`).
|
|
574
|
+
The result is an exploration with `spawn_origin: 'discovery_worktree'`; its brief is
|
|
575
|
+
agent-authored, not human-reviewed. (See `references/unchosen-options-discovery-worktrees.md` in `documents/architecture/`.)
|
|
576
|
+
- **`next-job <nums>`** → for each, call `mcp__ritual__create_exploration` with the candidate's
|
|
577
|
+
`title` as `name`, its `summary` as `problem_statement`, `spawn_origin: 'next_job'`, and NO
|
|
578
|
+
`agentic` flag — a NOT_STARTED draft that shows in the workspace roster as a future job. Cheap; nothing runs.
|
|
579
|
+
- **`skip` / no reply about them** → drop silently.
|
|
580
|
+
|
|
581
|
+
Keep it ONE prompt, never per-candidate pauses. If the user just proceeds without addressing it, treat as `skip`.
|
|
582
|
+
|
|
583
|
+
f.2 **Continue to Step 2 (template selection)** for the picked candidate.
|
|
558
584
|
|
|
559
585
|
g. **If the user says "none" / "let me describe":** continue to Step 2 normally; treat as if they had originally picked "start fresh" with no raw_input yet (they'll provide one at Step 3-4 time).
|
|
560
586
|
|