@danielmarbach/mnemonic-mcp 0.28.0 → 0.30.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/CHANGELOG.md +17 -1
- package/README.md +7 -0
- package/build/cache.d.ts.map +1 -1
- package/build/cache.js +9 -9
- package/build/cache.js.map +1 -1
- package/build/cli/import-claude-memory.d.ts.map +1 -1
- package/build/cli/import-claude-memory.js +3 -1
- package/build/cli/import-claude-memory.js.map +1 -1
- package/build/config.d.ts.map +1 -1
- package/build/config.js +20 -18
- package/build/config.js.map +1 -1
- package/build/context.d.ts.map +1 -1
- package/build/context.js +8 -2
- package/build/context.js.map +1 -1
- package/build/domain-errors.d.ts +49 -0
- package/build/domain-errors.d.ts.map +1 -0
- package/build/domain-errors.js +99 -0
- package/build/domain-errors.js.map +1 -0
- package/build/embeddings.d.ts.map +1 -1
- package/build/embeddings.js +18 -10
- package/build/embeddings.js.map +1 -1
- package/build/error-utils.d.ts +30 -0
- package/build/error-utils.d.ts.map +1 -1
- package/build/error-utils.js +56 -0
- package/build/error-utils.js.map +1 -1
- package/build/git.d.ts.map +1 -1
- package/build/git.js +6 -2
- package/build/git.js.map +1 -1
- package/build/helpers/embed.d.ts.map +1 -1
- package/build/helpers/embed.js +10 -12
- package/build/helpers/embed.js.map +1 -1
- package/build/helpers/persistence.d.ts.map +1 -1
- package/build/helpers/persistence.js +3 -2
- package/build/helpers/persistence.js.map +1 -1
- package/build/migration.d.ts.map +1 -1
- package/build/migration.js +7 -4
- package/build/migration.js.map +1 -1
- package/build/project-introspection.d.ts.map +1 -1
- package/build/project-introspection.js +3 -1
- package/build/project-introspection.js.map +1 -1
- package/build/project.d.ts.map +1 -1
- package/build/project.js +24 -37
- package/build/project.js.map +1 -1
- package/build/projections.js +1 -1
- package/build/projections.js.map +1 -1
- package/build/provenance.d.ts +8 -2
- package/build/provenance.d.ts.map +1 -1
- package/build/provenance.js +40 -6
- package/build/provenance.js.map +1 -1
- package/build/recall.d.ts.map +1 -1
- package/build/recall.js +2 -1
- package/build/recall.js.map +1 -1
- package/build/relationships.d.ts.map +1 -1
- package/build/relationships.js +6 -6
- package/build/relationships.js.map +1 -1
- package/build/semantic-patch.d.ts.map +1 -1
- package/build/semantic-patch.js +6 -5
- package/build/semantic-patch.js.map +1 -1
- package/build/storage.d.ts.map +1 -1
- package/build/storage.js +38 -56
- package/build/storage.js.map +1 -1
- package/build/structured-content.d.ts +34 -0
- package/build/structured-content.d.ts.map +1 -1
- package/build/structured-content.js +16 -0
- package/build/structured-content.js.map +1 -1
- package/build/temporal-interpretation.d.ts.map +1 -1
- package/build/temporal-interpretation.js +3 -2
- package/build/temporal-interpretation.js.map +1 -1
- package/build/tools/consolidate-helpers.d.ts.map +1 -1
- package/build/tools/consolidate-helpers.js +11 -11
- package/build/tools/consolidate-helpers.js.map +1 -1
- package/build/tools/migration.d.ts.map +1 -1
- package/build/tools/migration.js +6 -5
- package/build/tools/migration.js.map +1 -1
- package/build/tools/recall-helpers.d.ts +12 -0
- package/build/tools/recall-helpers.d.ts.map +1 -1
- package/build/tools/recall-helpers.js +81 -1
- package/build/tools/recall-helpers.js.map +1 -1
- package/build/tools/recall.d.ts.map +1 -1
- package/build/tools/recall.js +81 -11
- package/build/tools/recall.js.map +1 -1
- package/build/tools/remember.d.ts.map +1 -1
- package/build/tools/remember.js +10 -10
- package/build/tools/remember.js.map +1 -1
- package/build/tools/update.d.ts.map +1 -1
- package/build/tools/update.js +28 -29
- package/build/tools/update.js.map +1 -1
- package/build/vault.d.ts.map +1 -1
- package/build/vault.js +35 -50
- package/build/vault.js.map +1 -1
- package/package.json +4 -2
- package/skills/mnemonic-rpi-workflow/SKILL.md +48 -17
package/build/vault.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "fs/promises";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { simpleGit } from "simple-git";
|
|
4
|
-
import { debugLog, getErrorMessage } from "./error-utils.js";
|
|
4
|
+
import { attempt, debugLog, getErrorMessage } from "./error-utils.js";
|
|
5
5
|
import { Storage } from "./storage.js";
|
|
6
6
|
import { memoryId } from "./brands.js";
|
|
7
7
|
import { GitOps } from "./git.js";
|
|
@@ -200,58 +200,48 @@ function makeVault(vaultPath, gitRoot, notesRelDir, isProject, vaultFolderName,
|
|
|
200
200
|
* namespaces for submodule-specific context while sharing the same git history.
|
|
201
201
|
*/
|
|
202
202
|
async function discoverSubmoduleVaultFolders(gitRoot) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
.filter(e => e.isDirectory() && e.name.startsWith(".mnemonic-"))
|
|
207
|
-
.map(e => e.name)
|
|
208
|
-
.sort();
|
|
209
|
-
}
|
|
210
|
-
catch (err) {
|
|
211
|
-
debugLog("vault:discover-submodules", `failed: ${getErrorMessage(err)}`);
|
|
203
|
+
const result = await attempt("vault:discover-submodules", () => fs.readdir(gitRoot, { withFileTypes: true }));
|
|
204
|
+
if (!result.ok) {
|
|
205
|
+
debugLog("vault:discover-submodules", `failed: ${getErrorMessage(result.error)}`);
|
|
212
206
|
return [];
|
|
213
207
|
}
|
|
208
|
+
return result.value
|
|
209
|
+
.filter(e => e.isDirectory() && e.name.startsWith(".mnemonic-"))
|
|
210
|
+
.map(e => e.name)
|
|
211
|
+
.sort();
|
|
214
212
|
}
|
|
215
213
|
async function findGitRoot(cwd, visited = new Set()) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return null;
|
|
222
|
-
// Guard against infinite recursion in pathological submodule configurations.
|
|
223
|
-
if (visited.has(trimmedRoot))
|
|
224
|
-
return trimmedRoot;
|
|
225
|
-
visited.add(trimmedRoot);
|
|
226
|
-
// When inside a git submodule, walk up to the top-level superproject root
|
|
227
|
-
// so that project vaults are always anchored at the main repository.
|
|
228
|
-
try {
|
|
229
|
-
const superproject = await git.revparse(["--show-superproject-working-tree"]);
|
|
230
|
-
const trimmedSuperproject = superproject.trim();
|
|
231
|
-
if (trimmedSuperproject) {
|
|
232
|
-
return findGitRoot(trimmedSuperproject, visited);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
catch {
|
|
236
|
-
debugLog("vault:find-git-root", "not inside a submodule or flag unsupported, using current root");
|
|
237
|
-
}
|
|
238
|
-
return trimmedRoot;
|
|
214
|
+
const git = simpleGit(cwd);
|
|
215
|
+
const rootResult = await attempt("vault:find-git-root", () => git.revparse(["--show-toplevel"]));
|
|
216
|
+
if (!rootResult.ok) {
|
|
217
|
+
debugLog("vault:find-git-root", `failed: ${getErrorMessage(rootResult.error)}`);
|
|
218
|
+
return null;
|
|
239
219
|
}
|
|
240
|
-
|
|
241
|
-
|
|
220
|
+
const trimmedRoot = rootResult.value.trim();
|
|
221
|
+
if (!trimmedRoot)
|
|
242
222
|
return null;
|
|
223
|
+
if (visited.has(trimmedRoot))
|
|
224
|
+
return trimmedRoot;
|
|
225
|
+
visited.add(trimmedRoot);
|
|
226
|
+
const superResult = await attempt("vault:find-git-root:superproject", () => git.revparse(["--show-superproject-working-tree"]));
|
|
227
|
+
if (superResult.ok) {
|
|
228
|
+
const trimmedSuperproject = superResult.value.trim();
|
|
229
|
+
if (trimmedSuperproject) {
|
|
230
|
+
return findGitRoot(trimmedSuperproject, visited);
|
|
231
|
+
}
|
|
243
232
|
}
|
|
233
|
+
else {
|
|
234
|
+
debugLog("vault:find-git-root", "not inside a submodule or flag unsupported, using current root");
|
|
235
|
+
}
|
|
236
|
+
return trimmedRoot;
|
|
244
237
|
}
|
|
245
238
|
export async function ensureGitignore(ignorePath) {
|
|
246
239
|
const requiredLines = ["embeddings/", "projections/"];
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
existing
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
debugLog("vault:ensure-gitignore", `no existing gitignore: ${getErrorMessage(err)}`);
|
|
253
|
-
existing = "";
|
|
254
|
-
}
|
|
240
|
+
const existingResult = await attempt("vault:ensure-gitignore", () => fs.readFile(ignorePath, "utf-8"));
|
|
241
|
+
const existing = existingResult.ok ? existingResult.value : (() => {
|
|
242
|
+
debugLog("vault:ensure-gitignore", `no existing gitignore: ${getErrorMessage(existingResult.error)}`);
|
|
243
|
+
return "";
|
|
244
|
+
})();
|
|
255
245
|
const missing = requiredLines.filter(line => !existing.includes(line));
|
|
256
246
|
if (missing.length === 0)
|
|
257
247
|
return;
|
|
@@ -259,12 +249,7 @@ export async function ensureGitignore(ignorePath) {
|
|
|
259
249
|
await fs.writeFile(ignorePath, updated);
|
|
260
250
|
}
|
|
261
251
|
async function pathExists(p) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
catch {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
252
|
+
const result = await attempt("vault:pathExists", () => fs.access(p));
|
|
253
|
+
return result.ok;
|
|
269
254
|
}
|
|
270
255
|
//# sourceMappingURL=vault.js.map
|
package/build/vault.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAa,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,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M,aAAa,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACtD,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAClE,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CACjC,CAAC;IACF,MAAM,QAAQ,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;QAChE,QAAQ,CAAC,wBAAwB,EAAE,0BAA0B,eAAe,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtG,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,EAAE,CAAC;IACL,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtE,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,CAAS;IACjC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielmarbach/mnemonic-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "A local MCP memory server backed by markdown + JSON files, synced via git",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"skills:update": "node scripts/install-skills.mjs --target all --mode copy --update",
|
|
38
38
|
"test": "vitest run",
|
|
39
39
|
"test:watch": "vitest",
|
|
40
|
-
"typecheck": "tsc --noEmit"
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"lint:ast": "ast-grep scan"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@modelcontextprotocol/sdk": "^1.10.1",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"zod": "^4.3.6"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
54
|
+
"@ast-grep/cli": "^0.42.1",
|
|
53
55
|
"@types/node": "^24.0.0",
|
|
54
56
|
"typescript": "^6.0.0",
|
|
55
57
|
"vitest": "^4.0.18"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mnemonic-rpi-workflow
|
|
3
|
-
description: Executes multi-step research-plan-implement-review workflows using mnemonic for workflow artifacts. Triggers on multi-step feature or bugfix work, subagent handoffs, plan-heavy tasks, or any work needing structured RPIR artifacts with explicit handoffs and consistent role/relationship conventions.
|
|
3
|
+
description: Executes multi-step research-plan-implement-review workflows using mnemonic for workflow artifacts. Triggers on multi-step feature or bugfix work, subagent handoffs, plan-heavy tasks, or any work needing structured RPIR artifacts with explicit handoffs and consistent role/relationship conventions. Review phase always dispatches a fresh-context subagent with adversarial posture and constraint violation hunting.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# RPIR Workflow: Research → Plan → Implement → Review
|
|
@@ -58,32 +58,42 @@ Only after confirmation: proceed to Implement checklist.
|
|
|
58
58
|
- Link to plan note (`follows` for ordered steps).
|
|
59
59
|
- For non-trivial work, dispatch a subagent with narrow scope (see [handoff template](#subagent-handoff-template)).
|
|
60
60
|
|
|
61
|
-
### 4. Review
|
|
61
|
+
### 4. Review (Fresh-Context Subagent Required)
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
The implementer's own context is contaminated — they designed the code, so they see intent rather than behavior. Review must be performed by a fresh-context subagent that has no prior exposure to the implementation decisions.
|
|
64
|
+
|
|
65
|
+
**Before writing the review, the orchestrator must:**
|
|
66
|
+
1. `get` the research note(s), plan note, and apply/task note(s) linked to this work
|
|
65
67
|
2. Read the apply/task note(s) to confirm what actually shipped
|
|
68
|
+
3. Extract all explicit constraints from the plan (performance constraints, I/O constraints, fail-soft requirements, schema requirements, etc.) into a constraint checklist
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
**The review subagent receives the full artifact chain and must:**
|
|
71
|
+
|
|
72
|
+
**A. Constraint violation hunting (adversarial — prove violations don't exist)**
|
|
73
|
+
- Enumerate every explicit constraint from the plan (e.g., "no new I/O on cold paths", "fail-soft to undefined", "always populate contextual metrics", "every Zod field gets `.describe()`")
|
|
74
|
+
- For each constraint: cite the exact code path(s) that satisfy it, or flag it as a violation
|
|
75
|
+
- If any constraint is unmentioned in the apply note, flag it — silent omission is a violation
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
- Does the implementation satisfy
|
|
72
|
-
- Were all planned deliverables completed? If not, why?
|
|
77
|
+
**B. Deliverable completeness**
|
|
78
|
+
- Does the implementation satisfy every requirement from research?
|
|
79
|
+
- Were all planned deliverables completed? If not, why, and is the deferral explicit?
|
|
73
80
|
- Are there gaps between what was planned and what was delivered?
|
|
74
81
|
- Were any assumptions from research invalidated during implementation?
|
|
75
82
|
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
- Is any unchecked item silently ignored rather than called out?
|
|
83
|
+
**C. Fresh verification**
|
|
84
|
+
- Every verification command must be run fresh during this review — do not reuse results from implementation
|
|
85
|
+
- Record each command, result, and evidence
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
The review subagent must adopt an adversarial posture: assume violations exist and prove they don't. A review that only confirms what the apply note claims is not sufficient.
|
|
88
|
+
|
|
89
|
+
Create review notes: `role: review`, `lifecycle: temporary`.
|
|
90
|
+
Link to apply/task notes or plan (`derives-from` when conclusions derive from specific artifacts).
|
|
82
91
|
|
|
83
92
|
Record outcome: continue, block, or update plan.
|
|
84
93
|
Reconcile checklist state with verification evidence; call out any unchecked items explicitly.
|
|
85
94
|
If review causes a material plan change, update plan note first.
|
|
86
|
-
|
|
95
|
+
|
|
96
|
+
Every review note must include verification evidence:
|
|
87
97
|
|
|
88
98
|
```text
|
|
89
99
|
- Command: <run command>
|
|
@@ -91,6 +101,14 @@ Every verification command must be run fresh during this review — do not reuse
|
|
|
91
101
|
- Details: <counts, errors>
|
|
92
102
|
```
|
|
93
103
|
|
|
104
|
+
And a constraint checklist:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
| Constraint | Status | Evidence |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| <constraint from plan> | pass/fail | <code path or violation detail> |
|
|
110
|
+
```
|
|
111
|
+
|
|
94
112
|
### 5. Consolidate
|
|
95
113
|
|
|
96
114
|
- Create permanent decision note(s) and summary note(s).
|
|
@@ -117,7 +135,7 @@ Must return: apply note content, optional review note, recommendation (continue
|
|
|
117
135
|
|
|
118
136
|
### Review Handoff Variant
|
|
119
137
|
|
|
120
|
-
|
|
138
|
+
Dispatch a fresh-context subagent with the full artifact chain. The reviewer has no prior exposure to implementation decisions and must adopt an adversarial posture.
|
|
121
139
|
|
|
122
140
|
```text
|
|
123
141
|
Request note: <note-id/title>
|
|
@@ -126,12 +144,25 @@ Plan note: <note-id/title>
|
|
|
126
144
|
Apply/task notes: <note-id/title>, ...
|
|
127
145
|
Durable context: <note-id/title>, ...
|
|
128
146
|
|
|
147
|
+
Constraint checklist (extracted from plan):
|
|
148
|
+
| Constraint | Status | Evidence |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| <explicit constraint from plan> | ? | <to be verified> |
|
|
151
|
+
|
|
129
152
|
Review scope:
|
|
130
153
|
- What was planned: <summary from plan note>
|
|
131
154
|
- What was implemented: <summary from apply note>
|
|
132
155
|
- Validation: <tests/checks>
|
|
133
156
|
|
|
134
|
-
|
|
157
|
+
Adversarial review mandate:
|
|
158
|
+
1. Assume violations exist — prove they don't
|
|
159
|
+
2. For each explicit plan constraint: cite the code path that satisfies it, or flag it as a violation
|
|
160
|
+
3. For each research requirement: confirm it is addressed or explicitly deferred
|
|
161
|
+
4. For each plan deliverable: verify matching evidence exists
|
|
162
|
+
5. Run all verification commands fresh — do not reuse implementation results
|
|
163
|
+
6. If a constraint is not mentioned in the apply note, flag it as a potential violation
|
|
164
|
+
|
|
165
|
+
Return: review note content with constraint checklist, recommendation (continue | block | update plan), and any unchecked items.
|
|
135
166
|
```
|
|
136
167
|
|
|
137
168
|
## Canonical Graph
|