gitmem-mcp 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/CHANGELOG.md +14 -14
  2. package/dist/commands/check.d.ts +1 -1
  3. package/dist/commands/check.js +4 -3
  4. package/dist/diagnostics/anonymizer.d.ts +1 -1
  5. package/dist/diagnostics/anonymizer.js +1 -1
  6. package/dist/diagnostics/channels.d.ts +1 -1
  7. package/dist/diagnostics/channels.js +1 -1
  8. package/dist/diagnostics/collector.d.ts +1 -1
  9. package/dist/diagnostics/collector.js +1 -1
  10. package/dist/diagnostics/index.d.ts +1 -1
  11. package/dist/diagnostics/index.js +1 -1
  12. package/dist/hooks/quick-retrieve.js +2 -1
  13. package/dist/index.js +0 -0
  14. package/dist/schemas/active-sessions.d.ts +9 -9
  15. package/dist/schemas/active-sessions.js +1 -1
  16. package/dist/schemas/common.d.ts +2 -5
  17. package/dist/schemas/common.js +13 -7
  18. package/dist/schemas/create-learning.js +1 -1
  19. package/dist/schemas/session-close.d.ts +5 -8
  20. package/dist/schemas/session-close.js +7 -3
  21. package/dist/schemas/session-start.d.ts +4 -4
  22. package/dist/schemas/session-start.js +1 -1
  23. package/dist/schemas/thread.d.ts +1 -1
  24. package/dist/schemas/thread.js +1 -1
  25. package/dist/server.d.ts +2 -2
  26. package/dist/server.js +21 -10
  27. package/dist/services/active-sessions.js +3 -2
  28. package/dist/services/agent-briefing.d.ts +1 -1
  29. package/dist/services/agent-briefing.js +1 -1
  30. package/dist/services/agent-detection.d.ts +1 -0
  31. package/dist/services/agent-detection.js +21 -12
  32. package/dist/services/analytics.d.ts +1 -1
  33. package/dist/services/analytics.js +3 -3
  34. package/dist/services/behavioral-decay.js +2 -2
  35. package/dist/services/cache.d.ts +1 -1
  36. package/dist/services/cache.js +1 -1
  37. package/dist/services/compliance-validator.d.ts +1 -1
  38. package/dist/services/compliance-validator.js +5 -5
  39. package/dist/services/config.d.ts +1 -1
  40. package/dist/services/config.js +1 -1
  41. package/dist/services/file-lock.js +12 -0
  42. package/dist/services/gitmem-dir.d.ts +17 -4
  43. package/dist/services/gitmem-dir.js +43 -9
  44. package/dist/services/local-file-storage.d.ts +1 -1
  45. package/dist/services/local-file-storage.js +4 -3
  46. package/dist/services/local-vector-search.d.ts +1 -1
  47. package/dist/services/local-vector-search.js +2 -2
  48. package/dist/services/metrics.d.ts +6 -6
  49. package/dist/services/metrics.js +8 -8
  50. package/dist/services/session-state.d.ts +7 -7
  51. package/dist/services/session-state.js +19 -7
  52. package/dist/services/startup.d.ts +1 -1
  53. package/dist/services/startup.js +3 -2
  54. package/dist/services/supabase-client.d.ts +17 -6
  55. package/dist/services/supabase-client.js +44 -8
  56. package/dist/services/thread-manager.d.ts +1 -1
  57. package/dist/services/thread-manager.js +5 -5
  58. package/dist/services/thread-supabase.d.ts +1 -1
  59. package/dist/services/thread-supabase.js +2 -2
  60. package/dist/services/transcript-chunker.d.ts +1 -1
  61. package/dist/services/transcript-chunker.js +1 -1
  62. package/dist/services/variant-assignment.d.ts +6 -6
  63. package/dist/services/variant-assignment.js +9 -8
  64. package/dist/tools/analyze.d.ts +2 -2
  65. package/dist/tools/analyze.js +2 -2
  66. package/dist/tools/archive-learning.js +36 -22
  67. package/dist/tools/confirm-scars.js +1 -1
  68. package/dist/tools/create-decision.d.ts +1 -1
  69. package/dist/tools/create-decision.js +2 -2
  70. package/dist/tools/create-learning.d.ts +1 -1
  71. package/dist/tools/create-learning.js +4 -4
  72. package/dist/tools/create-linear-issue.d.ts +18 -0
  73. package/dist/tools/create-linear-issue.js +197 -0
  74. package/dist/tools/create-thread.d.ts +1 -1
  75. package/dist/tools/create-thread.js +2 -2
  76. package/dist/tools/definitions.js +50 -48
  77. package/dist/tools/get-transcript.d.ts +1 -1
  78. package/dist/tools/get-transcript.js +1 -1
  79. package/dist/tools/graph-traverse.d.ts +1 -1
  80. package/dist/tools/graph-traverse.js +18 -16
  81. package/dist/tools/list-threads.d.ts +2 -2
  82. package/dist/tools/list-threads.js +4 -4
  83. package/dist/tools/log.d.ts +1 -1
  84. package/dist/tools/log.js +1 -1
  85. package/dist/tools/prepare-context.d.ts +1 -1
  86. package/dist/tools/prepare-context.js +1 -1
  87. package/dist/tools/recall.d.ts +4 -4
  88. package/dist/tools/recall.js +25 -25
  89. package/dist/tools/record-scar-usage-batch.js +2 -2
  90. package/dist/tools/record-scar-usage.d.ts +1 -1
  91. package/dist/tools/record-scar-usage.js +3 -3
  92. package/dist/tools/resolve-thread.d.ts +2 -2
  93. package/dist/tools/resolve-thread.js +3 -3
  94. package/dist/tools/save-transcript.d.ts +1 -1
  95. package/dist/tools/save-transcript.js +1 -1
  96. package/dist/tools/search.d.ts +1 -1
  97. package/dist/tools/search.js +1 -1
  98. package/dist/tools/session-close.d.ts +1 -1
  99. package/dist/tools/session-close.js +31 -31
  100. package/dist/tools/session-start.d.ts +5 -5
  101. package/dist/tools/session-start.js +63 -61
  102. package/dist/types/index.d.ts +13 -13
  103. package/hooks/.claude-plugin/plugin.json +1 -1
  104. package/hooks/scripts/post-tool-use.sh +1 -1
  105. package/hooks/scripts/recall-check.sh +1 -1
  106. package/hooks/scripts/session-close-check.sh +1 -1
  107. package/hooks/scripts/session-start.sh +1 -1
  108. package/package.json +6 -3
  109. package/dist/commands/check.d.ts.map +0 -1
  110. package/dist/commands/check.js.map +0 -1
  111. package/dist/constants/closing-questions.d.ts.map +0 -1
  112. package/dist/constants/closing-questions.js.map +0 -1
  113. package/dist/diagnostics/anonymizer.d.ts.map +0 -1
  114. package/dist/diagnostics/anonymizer.js.map +0 -1
  115. package/dist/diagnostics/channels.d.ts.map +0 -1
  116. package/dist/diagnostics/channels.js.map +0 -1
  117. package/dist/diagnostics/collector.d.ts.map +0 -1
  118. package/dist/diagnostics/collector.js.map +0 -1
  119. package/dist/diagnostics/index.d.ts.map +0 -1
  120. package/dist/diagnostics/index.js.map +0 -1
  121. package/dist/hooks/format-utils.d.ts.map +0 -1
  122. package/dist/hooks/format-utils.js.map +0 -1
  123. package/dist/hooks/quick-retrieve.d.ts.map +0 -1
  124. package/dist/hooks/quick-retrieve.js.map +0 -1
  125. package/dist/index.d.ts.map +0 -1
  126. package/dist/index.js.map +0 -1
  127. package/dist/schemas/absorb-observations.d.ts.map +0 -1
  128. package/dist/schemas/absorb-observations.js.map +0 -1
  129. package/dist/schemas/active-sessions.d.ts.map +0 -1
  130. package/dist/schemas/active-sessions.js.map +0 -1
  131. package/dist/schemas/analyze.d.ts.map +0 -1
  132. package/dist/schemas/analyze.js.map +0 -1
  133. package/dist/schemas/common.d.ts.map +0 -1
  134. package/dist/schemas/common.js.map +0 -1
  135. package/dist/schemas/create-decision.d.ts.map +0 -1
  136. package/dist/schemas/create-decision.js.map +0 -1
  137. package/dist/schemas/create-learning.d.ts.map +0 -1
  138. package/dist/schemas/create-learning.js.map +0 -1
  139. package/dist/schemas/get-transcript.d.ts.map +0 -1
  140. package/dist/schemas/get-transcript.js.map +0 -1
  141. package/dist/schemas/index.d.ts.map +0 -1
  142. package/dist/schemas/index.js.map +0 -1
  143. package/dist/schemas/log.d.ts.map +0 -1
  144. package/dist/schemas/log.js.map +0 -1
  145. package/dist/schemas/prepare-context.d.ts.map +0 -1
  146. package/dist/schemas/prepare-context.js.map +0 -1
  147. package/dist/schemas/recall.d.ts.map +0 -1
  148. package/dist/schemas/recall.js.map +0 -1
  149. package/dist/schemas/record-scar-usage-batch.d.ts.map +0 -1
  150. package/dist/schemas/record-scar-usage-batch.js.map +0 -1
  151. package/dist/schemas/record-scar-usage.d.ts.map +0 -1
  152. package/dist/schemas/record-scar-usage.js.map +0 -1
  153. package/dist/schemas/registry.d.ts.map +0 -1
  154. package/dist/schemas/registry.js.map +0 -1
  155. package/dist/schemas/save-transcript.d.ts.map +0 -1
  156. package/dist/schemas/save-transcript.js.map +0 -1
  157. package/dist/schemas/search-transcripts.d.ts.map +0 -1
  158. package/dist/schemas/search-transcripts.js.map +0 -1
  159. package/dist/schemas/search.d.ts.map +0 -1
  160. package/dist/schemas/search.js.map +0 -1
  161. package/dist/schemas/session-close.d.ts.map +0 -1
  162. package/dist/schemas/session-close.js.map +0 -1
  163. package/dist/schemas/session-start.d.ts.map +0 -1
  164. package/dist/schemas/session-start.js.map +0 -1
  165. package/dist/schemas/thread.d.ts.map +0 -1
  166. package/dist/schemas/thread.js.map +0 -1
  167. package/dist/server.d.ts.map +0 -1
  168. package/dist/server.js.map +0 -1
  169. package/dist/services/active-sessions.d.ts.map +0 -1
  170. package/dist/services/active-sessions.js.map +0 -1
  171. package/dist/services/agent-briefing.d.ts.map +0 -1
  172. package/dist/services/agent-briefing.js.map +0 -1
  173. package/dist/services/agent-detection.d.ts.map +0 -1
  174. package/dist/services/agent-detection.js.map +0 -1
  175. package/dist/services/analytics.d.ts.map +0 -1
  176. package/dist/services/analytics.js.map +0 -1
  177. package/dist/services/behavioral-decay.d.ts.map +0 -1
  178. package/dist/services/behavioral-decay.js.map +0 -1
  179. package/dist/services/bm25.d.ts.map +0 -1
  180. package/dist/services/bm25.js.map +0 -1
  181. package/dist/services/cache.d.ts.map +0 -1
  182. package/dist/services/cache.js.map +0 -1
  183. package/dist/services/cache.test.d.ts +0 -8
  184. package/dist/services/cache.test.d.ts.map +0 -1
  185. package/dist/services/cache.test.js +0 -267
  186. package/dist/services/cache.test.js.map +0 -1
  187. package/dist/services/compliance-validator.d.ts.map +0 -1
  188. package/dist/services/compliance-validator.js.map +0 -1
  189. package/dist/services/config.d.ts.map +0 -1
  190. package/dist/services/config.js.map +0 -1
  191. package/dist/services/display-protocol.d.ts.map +0 -1
  192. package/dist/services/display-protocol.js.map +0 -1
  193. package/dist/services/effect-tracker.d.ts.map +0 -1
  194. package/dist/services/effect-tracker.js.map +0 -1
  195. package/dist/services/embedding.d.ts.map +0 -1
  196. package/dist/services/embedding.js.map +0 -1
  197. package/dist/services/file-lock.d.ts.map +0 -1
  198. package/dist/services/file-lock.js.map +0 -1
  199. package/dist/services/gitmem-dir.d.ts.map +0 -1
  200. package/dist/services/gitmem-dir.js.map +0 -1
  201. package/dist/services/local-file-storage.d.ts.map +0 -1
  202. package/dist/services/local-file-storage.js.map +0 -1
  203. package/dist/services/local-vector-search.d.ts.map +0 -1
  204. package/dist/services/local-vector-search.js.map +0 -1
  205. package/dist/services/metrics.d.ts.map +0 -1
  206. package/dist/services/metrics.js.map +0 -1
  207. package/dist/services/session-state.d.ts.map +0 -1
  208. package/dist/services/session-state.js.map +0 -1
  209. package/dist/services/startup.d.ts.map +0 -1
  210. package/dist/services/startup.js.map +0 -1
  211. package/dist/services/storage.d.ts.map +0 -1
  212. package/dist/services/storage.js.map +0 -1
  213. package/dist/services/supabase-client.d.ts.map +0 -1
  214. package/dist/services/supabase-client.js.map +0 -1
  215. package/dist/services/thread-dedup.d.ts.map +0 -1
  216. package/dist/services/thread-dedup.js.map +0 -1
  217. package/dist/services/thread-manager.d.ts.map +0 -1
  218. package/dist/services/thread-manager.js.map +0 -1
  219. package/dist/services/thread-suggestions.d.ts.map +0 -1
  220. package/dist/services/thread-suggestions.js.map +0 -1
  221. package/dist/services/thread-supabase.d.ts.map +0 -1
  222. package/dist/services/thread-supabase.js.map +0 -1
  223. package/dist/services/thread-vitality.d.ts.map +0 -1
  224. package/dist/services/thread-vitality.js.map +0 -1
  225. package/dist/services/tier.d.ts.map +0 -1
  226. package/dist/services/tier.js.map +0 -1
  227. package/dist/services/timezone.d.ts.map +0 -1
  228. package/dist/services/timezone.js.map +0 -1
  229. package/dist/services/transcript-chunker.d.ts.map +0 -1
  230. package/dist/services/transcript-chunker.js.map +0 -1
  231. package/dist/services/triple-writer.d.ts.map +0 -1
  232. package/dist/services/triple-writer.js.map +0 -1
  233. package/dist/services/variant-assignment.d.ts.map +0 -1
  234. package/dist/services/variant-assignment.js.map +0 -1
  235. package/dist/services/variant-generation.d.ts.map +0 -1
  236. package/dist/services/variant-generation.js.map +0 -1
  237. package/dist/tools/absorb-observations.d.ts.map +0 -1
  238. package/dist/tools/absorb-observations.js.map +0 -1
  239. package/dist/tools/analyze.d.ts.map +0 -1
  240. package/dist/tools/analyze.js.map +0 -1
  241. package/dist/tools/archive-learning.d.ts.map +0 -1
  242. package/dist/tools/archive-learning.js.map +0 -1
  243. package/dist/tools/cleanup-threads.d.ts.map +0 -1
  244. package/dist/tools/cleanup-threads.js.map +0 -1
  245. package/dist/tools/confirm-scars.d.ts.map +0 -1
  246. package/dist/tools/confirm-scars.js.map +0 -1
  247. package/dist/tools/create-decision.d.ts.map +0 -1
  248. package/dist/tools/create-decision.js.map +0 -1
  249. package/dist/tools/create-learning.d.ts.map +0 -1
  250. package/dist/tools/create-learning.js.map +0 -1
  251. package/dist/tools/create-thread.d.ts.map +0 -1
  252. package/dist/tools/create-thread.js.map +0 -1
  253. package/dist/tools/definitions.d.ts.map +0 -1
  254. package/dist/tools/definitions.js.map +0 -1
  255. package/dist/tools/dismiss-suggestion.d.ts.map +0 -1
  256. package/dist/tools/dismiss-suggestion.js.map +0 -1
  257. package/dist/tools/get-transcript.d.ts.map +0 -1
  258. package/dist/tools/get-transcript.js.map +0 -1
  259. package/dist/tools/graph-traverse.d.ts.map +0 -1
  260. package/dist/tools/graph-traverse.js.map +0 -1
  261. package/dist/tools/list-threads.d.ts.map +0 -1
  262. package/dist/tools/list-threads.js.map +0 -1
  263. package/dist/tools/log.d.ts.map +0 -1
  264. package/dist/tools/log.js.map +0 -1
  265. package/dist/tools/prepare-context.d.ts.map +0 -1
  266. package/dist/tools/prepare-context.js.map +0 -1
  267. package/dist/tools/promote-suggestion.d.ts.map +0 -1
  268. package/dist/tools/promote-suggestion.js.map +0 -1
  269. package/dist/tools/recall.d.ts.map +0 -1
  270. package/dist/tools/recall.js.map +0 -1
  271. package/dist/tools/recall.test.d.ts +0 -5
  272. package/dist/tools/recall.test.d.ts.map +0 -1
  273. package/dist/tools/recall.test.js +0 -155
  274. package/dist/tools/recall.test.js.map +0 -1
  275. package/dist/tools/record-scar-usage-batch.d.ts.map +0 -1
  276. package/dist/tools/record-scar-usage-batch.js.map +0 -1
  277. package/dist/tools/record-scar-usage.d.ts.map +0 -1
  278. package/dist/tools/record-scar-usage.js.map +0 -1
  279. package/dist/tools/resolve-thread.d.ts.map +0 -1
  280. package/dist/tools/resolve-thread.js.map +0 -1
  281. package/dist/tools/save-transcript.d.ts.map +0 -1
  282. package/dist/tools/save-transcript.js.map +0 -1
  283. package/dist/tools/search-transcripts.d.ts.map +0 -1
  284. package/dist/tools/search-transcripts.js.map +0 -1
  285. package/dist/tools/search.d.ts.map +0 -1
  286. package/dist/tools/search.js.map +0 -1
  287. package/dist/tools/session-close.d.ts.map +0 -1
  288. package/dist/tools/session-close.js.map +0 -1
  289. package/dist/tools/session-start.d.ts.map +0 -1
  290. package/dist/tools/session-start.js.map +0 -1
  291. package/dist/types/index.d.ts.map +0 -1
  292. package/dist/types/index.js.map +0 -1
  293. package/hooks/tests/test-hooks.sh +0 -577
