@mnemonik/shared 5.33.12 → 5.86.1

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.
@@ -23,9 +23,34 @@ export interface ScanOptions {
23
23
  ignorePatterns?: string[];
24
24
  includeExtensions?: string[];
25
25
  }
26
+ /**
27
+ * Matchers for authority manifest / config / CI files whose verbatim content
28
+ * is collected by `collectAuthorityFiles` and pushed to the server for
29
+ * doc-truth Fingerprint parsing. Operates on relative, forward-slash paths.
30
+ */
31
+ export declare const AUTHORITY_FILE_MATCHERS: Array<(relPath: string) => boolean>;
32
+ /**
33
+ * True when `dirPath` is the root of a DIFFERENT repository than the one
34
+ * being scanned: it carries its own `.git` entry. A `.git` FILE marks a
35
+ * linked git worktree (wherever the user keeps them) or a submodule
36
+ * checkout; a `.git` DIRECTORY marks a nested clone. Files under such a
37
+ * boundary belong to that repository's own project identity — scanning them
38
+ * into the parent project is wrong attribution for any codebase, so the
39
+ * walkers skip these subtrees. Convention-free: this is git's own marker,
40
+ * not a host/tool path layout. The scan ROOT is exempt by construction
41
+ * (callers only test child directories).
42
+ */
43
+ export declare function isGitBoundary(dirPath: string): Promise<boolean>;
26
44
  export declare class CodeScanner {
27
45
  private options;
28
46
  constructor(options?: ScanOptions);
47
+ /**
48
+ * True when any directory strictly between `rootPath` and `filePath`
49
+ * carries its own `.git` entry (see isGitBoundary). Paths that don't
50
+ * resolve under `rootPath` are not judged here (return false) — the
51
+ * server's path validation handles escapes.
52
+ */
53
+ private insideNestedGitBoundary;
29
54
  /**
30
55
  * Maximum directory depth for recursive scanning
31
56
  * Prevents runaway recursion on deep/symlinked structures
@@ -36,6 +61,24 @@ export declare class CodeScanner {
36
61
  * Added max depth (10) to prevent infinite recursion
37
62
  */
38
63
  scanDirectory(rootPath: string): Promise<CodeChunk[]>;
64
+ /**
65
+ * Enumerate scan-eligible relative file paths under `rootPath` without
66
+ * reading or chunking content. Same walk + ignorePatterns + extension
67
+ * filter as `scanDirectory`, but bounded to O(file count) directory ops
68
+ * — cheap enough to call on every periodic reconcile tick.
69
+ *
70
+ * Returns relative paths normalized against `rootPath`, matching the
71
+ * shape the server stores in `memories.metadata->>'filePath'`. Use this
72
+ * for the scanner reconciliation channel (`POST /api/v1/scan/reconcile`).
73
+ *
74
+ * Defensive: skips any path whose `relative()` result contains a `..`
75
+ * traversal segment (can happen when a symlink resolves under root but
76
+ * the readdir entry path doesn't normalize cleanly). The server's
77
+ * `safeScanPath` rejects such paths; filtering here keeps a single
78
+ * malformed entry from failing the entire reconcile push.
79
+ */
80
+ listFiles(rootPath: string): Promise<string[]>;
81
+ private traversePaths;
39
82
  /**
40
83
  * Scan specific files and extract code chunks.
41
84
  * Pass rootPath to compute proper relative file paths in chunk metadata.
@@ -104,5 +147,15 @@ export declare class CodeScanner {
104
147
  * Generate content hash for drift detection
105
148
  */
106
149
  private hash;
150
+ /**
151
+ * Walk the project for authority manifest/config/CI files and return their
152
+ * verbatim content. Reuses ignorePatterns; matches AUTHORITY_FILE_MATCHERS
153
+ * (not includeExtensions). Content-only — no chunking, no embeddings.
154
+ */
155
+ collectAuthorityFiles(projectRoot: string): Promise<Array<{
156
+ path: string;
157
+ content: string;
158
+ hash: string;
159
+ }>>;
107
160
  }
108
161
  //# sourceMappingURL=codeScanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeScanner.d.ts","sourceRoot":"","sources":["../src/codeScanner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM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OAAO,CAAC,MAAM,EAAE,CAAC;YAMtC,aAAa;IA8C3B;;;OAGG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA2C5E;;;OAGG;YACW,iBAAiB;IAgE/B;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAepB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAoB;YAE3C,SAAS;IAyFvB;;OAEG;IACH,OAAO,CAAC,cAAc;IAwBtB;;OAEG;IACH,OAAO,CAAC,aAAa;IAoFrB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA0GzB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAoE/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqD3B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,QAAQ;IA2FhB;;OAEG;IACH,OAAO,CAAC,IAAI;IAIZ;;;;OAIG;IACG,qBAAqB,CACzB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAqCnE"}
@@ -2,7 +2,7 @@
2
2
  * Code Scanner - Parse and chunk source files for embedding
3
3
  */
4
4
  import { readdir, readFile, stat, lstat, realpath } from 'fs/promises';
5
- import { join, relative, extname } from 'path';
5
+ import { join, relative, extname, sep } from 'path';
6
6
  import { createHash } from 'crypto';
7
7
  import { debug as logDebug } from './logger.js';
8
8
  import { withTimeout } from './asyncUtils.js';
@@ -49,6 +49,13 @@ const DEFAULT_OPTIONS = {
49
49
  '*.bundle.js',
50
50
  '*.legacy.js',
51
51
  '*.map',
52
+ // NOTE: transient agent worktrees (previously `.claude/worktrees/*`
53
+ // here) are no longer excluded by path convention. Linked worktrees,
54
+ // nested clones, and submodules are all excluded generically by the
55
+ // nested-git-boundary rule (isGitBoundary below) — git's own `.git`
56
+ // marker, so no host or codebase layout is baked in. Original incident:
57
+ // a worktree mirror was indexed as canonical source and polluted the
58
+ // corpus with 376 stale couplings.
52
59
  ],
53
60
  includeExtensions: [
54
61
  '.ts',
@@ -70,11 +77,74 @@ const DEFAULT_OPTIONS = {
70
77
  '.md',
71
78
  ],
72
79
  };
