memtrace-skills 0.8.11 → 0.8.12

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.
@@ -28,6 +28,41 @@ function writeSkill(skill, rootDir) {
28
28
  function isRecord(value) {
29
29
  return typeof value === 'object' && value !== null && !Array.isArray(value);
30
30
  }
31
+ function hasGitDir(dir) {
32
+ return fs.existsSync(path.join(dir, '.git'));
33
+ }
34
+ function isFolderGroup(dir) {
35
+ if (hasGitDir(dir))
36
+ return false;
37
+ let count = 0;
38
+ let entries;
39
+ try {
40
+ entries = fs.readdirSync(dir, { withFileTypes: true });
41
+ }
42
+ catch {
43
+ return false;
44
+ }
45
+ for (const entry of entries) {
46
+ if (!entry.isDirectory())
47
+ continue;
48
+ if (hasGitDir(path.join(dir, entry.name)))
49
+ count++;
50
+ if (count >= 2)
51
+ return true;
52
+ }
53
+ return false;
54
+ }
55
+ function cursorWorkspaceBoundaryWarnings(ctx) {
56
+ if (ctx.scope !== 'local')
57
+ return [];
58
+ if (!isFolderGroup(ctx.cwd))
59
+ return [];
60
+ if (fs.existsSync(path.join(ctx.cwd, '.memtrace-workspace')))
61
+ return [];
62
+ return [
63
+ `Cursor install target ${ctx.cwd} contains multiple sibling git repos but is not a blessed Memtrace workspace. For separate MemDBs, install/open each repo root. To intentionally share one MemDB, run 'memtrace start --bless-workspace' from ${ctx.cwd}, then verify with 'memtrace workspace status ${ctx.cwd}'.`,
64
+ ];
65
+ }
31
66
  export function registerCursorMcpAt(mcpFile, binary) {
32
67
  const { value, corrupted, backupPath } = safeReadJson(mcpFile);
33
68
  if (corrupted) {
@@ -59,6 +94,7 @@ export const cursorTransformer = {
59
94
  name: 'cursor',
60
95
  async install(skills, ctx) {
61
96
  const rootDir = skillsRoot(ctx);
97
+ const warnings = cursorWorkspaceBoundaryWarnings(ctx);
62
98
  if (fs.existsSync(rootDir)) {
63
99
  for (const entry of fs.readdirSync(rootDir)) {
64
100
  if (entry.startsWith('memtrace-')) {
@@ -72,6 +108,9 @@ export const cursorTransformer = {
72
108
  if (!ctx.skipMcp) {
73
109
  const result = registerCursorMcpAt(mcpPath(ctx), ctx.memtraceBinary);
74
110
  mcpRegistered = result.registered;
111
+ if (!mcpRegistered && result.backupPath) {
112
+ warnings.push(`Cursor MCP config was malformed; backed up to ${result.backupPath}.`);
113
+ }
75
114
  }
76
115
  // ─── memtrace-rail ─── Wire the Memtrace-first discovery hook (default
77
116
  // observe). Failure must not block the rest of the install.
@@ -87,7 +126,7 @@ export const cursorTransformer = {
87
126
  skillsDir: rootDir,
88
127
  mcpConfigPath: mcpPath(ctx),
89
128
  mcpRegistered,
90
- warnings: [],
129
+ warnings,
91
130
  };
92
131
  },
93
132
  async uninstall(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memtrace-skills",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "Memtrace skills for AI coding agents — codebase exploration, temporal evolution, impact analysis, and more.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memtrace-skills",
3
3
  "description": "Memtrace skills for codebase exploration, code search, relationship analysis, temporal evolution, blast radius impact, code quality, graph algorithms, API topology, GitHub PR code review, multi-agent fleet coordination (branch-scoped intents, conflict classification, and agent-judged Class C resolution), and multi-step workflows for change impact, incident investigation, refactoring, session continuity, co-change analysis, and episode replay, Cortex decision memory (decision recall, provenance, intent verification), session bookends (daily briefing, hotspots, self-audit), and single-symbol pre-edit preflight checks.",
4
- "version": "0.8.11",
4
+ "version": "0.8.12",
5
5
  "author": {
6
6
  "name": "Syncable",
7
7
  "email": "support@syncable.dev"
@@ -31,7 +31,10 @@ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bun
31
31
  - Do not create benchmark-specific or PR-specific findings. The review must come from general Memtrace detectors, graph evidence, and policy ranking.
32
32
  - If the tool reports missing auth, tell the user to run `memtrace auth login`.
33
33
  - If the tool reports missing GitHub App installation, tell the user to install Memtrace Code Reviewer on that repository.
34
- - If the tool reports missing local graph context, tell the user to run `memtrace index .` at the workspace root.
34
+ - If the tool reports missing local graph context, tell the user to run
35
+ `memtrace index .` from the actual repo root. If the open folder is a parent
36
+ containing multiple independent repos, do not index the parent unless the user
37
+ explicitly wants a shared workspace.
35
38
 
36
39
  ## Output
37
40
 
@@ -51,6 +51,24 @@ Memtrace:
51
51
  root with `incremental: true` (or ask before `clear_existing: true`).
52
52
  5. Report the indexing coverage problem instead of silently switching to grep.
53
53
 
54
+ ### Workspace Boundary Check
55
+
56
+ Before indexing or reindexing, make sure the target path is the repo the user
57
+ asked about. If the current folder is only a parent that contains multiple
58
+ independent git repos, do **not** index the parent just because it is the open
59
+ editor folder. That creates or reuses a shared `.memdb` and can make agents
60
+ answer from stale repos.
61
+
62
+ - For separate repos: use the actual git repo root as the `index_directory`
63
+ path, or ask the user to open/run the agent from that repo root.
64
+ - For an intentional shared workspace: the user should bless it explicitly with
65
+ `memtrace start --bless-workspace`, then verify it with
66
+ `memtrace workspace status <path>`; the workspace marker should be present.
67
+ - If `list_indexed_repositories` returns empty or its metadata says the MCP
68
+ child resolved a data dir from cwd because no workspace marker/git root was
69
+ found, surface the workspace mismatch. Do not "fix" it by indexing the broad
70
+ parent folder.
71
+
54
72
  **Never say "the index only covers X, so grep is right" when the target path is
55
73
  inside the indexed repository.** That is an indexing freshness/coverage issue,
56
74
  not permission to abandon Memtrace.
@@ -41,6 +41,13 @@ Use the `index_directory` MCP tool:
41
41
  - Set `incremental: true` if re-indexing after changes
42
42
  - Set `clear_existing: true` only if a full rebuild is needed
43
43
 
44
+ If the selected path is just a folder containing multiple independent git repos,
45
+ do not index that parent folder unless the user explicitly wants a shared
46
+ workspace. For separate repos, index each repo root separately. For intentional
47
+ sharing, ask the user to bless the parent explicitly with
48
+ `memtrace start --bless-workspace` first, then verify the boundary with
49
+ `memtrace workspace status <path>`.
50
+
44
51
  **Success criteria:** You receive a `job_id` immediately.
45
52
 
46
53
  ### 3. Poll for completion
@@ -51,6 +51,13 @@ Use the `index_directory` MCP tool:
51
51
  - Set `incremental: true` if re-indexing after changes
52
52
  - Set `clear_existing: true` only if a full rebuild is needed
53
53
 
54
+ If the selected path is just a folder containing multiple independent git repos,
55
+ do not index that parent folder unless the user explicitly wants a shared
56
+ workspace. For separate repos, index each repo root separately. For intentional
57
+ sharing, ask the user to bless the parent explicitly with
58
+ `memtrace start --bless-workspace` first, then verify the boundary with
59
+ `memtrace workspace status <path>`.
60
+
54
61
  **Success criteria:** You receive a `job_id` immediately.
55
62
 
56
63
  ### 3. Poll for completion
@@ -40,7 +40,10 @@ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bun
40
40
  - Do not create benchmark-specific or PR-specific findings. The review must come from general Memtrace detectors, graph evidence, and policy ranking.
41
41
  - If the tool reports missing auth, tell the user to run `memtrace auth login`.
42
42
  - If the tool reports missing GitHub App installation, tell the user to install Memtrace Code Reviewer on that repository.
43
- - If the tool reports missing local graph context, tell the user to run `memtrace index .` at the workspace root.
43
+ - If the tool reports missing local graph context, tell the user to run
44
+ `memtrace index .` from the actual repo root. If the open folder is a parent
45
+ containing multiple independent repos, do not index the parent unless the user
46
+ explicitly wants a shared workspace.
44
47
 
45
48
  ## Output
46
49
 
@@ -84,6 +84,24 @@ Memtrace:
84
84
  root with `incremental: true` (or ask before `clear_existing: true`).
85
85
  5. Report the indexing coverage problem instead of silently switching to grep.
86
86
 
87
+ ### Workspace Boundary Check
88
+
89
+ Before indexing or reindexing, make sure the target path is the repo the user
90
+ asked about. If the current folder is only a parent that contains multiple
91
+ independent git repos, do **not** index the parent just because it is the open
92
+ editor folder. That creates or reuses a shared `.memdb` and can make agents
93
+ answer from stale repos.
94
+
95
+ - For separate repos: use the actual git repo root as the `index_directory`
96
+ path, or ask the user to open/run the agent from that repo root.
97
+ - For an intentional shared workspace: the user should bless it explicitly with
98
+ `memtrace start --bless-workspace`, then verify it with
99
+ `memtrace workspace status <path>`; the workspace marker should be present.
100
+ - If `list_indexed_repositories` returns empty or its metadata says the MCP
101
+ child resolved a data dir from cwd because no workspace marker/git root was
102
+ found, surface the workspace mismatch. Do not "fix" it by indexing the broad
103
+ parent folder.
104
+
87
105
  **Never say "the index only covers X, so grep is right" when the target path is
88
106
  inside the indexed repository.** That is an indexing freshness/coverage issue,
89
107
  not permission to abandon Memtrace.