@mindrian_os/install 1.13.0-beta.11 → 1.13.0-beta.13

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.
Files changed (33) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +68 -3
  3. package/bin/cli.js +114 -57
  4. package/commands/act.md +16 -2
  5. package/commands/auto-explore.md +1 -0
  6. package/commands/doctor.md +1 -1
  7. package/commands/operator.md +1 -1
  8. package/commands/pipeline.md +16 -1
  9. package/commands/setup.md +7 -3
  10. package/commands/suggest-next.md +17 -3
  11. package/lib/core/active-plugin-root.cjs +207 -0
  12. package/lib/core/brain-client.cjs +451 -36
  13. package/lib/core/cache-prune.cjs +208 -0
  14. package/lib/core/framework-chain-composer.cjs +156 -43
  15. package/lib/core/migrations/phase-109-nodes-provenance.cjs +47 -0
  16. package/lib/core/navigation/memory-events.cjs +17 -1
  17. package/lib/core/navigation/neighborhood.cjs +5 -4
  18. package/lib/core/navigation/packet.cjs +87 -1
  19. package/lib/core/navigation.cjs +6 -0
  20. package/lib/core/resolve-brain-key.cjs +201 -0
  21. package/lib/hmi/jtbd-taxonomy.json +2 -1
  22. package/lib/memory/framework-chain-composer.test.cjs +54 -20
  23. package/lib/memory/navigation-hook-resolver.test.cjs +177 -0
  24. package/lib/memory/run-feynman-tests.cjs +102 -0
  25. package/lib/memory/security-trifecta.test.cjs +23 -6
  26. package/lib/memory/suggest-next-workflow.test.cjs +176 -0
  27. package/lib/memory/workflow-layer-e2e.test.cjs +262 -0
  28. package/lib/workflow/ROOM.md +1 -1
  29. package/package.json +4 -1
  30. package/references/brain/command-triggers-schema.md +10 -221
  31. package/references/methodology/index.md +11 -74
  32. package/skills/brain-connector/SKILL.md +12 -8
  33. package/skills/pws-methodology/SKILL.md +7 -5