80
+ /**
81
+ * Matchers for authority manifest / config / CI files whose verbatim content
82
+ * is collected by `collectAuthorityFiles` and pushed to the server for
83
+ * doc-truth Fingerprint parsing. Operates on relative, forward-slash paths.
84
+ */
85
+ export const AUTHORITY_FILE_MATCHERS = [
86
+ (p) => p === 'package.json',
87
+ (p) => /^(packages|apps|services|tools)\/[^/]+\/package\.json$/.test(p),
88
+ (p) => p === 'tsconfig.json' || /^tsconfig\.[^/]+\.json$/.test(p),
89
+ (p) => p === 'pyproject.toml',
90
+ (p) => p === 'requirements.txt',
91
+ (p) => p === 'setup.py',
92
+ (p) => p === 'Cargo.toml',
93
+ (p) => p === 'Gemfile',
94
+ (p) => p === 'Makefile',
95
+ (p) => p === '.env.example',
96
+ (p) => /^\.github\/workflows\/[^/]+\.(yml|yaml)$/.test(p),
97
+ // SQL migrations: the schema_columns authority extractor reads every .sql
98
+ // under `migrations/` (listFiles('migrations/') -> LIKE 'migrations/%' then
99
+ // .endsWith('.sql')). Without collecting these, that authority is empty and
100
+ // every schema_table_enumeration claim falls to unverifiable.
101
+ (p) => /^migrations\/.*\.sql$/.test(p),
102
+ ];
103
+ /**
104
+ * True when `dirPath` is the root of a DIFFERENT repository than the one
105
+ * being scanned: it carries its own `.git` entry. A `.git` FILE marks a
106
+ * linked git worktree (wherever the user keeps them) or a submodule
107
+ * checkout; a `.git` DIRECTORY marks a nested clone. Files under such a
108
+ * boundary belong to that repository's own project identity — scanning them
109
+ * into the parent project is wrong attribution for any codebase, so the
110
+ * walkers skip these subtrees. Convention-free: this is git's own marker,
111
+ * not a host/tool path layout. The scan ROOT is exempt by construction
112
+ * (callers only test child directories).
113
+ */
114
+ export async function isGitBoundary(dirPath) {
115
+ try {
116
+ await withTimeout(lstat(join(dirPath, '.git')), FILE_OP_TIMEOUT_MS, `lstat timed out: ${join(dirPath, '.git')}`);
117
+ return true;
118
+ }
119
+ catch {
120
+ return false;
121
+ }
122
+ }
73
123
  export class CodeScanner {
74
124
  options;
75
125
  constructor(options = {}) {
76
126
  this.options = { ...DEFAULT_OPTIONS, ...options };
77
127
  }
128
+ /**
129
+ * True when any directory strictly between `rootPath` and `filePath`
130
+ * carries its own `.git` entry (see isGitBoundary). Paths that don't
131
+ * resolve under `rootPath` are not judged here (return false) — the
132
+ * server's path validation handles escapes.
133
+ */
134
+ async insideNestedGitBoundary(filePath, rootPath) {
135
+ const rel = relative(rootPath, filePath);
136
+ if (!rel || rel.startsWith('..'))
137
+ return false;
138
+ const segments = rel.split(sep);
139
+ let current = rootPath;
140
+ // Walk intermediate directories only (exclude the file itself).
141
+ for (let i = 0; i < segments.length - 1; i++) {
142
+ current = join(current, segments[i]);
143
+ if (await isGitBoundary(current))
144
+ return true;
145
+ }
146
+ return false;
147
+ }
78
148
  /**
79
149
  * Maximum directory depth for recursive scanning
80
150
  * Prevents runaway recursion on deep/symlinked structures
@@ -89,6 +159,63 @@ export class CodeScanner {
89
159
  await this.traverseDirectory(rootPath, rootPath, chunks, 0);
90
160
  return chunks;
91
161
  }
162
+ /**
163
+ * Enumerate scan-eligible relative file paths under `rootPath` without
164
+ * reading or chunking content. Same walk + ignorePatterns + extension
165
+ * filter as `scanDirectory`, but bounded to O(file count) directory ops
166
+ * — cheap enough to call on every periodic reconcile tick.
167
+ *
168
+ * Returns relative paths normalized against `rootPath`, matching the
169
+ * shape the server stores in `memories.metadata->>'filePath'`. Use this
170
+ * for the scanner reconciliation channel (`POST /api/v1/scan/reconcile`).
171
+ *
172
+ * Defensive: skips any path whose `relative()` result contains a `..`
173
+ * traversal segment (can happen when a symlink resolves under root but
174
+ * the readdir entry path doesn't normalize cleanly). The server's
175
+ * `safeScanPath` rejects such paths; filtering here keeps a single
176
+ * malformed entry from failing the entire reconcile push.
177
+ */
178
+ async listFiles(rootPath) {
179
+ const paths = [];
180
+ await this.traversePaths(rootPath, rootPath, paths, 0);
181
+ return paths.filter((p) => !/(^|[/\\])\.\.([/\\]|$)/.test(p));
182
+ }
183
+ async traversePaths(currentPath, rootPath, out, depth) {
184
+ if (depth >= CodeScanner.MAX_DEPTH)
185
+ return;
186
+ try {
187
+ const entries = await withTimeout(readdir(currentPath), FILE_OP_TIMEOUT_MS, `readdir timed out: ${currentPath}`);
188
+ for (const entry of entries) {
189
+ const fullPath = join(currentPath, entry);
190
+ const relativePath = relative(rootPath, fullPath);
191
+ if (this.shouldIgnore(relativePath))
192
+ continue;
193
+ const lstats = await withTimeout(lstat(fullPath), FILE_OP_TIMEOUT_MS, `lstat timed out: ${fullPath}`);
194
+ if (lstats.isSymbolicLink()) {
195
+ const resolved = await realpath(fullPath);
196
+ const resolvedRoot = await realpath(rootPath);
197
+ if (!resolved.startsWith(resolvedRoot + '/') && resolved !== resolvedRoot)
198
+ continue;
199
+ }
200
+ const stats = lstats.isSymbolicLink()
201
+ ? await withTimeout(stat(fullPath), FILE_OP_TIMEOUT_MS, `stat timed out: ${fullPath}`)
202
+ : lstats;
203
+ if (stats.isDirectory()) {
204
+ if (await isGitBoundary(fullPath))
205
+ continue; // another repo's subtree
206
+ await this.traversePaths(fullPath, rootPath, out, depth + 1);
207
+ }
208
+ else if (stats.isFile()) {
209
+ if (this.options.includeExtensions.includes(extname(fullPath))) {
210
+ out.push(relativePath);
211
+ }
212
+ }
213
+ }
214
+ }
215
+ catch (error) {
216
+ logDebug('Error traversing directory (listFiles)', { path: currentPath, error });
217
+ }
218
+ }
92
219
  /**
93
220
  * Scan specific files and extract code chunks.
94
221
  * Pass rootPath to compute proper relative file paths in chunk metadata.
@@ -100,6 +227,13 @@ export class CodeScanner {
100
227
  if (this.shouldIgnore(filePath)) {
101
228
  continue;
102
229
  }
230
+ // Explicit file lists arrive from watcher events, which can race a
231
+ // worktree/nested-clone appearing — apply the same nested-git-boundary
232
+ // rule the walks use (an ancestor between root and the file carrying
233
+ // its own .git means the file belongs to another repository).
234
+ if (rootPath && (await this.insideNestedGitBoundary(filePath, rootPath))) {
235
+ continue;
236
+ }
103
237
  const ext = extname(filePath);
104
238
  if (this.options.includeExtensions.includes(ext)) {
105
239
  const fileChunks = await this.parseFile(filePath, rootPath || filePath);
@@ -160,6 +294,8 @@ export class CodeScanner {
160
294
  ? await withTimeout(stat(fullPath), FILE_OP_TIMEOUT_MS, `stat timed out: ${fullPath}`)
161
295
  : lstats;
162
296
  if (stats.isDirectory()) {
297
+ if (await isGitBoundary(fullPath))
298
+ continue; // another repo's subtree
163
299
  await this.traverseDirectory(fullPath, rootPath, chunks, depth + 1);
164
300
  }
165
301
  else if (stats.isFile()) {
@@ -700,5 +836,52 @@ export class CodeScanner {
700
836
  hash(content) {
701
837
  return createHash('sha256').update(content).digest('hex').substring(0, 16);
702
838
  }
839
+ /**
840
+ * Walk the project for authority manifest/config/CI files and return their
841
+ * verbatim content. Reuses ignorePatterns; matches AUTHORITY_FILE_MATCHERS
842
+ * (not includeExtensions). Content-only — no chunking, no embeddings.
843
+ */
844
+ async collectAuthorityFiles(projectRoot) {
845
+ const out = [];
846
+ // M2: cap walk depth to match the scanner's MAX_DEPTH (10)
847
+ const walk = async (dir, depth) => {
848
+ if (depth >= CodeScanner.MAX_DEPTH)
849
+ return;
850
+ let entries;
851
+ try {
852
+ entries = await readdir(dir, { withFileTypes: true });
853
+ }
854
+ catch {
855
+ return;
856
+ }
857
+ for (const ent of entries) {
858
+ const full = join(dir, ent.name);
859
+ const rel = relative(projectRoot, full).split(sep).join('/');
860
+ if (this.shouldIgnore(rel))
861
+ continue;
862
+ if (ent.isDirectory()) {
863
+ if (await isGitBoundary(full))
864
+ continue; // another repo's subtree
865
+ await walk(full, depth + 1);
866
+ }
867
+ else if (AUTHORITY_FILE_MATCHERS.some((m) => m(rel))) {
868
+ try {
869
+ const content = await readFile(full, 'utf-8');
870
+ // C2: skip files whose content exceeds the server's 5MB cap —
871
+ // manifests are tiny; an oversized one is anomalous.
872
+ if (content.length > 5_000_000)
873
+ continue;
874
+ const hash = createHash('sha256').update(content).digest('hex');
875
+ out.push({ path: rel, content, hash });
876
+ }
877
+ catch {
878
+ /* unreadable — skip */
879
+ }
880
+ }
881
+ }
882
+ };
883
+ await walk(projectRoot, 0);
884
+ return out;
885
+ }
703
886
  }
