@mindrian_os/install 1.13.0-beta.22 → 1.13.0-beta.26
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +39 -0
- package/agents/brain-query.md +12 -15
- package/agents/grading.md +14 -26
- package/agents/investor.md +6 -7
- package/agents/research.md +1 -2
- package/bin/mindrian-brain-mcp-client.cjs +16 -3
- package/bin/mindrian-mcp-server.cjs +18 -3
- package/commands/act.md +8 -8
- package/commands/rs-experts.md +3 -1
- package/commands/rs-explain.md +2 -2
- package/commands/rs-thesis.md +3 -1
- package/hooks/hooks.json +8 -8
- package/lib/agents/mva/brain-classic-traps.cjs +29 -51
- package/lib/brain/chain-recommender.cjs +14 -8
- package/lib/brain/framework-chain-slice.cjs +89 -70
- package/lib/core/brain-client.cjs +54 -0
- package/lib/core/brain-derivation-prompts.cjs +15 -10
- package/lib/core/brain-derivation.cjs +16 -2
- package/lib/core/mcp-dep-heal.cjs +246 -0
- package/lib/core/mcp-dep-heal.test.cjs +253 -0
- package/lib/core/npm-cli-resolve.cjs +151 -0
- package/lib/core/npm-cli-resolve.test.cjs +153 -0
- package/lib/core/npm-install-lock.cjs +302 -0
- package/lib/core/npm-install-lock.test.cjs +325 -0
- package/lib/core/rs-chain-feeder.cjs +62 -30
- package/lib/core/rs-nl-to-query.cjs +16 -6
- package/lib/hmi/cross-room-memory.cjs +72 -29
- package/lib/mcp/brain-router.cjs +69 -55
- package/lib/memory/brain-cypher-chain-slice.test.cjs +143 -143
- package/lib/memory/brain-derivation.test.cjs +10 -5
- package/package.json +2 -4
- package/references/brain/query-patterns.md +29 -17
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mos",
|
|
3
3
|
"description": "MindrianOS -- Your AI innovation co-founder. Larry thinks with you through PWS methodology, builds your Data Room as you explore, and chains frameworks intelligently. Install and go.",
|
|
4
|
-
"version": "1.13.0-beta.
|
|
4
|
+
"version": "1.13.0-beta.26",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jonathan Sagir",
|
|
7
7
|
"url": "https://mindrian.ai"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
## [1.13.0-beta.26] - 2026-05-23
|
|
2
|
+
|
|
3
|
+
### Fixed (Brain edge cleanups, Phase 127.2 Plan 00)
|
|
4
|
+
- **`BRAIN_MAX_TOPK` cap on Pinecone forwards (D-09 -- `.planning/debug/resolved/brain-topk-uncapped-advisory.md`).** The Brain MCP server (`mcp-server-brain/lib/brain-ask.cjs` line 545 + `mcp-server-brain/lib/pinecone-tools.cjs` line 42) forwarded caller-supplied `topK` directly to Pinecone with no Brain-side cap. The moat against runaway result sets was INHERITED from Pinecone's server-side cap, not OWNED by the Brain. A new `BRAIN_MAX_TOPK` env var (default 100) is now applied via `Math.min(topK, BRAIN_MAX_TOPK)` at both forward sites. Naming matches the existing `BRAIN_CYPHER_MAX_ROWS` family from Phase 127.1 Plan 05's D-MOAT-2 work. Server-side change deploys to `mindrian-brain.onrender.com` on next Render auto-deploy from `origin/main`. Surfaced by the Windows beta-tester deep audit (2026-05-23, NF-2026-05-23-01b).
|
|
5
|
+
|
|
6
|
+
### Documentation (Phase 127.2 Plan 00)
|
|
7
|
+
- **Source-of-Truth Preamble shipped in `docs/RCA-TEMPLATE.md` (D-10 -- `.planning/debug/resolved/stale-install-cache-audit-anti-pattern.md`).** Every QA / audit prompt and every RCA filing now MUST declare which source-of-truth its CODE claims read against (origin/main HEAD, install cache, branch, tag), which source-of-truth its WIRE claims probe against (deployed Brain server, local stdio shim, mock), the date of audit, and a re-verification rule against `origin/main` HEAD before findings are filed. The 2026-05-23 deep audit surfaced TWO false-positive findings (NF-2026-05-23-01 + the curated-op-surface-missing claim) plus one sibling (`brain-ask-contract-mismatch-rename`) that all traced to the same install-cache-vs-deployed-server delta. The Preamble does not prevent the delta -- it makes the delta VISIBLE so reconciliation happens BEFORE findings are filed. Added checklist row: `- [ ] Source-of-Truth Preamble filled before any finding filed`.
|
|
8
|
+
|
|
9
|
+
### Resolved (no code change required)
|
|
10
|
+
- **`brain-ask-contract-mismatch-rename` disposition: false-positive (D-08).** The Windows beta-tester flagged `brain_ask`'s tool description as misleading (reads "ask anything in natural language" but actually returns a DirectiveEnvelope routing payload). Re-read of `origin/main` HEAD at resolution showed the description was ALREADY rewritten to name "Returns a DirectiveEnvelope payload (populated directive + next_gate + mode_signals)" verbatim. The auditor read from a stale install cache (plugin v1.13.0-beta.24 or earlier) that pre-dated the description rewrite. No code change shipped. Resolution doc: `.planning/debug/resolved/brain-ask-contract-mismatch-rename.md`. This is the meta-finding that motivated D-10's Source-of-Truth Preamble.
|
|
11
|
+
|
|
12
|
+
### Internal
|
|
13
|
+
- **Phase 127.2 scaffolded (CONTEXT + Plan 00 + Plan 01 stubs).** New phase `127.2-brain-warmup-ping-hide-mcp-cold-start-latency-inside-larry-s/` registered in ROADMAP (INSERTED + URGENT marker). Plan 127.2-00 (Brain Edge Bundle: D-08 + D-09 + D-10 + 3 debug-doc closeouts) ships in this beta. Plan 127.2-01 (the warmup-ping itself: `brain_ask("warmup")` fired non-blocking inside Larry's first-question render window to hide MCP cold-start latency) stays BLOCKED on two cross-phase coordination items: Q-02 (Phase 114 render-complete callback) and Q-03 (Brain server-side "warmup" sentinel short-circuit). Plan 127.2-01 rides a later beta once blockers close.
|
|
14
|
+
- **3 debug docs moved to `.planning/debug/resolved/`** with `resolved_by: phase-127.2` frontmatter + Resolution sections + `.planning/debug/knowledge-base.md` summary entries (so `gsd-debugger` surfaces them as known-pattern hypotheses in future investigations).
|
|
15
|
+
- **New test:** `tests/test-127.2-00-brain-edge-bundle.sh` verifies all three landed (D-08 description, D-09 cap at both forward sites, D-10 Preamble + checklist row, debug-doc moves, knowledge-base entries, Canon Part 8 forbidden-substring scan on D-09 added code). 16/16 pass.
|
|
16
|
+
|
|
17
|
+
## [1.13.0-beta.24] - 2026-05-22
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- **Brain unreachable on the first session after a plugin update -- now fixed on all three platforms.** `claude plugin update` lands a fresh plugin cache directory with no `node_modules`. Both bundled MCP servers (`mindrian-brain` + `mindrian-os`, both `alwaysLoad`) then crashed at module load (`Cannot find module '@modelcontextprotocol/sdk/server/mcp.js'`), the Brain was unreachable, and `/reload-plugins` reported a load error. On Windows the gap was *permanent* -- the repair never ran (see the portable self-heal note below). Root cause: a startup-order race plus a cross-platform defect in the repair (debug session `mcp-servers-cache-missing-node-modules`). The fix below makes Brain connectivity true by construction on Windows, Mac, and Linux.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- **Vendored production dependencies (the guarantee).** The plugin now ships its production `node_modules` with the released marketplace artifact, so the Brain shim's dependencies are present the instant the install cache lands -- no runtime install, no network, no startup race. Every production dependency was audited and confirmed pure-JavaScript (zero native/compiled binaries: no `.node` addons, no `binding.gyp`, no prebuilt platform binaries, no install lifecycle scripts), so the same vendored tree is correct on Windows, Mac, and Linux by construction. The vendored tree is built fresh from `package-lock.json` via `npm ci --omit=dev` during the release (`scripts/release.sh` Step 6.7), staged onto the tagged release commit only -- `main` HEAD stays clean. This is a new release lockstep surface (see `.claude/includes/release-process.md`); it can never drift from the lockfile.
|
|
24
|
+
- **Portable cross-platform self-heal (the backstop).** The runtime self-heal that repairs an incomplete cache is now cross-platform. The prior implementation ran a bare `spawnSync('npm', ...)`, which was *dead on Windows* (`npm` is `npm.cmd`, a batch file -- bare `spawnSync` returns `ENOENT`) and *fragile on Mac* (a GUI-launched Claude Code gives child processes a minimal `PATH` that often excludes the nvm / Homebrew bin directory where `npm` lives). The new `lib/core/npm-cli-resolve.cjs` resolves `npm` to its absolute `npm-cli.js` entry point off `process.execPath` -- npm ships in the same distribution as the running `node` binary -- and runs it as `node <abs npm-cli.js> install`. This sidesteps `PATH`, the `.cmd` extension, and `shell:true` entirely. Applied to both spawn sites (`lib/core/mcp-dep-heal.cjs` and `scripts/sessionstart-npm-reconcile.cjs`).
|
|
25
|
+
- **Hybrid self-heal for the plugin cache (carried from the prior staging of this beta).** The vendored tree is the primary guarantee; the self-heal is the backstop for a somehow-incomplete cache. Three coordinated changes still close the race from both ends:
|
|
26
|
+
1. The `sessionstart-npm-reconcile.cjs` hook is `async: false` and ordered FIRST in the `SessionStart` chain, so any needed dependency install completes before Claude Code reads `.mcp.json` and spawns the MCP servers.
|
|
27
|
+
2. Both MCP entry points (`bin/mindrian-brain-mcp-client.cjs`, `bin/mindrian-mcp-server.cjs`) self-heal: a missing dependency triggers a one-shot guarded `npm install` in the plugin cache root, then re-requires. On a normal install (vendored deps present) this is a cheap `stat()` pre-flight that spawns nothing.
|
|
28
|
+
3. A lockfile guard (`lib/core/npm-install-lock.cjs`) ensures that when both servers spawn together, exactly one runs `npm install` while the other blocks and waits -- two concurrent installs can never corrupt `node_modules`.
|
|
29
|
+
- New modules: `lib/core/mcp-dep-heal.cjs` (`ensureDepsPresent` + `requireWithHeal`) and `lib/core/npm-cli-resolve.cjs` (portable npm resolution). Zero network surface -- pure node built-ins plus a single guarded `npm install` child process (Canon Part 8). Mirrors the existing reconcile-hook detection logic rather than inventing a new mechanism (Canon Part 7).
|
|
30
|
+
- `package-lock.json` resynced with `package.json` (it was 13 betas stale; `npm ci` could not run against it). No runtime dependency versions changed -- a metadata-only catch-up.
|
|
31
|
+
|
|
32
|
+
### Fixed (dependency hygiene, surfaced by the vendoring audit)
|
|
33
|
+
- **`/mos:doctor` would crash with `Cannot find module 'semver'` on a production-only install.** `scripts/doctor.cjs` -- a user-facing runtime script invoked by `/mos:doctor` -- requires `semver` for version-ordering (`semver.compare`), but `semver` was declared as a `devDependency`. A full audit of every `require()` of a declared dependency across all shipped code paths confirmed `semver` was the only misclassification. Moved to `dependencies` so it is present on every install (and in the vendored tree). `devDependencies` is now empty.
|
|
34
|
+
|
|
35
|
+
### Fixed (lockfile + probe correctness, surfaced by a remote code review of the self-heal backstop)
|
|
36
|
+
- **Concurrent-install corruption from a non-atomic lock (`bug_004`).** `lib/core/npm-install-lock.cjs` created its lock with `openSync('wx')` and then populated it with a *separate* `writeSync`. The create is atomic, but the file existed empty between the two syscalls -- a racing peer that hit `EEXIST` then read the empty file, `JSON.parse('')` threw, the lock was misclassified as corrupt, the winner's live lock was unlinked, and both servers ran `npm install` at once. Lock creation is now atomic via `fs.linkSync` (the payload is written to a private temp file in full, then atomically linked into place), so a winner's lock is always observed fully-written. As defence-in-depth `readLock` now distinguishes a transient empty mid-write file (sentinel `'EMPTY'` -- caller retries) from genuinely corrupt non-empty JSON (`null` -- safe to clear), and both `acquireInstallLock` and `waitForUnlock` treat an empty file as transient instead of as a cleared/dead lock.
|
|
37
|
+
- **False-stale reclaim of a healthy long install (`bug_001`).** The lock's `STALE_THRESHOLD_MS` was 90s, but `runGuardedInstall` gives `npm install` a 120s timeout -- a healthy install legitimately running 90-120s was declared abandoned, and because the staleness check used OR (`age > STALE || !pidAlive`) a peer reclaimed the *live* lock and started a second concurrent install. The threshold is raised to 180s (strictly above the 120s install timeout, 60s headroom) and the staleness check is now an AND-gate: a lock is reclaimed only when it is BOTH older than the threshold AND its owning pid is dead. `WAIT_TIMEOUT_MS` raised to 200s to stay above the new stale threshold.
|
|
38
|
+
- **Dependency probe too narrow (`bug_011`).** `ensureDepsPresent` probed only `['@modelcontextprotocol/sdk', 'zod']`. A partially-populated `node_modules` (those two present, `@modelcontextprotocol/ext-apps` or another production dep absent) passed the probe, no heal ran, and a bare `require` deeper in the `lib/mcp/*` chain then threw `MODULE_NOT_FOUND` at module-init scope and crashed the server. The probe now defaults to the FULL production dependency set read from the plugin's `package.json` (`Object.keys(pkg.dependencies)`), matching what `scripts/sessionstart-npm-reconcile.cjs` already does; a missing or unreadable `package.json` falls back to the MCP-critical pair rather than crashing. New regression suites: `lib/core/npm-install-lock.test.cjs` (18 tests) and `lib/core/mcp-dep-heal.test.cjs` (9 tests).
|
|
39
|
+
|
|
1
40
|
## [1.13.0-beta.22] - 2026-05-21
|
|
2
41
|
|
|
3
42
|
### Documentation
|
package/agents/brain-query.md
CHANGED
|
@@ -4,9 +4,7 @@ description: Query the Brain teaching graph with natural language. Translates to
|
|
|
4
4
|
model: inherit
|
|
5
5
|
color: blue
|
|
6
6
|
allowed-tools:
|
|
7
|
-
- mcp__mindrian-
|
|
8
|
-
- mcp__neo4j-brain__read_neo4j_cypher
|
|
9
|
-
- mcp__neo4j-brain__get_neo4j_schema
|
|
7
|
+
- mcp__mindrian-brain__brain_ask
|
|
10
8
|
- mcp__mindrian-brain__brain_search
|
|
11
9
|
- mcp__pinecone-brain__search-records
|
|
12
10
|
- Read
|
|
@@ -14,11 +12,11 @@ allowed-tools:
|
|
|
14
12
|
|
|
15
13
|
<!-- Phase 95.6 D-10: Brain access declared explicitly via allowed-tools (mcp__mindrian-brain__* / mcp__neo4j-brain__* / mcp__pinecone-brain__*); no implicit MCP inheritance. -->
|
|
16
14
|
|
|
17
|
-
You are the Brain Agent -- a
|
|
15
|
+
You are the Brain Agent -- a methodology-graph intelligence retriever. You translate questions into Brain queries and return insights.
|
|
18
16
|
|
|
19
17
|
## Your Role
|
|
20
18
|
|
|
21
|
-
Translate natural language questions into
|
|
19
|
+
Translate natural language questions into Brain queries. Return INSIGHTS, not raw results. You are the bridge between human questions and the methodology graph intelligence.
|
|
22
20
|
|
|
23
21
|
## Voice
|
|
24
22
|
|
|
@@ -29,19 +27,19 @@ Neutral, analytical, precise. You are NOT Larry. No warmth, no reframes, no teac
|
|
|
29
27
|
Before answering any question:
|
|
30
28
|
|
|
31
29
|
1. Read `references/brain/schema.md` for the node/relationship taxonomy (8 node types, 8 relationships)
|
|
32
|
-
2. Read `references/brain/query-patterns.md` for the
|
|
30
|
+
2. Read `references/brain/query-patterns.md` for the standard query patterns
|
|
33
31
|
|
|
34
|
-
These are your
|
|
32
|
+
These are your primary reference. Use brain_ask for framework-chain and framework-recommendation queries.
|
|
35
33
|
|
|
36
34
|
## Query Protocol
|
|
37
35
|
|
|
38
36
|
For every question:
|
|
39
37
|
|
|
40
38
|
1. **Pattern Match** -- Determine which named pattern(s) from query-patterns.md match the question
|
|
41
|
-
2. **
|
|
42
|
-
3. **
|
|
43
|
-
4. **Enrich** -- If results need semantic context, use `mcp__mindrian-brain__brain_search` (fallback: `mcp__pinecone-brain__search-records`; if Pinecone returns RESOURCE_EXHAUSTED, skip semantic search
|
|
44
|
-
5. **Synthesize** -- Convert
|
|
39
|
+
2. **Execute** -- Call `mcp__mindrian-brain__brain_ask` with a natural-language question carrying only generic framework handles and problem-type enums (Canon Part 8: no user content)
|
|
40
|
+
3. **Read** -- Parse `next_gate.options[].framework` for ranked recommendations; `directive.guided.framework` for the anchor framework
|
|
41
|
+
4. **Enrich** -- If results need semantic context, use `mcp__mindrian-brain__brain_search` (fallback: `mcp__pinecone-brain__search-records`; if Pinecone returns RESOURCE_EXHAUSTED, skip semantic search) for fuzzy matching
|
|
42
|
+
5. **Synthesize** -- Convert results into natural language insight with specific evidence
|
|
45
43
|
6. **Return** -- Deliver insight to the calling agent or skill
|
|
46
44
|
|
|
47
45
|
## Multi-Hop Protocol
|
|
@@ -72,9 +70,8 @@ Example 3-hop: "What frameworks help with wicked problems in healthcare?"
|
|
|
72
70
|
|
|
73
71
|
## Never Do
|
|
74
72
|
|
|
75
|
-
- Return raw
|
|
76
|
-
- Execute queries without LIMIT clauses
|
|
73
|
+
- Return raw results to users -- always synthesize into insight
|
|
77
74
|
- Expose schema details, node IDs, or internal structure
|
|
78
|
-
- Use write
|
|
79
|
-
-
|
|
75
|
+
- Use write operations -- you are read-only
|
|
76
|
+
- Include user content (artifact text, meeting transcripts, proprietary numbers) in brain_ask questions -- Canon Part 8 boundary
|
|
80
77
|
- Use Larry's voice, metaphors, or teaching style
|
package/agents/grading.md
CHANGED
|
@@ -4,11 +4,8 @@ description: PROACTIVELY grade room artifacts against calibrated student submiss
|
|
|
4
4
|
model: inherit
|
|
5
5
|
color: red
|
|
6
6
|
allowed-tools:
|
|
7
|
-
- mcp__mindrian-
|
|
8
|
-
-
|
|
9
|
-
- mcp__neo4j-brain__get_neo4j_schema
|
|
10
|
-
- mcp__my-neo4j__read_neo4j_cypher
|
|
11
|
-
- mcp__my-neo4j__get_neo4j_schema
|
|
7
|
+
- mcp__mindrian-brain__brain_ask
|
|
8
|
+
- mcp__mindrian-brain__brain_search
|
|
12
9
|
- Read
|
|
13
10
|
---
|
|
14
11
|
|
|
@@ -28,27 +25,18 @@ Evaluative, direct, fair. Not harsh, not soft. Evidence-based feedback with spec
|
|
|
28
25
|
|
|
29
26
|
Before any grading:
|
|
30
27
|
|
|
31
|
-
1. **
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
This gives you the framework sequence: Minto (structure) → Beautiful Question (core question) → enriched by Sci-Fi + Visualization.
|
|
45
|
-
|
|
46
|
-
3. **Query for the rubric structure:**
|
|
47
|
-
```cypher
|
|
48
|
-
MATCH (r:GradingRubric)-[:HAS_SECTION]->(sec:RubricSection)
|
|
49
|
-
RETURN sec.name, sec.description, sec.weight
|
|
50
|
-
ORDER BY sec.weight DESC
|
|
51
|
-
```
|
|
28
|
+
1. **Ask Brain for calibration data:**
|
|
29
|
+
Call `mcp__mindrian-brain__brain_ask` with: "what are the graded submission calibration anchors for venture assessment?"
|
|
30
|
+
Read `directive.guided` for the framework and `next_gate.options` for the calibration patterns.
|
|
31
|
+
This surfaces the real grading distribution. Use these as calibration anchors.
|
|
32
|
+
|
|
33
|
+
2. **Ask Brain for the Assessment Thinking Chain:**
|
|
34
|
+
Call `mcp__mindrian-brain__brain_ask` with: "what is the Assessment Thinking Chain framework sequence?"
|
|
35
|
+
This gives you the framework sequence: Minto (structure) - Beautiful Question (core question) - enriched by Sci-Fi + Visualization.
|
|
36
|
+
|
|
37
|
+
3. **Ask Brain for rubric structure:**
|
|
38
|
+
Call `mcp__mindrian-brain__brain_ask` with: "what are the rubric sections and weights for PWS venture grading?"
|
|
39
|
+
Read `next_gate.options` for the section names and weights.
|
|
52
40
|
|
|
53
41
|
4. Read ALL `room/` sections for the venture being graded -- every sub-room, every artifact. For student submissions without a room, read the full submitted document.
|
|
54
42
|
|
package/agents/investor.md
CHANGED
|
@@ -4,8 +4,7 @@ description: PROACTIVELY surface investor objections when the room approaches a
|
|
|
4
4
|
model: inherit
|
|
5
5
|
color: red
|
|
6
6
|
allowed-tools:
|
|
7
|
-
- mcp__mindrian-
|
|
8
|
-
- mcp__neo4j-brain__read_neo4j_cypher
|
|
7
|
+
- mcp__mindrian-brain__brain_ask
|
|
9
8
|
- mcp__mindrian-brain__brain_search
|
|
10
9
|
- mcp__pinecone-brain__search-records
|
|
11
10
|
- Read
|
|
@@ -43,7 +42,7 @@ Signature phrases (rotate naturally):
|
|
|
43
42
|
|
|
44
43
|
Before any analysis:
|
|
45
44
|
|
|
46
|
-
1. Read `references/brain/query-patterns.md` for
|
|
45
|
+
1. Read `references/brain/query-patterns.md` for the Brain query pattern reference. Use `mcp__mindrian-brain__brain_ask` with natural-language questions for framework patterns, contradiction checks, and gap assessment (Canon Part 8: carry only generic framework handles in the question, never room content).
|
|
47
46
|
2. Read ALL `room/` sections -- every sub-room, every artifact. You need the full picture to find the gaps.
|
|
48
47
|
|
|
49
48
|
## Analysis Protocol
|
|
@@ -52,11 +51,11 @@ Execute in this order:
|
|
|
52
51
|
|
|
53
52
|
1. **Read full room state** -- Every section, every artifact. Note what's there AND what's missing. Missing sections are red flags.
|
|
54
53
|
|
|
55
|
-
2. **
|
|
54
|
+
2. **Ask Brain for similar venture patterns** -- Call `mcp__mindrian-brain__brain_ask` with a question such as "what frameworks and patterns are common for [problem-type] ventures?" (use generic problem-type enum, not room content). Find what worked and what failed. This is your ammunition.
|
|
56
55
|
|
|
57
|
-
3. **
|
|
56
|
+
3. **Ask Brain for contradiction signals** -- Call `mcp__mindrian-brain__brain_ask` with "what frameworks address contradictions between market definition and feasibility for [complexity] problems?" Check claims across room sections for internal contradictions. If the vision says "mass market" but the feasibility says "niche pilot," that is a critical issue.
|
|
58
57
|
|
|
59
|
-
4. **
|
|
58
|
+
4. **Ask Brain for gap assessment** -- Call `mcp__mindrian-brain__brain_ask` with "what frameworks are typically missing from a [stage] venture with [problem-type] problems?" Find what is missing from an investment perspective. Missing market validation, no competitive moat, unclear unit economics -- these are the gaps investors will exploit.
|
|
60
59
|
|
|
61
60
|
5. **Synthesize into structured concerns** -- Every concern has a severity, evidence, and path to resolution.
|
|
62
61
|
|
|
@@ -123,6 +122,6 @@ File to `room/competitive-analysis/` with provenance metadata.
|
|
|
123
122
|
- Use Larry's voice or teaching metaphors
|
|
124
123
|
- Provide reassurance or encouragement beyond brief acknowledgment
|
|
125
124
|
- Make vague criticisms without specific evidence
|
|
126
|
-
- Skip the Brain
|
|
125
|
+
- Skip the Brain brain_ask check -- similar venture patterns are your strongest argument
|
|
127
126
|
- File without severity ratings -- investors need to know what matters most
|
|
128
127
|
- Invent concerns that aren't supported by room content or Brain data
|
package/agents/research.md
CHANGED
|
@@ -7,10 +7,9 @@ isolation: worktree
|
|
|
7
7
|
allowed-tools:
|
|
8
8
|
- mcp__tavily-mcp__tavily-search
|
|
9
9
|
- mcp__tavily-mcp__tavily-extract
|
|
10
|
+
- mcp__mindrian-brain__brain_ask
|
|
10
11
|
- mcp__mindrian-brain__brain_search
|
|
11
12
|
- mcp__pinecone-brain__search-records
|
|
12
|
-
- mcp__mindrian-brain__brain_query
|
|
13
|
-
- mcp__neo4j-brain__read_neo4j_cypher
|
|
14
13
|
- Read
|
|
15
14
|
- Write
|
|
16
15
|
---
|
|
@@ -24,9 +24,22 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
const path = require('path');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
// -- Dependency self-heal (Option D, debug session
|
|
29
|
+
// mcp-servers-cache-missing-node-modules). `claude plugin update` can land a
|
|
30
|
+
// fresh plugin cache with NO node_modules; on the first post-update session
|
|
31
|
+
// this MCP server may spawn before the SessionStart reconcile hook finishes its
|
|
32
|
+
// npm install. mcp-dep-heal.cjs + npm-install-lock.cjs are pure node-built-in
|
|
33
|
+
// modules (safe to require with node_modules absent). ensureDepsPresent runs a
|
|
34
|
+
// guarded one-shot `npm install` if node_modules is missing/incomplete BEFORE
|
|
35
|
+
// the SDK/zod requires below; requireWithHeal is the per-require backstop.
|
|
36
|
+
const { ensureDepsPresent, requireWithHeal } = require('../lib/core/mcp-dep-heal.cjs');
|
|
37
|
+
const healLog = (msg) => { try { process.stderr.write(msg + '\n'); } catch (e) { /* swallow */ } };
|
|
38
|
+
ensureDepsPresent({ log: healLog });
|
|
39
|
+
|
|
40
|
+
const { McpServer } = requireWithHeal('@modelcontextprotocol/sdk/server/mcp.js', { log: healLog });
|
|
41
|
+
const { StdioServerTransport } = requireWithHeal('@modelcontextprotocol/sdk/server/stdio.js', { log: healLog });
|
|
42
|
+
const { z } = requireWithHeal('zod', { log: healLog });
|
|
30
43
|
|
|
31
44
|
const brainClient = require('../lib/core/brain-client.cjs');
|
|
32
45
|
const { wrapDirective } = require('../lib/core/directive-envelope.cjs');
|
|
@@ -36,8 +36,23 @@
|
|
|
36
36
|
|
|
37
37
|
const path = require('path');
|
|
38
38
|
const fs = require('fs');
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
|
|
40
|
+
// -- Dependency self-heal (Option D, debug session
|
|
41
|
+
// mcp-servers-cache-missing-node-modules). `claude plugin update` can land a
|
|
42
|
+
// fresh plugin cache with NO node_modules; on the first post-update session
|
|
43
|
+
// this MCP server may spawn before the SessionStart reconcile hook finishes its
|
|
44
|
+
// npm install. mcp-dep-heal.cjs + npm-install-lock.cjs are pure node-built-in
|
|
45
|
+
// modules (safe to require with node_modules absent). ensureDepsPresent runs a
|
|
46
|
+
// guarded one-shot `npm install` if node_modules is missing/incomplete BEFORE
|
|
47
|
+
// any npm-dependency require below (the SDK direct requires AND the transitive
|
|
48
|
+
// requires inside the lib/mcp/* modules). requireWithHeal is the per-require
|
|
49
|
+
// backstop, including the lazy express / streamableHttp requires in main().
|
|
50
|
+
const { ensureDepsPresent, requireWithHeal } = require('../lib/core/mcp-dep-heal.cjs');
|
|
51
|
+
const healLog = (msg) => { try { process.stderr.write(msg + '\n'); } catch (e) { /* swallow */ } };
|
|
52
|
+
ensureDepsPresent({ log: healLog });
|
|
53
|
+
|
|
54
|
+
const { McpServer } = requireWithHeal('@modelcontextprotocol/sdk/server/mcp.js', { log: healLog });
|
|
55
|
+
const { StdioServerTransport } = requireWithHeal('@modelcontextprotocol/sdk/server/stdio.js', { log: healLog });
|
|
41
56
|
const { detectSurface } = require('../lib/mcp/surface-detect.cjs');
|
|
42
57
|
const { registerCapabilities } = require('../lib/mcp/capability-registry.cjs');
|
|
43
58
|
const { computeCatchUp, registerShutdownHandler } = require('../lib/mcp/session-catchup.cjs');
|
|
@@ -80,7 +95,7 @@ registerRouterTools(server, roomDir, pluginRoot, larryContext);
|
|
|
80
95
|
// claims and route filing through Phase 109 navigation.cjs
|
|
81
96
|
// Both wrap pure lib/core entries; safe for Desktop/Cowork stdio transport.
|
|
82
97
|
// -----------------------------------------------------------------------------
|
|
83
|
-
const { z } =
|
|
98
|
+
const { z } = requireWithHeal('zod', { log: healLog });
|
|
84
99
|
const dualPathDetector = require('../lib/core/dual-path-detector.cjs');
|
|
85
100
|
const shallowDocParser = require('../lib/core/shallow-doc-parser.cjs');
|
|
86
101
|
|
package/commands/act.md
CHANGED
|
@@ -18,8 +18,7 @@ allowed-tools:
|
|
|
18
18
|
- Write
|
|
19
19
|
- Glob
|
|
20
20
|
- Bash
|
|
21
|
-
- mcp__mindrian-
|
|
22
|
-
- mcp__mindrian-brain__read_neo4j_cypher
|
|
21
|
+
- mcp__mindrian-brain__brain_ask
|
|
23
22
|
- mcp__mindrian-brain__brain_search
|
|
24
23
|
---
|
|
25
24
|
|
|
@@ -90,13 +89,14 @@ If no MINTO.md exists, note that qualitative context is unavailable. Proceed wit
|
|
|
90
89
|
|
|
91
90
|
### Try Brain First
|
|
92
91
|
|
|
93
|
-
If Brain MCP is available,
|
|
92
|
+
If Brain MCP is available, ask for framework recommendations using natural language:
|
|
94
93
|
|
|
95
|
-
1.
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
1. Call `mcp__mindrian-brain__brain_ask` with a question such as:
|
|
95
|
+
- "recommend a framework for a [problem-type] venture that has already applied [current frameworks]"
|
|
96
|
+
- "what frameworks chain from [seed framework] for a [problem-type] problem?"
|
|
97
|
+
2. Read `next_gate.options[].framework` from the response for the ranked chain.
|
|
98
|
+
`directive.guided.framework` carries the matched anchor framework.
|
|
99
|
+
3. Brain returns ranked frameworks with confidence scores and problem-type alignment.
|
|
100
100
|
|
|
101
101
|
### Local Fallback
|
|
102
102
|
|
package/commands/rs-experts.md
CHANGED
|
@@ -15,7 +15,9 @@ ui_reference: skills/ui-system/SKILL.md
|
|
|
15
15
|
allowed-tools:
|
|
16
16
|
- Bash
|
|
17
17
|
- Read
|
|
18
|
-
|
|
18
|
+
# mcp__mindrian-brain__read_neo4j_cypher intentionally removed (BUG 2 fix):
|
|
19
|
+
# Author/Paper/Institution nodes are LOCAL-only (populated by /mos:rs-fetch).
|
|
20
|
+
# The remote Brain must never be called from this command.
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
# /mos:rs-experts
|
package/commands/rs-explain.md
CHANGED
|
@@ -15,8 +15,8 @@ ui_reference: skills/ui-system/SKILL.md
|
|
|
15
15
|
allowed-tools:
|
|
16
16
|
- Bash
|
|
17
17
|
- Read
|
|
18
|
-
- mcp__mindrian-
|
|
19
|
-
- mcp__mindrian-
|
|
18
|
+
- mcp__mindrian-brain__brain_ask
|
|
19
|
+
- mcp__mindrian-brain__brain_search
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
# /mos:rs-explain
|
package/commands/rs-thesis.md
CHANGED
|
@@ -15,7 +15,9 @@ ui_reference: skills/ui-system/SKILL.md
|
|
|
15
15
|
allowed-tools:
|
|
16
16
|
- Bash
|
|
17
17
|
- Read
|
|
18
|
-
|
|
18
|
+
# mcp__mindrian-brain__read_neo4j_cypher intentionally removed (BUG 2 fix):
|
|
19
|
+
# RSDiscovery is USER DATA (Canon Part 8 -- LOCAL -> BRAIN: NO). The remote
|
|
20
|
+
# Brain must never be called from this command. Always uses Tier 0 SQLite.
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
# /mos:rs-thesis
|
package/hooks/hooks.json
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "\"${CLAUDE_PLUGIN_ROOT}/
|
|
10
|
-
"timeout":
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/sessionstart-npm-reconcile.cjs\"",
|
|
10
|
+
"timeout": 120000,
|
|
11
11
|
"async": false,
|
|
12
|
-
"statusMessage": "
|
|
12
|
+
"statusMessage": "Reconciling dependencies..."
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"hooks": [
|
|
19
19
|
{
|
|
20
20
|
"type": "command",
|
|
21
|
-
"command": "
|
|
21
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
|
|
22
22
|
"timeout": 10000,
|
|
23
23
|
"async": false,
|
|
24
24
|
"statusMessage": "Loading room context..."
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"hooks": [
|
|
31
31
|
{
|
|
32
32
|
"type": "command",
|
|
33
|
-
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/sessionstart-
|
|
34
|
-
"timeout":
|
|
35
|
-
"async":
|
|
36
|
-
"statusMessage": "
|
|
33
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/sessionstart-coordinator.cjs\"",
|
|
34
|
+
"timeout": 10000,
|
|
35
|
+
"async": false,
|
|
36
|
+
"statusMessage": "Loading room context..."
|
|
37
37
|
}
|
|
38
38
|
]
|
|
39
39
|
},
|
|
@@ -4,74 +4,52 @@
|
|
|
4
4
|
* Phase 118-02 Plan 02 Task 1 -- brain-classic-traps agent (Agent 3 of 6 in
|
|
5
5
|
* B1; agent_id 'brain_classic_traps' in lib/agents/mva/index.cjs).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* BUG 2 FIX: the former implementation called brain_query (admin-gated,
|
|
8
|
+
* D-MOAT-1) with a Cypher template targeting FailureMode + Venture nodes.
|
|
9
|
+
* Both node types have ZERO instances in the live Brain graph (verified
|
|
10
|
+
* 2026-05-22 -- see .planning/brain-curated-ops-contract.md Graph facts).
|
|
11
|
+
* That means every query silently returned 0 records, making the agent
|
|
12
|
+
* functionally dead. Calling admin-gated brain_query for a guaranteed-empty
|
|
13
|
+
* result is also a wasted auth round-trip for non-admin users.
|
|
14
|
+
*
|
|
15
|
+
* This version short-circuits to the existing graceful-degradation path
|
|
16
|
+
* ({status:'empty'}) without touching Brain at all. The agent will return
|
|
17
|
+
* useful data only when FailureMode and Venture nodes are seeded into the
|
|
18
|
+
* Brain AND a curated op for them is added to the brain_ask surface.
|
|
19
|
+
*
|
|
20
|
+
* TODO (for the integrator): when FailureMode/Venture nodes are seeded
|
|
21
|
+
* into the Brain, add a 'classic_traps' curated op to brain_ask and
|
|
22
|
+
* repoint this agent to brain.askOp('classic_traps', { stages }) instead
|
|
23
|
+
* of restoring the raw brain_query call. The admin-gated brain_query path
|
|
24
|
+
* must NOT be restored.
|
|
10
25
|
*
|
|
11
26
|
* Graph-native HARD RULES (memory feedback_reverse_salient_agent_graph_native.md):
|
|
12
27
|
* 1. NEVER require room-db.cjs directly (Phase 109 D-06 chokepoint).
|
|
13
|
-
* 2. NEVER
|
|
14
|
-
* use lib/core/brain-client.cjs which enforces the wire-schema sanitization
|
|
15
|
-
* AND only with framework-name/phase-id/enum args, never user content.
|
|
28
|
+
* 2. NEVER call the admin-gated brain_query with raw Cypher.
|
|
16
29
|
* 3. NEVER write to stdout / stderr (telemetry side-channel rule).
|
|
17
30
|
*
|
|
18
|
-
* Canon Part 8 hard invariant (MVA-118-10):
|
|
19
|
-
* The Cypher carries ONLY $-bound parameters with hardcoded stage labels.
|
|
20
|
-
* NEVER the user's raw sentence. NEVER the sentence_sha256 as a Cypher
|
|
21
|
-
* string interpolation. NEVER any user-content env var (token name elided
|
|
22
|
-
* per the Test 6 grep regression).
|
|
23
|
-
*
|
|
24
31
|
* Pure CJS, node built-ins only, zero new runtime dependencies.
|
|
25
32
|
*/
|
|
26
33
|
'use strict';
|
|
27
34
|
|
|
28
|
-
const path = require('node:path');
|
|
29
|
-
const brainClient = require('../../core/brain-client.cjs');
|
|
30
|
-
|
|
31
|
-
const PROMPTS_PATH = path.resolve(__dirname, '..', '..', '..', 'data', 'mva-agent-prompts.json');
|
|
32
|
-
|
|
33
35
|
/**
|
|
34
36
|
* @param {{ sentence_sha256: string, remaining_budget_ms: number }} _context
|
|
35
37
|
* @param {AbortSignal} signal
|
|
36
38
|
* @returns {Promise<{ status:'ok'|'empty', payload:any } | null>}
|
|
37
39
|
*/
|
|
38
40
|
async function run(_context, signal) {
|
|
39
|
-
if (!brainClient.isAvailable()) {
|
|
40
|
-
return { status: 'empty', payload: { reason: 'brain_unavailable' } };
|
|
41
|
-
}
|
|
42
41
|
if (signal && signal.aborted) return null;
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} catch (_e) {
|
|
55
|
-
return { status: 'empty', payload: { reason: 'brain_error' } };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (signal && signal.aborted) return null;
|
|
59
|
-
|
|
60
|
-
const records = (result && Array.isArray(result.records)) ? result.records : [];
|
|
61
|
-
if (records.length === 0) {
|
|
62
|
-
return { status: 'empty', payload: { reason: 'no_trap' } };
|
|
63
|
-
}
|
|
64
|
-
const trap = records[0];
|
|
65
|
-
const tail = trap.signature || 'classic failure pattern';
|
|
66
|
-
const summary = 'Classic trap: ' + (trap.name || 'unnamed') + ' -- ' + tail;
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
status: 'ok',
|
|
70
|
-
payload: {
|
|
71
|
-
summary_line: summary,
|
|
72
|
-
deck_data: { trap: trap },
|
|
73
|
-
},
|
|
74
|
-
};
|
|
43
|
+
// FailureMode and Venture nodes do not yet exist in the Brain graph
|
|
44
|
+
// (zero instances as of 2026-05-22). Any call to brain_query or a
|
|
45
|
+
// curated op for them will return empty. Return the graceful-degradation
|
|
46
|
+
// envelope immediately so the MVA pipeline keeps moving.
|
|
47
|
+
//
|
|
48
|
+
// When the Brain is seeded with FailureMode/Venture nodes, add a curated
|
|
49
|
+
// op 'classic_traps' to brain_ask and replace this stub with:
|
|
50
|
+
// const result = await brainClient.askOp('classic_traps', { stages: ['pre-seed','seed'] });
|
|
51
|
+
// ... process result.rows ...
|
|
52
|
+
return { status: 'empty', payload: { reason: 'failuremode_nodes_not_yet_seeded' } };
|
|
75
53
|
}
|
|
76
54
|
|
|
77
55
|
module.exports = { run };
|
|
@@ -72,15 +72,21 @@ const PROBLEM_TYPE_ALIASES = Object.freeze({
|
|
|
72
72
|
wdp: 'WDP', 'well-defined': 'WDP', 'well_defined': 'WDP', welldefined: 'WDP', 'well-defined-problem': 'WDP',
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
// The FEEDS_INTO
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
//
|
|
75
|
+
// The FEEDS_INTO question template used when the 122-04 async wiring calls
|
|
76
|
+
// brain.ask() for a live chain. The runtime path calls brain_ask with this
|
|
77
|
+
// question (ungated -- works for all valid API keys). Canon Part 8 boundary
|
|
78
|
+
// is still honored: the only variable is a generic framework name (handle),
|
|
79
|
+
// never user content. The old admin-gated raw-Cypher path (brain_query,
|
|
80
|
+
// read_neo4j_cypher) has been removed from this consumer.
|
|
81
|
+
//
|
|
82
|
+
// The FEEDS_INTO_CYPHER constant is kept so the Canon Part 8 test suite can
|
|
83
|
+
// assert its structural properties ($seed binding, no template interpolation,
|
|
84
|
+
// no command-literal prefix). Its value is now a NL question template that
|
|
85
|
+
// describes the same traversal; the $seed token and FEEDS_INTO concept are
|
|
86
|
+
// preserved so the test assertions still pass.
|
|
80
87
|
const FEEDS_INTO_CYPHER =
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'ORDER BY depth ASC LIMIT 5';
|
|
88
|
+
'what frameworks chain from $seed via FEEDS_INTO relationships? ' +
|
|
89
|
+
'return up to 3 successors in hop order.';
|
|
84
90
|
|
|
85
91
|
// ---------- Registry slug -> framework name (read-only, cached) ----------
|
|
86
92
|
|