@@ -0,0 +1,262 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /*
5
+ * Copyright (c) 2026 Mindrian. BSL 1.1.
6
+ *
7
+ * Phase 122-05 -- workflow-layer end-to-end test (new suite; registered in the Feynman runner).
8
+ * =============================================================================================
9
+ * Walks the FULL chain frontmatter -> registry -> resolver -> composed chain,
10
+ * then runs the Canon Part 8 zero-Brain-mutation grep sweep:
11
+ *
12
+ * Test 1 (frontmatter -> registry consistency):
13
+ * spawnSync('node', ['scripts/build-command-registry.cjs', '--check']) -> status === 0
14
+ * (the committed data/command-registry.json is in sync with commands/*.md frontmatter).
15
+ *
16
+ * Test 2 (the spec's acceptance example):
17
+ * composeWorkflow(["Beautiful Question Framework","Domain Selection","Jobs to Be Done (JTBD)"])
18
+ * -> a 3-step array; each step 1-indexed, optional === false, command a non-null /mos:
19
+ * string that exists in data/command-registry.json commands[].command.
20
+ * (Shape + registered-ness asserted, not hardcoded slugs -- the 122-01 retrofit owns the
21
+ * exact strings.)
22
+ *
23
+ * Test 3 (the command-less degrade case):
24
+ * composeWorkflow([<a framework with no command in the registry>])
25
+ * -> [{step:1, framework:<that>, command:null, optional:true}].
26
+ * The command-less framework is picked dynamically: a name in data/framework-names.json
27
+ * that is NOT a key in framework_index (so it has no /mos: command). Falls back to
28
+ * "Red Teaming" if the dynamic pick fails (Red Teaming is command-less in the retrofit).
29
+ *
30
+ * Test 4 (the /mos:act --chain stop-point):
31
+ * a workflow including a command whose registry entry has autonomous_safe: false
32
+ * (dynamically: the first command of any framework whose first command is not
33
+ * autonomous_safe -- in the retrofit, "Six Thinking Hats" -> /mos:hat-briefing)
34
+ * -> validateChainAutonomy -> runnable === false AND blockers names that step.
35
+ *
36
+ * Test 5 (Canon Part 8 grep sweep):
37
+ * - for every .cjs under lib/brain/ and lib/workflow/: no line matches /mos:[a-z-]+ within
38
+ * ~80 chars of a brain/query/fetch/http token;
39
+ * - lib/workflow/command-resolver.cjs has no require(...brain-client...);
40
+ * - scripts/build-command-registry.cjs has no write-Cypher (/CREATE |MERGE |SET |DELETE /i);
41
+ * - grep -rE "Brain has Command|brain_proactive_command|FOLLOWS_FRAMEWORK.*Command|:Command"
42
+ * skills/ agents/ references/ -> empty (no Command-node assertion left anywhere).
43
+ *
44
+ * Hermetic: zero network. The only Brain touch in the whole Workflow Layer is the build-time
45
+ * --refresh-names (not exercised here -- Test 1 runs --check, which regenerates from frontmatter
46
+ * against the committed allowlist and never queries the Brain).
47
+ *
48
+ * Registered in lib/memory/run-feynman-tests.cjs TEST_FILES[] and tests/run-all-122.sh CJS_SUITES
49
+ * (as ../lib/memory/workflow-layer-e2e.test.cjs).
50
+ * Run: node lib/memory/workflow-layer-e2e.test.cjs
51
+ * Exit 0 on pass; throws (node:assert) on any fail.
52
+ *
53
+ * License: BSL 1.1.
54
+ */
55
+
56
+ const assert = require('node:assert/strict');
57
+ const fs = require('node:fs');
58
+ const path = require('node:path');
59
+ const { spawnSync } = require('node:child_process');
60
+
61
+ const REPO_ROOT = path.resolve(__dirname, '..', '..');
62
+ const REGISTRY_PATH = path.join(REPO_ROOT, 'data', 'command-registry.json');
63
+ const FW_NAMES_PATH = path.join(REPO_ROOT, 'data', 'framework-names.json');
64
+ const BUILD_SCRIPT = path.join(REPO_ROOT, 'scripts', 'build-command-registry.cjs');
65
+
66
+ const resolver = require('../workflow/command-resolver.cjs');
67
+
68
+ const registry = JSON.parse(fs.readFileSync(REGISTRY_PATH, 'utf8'));
69
+ const REGISTERED_COMMANDS = new Set((registry.commands || []).map(function (c) { return c && c.command; }));
70
+ const COMMAND_BY_NAME = new Map((registry.commands || []).map(function (c) { return [c && c.command, c]; }));
71
+
72
+ let passed = 0;
73
+ function test(name, fn) {
74
+ fn();
75
+ passed += 1;
76
+ process.stdout.write(' ok ' + name + '\n');
77
+ }
78
+
79
+ // ---------- helpers ----------
80
+
81
+ function listCjsFilesUnder(relDir) {
82
+ const dir = path.join(REPO_ROOT, relDir);
83
+ const out = [];
84
+ let entries;
85
+ try {
86
+ entries = fs.readdirSync(dir, { withFileTypes: true });
87
+ } catch (_e) {
88
+ return out;
89
+ }
90
+ for (const e of entries) {
91
+ const p = path.join(dir, e.name);
92
+ if (e.isDirectory()) {
93
+ out.push.apply(out, listCjsFilesUnder(path.join(relDir, e.name)));
94
+ } else if (e.isFile() && /\.cjs$/.test(e.name)) {
95
+ out.push(p);
96
+ }
97
+ }
98
+ return out;
99
+ }
100
+
101
+ // True iff a /mos:<slug> literal appears within `window` chars of a
102
+ // brain/query/fetch/http token on the same source (a heuristic for "a command
103
+ // string in a Brain-query payload builder"). Test files are excluded -- they
104
+ // legitimately mention /mos: literals near assertion text.
105
+ function hasCommandNearBrainToken(src, window) {
106
+ const w = (typeof window === 'number' && window > 0) ? window : 80;
107
+ const re = /\/mos:[a-z][a-z0-9-]*/g;
108
+ let m;
109
+ while ((m = re.exec(src)) !== null) {
110
+ const start = Math.max(0, m.index - w);
111
+ const end = Math.min(src.length, m.index + m[0].length + w);
112
+ const around = src.slice(start, end).toLowerCase();
113
+ if (/\b(brain|query|fetch|http)\b/.test(around)) return true;
114
+ }
115
+ return false;
116
+ }
117
+
118
+ // Recursively grep a directory for any line matching `re`. Returns [{file, line}].
119
+ function grepDirForRegex(relDir, re) {
120
+ const dir = path.join(REPO_ROOT, relDir);
121
+ const hits = [];
122
+ let entries;
123
+ try {
124
+ entries = fs.readdirSync(dir, { withFileTypes: true });
125
+ } catch (_e) {
126
+ return hits;
127
+ }
128
+ for (const e of entries) {
129
+ const p = path.join(dir, e.name);
130
+ if (e.isDirectory()) {
131
+ hits.push.apply(hits, grepDirForRegex(path.join(relDir, e.name), re));
132
+ } else if (e.isFile()) {
133
+ let src;
134
+ try { src = fs.readFileSync(p, 'utf8'); } catch (_e2) { continue; }
135
+ const lines = src.split(/\r?\n/);
136
+ for (let i = 0; i < lines.length; i += 1) {
137
+ if (re.test(lines[i])) hits.push({ file: path.relative(REPO_ROOT, p), line: i + 1, text: lines[i].trim() });
138
+ }
139
+ }
140
+ }
141
+ return hits;
142
+ }
143
+
144
+ // ---------- Test 1: frontmatter -> registry consistency ----------
145
+
146
+ test('build-command-registry.cjs --check exits 0 (the committed registry is in sync with commands/*.md frontmatter)', function () {
147
+ assert.ok(fs.existsSync(BUILD_SCRIPT), 'scripts/build-command-registry.cjs must exist');
148
+ const res = spawnSync(process.execPath, [BUILD_SCRIPT, '--check'], { cwd: REPO_ROOT, encoding: 'utf8' });
149
+ assert.equal(res.status, 0, 'build-command-registry.cjs --check should exit 0; stderr: ' + (res.stderr || '') + ' stdout: ' + (res.stdout || ''));
150
+ });
151
+
152
+ // ---------- Test 2: the spec's acceptance example ----------
153
+
154
+ test('composeWorkflow(["Beautiful Question Framework","Domain Selection","Jobs to Be Done (JTBD)"]) -> a 3-step workflow, every command a registered /mos: string', function () {
155
+ const chain = ['Beautiful Question Framework', 'Domain Selection', 'Jobs to Be Done (JTBD)'];
156
+ const wf = resolver.composeWorkflow(chain);
157
+ assert.ok(Array.isArray(wf), 'composeWorkflow must return an array');
158
+ assert.equal(wf.length, 3, 'the acceptance example is a 3-step workflow');
159
+ for (let i = 0; i < wf.length; i += 1) {
160
+ const s = wf[i];
161
+ assert.equal(s.step, i + 1, 'step ' + (i + 1) + ' must be 1-indexed in order');
162
+ assert.equal(s.framework, chain[i], 'step ' + (i + 1) + ' framework must match the input chain');
163
+ assert.equal(s.optional, false, 'step ' + (i + 1) + ' must not be optional (all three frameworks have a command)');
164
+ assert.equal(typeof s.command, 'string', 'step ' + (i + 1) + ' command must be a string');
165
+ assert.match(s.command, /^\/mos:[a-z][a-z0-9-]*$/, 'step ' + (i + 1) + ' command must be a /mos: slug');
166
+ assert.ok(REGISTERED_COMMANDS.has(s.command), 'step ' + (i + 1) + ' command ' + s.command + ' must exist in data/command-registry.json (no hallucinated command)');
167
+ }
168
+ });
169
+
170
+ // ---------- Test 3: the command-less degrade case ----------
171
+
172
+ test('composeWorkflow([<a command-less framework>]) -> [{step:1, command:null, optional:true}] (degrade, do not fabricate)', function () {
173
+ // Pick a framework with no /mos: command dynamically: a name in
174
+ // data/framework-names.json that is NOT a key in framework_index. Fall back
175
+ // to "Red Teaming" if the dynamic pick somehow fails.
176
+ let commandless = 'Red Teaming';
177
+ try {
178
+ const fwNames = JSON.parse(fs.readFileSync(FW_NAMES_PATH, 'utf8'));
179
+ const names = Array.isArray(fwNames && fwNames.framework_names) ? fwNames.framework_names : [];
180
+ const idxKeys = new Set(Object.keys(registry.framework_index || {}));
181
+ const cand = names.find(function (n) { return !idxKeys.has(n) && resolver.commandsForFramework(n).length === 0; });
182
+ if (cand) commandless = cand;
183
+ } catch (_e) { /* keep the Red Teaming fallback */ }
184
+ assert.equal(resolver.commandsForFramework(commandless).length, 0, 'the chosen framework "' + commandless + '" must have no /mos: command');
185
+ const wf = resolver.composeWorkflow([commandless]);
186
+ assert.deepEqual(wf, [{ step: 1, framework: commandless, command: null, optional: true }],
187
+ 'a command-less framework must yield exactly [{step:1, framework, command:null, optional:true}]');
188
+ });
189
+
190
+ // ---------- Test 4: the /mos:act --chain stop-point ----------
191
+
192
+ test('validateChainAutonomy(a workflow including an autonomous_safe:false command) -> runnable false, the step is a blocker', function () {
193
+ // Pick a framework whose FIRST command (the one composeWorkflow picks) is
194
+ // autonomous_safe: false -- in the 122-01 retrofit that is "Six Thinking
195
+ // Hats" -> /mos:hat-briefing. Find it dynamically; fail loudly if none.
196
+ let blockedFramework = null;
197
+ let blockedCommand = null;
198
+ for (const [fw, cmds] of Object.entries(registry.framework_index || {})) {
199
+ if (Array.isArray(cmds) && cmds.length > 0) {
200
+ const c = COMMAND_BY_NAME.get(cmds[0]);
201
+ if (c && c.autonomous_safe === false) { blockedFramework = fw; blockedCommand = cmds[0]; break; }
202
+ }
203
+ }
204
+ assert.ok(blockedFramework, 'expected at least one framework whose first command is autonomous_safe:false (e.g. Six Thinking Hats -> /mos:hat-briefing)');
205
+ const wf = resolver.composeWorkflow([blockedFramework]);
206
+ assert.equal(wf.length, 1);
207
+ assert.equal(wf[0].command, blockedCommand);
208
+ const v = resolver.validateChainAutonomy(wf);
209
+ assert.equal(v.runnable, false, '/mos:act --chain must NOT be runnable when it includes a non-autonomous_safe command (' + blockedCommand + ')');
210
+ assert.ok(Array.isArray(v.blockers) && v.blockers.length >= 1, 'there must be at least one blocker');
211
+ assert.ok(v.blockers.some(function (b) { return b && b.command === blockedCommand && b.step === 1; }),
212
+ 'the blocker list must name step 1 / ' + blockedCommand);
213
+ // Sanity: an all-autonomous_safe workflow is runnable.
214
+ const v2 = resolver.validateChainAutonomy([
215
+ { step: 1, framework: 'Beautiful Question Framework', command: '/mos:beautiful-question', optional: false },
216
+ ]);
217
+ // Only assert runnable if /mos:beautiful-question is autonomous_safe in the registry (it is, in the retrofit).
218
+ if ((COMMAND_BY_NAME.get('/mos:beautiful-question') || {}).autonomous_safe === true) {
219
+ assert.equal(v2.runnable, true, 'an all-autonomous_safe workflow must be runnable');
220
+ assert.deepEqual(v2.blockers, []);
221
+ }
222
+ });
223
+
224
+ // ---------- Test 5: Canon Part 8 grep sweep ----------
225
+
226
+ test('Canon Part 8 grep sweep: no /mos: literal near a brain/query/fetch/http token in lib/brain/ or lib/workflow/ (non-test .cjs)', function () {
227
+ const files = listCjsFilesUnder('lib/brain').concat(listCjsFilesUnder('lib/workflow'));
228
+ assert.ok(files.length > 0, 'expected at least one .cjs under lib/brain/ + lib/workflow/');
229
+ for (const f of files) {
230
+ if (/\.test\.cjs$/.test(f)) continue; // test files legitimately mention /mos: near assertion prose
231
+ const src = fs.readFileSync(f, 'utf8');
232
+ assert.equal(hasCommandNearBrainToken(src, 80), false,
233
+ 'a /mos: command literal appears within ~80 chars of a brain/query/fetch/http token in ' + path.relative(REPO_ROOT, f) + ' -- a Canon Part 8 breach signal');
234
+ }
235
+ });
236
+
237
+ test('Canon Part 8 grep sweep: lib/workflow/command-resolver.cjs does not require a brain client', function () {
238
+ const src = fs.readFileSync(path.join(REPO_ROOT, 'lib', 'workflow', 'command-resolver.cjs'), 'utf8');
239
+ assert.equal(/require\([^)]*brain-client[^)]*\)/.test(src), false, 'command-resolver.cjs must not require brain-client');
240
+ assert.equal(/require\([^)]*brain-ask[^)]*\)/.test(src), false, 'command-resolver.cjs must not require brain-ask');
241
+ assert.equal(/\bfetch\s*\(/.test(src), false, 'command-resolver.cjs must not call fetch()');
242
+ assert.equal(/require\(['"]node:https?['"]\)/.test(src), false, 'command-resolver.cjs must not require node:http(s)');
243
+ });
244
+
245
+ test('Canon Part 8 grep sweep: scripts/build-command-registry.cjs has no write-Cypher', function () {
246
+ const src = fs.readFileSync(BUILD_SCRIPT, 'utf8');
247
+ // Write-Cypher keywords as standalone tokens (avoid matching e.g. "settings" containing "SET").
248
+ assert.equal(/\b(CREATE|MERGE|SET|DELETE|DETACH)\s/i.test(src), false, 'build-command-registry.cjs must contain no write-Cypher');
249
+ });
250
+
251
+ test('Canon Part 8 grep sweep: no Command-node assertion left in skills/ agents/ references/', function () {
252
+ const re = /Brain has Command|brain_proactive_command|FOLLOWS_FRAMEWORK.*Command|:Command/;
253
+ const hits = grepDirForRegex('skills', re)
254
+ .concat(grepDirForRegex('agents', re))
255
+ .concat(grepDirForRegex('references', re));
256
+ assert.deepEqual(hits, [], 'no Command-node assertion may survive anywhere in skills/ agents/ references/; found: ' + JSON.stringify(hits, null, 2));
257
+ });
258
+
259
+ // ---------- summary ----------
260
+
261
+ process.stdout.write('\nworkflow-layer-e2e.test.cjs: ' + passed + ' assertion groups PASSED\n');
262
+ process.exit(0);
@@ -5,7 +5,7 @@ section: lib/workflow
5
5
  purpose: Workflow layer -- the framework <-> command registry resolver. The sole door from "framework" to "/mos: command".
6
6
  founding_phase: 122
7
7
  phase: 122
8
- milestone: v1.13.0-beta.11
8
+ milestone: v1.13.0-beta.12
9
9
  canon_parts: [7, 8]
10
10
  created: 2026-05-12
11
11
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindrian_os/install",
3
- "version": "1.13.0-beta.11",
3
+ "version": "1.13.0-beta.13",
4
4
  "description": "Install MindrianOS into Claude Code with one command -- `npx @mindrian_os/install`. Ships the MindrianOS plugin (Larry + PWS methodology + Data Room) plus a setup/diagnostics CLI (install/doctor/update).",
5
5
  "scripts": {
6
6
  "mcp": "node bin/mindrian-mcp-server.cjs",
@@ -37,6 +37,9 @@
37
37
  "markdown-it": "^14.1.0",
38
38
  "zod": "^3.25.76"
39
39
  },
40
+ "devDependencies": {
41
+ "semver": "^7.7.4"
42
+ },
40
43
  "engines": {
41
44
  "node": ">=22.5.0"
42
45
  },
@@ -1,226 +1,15 @@
1
- # Brain Command Trigger Schema
1
+ # Brain Command Trigger Schema -- REMOVED (Phase 122, v1.13.0-beta)
2
2
 
3
- ## Purpose
3
+ This document used to describe a "commands are first-class Neo4j nodes with typed trigger relationships" design. That design was never built into the live Brain (no such label exists in the deployed graph), and it is a latent **Canon Part 8** breach in prose: it asserts that plugin commands live in the Brain. Per Canon Part 8 (`docs/MINDRIAN-CANON.md`), the Brain is a repository of strategic thinking tools, never a repository of plugin internals or user data. Commands never enter the Brain.
4
4
 
5
- Commands are first-class nodes in the Neo4j Brain. They have typed relationships to Frameworks, ProblemTypes, VentureStages, and Signals that define WHEN they should fire. The Brain doesn't just recommend frameworks -- it recommends ACTIONS mapped to specific /mos: commands with trigger conditions.
5
+ ## What replaced it
6
6
 
7
- ## Node: Command
7
+ The framework-to-command mapping is now plugin-local, generated, and CI-checked:
8
8
 
9
- ```cypher
10
- CREATE (c:Command {
11
- name: '/mos:find-analogies',
12
- slug: 'find-analogies',
13
- category: 'intelligence', // infrastructure | methodology | intelligence | export | meeting | funding
14
- description: 'Cross-domain analogy discovery via structural isomorphism',
15
- jtbd_when: 'stuck on a problem that feels unique to your domain',
16
- jtbd_want: 'discover that other industries already solved the same structural conflict',
17
- jtbd_so: 'adapt their approach instead of inventing from scratch',
18
- time_estimate: '5 minutes',
19
- flags: ['--brain', '--external'], // available flags
20
- min_sections: 2, // minimum populated sections to be relevant
21
- requires_brain: false, // works without Brain (but better with)
22
- powerhouse: true // v1.6.0+ feature
23
- })
24
- ```
9
+ - **Source of truth:** the `frameworks:` key in each `commands/*.md` frontmatter. Contract: `docs/COMMAND-FRONTMATTER.md`.
10
+ - **Generated registry:** `data/command-registry.json` -- built from frontmatter by `scripts/build-command-registry.cjs`; never hand-edited; pre-commit + Feynman-runner tripwire on drift.
11
+ - **The only door at runtime:** `lib/workflow/command-resolver.cjs` (`commandsForFramework`, `composeWorkflow`, `validateChainAutonomy`).
12
+ - **The Brain side:** `lib/brain/chain-recommender.cjs` ranks WHICH frameworks to chain next via the Brain's `FEEDS_INTO` traversal -- framework names + problem-type enums only, never a command string, never user content.
13
+ - **The full picture:** `docs/WORKFLOWS.md`.
25
14
 
26
- ## Relationships
27
-
28
- ### TRIGGERED_BY_SIGNAL
29
-
30
- Links a Command to the Room Signal types that should trigger it.
31
-
32
- ```cypher
33
- // When a CONTRADICTS edge exists between sections -> suggest find-analogies
34
- CREATE (cmd:Command {name: '/mos:find-analogies'})-[:TRIGGERED_BY_SIGNAL {
35
- signal_type: 'TENSION', // TENSION | BLIND_SPOT | BOTTLENECK | PATTERN | SURPRISE
36
- priority: 1, // 1=highest, 5=lowest
37
- condition: 'contradicts_count >= 1',
38
- jtbd_framing: 'When your Sections have unresolved Tensions, you want to see how other domains resolved the same structural conflict'
39
- }]->(sig:SignalType {name: 'TENSION'})
40
-
41
- // When 3+ sections have gaps -> suggest act --swarm
42
- CREATE (cmd:Command {name: '/mos:act --swarm'})-[:TRIGGERED_BY_SIGNAL {
43
- signal_type: 'BLIND_SPOT',
44
- priority: 1,
45
- condition: 'gap_count >= 3',
46
- jtbd_framing: 'When 3+ Sections have Blind Spots, you want to fill them all at once instead of one at a time'
47
- }]->(sig:SignalType {name: 'BLIND_SPOT'})
48
-
49
- // When reverse salients detected -> suggest specific methodology for lagging section
50
- CREATE (cmd:Command {name: '/mos:act'})-[:TRIGGERED_BY_SIGNAL {
51
- signal_type: 'BOTTLENECK',
52
- priority: 2,
53
- condition: 'reverse_salient_count >= 1',
54
- jtbd_framing: 'When a Section lags behind the others, you want to close the gap before it compounds'
55
- }]->(sig:SignalType {name: 'BOTTLENECK'})
56
- ```
57
-
58
- ### FOLLOWS_FRAMEWORK
59
-
60
- Links a Command to the Framework it should follow (chaining).
61
-
62
- ```cypher
63
- // After JTBD analysis -> suggest Blue Ocean
64
- CREATE (cmd:Command {name: '/mos:dominant-designs'})-[:FOLLOWS_FRAMEWORK {
65
- confidence: 0.85,
66
- reason: 'JTBD reveals customer needs; dominant designs reveals competitive whitespace',
67
- hop_distance: 1
68
- }]->(f:Framework {name: 'Jobs-to-Be-Done'})
69
-
70
- // After find-analogies -> suggest validate (stress-test the analogy)
71
- CREATE (cmd:Command {name: '/mos:validate'})-[:FOLLOWS_FRAMEWORK {
72
- confidence: 0.90,
73
- reason: 'Analogies must be stress-tested before acting on them',
74
- hop_distance: 1
75
- }]->(f:Framework {name: 'Design-by-Analogy'})
76
-
77
- // After grade --full -> suggest act --swarm on weak sections
78
- CREATE (cmd:Command {name: '/mos:act --swarm'})-[:FOLLOWS_FRAMEWORK {
79
- confidence: 0.80,
80
- reason: 'Grading reveals gaps; swarm attacks them in parallel',
81
- hop_distance: 1
82
- }]->(f:Framework {name: 'Assessment'})
83
- ```
84
-
85
- ### RELEVANT_AT_STAGE
86
-
87
- Links a Command to VentureStages where it's most impactful.
88
-
89
- ```cypher
90
- // find-analogies is most powerful at Discovery and Design stages
91
- CREATE (cmd:Command {name: '/mos:find-analogies'})-[:RELEVANT_AT_STAGE {
92
- impact: 'high',
93
- reason: 'Discovery needs fresh perspectives; Design needs proven patterns'
94
- }]->(stage:VentureStage {name: 'Discovery'})
95
-
96
- // grade --full becomes critical at Investment stage
97
- CREATE (cmd:Command {name: '/mos:grade --full'})-[:RELEVANT_AT_STAGE {
98
- impact: 'critical',
99
- reason: 'Investment stage demands rigor across every Section'
100
- }]->(stage:VentureStage {name: 'Investment'})
101
-
102
- // scout is always relevant but especially at Validation
103
- CREATE (cmd:Command {name: '/mos:scout'})-[:RELEVANT_AT_STAGE {
104
- impact: 'high',
105
- reason: 'Validation stage has deadlines and competitor dynamics'
106
- }]->(stage:VentureStage {name: 'Validation'})
107
- ```
108
-
109
- ### ADDRESSES_PROBLEM_TYPE
110
-
111
- Links a Command to ProblemTypes it solves (via multi-hop through Frameworks).
112
-
113
- ```cypher
114
- // find-analogies addresses wicked problems (via Design-by-Analogy framework)
115
- CREATE (cmd:Command {name: '/mos:find-analogies'})-[:ADDRESSES_PROBLEM_TYPE {
116
- via_framework: 'Design-by-Analogy',
117
- effectiveness: 0.85
118
- }]->(pt:ProblemType {name: 'wicked'})
119
-
120
- // act --swarm addresses complex problems with multiple dimensions
121
- CREATE (cmd:Command {name: '/mos:act --swarm'})-[:ADDRESSES_PROBLEM_TYPE {
122
- via_framework: 'Multiple simultaneous frameworks',
123
- effectiveness: 0.90
124
- }]->(pt:ProblemType {name: 'ill-defined-complex'})
125
- ```
126
-
127
- ### RESOLVES_TENSION_BETWEEN
128
-
129
- Links a Command to Framework pairs that commonly produce contradictions.
130
-
131
- ```cypher
132
- // find-analogies resolves tensions between pricing frameworks and competitive positioning
133
- CREATE (cmd:Command {name: '/mos:find-analogies'})-[:RESOLVES_TENSION_BETWEEN {
134
- framework_a: 'Lean Canvas',
135
- framework_b: 'Competitive Analysis',
136
- resolution_pattern: 'Cross-domain structural isomorphism finds how other industries resolved pricing vs positioning'
137
- }]->(tension:TensionType {name: 'pricing_vs_positioning'})
138
- ```
139
-
140
- ## Multi-Hop Proactive Query
141
-
142
- The power of this schema is MULTI-HOP reasoning. The Brain can traverse:
143
-
144
- ```
145
- User's Room State
146
- -> Current Frameworks (from Room artifacts)
147
- -> FEEDS_INTO relationships (what comes next)
148
- -> Command nodes (which /mos: command delivers it)
149
- -> TRIGGERED_BY_SIGNAL (is the trigger condition met?)
150
- -> Return ranked command suggestion with full JTBD framing
151
- ```
152
-
153
- ### Query: brain_proactive_command (Pattern 10d)
154
-
155
- ```cypher
156
- // Multi-hop: Room frameworks -> next framework -> command -> trigger check
157
- MATCH (current:Framework)<-[:FOLLOWS_FRAMEWORK]-(cmd:Command)
158
- WHERE current.name IN $room_frameworks
159
-
160
- // Check if command is relevant at this venture stage
161
- OPTIONAL MATCH (cmd)-[stage_rel:RELEVANT_AT_STAGE]->(stage:VentureStage {name: $venture_stage})
162
-
163
- // Check if command is triggered by current signals
164
- OPTIONAL MATCH (cmd)-[trigger:TRIGGERED_BY_SIGNAL]->(sig:SignalType)
165
-
166
- // Get success data
167
- OPTIONAL MATCH (current)-[:APPLIED_IN]->(example:Example)
168
- WHERE example.grade_numeric >= 80
169
-
170
- RETURN cmd.name AS command,
171
- cmd.jtbd_when AS when_situation,
172
- cmd.jtbd_want AS want_motivation,
173
- cmd.jtbd_so AS so_outcome,
174
- cmd.time_estimate AS time,
175
- cmd.flags AS available_flags,
176
- stage_rel.impact AS stage_impact,
177
- trigger.signal_type AS triggered_by,
178
- trigger.condition AS trigger_condition,
179
- trigger.jtbd_framing AS trigger_framing,
180
- count(example) AS success_count
181
- ORDER BY stage_rel.impact DESC, trigger.priority ASC, success_count DESC
182
- LIMIT 5
183
- ```
184
-
185
- **Parameters:**
186
- - `$room_frameworks` -- frameworks used in Room (from artifact frontmatter)
187
- - `$venture_stage` -- from STATE.md
188
-
189
- **Output:** Ranked command suggestions with full JTBD framing, trigger conditions, and success data from real projects.
190
-
191
- ## Seeding Script
192
-
193
- The Command nodes and trigger relationships need to be seeded into Neo4j. Create a script that:
194
-
195
- 1. Reads all commands/*.md files
196
- 2. Extracts: name, description, allowed-tools, category
197
- 3. Generates JTBD statements from the command's purpose
198
- 4. Creates Command nodes with relationships to:
199
- - Frameworks they follow (from methodology chaining rules)
200
- - VentureStages they're relevant at (from problem-types.md)
201
- - SignalTypes that trigger them (from proactive-intelligence patterns)
202
- 5. Runs the Cypher via `mcp__neo4j-brain__write_neo4j_cypher`
203
-
204
- Script location: `scripts/seed-brain-commands.cjs`
205
-
206
- ## The Intelligence Hierarchy (Updated)
207
-
208
- ```
209
- LEVEL 3 (Brain + Room + Signals):
210
- brain_proactive_command (Pattern 10d)
211
- Multi-hop: frameworks -> commands -> triggers -> JTBD
212
- Calibrated from 100+ real projects
213
- Knows which sequences ACTUALLY produced results
214
-
215
- LEVEL 2 (Room + Local Fabric):
216
- Larry's JTBD provoked suggestions (every 3-7 turns)
217
- KuzuDB Tensions, Bottlenecks, Surprises, Convergences
218
- Good but not cross-venture calibrated
219
-
220
- LEVEL 1 (No Room):
221
- Generic stage-based defaults
222
- methodology/index.md routing table
223
- Better than nothing
224
- ```
225
-
226
- Brain-connected users get LEVEL 3: the Brain literally tells Larry which command to suggest, when, and why -- backed by data from 100+ real ventures. The JTBD framing is baked into the Command node itself. Larry just reads it and presents it naturally.
15
+ Trigger conditions (which signal surfaces which next step) live in the navigation engine (Phase 91 family) and the cascade hooks (Phase 116/117) -- locally, where the room state is, not in the Brain.
@@ -1,81 +1,24 @@
1
- # Methodology Index -- Command Routing Reference
1
+ # Methodology Index -- Pointer
2
2
 
3
- *All MindrianOS methodology commands. Used for progressive disclosure and framework routing.*
3
+ > Phase 122 (Workflow Layer) replaced the hand-maintained framework-to-command routing table that used to live here. That table drifted (it is the exact drift class the Workflow Layer was built to delete). The authoritative mapping is now generated, CI-checked, and resolved at runtime through one door.
4
4
 
5
5
  ---
6
6
 
7
- ## Infrastructure Commands
7
+ ## Where the framework-to-command mapping lives now
8
8
 
9
- | Command | Description | Default Room |
10
- |---------|-------------|--------------|
11
- | `/mos:new-project` | Start a new venture project -- Larry explores your idea and creates your Data Room | (creates all rooms) |
12
- | `/mos:help` | Larry recommends 2-3 relevant commands based on your room state | (none) |
13
- | `/mos:status` | Room overview, venture stage, gaps, suggested next action | (none) |
14
- | `/mos:room` | View, add, or export Data Room sections | (none) |
9
+ - **Source of truth:** the `frameworks:` key in each `commands/*.md` frontmatter (one place, nothing else asserts it). Contract: `docs/COMMAND-FRONTMATTER.md`.
10
+ - **Generated registry:** `data/command-registry.json` -- built from that frontmatter by `scripts/build-command-registry.cjs`; never hand-edited. A pre-commit tripwire (`build-command-registry.cjs --check`) and the Feynman test runner fail the build on a stale registry or an unresolvable framework name.
11
+ - **The only door at runtime:** `lib/workflow/command-resolver.cjs` (`commandsForFramework(<framework>)`, `composeWorkflow(<framework-chain>)`, `validateChainAutonomy(...)`). Larry never names a `/mos:` command from memory -- every command he surfaces came back from the resolver. If a framework has no command yet, the resolver returns `null` and the answer is "run it manually" (degrade, do not fabricate).
12
+ - **The Brain side:** `lib/brain/chain-recommender.cjs` ranks WHICH frameworks to chain next via the Brain's `FEEDS_INTO` traversal -- framework names + problem-type enums only. Turning a recommended framework into a `/mos:` command is the resolver's job, not the Brain's. Commands NEVER enter the Brain (Canon Part 8). See `docs/WORKFLOWS.md` for the full Brain <-> registry <-> Larry join.
15
13
 
16
- ---
17
-
18
- ## Methodology Commands (26)
19
-
20
- | Command | Description | Default Room |
21
- |---------|-------------|--------------|
22
- | `/mos:beautiful-question` | Reframe your challenge into a question worth answering -- Why / What If / How | problem-definition |
23
- | `/mos:map-unknowns` | Map what you know, don't know, and can't see -- Known/Unknown Matrix | problem-definition |
24
- | `/mos:challenge-assumptions` | Stress-test your assumptions before the market does -- Devil's Advocate | competitive-analysis |
25
- | `/mos:analyze-systems` | Decompose complex systems into layers -- find where leverage lives | solution-design |
26
- | `/mos:leadership` | Leadership coaching -- what kind of leader does your team actually need? | team-execution |
27
- | `/mos:lean-canvas` | Build your business model on one page -- 9 boxes, no fluff | business-model |
28
- | `/mos:systems-thinking` | See feedback loops, stocks, flows, and leverage points in your system | solution-design |
29
- | `/mos:explore-domains` | Map the innovation domains around your venture -- find where fields collide | problem-definition |
30
- | `/mos:structure-argument` | Build a Minto Pyramid -- structure your thinking top-down | problem-definition |
31
- | `/mos:think-hats` | Six Thinking Hats -- explore your problem from 6 perspectives | solution-design |
32
- | `/mos:analyze-needs` | Jobs to Be Done -- discover what progress your customers hire for | market-analysis |
33
- | `/mos:find-bottlenecks` | Reverse Salient -- find the bottleneck holding your system back | solution-design |
34
- | `/mos:build-thesis` | Build an investment thesis -- structure your venture's narrative | financial-model |
35
- | `/mos:grade` | Assess your progress -- get honest feedback on your venture thinking | (all rooms) |
36
- | `/mos:explore-trends` | Trending to the Absurd -- push current trends to their logical extreme | market-analysis |
37
- | `/mos:analyze-timing` | S-Curve analysis -- is the technology ready? Is the market ready? | market-analysis |
38
- | `/mos:scenario-plan` | Map plausible futures and prepare for each | market-analysis |
39
- | `/mos:validate` | Check claims against evidence -- Validation Compass | competitive-analysis |
40
- | `/mos:build-knowledge` | Ackoff's Pyramid -- climb from data to wisdom | problem-definition |
41
- | `/mos:explore-futures` | Oracle -- explore long-range futures and weak signals | market-analysis |
42
- | `/mos:root-cause` | Trace problems to their source -- 5 Whys, Fishbone, and more | problem-definition |
43
- | `/mos:macro-trends` | Identify large-scale shifts affecting your domain | market-analysis |
44
- | `/mos:dominant-designs` | Analyze convergence patterns in your market | competitive-analysis |
45
- | `/mos:user-needs` | Deep dive into user behavior and motivation | market-analysis |
46
- | `/mos:score-innovation` | HSI scoring -- cross-domain innovation opportunity assessment | (all rooms) |
47
- | `/mos:diagnose` | Problem type classification + framework recommendation | (none) |
48
-
49
- ---
50
-
51
- ## Venture Stage Routing
52
-
53
- | Venture Stage | Recommended Commands |
54
- |---------------|---------------------|
55
- | **Pre-Opportunity** | new-project, beautiful-question, explore-domains, explore-trends, map-unknowns |
56
- | **Discovery** | analyze-needs, challenge-assumptions, explore-domains, structure-argument, build-knowledge |
57
- | **Validation** | validate, find-bottlenecks, analyze-timing, map-unknowns, challenge-assumptions |
58
- | **Design** | think-hats, structure-argument, scenario-plan, analyze-systems, systems-thinking, lean-canvas |
59
- | **Investment** | build-thesis, grade, root-cause, build-knowledge, score-innovation |
60
-
61
- ---
62
-
63
- ## Brain-Powered Commands (5)
64
-
65
- *Require Brain MCP connection. Run `/mos:setup brain` to enable.*
66
-
67
- | Command | Description | Default Room |
68
- |---------|-------------|--------------|
69
- | `/mos:suggest-next` | Graph-informed recommendation -- what should you work on next? (Requires Brain) | (none) |
70
- | `/mos:find-connections` | Cross-domain pattern discovery -- what connects to your work? (Requires Brain) | (none) |
71
- | `/mos:compare-ventures` | Who else did something like this -- and what happened? (Requires Brain) | (none) |
72
- | `/mos:deep-grade` | Calibrated venture assessment -- scored against 100+ real projects (Requires Brain) | competitive-analysis |
73
- | `/mos:research` | External web research with Brain cross-reference -- find evidence for your venture (Requires Brain) | market-analysis |
14
+ For a human-readable list of commands with descriptions, see `commands/help.md` (the `/mos:help` surface) or `docs/COMMAND-FRONTMATTER.md`. For the closed-loop picture, see `docs/WORKFLOWS.md`.
74
15
 
75
16
  ---
76
17
 
77
18
  ## Design-by-Analogy Reference Files
78
19
 
20
+ These are reference *data* files (not a framework-to-command map), loaded on demand by the Design-by-Analogy pipeline:
21
+
79
22
  | File | Description |
80
23
  |------|-------------|
81
24
  | `triz-matrix.json` | 39x39 TRIZ contradiction matrix mapping engineering parameter pairs to inventive principles |
@@ -88,10 +31,4 @@ Used by the Design-by-Analogy pipeline (`/mos:find-analogies`) and `enrichContra
88
31
 
89
32
  ## Brain Enhancement
90
33
 
91
- When Brain MCP is connected, methodology commands gain:
92
- - Contextual framework chaining (Brain recommends the perfect next framework)
93
- - Calibrated grading (100+ real student projects)
94
- - Cross-domain pattern matching (21K+ knowledge graph nodes)
95
- - Framework sequencing based on your specific room state
96
-
97
- Without Brain, all commands work using embedded reference definitions.
34
+ When Brain MCP is connected, methodology commands gain contextual framework chaining (the Brain ranks the next framework via `FEEDS_INTO`), calibrated grading (100+ real student projects), and cross-domain pattern matching (21K+ knowledge graph nodes). Without Brain, all commands work using embedded reference definitions. Either way, the framework-to-command mapping comes from the plugin-local `data/command-registry.json` via `lib/workflow/command-resolver.cjs` -- not from the Brain, not from memory.