704
887
  //# sourceMappingURL=codeScanner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeScanner.js","sourceRoot":"","sources":["../src/codeScanner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,kBAAkB,GAAG,IAAI,CAAC;AA0BhC,MAAM,eAAe,GAA0B;IAC7C,YAAY,EAAE,IAAI,EAAE,eAAe;IACnC,YAAY,EAAE,GAAG;IACjB,cAAc,EAAE;QACd,kBAAkB;QAClB,cAAc;QACd,OAAO;QACP,8BAA8B;QAC9B,MAAM;QACN,OAAO;QACP,KAAK;QACL,MAAM;QACN,aAAa;QACb,MAAM;QACN,aAAa;QACb,eAAe;QACf,gBAAgB;QAChB,MAAM;QACN,OAAO;QACP,QAAQ;QACR,KAAK;QACL,KAAK;QACL,UAAU;QACV,0BAA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,WAAW,EAAE,EAAE,CAAC;oBACtB,IAAI,MAAM,aAAa,CAAC,IAAI,CAAC;wBAAE,SAAS,CAAC,yBAAyB;oBAClE,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC9B,CAAC;qBAAM,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;oBACvD,IAAI,CAAC;wBACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;wBAC9C,8DAA8D;wBAC9D,qDAAqD;wBACrD,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS;4BAAE,SAAS;wBACzC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wBAChE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;oBACzC,CAAC;oBAAC,MAAM,CAAC;wBACP,uBAAuB;oBACzB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export { MCP_INSTRUCTIONS, MCP_INSTRUCTIONS_RAW, getMcpInstructions } from './instructions.js';
8
8
  export { USAGE_GUIDE } from './usageGuide.js';
9
- export { CodeScanner, type CodeChunk, type ScanOptions } from './codeScanner.js';
9
+ export { CodeScanner, AUTHORITY_FILE_MATCHERS, isGitBoundary, type CodeChunk, type ScanOptions, } from './codeScanner.js';
10
10
  export { FileSystemReader, getFileSystemReader, type ScanFilesResult, type ChangedFilesResult, type FileData, } from './FileSystemReader.js';
11
11
  export { SECRET_PATTERNS, SECRET_REDACTION_PLACEHOLDER, scrubSecrets } from './secretPatterns.js';
12
12
  export { FETCH_TIMEOUT_MS, TELEMETRY_TIMEOUT_MS, POST_TOOL_TIMEOUT_MS, MCP_PRECHECK_TIMEOUT_MS, withHookTimeout, } from './hookTimeouts.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export { MCP_INSTRUCTIONS, MCP_INSTRUCTIONS_RAW, getMcpInstructions } from './instructions.js';
8
8
  export { USAGE_GUIDE } from './usageGuide.js';
9
- export { CodeScanner } from './codeScanner.js';
9
+ export { CodeScanner, AUTHORITY_FILE_MATCHERS, isGitBoundary, } from './codeScanner.js';
10
10
  export { FileSystemReader, getFileSystemReader, } from './FileSystemReader.js';
11
11
  export { SECRET_PATTERNS, SECRET_REDACTION_PLACEHOLDER, scrubSecrets } from './secretPatterns.js';
12
12
  export { FETCH_TIMEOUT_MS, TELEMETRY_TIMEOUT_MS, POST_TOOL_TIMEOUT_MS, MCP_PRECHECK_TIMEOUT_MS, withHookTimeout, } from './hookTimeouts.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAoC,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GAIpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,GAGd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GAIpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
@@ -4,8 +4,22 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for MCP instructions.
5
5
  * Shared instruction content imported by the server.
6
6
  *
7
- * Version: 2.93
8
- * Updated: 2026-05-15
7
+ * Version: 2.98
8
+ * Updated: 2026-05-27
9
+ *
10
+ * v2.98 — Doc truth contracts are the normal drift surface. linkedDocs and
11
+ * doc_code_couplings remain legacy diagnostics only; docs drift
12
+ * defaults to truth findings and legacy:true is explicit debug.
13
+ * v2.97 — Dropped legacy doc-coupling action guidance. Coupling rows are
14
+ * not truth findings (plan §1).
15
+ * v2.96 — Replace conditional memory_discover guidance with structural fix:
16
+ * bootstrap now includes _methodCatalog (discoverMemoryTools({})) so
17
+ * agents have the memory_tools calling convention from turn one.
18
+ * Instruction updated to reference _methodCatalog directly.
19
+ * v2.95 — Drop `augments` from JIT directive verdict list per plan §5 default
20
+ * (augments downgrades to ambient via the parallel recall gate, not
21
+ * the directive lane). See jit-knowledge-injector.md §5 decision note.
22
+ * v2.94 — Add JIT directive teaching (docs/development/jit-knowledge-injector.md §2.3).
9
23
  *
10
24
  * Code mode permanent — all memory operations via memory_tools sandbox.
11
25
  * memory_add, file_context etc. are now mnemonik.* methods, not standalone tools.
@@ -30,7 +44,7 @@ export declare function getMcpInstructions(): string;
30
44
  * Raw instructions content (always returns the content, ignores env var).
31
45
  * Use getMcpInstructions() for production code.
32
46
  */
