@manehorizons/cadence-core 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/explain.d.ts +34 -0
- package/dist/cli/commands/explain.d.ts.map +1 -0
- package/dist/cli/commands/explain.js +189 -0
- package/dist/cli/commands/explain.js.map +1 -0
- package/dist/cli/commands/tutorial.d.ts +32 -0
- package/dist/cli/commands/tutorial.d.ts.map +1 -0
- package/dist/cli/commands/tutorial.js +176 -0
- package/dist/cli/commands/tutorial.js.map +1 -0
- package/dist/cli/register.d.ts.map +1 -1
- package/dist/cli/register.js +4 -0
- package/dist/cli/register.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type CommandIO, type CommandResult } from '../../services/io.js';
|
|
3
|
+
/**
|
|
4
|
+
* `cadence explain [concept]` — in-CLI concept help (phase 64).
|
|
5
|
+
*
|
|
6
|
+
* Prints curated, terminal-sized explanations of CADENCE's core concepts so a
|
|
7
|
+
* user can learn the model without leaving the terminal or depending on the
|
|
8
|
+
* `docs/` tree being shipped with the package. Content is **embedded** here
|
|
9
|
+
* (distilled from `docs/concepts.md`), never read from disk at runtime, so it
|
|
10
|
+
* works identically from any install. `explain.test.ts` AC-5 guards that every
|
|
11
|
+
* advertised concept keeps non-empty content — the in-repo analog of the
|
|
12
|
+
* `commands.md` drift guard.
|
|
13
|
+
*/
|
|
14
|
+
/** A single explainable concept: a one-line list blurb + the full body text. */
|
|
15
|
+
export interface Concept {
|
|
16
|
+
/** One-line summary shown in the discovery list. */
|
|
17
|
+
blurb: string;
|
|
18
|
+
/** The full explanation printed for `cadence explain <name>`. */
|
|
19
|
+
body: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The canonical concept registry. Keys are the canonical names advertised in
|
|
23
|
+
* the list; aliases resolve to these via {@link ALIASES}.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CONCEPTS: Record<string, Concept>;
|
|
26
|
+
/**
|
|
27
|
+
* Run the explain command. Pure over its `io` sink (no process access, no file
|
|
28
|
+
* I/O), so the same path serves the CLI and tests.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runExplain(args: {
|
|
31
|
+
concept?: string;
|
|
32
|
+
}, io: CommandIO): CommandResult;
|
|
33
|
+
export declare function registerExplainCommand(program: Command): void;
|
|
34
|
+
//# sourceMappingURL=explain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErF;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,MAAM,WAAW,OAAO;IACtB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA6F5C,CAAC;AA6DF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,EAAE,SAAS,GAAG,aAAa,CAmBnF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS7D"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { processIO } from '../../services/io.js';
|
|
2
|
+
/**
|
|
3
|
+
* The canonical concept registry. Keys are the canonical names advertised in
|
|
4
|
+
* the list; aliases resolve to these via {@link ALIASES}.
|
|
5
|
+
*/
|
|
6
|
+
export const CONCEPTS = {
|
|
7
|
+
loop: {
|
|
8
|
+
blurb: 'The DRAFT→BUILD→SETTLE cycle every unit of work moves through.',
|
|
9
|
+
body: [
|
|
10
|
+
'The loop',
|
|
11
|
+
'',
|
|
12
|
+
' IDLE → [SPEC] → DRAFT → BUILD → SETTLE → IDLE',
|
|
13
|
+
'',
|
|
14
|
+
'Every unit of work moves through three core positions (SPEC is optional):',
|
|
15
|
+
'',
|
|
16
|
+
' DRAFT You (or the AI) write a structured plan — the DRAFT — listing what',
|
|
17
|
+
' changes (files per task), what success looks like (acceptance',
|
|
18
|
+
' criteria AC-N), and how large the work is (tier). CADENCE',
|
|
19
|
+
' coherence-checks it, then advances to BUILD on approve.',
|
|
20
|
+
'',
|
|
21
|
+
' BUILD The AI executes tasks one by one, each marked DONE / BLOCKED /',
|
|
22
|
+
' NEEDS_CONTEXT. Progress persists continuously, so the loop',
|
|
23
|
+
' survives session restarts.',
|
|
24
|
+
'',
|
|
25
|
+
' SETTLE `cadence settle run` runs the gate set, emits anomaly events, and',
|
|
26
|
+
' writes the SUMMARY pair before returning to IDLE.',
|
|
27
|
+
'',
|
|
28
|
+
'SPEC is an opt-in stage before DRAFT for locking down *what* a phase',
|
|
29
|
+
'delivers before planning *how*. Artifacts live under',
|
|
30
|
+
'`.cadence/phases/<phase>/<id>-{DRAFT,PROGRESS,SUMMARY,...}`.',
|
|
31
|
+
'',
|
|
32
|
+
'See also: cadence explain tiers, gates, profiles · docs/concepts.md',
|
|
33
|
+
].join('\n'),
|
|
34
|
+
},
|
|
35
|
+
gates: {
|
|
36
|
+
blurb: 'The 13 quality checks that fire across the loop, by cost band.',
|
|
37
|
+
body: [
|
|
38
|
+
'Gates',
|
|
39
|
+
'',
|
|
40
|
+
'CADENCE has 13 gates: 3 that always fire and 10 delta gates added per',
|
|
41
|
+
'(profile × tier) cell. Which fire is decided in gates/engine.ts; the full',
|
|
42
|
+
'matrix lives in docs/concepts.md.',
|
|
43
|
+
'',
|
|
44
|
+
'Always-fire (free, every phase):',
|
|
45
|
+
' coherence-check DRAFT frontmatter consistency (tier vs counts, AC format)',
|
|
46
|
+
' structural-verifier every task in a terminal state before settle',
|
|
47
|
+
' build-test-must-pass configured test command must exit 0 at settle',
|
|
48
|
+
'',
|
|
49
|
+
'Delta gates by cost band (added on top of always-fire):',
|
|
50
|
+
' cheap draft-read · test-coverage · anomaly-notify',
|
|
51
|
+
' medium approve · per-task-verify · code-review',
|
|
52
|
+
' expensive deep-verify · interactive-verdict · plan-review · security-audit',
|
|
53
|
+
'',
|
|
54
|
+
'Most gates have a per-invocation bypass flag (e.g. --allow-missing-coverage,',
|
|
55
|
+
'--no-approve, --force) for CI / non-TTY / deliberate overrides.',
|
|
56
|
+
'',
|
|
57
|
+
'See also: cadence explain profiles, tiers · docs/concepts.md (gate matrix)',
|
|
58
|
+
].join('\n'),
|
|
59
|
+
},
|
|
60
|
+
tiers: {
|
|
61
|
+
blurb: 'The phase-size axis (quick-fix / standard / complex) that scales gate work.',
|
|
62
|
+
body: [
|
|
63
|
+
'Tiers',
|
|
64
|
+
'',
|
|
65
|
+
'A tier is the phase-size axis. The AI proposes one in the DRAFT frontmatter;',
|
|
66
|
+
'the coherence check verifies it against the task count and touched-file count.',
|
|
67
|
+
'',
|
|
68
|
+
' quick-fix ≤ 1 task, ≤ 1 file',
|
|
69
|
+
' standard ≤ 5 tasks, ≤ 8 files',
|
|
70
|
+
' complex ≥ 6 tasks, any number of files',
|
|
71
|
+
'',
|
|
72
|
+
'Larger tiers pull in more gate work (see cadence explain gates). The tier',
|
|
73
|
+
'combines with the profile (user-involvement axis) to select the effective',
|
|
74
|
+
'gate set for the phase.',
|
|
75
|
+
'',
|
|
76
|
+
'See also: cadence explain profiles, gates · docs/concepts.md (profiles × tiers)',
|
|
77
|
+
].join('\n'),
|
|
78
|
+
},
|
|
79
|
+
profiles: {
|
|
80
|
+
blurb: 'The user-involvement axis (strict / standard / auto) that sets gating posture.',
|
|
81
|
+
body: [
|
|
82
|
+
'Profiles',
|
|
83
|
+
'',
|
|
84
|
+
'A profile is the user-involvement axis. Set it project-wide in',
|
|
85
|
+
'.cadence/config.json (`profile`) or override per-phase in DRAFT frontmatter.',
|
|
86
|
+
'',
|
|
87
|
+
' strict Full control — every step is a checkpoint.',
|
|
88
|
+
' standard Major-step gating — approve at DRAFT + verify at settle.',
|
|
89
|
+
' auto Hands-off — the AI drives; anomalies surface automatically.',
|
|
90
|
+
'',
|
|
91
|
+
'Profile combines with tier (phase-size axis) to select the gate set. Note',
|
|
92
|
+
'the auto × complex cell is soft-capped: CADENCE refuses to approve/settle',
|
|
93
|
+
'it by default (high blast radius, no supervision) unless you pass',
|
|
94
|
+
'--allow-auto-complex.',
|
|
95
|
+
'',
|
|
96
|
+
'See also: cadence explain tiers, gates · docs/concepts.md (profiles × tiers)',
|
|
97
|
+
].join('\n'),
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
/** Aliases → canonical concept name. Lookup is also case-insensitive. */
|
|
101
|
+
const ALIASES = {
|
|
102
|
+
gate: 'gates',
|
|
103
|
+
tier: 'tiers',
|
|
104
|
+
profile: 'profiles',
|
|
105
|
+
loops: 'loop',
|
|
106
|
+
};
|
|
107
|
+
/** Resolve a user-supplied name (alias + case insensitive) to a canonical key, or null. */
|
|
108
|
+
function resolve(input) {
|
|
109
|
+
const key = input.trim().toLowerCase();
|
|
110
|
+
if (key in CONCEPTS)
|
|
111
|
+
return key;
|
|
112
|
+
if (key in ALIASES)
|
|
113
|
+
return ALIASES[key];
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
/** Tiny Levenshtein distance for the did-you-mean nudge (no new dependency). */
|
|
117
|
+
function distance(a, b) {
|
|
118
|
+
const m = a.length;
|
|
119
|
+
const n = b.length;
|
|
120
|
+
const row = Array.from({ length: n + 1 }, (_, i) => i);
|
|
121
|
+
for (let i = 1; i <= m; i++) {
|
|
122
|
+
let prev = row[0];
|
|
123
|
+
row[0] = i;
|
|
124
|
+
for (let j = 1; j <= n; j++) {
|
|
125
|
+
const tmp = row[j];
|
|
126
|
+
row[j] = a[i - 1] === b[j - 1] ? prev : Math.min(prev, row[j], row[j - 1]) + 1;
|
|
127
|
+
prev = tmp;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return row[n];
|
|
131
|
+
}
|
|
132
|
+
/** Nearest canonical concept to an unknown input, if reasonably close. */
|
|
133
|
+
function nearest(input) {
|
|
134
|
+
const key = input.trim().toLowerCase();
|
|
135
|
+
let best = null;
|
|
136
|
+
let bestD = Infinity;
|
|
137
|
+
for (const name of Object.keys(CONCEPTS)) {
|
|
138
|
+
const d = distance(key, name);
|
|
139
|
+
if (d < bestD) {
|
|
140
|
+
bestD = d;
|
|
141
|
+
best = name;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Only suggest when the edit distance is small relative to the word.
|
|
145
|
+
return best !== null && bestD <= Math.max(2, Math.ceil(best.length / 2)) ? best : null;
|
|
146
|
+
}
|
|
147
|
+
/** Render the discovery list of concepts with their blurbs. */
|
|
148
|
+
function renderList(io) {
|
|
149
|
+
io.out('Concepts you can explain:\n\n');
|
|
150
|
+
const width = Math.max(...Object.keys(CONCEPTS).map((n) => n.length));
|
|
151
|
+
for (const [name, concept] of Object.entries(CONCEPTS)) {
|
|
152
|
+
io.out(` ${name.padEnd(width)} ${concept.blurb}\n`);
|
|
153
|
+
}
|
|
154
|
+
io.out('\nRun `cadence explain <concept>` for the full explanation.\n');
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Run the explain command. Pure over its `io` sink (no process access, no file
|
|
158
|
+
* I/O), so the same path serves the CLI and tests.
|
|
159
|
+
*/
|
|
160
|
+
export function runExplain(args, io) {
|
|
161
|
+
const requested = args.concept;
|
|
162
|
+
if (requested === undefined || requested.trim() === '') {
|
|
163
|
+
renderList(io);
|
|
164
|
+
return { exitCode: 0, data: { concepts: Object.keys(CONCEPTS) } };
|
|
165
|
+
}
|
|
166
|
+
const canonical = resolve(requested);
|
|
167
|
+
if (canonical === null) {
|
|
168
|
+
io.err(`No such concept: ${requested}\n`);
|
|
169
|
+
const guess = nearest(requested);
|
|
170
|
+
if (guess !== null)
|
|
171
|
+
io.err(`Did you mean \`${guess}\`?\n`);
|
|
172
|
+
io.err('\n');
|
|
173
|
+
renderList(io);
|
|
174
|
+
return { exitCode: 1, data: { unknown: requested } };
|
|
175
|
+
}
|
|
176
|
+
io.out(`${CONCEPTS[canonical].body}\n`);
|
|
177
|
+
return { exitCode: 0, data: { concept: canonical } };
|
|
178
|
+
}
|
|
179
|
+
export function registerExplainCommand(program) {
|
|
180
|
+
program
|
|
181
|
+
.command('explain')
|
|
182
|
+
.argument('[concept]', 'concept to explain (loop | gates | tiers | profiles)')
|
|
183
|
+
.description('Print an in-terminal explanation of a CADENCE concept')
|
|
184
|
+
.action((concept) => {
|
|
185
|
+
const res = runExplain(concept === undefined ? {} : { concept }, processIO());
|
|
186
|
+
process.exitCode = res.exitCode;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=explain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAsC,MAAM,sBAAsB,CAAC;AAsBrF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC/C,IAAI,EAAE;QACJ,KAAK,EAAE,gEAAgE;QACvE,IAAI,EAAE;YACJ,UAAU;YACV,EAAE;YACF,iDAAiD;YACjD,EAAE;YACF,2EAA2E;YAC3E,EAAE;YACF,8EAA8E;YAC9E,yEAAyE;YACzE,qEAAqE;YACrE,mEAAmE;YACnE,EAAE;YACF,0EAA0E;YAC1E,sEAAsE;YACtE,sCAAsC;YACtC,EAAE;YACF,6EAA6E;YAC7E,6DAA6D;YAC7D,EAAE;YACF,sEAAsE;YACtE,sDAAsD;YACtD,8DAA8D;YAC9D,EAAE;YACF,qEAAqE;SACtE,CAAC,IAAI,CAAC,IAAI,CAAC;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CAAC;SACpE,MAAM,CAAC,CAAC,OAA2B,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9E,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type CommandIO, type CommandResult } from '../../services/io.js';
|
|
3
|
+
/**
|
|
4
|
+
* `cadence tutorial` — run one real DRAFT→BUILD→SETTLE loop inside an ephemeral
|
|
5
|
+
* sandbox, printing each step's command and the engine's actual output, then
|
|
6
|
+
* clean up. The executable companion to the static "Your first loop" block in
|
|
7
|
+
* `cadence init` (phase 62): it composes the real engine services so the
|
|
8
|
+
* walkthrough can never drift from real behavior.
|
|
9
|
+
*/
|
|
10
|
+
export interface TutorialOpts {
|
|
11
|
+
/** Skip the between-step pause (always true for non-TTY / CI / agents). */
|
|
12
|
+
noPause?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** A single walkthrough step, run against the sandbox root. */
|
|
15
|
+
type Step = (ctx: {
|
|
16
|
+
root: string;
|
|
17
|
+
io: CommandIO;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
/** Test seam: lets a test inject steps (e.g. a throwing one) to exercise the
|
|
20
|
+
* sandbox-cleanup `finally` without running the full loop. */
|
|
21
|
+
export interface TutorialDeps {
|
|
22
|
+
steps?: Step[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run the tutorial. Creates a sandbox, runs the steps, and always removes the
|
|
26
|
+
* sandbox (even on error). Returns `loopPosition` + `summaryWritten` read back
|
|
27
|
+
* from the sandbox before cleanup. Throws if a step throws.
|
|
28
|
+
*/
|
|
29
|
+
export declare function runTutorial(opts: TutorialOpts, io: CommandIO, deps?: TutorialDeps): Promise<CommandResult>;
|
|
30
|
+
export declare function registerTutorialCommand(program: Command): void;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=tutorial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/tutorial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrF;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,+DAA+D;AAC/D,KAAK,IAAI,GAAG,CAAC,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,SAAS,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpE;8DAC8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAwJD;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,SAAS,EACb,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAU9D"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { presets, emptyState } from '@manehorizons/cadence-types';
|
|
5
|
+
import { atomicWriteJSON } from '../../state/atomic-write.js';
|
|
6
|
+
import { SimpleStateBackend } from '../../state/simple.js';
|
|
7
|
+
import { draftNewService } from '../../services/draft-new.js';
|
|
8
|
+
import { draftApproveService } from '../../services/draft-approve.js';
|
|
9
|
+
import { settleService } from '../../services/settle.js';
|
|
10
|
+
import { recordTaskOutcome } from '../../build/record.js';
|
|
11
|
+
import { processIO } from '../../services/io.js';
|
|
12
|
+
import { StdinPrompter } from '../../verify/prompter.js';
|
|
13
|
+
// The draft id is derived as `${phase.slice(0,2)}-${num}` and must match
|
|
14
|
+
// /^\d{2}-\d{2}$/, so the demo phase needs a two-digit prefix.
|
|
15
|
+
const DEMO_PHASE = '00-demo';
|
|
16
|
+
const DEMO_NUM = '01';
|
|
17
|
+
const DEMO_ID = `${DEMO_PHASE.slice(0, 2)}-${DEMO_NUM.padStart(2, '0')}`; // 00-01
|
|
18
|
+
/** A coherent quick-fix toy draft: one AC, one task, one file. */
|
|
19
|
+
const TOY_DRAFT = `---
|
|
20
|
+
phase: ${DEMO_PHASE}
|
|
21
|
+
id: ${DEMO_ID}
|
|
22
|
+
tier: quick-fix
|
|
23
|
+
status: PENDING
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# ${DEMO_ID} — Hello loop
|
|
27
|
+
|
|
28
|
+
## Objective
|
|
29
|
+
|
|
30
|
+
A throwaway demo so you can watch one DRAFT→BUILD→SETTLE loop run end to end.
|
|
31
|
+
|
|
32
|
+
## Acceptance Criteria
|
|
33
|
+
|
|
34
|
+
### AC-1: the loop closes cleanly
|
|
35
|
+
Given this demo draft
|
|
36
|
+
When the loop settles
|
|
37
|
+
Then AC-1 is recorded as pass.
|
|
38
|
+
|
|
39
|
+
## Tasks
|
|
40
|
+
|
|
41
|
+
### T1: greet the loop
|
|
42
|
+
- files: \`hello.txt\`
|
|
43
|
+
- action: write a one-line greeting to hello.txt
|
|
44
|
+
- verify: the greeting is present
|
|
45
|
+
- done: AC-1
|
|
46
|
+
|
|
47
|
+
## Boundaries
|
|
48
|
+
|
|
49
|
+
- DO NOT rely on this demo phase outside the tutorial.
|
|
50
|
+
`;
|
|
51
|
+
function line(io, s = '') {
|
|
52
|
+
io.out(`${s}\n`);
|
|
53
|
+
}
|
|
54
|
+
function header(io, n, label, cmd) {
|
|
55
|
+
line(io);
|
|
56
|
+
line(io, ` Step ${n}/5 · ${label}`);
|
|
57
|
+
line(io, ` $ cadence ${cmd}`);
|
|
58
|
+
}
|
|
59
|
+
/** Header for a non-command step (e.g. editing the DRAFT in your editor). */
|
|
60
|
+
function headerNote(io, n, label, note) {
|
|
61
|
+
line(io);
|
|
62
|
+
line(io, ` Step ${n}/5 · ${label}`);
|
|
63
|
+
line(io, ` ${note}`);
|
|
64
|
+
}
|
|
65
|
+
/** Fail loudly if a composed service returns non-zero — keeps the demo honest
|
|
66
|
+
* (a future gate change can't silently leave the loop half-run). The service
|
|
67
|
+
* has already streamed its own error to `io.err`. */
|
|
68
|
+
function expectOk(res, step) {
|
|
69
|
+
if (res.exitCode !== 0) {
|
|
70
|
+
throw new Error(`tutorial step "${step}" failed (exit ${res.exitCode})`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** Pause between steps in a real TTY; auto-advance otherwise. */
|
|
74
|
+
async function maybePause(opts) {
|
|
75
|
+
if (opts.noPause || !process.stdin.isTTY)
|
|
76
|
+
return;
|
|
77
|
+
let prompter = null;
|
|
78
|
+
try {
|
|
79
|
+
prompter = new StdinPrompter();
|
|
80
|
+
await prompter.ask(' [press enter to continue …] ');
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
/* no TTY after all — just advance */
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
await prompter?.close?.();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** Scaffold a minimal `.cadence/` in `root` (mirrors init.ts), tuned so the
|
|
90
|
+
* settle stack passes offline on a no-test toy draft. */
|
|
91
|
+
async function scaffoldSandbox(root) {
|
|
92
|
+
const cadenceDir = join(root, '.cadence');
|
|
93
|
+
await mkdir(join(cadenceDir, 'phases'), { recursive: true });
|
|
94
|
+
await mkdir(join(cadenceDir, 'handoff'), { recursive: true });
|
|
95
|
+
await mkdir(join(cadenceDir, 'research'), { recursive: true });
|
|
96
|
+
await mkdir(join(cadenceDir, 'archive'), { recursive: true });
|
|
97
|
+
// `solo` preset: reminder loop-enforcement + optional AC-discipline — the
|
|
98
|
+
// gentlest gate posture, right for a throwaway demo. profile stays `auto`.
|
|
99
|
+
await atomicWriteJSON(join(cadenceDir, 'config.json'), presets.solo);
|
|
100
|
+
await new SimpleStateBackend(root).commit(emptyState('tutorial'));
|
|
101
|
+
await writeFile(join(cadenceDir, 'PROJECT.md'), '# tutorial\n\n> CADENCE tutorial sandbox — created and removed by `cadence tutorial`.\n');
|
|
102
|
+
}
|
|
103
|
+
/** The five-step walkthrough, each printing its command + the real output. */
|
|
104
|
+
function defaultSteps(opts) {
|
|
105
|
+
return [
|
|
106
|
+
async ({ root, io }) => {
|
|
107
|
+
header(io, 1, 'DRAFT', `draft new ${DEMO_PHASE} ${DEMO_NUM} --title "Hello loop"`);
|
|
108
|
+
expectOk(await draftNewService(root, { phase: DEMO_PHASE, num: DEMO_NUM, title: 'Hello loop', tier: 'quick-fix' }, io), 'draft new');
|
|
109
|
+
await maybePause(opts);
|
|
110
|
+
},
|
|
111
|
+
async ({ root, io }) => {
|
|
112
|
+
headerNote(io, 2, 'EDIT', `(open ${DEMO_ID}-DRAFT.md in your editor — add the objective, AC-1, one task)`);
|
|
113
|
+
await writeFile(join(root, '.cadence', 'phases', DEMO_PHASE, `${DEMO_ID}-DRAFT.md`), TOY_DRAFT);
|
|
114
|
+
line(io, ` Wrote an objective, AC-1, and task T1 into the DRAFT.`);
|
|
115
|
+
await maybePause(opts);
|
|
116
|
+
},
|
|
117
|
+
async ({ root, io }) => {
|
|
118
|
+
header(io, 3, 'APPROVE', `draft approve ${DEMO_PHASE} ${DEMO_NUM}`);
|
|
119
|
+
expectOk(await draftApproveService(root, { phase: DEMO_PHASE, num: DEMO_NUM, approve: false }, io), 'draft approve');
|
|
120
|
+
await maybePause(opts);
|
|
121
|
+
},
|
|
122
|
+
async ({ root, io }) => {
|
|
123
|
+
header(io, 4, 'BUILD', `done T1`);
|
|
124
|
+
await recordTaskOutcome(root, 'T1', 'DONE', 'demo task complete');
|
|
125
|
+
line(io, ` Recorded T1: DONE`);
|
|
126
|
+
await maybePause(opts);
|
|
127
|
+
},
|
|
128
|
+
async ({ root, io }) => {
|
|
129
|
+
header(io, 5, 'SETTLE', `settle run --ac AC-1=pass`);
|
|
130
|
+
expectOk(await settleService(root, { ac: ['AC-1=pass'], allowMissingCoverage: true }, io), 'settle run');
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Run the tutorial. Creates a sandbox, runs the steps, and always removes the
|
|
136
|
+
* sandbox (even on error). Returns `loopPosition` + `summaryWritten` read back
|
|
137
|
+
* from the sandbox before cleanup. Throws if a step throws.
|
|
138
|
+
*/
|
|
139
|
+
export async function runTutorial(opts, io, deps = {}) {
|
|
140
|
+
const root = await mkdtemp(join(tmpdir(), 'cadence-tutorial-'));
|
|
141
|
+
try {
|
|
142
|
+
line(io);
|
|
143
|
+
line(io, ' CADENCE tutorial — one real loop, in a throwaway sandbox');
|
|
144
|
+
line(io, ' ───────────────────────────────────────────────────────');
|
|
145
|
+
line(io, ` Sandbox: ${root} (removed when this finishes)`);
|
|
146
|
+
await scaffoldSandbox(root);
|
|
147
|
+
const steps = deps.steps ?? defaultSteps(opts);
|
|
148
|
+
for (const step of steps) {
|
|
149
|
+
await step({ root, io });
|
|
150
|
+
}
|
|
151
|
+
const finalState = await new SimpleStateBackend(root).readState();
|
|
152
|
+
const summaryWritten = (await import('node:fs')).existsSync(join(root, '.cadence', 'phases', DEMO_PHASE, `${DEMO_ID}-SUMMARY.md`));
|
|
153
|
+
line(io);
|
|
154
|
+
line(io, " That's the whole loop. Run `cadence init` to start your own.");
|
|
155
|
+
line(io);
|
|
156
|
+
return {
|
|
157
|
+
exitCode: 0,
|
|
158
|
+
data: { loopPosition: finalState.loopPosition, summaryWritten, sandbox: root },
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
await rm(root, { recursive: true, force: true });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export function registerTutorialCommand(program) {
|
|
166
|
+
program
|
|
167
|
+
.command('tutorial')
|
|
168
|
+
.description('Run one real DRAFT→BUILD→SETTLE loop in a throwaway sandbox')
|
|
169
|
+
.option('--no-pause', 'do not pause between steps (auto-advance; for non-TTY)')
|
|
170
|
+
.action(async (opts) => {
|
|
171
|
+
// commander maps `--no-pause` to `opts.pause === false`.
|
|
172
|
+
const res = await runTutorial({ noPause: opts.pause === false }, processIO());
|
|
173
|
+
process.exitCode = res.exitCode;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=tutorial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutorial.js","sourceRoot":"","sources":["../../../src/cli/commands/tutorial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,SAAS,EA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AAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9E,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/cli/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/cli/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2B1D"}
|
package/dist/cli/register.js
CHANGED
|
@@ -22,6 +22,8 @@ import { registerDecisionCommand } from './commands/decision.js';
|
|
|
22
22
|
import { registerIntelligenceCommand } from './commands/intelligence.js';
|
|
23
23
|
import { registerDoctorCommand } from './commands/doctor.js';
|
|
24
24
|
import { registerMcpCommand } from './commands/mcp.js';
|
|
25
|
+
import { registerTutorialCommand } from './commands/tutorial.js';
|
|
26
|
+
import { registerExplainCommand } from './commands/explain.js';
|
|
25
27
|
export function registerAllCommands(program) {
|
|
26
28
|
registerConfigCommand(program);
|
|
27
29
|
registerInitCommand(program);
|
|
@@ -47,5 +49,7 @@ export function registerAllCommands(program) {
|
|
|
47
49
|
registerIntelligenceCommand(program);
|
|
48
50
|
registerDoctorCommand(program);
|
|
49
51
|
registerMcpCommand(program);
|
|
52
|
+
registerTutorialCommand(program);
|
|
53
|
+
registerExplainCommand(program);
|
|
50
54
|
}
|
|
51
55
|
//# sourceMappingURL=register.js.map
|
package/dist/cli/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/cli/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA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AAC;IAC5B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manehorizons/cadence-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
52
52
|
"commander": "^14.0.0",
|
|
53
53
|
"zod": "^4.4.3",
|
|
54
|
-
"@manehorizons/cadence-types": "1.
|
|
54
|
+
"@manehorizons/cadence-types": "1.12.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"vitest": "^2.1.0",
|