@@ -17,29 +17,31 @@ import { Timer, buildPerformanceData, } from "../services/metrics.js";
17
17
  import { wrapDisplay } from "../services/display-protocol.js";
18
18
  // --- Constants ---
19
19
  const SELECT_COLS = "id,subject,predicate,object,event_time,decay_weight,source_type,source_id,source_linear_issue,created_by";
20
- const KNOWN_AGENTS = ["CLI", "DAC", "CODA-1", "Brain_Local", "Brain_Cloud"];
20
+ const KNOWN_AGENTS = ["cli", "desktop", "autonomous", "local", "cloud", "CLI", "DAC", "CODA-1", "Brain_Local", "Brain_Cloud"];
21
21
  /** Persona names are resolved dynamically via triple-writer's normalizePersonaLabel */
22
22
  const KNOWN_PERSONAS = [];
23
23
  function normalizeNode(input) {
24
24
  const trimmed = input.trim();
25
- // Already prefixed: "Scar: Title", "Issue: OD-466", etc.
26
- if (/^(Scar|Win|Decision|Pattern|Anti-Pattern|Issue|Agent|Persona|Thread):/.test(trimmed)) {
27
- return { pattern: `*${trimmed}*`, type: trimmed.split(":")[0] };
25
+ // Sanitize: strip PostgREST structural chars that could escape ilike/or expressions
26
+ const safe = trimmed.replace(/[(),\0]/g, "");
27
+ // Already prefixed: "Scar: Title", "Issue: PROJ-123", etc.
28
+ if (/^(Scar|Win|Decision|Pattern|Anti-Pattern|Issue|Agent|Persona|Thread):/.test(safe)) {
29
+ return { pattern: `*${safe}*`, type: safe.split(":")[0] };
28
30
  }
29
- // OD-XXX issue pattern
30
- if (/^OD-\d+$/i.test(trimmed)) {
31
- return { pattern: `*${trimmed.toUpperCase()}*`, type: "Issue" };
31
+ // Issue identifier pattern (e.g., PROJ-123, ENG-456)
32
+ if (/^[A-Z]+-\d+$/i.test(safe)) {
33
+ return { pattern: `*${safe.toUpperCase()}*`, type: "Issue" };
32
34
  }
33
35
  // Known agent names
34
- if (KNOWN_AGENTS.includes(trimmed)) {
35
- return { pattern: `*Agent: ${trimmed}*`, type: "Agent" };
36
+ if (KNOWN_AGENTS.includes(safe)) {
37
+ return { pattern: `*Agent: ${safe}*`, type: "Agent" };
36
38
  }
37
39
  // Known persona names
38
- if (KNOWN_PERSONAS.includes(trimmed)) {
39
- return { pattern: `*Persona: ${trimmed}*`, type: "Persona" };
40
+ if (KNOWN_PERSONAS.includes(safe)) {
41
+ return { pattern: `*Persona: ${safe}*`, type: "Persona" };
40
42
  }
41
43
  // Fallback: fuzzy search
42
- return { pattern: `*${trimmed}*`, type: "Unknown" };
44
+ return { pattern: `*${safe}*`, type: "Unknown" };
43
45
  }
44
46
  /** Detect the type label from a subject/object string */
45
47
  function detectNodeType(label) {
@@ -283,13 +285,13 @@ async function stats(params, timer) {
283
285
  for (const t of allTriples) {
284
286
  objectCounts[t.object] = (objectCounts[t.object] || 0) + 1;
285
287
  }
286
- // Issues by learning count (objects matching "Issue: OD-*")
288
+ // Issues by learning count (objects matching "Issue: *")
287
289
  const issueCounts = {};
288
290
  for (const t of allTriples) {
289
- if (t.object.startsWith("Issue: OD-")) {
291
+ if (t.object.startsWith("Issue: ")) {
290
292
  issueCounts[t.object] = (issueCounts[t.object] || 0) + 1;
291
293
  }
292
- if (t.subject.startsWith("Issue: OD-")) {
294
+ if (t.subject.startsWith("Issue: ")) {
293
295
  issueCounts[t.subject] = (issueCounts[t.subject] || 0) + 1;
294
296
  }
295
297
  }
@@ -359,7 +361,7 @@ export async function graphTraverse(params) {
359
361
  }
360
362
  // Validate: node required for all lenses except stats
361
363
  if (lens !== "stats" && !params.node) {
362
- const missingNodeMsg = `The '${lens}' lens requires a 'node' parameter (e.g., "OD-466", "CLI", "Scar: Done ≠ Deployed")`;
364
+ const missingNodeMsg = `The '${lens}' lens requires a 'node' parameter (e.g., "PROJ-123", "cli", "Scar: Done ≠ Deployed")`;
363
365
  return {
364
366
  success: false,
365
367
  lens,
@@ -1,10 +1,10 @@
1
1
  /**
2
- * list_threads Tool (OD-thread-lifecycle, OD-622)
2
+ * list_threads Tool
3
3
  *
4
4
  * List open threads across recent sessions. Shows unresolved work items
5
5
  * that carry over between sessions, with IDs for resolution.
6
6
  *
7
- * OD-622: Primary read from Supabase (source of truth).
7
+ * Primary read from Supabase (source of truth).
8
8
  * Falls back to session-based aggregation (same as session_start),
9
9
  * then in-memory session state, then .gitmem/threads.json.
10
10
  *
@@ -1,10 +1,10 @@
1
1
  /**
2
- * list_threads Tool (OD-thread-lifecycle, OD-622)
2
+ * list_threads Tool
3
3
  *
4
4
  * List open threads across recent sessions. Shows unresolved work items
5
5
  * that carry over between sessions, with IDs for resolution.
6
6
  *
7
- * OD-622: Primary read from Supabase (source of truth).
7
+ * Primary read from Supabase (source of truth).
8
8
  * Falls back to session-based aggregation (same as session_start),
9
9
  * then in-memory session state, then .gitmem/threads.json.
10
10
  *
@@ -14,7 +14,7 @@ import { v4 as uuidv4 } from "uuid";
14
14
  import { hasSupabase } from "../services/tier.js";
15
15
  import { getProject } from "../services/session-state.js";
16
16
  import { aggregateThreads, loadThreadsFile, mergeThreadStates } from "../services/thread-manager.js";
17
- import { deduplicateThreadList } from "../services/thread-dedup.js"; // OD-641
17
+ import { deduplicateThreadList } from "../services/thread-dedup.js";
18
18
  import { listThreadsFromSupabase } from "../services/thread-supabase.js";
19
19
  import * as supabase from "../services/supabase-client.js";
20
20
  import { Timer, recordMetrics, buildPerformanceData, } from "../services/metrics.js";
@@ -67,7 +67,7 @@ export async function listThreads(params) {
67
67
  const project = params.project || getProject() || "default";
68
68
  let allThreads = null;
69
69
  let source = "file";
70
- // OD-622: Try Supabase first (source of truth)
70
+ // Try Supabase first (source of truth)
71
71
  const supabaseThreads = await listThreadsFromSupabase(project, {
72
72
  statusFilter: includeResolved ? undefined : statusFilter,
73
73
  includeResolved,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * log Tool (OD-561)
2
+ * log Tool
3
3
  *
4
4
  * Chronological listing of recent learnings, like `git log`.
5
5
  * Pure read-only operation with no side effects.
package/dist/tools/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * log Tool (OD-561)
2
+ * log Tool
3
3
  *
4
4
  * Chronological listing of recent learnings, like `git log`.
5
5
  * Pure read-only operation with no side effects.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * prepare_context Tool (GitMem v2 Phase 1 — OD-593)
2
+ * prepare_context Tool
3
3
  *
4
4
  * Bridge between global memory and agents that can't call recall directly.
5
5
  * The lead agent calls this to generate a portable memory payload that
@@ -1,5 +1,5 @@
1
1
  /**
2
- * prepare_context Tool (GitMem v2 Phase 1 — OD-593)
2
+ * prepare_context Tool
3
3
  *
4
4
  * Bridge between global memory and agents that can't call recall directly.
5
5
  * The lead agent calls this to generate a portable memory payload that
@@ -4,12 +4,12 @@
4
4
  * Check institutional memory for relevant scars before taking action.
5
5
  * Core GitMem MVP tool that enables "check before act" workflow.
6
6
  *
7
- * Performance target: <2000ms response time (OD-429)
7
+ * Performance target: <2000ms response time
8
8
  *
9
- * OD-489: Uses local vector search when available for speed,
9
+ * Uses local vector search when available for speed,
10
10
  * falls back to Supabase scar_search when local cache isn't ready.
11
11
  *
12
- * OD-466: After scar search, fetches related knowledge triples and
12
+ * After scar search, fetches related knowledge triples and
13
13
  * includes them in the formatted response for relationship context.
14
14
  */
15
15
  import type { KnowledgeTriple } from "../services/supabase-client.js";
@@ -26,7 +26,7 @@ export interface RecallParams {
26
26
  similarity_threshold?: number;
27
27
  }
28
28
  /**
29
- * Required verification block for enforcement gate (OD-487)
29
+ * Required verification block for enforcement gate
30
30
  */
31
31
  interface RequiredVerification {
32
32
  when: string;
@@ -4,12 +4,12 @@
4
4
  * Check institutional memory for relevant scars before taking action.
5
5
  * Core GitMem MVP tool that enables "check before act" workflow.
6
6
  *
7
- * Performance target: <2000ms response time (OD-429)
7
+ * Performance target: <2000ms response time
8
8
  *
9
- * OD-489: Uses local vector search when available for speed,
9
+ * Uses local vector search when available for speed,
10
10
  * falls back to Supabase scar_search when local cache isn't ready.
11
11
  *
12
- * OD-466: After scar search, fetches related knowledge triples and
12
+ * After scar search, fetches related knowledge triples and
13
13
  * includes them in the formatted response for relationship context.
14
14
  */
15
15
  import * as supabase from "../services/supabase-client.js";
@@ -19,8 +19,8 @@ import { getProject } from "../services/session-state.js";
19
19
  import { getStorage } from "../services/storage.js";
20
20
  import { Timer, recordMetrics, buildPerformanceData, buildComponentPerformance, calculateContextBytes, } from "../services/metrics.js";
21
21
  import { getOrAssignVariant, formatVariantEnforcement, } from "../services/variant-assignment.js";
22
- import { addSurfacedScars, getCurrentSession } from "../services/session-state.js"; // OD-552
23
- import { getAgentIdentity } from "../services/agent-detection.js"; // OD-547
22
+ import { addSurfacedScars, getCurrentSession } from "../services/session-state.js";
23
+ import { getAgentIdentity } from "../services/agent-detection.js";
24
24
  import { v4 as uuidv4 } from "uuid";
25
25
  import * as fs from "fs";
26
26
  import { getSessionPath } from "../services/gitmem-dir.js";
@@ -35,7 +35,7 @@ function formatResponse(scars, plan, dismissals) {
35
35
 
36
36
  No past lessons match this plan closely enough. Scars accumulate as you work — create learnings during session close to build institutional memory.`;
37
37
  }
38
- // OD-487: Check if any scars have required_verification (blocking gates)
38
+ // Check if any scars have required_verification (blocking gates)
39
39
  const scarsWithVerification = scars.filter((s) => s.required_verification?.blocking);
40
40
  const lines = [
41
41
  "🧠 INSTITUTIONAL MEMORY ACTIVATED",
@@ -43,7 +43,7 @@ No past lessons match this plan closely enough. Scars accumulate as you work —
43
43
  `Found ${scars.length} relevant scar${scars.length === 1 ? "" : "s"} for your plan:`,
44
44
  "",
45
45
  ];
46
- // OD-487: Display blocking verification requirements FIRST and prominently
46
+ // Display blocking verification requirements FIRST and prominently
47
47
  if (scarsWithVerification.length > 0) {
48
48
  lines.push("═══════════════════════════════════════════════════════════════");
49
49
  lines.push("🚨 **VERIFICATION REQUIRED BEFORE PROCEEDING**");
@@ -84,7 +84,7 @@ No past lessons match this plan closely enough. Scars accumulate as you work —
84
84
  lines.push(` _[${counts.dismissed}x dismissed — consider archiving with gm-archive]_`);
85
85
  }
86
86
  }
87
- // OD-525: Use variant enforcement text if available (blind to variant name)
87
+ // Use variant enforcement text if available (blind to variant name)
88
88
  if (scar.variant_info?.has_variants && scar.variant_info.variant) {
89
89
  const variantText = formatVariantEnforcement(scar.variant_info.variant, scar.title);
90
90
  lines.push(variantText);
@@ -104,7 +104,7 @@ No past lessons match this plan closely enough. Scars accumulate as you work —
104
104
  lines.push("");
105
105
  lines.push("*Applies when:* " + scar.applies_when.slice(0, 3).join(", "));
106
106
  }
107
- // OD-530: Render LLM-cooperative enforcement fields (OD-508)
107
+ // Render LLM-cooperative enforcement fields
108
108
  if (scar.why_this_matters) {
109
109
  lines.push("");
110
110
  lines.push(`**Why this matters:** ${scar.why_this_matters}`);
@@ -123,7 +123,7 @@ No past lessons match this plan closely enough. Scars accumulate as you work —
123
123
  lines.push(` - [ ] ${criterion}`);
124
124
  }
125
125
  }
126
- // OD-466: Render related knowledge triples
126
+ // Render related knowledge triples
127
127
  if (scar.related_triples && scar.related_triples.length > 0) {
128
128
  lines.push("");
129
129
  lines.push("*Related knowledge:*");
@@ -170,8 +170,8 @@ export async function recall(params) {
170
170
  }
171
171
  const project = params.project || getProject() || "default";
172
172
  const matchCount = params.match_count || 3;
173
- const issueId = params.issue_id; // OD-525: For variant assignment
174
- // OD-686: Similarity threshold — suppress weak matches
173
+ const issueId = params.issue_id; // For variant assignment
174
+ // Similarity threshold — suppress weak matches
175
175
  const defaultThreshold = hasSupabase() ? 0.35 : 0.4;
176
176
  const similarityThreshold = params.similarity_threshold ?? defaultThreshold;
177
177
  // Free tier: use local keyword search
@@ -191,7 +191,7 @@ export async function recall(params) {
191
191
  applies_when: [],
192
192
  similarity: scar.similarity || 0,
193
193
  }))
194
- // OD-686: Filter below threshold
194
+ // Filter below threshold
195
195
  .filter((scar) => scar.similarity >= similarityThreshold);
196
196
  const latencyMs = timer.stop();
197
197
  const perfData = buildPerformanceData("recall", latencyMs, scars.length, {
@@ -253,7 +253,7 @@ export async function recall(params) {
253
253
  let cache_age_ms;
254
254
  let search_mode = "remote";
255
255
  let network_call = true; // Assume network call until proven otherwise
256
- // OD-489: Try local vector search first (fast, no Supabase hit)
256
+ // Try local vector search first (fast, no Supabase hit)
257
257
  // Falls back to Supabase scar_search if local cache isn't ready
258
258
  const searchTimer = new Timer();
259
259
  if (isLocalSearchReady(project)) {
@@ -275,7 +275,7 @@ export async function recall(params) {
275
275
  cache_age_ms = supabaseResult.cache_age_ms;
276
276
  }
277
277
  const searchLatencyMs = searchTimer.stop();
278
- // OD-547: Assign variants for A/B testing (dev tier only)
278
+ // Assign variants for A/B testing (dev tier only)
279
279
  // Agent identity is always available, so variants are always assigned
280
280
  const variantTimer = new Timer();
281
281
  const variantResults = new Map();
@@ -296,7 +296,7 @@ export async function recall(params) {
296
296
  for (const { scarId, variantInfo } of results) {
297
297
  variantResults.set(scarId, variantInfo);
298
298
  }
299
- // OD-525: Record enforcement metrics for variants (dev only)
299
+ // Record enforcement metrics for variants (dev only)
300
300
  if (hasMetrics()) {
301
301
  const metricsPromises = results
302
302
  .filter(({ variantInfo }) => variantInfo.has_variants && variantInfo.variant)
@@ -322,7 +322,7 @@ export async function recall(params) {
322
322
  }
323
323
  }
324
324
  const variantLatencyMs = variantTimer.stop();
325
- // OD-466: Fetch related knowledge triples for surfaced scars
325
+ // Fetch related knowledge triples for surfaced scars
326
326
  const tripleTimer = new Timer();
327
327
  const scarIds = rawScars.map((s) => s.id);
328
328
  const triplesMap = await supabase.fetchRelatedTriples(scarIds);
@@ -351,19 +351,19 @@ export async function recall(params) {
351
351
  source_issue: scar.source_linear_issue,
352
352
  similarity: scar.similarity || 0,
353
353
  required_verification: scar.required_verification,
354
- variant_info: variantResults.get(scar.id), // OD-525
355
- // OD-508: LLM-cooperative enforcement fields
354
+ variant_info: variantResults.get(scar.id),
355
+ // LLM-cooperative enforcement fields
356
356
  why_this_matters: scar.why_this_matters,
357
357
  action_protocol: scar.action_protocol,
358
358
  self_check_criteria: scar.self_check_criteria,
359
- // OD-466: Knowledge triples
359
+ // Knowledge triples
360
360
  related_triples: triplesMap.get(scar.id),
361
361
  // Behavioral decay
362
362
  decay_multiplier: scar.decay_multiplier,
363
363
  }))
364
- // OD-686: Filter below threshold
364
+ // Filter below threshold
365
365
  .filter((scar) => scar.similarity >= similarityThreshold);
366
- // OD-552: Track surfaced scars for auto-bridge at session close
366
+ // Track surfaced scars for auto-bridge at session close
367
367
  const recallSurfacedAt = new Date().toISOString();
368
368
  const recallSurfacedScars = scars.map((scar) => ({
369
369
  scar_id: scar.id,
@@ -374,7 +374,7 @@ export async function recall(params) {
374
374
  variant_id: variantResults.get(scar.id)?.assignment?.variant_id,
375
375
  }));
376
376
  addSurfacedScars(recallSurfacedScars);
377
- // OD-552: Update per-session dir with accumulated surfaced scars
377
+ // Update per-session dir with accumulated surfaced scars
378
378
  try {
379
379
  const session = getCurrentSession();
380
380
  if (session) {
@@ -393,7 +393,7 @@ export async function recall(params) {
393
393
  const latencyMs = timer.stop();
394
394
  const memoriesSurfaced = scars.map((s) => s.id);
395
395
  const similarityScores = scars.map((s) => s.similarity);
396
- // OD-489: Build detailed performance breakdown for test harness
396
+ // Build detailed performance breakdown for test harness
397
397
  const breakdown = {
398
398
  scar_search: buildComponentPerformance(searchLatencyMs, search_mode === "local" ? "local_cache" : "supabase", network_call, network_call ? "miss" : "hit"),
399
399
  };
@@ -436,7 +436,7 @@ export async function recall(params) {
436
436
  cache_hit,
437
437
  cache_age_ms,
438
438
  search_mode,
439
- // OD-489: Detailed instrumentation
439
+ // Detailed instrumentation
440
440
  network_calls_made: perfData.network_calls_made,
441
441
  fully_local: perfData.fully_local,
442
442
  },
@@ -94,8 +94,8 @@ export async function recordScarUsageBatch(params) {
94
94
  scar_id: scarId,
95
95
  issue_id: entry.issue_id || null,
96
96
  issue_identifier: entry.issue_identifier || null,
97
- session_id: entry.session_id || null, // OD-552: Session tracking
98
- agent: entry.agent || null, // OD-552: Agent identity
97
+ session_id: entry.session_id || null, // Session tracking
98
+ agent: entry.agent || null, // Agent identity
99
99
  surfaced_at: entry.surfaced_at,
100
100
  acknowledged_at: entry.acknowledged_at || null,
101
101
  referenced: entry.reference_type !== "none",
@@ -4,7 +4,7 @@
4
4
  * Track scar application for effectiveness measurement.
5
5
  * Records to scar_usage table.
6
6
  *
7
- * Performance target: <1000ms (OD-429)
7
+ * Performance target: <1000ms
8
8
  */
9
9
  import type { RecordScarUsageParams, RecordScarUsageResult } from "../types/index.js";
10
10
  /**
@@ -4,7 +4,7 @@
4
4
  * Track scar application for effectiveness measurement.
5
5
  * Records to scar_usage table.
6
6
  *
7
- * Performance target: <1000ms (OD-429)
7
+ * Performance target: <1000ms
8
8
  */
9
9
  import { v4 as uuidv4 } from "uuid";
10
10
  import { wrapDisplay } from "../services/display-protocol.js";
@@ -24,8 +24,8 @@ export async function recordScarUsage(params) {
24
24
  scar_id: params.scar_id,
25
25
  issue_id: params.issue_id || null,
26
26
  issue_identifier: params.issue_identifier || null,
27
- session_id: params.session_id || null, // OD-552: Session tracking
28
- agent: params.agent || null, // OD-552: Agent identity
27
+ session_id: params.session_id || null, // Session tracking
28
+ agent: params.agent || null, // Agent identity
29
29
  surfaced_at: params.surfaced_at,
30
30
  acknowledged_at: params.acknowledged_at || null,
31
31
  referenced: params.reference_type !== "none",
@@ -1,11 +1,11 @@
1
1
  /**
2
- * resolve_thread Tool (OD-thread-lifecycle, OD-621)
2
+ * resolve_thread Tool
3
3
  *
4
4
  * Mark an open thread as resolved. Supports resolution by:
5
5
  * - thread_id: exact match (preferred)
6
6
  * - text_match: case-insensitive substring match (fallback)
7
7
  *
8
- * OD-621: Updates Supabase (source of truth) + local file (cache).
8
+ * Updates Supabase (source of truth) + local file (cache).
9
9
  * Falls back to local-only if Supabase is unavailable or thread
10
10
  * doesn't exist in Supabase.
11
11
  *
@@ -1,11 +1,11 @@
1
1
  /**
2
- * resolve_thread Tool (OD-thread-lifecycle, OD-621)
2
+ * resolve_thread Tool
3
3
  *
4
4
  * Mark an open thread as resolved. Supports resolution by:
5
5
  * - thread_id: exact match (preferred)
6
6
  * - text_match: case-insensitive substring match (fallback)
7
7
  *
8
- * OD-621: Updates Supabase (source of truth) + local file (cache).
8
+ * Updates Supabase (source of truth) + local file (cache).
9
9
  * Falls back to local-only if Supabase is unavailable or thread
10
10
  * doesn't exist in Supabase.
11
11
  *
@@ -82,7 +82,7 @@ export async function resolveThread(params) {
82
82
  }
83
83
  // Persist to local file (cache)
84
84
  saveThreadsFile(threads);
85
- // OD-621: Update Supabase (source of truth) — graceful fallback on failure
85
+ // Update Supabase (source of truth) — graceful fallback on failure
86
86
  let supabaseSynced = false;
87
87
  const supabaseSuccess = await resolveThreadInSupabase(resolved.id, {
88
88
  resolvedAt: resolved.resolved_at,
@@ -4,7 +4,7 @@
4
4
  * Save full session transcript to Supabase storage for training data,
5
5
  * post-mortems, and pattern mining.
6
6
  *
7
- * Issue: OD-467
7
+ *
8
8
  */
9
9
  import type { Project, PerformanceData } from "../types/index.js";
10
10
  export interface SaveTranscriptParams {
@@ -4,7 +4,7 @@
4
4
  * Save full session transcript to Supabase storage for training data,
5
5
  * post-mortems, and pattern mining.
6
6
  *
7
- * Issue: OD-467
7
+ *
8
8
  */
9
9
  import { detectAgent } from "../services/agent-detection.js";
10
10
  import * as supabase from "../services/supabase-client.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * search Tool (OD-560)
2
+ * search Tool
3
3
  *
4
4
  * Semantic search of institutional memory without action context.
5
5
  * Unlike recall (which is "I'm about to do X, warn me"), search is
@@ -1,5 +1,5 @@
1
1
  /**
2
- * search Tool (OD-560)
2
+ * search Tool
3
3
  *
4
4
  * Semantic search of institutional memory without action context.
5
5
  * Unlike recall (which is "I'm about to do X, warn me"), search is
@@ -4,7 +4,7 @@
4
4
  * Persist session with compliance validation.
5
5
  * Validates that required fields are present based on close type.
6
6
  *
7
- * Performance target: <3000ms (OD-429)
7
+ * Performance target: <3000ms
8
8
  */
9
9
  import type { SessionCloseParams, SessionCloseResult } from "../types/index.js";
10
10
  /**