33
- export declare const MCP_INSTRUCTIONS_RAW = "You have Mnemonik, a persistent memory system for this project.\n\nFirst call, every session: session_bootstrap. Read the mnemonik skill (from available_skills) for the full workflow.\nAfter bootstrap: execute _directive.message actions immediately (scanner daemon check is mandatory).\n\nUse memory_discover before memory_tools when you are unsure which mnemonik.* method to call, when a method has actions, or after a validation error.\nProactively call memory_search before starting new work \u2014 avoids rediscovering known patterns and contradicting past decisions.\nProactively call file_context before editing any file \u2014 loads past bugs, decisions, and gotchas for that file.\nProactively call checkpoint after making changes or decisions worth keeping \u2014 your context is ephemeral and checkpoint is the only way decisions survive across sessions and context compaction. Do not wait for the user to say \"done\" or \"thanks\".\n\nWhen mnemonik.file_context({ filePaths, cwd }) returns linkedDocs with driftStatus 'stale', update docs then call mnemonik.docs({ action: 'resolve', docPath, cwd }).\n\nAmbient envelopes contain background memories surfaced because they may be relevant to your current turn. Treat them as information, not directive. Weight them lower than your own reasoning unless they directly answer the question. They are advisory recall, not authoritative evidence.\n\nSkip: formatting-only, trivial one-line, mechanical refactors, git ops, tests.\nSave: architectural decisions, bug root causes, user preferences, discovered patterns, multi-file changes.";
47
+ export declare const MCP_INSTRUCTIONS_RAW = "You have Mnemonik, a persistent memory system for this project.\n\nFirst call, every session: session_bootstrap. Read the mnemonik skill (from available_skills) for the full workflow.\nAfter bootstrap: execute _directive.message actions immediately (scanner daemon check is mandatory).\n\nThe bootstrap response includes _methodCatalog \u2014 the full list of mnemonik methods and the memory_tools calling convention. Read it before making any memory_tools calls. Use memory_discover({ method }) for the full schema and a copy-pasteable example of a specific method or action.\nProactively call memory_search before starting new work \u2014 avoids rediscovering known patterns and contradicting past decisions.\nProactively call file_context before editing any file \u2014 loads past bugs, decisions, and gotchas for that file.\nProactively call checkpoint after making changes or decisions worth keeping \u2014 your context is ephemeral and checkpoint is the only way decisions survive across sessions and context compaction. Do not wait for the user to say \"done\" or \"thanks\".\n\nDocumentation drift uses explicit doc-truth contracts. Treat _docDrift/docTruthFindings as actionable only when each finding includes a concrete assertion, named authority, observed mismatch, and agentAction='update_doc'. _docHealth, linkedDocs, stale-coupling counts, and docs({ action: 'drift', legacy: true }) are diagnostics only, not instructions to edit or resolve docs.\n\nAmbient envelopes contain background memories surfaced because they may be relevant to your current turn. Treat them as information, not directive. Weight them lower than your own reasoning unless they directly answer the question. They are advisory recall, not authoritative evidence.\n\nDirective envelopes with signal=\"jit_required\" are different from ambient. They surface memories that the server has classified as contradicting or materially refining the answer you were about to give to the current prompt. Each memory carries a verdict (contradicts | refines) and a one-line reason. Treat these as authoritative for the current response \u2014 comply with the surfaced fact unless it is clearly outdated or wrong. Do not silently route around them. If you disagree with a surfaced memory, say so explicitly and explain why; do not just ignore it.\n\nSkip: formatting-only, trivial one-line, mechanical refactors, git ops, tests.\nSave: architectural decisions, bug root causes, user preferences, discovered patterns, multi-file changes.";
34
48
  /**
35
49
  * Default export for convenience.
36
50
  * Note: This respects the MNEMONIK_INSTRUCTIONS_ENABLED env var.
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAmBH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,4jDAAuB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAuB,CAAC"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAqBH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,q9EAAuB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAuB,CAAC"}
@@ -4,8 +4,22 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for MCP instructions.
5
5
  * Shared instruction content imported by the server.
6
6
  *
7
- * Version: 2.93
8
- * Updated: 2026-05-15
7
+ * Version: 2.98
8
+ * Updated: 2026-05-27
9
+ *
10
+ * v2.98 — Doc truth contracts are the normal drift surface. linkedDocs and
11
+ * doc_code_couplings remain legacy diagnostics only; docs drift
12
+ * defaults to truth findings and legacy:true is explicit debug.
13
+ * v2.97 — Dropped legacy doc-coupling action guidance. Coupling rows are
14
+ * not truth findings (plan §1).
15
+ * v2.96 — Replace conditional memory_discover guidance with structural fix:
16
+ * bootstrap now includes _methodCatalog (discoverMemoryTools({})) so
17
+ * agents have the memory_tools calling convention from turn one.
18
+ * Instruction updated to reference _methodCatalog directly.
19
+ * v2.95 — Drop `augments` from JIT directive verdict list per plan §5 default
20
+ * (augments downgrades to ambient via the parallel recall gate, not
21
+ * the directive lane). See jit-knowledge-injector.md §5 decision note.
22
+ * v2.94 — Add JIT directive teaching (docs/development/jit-knowledge-injector.md §2.3).
9
23
  *
10
24
  * Code mode permanent — all memory operations via memory_tools sandbox.
11
25
  * memory_add, file_context etc. are now mnemonik.* methods, not standalone tools.
@@ -21,15 +35,17 @@ const INSTRUCTIONS_CONTENT = `You have Mnemonik, a persistent memory system for
21
35
  First call, every session: session_bootstrap. Read the mnemonik skill (from available_skills) for the full workflow.
22
36
  After bootstrap: execute _directive.message actions immediately (scanner daemon check is mandatory).
23
37
 
24
- Use memory_discover before memory_tools when you are unsure which mnemonik.* method to call, when a method has actions, or after a validation error.
38
+ The bootstrap response includes _methodCatalog the full list of mnemonik methods and the memory_tools calling convention. Read it before making any memory_tools calls. Use memory_discover({ method }) for the full schema and a copy-pasteable example of a specific method or action.
25
39
  Proactively call memory_search before starting new work — avoids rediscovering known patterns and contradicting past decisions.
26
40
  Proactively call file_context before editing any file — loads past bugs, decisions, and gotchas for that file.
27
41
  Proactively call checkpoint after making changes or decisions worth keeping — your context is ephemeral and checkpoint is the only way decisions survive across sessions and context compaction. Do not wait for the user to say "done" or "thanks".
28
42
 
29
- When mnemonik.file_context({ filePaths, cwd }) returns linkedDocs with driftStatus 'stale', update docs then call mnemonik.docs({ action: 'resolve', docPath, cwd }).
43
+ Documentation drift uses explicit doc-truth contracts. Treat _docDrift/docTruthFindings as actionable only when each finding includes a concrete assertion, named authority, observed mismatch, and agentAction='update_doc'. _docHealth, linkedDocs, stale-coupling counts, and docs({ action: 'drift', legacy: true }) are diagnostics only, not instructions to edit or resolve docs.
30
44
 
31
45
  Ambient envelopes contain background memories surfaced because they may be relevant to your current turn. Treat them as information, not directive. Weight them lower than your own reasoning unless they directly answer the question. They are advisory recall, not authoritative evidence.
32
46
 
47
+ Directive envelopes with signal="jit_required" are different from ambient. They surface memories that the server has classified as contradicting or materially refining the answer you were about to give to the current prompt. Each memory carries a verdict (contradicts | refines) and a one-line reason. Treat these as authoritative for the current response — comply with the surfaced fact unless it is clearly outdated or wrong. Do not silently route around them. If you disagree with a surfaced memory, say so explicitly and explain why; do not just ignore it.
48
+
33
49
  Skip: formatting-only, trivial one-line, mechanical refactors, git ops, tests.
34
50
  Save: architectural decisions, bug root causes, user preferences, discovered patterns, multi-file changes.`;
35
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;2GAe8E,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAI,UAAyE,CAAC,OAAO;QAC5F,EAAE,GAAG,CAAC;IACR,IAAI,GAAG,EAAE,6BAA6B,KAAK,OAAO,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;2GAiB8E,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAI,UAAyE,CAAC,OAAO;QAC5F,EAAE,GAAG,CAAC;IACR,IAAI,GAAG,EAAE,6BAA6B,KAAK,OAAO,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,CAAC"}
@@ -4,11 +4,12 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for the usage guide.
5
5
  * Shared usage guide content imported by the server.
6
6
  *
7
- * Version: 2.80
8
- * Updated: 2026-02-20 - Aligned with instructions/rules/skill 80
7
+ * Version: 2.82
8
+ * Updated: 2026-05-27 - Doc-truth-contract-rebuild: teach authority-backed
9
+ * truth findings and keep legacy coupling drift diagnostic only.
9
10
  *
10
11
  * This guide focuses on HOW to use Mnemonik effectively, not WHAT tools exist.
11
12
  * Tool schemas already tell agents what's available - they need the workflow.
12
13
  */
13
- export declare const USAGE_GUIDE = "# Mnemonik Workflow Guide (v2.80)\n\n## Workflow\n\nsession_bootstrap \u2192 memory_search \u2192 file_context \u2192 [work] \u2192 memory_add \u2192 memory_state\n\n## Tool Selection by Stage\n\n### Session start\n- session_bootstrap: loads context, policies, pending tasks (call once, first thing)\n- memory_search: search by task domain; set workflowContext (feature_implementation, debugging, exploration, policy_review)\n- projects: resolve project IDs if context unclear\n- policy: review safety rules\n\n### Before editing files\n- file_context: fetch memories for the file \u2014 call for EVERY file you edit\n- memory_search: second search scoped to file/module if needed\n- mnemonik.docs({ action: 'links' }): check doc couplings for the file\n\n### During implementation\n- memory_get: retrieve specific memory by id\n- memory_update: refine memory created this session\n- memory_info: query history, provenance, confidence breakdown, links, graph\n- assist: get tool guidance if uncertain\n\n### After significant work\n- memory_add: save decisions, outcomes, patterns, bug root causes\n- memory_state: reinforce (memory helped), supersede (replace outdated), deprecate, penalize, dispute\n- tasks: mark tasks in progress or complete\n- mnemonik.docs({ action: 'drift' }): check for stale documentation after code changes\n- mnemonik.docs({ action: 'resolve' }): mark stale docs as fixed after updating them\n\n### Diagnostics\n- doctor: when tool calls fail or behavior is inconsistent\n- scanner: refresh embeddings, trigger scans, check drift\n\n## Skip conditions\n\nSkip memory tools for: formatting-only edits, trivial one-line changes, mechanical refactors, git operations, running tests.\n\n## Completion gate\n\nNever tell the user significant work is done without calling memory_add first in the same response. Changes made + responding next = completion. \"Progress updates\" count.\n\n## Memory search tips\n\n- Query should include task intent + key entities\n- Set workflowContext when you know the phase\n- Use currentFile to boost file-linked memories\n- Use filterOnly:true only for narrow filters (no embedding, requires >=1 filter)\n\n## Proactive heuristics\n\n- Long sessions: re-run memory_search after switching topics\n- Conflicting info: use memory_state to supersede/dispute\n- High-impact changes: save memory immediately after verification\n- When file_context returns linkedDocs with driftStatus 'stale': update docs then mnemonik.docs({ action: 'resolve' })\n\n## Anti-fade (every ~10 tool calls)\n\nCheck: (1) memory_search before work? (2) file_context before edit? (3) memory_add after completing? No session_bootstrap? Call it now.\n";
14
+ export declare const USAGE_GUIDE = "# Mnemonik Workflow Guide (v2.82)\n\n## Workflow\n\nsession_bootstrap \u2192 memory_search \u2192 file_context \u2192 [work] \u2192 memory_add \u2192 memory_state\n\n## Tool Selection by Stage\n\n### Session start\n- session_bootstrap: loads context, policies, pending tasks (call once, first thing)\n- memory_search: search by task domain; set workflowContext (feature_implementation, debugging, exploration, policy_review)\n- projects: resolve project IDs if context unclear\n- policy: review safety rules\n\n### Before editing files\n- file_context: fetch memories for the file \u2014 call for EVERY file you edit\n- memory_search: second search scoped to file/module if needed\n- mnemonik.docs({ action: 'links' }): check doc couplings for the file\n\n### During implementation\n- memory_get: retrieve specific memory by id\n- memory_update: refine memory created this session\n- memory_info: query history, provenance, confidence breakdown, links, graph\n- assist: get tool guidance if uncertain\n\n### After significant work\n- memory_add: save decisions, outcomes, patterns, bug root causes\n- memory_state: reinforce (memory helped), supersede (replace outdated), deprecate, penalize, dispute\n- tasks: mark tasks in progress or complete\n- mnemonik.docs({ action: 'status' }): view doc-truth health (legacy coupling counts are diagnostic only \u2014 do not act on them as drift)\n\n### Diagnostics\n- doctor: when tool calls fail or behavior is inconsistent\n- scanner: refresh embeddings, trigger scans, check drift\n\n## Skip conditions\n\nSkip memory tools for: formatting-only edits, trivial one-line changes, mechanical refactors, git operations, running tests.\n\n## Completion gate\n\nNever tell the user significant work is done without calling memory_add first in the same response. Changes made + responding next = completion. \"Progress updates\" count.\n\n## Memory search tips\n\n- Query should include task intent + key entities\n- Set workflowContext when you know the phase\n- Use currentFile to boost file-linked memories\n- Use filterOnly:true only for narrow filters (no embedding, requires >=1 filter)\n\n## Proactive heuristics\n\n- Long sessions: re-run memory_search after switching topics\n- Conflicting info: use memory_state to supersede/dispute\n- High-impact changes: save memory immediately after verification\n- Act on docTruthFindings/_docDrift only when the finding has authority, observed mismatch, and agentAction='update_doc'; linkedDocs and stale-coupling counts are legacy diagnostics\n\n## Anti-fade (every ~10 tool calls)\n\nCheck: (1) memory_search before work? (2) file_context before edit? (3) memory_add after completing? No session_bootstrap? Call it now.\n";
14
15
  //# sourceMappingURL=usageGuide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usageGuide.d.ts","sourceRoot":"","sources":["../src/usageGuide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,WAAW,4nFA6DvB,CAAC"}
1
+ {"version":3,"file":"usageGuide.d.ts","sourceRoot":"","sources":["../src/usageGuide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,WAAW,2pFA4DvB,CAAC"}
@@ -4,13 +4,14 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for the usage guide.
5
5
  * Shared usage guide content imported by the server.
6
6
  *
7
- * Version: 2.80
8
- * Updated: 2026-02-20 - Aligned with instructions/rules/skill 80
7
+ * Version: 2.82
8
+ * Updated: 2026-05-27 - Doc-truth-contract-rebuild: teach authority-backed
9
+ * truth findings and keep legacy coupling drift diagnostic only.
9
10
  *
10
11
  * This guide focuses on HOW to use Mnemonik effectively, not WHAT tools exist.
11
12
  * Tool schemas already tell agents what's available - they need the workflow.
12
13
  */
13
- export const USAGE_GUIDE = `# Mnemonik Workflow Guide (v2.80)
14
+ export const USAGE_GUIDE = `# Mnemonik Workflow Guide (v2.82)
14
15
 
15
16
  ## Workflow
16
17
 
@@ -39,8 +40,7 @@ session_bootstrap → memory_search → file_context → [work] → memory_add
39
40
  - memory_add: save decisions, outcomes, patterns, bug root causes
40
41
  - memory_state: reinforce (memory helped), supersede (replace outdated), deprecate, penalize, dispute
41
42
  - tasks: mark tasks in progress or complete
42
- - mnemonik.docs({ action: 'drift' }): check for stale documentation after code changes
43
- - mnemonik.docs({ action: 'resolve' }): mark stale docs as fixed after updating them
43
+ - mnemonik.docs({ action: 'status' }): view doc-truth health (legacy coupling counts are diagnostic only — do not act on them as drift)
44
44
 
45
45
  ### Diagnostics
46
46
  - doctor: when tool calls fail or behavior is inconsistent
@@ -66,7 +66,7 @@ Never tell the user significant work is done without calling memory_add first in
66
66
  - Long sessions: re-run memory_search after switching topics
67
67
  - Conflicting info: use memory_state to supersede/dispute
68
68
  - High-impact changes: save memory immediately after verification
69
- - When file_context returns linkedDocs with driftStatus 'stale': update docs then mnemonik.docs({ action: 'resolve' })
69
+ - Act on docTruthFindings/_docDrift only when the finding has authority, observed mismatch, and agentAction='update_doc'; linkedDocs and stale-coupling counts are legacy diagnostics
70
70
 
71
71
  ## Anti-fade (every ~10 tool calls)
72
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"usageGuide.js","sourceRoot":"","sources":["../src/usageGuide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6D1B,CAAC"}
1
+ {"version":3,"file":"usageGuide.js","sourceRoot":"","sources":["../src/usageGuide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnemonik/shared",
3
- "version": "5.33.12",
3
+ "version": "5.86.1",
4
4
  "description": "Shared constants and utilities for Mnemonik packages",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { readdir, readFile, stat, lstat, realpath } from 'fs/promises';
6
- import { join, relative, extname } from 'path';
6
+ import { join, relative, extname, sep } from 'path';
7
7
  import { createHash } from 'crypto';
8
8
  import { debug as logDebug } from './logger.js';
9
9
  import { withTimeout } from './asyncUtils.js';
@@ -76,6 +76,13 @@ const DEFAULT_OPTIONS: Required<ScanOptions> = {
76
76
  '*.bundle.js',
77
77
  '*.legacy.js',
78
78
  '*.map',
79
+ // NOTE: transient agent worktrees (previously `.claude/worktrees/*`
80
+ // here) are no longer excluded by path convention. Linked worktrees,
81
+ // nested clones, and submodules are all excluded generically by the
82
+ // nested-git-boundary rule (isGitBoundary below) — git's own `.git`
83
+ // marker, so no host or codebase layout is baked in. Original incident:
84
+ // a worktree mirror was indexed as canonical source and polluted the
85
+ // corpus with 376 stale couplings.
79
86
  ],
80
87
  includeExtensions: [
81
88
  '.ts',
@@ -98,6 +105,54 @@ const DEFAULT_OPTIONS: Required<ScanOptions> = {
98
105
  ],
99
106
  };
100
107
 
108
+ /**
109
+ * Matchers for authority manifest / config / CI files whose verbatim content
110
+ * is collected by `collectAuthorityFiles` and pushed to the server for
111
+ * doc-truth Fingerprint parsing. Operates on relative, forward-slash paths.
112
+ */
113
+ export const AUTHORITY_FILE_MATCHERS: Array<(relPath: string) => boolean> = [
114
+ (p) => p === 'package.json',
115
+ (p) => /^(packages|apps|services|tools)\/[^/]+\/package\.json$/.test(p),
116
+ (p) => p === 'tsconfig.json' || /^tsconfig\.[^/]+\.json$/.test(p),
117
+ (p) => p === 'pyproject.toml',
118
+ (p) => p === 'requirements.txt',
119
+ (p) => p === 'setup.py',
120
+ (p) => p === 'Cargo.toml',
121
+ (p) => p === 'Gemfile',
122
+ (p) => p === 'Makefile',
123
+ (p) => p === '.env.example',
124
+ (p) => /^\.github\/workflows\/[^/]+\.(yml|yaml)$/.test(p),
125
+ // SQL migrations: the schema_columns authority extractor reads every .sql
126
+ // under `migrations/` (listFiles('migrations/') -> LIKE 'migrations/%' then
127
+ // .endsWith('.sql')). Without collecting these, that authority is empty and
128
+ // every schema_table_enumeration claim falls to unverifiable.
129
+ (p) => /^migrations\/.*\.sql$/.test(p),
130
+ ];
131
+
132
+ /**
133
+ * True when `dirPath` is the root of a DIFFERENT repository than the one
134
+ * being scanned: it carries its own `.git` entry. A `.git` FILE marks a
135
+ * linked git worktree (wherever the user keeps them) or a submodule
136
+ * checkout; a `.git` DIRECTORY marks a nested clone. Files under such a
137
+ * boundary belong to that repository's own project identity — scanning them
138
+ * into the parent project is wrong attribution for any codebase, so the
139
+ * walkers skip these subtrees. Convention-free: this is git's own marker,
140
+ * not a host/tool path layout. The scan ROOT is exempt by construction
141
+ * (callers only test child directories).
142
+ */
143
+ export async function isGitBoundary(dirPath: string): Promise<boolean> {
144
+ try {
145
+ await withTimeout(
146
+ lstat(join(dirPath, '.git')),
147
+ FILE_OP_TIMEOUT_MS,
148
+ `lstat timed out: ${join(dirPath, '.git')}`
149
+ );
150
+ return true;
151
+ } catch {
152
+ return false;
153
+ }
154
+ }
155
+
101
156
  export class CodeScanner {
102
157
  private options: Required<ScanOptions>;
103
158
 
@@ -105,6 +160,25 @@ export class CodeScanner {
105
160
  this.options = { ...DEFAULT_OPTIONS, ...options };
106
161
  }
107
162
 
163
+ /**
164
+ * True when any directory strictly between `rootPath` and `filePath`
165
+ * carries its own `.git` entry (see isGitBoundary). Paths that don't
166
+ * resolve under `rootPath` are not judged here (return false) — the
167
+ * server's path validation handles escapes.
168
+ */
169
+ private async insideNestedGitBoundary(filePath: string, rootPath: string): Promise<boolean> {
170
+ const rel = relative(rootPath, filePath);
171
+ if (!rel || rel.startsWith('..')) return false;
172
+ const segments = rel.split(sep);
173
+ let current = rootPath;
174
+ // Walk intermediate directories only (exclude the file itself).
175
+ for (let i = 0; i < segments.length - 1; i++) {
176
+ current = join(current, segments[i]);
177
+ if (await isGitBoundary(current)) return true;
178
+ }
179
+ return false;
180
+ }
181
+
108
182
  /**
109
183
  * Maximum directory depth for recursive scanning
110
184
  * Prevents runaway recursion on deep/symlinked structures
@@ -121,6 +195,74 @@ export class CodeScanner {
121
195
  return chunks;
122
196
  }
123
197
 
198
+ /**
199
+ * Enumerate scan-eligible relative file paths under `rootPath` without
200
+ * reading or chunking content. Same walk + ignorePatterns + extension
201
+ * filter as `scanDirectory`, but bounded to O(file count) directory ops
202
+ * — cheap enough to call on every periodic reconcile tick.
203
+ *
204
+ * Returns relative paths normalized against `rootPath`, matching the
205
+ * shape the server stores in `memories.metadata->>'filePath'`. Use this
206
+ * for the scanner reconciliation channel (`POST /api/v1/scan/reconcile`).
207
+ *
208
+ * Defensive: skips any path whose `relative()` result contains a `..`
209
+ * traversal segment (can happen when a symlink resolves under root but
210
+ * the readdir entry path doesn't normalize cleanly). The server's
211
+ * `safeScanPath` rejects such paths; filtering here keeps a single
212
+ * malformed entry from failing the entire reconcile push.
213
+ */
214
+ async listFiles(rootPath: string): Promise<string[]> {
215
+ const paths: string[] = [];
216
+ await this.traversePaths(rootPath, rootPath, paths, 0);
217
+ return paths.filter((p) => !/(^|[/\\])\.\.([/\\]|$)/.test(p));
218
+ }
219
+
220
+ private async traversePaths(
221
+ currentPath: string,
222
+ rootPath: string,
223
+ out: string[],
224
+ depth: number
225
+ ): Promise<void> {
226
+ if (depth >= CodeScanner.MAX_DEPTH) return;
227
+ try {
228
+ const entries = await withTimeout(
229
+ readdir(currentPath),
230
+ FILE_OP_TIMEOUT_MS,
231
+ `readdir timed out: ${currentPath}`
232
+ );
233
+ for (const entry of entries) {
234
+ const fullPath = join(currentPath, entry);
235
+ const relativePath = relative(rootPath, fullPath);
236
+ if (this.shouldIgnore(relativePath)) continue;
237
+
238
+ const lstats = await withTimeout(
239
+ lstat(fullPath),
240
+ FILE_OP_TIMEOUT_MS,
241
+ `lstat timed out: ${fullPath}`
242
+ );
243
+ if (lstats.isSymbolicLink()) {
244
+ const resolved = await realpath(fullPath);
245
+ const resolvedRoot = await realpath(rootPath);
246
+ if (!resolved.startsWith(resolvedRoot + '/') && resolved !== resolvedRoot) continue;
247
+ }
248
+ const stats = lstats.isSymbolicLink()
249
+ ? await withTimeout(stat(fullPath), FILE_OP_TIMEOUT_MS, `stat timed out: ${fullPath}`)
250
+ : lstats;
251
+
252
+ if (stats.isDirectory()) {
253
+ if (await isGitBoundary(fullPath)) continue; // another repo's subtree
254
+ await this.traversePaths(fullPath, rootPath, out, depth + 1);
255
+ } else if (stats.isFile()) {
256
+ if (this.options.includeExtensions.includes(extname(fullPath))) {
257
+ out.push(relativePath);
258
+ }
259
+ }
260
+ }
261
+ } catch (error) {
262
+ logDebug('Error traversing directory (listFiles)', { path: currentPath, error });
263
+ }
264
+ }
265
+
124
266
  /**
125
267
  * Scan specific files and extract code chunks.
126
268
  * Pass rootPath to compute proper relative file paths in chunk metadata.
@@ -133,6 +275,13 @@ export class CodeScanner {
133
275
  if (this.shouldIgnore(filePath)) {
134
276
  continue;
135
277
  }
278
+ // Explicit file lists arrive from watcher events, which can race a
279
+ // worktree/nested-clone appearing — apply the same nested-git-boundary
280
+ // rule the walks use (an ancestor between root and the file carrying
281
+ // its own .git means the file belongs to another repository).
282
+ if (rootPath && (await this.insideNestedGitBoundary(filePath, rootPath))) {
283
+ continue;
284
+ }
136
285
 
137
286
  const ext = extname(filePath);
138
287
  if (this.options.includeExtensions.includes(ext)) {
@@ -214,6 +363,7 @@ export class CodeScanner {
214
363
  : lstats;
215
364
 
216
365
  if (stats.isDirectory()) {
366
+ if (await isGitBoundary(fullPath)) continue; // another repo's subtree
217
367
  await this.traverseDirectory(fullPath, rootPath, chunks, depth + 1);
218
368
  } else if (stats.isFile()) {
219
369
  const ext = extname(fullPath);
@@ -811,4 +961,49 @@ export class CodeScanner {
811
961
  private hash(content: string): string {
812
962
  return createHash('sha256').update(content).digest('hex').substring(0, 16);
813
963
  }
964
+
965
+ /**
966
+ * Walk the project for authority manifest/config/CI files and return their
967
+ * verbatim content. Reuses ignorePatterns; matches AUTHORITY_FILE_MATCHERS
968
+ * (not includeExtensions). Content-only — no chunking, no embeddings.
969
+ */
970
+ async collectAuthorityFiles(
971
+ projectRoot: string
972
+ ): Promise<Array<{ path: string; content: string; hash: string }>> {
973
+ const out: Array<{ path: string; content: string; hash: string }> = [];
974
+
975
+ // M2: cap walk depth to match the scanner's MAX_DEPTH (10)
976
+ const walk = async (dir: string, depth: number): Promise<void> => {
977
+ if (depth >= CodeScanner.MAX_DEPTH) return;
978
+ let entries;
979
+ try {
980
+ entries = await readdir(dir, { withFileTypes: true });
981
+ } catch {
982
+ return;
983
+ }
984
+ for (const ent of entries) {
985
+ const full = join(dir, ent.name);
986
+ const rel = relative(projectRoot, full).split(sep).join('/');
987
+ if (this.shouldIgnore(rel)) continue;
988
+ if (ent.isDirectory()) {
989
+ if (await isGitBoundary(full)) continue; // another repo's subtree
990
+ await walk(full, depth + 1);
991
+ } else if (AUTHORITY_FILE_MATCHERS.some((m) => m(rel))) {
992
+ try {
993
+ const content = await readFile(full, 'utf-8');
994
+ // C2: skip files whose content exceeds the server's 5MB cap —
995
+ // manifests are tiny; an oversized one is anomalous.
996
+ if (content.length > 5_000_000) continue;
997
+ const hash = createHash('sha256').update(content).digest('hex');
998
+ out.push({ path: rel, content, hash });
999
+ } catch {
1000
+ /* unreadable — skip */
1001
+ }
1002
+ }
1003
+ }
1004
+ };
1005
+
1006
+ await walk(projectRoot, 0);
1007
+ return out;
1008
+ }
814
1009
  }
package/src/index.ts CHANGED
@@ -7,7 +7,13 @@
7
7
 
8
8
  export { MCP_INSTRUCTIONS, MCP_INSTRUCTIONS_RAW, getMcpInstructions } from './instructions.js';
9
9
  export { USAGE_GUIDE } from './usageGuide.js';
10
- export { CodeScanner, type CodeChunk, type ScanOptions } from './codeScanner.js';
10
+ export {
11
+ CodeScanner,
12
+ AUTHORITY_FILE_MATCHERS,
13
+ isGitBoundary,
14
+ type CodeChunk,
15
+ type ScanOptions,
16
+ } from './codeScanner.js';
11
17
  export {
12
18
  FileSystemReader,
13
19
  getFileSystemReader,
@@ -4,8 +4,22 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for MCP instructions.
5
5
  * Shared instruction content imported by the server.
6
6
  *
7
- * Version: 2.93
8
- * Updated: 2026-05-15
7
+ * Version: 2.98
8
+ * Updated: 2026-05-27
9
+ *
10
+ * v2.98 — Doc truth contracts are the normal drift surface. linkedDocs and
11
+ * doc_code_couplings remain legacy diagnostics only; docs drift
12
+ * defaults to truth findings and legacy:true is explicit debug.
13
+ * v2.97 — Dropped legacy doc-coupling action guidance. Coupling rows are
14
+ * not truth findings (plan §1).
15
+ * v2.96 — Replace conditional memory_discover guidance with structural fix:
16
+ * bootstrap now includes _methodCatalog (discoverMemoryTools({})) so
17
+ * agents have the memory_tools calling convention from turn one.
18
+ * Instruction updated to reference _methodCatalog directly.
19
+ * v2.95 — Drop `augments` from JIT directive verdict list per plan §5 default
20
+ * (augments downgrades to ambient via the parallel recall gate, not
21
+ * the directive lane). See jit-knowledge-injector.md §5 decision note.
22
+ * v2.94 — Add JIT directive teaching (docs/development/jit-knowledge-injector.md §2.3).
9
23
  *
10
24
  * Code mode permanent — all memory operations via memory_tools sandbox.
11
25
  * memory_add, file_context etc. are now mnemonik.* methods, not standalone tools.
@@ -22,15 +36,17 @@ const INSTRUCTIONS_CONTENT = `You have Mnemonik, a persistent memory system for
22
36
  First call, every session: session_bootstrap. Read the mnemonik skill (from available_skills) for the full workflow.
23
37
  After bootstrap: execute _directive.message actions immediately (scanner daemon check is mandatory).
24
38
 
25
- Use memory_discover before memory_tools when you are unsure which mnemonik.* method to call, when a method has actions, or after a validation error.
39
+ The bootstrap response includes _methodCatalog the full list of mnemonik methods and the memory_tools calling convention. Read it before making any memory_tools calls. Use memory_discover({ method }) for the full schema and a copy-pasteable example of a specific method or action.
26
40
  Proactively call memory_search before starting new work — avoids rediscovering known patterns and contradicting past decisions.
27
41
  Proactively call file_context before editing any file — loads past bugs, decisions, and gotchas for that file.
28
42
  Proactively call checkpoint after making changes or decisions worth keeping — your context is ephemeral and checkpoint is the only way decisions survive across sessions and context compaction. Do not wait for the user to say "done" or "thanks".
29
43
 
30
- When mnemonik.file_context({ filePaths, cwd }) returns linkedDocs with driftStatus 'stale', update docs then call mnemonik.docs({ action: 'resolve', docPath, cwd }).
44
+ Documentation drift uses explicit doc-truth contracts. Treat _docDrift/docTruthFindings as actionable only when each finding includes a concrete assertion, named authority, observed mismatch, and agentAction='update_doc'. _docHealth, linkedDocs, stale-coupling counts, and docs({ action: 'drift', legacy: true }) are diagnostics only, not instructions to edit or resolve docs.
31
45
 
32
46
  Ambient envelopes contain background memories surfaced because they may be relevant to your current turn. Treat them as information, not directive. Weight them lower than your own reasoning unless they directly answer the question. They are advisory recall, not authoritative evidence.
33
47
 
48
+ Directive envelopes with signal="jit_required" are different from ambient. They surface memories that the server has classified as contradicting or materially refining the answer you were about to give to the current prompt. Each memory carries a verdict (contradicts | refines) and a one-line reason. Treat these as authoritative for the current response — comply with the surfaced fact unless it is clearly outdated or wrong. Do not silently route around them. If you disagree with a surfaced memory, say so explicitly and explain why; do not just ignore it.
49
+
34
50
  Skip: formatting-only, trivial one-line, mechanical refactors, git ops, tests.
35
51
  Save: architectural decisions, bug root causes, user preferences, discovered patterns, multi-file changes.`;
36
52
 
package/src/usageGuide.ts CHANGED
@@ -4,14 +4,15 @@
4
4
  * This is the SINGLE SOURCE OF TRUTH for the usage guide.
5
5
  * Shared usage guide content imported by the server.
6
6
  *
7
- * Version: 2.80
8
- * Updated: 2026-02-20 - Aligned with instructions/rules/skill 80
7
+ * Version: 2.82
8
+ * Updated: 2026-05-27 - Doc-truth-contract-rebuild: teach authority-backed
9
+ * truth findings and keep legacy coupling drift diagnostic only.
9
10
  *
10
11
  * This guide focuses on HOW to use Mnemonik effectively, not WHAT tools exist.
11
12
  * Tool schemas already tell agents what's available - they need the workflow.
12
13
  */
13
14
 
14
- export const USAGE_GUIDE = `# Mnemonik Workflow Guide (v2.80)
15
+ export const USAGE_GUIDE = `# Mnemonik Workflow Guide (v2.82)
15
16
 
16
17
  ## Workflow
17
18
 
@@ -40,8 +41,7 @@ session_bootstrap → memory_search → file_context → [work] → memory_add
40
41
  - memory_add: save decisions, outcomes, patterns, bug root causes
41
42
  - memory_state: reinforce (memory helped), supersede (replace outdated), deprecate, penalize, dispute
42
43
  - tasks: mark tasks in progress or complete
43
- - mnemonik.docs({ action: 'drift' }): check for stale documentation after code changes
44
- - mnemonik.docs({ action: 'resolve' }): mark stale docs as fixed after updating them
44
+ - mnemonik.docs({ action: 'status' }): view doc-truth health (legacy coupling counts are diagnostic only — do not act on them as drift)
45
45
 
46
46
  ### Diagnostics
47
47
  - doctor: when tool calls fail or behavior is inconsistent
@@ -67,7 +67,7 @@ Never tell the user significant work is done without calling memory_add first in
67
67
  - Long sessions: re-run memory_search after switching topics
68
68
  - Conflicting info: use memory_state to supersede/dispute
69
69
  - High-impact changes: save memory immediately after verification
70
- - When file_context returns linkedDocs with driftStatus 'stale': update docs then mnemonik.docs({ action: 'resolve' })
70
+ - Act on docTruthFindings/_docDrift only when the finding has authority, observed mismatch, and agentAction='update_doc'; linkedDocs and stale-coupling counts are legacy diagnostics
71
71
 
72
72
  ## Anti-fade (every ~10 tool calls)
73
73