memory-journal-mcp 6.1.2 → 6.2.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.
Files changed (372) hide show
  1. package/README.md +44 -28
  2. package/dist/{chunk-X4SWFATC.js → chunk-BI4ZNSKA.js} +38 -24
  3. package/dist/{chunk-HCEWINSB.js → chunk-N6EBIDN7.js} +99 -102
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/tools-WPRY5MJ6.js +2 -0
  7. package/package.json +10 -1
  8. package/skills/github-commander/SKILL.md +151 -0
  9. package/skills/github-commander/config/project-config.example.md +125 -0
  10. package/skills/github-commander/workflows/code-quality-audit.md +80 -0
  11. package/skills/github-commander/workflows/full-audit.md +134 -0
  12. package/skills/github-commander/workflows/issue-triage.md +239 -0
  13. package/skills/github-commander/workflows/milestone-sprint.md +81 -0
  14. package/skills/github-commander/workflows/perf-audit.md +142 -0
  15. package/skills/github-commander/workflows/pr-review.md +123 -0
  16. package/skills/github-commander/workflows/security-audit.md +170 -0
  17. package/skills/github-commander/workflows/update-deps.md +109 -0
  18. package/.dockerignore +0 -139
  19. package/.gitattributes +0 -20
  20. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -95
  21. package/.github/ISSUE_TEMPLATE/config.yml +0 -11
  22. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -110
  23. package/.github/ISSUE_TEMPLATE/question.md +0 -78
  24. package/.github/aw/actions-lock.json +0 -14
  25. package/.github/copilot-instructions.md +0 -122
  26. package/.github/dependabot.yml +0 -93
  27. package/.github/pull_request_template.md +0 -135
  28. package/.github/workflows/README.md +0 -133
  29. package/.github/workflows/agentics-maintenance.yml +0 -141
  30. package/.github/workflows/auto-release.yml +0 -68
  31. package/.github/workflows/ci-health-monitor.lock.yml +0 -1121
  32. package/.github/workflows/ci-health-monitor.md +0 -87
  33. package/.github/workflows/codeql.yml +0 -41
  34. package/.github/workflows/dependabot-auto-merge.yml +0 -42
  35. package/.github/workflows/dependency-maintenance.lock.yml +0 -1182
  36. package/.github/workflows/dependency-maintenance.md +0 -147
  37. package/.github/workflows/docker-publish.yml +0 -254
  38. package/.github/workflows/docs-drift-detector.lock.yml +0 -1142
  39. package/.github/workflows/docs-drift-detector.md +0 -115
  40. package/.github/workflows/lint-and-test.yml +0 -60
  41. package/.github/workflows/publish-npm.yml +0 -85
  42. package/.github/workflows/secrets-scanning.yml +0 -32
  43. package/.github/workflows/security-update.yml +0 -127
  44. package/.gitleaks.toml +0 -9
  45. package/.prettierignore +0 -21
  46. package/.prettierrc +0 -33
  47. package/.scout-ignore +0 -12
  48. package/.trivyignore +0 -21
  49. package/CHANGELOG.md +0 -1814
  50. package/CODE_OF_CONDUCT.md +0 -133
  51. package/CONTRIBUTING.md +0 -263
  52. package/DOCKER_README.md +0 -331
  53. package/Dockerfile +0 -128
  54. package/SECURITY.md +0 -227
  55. package/UNRELEASED.md +0 -1
  56. package/dist/tools-T4U5A3X4.js +0 -2
  57. package/docker-compose.yml +0 -71
  58. package/docs/README.md +0 -18
  59. package/docs/agentic-journal-synergy.md +0 -175
  60. package/docs/copilot-setup.md +0 -72
  61. package/eslint.config.js +0 -110
  62. package/mcp-config-example.json +0 -21
  63. package/playwright.config.ts +0 -35
  64. package/releases/v2.1.0.md +0 -220
  65. package/releases/v2.2.0.md +0 -168
  66. package/releases/v3.0.0.md +0 -237
  67. package/releases/v3.1.0.md +0 -104
  68. package/releases/v3.1.1.md +0 -42
  69. package/releases/v3.1.2.md +0 -40
  70. package/releases/v3.1.3.md +0 -64
  71. package/releases/v3.1.4.md +0 -32
  72. package/releases/v3.1.5.md +0 -44
  73. package/releases/v4.0.0.md +0 -71
  74. package/releases/v4.1.0.md +0 -88
  75. package/releases/v4.2.0.md +0 -90
  76. package/releases/v4.3.0.md +0 -92
  77. package/releases/v4.3.1.md +0 -69
  78. package/releases/v4.4.0.md +0 -120
  79. package/releases/v4.4.1.md +0 -33
  80. package/releases/v4.4.2.md +0 -31
  81. package/releases/v4.5.0.md +0 -116
  82. package/releases/v5.0.0.md +0 -105
  83. package/releases/v5.0.1.md +0 -25
  84. package/releases/v5.1.0.md +0 -83
  85. package/releases/v5.1.1.md +0 -10
  86. package/releases/v6.0.0.md +0 -48
  87. package/releases/v6.0.1.md +0 -36
  88. package/releases/v6.1.0.md +0 -68
  89. package/releases/v6.1.1.md +0 -30
  90. package/releases/v6.1.2.md +0 -23
  91. package/scripts/generate-server-instructions.ts +0 -306
  92. package/scripts/server-instructions-function-body.ts +0 -107
  93. package/scripts/server-instructions-gotchas.ts +0 -45
  94. package/server.json +0 -42
  95. package/social-preview.png +0 -0
  96. package/src/auth/auth-context.ts +0 -78
  97. package/src/auth/authorization-server-discovery.ts +0 -263
  98. package/src/auth/errors.ts +0 -215
  99. package/src/auth/index.ts +0 -58
  100. package/src/auth/middleware.ts +0 -392
  101. package/src/auth/oauth-resource-server.ts +0 -170
  102. package/src/auth/scope-map.ts +0 -46
  103. package/src/auth/scopes.ts +0 -256
  104. package/src/auth/token-validator.ts +0 -293
  105. package/src/auth/transport-agnostic.ts +0 -164
  106. package/src/auth/types.ts +0 -372
  107. package/src/cli.ts +0 -279
  108. package/src/codemode/api-constants.ts +0 -263
  109. package/src/codemode/api.ts +0 -302
  110. package/src/codemode/auto-return.ts +0 -65
  111. package/src/codemode/index.ts +0 -47
  112. package/src/codemode/sandbox-factory.ts +0 -144
  113. package/src/codemode/sandbox.ts +0 -220
  114. package/src/codemode/security.ts +0 -155
  115. package/src/codemode/types.ts +0 -228
  116. package/src/codemode/worker-sandbox.ts +0 -277
  117. package/src/codemode/worker-script.ts +0 -239
  118. package/src/constants/icons.ts +0 -183
  119. package/src/constants/server-instructions.md +0 -166
  120. package/src/constants/server-instructions.ts +0 -514
  121. package/src/database/adapter-factory.ts +0 -16
  122. package/src/database/core/entry-columns.ts +0 -10
  123. package/src/database/core/interfaces.ts +0 -188
  124. package/src/database/core/schema.ts +0 -152
  125. package/src/database/sqlite-adapter/backup.ts +0 -167
  126. package/src/database/sqlite-adapter/entries/crud.ts +0 -233
  127. package/src/database/sqlite-adapter/entries/importance.ts +0 -76
  128. package/src/database/sqlite-adapter/entries/index.ts +0 -142
  129. package/src/database/sqlite-adapter/entries/search.ts +0 -294
  130. package/src/database/sqlite-adapter/entries/shared.ts +0 -102
  131. package/src/database/sqlite-adapter/entries/statistics.ts +0 -162
  132. package/src/database/sqlite-adapter/index.ts +0 -265
  133. package/src/database/sqlite-adapter/native-connection.ts +0 -301
  134. package/src/database/sqlite-adapter/relationships.ts +0 -70
  135. package/src/database/sqlite-adapter/tags.ts +0 -182
  136. package/src/filtering/tool-filter.ts +0 -312
  137. package/src/github/github-integration/client.ts +0 -114
  138. package/src/github/github-integration/index.ts +0 -297
  139. package/src/github/github-integration/insights.ts +0 -155
  140. package/src/github/github-integration/issues.ts +0 -213
  141. package/src/github/github-integration/milestones.ts +0 -262
  142. package/src/github/github-integration/projects.ts +0 -414
  143. package/src/github/github-integration/pull-requests.ts +0 -235
  144. package/src/github/github-integration/repository.ts +0 -110
  145. package/src/github/github-integration/types.ts +0 -43
  146. package/src/handlers/prompts/github.ts +0 -210
  147. package/src/handlers/prompts/index.ts +0 -97
  148. package/src/handlers/prompts/workflow.ts +0 -361
  149. package/src/handlers/resources/core/briefing/context-section.ts +0 -182
  150. package/src/handlers/resources/core/briefing/github-section.ts +0 -354
  151. package/src/handlers/resources/core/briefing/index.ts +0 -106
  152. package/src/handlers/resources/core/briefing/user-message.ts +0 -114
  153. package/src/handlers/resources/core/health.ts +0 -75
  154. package/src/handlers/resources/core/index.ts +0 -31
  155. package/src/handlers/resources/core/instructions.ts +0 -45
  156. package/src/handlers/resources/core/utilities.ts +0 -310
  157. package/src/handlers/resources/github.ts +0 -340
  158. package/src/handlers/resources/graph.ts +0 -218
  159. package/src/handlers/resources/help.ts +0 -410
  160. package/src/handlers/resources/index.ts +0 -143
  161. package/src/handlers/resources/shared.ts +0 -219
  162. package/src/handlers/resources/team.ts +0 -134
  163. package/src/handlers/resources/templates.ts +0 -334
  164. package/src/handlers/tools/admin.ts +0 -351
  165. package/src/handlers/tools/analytics.ts +0 -346
  166. package/src/handlers/tools/backup.ts +0 -272
  167. package/src/handlers/tools/codemode.ts +0 -188
  168. package/src/handlers/tools/core.ts +0 -359
  169. package/src/handlers/tools/error-fields-mixin.ts +0 -10
  170. package/src/handlers/tools/export.ts +0 -150
  171. package/src/handlers/tools/github/copilot-tools.ts +0 -72
  172. package/src/handlers/tools/github/helpers.ts +0 -125
  173. package/src/handlers/tools/github/insights-tools.ts +0 -112
  174. package/src/handlers/tools/github/issue-tools.ts +0 -442
  175. package/src/handlers/tools/github/kanban-tools.ts +0 -153
  176. package/src/handlers/tools/github/milestone-tools.ts +0 -371
  177. package/src/handlers/tools/github/mutation-tools.ts +0 -17
  178. package/src/handlers/tools/github/read-tools.ts +0 -302
  179. package/src/handlers/tools/github/schemas.ts +0 -435
  180. package/src/handlers/tools/github.ts +0 -39
  181. package/src/handlers/tools/index.ts +0 -255
  182. package/src/handlers/tools/relationships.ts +0 -390
  183. package/src/handlers/tools/schemas.ts +0 -165
  184. package/src/handlers/tools/search.ts +0 -448
  185. package/src/handlers/tools/team/admin-tools.ts +0 -164
  186. package/src/handlers/tools/team/analytics-tools.ts +0 -233
  187. package/src/handlers/tools/team/backup-tools.ts +0 -83
  188. package/src/handlers/tools/team/core-tools.ts +0 -197
  189. package/src/handlers/tools/team/export-tools.ts +0 -130
  190. package/src/handlers/tools/team/helpers.ts +0 -66
  191. package/src/handlers/tools/team/index.ts +0 -45
  192. package/src/handlers/tools/team/relationship-tools.ts +0 -219
  193. package/src/handlers/tools/team/schemas.ts +0 -558
  194. package/src/handlers/tools/team/search-tools.ts +0 -145
  195. package/src/handlers/tools/team/vector-tools.ts +0 -261
  196. package/src/index.ts +0 -57
  197. package/src/server/mcp-server.ts +0 -446
  198. package/src/server/registration.ts +0 -141
  199. package/src/server/scheduler.ts +0 -283
  200. package/src/transports/http/handlers.ts +0 -78
  201. package/src/transports/http/index.ts +0 -8
  202. package/src/transports/http/security.ts +0 -147
  203. package/src/transports/http/server/index.ts +0 -397
  204. package/src/transports/http/server/legacy-sse.ts +0 -87
  205. package/src/transports/http/server/stateful.ts +0 -222
  206. package/src/transports/http/server/stateless.ts +0 -42
  207. package/src/transports/http/types.ts +0 -132
  208. package/src/types/entities.ts +0 -145
  209. package/src/types/error-types.ts +0 -92
  210. package/src/types/errors.ts +0 -200
  211. package/src/types/filtering.ts +0 -55
  212. package/src/types/github.ts +0 -216
  213. package/src/types/index.ts +0 -348
  214. package/src/utils/error-helpers.ts +0 -78
  215. package/src/utils/errors/error-response-fields.ts +0 -29
  216. package/src/utils/errors/suggestions.ts +0 -94
  217. package/src/utils/github-helpers.ts +0 -33
  218. package/src/utils/logger.ts +0 -107
  219. package/src/utils/mcp-logger.ts +0 -155
  220. package/src/utils/progress-utils.ts +0 -100
  221. package/src/utils/query-helpers.ts +0 -78
  222. package/src/utils/resource-annotations.ts +0 -75
  223. package/src/utils/security-utils.ts +0 -198
  224. package/src/utils/vector-index-helpers.ts +0 -24
  225. package/src/vector/vector-search-manager.ts +0 -409
  226. package/src/version.ts +0 -15
  227. package/test-server/README.md +0 -193
  228. package/test-server/code-map.md +0 -399
  229. package/test-server/test-agent-experience.md +0 -213
  230. package/test-server/test-filter-instructions.mjs +0 -295
  231. package/test-server/test-instruction-levels.mjs +0 -102
  232. package/test-server/test-preflight.md +0 -55
  233. package/test-server/test-prompts.mjs +0 -185
  234. package/test-server/test-scheduler.mjs +0 -174
  235. package/test-server/test-tool-annotations.mjs +0 -115
  236. package/test-server/test-tools-codemode.md +0 -632
  237. package/test-server/test-tools-codemode2.md +0 -1218
  238. package/test-server/test-tools-team.md +0 -215
  239. package/test-server/test-tools.md +0 -429
  240. package/test-server/test-tools2.md +0 -361
  241. package/test-server/test-tools3.md +0 -396
  242. package/test-server/tool-reference.md +0 -231
  243. package/tests/README.md +0 -54
  244. package/tests/auth/auth-context.test.ts +0 -162
  245. package/tests/auth/authorization-server-discovery.test.ts +0 -265
  246. package/tests/auth/errors.test.ts +0 -170
  247. package/tests/auth/middleware.test.ts +0 -585
  248. package/tests/auth/oauth-resource-server.test.ts +0 -173
  249. package/tests/auth/scope-map.test.ts +0 -66
  250. package/tests/auth/scopes.test.ts +0 -347
  251. package/tests/auth/token-validator.test.ts +0 -271
  252. package/tests/codemode/api.test.ts +0 -396
  253. package/tests/codemode/auto-return.test.ts +0 -167
  254. package/tests/codemode/codemode-tool-handlers.test.ts +0 -197
  255. package/tests/codemode/sandbox-factory.test.ts +0 -152
  256. package/tests/codemode/sandbox.test.ts +0 -190
  257. package/tests/codemode/security.test.ts +0 -242
  258. package/tests/codemode/worker-sandbox.test.ts +0 -106
  259. package/tests/constants/icons.test.ts +0 -101
  260. package/tests/constants/server-instructions.test.ts +0 -514
  261. package/tests/database/crud-workflow-branches.test.ts +0 -418
  262. package/tests/database/database-branches.test.ts +0 -132
  263. package/tests/database/entries-auth-branches.test.ts +0 -390
  264. package/tests/database/native-connection.test.ts +0 -249
  265. package/tests/database/shared-helpers.test.ts +0 -103
  266. package/tests/database/sqlite-adapter.bench.ts +0 -63
  267. package/tests/database/sqlite-adapter.test.ts +0 -690
  268. package/tests/database/tags.test.ts +0 -134
  269. package/tests/e2e/README.md +0 -39
  270. package/tests/e2e/auth.spec.ts +0 -106
  271. package/tests/e2e/codemode-abuse.spec.ts +0 -75
  272. package/tests/e2e/health.spec.ts +0 -63
  273. package/tests/e2e/helpers.ts +0 -139
  274. package/tests/e2e/oauth-discovery.spec.ts +0 -102
  275. package/tests/e2e/oauth-scopes.spec.ts +0 -222
  276. package/tests/e2e/payloads-admin.spec.ts +0 -76
  277. package/tests/e2e/payloads-analytics.spec.ts +0 -37
  278. package/tests/e2e/payloads-backup-restore.spec.ts +0 -102
  279. package/tests/e2e/payloads-backup.spec.ts +0 -44
  280. package/tests/e2e/payloads-codemode-api.spec.ts +0 -131
  281. package/tests/e2e/payloads-codemode-readonly.spec.ts +0 -116
  282. package/tests/e2e/payloads-codemode.spec.ts +0 -116
  283. package/tests/e2e/payloads-core.spec.ts +0 -82
  284. package/tests/e2e/payloads-error-contracts.spec.ts +0 -159
  285. package/tests/e2e/payloads-export.spec.ts +0 -46
  286. package/tests/e2e/payloads-github-degradation.spec.ts +0 -73
  287. package/tests/e2e/payloads-github.spec.ts +0 -176
  288. package/tests/e2e/payloads-relationships.spec.ts +0 -56
  289. package/tests/e2e/payloads-search.spec.ts +0 -64
  290. package/tests/e2e/payloads-team-happy.spec.ts +0 -231
  291. package/tests/e2e/payloads-team.spec.ts +0 -174
  292. package/tests/e2e/prompts-expanded.spec.ts +0 -137
  293. package/tests/e2e/prompts.spec.ts +0 -62
  294. package/tests/e2e/protocols.spec.ts +0 -134
  295. package/tests/e2e/rate-limiting.spec.ts +0 -291
  296. package/tests/e2e/resources-briefing-env.spec.ts +0 -106
  297. package/tests/e2e/resources-complete.spec.ts +0 -180
  298. package/tests/e2e/resources-expanded.spec.ts +0 -83
  299. package/tests/e2e/resources-instructions-levels.spec.ts +0 -145
  300. package/tests/e2e/resources-templates.spec.ts +0 -123
  301. package/tests/e2e/resources.spec.ts +0 -103
  302. package/tests/e2e/scheduler.spec.ts +0 -79
  303. package/tests/e2e/security.spec.ts +0 -112
  304. package/tests/e2e/session-advanced.spec.ts +0 -152
  305. package/tests/e2e/sessions.spec.ts +0 -95
  306. package/tests/e2e/stateless.spec.ts +0 -79
  307. package/tests/e2e/streaming.spec.ts +0 -176
  308. package/tests/e2e/tool-filtering-presets.spec.ts +0 -192
  309. package/tests/e2e/tool-filtering.spec.ts +0 -77
  310. package/tests/e2e/tools.spec.ts +0 -111
  311. package/tests/filtering/tool-filter.test.ts +0 -314
  312. package/tests/github/client-issues-errors.test.ts +0 -433
  313. package/tests/github/github-integration-branches.test.ts +0 -490
  314. package/tests/github/github-integration.test.ts +0 -1015
  315. package/tests/github/github-managers-branches.test.ts +0 -907
  316. package/tests/github/pull-requests.test.ts +0 -334
  317. package/tests/handlers/analytics-branches.test.ts +0 -222
  318. package/tests/handlers/backup-branches.test.ts +0 -270
  319. package/tests/handlers/briefing-context-section.test.ts +0 -388
  320. package/tests/handlers/briefing-github-section.test.ts +0 -392
  321. package/tests/handlers/briefing-user-message.test.ts +0 -405
  322. package/tests/handlers/codemode-tools.test.ts +0 -85
  323. package/tests/handlers/copilot-tools.test.ts +0 -126
  324. package/tests/handlers/error-path-coverage.test.ts +0 -324
  325. package/tests/handlers/export-tools.test.ts +0 -203
  326. package/tests/handlers/github-resource-handlers.test.ts +0 -929
  327. package/tests/handlers/github-tool-handlers.test.ts +0 -1452
  328. package/tests/handlers/handler-error-branches.test.ts +0 -346
  329. package/tests/handlers/help-resource.test.ts +0 -92
  330. package/tests/handlers/prompt-handler-coverage.test.ts +0 -108
  331. package/tests/handlers/prompt-handlers.test.ts +0 -131
  332. package/tests/handlers/resource-handler-coverage.test.ts +0 -281
  333. package/tests/handlers/resource-handlers.test.ts +0 -357
  334. package/tests/handlers/resource-prompt-branches.test.ts +0 -495
  335. package/tests/handlers/search-tool-handlers.test.ts +0 -379
  336. package/tests/handlers/targeted-gap-closure.test.ts +0 -387
  337. package/tests/handlers/team-admin.test.ts +0 -291
  338. package/tests/handlers/team-analytics.test.ts +0 -220
  339. package/tests/handlers/team-core.test.ts +0 -148
  340. package/tests/handlers/team-data.test.ts +0 -198
  341. package/tests/handlers/team-relationships.test.ts +0 -271
  342. package/tests/handlers/team-resource-handlers.test.ts +0 -161
  343. package/tests/handlers/team-search.test.ts +0 -134
  344. package/tests/handlers/team-tool-handlers.test.ts +0 -301
  345. package/tests/handlers/team-vector.test.ts +0 -213
  346. package/tests/handlers/template-github-branches.test.ts +0 -676
  347. package/tests/handlers/tool-annotations.test.ts +0 -90
  348. package/tests/handlers/tool-handler-coverage.test.ts +0 -514
  349. package/tests/handlers/tool-handlers.test.ts +0 -510
  350. package/tests/handlers/tool-output-schemas.test.ts +0 -116
  351. package/tests/handlers/vector-tool-handlers.test.ts +0 -238
  352. package/tests/security/sql-injection.test.ts +0 -284
  353. package/tests/server/mcp-server.bench.ts +0 -55
  354. package/tests/server/mcp-server.test.ts +0 -1326
  355. package/tests/server/scheduler.test.ts +0 -400
  356. package/tests/transports/http-legacy-sse.test.ts +0 -275
  357. package/tests/transports/http-security.test.ts +0 -322
  358. package/tests/transports/http-stateful.test.ts +0 -487
  359. package/tests/transports/http-transport-server.test.ts +0 -301
  360. package/tests/transports/http-transport.test.ts +0 -771
  361. package/tests/utils/github-helpers.test.ts +0 -58
  362. package/tests/utils/logger.test.ts +0 -180
  363. package/tests/utils/mcp-logger.test.ts +0 -211
  364. package/tests/utils/progress-utils.test.ts +0 -156
  365. package/tests/utils/query-helpers.test.ts +0 -80
  366. package/tests/utils/security-utils.test.ts +0 -82
  367. package/tests/vector/vector-search-branches.test.ts +0 -111
  368. package/tests/vector/vector-search-manager.test.ts +0 -375
  369. package/tests/vector/vector-search.bench.ts +0 -48
  370. package/tsconfig.json +0 -42
  371. package/tsup.config.ts +0 -19
  372. package/vitest.config.ts +0 -25
package/CHANGELOG.md DELETED
@@ -1,1814 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to Memory Journal MCP will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased](https://github.com/neverinfamous/memory-journal-mcp/compare/v6.1.2...HEAD)
9
-
10
- ## [6.1.2](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v6.1.2) - 2026-03-22
11
-
12
- ### Security
13
-
14
- - **Docker Workflow** — Removed `ref: ${{ github.event.workflow_run.head_sha }}` from `docker-publish.yml` checkout steps; CodeQL does not accept `persist-credentials: false` as mitigation for untrusted-checkout alerts (#145, #146, #161).
15
-
16
- ### Fixed
17
-
18
- - **Unused Import** — Removed orphaned `jose` import from `entries-auth-branches.test.ts` (#162), cascading from v6.1.1 `err` variable removal.
19
-
20
- ## [6.1.1](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v6.1.1) - 2026-03-22
21
-
22
- ### Security
23
-
24
- - **Docker Workflow Hardening** — Removed explicit `ref: ${{ github.event.workflow_run.head_sha }}` from `docker-publish.yml` checkout steps to resolve CodeQL "untrusted checkout in trusted context" alerts (#145, #146, #147). The workflow only triggers on completed `Lint and Test` runs on main, so the default checkout is safe.
25
-
26
- ### Fixed
27
-
28
- - **Useless Assignment** — Removed dead initial assignment `= 'unknown'` on `status` variable in `github-section.ts` (#148).
29
- - **Unused Variables** — Removed 12 unused variables, imports, and constants across test files flagged by CodeQL (#149–#160).
30
-
31
- ## [6.1.0](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v6.1.0) - 2026-03-22
32
-
33
- ### Added
34
-
35
- - **Team Tools Parity** — 12 new team tools bringing the team group from 3 to 15 tools: `team_get_entry_by_id`, `team_list_tags`, `team_search_by_date_range`, `team_update_entry`, `team_delete_entry`, `team_merge_tags`, `team_get_statistics`, `team_link_entries`, `team_visualize_relationships`, `team_export_entries`, `team_backup`, `team_list_backups`. Split `team.ts` into `team/` directory with 8 sub-modules.
36
- - **Team Vector & Insights** — 5 new team tools bringing the team group from 15 to 20 tools: `team_semantic_search`, `team_get_vector_index_stats`, `team_rebuild_vector_index`, `team_add_to_vector_index`, `team_get_cross_project_insights`. Added `teamVectorManager` infrastructure for isolated team vector indexing.
37
- - **`memory://rules` resource** — New resource that serves the full contents of `RULES_FILE_PATH` as `text/markdown`. Returns `{ configured: false }` when env var is not set.
38
- - **`memory://workflows` resource** — New resource that serves the `MEMORY_JOURNAL_WORKFLOW_SUMMARY` env var value via `BriefingConfig.workflowSummary`. Can also be set via `--workflow-summary` CLI flag. Returns `{ configured: false }` when not set.
39
- - **`memory://skills` resource** — New resource that scans `SKILLS_DIR_PATH` for `SKILL.md` files and returns a structured skill index with names, paths, and excerpts.
40
- - **`memory://skills` caching** — Added a 5-minute in-memory TTL cache to prevent expensive synchronous file I/O scans on every read request when the skills directory is large.
41
- - **Error auto-refinement** — `MemoryJournalMcpError` base class now auto-refines generic codes (e.g., `QUERY_FAILED` → `TABLE_NOT_FOUND`) when the message matches a known pattern from `ERROR_SUGGESTIONS`. New `matchSuggestion()` utility in `src/utils/errors/suggestions.ts`.
42
- - **`structuredContent` on error responses** — Tool error responses now include `structuredContent` with `code`, `category`, `suggestion`, and `recoverable` fields when the tool has an `outputSchema`, matching the success path behavior.
43
- - **Query helpers** — New `coerceNumber()`, `coerceBoolean()`, `coerceLimit()`, `buildLimitClause()` utilities in `src/utils/query-helpers.ts` for type-safe MCP input coercion.
44
- - **Resource annotation presets** — Centralized `HIGH_PRIORITY`, `MEDIUM_PRIORITY`, `LOW_PRIORITY`, `ASSISTANT_FOCUSED` presets in `src/utils/resource-annotations.ts`.
45
- - **Dynamic help resources** — `memory://help` (lists all tool groups with descriptions and tool counts) and `memory://help/{group}` (per-group tool reference with parameters and annotations). Content generated at runtime from live tool definitions — stays in sync automatically.
46
- - **Tool invariant tests** — Added `tool-annotations.test.ts` and `tool-output-schemas.test.ts` verifying all tools have annotations (`readOnlyHint`, `openWorldHint`), `outputSchema`, and `ErrorFieldsMixin` compliance.
47
- - **Test coverage expansion** — Achieved 91.6% global line coverage by adding comprehensive test suites for Code Mode (`mj_execute_code`), team-core, team-search tools, and utility helpers (`query-helpers.ts`).
48
- - **Vitest Code Mode coverage mock** — Fixed 0% test coverage on `mj_execute_code` routing paths resulting from `node:vm` async IIFEs failing to resolve under Vitest by providing an isolated `createSandboxPool` mock mapping for unit test environments.
49
- - **Per-tool OAuth scope enforcement middleware** — `src/transports/http/server/index.ts` now wires an Express middleware after the OAuth token validator that intercepts `POST /mcp` requests with `method: "tools/call"`, reads the tool name from `params.name`, looks up the required scope via `getRequiredScope()`, and returns HTTP 403 `insufficient_scope` when the token lacks it. This activates the scope-map infrastructure (`scope-map.ts`, auth-context) that previously existed but was not connected to the request pipeline.
50
-
51
- ### Changed
52
-
53
- - **Deleted stale `tools.json`** — Listed only 14 of 61 tools with no consumers. Authoritative references are `tool-reference.md` and `memory://help/{group}`.
54
- - **`server.json` author aligned** — Changed author from `Chris LeRoux` to `Adamic.tech` to match `package.json`.
55
- - **`server.json` description aligned** — Replaced stale description with `package.json` description for consistency across npm and MCP registry.
56
- - **README architecture diagram resource count** — Fixed `Resources (27)` → `Resources (28)` in the ASCII stack diagram.
57
- - **Compact JSON for tool responses** — Success-path responses use `JSON.stringify(result)` (no pretty-print) for ~15-20% payload reduction per mcp-builder §3.1. Error responses remain pretty-printed for readability.
58
- - **Server instructions refactor** — Removed ~55% redundant tool parameter tables from `server-instructions.ts` (511→285 lines) and `.md` (371→147 lines). Tool reference now served dynamically via `memory://help/{group}`. Field notes moved to new `memory://help/gotchas` resource. `standard` level now includes help resource pointers. ~33% token savings at `full` instruction level.
59
- - **Filter-aware server instructions** — `generateInstructions()` now conditionally includes instruction sections based on enabled tool groups: Code Mode section (+ namespace table) only when `codemode` is enabled; Copilot Review Patterns only when `github` is enabled; GitHub Integration patterns only when `github` is enabled; `semantic_search` Quick Access row only when `search` is enabled. New `getEnabledGroups(enabledTools)` helper added to `tool-filter.ts`. Codegen pipeline updated to parse 6 sections (`CORE`, `COPILOT`, `CODE_MODE`, `GITHUB`, `HELP_POINTERS`, `SERVER_ACCESS`). Backward-compatible — callers omitting `enabledGroups` derive it from `enabledTools`. 14 new tests added.
60
- - **`essential` and `starter` shortcuts now include `codemode`** — `META_GROUPS.essential` = `['core', 'codemode']`, `META_GROUPS.starter` = `['core', 'search', 'codemode']`. Matches the documented tool counts (~7 and ~11 respectively) and makes shortcut behavior consistent with the README note that all shortcuts include Code Mode by default. `readonly` unchanged (`['core', 'search', 'analytics', 'relationships', 'export']`).
61
- - **mcp-builder skill updates (S1-S5)** — Updated `SKILL.md` with production-tested patterns from memory-journal-mcp: dynamic help resources as preferred Approach A (S1), single-source instructions alternative (S2), `ToolDefinition` vs `ToolRegistration` type distinction with `mapTool()` example (S3), briefing configuration with 12 env vars table (S4), `inferGroupFromName()` workaround for SDK's missing `group` field (S5).
62
- - **`memory://significant` batched importance (P-R1)** — Replaced N+1 `calculateImportance()` per-entry loop with a single SQL query using LEFT JOIN aggregations for relationship and causal counts. Eliminates N serial subqueries.
63
- - **`help.ts` cached `require()` (P-R2)** — Cached the dynamic `require()` module reference in a module-level variable with `??=` so the circular-dep workaround only resolves the module once.
64
- - **Code Mode Readonly Contract Clarified** — Documentation explicitly defines that calling mutation methods under `--tool-filter readonly` safely halts the sandbox and returns a structured `{ success: false, error: "..." }` response rather than a raw exception.
65
- - **Comprehensive Code Quality Audit** — Completed March 2026 zero-regression code quality baseline audit. Validated 100% adherence to architectural standards, typed error boundaries (`MemoryJournalMcpError`), strict schema constraints (`z.object({}).strict()`), and sanitized SQL parameterization. Overall codebase quality certified as **A+**.
66
- - **Code Quality Audit Fixes** — Used `milestoneCompletionPct` helper in milestone tool handlers and extracted `MAX_QUERY_LIMIT` constant/helper in search handlers to DRY up duplication.
67
- - **npm publish gated behind Docker checks** — npm no longer publishes on release creation; instead `docker-publish.yml` calls `publish-npm.yml` via `workflow_call` after Docker Scout passes and images are pushed. Both artifacts ship together or neither ships. Manual `workflow_dispatch` fallback preserved.
68
- - **Dependency Updates** — Updated 27 npm packages; `eslint` → `10.1.0`, `jose` → `6.2.2`, `sqlite-vec` → `0.1.7`, `typescript-eslint` → `8.57.1`. 0 vulnerabilities.
69
- - **`relaxedNumber()` type-safe union** — Changed from `z.any()` to `z.union([z.number(), z.string()])` for MCP SDK inputSchema registration. Accepts both native numbers and string-typed numbers while rejecting non-numeric types at the SDK level. `z.preprocess()` was evaluated but caused 192 ESLint `@typescript-eslint/no-unsafe-*` cascading errors due to unresolvable `ZodEffects` generics.
70
- - **mcp-builder compliance audit** — Complexity tier 4. Audited error handling, input coercion, and tool/resource patterns against mcp-builder standards. Implemented 10 remediation items including dynamic help resources (R3) and resource annotation preset migration (R2).
71
- - **Version SSoT (`src/version.ts`)** — Created centralized `VERSION` constant. Updated 4 consumers (`cli.ts`, `mcp-server.ts`, `http/handlers.ts`, `briefing/index.ts`) to import from SSoT instead of directly reading `package.json`. Added `VERSION` to public barrel export.
72
- - **`ErrorFieldsMixin` relocated** — Canonical SSoT moved from `handlers/tools/error-fields-mixin.ts` to `utils/errors/error-response-fields.ts`. Old path preserved as re-export stub for backward compatibility.
73
- - **`title` plumbed through `ToolRegistration`** — Added `title` field to `ToolRegistration` type, `mapTool()` mapping in `handlers/tools/index.ts`, and `registerTool()` options in `mcp-server.ts`. Previously `title` was defined on every tool definition but dropped during the mapping step.
74
- - **Tool title invariant test** — `tool-annotations.test.ts` now verifies every tool has a non-empty `title` field.
75
-
76
- ### Fixed
77
-
78
- - **`export_entries` JSON response missing `count` field** — The `json` format response returned `{ format, entries }` but omitted `count`, unlike `team_export_entries` which includes `count: entries.length`. Added `count` to both the handler return and `ExportEntriesOutputSchema`.
79
- - **`test-tool-annotations.mjs` always exiting with code 1** — The 15-second safety-timeout was never cancelled when the script successfully processed the `tools/list` response. Captured the timeout handle with `const killTimeout = setTimeout(...)` and added `clearTimeout(killTimeout)` in the success handler before `process.exit(0)`.
80
- - **Code Mode proxy error wording** — Calling a nonexistent method (e.g., `mj.core.nonexistentMethod()`) in default mode no longer says "not available in read-only mode". Now says "not found in group" for groups with methods, or "no methods (read-only mode?)" for fully-stripped groups. Updated `server-instructions.md` accordingly.
81
- - **Test prompt: incorrect env var** — `test-tools2.md` referenced non-existent `WORKFLOWS_DIR_PATH`; corrected to `MEMORY_JOURNAL_WORKFLOW_SUMMARY` (or `--workflow-summary`).
82
- - **Code Mode last-expression auto-return (CM-1)** — Bare expressions like `mj.help()` now correctly surface their return value from `mj_execute_code`. Previously, the async IIFE wrapper `(async () => { code })()` silently returned `undefined` for non-`return` statements. New `transformAutoReturn()` utility prepends `return` to the last expression statement, mimicking Node REPL semantics. Applied to both VM and Worker sandbox paths.
83
- - **Test prompt: missing verification row** — `test-tools-codemode2.md` Phase 27.4 table omitted `newTagExists` check despite the test code computing it.
84
- - **Test prompt: stale counts and missing coverage** — `test-tools.md` instruction token sizes updated from pre-refactor (~1.2K/~1.4K/~6.7K) to post-refactor (~1.5K/~1.7K/~2.7K). `test-tools2.md` resource count 27→28, template count 7→8, and added `memory://help/gotchas` test row.
85
- - **Test prompt: stale expectations in `test-tools.md`** — Updated 5 test rows following exhaustive Phase 0–5 core test run: (1) FTS5 `architecture` single-word search clarified to note BM25 may rank team entry first; (2) FTS5 phrase search note added about literal-quote requirement in query param; (3) `visualize_relationships` response shape corrected from "raw text" to JSON object with `mermaid` string field; (4) Post-seed verification cross-DB assertion relaxed to match real rank ordering; (5) Inverted date range updated from "empty results (no validation)" to VALIDATION_ERROR structured response reflecting new server-side guard.
86
- - **README/DOCKER_README resource categorization** — `memory://help/{group}` moved from Static to Template resources (20 Static + 8 Template = 28 total).
87
- - **`visualize_relationships` missing success field** — The handler returned a `message` but omitted `success: false` when an entry was not found, violating the common structured error format. Added `success: false` to the failure response.
88
- - **`team_list_tags` output validation error** — Handler passed raw `listTags()` result with `usageCount` field directly, but `TagOutputSchema` expects `count`. Added mapping to match the personal `list_tags` handler pattern.
89
- - **FTS5 phrase search (`"error handling"` returns 0 results)** — The porter stemmer indexes `handling` → `handl`, so FTS5 phrase queries requiring exact token sequences never match stemmed content. Added `sanitizeFtsQuery` helper in `search.ts` that detects pure quoted phrases (e.g. `"error handling"`) and rewrites them as AND-joined terms (`error AND handling`), letting the stemmer apply per-word and correctly finding matches.
90
- - **Sandbox readonly `TypeError`** — Calling a mutation method (e.g. `mj.relationships.linkEntries`) in `readonly: true` mode threw `TypeError: mj.relationships.linkEntries is not a function` because the stripped method was `undefined`. Wrapped each group proxy in a `Proxy` with a `get` trap that returns a structured `{ success: false, error: "Operation '...' is not available..." }` for any unknown method.
91
- - **`server-instructions.md` readonly wording** — Corrected the description of `readonly: true` mode: mutation calls now return a structured error object instead of throwing, and the misleading "Write-only groups will be empty" language has been removed.
92
- - **`restore_backup(confirm: false)` leaks raw MCP error** — `confirm: z.literal(true)` in the `inputSchema` caused Zod to reject `false` before the handler's try/catch could run, bypassing `formatHandlerError`. Changed to `z.boolean()` with an explicit handler-level guard returning a structured `VALIDATION_ERROR`.
93
- - **`search_entries` filter regressions (BUG-S1/S2)** — `pr_status` and `workflow_run_id` filters were missing in `DatabaseAdapter.searchEntries` WHERE clauses and the tool handler's `hasFilters` check, causing them to be ignored or improperly shortcut to `getRecentEntries`. Propagated the type and SQL generation across all 5 adapter layers.
94
- - **`link_entries` self-loop & validation shapes (BUG-R1/R2)** — The tool no longer allows an entry to link to itself. Non-existent entry errors also now return a structured `{ code: 'NOT_FOUND' }` object instead of a `{ message: '...' }` object matching the project's standardized error formats.
95
- - **Sandbox readonly mode behavior (BUG-C2/C3)** — Writing functions (e.g. `mj.core.create()`) in a `readonly: true` evaluation now correctly throw a captured Error (via `Promise.reject()`) failing the block immediately instead of silently succeeding with `undefined`. Corrected documentation in `server-instructions.md` indicating that `readonly` methods throw on access. Added missing return shape docs for `mj.core.recent()`.
96
- - **`team_get_cross_project_insights` scaling trap** — Added a `limit` parameter to the schema (default 100, max 500) and mapped it to the SQL `LIMIT` clauses for active/inactive project aggregations. This bounds the queries, explicitly enforcing the project's internal `MAX_QUERY_LIMIT` architecture, and strictly guarantees the subsequent tag index lookup (`IN (?,?,...)`) can never exceed SQLite's 999 maximum variable bindings, preventing O(n²) memory and parsing overhead during heavy team database load.
97
- - **Ad-hoc error responses standardized** — 8 handler error responses across `core.ts`, `admin.ts`, and `search.ts` that returned bare `{ success: false, error }` now include `code`, `category`, `suggestion`, and `recoverable` fields.
98
- - **Team + GitHub error responses standardized** — 19 `TEAM_DB_NOT_CONFIGURED` responses across all 8 team tool files and 5 GitHub bare errors in `helpers.ts` and `read-tools.ts` now include structured `code`, `category`, `suggestion`, and `recoverable` fields. Added shared `TEAM_DB_ERROR_RESPONSE` constant in `team/helpers.ts`.
99
- - **`formatHandlerError` enriched** — Raw `Error` instances now get matched against `ERROR_SUGGESTIONS` for actionable suggestions and refined error codes instead of always returning bare `INTERNAL_ERROR`.
100
- - **Timer `.unref()` parity** — Added `.unref()` to the session sweep timer (`stateful.ts`) and scheduler job timers (`scheduler.ts`) so they don't prevent clean process exit. The `rateLimitCleanupTimer` already had `.unref()` — this brings all `setInterval` timers into compliance with mcp-builder §2.2.1.
101
- - **`team_link_entries` default `relationship_type`** — Changed relaxed schema default from `'related_to'` (not a valid enum value) to `'references'`, matching the strict schema.
102
- - **`get_github_milestone` structured error fields** — Added missing `code`, `category`, `suggestion`, and `recoverable` fields to the not-found error response. Same fix applied to `create_github_milestone`, `update_github_milestone`, and `delete_github_milestone` failure responses.
103
- - **Vector search lazy init error handling** — Wrapped lazy `initialize()` calls in `addEntry()`, `search()`, and `rebuildIndex()` with try/catch so `better-sqlite3` connection errors return structured responses instead of crashing.
104
- - **`MoveKanbanItemOutputSchema` missing `availableStatuses`** — The `move_kanban_item` handler returns `availableStatuses: string[]` in the status-not-found error path, but this field was missing from the output schema. Could cause `-32602` under strict `structuredContent` validation.
105
- - **Kanban + admin error enrichment** — 5 error responses in `delete_entry`, `merge_tags` (same-tag and domain error), `get_kanban_board` (not-found), and `move_kanban_item` (project/status not-found) now include `code`, `category`, `suggestion`, and `recoverable` fields, matching the `formatHandlerError()` pattern.
106
- - **Team tool error responses enriched** — 10 bare `{success: false, error}` responses across `team/core-tools.ts`, `team/admin-tools.ts`, `team/relationship-tools.ts`, and `team/vector-tools.ts` now include `code`, `category`, `suggestion`, and `recoverable` fields (RESOURCE_NOT_FOUND, VALIDATION_ERROR, or CONFIGURATION_ERROR as appropriate).
107
- - **Reverse-direction relationship duplicate detection removed** — `link_entries` previously treated B→A as a duplicate of A→B (same `relationshipType`), preventing agents from modeling bidirectional relationships. Detection now checks only the exact direction (A→B); reverse links are independent records. `team_link_entries` applies the same directional-only check.
108
- - **Inverted date range validation** — `search_by_date_range` and `team_search_by_date_range` now return a structured `VALIDATION_ERROR` when `start_date > end_date` instead of silently returning empty results.
109
- - **`team_visualize_relationships` tag lookup date bypass** — Modified the fallback tag lookup in `team_visualize_relationships` to use an all-time date range (`1970-01-01` to `2999-12-31`) when fetching entries by tag, ensuring older relationship records are correctly surfaced regardless of the surrounding temporal context.
110
- - **`team_export_entries` `tags` filter ignored without date range** — When no `start_date`/`end_date` was provided, the handler called `getRecentEntries(limit)` and only post-filtered by `entry_type`, silently ignoring any `tags` parameter. Added a client-side tag filter in the no-date-range branch, consistent with how `entry_type` is already filtered. The `tags` filter path in `searchByDateRange` is already correct and unaffected.
111
- - **Test doc: `testedCount` expected value corrected** — `test-tools-codemode2.md` Phase 27.10 table and success criteria listed `19` expected cross-tool error paths, but the test code only generates 18 unique error keys. Corrected to `18` in both locations.
112
- - **`team_link_entries` duplicate field standardized** — `team_link_entries` returned `alreadyExists: true` for duplicate relationships while `link_entries` (personal journal) returned `duplicate: true`. Both now return `duplicate: true`. Updated `TeamLinkEntriesOutputSchema` accordingly.
113
- - **Test doc: `entry_type` casing** — Phase 22.2 of `test-tools-codemode2.md` used `e.entry_type` (snake_case) to map `getRecentEntries` results; the API returns `entryType` (camelCase). Corrected to `e.entryType`.
114
- - **FTS5 ghost entry cleanup on startup** — `migrateSchema()` now detects when the FTS5 index has more rows than active journal entries (indicating ghost entries from hard deletes before the `fts_content_ad` trigger was added) and triggers `INSERT INTO fts_content(fts_content) VALUES('rebuild')` to remove stale tokens. Prevents `searchEntries` from returning IDs that no longer exist.
115
- - **SQLite database path collision in tests** — Addressed test isolation issues that caused intermittent test failures in team tool tests by implementing `beforeAll` cleanup hooks to delete SQLite cache files before each test suite.
116
- - **`help.ts` dynamic import type safety** — Fixed ESLint/TypeScript errors associated with the dynamic schema import cache by using precise `typeof import()` structures without unsafe `any` or `Record<string, unknown>` fallback type casting.
117
- - **`team_export_entries` filter-then-limit ordering** — When `entry_type` or `tags` filters were used without `start_date`/`end_date`, the handler fetched only `limit` entries via `getRecentEntries(limit)` then post-filtered, silently returning fewer results than expected. Now uses `searchByDateRange` with sentinel dates and a larger fetch batch (500) when filters are active, matching the individual `export_entries` fix pattern.
118
- - **Worker sandbox group Proxy thenable trap** — The Proxy `get` trap on group namespaces (`mj.core`, `mj.search`, etc.) returned a rejection function for any unknown property, including `then`. If user code returned a group namespace (e.g. `return mj.core`), JavaScript's Promise resolution would check `.then`, treat the Proxy as a thenable, and immediately reject with a misleading "not found in group" error. Now returns `undefined` for `then` and Symbol properties so group namespaces are never thenable.
119
- - **`link_entries` error code inconsistency** — The FK-constraint error response in `relationships.ts` used `code: 'NOT_FOUND'` / `category: 'not_found'` while every other handler uses `code: 'RESOURCE_NOT_FOUND'` / `category: 'resource'`. Aligned with project standard and added `suggestion` and `recoverable` fields.
120
-
121
- ### Security
122
-
123
- - **Log injection prevention** — Added `sanitizeLogValue()` to `logger.ts` that strips `\r\n`, `\r`, and `\n` from log messages, module names, operation names, and serialized context before writing to stderr. Prevents log forging via user-controlled inputs (CodeQL `js/log-injection`).
124
- - **CI/CD Hardening**: Added `--provenance` flag to `npm publish` in `publish-npm.yml` for SLSA Build L3 attestation. Added `id-token: write` permission for OIDC provenance token generation.
125
- - **CI/CD Harmonization**:
126
- - Added `dependabot-auto-merge.yml` (auto-squash patch/minor, manual review for major)
127
- - Added `security-extended,security-and-quality` CodeQL query sets (was using defaults only)
128
- - Added `.gitleaks.toml` and `.trivyignore` configuration files
129
- - **CI Action Bumps** (supply-chain pinning):
130
- - `github/gh-aw` actions (`setup`, `setup-cli`) bumped from `v0.58.1` → `v0.58.3` (SHA-pinned)
131
- - `github/codeql-action` (`init`, `autobuild`, `analyze`, `upload-sarif`) bumped from pre-v4.33.0 SHA → `v4.33.0` (SHA-pinned, all steps in sync)
132
- - `actions/upload-artifact` in `docker-publish.yml` corrected from `v6` → `v7` (SHA-pinned, resolves upload/download mismatch)
133
- - `github/gh-aw/actions/setup-cli` mutable semver tag replaced with pinned SHA (supply-chain hardening)
134
- - **Trivy false-positive dismissals** (`.trivyignore`):
135
- - `CVE-2026-32767` (CRITICAL) — Mislabeled/poisoned CVE: SiYuan Note application-level authorization bypass incorrectly attributed to `libexpat` in Trivy's advisory feed (supply chain data corruption). Not a real libexpat vulnerability.
136
- - `CVE-2026-32777` (MEDIUM) — Legitimate libexpat DoS (infinite loop in DTD parsing), but no attack surface: project is TypeScript/Node.js, no XML/DTD parsing. `libexpat` is a transitive Alpine system dependency only.
137
- - `CVE-2026-32778` (MEDIUM) — Legitimate libexpat DoS (NULL pointer dereference after OOM), same no-attack-surface rationale.
138
- - **`flatted` 3.4.2** — Prototype Pollution via `parse()` (transitive devDependency via `eslint` → `flat-cache`). Already resolved in local `package-lock.json`; zero production exposure (`npm ci --omit=dev` in Dockerfile).
139
-
140
- ### Tests
141
-
142
- - **E2E coverage expansion (+46 tests, 5 new spec files)** — Closed coverage gaps across 5 areas:
143
- - `resources-templates.spec.ts` — All 8 template resources (`memory://help/{group}` x5, GitHub-backed templates x7) fetched via HTTP client for the first time; verifies no raw MCP protocol exceptions.
144
- - `payloads-codemode-api.spec.ts` — `mj.*` API bridge depth: `mj.search.searchEntries()`, `mj.analytics.getStatistics()`, multi-step create-then-search workflow, `await mj.help()` group discovery.
145
- - `payloads-error-contracts.spec.ts` — Structured error field contracts: `VALIDATION_ERROR` on inverted date range (all 6 fields), minimum `code`+`category` on self-loop link, `{ duplicate: true }` naming verified (not `alreadyExists`).
146
- - `tool-filtering-presets.spec.ts` — Three filter presets: `essential` (core+codemode, excludes github/team), `codemode`-only (exactly 1 callable tool), `-github` subtractive (45 tools, no github group).
147
- - `resources-instructions-levels.spec.ts` — `memory://instructions` tool-filter group gating: `core`-only filter strips Code Mode and GitHub Integration sections; `-github` filter strips GitHub Integration while retaining Code Mode and semantic_search Quick Access row.
148
- - `oauth-scopes.spec.ts` — 3 tests verifying per-tool HTTP-level scope gating: `read` tokens blocked from `write`-group tools, `write` tokens blocked from `admin`-group tools, `admin` tokens permitted full access. Uses raw-fetch session handshake for success paths and bare `tools/call` for 403 interception.
149
- - `codemode-abuse.spec.ts` — Broadened assertion for unresolving-Promise worker exit to match both `timed out` and `Worker exited` messages. Fixed recovery test to `return 1 + 1` (sandbox wraps code in an async IIFE).
150
-
151
- ## [6.0.1](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v6.0.1) - 2026-03-14
152
-
153
- ### Changed
154
-
155
- - **Docker Image Size Optimization** — Reduced amd64 image from ~733 MB to ~250 MB:
156
- - Moved npm global upgrade + CVE patches to builder stage only; removed npm/npx from production image
157
- - Production `npm ci --omit=dev` runs in builder; `node_modules` copied via `COPY --from=builder`
158
- - Stripped `onnxruntime-web` entirely (browser-only runtime, ~90 MB)
159
- - Stripped non-Linux `onnxruntime-node` platform binaries (darwin + win32, ~132 MB)
160
-
161
- - **CI Dependency Updates** — Bumped GitHub Actions dependencies:
162
- - `github/codeql-action` SHA update (#263)
163
- - `actions/download-artifact` 7.0.0 → 8.0.1 (#264)
164
- - `github/gh-aw` 0.57.2 → 0.58.1 (#265)
165
- - `trufflesecurity/trufflehog` 3.93.7 → 3.93.8 (#266)
166
- - `docker/scout-action` 1.18.2 → 1.20.2 (#267)
167
-
168
- ## [6.0.0](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v6.0.0) - 2026-03-14
169
-
170
- ### Fixed
171
-
172
- - **HTTP Transport Close-Before-Reconnect** — MCP SDK `McpServer.connect()` now throws when called while already connected. Added `server.close()` before `server.connect()` for subsequent session initializations in both Streamable HTTP (`stateful.ts`) and Legacy SSE (`legacy-sse.ts`) transports. Tracks connection state via `serverConnected` flag on `StatefulContext`. Sequential sessions work correctly; concurrent multi-session is a known SDK limitation (single transport at a time).
173
-
174
- - **Copilot Review Fixes** — Addressed 5 code review findings from GitHub Copilot:
175
- - `tags.ts`: Fixed `usage_count` increment to use a subquery for accurate batch counting instead of flat `+1`
176
- - `context-section.ts`: Used `TEAM_PREVIEW_LENGTH` instead of `PREVIEW_LENGTH` for team context previews
177
- - `interfaces.ts`: Expanded `groupBy` union in `IDatabaseAdapter.getStatistics` to include `'year'`
178
- - `Dockerfile`: Added `tsup.config.ts` to `COPY` instruction to fix `tsup` build failure
179
- - `server/index.ts`: Replaced inline `import()` type annotation with top-level `import type` to resolve linting error
180
-
181
- - **Documentation Updates**
182
- - `CONTRIBUTING.md`: Corrected schema path to `src/database/core/schema.ts` and updated architecture tree
183
- - `README.md` / `DOCKER_README.md`: Added `MCP_AUTH_TOKEN` and `MCP_ENABLE_HSTS` environment variables to configuration tables
184
- - `docs/code-map.md`: Added `test-tools-codemode2.md` entry to Test Infrastructure table
185
-
186
- ### Added
187
-
188
- - **Test Coverage Improvement (73% → 87%)** — Added 10 new test files with 320+ tests, restoring coverage lost after unreleased changes:
189
- - **Briefing resources**: `briefing-context-section.test.ts`, `briefing-user-message.test.ts`, `briefing-github-section.test.ts` — covers all 4 context builders, the user message formatter, and GitHub section aggregation
190
- - **HTTP transport**: `http-stateful.test.ts`, `http-legacy-sse.test.ts`, `http-security.test.ts` — covers session sweep, POST/GET/DELETE /mcp routes, SSE lifecycle, rate limiting, CORS, and security headers
191
- - **GitHub integration**: `pull-requests.test.ts` — covers all 5 PullRequestsManager methods including Copilot bot detection
192
- - **Tool handlers**: `copilot-tools.test.ts`, `export-tools.test.ts` — covers get_copilot_reviews and export_entries handlers
193
- - **Utilities**: `github-helpers.test.ts` — covers resolveIssueUrl with all branch paths
194
- - Fixed existing test breakages from `hostHeaderValidation` middleware injection (middleware indices, mock response `.json()` method, `TokenValidator` import)
195
-
196
- - **E2E Test Expansion (71 → 105 tests)** — Added 8 new Playwright E2E spec files and refactored shared helpers:
197
- - `streaming.spec.ts` — raw SSE stream validation: GET /mcp with session ID, Last-Event-ID reconnection, Legacy SSE /sse endpoint event format (dedicated server on port 3107)
198
- - `rate-limiting.spec.ts` — 429 trigger, Retry-After header, /health exemption (inline server spawns with MCP_RATE_LIMIT_MAX)
199
- - `session-advanced.spec.ts` — cross-protocol guard, sequential session isolation, non-existent session ID rejection, post-DELETE session rejection
200
- - `prompts.spec.ts` — listPrompts (16+ prompts), getPrompt, parameterized prompt (find-related)
201
- - `resources-expanded.spec.ts` — memory://instructions, memory://significant, memory://graph/recent, memory://tags, unknown URI error handling
202
- - `payloads-codemode.spec.ts` — mj_execute_code basic execution, multi-step workflow, blocked patterns (require/process), timeout enforcement
203
- - `tool-filtering.spec.ts` — --tool-filter starter preset validation: correct subset exposed, core tools included, codemode/github/admin excluded (dedicated server on port 3104)
204
- - `oauth-discovery.spec.ts` — RFC 9728 /.well-known/oauth-protected-resource endpoint with/without OAuth enabled, scope validation, 401 without token (dedicated server on port 3105)
205
- - Refactored `helpers.ts` with shared `startServer()`/`stopServer()` lifecycle management
206
- - Refactored `auth.spec.ts` and `stateless.spec.ts` to use shared helpers, eliminating ~60 lines of duplicated boilerplate
207
-
208
- - **Agentic Workflows (GitHub Copilot)** — 4 new workflow scripts for automated repo maintenance using [GitHub Copilot Coding Agent](https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot): `dependency-maintenance.md` (weekly npm + Docker dep updates, patch version bump, PR creation), `docs-drift-detector.md` (PR-triggered documentation accuracy audit), `ci-health-monitor.md` (weekly CI deprecation and action version check), `agentics-maintenance.yml` (daily expired entity cleanup). Includes `.github/workflows/README.md` with workflow map diagram and editing guidelines.
209
-
210
- - **WASM SQLite Fallback Removed** — Removed the `sql.js` WASM fallback adapter to simplify the architecture, test matrix, and dependency footprint. The server now runs exclusively on the high-performance native `better-sqlite3` driver. `--sqlite-native` and `--sqlite-wasm` flags have been removed.
211
- - **Harmonized Error Types (`error-types.ts`)** — New `ErrorCategory` enum (9 categories: validation, connection, query, permission, config, resource, authentication, authorization, internal), `ErrorResponse` interface, and `ErrorContext` interface. Part of the harmonized error handling standard across db-mcp, postgres-mcp, mysql-mcp, and memory-journal-mcp
212
- - **`MemoryJournalMcpError` Base Class (`errors.ts`)** — Enriched base error class with `category`, `code`, `suggestion`, `recoverable`, `details`, and `cause` properties. Includes `toResponse()` method returning structured `ErrorResponse`. 6 subclasses: `ConnectionError`, `QueryError`, `ValidationError`, `ResourceNotFoundError`, `ConfigurationError`, `PermissionError`
213
- - **`OAuthError` Extends `MemoryJournalMcpError`** — OAuth errors now inherit full error handling infrastructure (category, suggestion, toResponse()). Auto-categorizes as AUTHENTICATION (401) or AUTHORIZATION (403) based on httpStatus. Deprecated standalone `getWWWAuthenticateHeader()` utility; removed from barrel export
214
- - **`SecurityError` Extends `MemoryJournalMcpError`** — Security validation errors (`InvalidDateFormatError`, `PathTraversalError`) now participate in the enriched error hierarchy with VALIDATION category
215
- - **`formatHandlerError()` Function** — Enriched error formatter in `error-helpers.ts` returning full `ErrorResponse` objects with code, category, suggestion, and recoverable fields. Handles `MemoryJournalMcpError`, `ZodError`, and raw errors
216
-
217
- - **Configurable Briefing (`memory://briefing`)** — 5 new env vars / CLI flags to customize the session briefing
218
- - `BRIEFING_ENTRY_COUNT` / `--briefing-entries` — Number of journal entries (default: 3)
219
- - `BRIEFING_INCLUDE_TEAM` / `--briefing-include-team` — Include team DB entries in briefing
220
- - `BRIEFING_ISSUE_COUNT` / `--briefing-issues` — Number of issues to list with titles (0 = count only)
221
- - `BRIEFING_PR_COUNT` / `--briefing-prs` — Number of PRs to list with titles (0 = count only)
222
- - `BRIEFING_PR_STATUS` / `--briefing-pr-status` — Show PR status breakdown (open/merged/closed)
223
- - Issues and PRs row now always displayed in the `userMessage` table when GitHub is available
224
- - `RULES_FILE_PATH` / `--rules-file` — Path to user rules file; shown in briefing with size and last-modified age
225
- - `SKILLS_DIR_PATH` / `--skills-dir` — Path to skills directory; shown in briefing with skill count
226
- - Expanded `## Rule & Skill Suggestions` in server instructions with guidance for adding, updating, and refining rules and skills
227
- - `BRIEFING_WORKFLOW_COUNT` / `--briefing-workflows` — Number of recent workflow runs to list with names and status icons
228
- - `BRIEFING_WORKFLOW_STATUS` / `--briefing-workflow-status` — Show workflow run status breakdown (passing/failing/pending/cancelled)
229
- - CI Status row in briefing enhanced to show named runs (✅ build · ❌ deploy) or aggregated counts
230
- - `get_copilot_reviews` tool — Fetch Copilot's code review findings for any PR (state, file-level comments with paths/lines)
231
- - `BRIEFING_COPILOT_REVIEWS` / `--briefing-copilot` — Aggregate Copilot review state across recent PRs in briefing
232
- - Copilot review patterns in server instructions (learn from reviews, pre-emptive checking, `copilot-finding` tag)
233
-
234
- - **OAuth 2.1 Authentication Module** — Full RFC-compliant OAuth 2.0 authentication and authorization for the HTTP transport
235
- - 10 new files in `src/auth/`: types, errors, scopes, token-validator, oauth-resource-server, authorization-server-discovery, scope-map, auth-context, middleware, barrel
236
- - RFC 9728 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`)
237
- - RFC 8414 Authorization Server Metadata discovery with caching
238
- - JWT validation via `jose` library with JWKS caching and issuer/audience verification
239
- - 10 tool groups mapped to 3 OAuth scopes: `read` (core, search, analytics, relationships, export), `write` (github, team), `admin` (admin, backup, codemode)
240
- - `AsyncLocalStorage`-based per-request auth context threading
241
- - Express middleware for token extraction, validation, and scope enforcement
242
- - Transport-agnostic utilities: `createAuthenticatedContext`, `validateAuth`, `formatOAuthError`
243
- - 5 new CLI flags: `--oauth-enabled`, `--oauth-issuer`, `--oauth-audience`, `--oauth-jwks-uri`, `--oauth-clock-tolerance`
244
- - Environment variable support: `OAUTH_ENABLED`, `OAUTH_ISSUER`, `OAUTH_AUDIENCE`, `OAUTH_JWKS_URI`
245
-
246
- - **Code Mode (`mj_execute_code`)** — Sandboxed JavaScript execution for multi-step workflows with 70-90% token reduction
247
- - 9 new files in `src/codemode/`: types, security manager, VM sandbox, worker-thread sandbox, worker script, sandbox factory, API bridge, API constants, barrel
248
- - `src/handlers/tools/codemode.ts` — Tool handler with security validation, rate limiting, and API bridge construction
249
- - `mj.*` namespaced API exposes all 44 tools across 10 groups (core, search, analytics, relationships, export, admin, github, backup, team, codemode)
250
- - Positional argument support, method aliases, per-group `help()` for discoverability
251
- - Production sandbox: `node:worker_threads` with V8 isolate boundary, `node:vm` secondary isolation, MessagePort RPC bridge
252
- - Resource limits: code length (50KB), execution timeout (30s), memory (128MB), rate limiting (60 executions/min), result size (10MB)
253
- - `--sandbox-mode <mode>` CLI flag: `worker` (production, default) or `vm` (lightweight)
254
- - Tool count: 42 → 44 tools, tool groups: 9 → 10
255
-
256
- ### Changed
257
-
258
- - **MCP Builder Naming Alignment** — Renamed `ErrorResponseFields` → `ErrorFieldsMixin` and `formatHandlerErrorResponse()` → `formatHandlerError()` to match the cross-server naming convention in the mcp-builder skill. Renamed source file `error-response-fields.ts` → `error-fields-mixin.ts`. Zero logic changes.
259
-
260
- - **Server Instructions Session Start** — Replaced numbered-list "Session Start" with bold **REQUIRED** directive to read `memory://briefing` and present `userMessage` to the user. Moved server name discovery plumbing below the action to prevent agents from misinterpreting the section as configuration guidance.
261
-
262
- - **Dependency Updates** — `better-sqlite3` bumped from `12.6.2` → `12.8.0` (skips non-viable `12.7.0`/`12.7.1` intermediates — both were yanked due to Electron v41 V8 ABI breakage and the withdrawn SQLite 3.52.0 release). `12.8.0` ships SQLite **3.51.3** (WAL-reset bug fix), resolves the `HolderV2()` V8 API compat issue, and carries no breaking API changes. Also bumped non-breaking transitive dependencies.
263
-
264
- - **Unified Audit Fixes**
265
- - SHA-pinned `actions/checkout` in `auto-release.yml` to commit SHA, matching all other workflows
266
- - Removed manually-maintained `LABEL version` from `Dockerfile` — Docker tags and OCI metadata already convey version info without drift risk
267
- - Removed dead `matchesCorsOrigin()` function from `security.ts` — unused since `setCorsHeaders()` was rewritten to use CodeQL-safe record-lookup pattern. Removed 6 associated tests and barrel re-export
268
- - Removed unused `crypto` import from `sandbox.ts` (only `worker-sandbox.ts` uses it for `poolId`)
269
- - Wired `enableHSTS` config to CLI via `--enable-hsts` flag and `MCP_ENABLE_HSTS` env var — was previously a dead config path with no way to enable HSTS from CLI or environment
270
-
271
- - **MCP Builder Compliance (D3/D7)**
272
- - Added `openWorldHint: false` to 28 non-GitHub tool annotations across 9 handler files (`core.ts`, `search.ts`, `relationships.ts`, `team.ts`, `backup.ts`, `export.ts`, `analytics.ts`, `admin.ts`, `codemode.ts`) — explicitly declares local-only SQLite operations
273
- - Added configurable instruction level via `--instruction-level` CLI flag and `INSTRUCTION_LEVEL` env var (values: `essential`, `standard`, `full`; default: `standard`) — controls AI briefing depth in MCP `initialize` response
274
-
275
- - **Pass 2 Testing Fixes**
276
- - Improved `link_entries` error message when source or target entry doesn't exist — now returns `"One or both entries not found (from: X, to: Y)"` instead of raw SQLite `"FOREIGN KEY constraint failed"` error
277
- - `add_to_vector_index` now surfaces the actual error message from embedding generation/storage failures instead of a generic `"Failed to generate or store embedding"` string — enables diagnosis of model loading, ONNX runtime, or sqlite-vec issues
278
- - `get_github_issues` and `get_github_prs` `inputSchema` now uses `relaxedNumber()` for `limit` parameter — previously used `z.number()` which caused the MCP SDK to pre-validate and produce raw `-32602` errors instead of structured handler errors when a string was passed
279
- - Code Mode `mj.admin.help()` examples now list all 5 admin tools (`updateEntry`, `deleteEntry`, `mergeTags`, `rebuildVectorIndex`, `addToVectorIndex`) — previously missing `mergeTags` and `addToVectorIndex`
280
- - Server instructions Code Mode section now documents `readonly` mode behavior — write-only groups (e.g., `admin`) are empty when `readonly: true`
281
-
282
- - **Pass 1 Retest Fixes**
283
- - `rebuild_vector_index` now returns `failedEntries` count, `firstError` with the actual embedding error message, and sets `success: false` when every entry fails — previously returned `success: true, entriesIndexed: 0` with no indication of failure
284
- - Added `getRecent` alias for `getRecentEntries` in Code Mode (`mj.core.getRecent()`) — agents commonly try this natural camelCase abbreviation
285
- - `semantic_search` hint is now governed by a quality floor (0.5) — if all returned results score below 0.5, a hint is included indicating results may be noise, even when `entries.length > 0`. Previously, `hint_on_empty` was effectively dead code because the default `similarity_threshold` (0.25) always returned noise matches from the MiniLM model
286
- - `semantic_search` quality gate hint is now always shown regardless of `hint_on_empty` — the `hint_on_empty` flag only controls advisory hints for empty indexes and zero-match queries, not the noise detection warning. Previously, `hint_on_empty=false` suppressed all hints including the quality gate, meaning clients received noisy results with no warning
287
- - `export_entries` `entry_types` filter now scans the full database instead of post-filtering a truncated result set — previously, type-only queries fetched the most recent `limit` entries via `getRecentEntries()` then filtered, silently returning empty results when no matching types existed in the window
288
- - `merge_tags` now wraps the entire operation in an explicit `db.transaction()` and cleans orphaned `entry_tags` rows (referencing permanently-deleted entries) before re-linking — previously failed with `FOREIGN KEY constraint failed` when both source and target tags existed with overlapping entries
289
- - Server instructions now specify a **briefing confirmation format** — short bullet list of key facts (entry counts, GitHub status, milestones, template resources, optional metadata) instead of tables or elaborate formatting
290
- - `test-tools.md` prerequisites no longer instruct agents to read `memory://briefing` separately — detailed briefing testing is deferred to Phase 1.2 to prevent duplicate reads
291
- - `close_github_issue_with_entry` with `move_to_done: true` now uses `addProjectItem` (idempotent) to resolve the item ID directly — bypasses the race condition where a newly-added item was not yet visible on the board during the immediately-following close call
292
-
293
- - **MCP Builder Compliance Audit Fixes**
294
- - Added `error` field to `ErrorFieldsMixin` — centralizes the 6th ErrorResponse field that was previously defined per-schema, preventing future omissions
295
- - Added DNS rebinding protection (`hostHeaderValidation()`) to HTTP transport — applies MCP SDK middleware when no auth is configured as defense-in-depth against CVE-2025-66414
296
- - SHA-pinned all GitHub Actions across 6 workflow files (`lint-and-test.yml`, `codeql.yml`, `publish-npm.yml`, `secrets-scanning.yml`, `security-update.yml`, `docker-publish.yml`) to prevent supply chain injection via force-pushed tags
297
-
298
- - **Performance Audit Fixes (Round 4)**
299
- - Enabled tsup `splitting: true` — shared code between `cli.js` and `index.js` is now extracted into a common chunk, reducing total dist size from 875 KB to 455 KB (~48% reduction, ~420 KB saved)
300
- - Migrated `TagsManager` and `RelationshipsManager` from legacy `exec()` (which translated rows to `{ columns, values }` arrays) to direct `db.prepare()` calls, matching the pattern already used by `EntriesManager`. Eliminates row-format translation overhead and the manual `rowToObject` helper. Uses native `result.lastInsertRowid` instead of `SELECT last_insert_rowid()` query.
301
-
302
- - **Code Quality Audit Fixes (Round 10)**
303
- - Extracted `MAX_CONTENT_LENGTH = 50_000` constant into `schemas.ts`, replacing 4 inline `max(50000)` literals in `core.ts` and `team.ts`
304
- - Extracted `DATE_MIN_SENTINEL` / `DATE_MAX_SENTINEL` constants into `schemas.ts`, replacing 3 inline `'1970-01-01'` / `'2999-12-31'` literals in `export.ts`
305
- - Extracted `CORS_PREFLIGHT_MAX_AGE_SECONDS = 86_400` constant into `types.ts`, replacing inline `'86400'` in `security.ts`
306
- - Extracted `JSONRPC_SERVER_ERROR = -32000` and `JSONRPC_INTERNAL_ERROR = -32603` constants into `types.ts`, replacing 6 inline literals across `stateless.ts`, `stateful.ts`, and `legacy-sse.ts`
307
- - Cached `collectNonCodeModeTools()` result in `codemode.ts` using referential identity check on `ToolContext`, matching the caching pattern in `handlers/tools/index.ts`
308
-
309
- - **Stale sql.js Comment Cleanup** — Updated 8 stale comment references to sql.js across 5 source files (`scheduler.ts`, `schema.ts`, `interfaces.ts`, `native-connection.ts`, `sqlite-adapter/index.ts`) to accurately reflect the better-sqlite3 native-only architecture. Comment-only changes, zero functional impact.
310
-
311
- - **Copilot Instructions Path Fixes** — Updated `.github/copilot-instructions.md` architecture tree to reflect kebab-case renames (`server-instructions.ts`, `sqlite-adapter/`, `tool-filter.ts`, `github-integration/`, `mcp-server.ts`, `scheduler.ts`, `http/`) and moved reference file paths (`test-server/` → `docs/`). Updated descriptions to reflect better-sqlite3 native-only architecture and modularized directory structures.
312
-
313
- - **Code Quality Audit Fixes (Round 9)**
314
- - Consolidated 4 duplicate `resolveOwnerRepo` implementations (in `milestone-tools.ts`, `read-tools.ts`, `copilot-tools.ts`, and inlined in `insights-tools.ts`) into the single shared helper in `helpers.ts` with optional `entityLabel` parameter
315
- - Extracted resource and prompt registration from `mcp-server.ts` (457 lines) into new `server/registration.ts` module, reducing the main server file to ~375 lines
316
-
317
- - **Code Map Audit Fixes** — Corrected handler→tool mapping table: swapped `update_entry`/`delete_entry` from core to admin, and `test_simple`/`list_tags` from admin to core to match actual source files. Fixed GitHub sub-handler tool counts (`issue-tools.ts` 4→2, `kanban-tools.ts` 1→2, removed non-existent `add_project_item`). Added missing `src/index.ts` to directory tree. Fixed backup tool name `create_backup`→`backup_journal`. Moved `confirm-briefing` prompt from `github.ts` to `workflow.ts` listing (workflow: 9→10, github: 7→6). Removed phantom `database/core/index.ts` barrel from directory tree.
318
-
319
- - **README/DOCKER_README Audit Fixes** — Fixed tool filter `full` count (43→44) to match `tool-reference.md` source of truth. Fixed coverage badge URL encoding (`%78`→`%25`) and updated stale badge values (coverage 74%, tests 910). Updated stack diagram tool count (43→44). Corrected MCP annotations date reference (2025-11-25→2025-03-26) in README Security section.
320
-
321
- - **README/DOCKER_README Session Initialization Rule** — Added a `## Rule` section with explicit instructions for AI agents to read `memory://briefing` before processing user requests. This supplements the MCP `instructions` field (which not all clients surface) by providing a README-level directive that clients like Claude Desktop and Cursor parse directly, making briefing initialization 100% reliable across all MCP clients.
322
-
323
- - **README/DOCKER_README Cross-Agent Memory** — Added **Cross-Agent Memory** feature row to both README and DOCKER_README feature tables, highlighting the IDE ↔ Copilot bridge via journal entries. Added Copilot Setup Guide link to Documentation & Resources sections.
324
-
325
- - **Wiki: Copilot Integration Page** — Created dedicated `Copilot-Integration.md` wiki page documenting the cross-agent memory bridge between IDE agents and GitHub Copilot (three usage patterns, setup for both directions, recommended workflow, security notes). Added to `_Sidebar.md` and `Home.md` navigation. Fixed stale tool counts (43→44) in `Home.md`.
326
-
327
- - **README/DOCKER_README "What Sets Us Apart" Table** — Converted the 14-bullet "Key Benefits" list into a 17-row feature table matching db-mcp's "What Sets Us Apart" format. Added rows for Configurable Briefing, OAuth 2.1 + Access Control, HTTP Streaming Transport, Production-Ready Security, Strict TypeScript, and MCP 2025-03-26 compliance. Removed all WASM/Dual-Backend/sql.js references (variant rows, stack diagram, Technical Highlights, security bullets) to reflect the native-only `better-sqlite3` architecture. Applied same changes to `DOCKER_README.md`.
328
-
329
- - **Performance Audit Fixes (Round 3)**
330
- - Pre-compiled `IS_MUTATION_RE` regex as module-level constant in `native-connection.ts` — eliminates repeated regex compilation on every `exec()` call
331
- - Replaced `new Date()` object allocation in `mergeAndDedup` sort comparator with `localeCompare()` in `search.ts` — ISO 8601 timestamps sort lexicographically without parsing
332
- - Moved `fetchCopilotReviews` into main `Promise.all` block in `github-section.ts` — runs in parallel with 4 other GitHub API calls instead of sequentially after them
333
-
334
- - **FTS5 Full-Text Search** — Replaced `LIKE '%query%'` substring matching in `search_entries` with SQLite FTS5 full-text search. Adds BM25 relevance ranking, phrase queries (`"exact match"`), prefix matching (`auth*`), and boolean operators (`error NOT warning`). Uses `content=memory_journal` content-sync mode (no duplicate storage), Porter stemmer with unicode61 tokenizer, and three auto-sync triggers (INSERT/UPDATE/DELETE). Gracefully falls back to LIKE on FTS5 syntax errors (e.g. SQL injection payloads, special characters). Existing databases auto-populate the FTS5 index on first migration via `rebuild` command. Updated `search_entries` tool description and server instructions with FTS5 query syntax documentation.
335
-
336
- - **Generator Script Fix** — Fixed `scripts/generate-server-instructions.ts` to output kebab-case `server-instructions.ts` (was PascalCase `ServerInstructions.ts`, a dead file with wrong import path). Fixed import from `ToolFilter.js` → `tool-filter.js`. Removed stale `_resources: ResourceDefinition[]` parameter from `server-instructions-function-body.ts` to match actual callers. Deleted orphaned `ServerInstructions.ts`.
337
-
338
- - **Test Artifact Consolidation** — Consolidated scattered test output directories (`coverage/`, `test-results/`, `test-server/*.db*`, `test-server/backups/`, `backups/`) into a single `.test-output/` directory with `coverage/` (vitest), `playwright/` (Playwright results), and `e2e/` (E2E databases and scheduler backups). Moved `code-map.md`, `test-tools.md`, and `tool-reference.md` from `test-server/` to `docs/`. Updated `.gitignore` and `.dockerignore` to use single `.test-output/` entry. No source code changes needed — the backup system auto-adapts via `dirname(dbPath)` path derivation.
339
-
340
- - **Vector Search Backend** — Replaced `vectra` with `sqlite-vec` for vector search. Embeddings now stored in the main SQLite database via a `vec0` virtual table (`vec_embeddings`), eliminating the separate `.vectra_index/` directory and 86 transitive dependencies (460→376 packages). KNN search uses SQL `WHERE embedding MATCH ? ORDER BY distance LIMIT ?` queries directly. `removeEntry()` and `getStats()` are now synchronous (better-sqlite3 is synchronous). NativeConnectionManager loads the sqlite-vec extension on init with a race-condition guard for concurrent close during async import.
341
-
342
- - **Build Tooling** — Replaced `tsc` with `tsup` (esbuild) for production builds. Output reduced from 372 files (1.04 MB) to 6 files (875 KB) with tree-shaking. Build speed: ~9s vs 19s. Type checking remains as a separate `npm run typecheck` step (`tsc --noEmit`).
343
- - **ML Embedding Library** — Migrated from `@xenova/transformers` v2 (archived, unmaintained) to `@huggingface/transformers` v3.8.1 (official Hugging Face org, actively maintained). API change: `quantized: true` → `dtype: 'q8'`. Same `Xenova/all-MiniLM-L6-v2` model, same embedding quality. Updated README, SECURITY, and DOCKER_README references.
344
-
345
- - **Performance Audit Fixes (Round 2)**
346
- - Replaced N+1 `getEntryById` calls in `semantic_search` handler with batch `getEntriesByIds()` — single `WHERE id IN(…)` query + `batchGetTagsForEntries` instead of N separate lookups
347
- - Replaced per-item sequential `deleteItem()` loop in `rebuildIndex()` with O(1) directory wipe + recreate — eliminates O(n) serial file I/O during vector index rebuilds
348
- - Parallelized 4 independent GitHub API calls (`fetchCiStatus`, `fetchIssuesAndPrs`, `fetchMilestones`, `fetchInsights`) in briefing resource using `Promise.all()` — reduces cold-load latency from additive to max of the 4 calls
349
-
350
- - **Performance Audit Fixes**
351
- - Replaced `getStatistics('week')` with `getActiveEntryCount()` in `buildJournalContext()` and `buildTeamContext()` — briefing only needs `totalEntries`, not the full stat breakdown (~5× fewer queries per session start)
352
- - Replaced N+1 exist-check loop in `mergeTags()` with bulk pre-fetch + batch `INSERT OR IGNORE` — O(1) vs O(N) queries during tag merge operations
353
-
354
- - **Code Quality Audit Fixes (Round 8)**
355
- - Extracted `milestoneCompletionPct()` helper into `resources/shared.ts`, replacing 4 inline duplicate calculations across `resources/github.ts` (×3) and `briefing/github-section.ts` (×1)
356
- - Added `logger.debug()` to 8 empty `catch {}` blocks in `briefing/context-section.ts` (team context, rules file, skills dir) and `briefing/github-section.ts` (CI status, issues/PRs, milestones, traffic, insights) for improved troubleshooting
357
-
358
- - **Code Quality Audit Fixes (Round 7)**
359
- - Replaced two remaining `inactiveThresholdDays: 7` literals with `INACTIVE_THRESHOLD_DAYS` constant in `analytics.ts`
360
- - Hoisted `DEDUP_KEY_LENGTH` from local function scope to module-level named constant in `search.ts`
361
- - Removed misleading `async` keyword from `DatabaseAdapterFactory.create()` in `adapter-factory.ts` (synchronous constructor wrapped in `Promise.resolve()`)
362
-
363
- - **Code Quality Audit Fixes (Round 6)**
364
- - Eliminated 10 `@typescript-eslint/no-non-null-assertion` lint errors in `resources/github.ts` by threading the narrowed `github` instance through `GitHubRepoResolved` from `resolveGitHubRepo()` — downstream handlers now destructure `github` instead of using `context.github!`
365
- - Extracted `MS_PER_DAY` constant in `prompts/workflow.ts`, replacing 3 inline `86400000` magic values
366
-
367
- - **Code Quality Audit Fixes (Round 5)**
368
- - Extracted `resolveGitHubRepo()` + `isResourceError()` guard helper into `resources/shared.ts`, eliminating ~60 lines of duplicated GitHub availability checks across 4 resource handlers and the briefing section
369
- - Added debug logging to 4 silent `catch {}` blocks in `vector-search-manager.ts` (`removeEntry`, `rebuildIndex` deletion/embedding, `getStats`) for improved troubleshooting
370
- - Extracted 5 inline API limits into named constants (`RESOURCE_ISSUE_LIMIT`, `RESOURCE_PR_LIMIT`, `RESOURCE_WORKFLOW_LIMIT`, `RESOURCE_STATUS_MILESTONE_LIMIT`, `RESOURCE_MILESTONE_LIMIT`) in `resources/github.ts`
371
- - Parallelized 6 serial GitHub API calls in `github/status` resource handler using `Promise.allSettled()` for reduced latency
372
-
373
- - **Code Quality Audit Fixes (Round 4)**
374
- - Added debug logging to 8 silent `catch {}` blocks across `github-section.ts`, `resources/github.ts`, `core.ts`, and `backup.ts` for improved debuggability
375
- - Wrapped `github/milestones` and `milestones/{number}` resource handler returns in `{ data, annotations }` structure for consistency with other GitHub resource handlers
376
- - Parallelized sequential `getCopilotReviewSummary()` API calls in `fetchCopilotReviews()` using `Promise.all()` for faster briefing generation
377
-
378
- - **Code Quality Audit Fixes (Round 3)**
379
- - Extracted duplicated `resolveIssueUrl()` logic from `core.ts` and `team.ts` into shared `utils/github-helpers.ts`
380
- - Replaced magic numbers with named constants: `INACTIVE_THRESHOLD_DAYS`, `MS_PER_DAY`, `MAX_TAGS_PER_PROJECT` in `analytics.ts`; `MERMAID_CONTENT_PREVIEW_LENGTH` in `relationships.ts`; `DEDUP_KEY_LENGTH` in `search.ts`; `LATEST_ENTRY_PREVIEW_LENGTH` in `server-instructions.ts`
381
- - Fixed N+1 tag query in `team_search` with batch `SELECT ... WHERE entry_id IN (...)` query
382
- - Consolidated 4 serial `SELECT COUNT(*)` queries in `getHealthStatus()` into a single subquery
383
- - Moved `scheduler` declaration before `handleResourceRead` closure to eliminate temporal hazard
384
- - Removed unused `_resources` parameter and `ResourceDefinition` type from `generateInstructions()`
385
- - Split `auth/middleware.ts` (519 lines) by extracting transport-agnostic auth functions to `auth/transport-agnostic.ts`
386
-
387
- - **Code Quality Audit Fixes (Round 2)**
388
- - Extracted `ToolRegistration` interface for typed `getTools()` return, eliminating ~10 unsafe `as` casts in `mcp-server.ts` tool registration
389
- - Added typed `pragma(command: string)` method to `IDatabaseAdapter` and `IDatabaseConnection` interfaces, eliminating unsafe `getRawDb() as { pragma/run }` casts in `scheduler.ts` and `backup.ts`
390
- - Typed `getStatistics()` return from `unknown` to `Record<string, unknown>` on `IDatabaseAdapter`
391
- - Added `queryRow()` / `queryRows()` typed query helpers to entries shared module
392
- - Extracted `autoIndexEntry()` helper into `utils/vector-index-helpers.ts`, removing 3-way fire-and-forget vector indexing duplication across `core.ts` and `admin.ts`
393
- - Extracted `handleResourceRead()` helper in `mcp-server.ts`, removing ~30 lines of duplicated resource response formatting between template and static resource registration
394
- - Replaced magic numbers with named constants: `MAX_RELATIONSHIP_SCORE_AT`, `MAX_CAUSAL_SCORE_AT`, `RECENCY_WINDOW_DAYS` in `importance.ts`; `MAX_PERIOD_ROWS` in `statistics.ts`; `MAX_BACKUP_NAME_LENGTH` in `backup.ts`
395
- - Removed no-op `await Promise.resolve()` calls in `scheduler.ts` (`runBackup`, `runVacuumOptimize`)
396
- - Added debug-level logging to previously silent WAL checkpoint error catch block in `backup.ts`
397
-
398
- - **Code Quality Audit Fixes (Round 1)**
399
- - Renamed 7 `PascalCase` files to kebab-case to match workspace standards (`sqlite-adapter.ts`, `tool-filter.ts`, `github-integration.ts`, `mcp-server.ts`, `mcp-logger.ts`, `vector-search-manager.ts`, `server-instructions.ts`, `scheduler.ts`) and updated 27 import references across the codebase
400
- - Converted 13 bare `throw new Error(...)` statements to typed error classes (`ConfigurationError`, `ResourceNotFoundError`, `ConnectionError`, `QueryError`, `ValidationError`) for consistent error handling and standard structured error responses (`vector-search-manager.ts`, `sqlite-adapter.ts`, `handlers/resources/index.ts`, `handlers/prompts/index.ts`, `authorization-server-discovery.ts`, `sandbox-factory.ts`)
401
- - Renamed `src/types/sql.js.d.ts` to `sql-js.d.ts` to ensure strict compliance with kebab-case naming standard
402
- - Eliminated `eslint-disable-next-line` pragmas where possible (e.g. `no-control-regex` solved natively in `security-utils.ts`, `no-explicit-any` removed in `backup.ts`)
403
- - Strictified `z.object({})` Zod schemas by appending `.strict()` for safer payload validation on empty schemas (`admin.ts`, `backup.ts`, `core.ts`, `search.ts`, `read-tools.ts`)
404
- - Consolidated duplicated `resolveAuthor` / `resolveTeamAuthor` logic from `core.ts` and `team.ts` into shared `resolveAuthor()` in `security-utils.ts`
405
- - Removed `as unknown as Record<string, unknown>` type cast in `crud.ts` by adding `timestamp?: string` to `CreateEntryInput` interface
406
- - Removed deprecated `SERVER_INSTRUCTIONS` constant from `server-instructions.ts` (zero consumers)
407
- - Split 603-line `briefing.ts` into `briefing/` directory: `github-section.ts`, `context-section.ts`, `user-message.ts`, `index.ts` (all under 260 lines)
408
- - Replaced N+1 author queries in `team.ts` with single batch `SELECT ... WHERE id IN (...)` via `batchFetchAuthors()` helper
409
- - Replaced N+1 per-project tag queries in `analytics.ts` with single batch query grouped by `project_number`
410
-
411
- - **Performance Optimization (I/O)** — Refactored blocking synchronous file system operations (`fs.writeFileSync`, `fs.readFileSync`, `fs.mkdirSync`, `fs.copyFileSync`, `fs.statSync`) in `BackupManager` to asynchronous `fs.promises` equivalents to prevent freezing the Node.js event pool during journal backups.
412
- - **Performance Optimization (I/O)** — Refactored synchronous `fs.mkdirSync` and `fs.rmSync` in `VectorSearchManager` to asynchronous `fs.promises` equivalents for non-blocking directory operations during index initialization and rebuilding.
413
- - **Performance Optimization (Build)** — Disabled generating `.map` source maps in production build (disabled `sourceMap` in `tsconfig.json`), saving approx 1-2MB in the final compiled bundle.
414
- - **Performance Optimization (Memory)** — Refactored unbounded `SELECT * FROM memory_journal` queries across core handlers (`entries.ts`, `templates.ts`, `github.ts`, `core.ts`, `stats.ts`, `graph.ts`, `workflow.ts`) to use explicit `ENTRY_COLUMNS` projections, reducing I/O latency and WASM memory overhead.
415
- - **Performance Optimization (Bundle)** — `WasmSqliteAdapter` initialization is now strictly loaded via a dynamic `await import` block inside `DatabaseAdapterFactory.create`. This keeps the heavy WASM binaries fully isolated from the top-level bundle payload on native platforms.
416
- - **Performance Optimization (Database)** — Unbounded `SELECT * FROM relationships` wildcard lookups have been restricted to strict `id, from_entry_id, to_entry_id, relationship_type, description, created_at` column mappings.
417
- - **Performance Optimization (Sandbox)** — Capped Code Mode Result serialization using strict buffer tracking logic to prevent `JSON.stringify` from creating maximum V8 strings that blow through native application memory.
418
- - **GitHub API Caching** — Implemented a bounded (max 100 items), TTL-aware LRU cache strategy in `GitHubClient` to prevent memory leaks on long-running instances.
419
- - **Core Handlers Modularized**:
420
- - **SQLite Adapter** — Split monolithic `src/database/sqlite-adapter.ts` (1640 lines) into `src/database/sqlite-adapter/` containing `connection.ts`, `tags.ts`, `entries.ts`, `relationships.ts`, `backup.ts`, and `index.ts`.
421
- - **GitHub Integration** — Split monolithic `src/github/github-integration.ts` (1707 lines) into `src/github/github-integration/` containing focused modules (`auth.ts`, `repos.ts`, `issues.ts`, `pull-requests.ts`, `search.ts`, `copilot.ts`, `index.ts`).
422
- - **Core Resources** — Split monolithic `src/handlers/resources/core.ts` (823 lines) into `src/handlers/resources/core/` containing `briefing.ts`, `instructions.ts`, `stats.ts`, and `index.ts`.
423
- - **Briefing Resource** — Split monolithic `src/handlers/resources/core/briefing.ts` (603 lines) into `src/handlers/resources/core/briefing/` containing focused builders (`github-section.ts`, `context-section.ts`, `user-message.ts`) and `index.ts`.
424
- - **Test Directory Renamed** — Renamed `src/auth/__tests__` to `src/auth/tests` to comply with the project's strict kebab-case naming standard.
425
- - **HTTP Transport Modularized** — Continued splitting `src/transports/http.ts` and `src/transports/http/server.ts` into a fully modularized directory:
426
- - `types.ts` — Configuration interface (`HttpTransportConfig`), constants, rate limiting types
427
- - `security.ts` — Client IP extraction, built-in rate limiting, CORS (exact-match multi-origin), security headers
428
- - `handlers.ts` — Health check, root info, bearer token auth middleware
429
- - `server/` — Split `server.ts` into `stateless.ts`, `stateful.ts`, `legacy-sse.ts`, and `index.ts`
430
- - `index.ts` — Barrel re-export
431
- - **CORS Configuration** — `corsOrigin: string` changed to `corsOrigins: string[]` for multi-origin support. CLI `--cors-origin` accepts comma-separated values. Exact-match origins only (CodeQL-safe record-lookup pattern).
432
- - **HSTS Configuration** — HSTS is now config-driven via `enableHSTS: true` instead of auto-detecting from `X-Forwarded-Proto` header.
433
- - **Cache-Control Header** — Strengthened from `no-store` to `no-store, no-cache, must-revalidate`.
434
-
435
- - **Dependency Updates**
436
- - `@types/node`: 25.3.5 → 25.4.0 (minor)
437
- - `express-rate-limit`: 8.3.0 → 8.3.1 (patch)
438
- - `simple-git`: 3.32.3 → 3.33.0 (minor)
439
- - `typescript-eslint`: 8.56.1 → 8.57.0 (minor)
440
- - `tar` override: 7.5.10 → 7.5.11 (patch) — npm + Docker layers
441
- - `axios` override: 1.13.5 → 1.13.6 (patch)
442
- - `tmp` override: 0.2.4 → 0.2.5 (patch)
443
- - GitHub Actions: `docker/setup-buildx-action` (v3 → v4), `docker/metadata-action` (v5 → v6), `docker/login-action` (v3 → v4), `aquasecurity/trivy-action` (0.34.1 → 0.35.0), `docker/scout-action` (v1.20.1 reverted to v1.18.2 — upstream 403 on asset download)
444
-
445
- ### Fixed
446
-
447
- - **Cross-DB `is_personal` Filter Bypass** — `search_entries`, `search_by_date_range`, and `semantic_search` now correctly honor `is_personal: true` when a team DB is present. Previously, team entries (which are never personal) were included in results even when `is_personal: true` was explicitly specified: `searchEntries` and `searchByDateRange` now skip the team DB entirely when `is_personal: true`, and `semanticSearch` now post-filters results by `isPersonal` when the parameter is set.
448
-
449
- - **Cross-DB Search Limit Bug** — `search_entries` and `search_by_date_range` now use `Math.min(limit * 2, 500)` for per-database queries when a team DB is present, then apply the user's requested limit during the final `mergeAndDedup` step. Previously, the user's limit (default 10) was passed directly to each individual database query, causing FTS5 BM25 ranking in the larger personal DB to silently drop matching entries that ranked below position N, even when the total matching entries across both databases was well under the limit.
450
-
451
- - **Mermaid Graph Resources Return Raw Text** — `memory://graph/recent`, `memory://graph/actions`, and `memory://kanban/{n}/diagram` now return raw Mermaid diagram strings instead of JSON envelopes (`{ format, diagram, ... }`). Output is directly pasteable into [mermaid.live](https://mermaid.live/) without `UnknownDiagramError`. The `text/plain` mimeType now correctly matches the response body.
452
-
453
- - **Vector Index sqlite-vec Compatibility** — Fixed two sqlite-vec `vec0` virtual table incompatibilities that prevented all vector operations (`rebuild_vector_index`, `add_to_vector_index`, `semantic_search`):
454
- 1. Entry IDs must be `BigInt` through `better-sqlite3` bindings — regular JavaScript `number` values are rejected with `"Only integers are allows for primary key values"`. Fixed by coercing with `BigInt()`, matching the [official sqlite-vec Node.js example](https://github.com/asg017/sqlite-vec/blob/main/examples/simple-node/demo.mjs).
455
- 2. `vec0` virtual tables don't support `INSERT OR REPLACE` conflict resolution — upserts fail with `"UNIQUE constraint failed"`. Changed `addEntry()` to DELETE+INSERT pattern.
456
-
457
- - Resolved Zod `4.3.6` dependency resolution conflict with OpenAI SDK via explicit `package.json` overrides.
458
- - Replaced `as unknown` type assertions with strict types where appropriate (`wasm-connection.ts`, `backup.ts`) and auth test mocks with properly mapped `QueryResult` types and `Object.create(Type.prototype)` mock instantiation.
459
- - Resolved native driver (better-sqlite3) `datatype mismatch` and `more than one statement` exceptions by strictly enforcing `IDatabaseConnection`'s `exec` implementation in analytical routes.
460
- - Abstracted `rawDb.exec` within the `relationships` tool group to an integrated adapter `executeRawQuery` to prevent query injection bypasses.
461
- - Secured native snapshot backups by switching from blocked in-memory blob exports to transactional file-system copies with `wal_checkpoint(TRUNCATE)`.
462
- - Fixed empty-array query result assertions across analytics, team, prompts, and resource handlers caused by SQLite native driver mismatching original `sql.js` row-wrapping (`rawDb.exec()`) structures natively by safely standardizing `executeRawQuery` mapping.
463
- - **Code Mode `timeout` Parameter Ignored** — The `timeout` parameter on `mj_execute_code` was parsed by the Zod schema but never forwarded to the sandbox pool. All executions used the default 30s timeout regardless of the user-specified value. Added per-call `timeoutMs` override to `ISandbox`, `ISandboxPool`, and all sandbox/pool implementations (`WorkerSandbox`, `WorkerSandboxPool`, `CodeModeSandbox`, `SandboxPool`). Handler now destructures `timeout` and passes it to `pool.execute()`.
464
-
465
- ### Security
466
-
467
- - **Dependency Updates** — Bumped `undici` to 7.24.1 to address multiple CVEs (CVE-2026-1525, CVE-2026-1528, CVE-2026-2581, CVE-2026-1527, CVE-2026-2229, CVE-2026-1526) causing request smuggling, DoS, and memory exhaustion risks.
468
- - **Built-in Rate Limiting** — Replaced `express-rate-limit` dependency with zero-dependency implementation. Health endpoint bypass, `Retry-After` header on 429, periodic cleanup with `.unref()`.
469
- - **Server Timeouts** — Added HTTP request (120s), keep-alive (65s), and headers (66s) timeouts to mitigate DoS attacks.
470
- - **CORS Enhancements** — `Access-Control-Max-Age: 86400`, `Vary: Origin` for specific origin matching, `corsAllowCredentials` option.
471
- - **Trust Proxy** — `trustProxy` config option for correct `X-Forwarded-For` client IP extraction behind reverse proxies.
472
- - **Max Body Size** — Configurable `maxBodySize` (default: 1MB) to prevent large request body attacks.
473
-
474
- ### Removed
475
-
476
- - **`express-rate-limit` Dependency** — Replaced by built-in rate limiter.
477
-
478
- ## [5.1.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v5.0.1...v5.1.0) - 2026-03-07
479
-
480
- ### Added
481
-
482
- - **`session-summary` Prompt** — New workflow prompt that creates a session summary journal entry. Fetches recent entries for context and guides the agent to create a `retrospective` entry tagged `session-summary` capturing accomplishments, pending items, and next-session context. Invoked by the user when ready (e.g., `/session-summary`). Replaces the unreliable automatic session-end behavior. Prompt count: 15 → 16.
483
-
484
- ### Performance
485
-
486
- - **`calculateImportance` Query Consolidation** — Merged 3 separate SQL queries (entry data, relationship count, causal count) into a single query with subqueries, reducing SQLite roundtrips 3→1.
487
- - **`linkTagsToEntry` Batch Operations** — Replaced per-tag `INSERT OR IGNORE` + `UPDATE` loop (2N SQL calls) with batched multi-row `INSERT`, `SELECT ... IN (...)`, and `UPDATE ... IN (...)` (4 SQL calls total for any N tags).
488
- - **`createEntry` Redundant Fetch Elimination** — Removed post-INSERT `getEntryById()` re-fetch (full SELECT + tag query). Entry is now constructed directly from input values + `last_insert_rowid()` + `datetime(CURRENT_TIMESTAMP)`.
489
- - **`updateEntry` Pre-check Elimination** — Removed pre-UPDATE `getEntryById()` existence check. Uses `UPDATE ... WHERE deleted_at IS NULL` + `SELECT changes()` to detect missing entries in one SQL call instead of a full SELECT + tag query.
490
- - **SQLite Performance PRAGMAs** — Added `PRAGMA journal_mode = MEMORY`, `synchronous = OFF`, and `temp_store = MEMORY` at initialization. sql.js operates in-memory with manual disk serialization; these eliminate unnecessary internal journal overhead.
491
- - **Composite Covering Index for `getRecentEntries`** — Added `idx_memory_journal_recent` on `(deleted_at, timestamp DESC, id DESC)` to enable index-only scan for the `WHERE deleted_at IS NULL ORDER BY timestamp DESC, id DESC` query pattern.
492
- - **`addEntry` Native Upsert** — Replaced `deleteItem()` + `insertItem()` pattern with vectra's native `upsertItem()`, eliminating a full exception path on every new entry insertion.
493
- - **`getTools` Cached Output** — Extracted shared `ensureToolCache()` for both `getTools` and `callTool`. Unfiltered `getTools` calls now return a cached mapped array instead of rebuilding 42 tool objects and mapping them on every invocation (~4800x faster than tool execution).
494
- - **Lazy Module Loading for Startup** — Deferred `@xenova/transformers` (1.5s) and `vectra` (0.9s) from top-level imports in `VectorSearchManager.ts` to dynamic `import()` inside `initialize()`. These heavyweight modules are now loaded only when vector search is first used, reducing server cold-start by ~1.8s (VectorSearchManager import: 1515ms → 12ms).
495
-
496
- ### Documentation
497
-
498
- - **Test Counts Updated** — Updated the `README.md` and `DOCKER_README.md` test count badges and the testing breakdown table to reflect the combined total of Vitest unit/integration tests and Playwright E2E tests (785 total tests).
499
- - **Performance Benchmark Claims Updated** — Updated benchmark numbers in `README.md` and `DOCKER_README.md` to reflect post-optimization measurements: vector ops >640 ops/sec, `getTools` ~4800x faster than tool execution, `getRecentEntries` ~4x faster via composite index.
500
-
501
- ### Removed
502
-
503
- - **Automatic Session End Behavior** — Removed `## Session End` section from server instructions (`ServerInstructions.ts`, `server-instructions.md`). Agents cannot reliably detect when a thread/session ends. Replaced by the user-invoked `session-summary` prompt.
504
- - **`hooks/` Directory** — Deleted the entire hooks directory (`hooks/cursor/`, `hooks/kiro/`, `hooks/kilo-code/`, `hooks/README.md`). All hook files were session-end related. Session start is handled by server instructions.
505
-
506
- ### Security
507
-
508
- - **Docker Compose Network Isolation (L-1)** — Added custom `mcp-net` bridge network to both services. Prevents MCP containers from accessing or being accessed by unrelated containers on the default Docker bridge.
509
- - **Docker Compose `no-new-privileges` (L-2)** — Added `security_opt: ["no-new-privileges:true"]` to both services. Prevents privilege escalation via `setuid`/`setgid` binaries inside containers.
510
- - **Author Input Sanitization (L-5)** — `resolveAuthor()` and `resolveTeamAuthor()` in `team.ts` and `core.ts` now strip ASCII control characters (`0x00`–`0x1F`, `0x7F`) and cap author strings at 100 characters. Prevents crafted `TEAM_AUTHOR` env or git config values from injecting control characters into the database `author` column or `autoContext` JSON payloads.
511
- - **Consolidated `sanitizeAuthor` (Audit)** — Moved duplicated `sanitizeAuthor()` from `core.ts` and `team.ts` into `security-utils.ts` as a single-source-of-truth export. Eliminates risk of divergent sanitization logic.
512
- - **Docker Compose `cap_drop: ALL` (Audit)** — Added `cap_drop: ALL` to both Docker Compose services, dropping all Linux capabilities (NET_RAW, SYS_CHROOT, etc.) that are unnecessary for a Node.js MCP server.
513
- - **CI Unit Test Gate (Audit)** — Added `npm run test` step to `lint-and-test.yml` workflow so unit tests run on every push/PR, not just lint/typecheck/build.
514
-
515
- ### Fixed
516
-
517
- - **Output schema mismatches causing MCP -32602 errors** — Three `outputSchema` definitions didn't match actual handler output, causing `structuredContent does not match the tool's output schema` errors:
518
- - `EntryOutputSchema` (schemas.ts) — Added `source` field (`'personal' | 'team'`) for cross-database search results that include a source marker
519
- - `VectorStatsOutputSchema` (search.ts) — Updated to match `VectorSearchManager.getStats()` return shape (`itemCount`, `modelName`, `dimensions` instead of `entryCount`, `indexSize`)
520
- - `BackupInfoSchema` (backup.ts) — Added `path` field to match `SqliteAdapter.listBackups()` output
521
- - **`get_statistics` Date Filtering** — `start_date` and `end_date` parameters now filter all statistics queries (total count, type breakdown, period breakdown, decision density). Previously parsed by Zod but ignored by the handler. Returns `dateRange` echo in the response when dates are provided.
522
- - **`get_statistics` Project Breakdown** — `project_breakdown: true` now returns a `projectBreakdown` array with per-project entry counts. Previously parsed but ignored.
523
- - **`export_entries` Filter Bypass** — Handler was calling `db.getRecentEntries(limit)` and ignoring all parsed filter parameters (`start_date`, `end_date`, `entry_types`, `tags`). Now correctly uses `db.searchByDateRange()` for date/tag filters and post-filters by `entry_types`.
524
- - **GitHub Error Consistency** — All GitHub tool error responses (`get_github_issue`, `get_github_pr`, `get_github_context`, `get_repo_insights`, `resolveOwnerRepo`, `resolveOwner`) now include `success: false` field, matching the `{success: false, error}` pattern used by all other tools.
525
- - **`get_vector_index_stats` Missing `success` Field** — Handler now returns `success: true/false` in all response paths for schema consistency.
526
- - **No-Argument Prompts Failing with MCP `-32602`** — Prompts with no arguments (e.g., `session-summary`, `confirm-briefing`, `prepare-standup`) failed when the client called `prompts/get` without `arguments`. The registration code passed an empty `argsSchema: {}` to `registerPrompt`, which the SDK wrapped in `z.object({})` and attempted to validate against `undefined`. Now omits `argsSchema` entirely for argumentless prompts so the SDK skips validation.
527
- - **`get_github_milestone` Error Missing `success: false`** — Error response for non-existent milestones returned `{ error }` without `success` field. Now returns `{ success: false, error }` matching the consistent error shape used by all other tools.
528
- - **`get_kanban_board` Error Missing `success: false`** — Error response for non-existent projects returned `{ error }` without `success` field. Now returns `{ success: false, error }` matching the consistent error shape used by all other tools.
529
- - **`search_by_date_range` Silent Filter Bug** — `issue_number`, `pr_number`, and `workflow_run_id` parameters were accepted by the Zod schema but silently ignored — the handler never passed them to the database query. Now correctly forwards all three filters to `SqliteAdapter.searchByDateRange()`, which applies them as SQL WHERE clauses.
530
-
531
- ### Improved
532
-
533
- - **Zod Boundary Leak Prevention** — Created separate relaxed MCP schemas (without `min`/`max` constraints) for 7 tools so boundary violations reach the handler for structured `{success: false, error}` responses instead of leaking as raw MCP `-32602` error frames. Affected tools: `get_recent_entries`, `create_entry`, `create_entry_minimal`, `search_entries`, `search_by_date_range`, `semantic_search`, `export_entries`, `cleanup_backups`, `visualize_relationships`.
534
- - **Numeric Coercion in MCP Schemas** — Replaced all `z.number()` / `z.coerce.number()` with `relaxedNumber()` (`z.any()`) in relaxed MCP input schemas across 10 tool files. Non-numeric values (e.g., `limit: "abc"`) now pass SDK-level Zod validation and are caught by handler strict schemas as structured `{success: false, error}` responses instead of raw MCP `-32602` errors. New shared helper: `relaxedNumber()` in `schemas.ts`. Added 4 new relaxed schemas: `GetEntryByIdSchemaMcp`, `DeleteEntrySchemaMcp`, `TeamGetRecentSchemaMcp`, `TeamSearchSchemaMcp`.
535
-
536
- ### Changed
537
-
538
- - **CI `publish-npm.yml` Node Version Alignment (L-4)** — Updated Node.js version from 22.x to 24.x to match `engines.node: >=24.0.0` in `package.json` and the Dockerfile base image (`node:24-alpine`).
539
-
540
- - **Dependency Updates**
541
- - `eslint`: 10.0.2 → 10.0.3 (patch)
542
-
543
- ## [5.0.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v5.0.0...v5.0.1) - 2026-03-06
544
-
545
- ### Security
546
-
547
- - **GHSA-qffp-2rhf-9h96 (tar)** — Manually patched npm's bundled `tar` → `7.5.10` in Dockerfile to fix HIGH severity path traversal vulnerability (CVSS 8.2). Also updated npm override.
548
-
549
- ### Changed
550
-
551
- - **Dependency Updates**
552
- - `tar` override: 7.5.9 → 7.5.10 (patch) — npm + Docker layers
553
-
554
- ## [5.0.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.5.0...v5.0.0) - 2026-03-06
555
-
556
- ### Added
557
-
558
- - **Playwright E2E Test Suite** — 8 spec files testing HTTP/SSE transport layer end-to-end with Playwright:
559
- - `health.spec.ts` — Health endpoint, root info, MCP initialization
560
- - `protocols.spec.ts` — Streamable HTTP and Legacy SSE protocol error handling
561
- - `security.spec.ts` — Security headers (6), CORS, HSTS, body size limits, 404 handler
562
- - `auth.spec.ts` — Bearer token authentication enforcement (separate server with `--auth-token`)
563
- - `sessions.spec.ts` — Session lifecycle: init → use → terminate → reject stale
564
- - `tools.spec.ts` — MCP SDK client tool execution via Streamable HTTP (`test_simple`, `create_entry_minimal`, validation errors)
565
- - `resources.spec.ts` — MCP SDK client resource reads via Streamable HTTP (`memory://health`, `memory://briefing`, etc.)
566
- - `stateless.spec.ts` — Stateless mode: SSE disabled (405), DELETE no-op (204), no legacy SSE
567
- - `scheduler.spec.ts` — Scheduler activation verification via `memory://health` resource
568
- - New `test:e2e` npm script (`playwright test`)
569
- - New devDependency: `@playwright/test`
570
-
571
- ### Fixed
572
-
573
- - **Legacy SSE transport `start()` redundancy** — `setupLegacySSE` called `sseTransport.start()` after `server.connect()` which already auto-calls `start()`, causing "SSEServerTransport already started!" errors and preventing SDK clients from using Legacy SSE
574
-
575
- - **Legacy SSE Transport** — HTTP transport now supports both Streamable HTTP (MCP 2025-03-26) and Legacy SSE (MCP 2024-11-05) protocols simultaneously (stateful mode only)
576
- - `GET /sse` — Opens Legacy SSE connection for backward-compatible clients
577
- - `POST /messages?sessionId=<id>` — Routes messages to Legacy SSE transport
578
- - Cross-protocol guard: SSE session IDs rejected on `/mcp` and vice versa
579
- - **Health Endpoint** — `GET /health` returns `{ status: "healthy", timestamp }` for monitoring and load balancer probes
580
- - **Root Info Endpoint** — `GET /` returns server name, version, description, all available endpoints, and documentation link
581
- - **404 Handler** — Unknown paths now return `404 { error: "Not found" }` instead of Express default HTML
582
- - **`DB_PATH` Environment Variable** — CLI `--db` flag now accepts `DB_PATH` as a fallback (precedence: CLI flag > `DB_PATH` env > `./memory_journal.db`). Enables database path configuration via MCP client env blocks without needing CLI args.
583
- - **Team Collaboration (Redesign)** — Rebuilt team collaboration from scratch with proper architecture:
584
- - **Separate team database** — `TEAM_DB_PATH` env var / `--team-db` CLI flag for a public, git-tracked `.db` file
585
- - **Author attribution** — Auto-detected from `TEAM_AUTHOR` env or `git config user.name`
586
- - **3 dedicated tools** — `team_create_entry`, `team_get_recent`, `team_search` (new `team` tool group)
587
- - **`share_with_team`** — Optional parameter on `create_entry` to copy entries to team DB
588
- - **Cross-database search** — `search_entries` and `search_by_date_range` auto-merge team results with `source` marker
589
- - **2 team resources** — `memory://team/recent` (author-enriched entries), `memory://team/statistics` (author breakdown)
590
- - **Briefing integration** — `memory://briefing` shows team entry count when team DB configured
591
- - **Health integration** — `memory://health` includes team database status block
592
- - **Server instructions** — Team collaboration section + team tool reference at standard+ level
593
- - **`ICON_TEAM`** — Users group SVG icon for team tools
594
- - Tool count: 39 → 42, tool groups: 8 → 9, resources: 20 → 22
595
-
596
- ### Removed
597
-
598
- - **Legacy Team Collaboration System** — Removed non-functional team collaboration feature (remnant of Python-era architecture), then rebuilt from scratch (see Added > Team Collaboration)
599
- - Removed old `share_with_team` parameter, `memory://team/recent` resource, and `ICON_TEAM` constant
600
- - Deleted unused `.memory-journal-team.db` file
601
- - Database files reorganized into `data/` directory
602
- - **Database Files Reorganized** — Moved `memory_journal.db` and `backups/` into `data/` directory for cleaner project structure
603
- - **Tool Handler Modularized** — Replaced 3,428-line monolith `src/handlers/tools/index.ts` with 12 focused modules + barrel file (~140 lines):
604
- - `core.ts` (6), `search.ts` (4), `analytics.ts` (2), `relationships.ts` (2), `export.ts` (1), `admin.ts` (5), `backup.ts` (4)
605
- - `github/` sub-directory: `read-tools.ts` (5), `mutation-tools.ts` (4), `milestone-tools.ts` (5), `insights-tools.ts` (1), `schemas.ts`
606
- - Shared Zod output schemas extracted to `schemas.ts` and `github/schemas.ts`
607
- - Public API (`getTools`, `callTool`) unchanged — zero breaking changes for `McpServer.ts`
608
- - **Types Modularized** — Split `types/index.ts` (652 lines) into `types/filtering.ts`, `types/entities.ts`, `types/github.ts` with barrel re-exports
609
- - **Database Schema Extracted** — Extracted SQL DDL + `CreateEntryInput` from `SqliteAdapter.ts` into `database/schema.ts`
610
- - **Resource Handlers Modularized** — Split `resources/index.ts` (1,692 lines) into 5 sub-modules + barrel (~120 lines):
611
- - `shared.ts` (types/helpers), `core.ts` (8 resources), `graph.ts` (3), `github.ts` (4), `templates.ts` (6)
612
- - **Prompt Handlers Modularized** — Split `prompts/index.ts` (587 lines) into `workflow.ts` (9 prompts), `github.ts` (6 prompts) + barrel (~95 lines)
613
- - **Mutation Tools Modularized** — Split `mutation-tools.ts` (660 lines) into `helpers.ts`, `kanban-tools.ts` (2 tools), `issue-tools.ts` (2 tools) + barrel
614
- - **Deterministic Error Handling** — All 42 tool handlers wrapped with `try/catch` + `formatHandlerError()` returning `{ success: false, error }` instead of throwing raw MCP errors. Matches the error handling standard from mysql-mcp.
615
- - New utility: `src/utils/error-helpers.ts` — `formatHandlerError()`, `formatZodError()`
616
- - `ToolDefinition.handler` return type changed from `Promise<unknown>` to `unknown` (supports both sync and async handlers)
617
- - GitHub `resolveOwnerRepo()` helpers now return validated `github` instance, eliminating all non-null assertions
618
- - **`Permissions-Policy` Header** — Added `Permissions-Policy: camera=(), microphone=(), geolocation=()` to security headers (6 headers total)
619
- - **`--auth-token` CLI Option** — New `--auth-token <token>` CLI flag and `MCP_AUTH_TOKEN` environment variable for optional bearer token authentication on the HTTP transport. When configured, all endpoints except `GET /health` require `Authorization: Bearer <token>`. Backward compatible — no auth required when not set.
620
-
621
- ### Security
622
-
623
- - **Trigger Name Validation in `migrateSchema()` (H-1)** — Added `SAFE_IDENTIFIER_RE` regex check (`/^[a-zA-Z_][a-zA-Z0-9_]*$/`) before interpolating trigger names into DDL during legacy FTS5 trigger cleanup. Prevents potential SQL injection if a legacy database contains a crafted trigger name. Unsafe names are now logged and skipped.
624
- - **Query Limit Caps (M-4)** — All `limit` parameters across tool handlers now enforce `.max(500)` via Zod schema validation, preventing unbounded memory-loading queries. Applied to 10 schemas across `core.ts`, `search.ts`, `team.ts`, `relationships.ts`, and `export.ts`.
625
- - **TruffleHog Pinned to Release Tag (M-2)** — `trufflesecurity/trufflehog@main` → `@v3.93.7` in `secrets-scanning.yml` to eliminate supply-chain risk from floating `@main` tag.
626
- - **Docker Scout Official Action (M-3)** — Replaced `curl | sh` Docker Scout CLI installer with `docker/scout-action@v1.18.2` in `docker-publish.yml`, eliminating supply-chain risk from executing arbitrary remote scripts in CI with elevated permissions.
627
- - **Gitleaks Blocking on Failure (L-4)** — Removed `continue-on-error: true` from Gitleaks step in `secrets-scanning.yml` so detected secret leaks now fail the workflow.
628
- - **HTTP Bearer Token Authentication (F-1)** — Optional bearer token middleware for HTTP transport. Logs a warning when HTTP mode starts without authentication configured.
629
- - **Gitleaks Pinned to Release Tag (F-3)** — `gitleaks/gitleaks-action@v2` → `@v2.3.9` in `secrets-scanning.yml` to eliminate supply-chain risk from floating major version tag.
630
- - **SSE Session Timeout Sweep (F-4)** — Legacy SSE sessions are now tracked in `sessionLastActivity` and expired by the 30-minute idle sweep, matching the behavior of Streamable HTTP sessions. Previously SSE sessions were only cleaned up on client disconnect.
631
- - **`searchByDateRange` Query Limit (F-6)** — Added `LIMIT` clause (default: 500, max: 500) to `searchByDateRange` SQL query to prevent unbounded result sets from broad date ranges. New `limit` parameter on `search_by_date_range` tool.
632
- - **Docker Production-Only Dependencies (I-2)** — Production image now runs `npm ci --omit=dev` instead of copying the full builder `node_modules`. Removes devDependencies (vitest, eslint, typescript, etc.) from the production image, reducing attack surface.
633
- - **CORS `Authorization` Header** — Added `Authorization` to `Access-Control-Allow-Headers` for bearer token authentication support.
634
- - **Timing-Safe Auth Token Comparison (L-1)** — Replaced string `!==` comparison with `crypto.timingSafeEqual()` for bearer token authentication, eliminating a timing side-channel that could theoretically leak token contents character-by-character.
635
- - **HSTS Header for Reverse Proxy (L-2)** — Added conditional `Strict-Transport-Security: max-age=31536000; includeSubDomains` header when `X-Forwarded-Proto: https` is detected, preventing downgrade attacks in TLS-terminating reverse proxy deployments.
636
- - **Docker Compose Auth Token (L-3)** — Added commented `MCP_AUTH_TOKEN` environment variable to the HTTP service in `docker-compose.yml`, making authentication configuration discoverable for production deployments.
637
- - **Shell-Free Git Author Detection (I-1)** — Replaced `execSync('git config user.name')` with `execFileSync('git', ['config', 'user.name'])` in `core.ts` and `team.ts` to avoid implicit shell invocation, reducing the surface for potential command injection if the call site were ever modified.
638
- - **Docker Compose Read-Only Filesystem** — Added `read_only: true` and `tmpfs: /tmp:noexec,nosuid,nodev` to both Docker Compose services. Limits container write surface to the `/app/data` volume and `/tmp` tmpfs, preventing filesystem-based persistence attacks.
639
- - **Docker Compose Generic Token Placeholder** — Replaced `ghp_your_token_here` placeholder with `<your-github-token>` to avoid false positive noise in secret scanners.
640
- - **Docker Compose Explicit `NODE_ENV`** — Added `NODE_ENV=production` to the HTTP service environment block for visibility and to prevent accidental override.
641
- - **CVE-2026-27171 (zlib)** — Explicitly install zlib from Alpine edge in Dockerfile builder and production stages to fix MEDIUM severity denial of service via infinite loop in CRC32 combine functions.
642
- - **Gitleaks `GITHUB_TOKEN`** — Pass `GITHUB_TOKEN` to `gitleaks/gitleaks-action@v2.3.9` in `secrets-scanning.yml` as now required for PR scanning.
643
-
644
- ### Improved
645
-
646
- - **Batch Tag Fetching (N+1 Elimination)** — Multi-row methods (`getRecentEntries`, `getEntriesPage`, `searchEntries`, `searchByDateRange`) now batch-fetch tags in a single `IN (...)` query via `batchGetTagsForEntries()` + `rowsToEntries()`, eliminating the N+1 per-row `getTagsForEntry` pattern. `getRecentEntries(50)` reduced from 51 queries to 2.
647
- - **Batch Tag Linking** — `linkTagsToEntry()` batches tag inserts and lookups: single `INSERT OR IGNORE` for all tags, single `SELECT ... WHERE name IN (...)` for IDs, reducing from 4N to 2+2N SQL statements per entry.
648
- - **Tool Dispatch Cache** — `callTool()` now caches tool definitions in a `Map` for O(1) lookup instead of rebuilding all 42 `ToolDefinition` objects and doing a linear scan on every call. Cache invalidates when context parameters change.
649
- - **Conditional JOIN in `searchByDateRange`** — Tag tables (`entry_tags`, `tags`) are only JOINed when a tag filter is provided, avoiding unnecessary `DISTINCT` and row multiplication for the common no-tag-filter case.
650
- - **Consolidated `getStatistics` Queries** — Reduced from 5 sequential `db.exec()` calls to 3 using multi-statement `exec()`: combined total+type counts, period+density via `SUM(CASE ...)`, and relationship+causal counts.
651
- - **Simplified `rebuildIndex` Cleanup** — Removed redundant orphan detection pass that preceded a delete-all pass. Now performs a single delete-all before re-indexing.
652
- - **Dual-Schema Validation for Structured Errors** — All tools now use a dual-schema pattern to ensure Zod validation errors produce structured `{ success: false, error }` responses instead of raw MCP `-32602` error frames. Relaxed schemas (`z.string()`) are passed to the SDK's `inputSchema` for type-level validation, while strict schemas (`z.enum()`, `z.string().regex()`) are used inside handlers via `.parse()` with `formatHandlerError()` catch. Applied across 8 tool files covering 13 enum fields and 8 date regex fields: `core.ts`, `search.ts`, `export.ts`, `analytics.ts`, `admin.ts`, `relationships.ts`, `github/read-tools.ts`, `github/milestone-tools.ts`.
653
-
654
- ### Fixed
655
-
656
- - **Entry Type Enum Completeness** — Added 6 missing entry types to the `EntryType` union and `ENTRY_TYPES` Zod enum: `technical_note`, `development_note`, `enhancement`, `milestone`, `system_integration_test`, `test_entry`. These types existed in the database (from prior usage) but were rejected by input validation, preventing creation of entries with these types. Updated `server-instructions.md` Entry Types section accordingly.
657
-
658
- - **`get_github_milestones` State Filter** — Fixed `state: "all"` parameter being converted to `undefined` before passing to the GitHub REST API, causing the API to default to `"open"` and silently exclude closed milestones. The GitHub REST API natively supports `"all"` as a valid state value; the conversion was unnecessary.
659
-
660
- - **Legacy Database Schema Migration** — Added `migrateSchema()` to `SqliteAdapter.initialize()` that checks for missing columns via `PRAGMA table_info` and adds them with `ALTER TABLE`. `CREATE TABLE IF NOT EXISTS` is a no-op on existing tables, so columns added after initial creation (e.g., `significance_type`, `auto_context`, `deleted_at`, GitHub fields) were never added to databases created before those columns existed. Also drops legacy FTS5 triggers from the Python era that cause `no such module: fts5` on INSERT/UPDATE/DELETE (sql.js WASM does not include FTS5; the TypeScript codebase uses LIKE queries).
661
- - **`list_tags` Null Usage Count** — Fixed `list_tags` output schema validation failure (`expected number, received null`) on databases with corrupted `usage_count` values. `listTags()` query now uses `COALESCE(usage_count, 0)` and `TagOutputSchema.count` is `z.number().nullable()`. Also added data repair in `migrateSchema()` to fix null `usage_count` values in the `tags` table.
662
- - **Output Schema Validation for Error Responses** — All tool output schemas now accept error responses (`{ success: false, error: "..." }`) from `formatHandlerError()`. Previously, schemas with required success-path fields (e.g., `entries`, `count`, `relationship`, `entry`) rejected error responses with output validation `-32602` errors. Made success-path fields optional and added `success`/`error` fields across 9 schema files: `schemas.ts`, `core.ts`, `search.ts`, `export.ts`, `analytics.ts`, `admin.ts`, `relationships.ts`, `github/schemas.ts`.
663
- - **Multi-Session Connect Crash** — Fixed `Already connected to a transport` error when creating 2+ concurrent Streamable HTTP sessions
664
- - SDK's `McpServer.connect()` only supports one active transport; second `connect()` threw
665
- - Added close-before-reconnect pattern wrapping `server.connect()` in try-catch
666
- - **Backup Tool Error Path Output Schema** — Backup tool error responses from `formatHandlerError()` (returning `{ success: false, error }`) now pass Zod output validation. Previously, `BackupResultOutputSchema`, `BackupsListOutputSchema`, `RestoreResultOutputSchema`, and `CleanupBackupsOutputSchema` required non-optional fields (`message`, `filename`, `path`, `sizeBytes`, etc.) that error responses don't include, causing raw MCP `-32602` errors on error paths like path traversal in backup names.
667
- - **Vector Benchmark `beforeAll` Timeout** — Added `benchmark.hookTimeout: 30000` to `vitest.config.ts` to accommodate transformer model loading in benchmark `beforeAll` hooks.
668
- - **Mermaid Arrow Inconsistency for `caused`** — Fixed `memory://graph/recent` using `-.->` (two-dot Mermaid syntax) for `caused` relationship type instead of `-.->` (single-dot), which is the canonical style used by `visualize_relationships` tool. Both now consistently use `-.->`.
669
-
670
- ### Changed
671
-
672
- - **HTTP Transport Modularized** — Extracted HTTP transport code from `McpServer.ts` (813 → ~450 lines) into a dedicated `src/transports/http.ts` module with `HttpTransport` class, matching the architecture of mysql-mcp, postgres-mcp, and db-mcp
673
-
674
- - **Dependency Updates**
675
- - `@types/node`: 25.3.3 → 25.3.5 (patch)
676
- - `express-rate-limit`: 8.2.1 → 8.3.0 (minor)
677
- - `sql.js`: 1.14.0 → 1.14.1 (patch)
678
-
679
- ### CI/CD
680
-
681
- - **CodeQL Default Setup Disabled** — Disabled GitHub's CodeQL "Default Setup" to resolve persistent "Error when processing the SARIF file" warning. Both the Default Setup and the custom `codeql.yml` workflow were uploading SARIF results for `javascript-typescript`, causing a conflict during ingestion. The custom workflow is now the sole CodeQL scanner.
682
- - **CodeQL `actions` Language Coverage** — Added `actions` to the CodeQL workflow language matrix to replace coverage previously provided by the Default Setup. The workflow now scans both `javascript-typescript` and `actions`.
683
- - **Trivy Action Update** — Updated `aquasecurity/trivy-action` 0.34.0 → 0.34.1 in `security-update.yml` (bundles Trivy scanner 0.69.2)
684
-
685
- ## [4.5.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.4.2...v4.5.0) - 2026-03-02
686
-
687
- ### Fixed
688
-
689
- - **Session Start briefing in Cursor** — Added Cursor-specific `FetchMcpResource` server name (`user-memory-journal-mcp`) to the Session Start instructions. Cursor prefixes MCP server names with `user-`, so agents using the generic name would get "Server not found" errors when fetching `memory://briefing`.
690
- - **`deleteOldBackups` Test Isolation** — Fixed flaky `should delete old backups keeping only keepCount` test by cleaning up pre-existing backups before creating test backups. Previously, leftover backups from other tests caused the assertion to fail non-deterministically.
691
- - **`deleteOldBackups` NaN Guard** — `keepCount` parameter now rejects `NaN` values. Previously, `NaN < 1` evaluated to `false`, bypassing the guard. With `NaN`, `backups.slice(0, NaN)` returns an empty array and `backups.slice(NaN)` returns all backups, causing every backup to be deleted.
692
- - **`restoreFromFile` Foreign Key Enforcement** — `PRAGMA foreign_keys = ON` is now applied after restoring a database from backup. Previously, `restoreFromFile()` bypassed `initialize()`, so `ON DELETE CASCADE` constraints in `entry_tags`, `relationships`, and `embeddings` tables were silently unenforced for the rest of the server's lifetime.
693
-
694
- ### Improved
695
-
696
- - **Test Coverage → 92%** — Expanded test suite from 549 → 590 tests, raising line coverage from 88.59% → 92.06%. Key areas covered:
697
- - SIGINT shutdown handlers for stdio, stateless HTTP, and stateful HTTP transports
698
- - Prompt handlers with proper arguments (`analyze-period`, `find-related`, `goal-tracker`, `get-context-bundle`, `prepare-retro`)
699
- - `SqliteAdapter` backup edge cases (missing backups dir, invalid keepCount, missing backup file)
700
- - `create_github_milestone` no-GitHub integration error path
701
- - Kanban diagram resource no-GitHub fallback
702
-
703
- ### Added
704
-
705
- - **Automated Scheduler (HTTP/SSE only)** — New in-process scheduler runs periodic maintenance jobs for long-running HTTP/SSE server processes. Configured via CLI flags:
706
- - `--backup-interval <minutes>` — Automated backup interval (0 = disabled, default: 0). Backups are created with `exportToFile()` and old backups cleaned up automatically.
707
- - `--keep-backups <count>` — Max backups to retain during automated cleanup (default: 5).
708
- - `--vacuum-interval <minutes>` — Database optimize interval (0 = disabled, default: 0). Runs `PRAGMA optimize` and flushes the database to disk.
709
- - `--rebuild-index-interval <minutes>` — Vector index rebuild interval (0 = disabled, default: 0). Full vector index rebuild from all entries.
710
- - Scheduler status is reported in the `memory://health` resource under the `scheduler` field.
711
- - Stdio transport ignores scheduler options with a warning log — use OS-level scheduling for stdio.
712
- - Each job is error-isolated: failures are logged but don't affect other scheduled jobs.
713
- - New module: `src/server/Scheduler.ts` — clean separation from `McpServer.ts`.
714
-
715
- ### Changed
716
-
717
- - **Dependency Updates**
718
- - `@types/node`: 25.3.2 → 25.3.3 (patch)
719
- - `globals`: 17.3.0 → 17.4.0 (minor)
720
- - `minimatch` override: 10.2.3 → 10.2.4 (patch) — npm + Docker layers
721
- - `tar` override: 7.5.8 → 7.5.9 (patch) — npm + Docker layers
722
-
723
- ### Security
724
-
725
- - **Wire Dead-Code Security Utilities (F-001)** — `sanitizeSearchQuery()` and `assertNoPathTraversal()` from `security-utils.ts` were defined but never imported or called. Now wired into active code paths:
726
- - `SqliteAdapter.searchEntries()` applies `sanitizeSearchQuery()` to LIKE patterns with `ESCAPE '\\\\'` clause, preventing wildcard injection (F-002)
727
- - `SqliteAdapter.restoreFromFile()` uses `assertNoPathTraversal()` instead of inline checks, throwing `PathTraversalError`
728
- - **HTTP Security Headers (F-003)** — Added three additional security headers to HTTP transport middleware:
729
- - `Content-Security-Policy: default-src 'none'; frame-ancestors 'none'` — prevents XSS and framing
730
- - `Cache-Control: no-store` — prevents caching of sensitive journal data
731
- - `Referrer-Policy: no-referrer` — prevents referrer leakage
732
- - **PRAGMA foreign_keys = ON (F-005)** — SQLite foreign key enforcement now enabled on database initialization. `ON DELETE CASCADE` constraints in `entry_tags`, `relationships`, and `embeddings` tables are now enforced at the database level.
733
- - **CORS Wildcard Warning (F-006)** — Server now logs a warning when HTTP transport CORS origin is `*` (the default), advising operators to set `--cors-origin` or `MCP_CORS_ORIGIN` for production deployments.
734
- - **Constrain `entry_type` / `significance_type` to Enums** — `entry_type` now validated against 19 allowed values and `significance_type` against 7 allowed values via Zod enums. Previously accepted arbitrary strings; invalid types now rejected at schema validation. Removes unsafe `as EntryType` / `as SignificanceType` casts.
735
- - **Date Format Validation** — All date string fields (`start_date`, `end_date`) across `SearchByDateRangeSchema`, `GetStatisticsSchema`, `ExportEntriesSchema`, and `CrossProjectInsightsSchema` now validate `YYYY-MM-DD` format via regex. Prevents malformed dates from reaching the database layer.
736
- - **HTTP Rate Limiting** — Added `express-rate-limit` middleware for HTTP transport (100 requests/minute per IP). Returns `429 Too Many Requests` on excess. Only applies to HTTP mode; stdio transport unaffected.
737
- - **Remove Dead SQL Injection Detection Code** — Removed `containsSqlInjection()`, `assertNoSqlInjection()`, `SqlInjectionError`, and `SQL_INJECTION_PATTERNS` from `security-utils.ts`. These regex-based detection functions were never called anywhere and provided a false sense of security. Parameterized queries (used consistently throughout) are the actual defense.
738
- - **`exportToFile()` Path Traversal Protection** — Added `assertNoPathTraversal()` check to backup export, matching the pattern already used in `restoreFromFile()`. Rejects malicious backup names containing `/`, `\\`, or `..`.
739
- - **`getRawDb()` Safety Documentation** — Added `@internal` JSDoc tag warning callers to use parameterized queries when accessing the raw database handle.
740
- - **Logger `LOG_LEVEL` Validation (L1)** — `LOG_LEVEL` environment variable is now validated against known levels (`debug`, `info`, `notice`, `warning`, `error`, `critical`). Invalid values fall back to `info` instead of silently setting `minLevel` to `undefined`, which would disable all logging.
741
- - **Logger `setLevel()` Guard (L2)** — `Logger.setLevel()` now validates the level parameter before applying, preventing invalid values from disabling logging.
742
- - **CI `security-scan` Node Version Alignment (L3)** — Updated Node.js version in `security-scan` job from 22.x to 24.x to match `engines.node: >=24.0.0`.
743
- - **CI Trivy SARIF Upload Guard** — `security-update.yml` upload-sarif step now checks that `trivy-results.sarif` exists before attempting upload. Previously, `if: always()` caused the step to fail when the Docker build failed upstream and no SARIF file was produced.
744
-
745
- ### Documentation
746
-
747
- - **Cursor Rule for Session Management** — Added `hooks/cursor/memory-journal.mdc`, an `alwaysApply` Cursor rule that instructs agents to read `memory://briefing` at session start and create a retrospective summary at session end. This is the most reliable mechanism for session behavior in Cursor, replacing the previous reliance on MCP server instructions alone.
748
- - **Fixed Cursor sessionEnd Hook Format** — Rewrote `hooks/cursor/hooks.json` from a non-standard format to Cursor's documented `version: 1` schema. Added companion `hooks/cursor/session-end.sh` audit script. Corrected documentation: Cursor's `sessionEnd` hook is fire-and-forget (cannot inject messages); session summary creation is handled by the Cursor rule and server instructions.
749
- - **Revised hooks/README.md** — Rewritten to accurately describe progressive enhancement: Cursor rule (primary) > server instructions (fallback) > hooks (audit only). Removed incorrect claim that Cursor `sessionEnd` does message injection. Added rule setup as Step 1 for Cursor users.
750
- - **Updated Session Management in README.md and DOCKER_README.md** — Session Management sections now lead with the Cursor rule as the primary setup mechanism, with a three-column table showing primary (agent behavior) vs optional (audit/logging) configurations per IDE.
751
- - **SECURITY.md Accuracy (F-004)** — Rewrote Database Security section to accurately reflect sql.js in-memory architecture. Removed false claims about WAL mode and 7 PRAGMAs that are not applicable to sql.js. Updated security checklist to reference actual function names (`assertNoPathTraversal`, `sanitizeSearchQuery`, `validateDateFormatPattern`). Updated HTTP security headers list to include CSP, Cache-Control, and Referrer-Policy.
752
- - **SECURITY.md Tag Filtering Correction** — Replaced inaccurate claim that dangerous characters are blocked in tags with accurate statement that tags are safely handled via parameterized queries.
753
- - **Team Collaboration in READMEs** — Added team collaboration feature to Key Benefits in both `README.md` and `DOCKER_README.md`.
754
- - **Wiki Security Page Updates** — Added LIKE pattern sanitization, path traversal protection, HTTP security headers, rate limiting, and team database security note to the wiki Security.md page. Expanded self-audit checklist from 10 to 16 items.
755
- - **Rate Limiting Documentation** — Added rate limiting mention to README.md Security section.
756
-
757
- ### Fixed
758
-
759
- - **Path Traversal Test Assertion** — Updated `sql-injection.test.ts` to assert `PathTraversalError` type instead of old inline error message string, matching refactored `assertNoPathTraversal()` usage.
760
- - **Tool Handler Test Fix** — Updated `tool-handlers.test.ts` to use valid entry_type enum value (`project_decision` instead of `decision`), matching the new enum constraint.
761
- - **`share_with_team` Not Setting `isPersonal`** — `create_entry` with `share_with_team: true` now correctly sets `isPersonal: false`, making the entry visible in team-scoped resources like `memory://team/recent`. Previously, the `share_with_team` parameter was parsed but never applied to the `isPersonal` field.
762
-
763
- ### Removed
764
-
765
- - **Unused `cors` Dependency** — Removed `cors` and `@types/cors` packages. CORS is handled by custom middleware in `McpServer.ts`.
766
-
767
- ## [4.4.2](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.4.0...v4.4.2) - 2026-02-27
768
-
769
- ### Security
770
-
771
- - **CVE-2026-27903 + CVE-2026-27904 (minimatch)** — Manually patched npm's bundled `minimatch` → `10.2.3` in Dockerfile to fix HIGH severity ReDoS and algorithmic complexity vulnerabilities (CVSS 7.5). The v4.4.1 npm override only affected project dependencies; Docker Scout detected the vulnerable copy inside npm's own bundled packages. Also added npm override.
772
-
773
- ## [4.4.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.3.1...v4.4.0) - 2026-02-27
774
-
775
- ### Added
776
-
777
- - **Performance Benchmarking Suite** — Added a `vitest bench` powered benchmarking suite to measure baseline performance for database operations, vector indexing, and tool execution overhead. Included new `"bench"` npm script.
778
-
779
- - **GitHub Milestones Integration** — Full CRUD support for GitHub Milestones
780
- - 5 new tools: `get_github_milestones`, `get_github_milestone`, `create_github_milestone`, `update_github_milestone`, `delete_github_milestone` (39 total tools)
781
- - 2 new resources: `memory://github/milestones` (list view) and `memory://milestones/{number}` (detail view) (20 total resources)
782
- - Session briefing (`memory://briefing`) now includes milestone progress in the user message table
783
- - GitHub status resource (`memory://github/status`) now includes milestone summary data
784
- - `create_github_issue_with_entry` now accepts optional `milestone_number` parameter to assign issues to milestones
785
- - `get_github_issues` and issue resources now include milestone association data
786
- - New `ICON_MILESTONE` flag icon for milestone tools and resources
787
- - Milestone tools reference added to `ServerInstructions.ts` for agent guidance
788
- - **Server Host Bind Parameter** — New `--server-host` CLI option and `MCP_HOST` environment variable for configuring HTTP transport bind address
789
- - Defaults to `localhost`; set to `0.0.0.0` for container deployments
790
- - Also reads `HOST` environment variable as fallback
791
- - CLI flag takes precedence over environment variables
792
-
793
- - **Repository Insights/Traffic Tool** — New `get_repo_insights` tool and `memory://github/insights` resource for monitoring repository health
794
- - 1 new tool: `get_repo_insights` (39 total tools, github group: 14 → 15)
795
- - 1 new resource: `memory://github/insights` — compact summary of stars, forks, and 14-day traffic totals (~150 tokens)
796
- - **Token-efficient sections parameter**: `stars` (~50 tokens), `traffic` (~100), `referrers` (~100), `paths` (~100), or `all` (~350)
797
- - Surfaces stars, forks, watchers, clone/view aggregates (14-day rolling), top referrer sources, and popular repository pages
798
- - Uses extended 10-minute cache TTL (vs 5-minute for other GitHub data) since traffic data changes slowly
799
- - 4 new `GitHubIntegration` methods: `getRepoStats()`, `getTrafficData()`, `getTopReferrers()`, `getPopularPaths()`
800
- - New types: `RepoStats`, `TrafficData`, `TrafficReferrer`, `PopularPath`
801
- - Requires push access to repository for traffic endpoints
802
-
803
- ### Changed
804
-
805
- - **Dependency Updates**
806
- - `@eslint/js`: 9.39.2 → 10.0.1 (major)
807
- - `@modelcontextprotocol/sdk`: 1.26.0 → 1.27.1 (minor)
808
- - `@types/node`: 25.2.0 → 25.3.2 (minor)
809
- - `eslint`: 9.39.2 → 10.0.2 (major)
810
- - `simple-git`: 3.28.0 → 3.32.3 (minor)
811
- - `sql.js`: 1.12.0 → 1.14.0 (minor)
812
- - `typescript-eslint`: 8.54.0 → 8.56.1 (minor)
813
- - `axios` override: 1.13.2 → 1.13.5 (patch) — fixes GHSA-43fc-jf86-j433 (DoS via `__proto__` key in `parseConfig`)
814
-
815
- ### Documentation
816
-
817
- - **Server Instructions Fixes** — Added missing Kanban optional `owner` parameters and the four new Phase 6 GitHub template resources to `ServerInstructions.ts`'s Key Resources table to ensure agents have complete tool/resource context.
818
- - **Testing Prompt Polish** — Fixed minor typos and phase numbering inconsistencies in the comprehensive verification plan (`test-memory-journal-mcp.md`).
819
- - **AntiGravity IDE Guidance** — Added explicit note in README.md and DOCKER_README.md that AntiGravity does not currently support MCP server instructions, with workaround to manually provide `ServerInstructions.ts` contents
820
- - **`memory://milestones/{N}` Behavior Clarified** — Updated `test-memory-journal-mcp.md` to accurately document that this resource is designed to return milestone metadata + issue counts + `completionPercentage` + a `hint` to use `get_github_issues` for individual issue details (not full issue arrays)
821
-
822
- ### Improved
823
-
824
- - **`get_entry_by_id` Importance Scoring Breakdown** — Tool now returns `importanceBreakdown` alongside the `importance` score, showing weighted component contributions: `significance` (30%), `relationships` (35%), `causal` (20%), `recency` (15%). Gives agents transparency into _why_ an entry scored a given importance level.
825
- - **`get_cross_project_insights` Inactive Threshold Visibility** — Tool output now includes `inactiveThresholdDays: 7` field, making the hardcoded inactive project classification criteria self-documenting. Previously, consumers saw an empty `inactive_projects` array with no way to know the cutoff.
826
- - **Database I/O — Debounced Save** — Mutation methods (`createEntry`, `updateEntry`, `deleteEntry`, `linkEntries`, `mergeTags`) now use a 500ms debounced `scheduleSave()` instead of synchronous `save()` on every call, batching rapid writes into a single disk flush. `close()` and `restoreFromFile()` still flush immediately for data safety.
827
- - **Vector Index Rebuild — Paginated Fetching** — `rebuildIndex()` now uses `getEntriesPage(offset, limit)` with `REBUILD_PAGE_SIZE=200` instead of loading all entries at once via `getRecentEntries(10000)`, reducing peak memory usage for large journals.
828
- - **Vector Index Rebuild — Parallel Batch Embedding** — Entries are embedded in parallel batches of 5 (`REBUILD_BATCH_SIZE`) via `Promise.all` instead of sequentially, improving rebuild throughput.
829
- - **Vector Index Rebuild — Sequential Insertion** — Embeddings are generated in parallel batches for throughput, but vectra insertions are sequential to avoid file I/O race conditions. Index is pre-cleaned in bulk to eliminate per-item upsert deletes.
830
- - **Server Startup — `getTools()` Deduplication** — Eliminated a duplicate `getTools()` call during server startup; tool names for instruction generation are now extracted from the same array used for registration, saving one full tool-construction pass.
831
- - **GitHub API — TTL Response Cache** — Read methods (`getIssues`, `getIssue`, `getPullRequests`, `getPullRequest`, `getWorkflowRuns`, `getRepoContext`, `getMilestones`, `getMilestone`) now cache responses for 5 minutes. Mutation methods (`createIssue`, `closeIssue`, `createMilestone`, `updateMilestone`, `deleteMilestone`, `moveProjectItem`, `addProjectItem`) automatically invalidate related caches. Public `clearCache()` method available for manual invalidation.
832
-
833
- ### Fixed
834
-
835
- - **`memory://instructions` Active Tool Count** — Fixed resource returning `Active Tools (3)` instead of `Active Tools (N)` when no tool filter is configured. The handler incorrectly fell back to a hardcoded 3-tool set (`create_entry`, `search_entries`, `get_recent_entries`) when `filterConfig` is `null`. Now correctly uses `getAllToolNames()` so the count reflects all enabled tools (e.g., `Active Tools (39)`). Added regression test to `resource-handlers.test.ts`.
836
-
837
- - **`get_github_issue` Missing Milestone Field** — `getIssue()` in `GitHubIntegration.ts` now maps `issue.milestone` from the GitHub API response into the returned `IssueDetails` object. Previously the field was silently excluded, so `get_github_issue` and other callers never reflected milestone assignment even when the issue had one.
838
- - **`ServerInstructions.ts` Entry Types Corrected** — Updated `## Entry Types` reference list from 7 stale v4-era types (`technical_note`, `progress_update`, `deployment`, etc.) to the full 13 types in the `EntryType` union (`personal_reflection`, `project_decision`, `technical_achievement`, `bug_fix`, `feature_implementation`, `code_review`, `meeting_notes`, `learning`, `research`, `planning`, `retrospective`, `standup`, `other`). The most impactful addition is `planning`, which is the type auto-assigned by `create_github_issue_with_entry` and `close_github_issue_with_entry`. Updated the corresponding test in `server-instructions.test.ts`.
839
- - **`memory://milestones/{N}` Description Clarified** — Updated resource description to accurately state it returns milestone metadata + issue counts (`openIssues`, `closedIssues`) rather than full issue arrays. Added a `hint` field to the response directing users to the `get_github_issues` tool for individual issue details.
840
- - **Docker Hub Short Description** — Corrected "HTTPS" → "HTTP/SSE" and formatting in `docker-publish.yml` short-description field
841
- - **`delete_entry` Permanent Delete of Soft-Deleted Entries** — `delete_entry(id, permanent: true)` now works on previously soft-deleted entries. Added `getEntryByIdIncludeDeleted()` so permanent deletion can find entries regardless of soft-delete state. Previously returned `{ success: false, error: "Entry not found" }` for soft-deleted entries.
842
- - **`list_tags` Zero-Count Tag Filtering** — `list_tags` tool and `memory://tags` resource no longer return orphan tags with zero usage count, reducing clutter from deleted or merged tags
843
- - **`delete_entry` Existence Check (P154)** — Tool now pre-checks entry existence before mutation, returning `{ success: false, error: "Entry X not found" }` for nonexistent entries instead of always returning `success: true`
844
- - **`link_entries` Existence Check (P154)** — Tool now pre-checks both source and target entry existence before creating relationship, returning `{ success: false, message: "Source/Target entry X not found" }` instead of silently creating orphan relationships
845
- - **`visualize_relationships` Existence Disambiguation (P154)** — When `entry_id` parameter specifies a nonexistent entry, tool now returns `{ message: "Entry X not found" }` instead of the ambiguous `"No entries found with relationships matching your criteria"`
846
- - **`memory://health` Tool Count** — Health resource now dynamically computes tool count from `TOOL_GROUPS` instead of a hardcoded value. Previously reported 33 tools; now correctly reports 38 after milestone tools were added.
847
- - **`memory://significant` Importance Sort Correctness** — Fixed resource returning entries sorted by timestamp instead of importance when the database has more than 20 significant entries. Previously, `LIMIT 20` was applied in SQL (`ORDER BY timestamp DESC LIMIT 20`) before the JavaScript importance sort, meaning older but higher-importance entries were excluded before sorting ran. Now all significant entries are fetched, sorted by `importance` descending in JavaScript, then the top 20 are returned. Added regression test verifying sort order across entries with different relationship counts.
848
-
849
- - **`delete_github_milestone` Structured Error** — Tool now returns `{ success: false, milestoneNumber, message, error }` matching `DeleteMilestoneOutputSchema` when deletion fails. Previously returned only `{ error }` without structured fields.
850
- - **`JournalEntry` GitHub Metadata** — Entry output now includes 10 GitHub integration fields (`issueNumber`, `issueUrl`, `prNumber`, `prUrl`, `prStatus`, `projectNumber`, `projectOwner`, `workflowRunId`, `workflowName`, `workflowStatus`) in all tool responses. Previously stored in DB but omitted from `create_entry`, `get_entry_by_id`, `get_recent_entries`, and search results.
851
-
852
- ### CI/CD
853
-
854
- - **Removed Dependabot Auto-Merge Workflow** — Deleted `dependabot-auto-merge.yml`; dependency PRs now require manual review and merge
855
- - **Trivy Action Update** — Updated `aquasecurity/trivy-action` 0.33.1 → 0.34.0 in `security-update.yml` (bundles Trivy scanner 0.69.1)
856
- - **CI Test Matrix Alignment** — Updated Node.js test matrix from `[20.x, 22.x, 25.x]` to `[24.x, 25.x]` to match `engines.node: >=24.0.0`
857
- - **Blocking npm audit** — Removed `continue-on-error: true` from `npm audit` step in lint-and-test.yml; known vulnerabilities now fail the pipeline
858
- - **Blocking Secret Scanning** — Removed `continue-on-error: true` from TruffleHog step in secrets-scanning.yml; verified secret leaks now fail the pipeline
859
-
860
- ### Security
861
-
862
- - **GHSA-w7fw-mjwx-w883 (qs)** — Updated `qs` 6.14.1 → 6.14.2 to fix low-severity arrayLimit bypass in comma parsing that allows denial of service
863
- - **CVE-2026-26960 (tar)** — Manually patched npm's bundled `tar` → `7.5.8` in Dockerfile to fix HIGH severity path traversal vulnerability (CVSS 7.1). Also updated npm override.
864
- - **HTTP Transport Hardening** — Comprehensive security improvements for HTTP mode:
865
- - **Configurable CORS** — New `--cors-origin` CLI flag and `MCP_CORS_ORIGIN` env var (default: `*`). Previously hardcoded `Access-Control-Allow-Origin: *`.
866
- - **Request Body Size Limit** — Added 1MB limit to `express.json()` to prevent memory exhaustion DoS attacks
867
- - **Security Headers** — Added `X-Content-Type-Options: nosniff` and `X-Frame-Options: DENY` on all HTTP responses
868
- - **Session Timeout** — Stateful HTTP sessions now expire after 30 minutes of inactivity (5-minute sweep interval). Prevents unbounded memory growth from abandoned sessions.
869
- - **Error Log Token Scrubbing** — Logger now automatically sanitizes `error` context fields to redact GitHub tokens (classic `ghp_`, fine-grained `github_pat_`), Bearer tokens, and Authorization headers before writing to stderr. New `sanitizeErrorForLogging()` in `security-utils.ts`.
870
- - **SECURITY.md Rewrite** — Complete rewrite for TypeScript era. Removed all outdated Python references. Added documentation for HTTP transport security (CORS, headers, session timeout, body limits), GitHub token handling, and CI/CD security pipeline.
871
- - **docker-compose.yml Rewrite** — Replaced Python-era configuration with TypeScript commands. Removed SSH/gitconfig root mounts, deprecated `version` key, and `PYTHONPATH`. Added HTTP transport service with resource limits and secure volume mount options.
872
- - **Dockerfile Version Label** — Updated hardcoded `4.0.0` → `4.3.1` to match actual package version
873
- - **Dockerfile Healthcheck** — Replaced no-op `console.log` healthcheck with `process.exit(0)` validation. Added documentation for HTTP-mode override using `curl`.
874
- - **Legacy Cleanup** — Removed leftover Python `__pycache__` directories from `src/` subtree
875
-
876
- ## [4.3.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.3.0...v4.3.1) - 2026-02-05
877
-
878
- ### Changed
879
-
880
- - **Dependency Updates**
881
- - `@modelcontextprotocol/sdk`: 1.25.3 → 1.26.0 (minor)
882
- - `@types/node`: 25.0.10 → 25.2.0 (minor)
883
- - `commander`: 14.0.2 → 14.0.3 (patch)
884
- - `globals`: 17.1.0 → 17.3.0 (minor)
885
-
886
- ### Fixed
887
-
888
- - **`get_cross_project_insights` Output Schema Validation** — Fixed empty result case returning incomplete object
889
- - When no projects met minimum entry threshold, handler returned only `message` and `projects`
890
- - Now returns all required fields: `project_count`, `total_entries`, `inactive_projects`, `time_distribution`
891
- - Fixes MCP outputSchema validation error when tool returns empty results
892
-
893
- ### Security
894
-
895
- - **CVE-2026-24515 (libexpat)** — Explicit libexpat install from Alpine edge fixes CRITICAL severity null pointer dereference vulnerability.
896
- - **CVE-2026-25210 (libexpat)** — Same patch fixes MEDIUM severity integer overflow information disclosure/data integrity issue.
897
- - **CVE-2026-23950 + CVE-2026-24842 (tar)** — Manually patched npm's bundled `tar` → `7.5.7` in Dockerfile to fix HIGH severity vulnerabilities (path traversal, CVSS 8.2). Also added npm override for project dependencies.
898
-
899
- ## [4.3.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.2.0...v4.3.0) - 2026-01-18
900
-
901
- ### Added
902
-
903
- - **Causal Relationship Types** — 3 new relationship types for decision tracing and failure analysis
904
- - `blocked_by`: Entry was blocked by another (e.g., blocker → resolution)
905
- - `resolved`: Entry resolved/fixed an issue from another
906
- - `caused`: Entry caused or led to another outcome
907
- - Distinct Mermaid arrow styles: `--x` for blocked_by, `==>` for resolved, `-.->` for caused
908
- - Updated Field Notes with guidance on when to use causal types
909
-
910
- - **Enhanced Analytics** — `get_statistics` now returns 4 additional metrics for deeper insights
911
- - `decisionDensity`: Significant entries per period (entries with `significanceType`)
912
- - `relationshipComplexity`: Total relationships / total entries average
913
- - `activityTrend`: Period-over-period growth percentage
914
- - `causalMetrics`: Counts for `blocked_by`, `resolved`, `caused` relationships
915
-
916
- - **Significance Gradients** — Computed `importance` scores (0.0-1.0) for entries
917
- - Formula weights: significance type (30%), relationship count (35%), causal relationships (20%), recency (15%)
918
- - `get_entry_by_id` now returns `importance` field
919
- - `memory://significant` resource sorts entries by importance (highest first)
920
-
921
- ### Fixed
922
-
923
- - **Docker Workflow Duplicate Builds** — Removed `push: tags: ['v*']` trigger that caused duplicate image sets when releasing versions
924
- - Docker builds now only trigger via `workflow_run` after "Lint and Test" passes
925
- - Version tags still applied based on `package.json` version
926
- - Removed obsolete `preflight-check` job
927
-
928
- ### Improved
929
-
930
- - **`memory://significant` Secondary Sort** — Entries with equal importance scores are now sorted by timestamp (newest first)
931
- - Previously, entries with identical importance could appear in non-deterministic order
932
- - Secondary sort ensures consistent, chronological ordering for ties
933
- - **`create_entry` Auto-populates `issueUrl`** — When creating an entry with `issue_number` but no `issueUrl`, the URL is now auto-constructed from cached repository info
934
- - Requires GitHub integration and prior `getRepoInfo()` call (happens naturally during briefing)
935
- - Eliminates need to manually provide `issueUrl` when linking to issues
936
- - **Harmonized Graph Arrow Styles** — `memory://graph/recent` now uses the same arrow mappings as `visualize_relationships` tool
937
- - Added causal relationship types: `blocked_by` (--x), `resolved` (==>), `caused` (-.->)
938
- - Added missing types: `clarifies` (-.->) and `response_to` (<-->)
939
- - Standardized `implements` to use `==>` (was `-.->`) for consistency
940
-
941
- ## [4.2.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.1.0...v4.2.0) - 2026-01-17
942
-
943
- ### Added
944
-
945
- - **HTTP/SSE Transport** — Run the server in HTTP mode for remote access and web-based clients
946
- - New `--transport http --port 3000` CLI options
947
- - `POST /mcp` — JSON-RPC requests (initialize, tools/call, resources/read, etc.)
948
- - `GET /mcp` — SSE stream for server-to-client notifications (supports resumability via `Last-Event-ID`)
949
- - `DELETE /mcp` — Session termination
950
- - **Stateful mode** (default): Session management via `mcp-session-id` header
951
- - **Stateless mode** (`--stateless`): No session management, ideal for serverless deployments
952
- - Trade-off: Progress notifications and SSE streaming unavailable in stateless mode
953
- - Uses MCP SDK's `StreamableHTTPServerTransport` with Express
954
- - New dependencies: `express@^5.1.0`, `@types/express` (devDependency)
955
- - **New Tool: `cleanup_backups`** — Automatic backup rotation to prune old backups
956
- - `keep_count` parameter specifies how many recent backups to retain (default: 5)
957
- - Returns list of deleted filenames and count of kept backups
958
- - Added to `backup` tool group in ToolFilter
959
- - **New Tool: `merge_tags`** — Tag normalization for consolidating similar tags
960
- - Merge duplicate/similar tags (e.g., `phase-2` → `phase2`)
961
- - Source tag is deleted after merge; target tag created if not exists
962
- - Updates all entry-tag links and usage counts
963
- - Added to `admin` tool group in ToolFilter
964
- - **Tool Count**: 31 → 33 tools (backup: 3 → 4, admin: 4 → 5)
965
-
966
- ### Improved
967
-
968
- - **`semantic_search` Hint Enhancement** — Improved feedback when no results found
969
- - Hint now includes the current `similarity_threshold` value (e.g., "0.3")
970
- - Suggests lowering threshold (e.g., "Try 0.2 for broader matches.")
971
- - Helps users understand why queries return empty and how to adjust
972
- - **`restore_backup` Enhanced Warning** — Improved feedback about reverted changes
973
- - Warning message now explicitly mentions tag merges, new entries, and relationships are reverted
974
- - New `revertedChanges` field in output with specific details about reverted data
975
- - `tagMerges` message now clarifies: "Previously merged tags will reappear as separate tags."
976
- - Added Field Note in `memory://instructions` documenting restore behavior
977
- - **`memory://prs/{pr_number}/timeline` Enhancement** — Live PR metadata from GitHub API
978
- - New `prMetadata` field with title, state, draft, mergedAt, closedAt, author, headBranch, baseBranch
979
- - New `timelineNote` field with human-readable PR status (e.g., "PR #67 is merged (merged)")
980
- - Differentiates timeline from simpler `memory://prs/{pr_number}/entries` resource
981
-
982
- ### Documentation
983
-
984
- - **`memory://tags` vs `list_tags` Schema** — Documented intentional difference between resource and tool output
985
- - Resource includes `id`, `name`, `count` (for reference/management use cases)
986
- - Tool returns only `name`, `count` (optimized for filtering/display)
987
- - Added to `ServerInstructions.ts` Field Notes section
988
- - **Tag Naming Conventions** — Added guidance for consistent tag naming patterns
989
- - Recommends lowercase with dashes (e.g., `bug-fix`, `phase-2`)
990
- - Documents `merge_tags` tool for consolidating duplicates
991
- - **`semantic_search` Threshold Guidance** — New Field Note documenting threshold recommendations
992
- - Default 0.3, broader matches at 0.2-0.25, strict matches at 0.4+
993
- - Added `similarity_threshold` to tool parameter reference table
994
-
995
- ### Changed
996
-
997
- - **`memory://instructions` Default Level** — Changed from `standard` to `full` so agents always receive complete tool parameter reference and field notes (~600 tokens)
998
- - **Briefing `clientNote`** — Simplified from "If prompts unavailable or Dynamic Context Management behaviors missing..." to clearer "For complete tool reference and field notes, read memory://instructions."
999
- - **Expanded StructuredContent Coverage** — 7 additional tools now return `structuredContent` with Zod validation
1000
- - `test_simple`, `export_entries`, `rebuild_vector_index`, `add_to_vector_index`
1001
- - `move_kanban_item`, `create_github_issue_with_entry`, `close_github_issue_with_entry`
1002
- - All 33 tools with response data now have formal output schemas
1003
-
1004
- ### Fixed
1005
-
1006
- - **CI Status "unknown" for Cancelled Workflows** — Fixed `memory://briefing` and `memory://github/status` reporting "unknown" when latest workflow was cancelled
1007
- - Added proper handling for `cancelled` conclusion alongside `success` and `failure`
1008
- - CI status type now includes `passing | failing | pending | cancelled | unknown`
1009
-
1010
- ## [4.1.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v4.0.0...v4.1.0) - 2026-01-17
1011
-
1012
- ### Added
1013
-
1014
- - **Auto-rebuild Vector Index on Startup** — New `--auto-rebuild-index` CLI flag and `AUTO_REBUILD_INDEX` env var
1015
- - When enabled, server rebuilds the vector index from all database entries during startup
1016
- - Ensures `memory://health` reports accurate `itemCount` matching `entryCount`
1017
- - Useful for deployments where the in-memory index needs to be synchronized after server restarts
1018
- - **`move_to_done` Option for `close_github_issue_with_entry`** — Automatically move Kanban item to "Done" when closing an issue
1019
- - New `move_to_done` boolean parameter (default: `false`)
1020
- - New `project_number` parameter (uses `DEFAULT_PROJECT_NUMBER` if not specified)
1021
- - Finds the issue on the Kanban board and moves it to the "Done" column
1022
- - Output includes `kanban` field with move result
1023
- - **`autoContext` Field Documentation** — Added "Field Notes" section to server instructions explaining the reserved field
1024
- - **MCP Progress Notifications** — Long-running operations now emit `notifications/progress` for improved user experience
1025
- - **`rebuild_vector_index`**: Reports progress every 10 entries with total count
1026
- - **`restore_backup`**: Reports 3-phase progress (backup → restore → verify)
1027
- - **`export_entries`**: Reports 2-phase progress (fetch → process)
1028
- - Requires client support for `progressToken` in request `_meta` (MCP 2025-11-25)
1029
- - New utility module: `src/utils/progress-utils.ts`
1030
- - **MCP Icons Array Support** — Tools, resources, and prompts now include optional `icons` for visual representation in MCP clients
1031
- - Follows MCP 2025-11-25 specification with `src`, `mimeType`, `sizes` properties
1032
- - **31 tools** with group-based icons (core, search, analytics, github, backup, etc.)
1033
- - **15 resources** with context-appropriate icons (briefing, recent, graph, health, github, etc.)
1034
- - **15 prompts** with message bubble icon
1035
- - Uses SVG data URIs for self-contained distribution (no external dependencies)
1036
- - New type: `McpIcon` in `src/types/index.ts`
1037
- - New module: `src/constants/icons.ts` with centralized icon definitions
1038
- - **Expanded StructuredContent Coverage** — Extended Zod output schemas from 5 to 24 tools
1039
- - **17 new output schemas** defined in `src/handlers/tools/index.ts`
1040
- - **Phase 1 (Core Read)**: `SemanticSearchOutputSchema`, `TagsListOutputSchema`, `VectorStatsOutputSchema`, `VisualizationOutputSchema`, `CrossProjectInsightsOutputSchema`
1041
- - **Phase 2 (Mutations)**: `CreateEntryOutputSchema`, `UpdateEntryOutputSchema`, `DeleteEntryOutputSchema`, `LinkEntriesOutputSchema`
1042
- - **Phase 3 (GitHub)**: `GitHubIssuesListOutputSchema`, `GitHubIssueResultOutputSchema`, `GitHubPRsListOutputSchema`, `GitHubPRResultOutputSchema`, `GitHubContextOutputSchema`, `KanbanBoardOutputSchema`
1043
- - **Phase 4 (Backup)**: `BackupResultOutputSchema`, `BackupsListOutputSchema`, `RestoreResultOutputSchema`
1044
- - Clients supporting `structuredContent` receive validated JSON for programmatic consumption
1045
- - **`semantic_search` Hint Control** — New `hint_on_empty` parameter (default: `true`) to control hint display
1046
- - When `false`, suppresses hints about empty results or index status
1047
- - Useful for programmatic consumers that handle empty results differently
1048
- - **PR Resource Empty Hints** — `memory://prs/{pr_number}/entries` and `memory://prs/{pr_number}/timeline` now include a `hint` field when no entries are linked
1049
- - Hint: "No journal entries linked to this PR. Use create_entry with pr_number to link entries."
1050
-
1051
- ### Documentation
1052
-
1053
- - **GitHub Fallback Behavior** — Documented in both `README.md` and `DOCKER_README.md`
1054
- - Explains what happens when GitHub tools cannot auto-detect repository information
1055
- - Shows example `requiresUserInput: true` response when `owner` and `repo` parameters are needed
1056
-
1057
- ### Known Limitations
1058
-
1059
- - **Icons not visible in protocol output** — MCP SDK v1.25.2 has `icons` in type definitions but `registerTool()`, `registerResource()`, and `registerPrompt()` don't pass icons through to protocol responses. Server-side implementation is correct and future-ready; will work when SDK adds proper passthrough.
1060
-
1061
- ### Fixed
1062
-
1063
- - **`list_tags` Output Schema Validation** — Fixed tool returning `usageCount` instead of `count` required by `TagsListOutputSchema`
1064
- - Handler now maps database `usageCount` field to schema-expected `count` field
1065
- - Fixes "expected number for tags[*].count, received undefined" validation error
1066
- - **`semantic_search` Misleading Hint** — Fixed hint always showing "No entries in vector index" even when index had items
1067
- - Now checks actual index stats to determine if index is truly empty
1068
- - Shows appropriate hint: "No entries matched your query above the similarity threshold" when items exist but don't match
1069
- - **`getRecentEntries` Deterministic Ordering** — Added secondary sort by ID for consistent results
1070
- - Entries with identical timestamps now sorted by `id DESC` for deterministic ordering
1071
- - Prevents non-reproducible results when entries share timestamps
1072
- - **GHSA-73rr-hh4g-fpgx (diff DoS)** — Manually patched npm's bundled `diff@8.0.2` → `8.0.3` in Dockerfile
1073
- - npm team hasn't released fix yet, so we patch it directly via `npm pack` + replace
1074
- - **CVE-2026-23745 (tar)** — Manually patched npm's bundled `tar@7.5.2` → `7.5.3` in Dockerfile
1075
- - Addresses high-severity vulnerability (CVSS 8.2) in npm's bundled tar package
1076
- - **`memory://health` Vector Index Field Name** — Aligned `indexedEntries` → `itemCount` for consistency with `get_vector_index_stats` tool
1077
- - **`memory://tags` Field Naming** — Mapped `usageCount` → `count` for consistency with `list_tags` tool output
1078
- - **`create_github_issue_with_entry` Default Status** — Issues added to projects now default to "Backlog" column when `initial_status` is not specified
1079
- - **`delete_entry` Vector Index Cleanup** — Deleting entries now removes them from the vector index, preventing orphaned index entries and `itemCount` discrepancy between vector index and database
1080
- - **`memory://instructions` Query Parameter Documentation** — Removed misleading description about query parameter support (`?level=essential|standard|full`) since MCP SDK performs exact URI matching at the SDK level before invoking handlers
1081
- - **Docker Security Gate** — Restructured workflow to scan BEFORE push:
1082
- - `security-scan` now runs FIRST (before any images are pushed)
1083
- - `build-platform` only runs after security scan passes
1084
- - Uses `--only-fixed` to block only on fixable CVEs
1085
- - Unfixable upstream CVEs (Alpine zlib, busybox) do not block deploys
1086
- - **Docker Build Optimization** — Comprehensive `.dockerignore` rewrite reducing build context by ~200MB:
1087
- - Added `node_modules/` (~195MB) — reinstalled in builder stage
1088
- - Added `mcp-publisher.exe` (6.3MB) — local publishing tool
1089
- - Added dev tooling files (`.prettierrc`, `eslint.config.js`, etc.)
1090
- - Added `releases/` directory and security scanning configs
1091
- - Organized into logical sections with clear documentation
1092
-
1093
- ## [4.0.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.5...v4.0.0) - 2026-01-16
1094
-
1095
- ### Added
1096
-
1097
- - **GitHub Issue Lifecycle Tools** — Integrated issue management with automatic journal entries
1098
- - **`create_github_issue_with_entry`**: Creates GitHub issue AND linked journal entry
1099
- - **New**: `initial_status` parameter to set Kanban column (e.g., "Backlog", "Ready")
1100
- - **`close_github_issue_with_entry`**: Closes issue AND creates resolution entry with significance
1101
- - Auto-detects owner/repo from git context
1102
- - Custom entry content optional with sensible auto-generated defaults
1103
- - **New `GitHubIntegration` Methods**: `createIssue()`, `closeIssue()` for Octokit operations
1104
- - **Tool Count**: 29 → 31 tools (github group: 7 → 9)
1105
- - **New Prompt: `confirm-briefing`** — Session context acknowledgment for users
1106
- - Generates formatted acknowledgment message showing what context the agent received
1107
- - Displays journal stats, latest entries preview, and behavioral guidance
1108
- - Helps users understand what context the AI agent has before continuing
1109
- - **Briefing Resource Enhancement** — `memory://briefing` now includes:
1110
- - `userMessage`: Pre-formatted context summary for agents to show users
1111
- - `autoRead` and `sessionInit` annotations: Hints for clients that support auto-subscribe behavior
1112
- - `templateResources`: Array of 6 template resource URIs (projects, issues, PRs, kanban) for full discoverability
1113
- - Enhanced description: "AUTO-READ AT SESSION START" for discoverability
1114
- - `clientNote`: Pointer to `memory://instructions` for clients that don't auto-inject ServerInstructions
1115
- - **New `memory://instructions` Resource** — Universal access to full server behavioral guidance
1116
- - Exposes the same instructions that `ServerInstructions.ts` provides to auto-inject clients
1117
- - Enables AntiGravity and other clients to access Dynamic Context Management patterns
1118
- - Resource count: 17 → 18 resources (12 static + 6 template)
1119
- - **structuredContent Text Fallback** — Tools with `outputSchema` now return both:
1120
- - `structuredContent`: Validated JSON for clients that support it (Cursor, Claude Desktop)
1121
- - `content`: Formatted JSON text for clients that don't (AntiGravity)
1122
- - Fixes "tool call completed" display issue in AntiGravity for 5 tools
1123
- - **Session Start Guidance** — Enhanced `ServerInstructions.ts` with acknowledgment step
1124
- - Step 1: Read `memory://briefing` for project context
1125
- - Step 2: **Show the `userMessage` to the user**
1126
- - Step 3: Proceed with user's request
1127
- - **Prompt Count** — 14 → 15 prompts (added `confirm-briefing`)
1128
- - **MCP 2025-11-25 Resource Annotations** — Added `lastModified` (ISO 8601 timestamp) to key dynamic resources
1129
- - Compact behavioral guidance (when to create/search entries)
1130
- - Latest 3 entries preview with truncated content
1131
- - GitHub status summary (repo, branch, CI, open issues/PRs)
1132
- - Quick access links to related resources
1133
- - Priority 1.0 (highest) — designed to be read first at session start
1134
- - Optimized for clients that don't auto-inject server instructions (Antigravity, VSCode, etc.)
1135
- - **MCP 2025-11-25 Tool `outputSchema`** — Structured output validation for high-value tools
1136
- - Tools return `structuredContent` (validated against schema) instead of raw text `content`
1137
- - **5 tools with `outputSchema`**: `get_recent_entries`, `search_entries`, `search_by_date_range`, `get_entry_by_id`, `get_statistics`
1138
- - New Zod schemas: `EntryOutputSchema`, `EntriesListOutputSchema`, `RelationshipOutputSchema`, `EntryByIdOutputSchema`, `StatisticsOutputSchema`
1139
- - SDK validates output at runtime — ensures response matches declared schema
1140
-
1141
- ### Changed
1142
-
1143
- - **Resource Handler Architecture** — Added `ResourceResult` interface for typed resource responses with annotations
1144
- - Handlers can now return `{ data, annotations: { lastModified } }` structure
1145
- - Backward compatible: existing handlers returning raw data still work
1146
- - **Confirmed OpenWorldHint Compliance** — All 7 GitHub tools already have `openWorldHint: true` annotation
1147
- - **Tiered Server Instructions** — `generateInstructions()` now supports `level` parameter
1148
- - `essential` (~200 tokens): Core behavioral guidance only
1149
- - `standard` (~400 tokens): + GitHub integration patterns (default)
1150
- - `full` (~600 tokens): + tool/resource/prompt listings
1151
- - **Resource Count** — 16 → 17 → 18 resources (added `memory://briefing`, then `memory://instructions`)
1152
- - **Node.js 24 LTS Engines Alignment** — Updated `package.json` engines field to match Dockerfile baseline
1153
- - `engines.node`: >=18.0.0 → >=24.0.0 (Dockerfile already using `node:24-alpine`)
1154
- - **Enhanced AI Agent Behavioral Guidance** — Added new `Behavioral Guidance` section to `ServerInstructions.ts`
1155
- - **When to Query Project Context** — Encourages agents to fetch `memory://recent` or use `semantic_search` at conversation start; includes time awareness via `memory://health`
1156
- - **When to Create Entries** — Clear triggers for documenting implementations, decisions, bug fixes, and milestones
1157
- - **Building the Knowledge Graph** — Guidance on using `link_entries` to connect related work
1158
- - **GitHub Integration Workflows** — Guidance on linking entries to Issues/PRs, documenting GitHub activity, and Kanban patterns
1159
- - **Initial Context Strategy** — Guidance on dynamically choosing context based on user prompt
1160
- - **Initial Briefing Optimization** — Server instructions now include latest entry snapshot for immediate context
1161
- - **New `memory://github/status` Resource** — Compact GitHub overview with progressive disclosure (CI status, commit SHA, issue/PR numbers, Kanban summary)
1162
- - **Optimized `get-context-bundle` Prompt** — Now uses compact entry summaries (~85% token reduction) instead of full content
1163
- - **ServerInstructions Token Optimization** — Reduced BASE_INSTRUCTIONS by ~53% (207→97 lines) with client-agnostic server naming
1164
- - **Dynamic Context Management Documentation** — Promoted new feature in README.md and DOCKER_README.md Key Benefits
1165
- - **Wiki Documentation Updates** — Added Dynamic Context Management to Home.md, Quick-Start.md, Architecture.md, Tools.md, Installation.md
1166
- - **Client Compatibility Notes** — Documented AntiGravity IDE limitations in README.md, DOCKER_README.md, and Installation.md
1167
- - ServerInstructions not injected: AntiGravity does not call `getServerInstructions()`
1168
- - Resource hints not honored: `autoRead`/`sessionInit` annotations ignored
1169
- - Workaround: Manual briefing read or user rules
1170
- - **Dependency Updates**
1171
- - `@types/node`: 25.0.8 → 25.0.9
1172
- - `vectra`: 0.11.1 → 0.12.3 (unpinned, packaging bug fixed)
1173
-
1174
- ### Documentation
1175
-
1176
- - **GitHub Management Capabilities** — Added hybrid workflow documentation explaining MCP + gh CLI approach
1177
- - New section in `README.md` and `DOCKER_README.md` with capability matrix
1178
- - Enhanced `Git-Integration.md` wiki page with comprehensive capability table
1179
- - Includes example issue lifecycle workflow demonstrating journal linking with gh CLI operations
1180
-
1181
- ### Fixed
1182
-
1183
- - **Trivy Security Scan Workflow** — Fixed workflow that hadn't run since September 2025
1184
- - Updated `aquasecurity/trivy-action` from unstable `@master` to stable `@0.33.1`
1185
- - Added `push` trigger on `main` branch for Dockerfile/package changes to ensure regular scans
1186
- - Added `pull_request` trigger for security validation before merging
1187
- - **Dependabot Label Configuration** — Created missing `npm` label in GitHub repository. Dependabot requires labels to exist before it can apply them to pull requests.
1188
- - **Vectra Type Definitions** — Now unpinned in v3.1.6. Previously pinned to v0.11.1 due to a packaging bug in v0.12.x where TypeScript type definitions (`.d.ts` files) were not included in the published npm package.
1189
- - **Docker Latest Tag** — Fixed `latest` tag not being applied on `workflow_run` triggered builds. Two issues were fixed: (1) The `{{is_default_branch}}` template doesn't evaluate correctly for `workflow_run` events - replaced with explicit branch detection. (2) The `security-scan` and `merge-and-push` jobs were being skipped due to cascading skip behavior from the skipped `preflight-check` job - added `always()` with explicit success checks for direct dependencies.
1190
- - **Semantic Search Timing** — Fixed race condition where search returned 0 results immediately after rebuild. Previous attempt using 100ms delay was insufficient; now using explicit index synchronization to ensure vectra's internal state is refreshed.
1191
- - **Auto-Indexing** — Fixed missing auto-indexing for `create_entry`, `create_entry_minimal`, and `update_entry` tools. New and updated entries are now immediately available for semantic search without requiring a full index rebuild.
1192
- - **CI Status Discrepancy** — Aligned `memory://github/status` logic with `memory://briefing` to use the latest _completed_ run for status determination. Previous logic incorrectly reported "failing" if _any_ of the last 5 runs failed, causing confusion when the latest run was passing.
1193
- - **GitHub Actions Resource** — `memory://actions/recent` now fetches live workflow runs from GitHub API and presents them as virtual journal entries, aligning with the graph view.
1194
- - **Project Board Automation** — `create_github_issue_with_entry` now accepts `project_number` to automatically add the created issue to a GitHub Project v2 Kanban board.
1195
- - **Search Filter Accuracy** — Fixed `search_entries` ignoring filters when `query` is empty. Now correctly filters by `issue_number`, `pr_number`, etc.
1196
- - **Default Project Number** — Added `--default-project` CLI option and `DEFAULT_PROJECT_NUMBER` environment variable to auto-add issues to a specific project if no `project_number` is provided.
1197
- - **Documentation Updates** — Updated README and DOCKER_README to document default project configuration and correct `mcp-config-example.json`.
1198
- - **`export_entries` Limit Parameter** — Added missing `limit` parameter to `export_entries` tool. Previously always exported 100 entries; now respects the `limit` parameter (default: 100).
1199
- - **`get_statistics` GroupBy Visibility** — Added `groupBy` field to statistics output so callers can verify which grouping was applied.
1200
- - **Entry Output Schema Completeness** — Added missing GitHub metadata fields to `EntryOutputSchema`: `projectOwner`, `issueUrl`, `prUrl`, `prStatus`, `workflowName`, `workflowStatus`.
1201
- - **Vector Index Stats Inconsistency** — Fixed `memory://health` reporting 0 indexed entries after `rebuild_vector_index`. Changed `getStats()` to use vectra's `getIndexStats()` API which explicitly loads from disk for authoritative stats.
1202
-
1203
- ### Documentation
1204
-
1205
- - **GitHub Management Capabilities** — Added hybrid workflow documentation explaining MCP + gh CLI approach
1206
- - New section in `README.md` and `DOCKER_README.md` with capability matrix
1207
- - Enhanced `Git-Integration.md` wiki page with comprehensive capability table
1208
- - Includes example issue lifecycle workflow demonstrating journal linking with gh CLI operations
1209
- - **`get_github_context` Clarification** — Updated description to clarify it only returns **open** items (closed items excluded).
1210
- - **`move_kanban_item` Case Sensitivity** — Documented that status matching is case-insensitive and to use exact status names from `get_kanban_board`.
1211
- - **Virtual Entry IDs** — Documented in Resources.md that `memory://actions/recent` returns virtual entries with negative IDs (negated workflow run IDs) to distinguish from database entries.
1212
- - **Resource Annotations Note** — Added note in Resources.md that MCP 2025-11-25 annotations (e.g., `lastModified`) may not be visible in all clients due to SDK/client limitations.
1213
-
1214
- ## [3.1.5](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.4...v3.1.5) - 2026-01-11
1215
-
1216
- ### Security
1217
-
1218
- - **Remove protobufjs CLI** — Eliminates CVE-2019-10790 (taffydb), CVE-2025-54798 (tmp), CVE-2025-5889 (brace-expansion). CLI folder not needed at runtime.
1219
-
1220
- ## [3.1.4](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.3...v3.1.4) - 2026-01-11
1221
-
1222
- ### Fixed
1223
-
1224
- - **Docker npm Upgrade** — Added `npm install -g npm@latest` to production stage (was only in builder stage). Fixes CVE-2025-64756 (glob) and CVE-2025-64118 (tar) in final Docker image.
1225
-
1226
- ## [3.1.3](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.2...v3.1.3) - 2026-01-11
1227
-
1228
- ### Security
1229
-
1230
- - **Docker CVE Fixes** — Active remediation for 7 CVEs:
1231
- - npm global upgrade fixes CVE-2025-64756 (glob) and CVE-2025-64118 (tar)
1232
- - Alpine edge for curl fixes CVE-2025-14524, CVE-2025-14819, CVE-2025-14017
1233
- - protobufjs cli cleanup fixes CVE-2025-54798 (tmp) and CVE-2025-5889 (brace-expansion)
1234
- - **Reduced CVE Allowlist** — Only truly unfixable CVEs remain (zlib with no upstream fix, taffydb unmaintained)
1235
-
1236
- ## [3.1.2](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.1...v3.1.2) - 2026-01-11
1237
-
1238
- ### Fixed
1239
-
1240
- - **CI Build Pipeline** — Added `.npmrc` with `legacy-peer-deps=true` to resolve `npm ci` failures from optional peer dependency conflicts (vectra's zod@^3.23.8 vs zod@^4.x)
1241
- - **Docker Workflow Gating** — Added `preflight-check` job to docker-publish.yml; tag pushes now run lint/typecheck/build before Docker deployment
1242
-
1243
- ## [3.1.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.1.0...v3.1.1) - 2026-01-11
1244
-
1245
- ### Security
1246
-
1247
- - **Docker Image Security** — Added `apk upgrade --no-cache` to builder stage for latest security patches
1248
- - Fixes CVE-2026-22184 (zlib critical)
1249
- - Fixes CVE-2025-14524, CVE-2025-14819, CVE-2025-14017 (curl)
1250
- - **NPM Dependency Override** — Added `glob@^11.1.0` override to fix CVE-2025-64756 (ReDoS)
1251
-
1252
- ### Fixed
1253
-
1254
- - **CI Build** — Regenerated `package-lock.json` to fix lock file desync with MCP SDK peer dependencies
1255
-
1256
- ## [3.1.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v3.0.0...v3.1.0) - 2026-01-11
1257
-
1258
- ### Added
1259
-
1260
- - **GitHub Projects v2 Kanban Support** — View and manage GitHub Project boards directly from AI agents
1261
- - **New Tool: `get_kanban_board`** — Fetch project items grouped by Status columns (Backlog, Ready, In progress, In review, Done)
1262
- - **New Tool: `move_kanban_item`** — Move items between status columns using GraphQL mutations
1263
- - **New Resource: `memory://kanban/{project_number}`** — JSON board data with items grouped by status
1264
- - **New Resource: `memory://kanban/{project_number}/diagram`** — Mermaid visualization of Kanban board
1265
- - **Multi-level project discovery** — Searches user → repository → organization level projects automatically
1266
- - **Dynamic status columns** — Supports any Status field configuration per project
1267
- - **Server Instructions** — Usage instructions are now automatically provided to AI agents via the MCP protocol's `instructions` capability during server initialization. See [`src/constants/ServerInstructions.ts`](https://github.com/neverinfamous/memory-journal-mcp/blob/main/src/constants/ServerInstructions.ts).
1268
- - **Comprehensive AI Agent Instructions** — Rewritten `ServerInstructions.ts` with:
1269
- - Explicit MCP access patterns (`CallMcpTool`, `ListMcpResources`, `FetchMcpResource`)
1270
- - Tool parameter reference tables for all 29 tools
1271
- - Default GitHub Projects v2 status column documentation
1272
- - Guidance for finding correct project by `projectTitle`
1273
-
1274
- ### Fixed
1275
-
1276
- - **Dependabot Configuration** — Migrated from deprecated `pip` ecosystem to `npm` ecosystem
1277
- - **Root Cause**: The v3.0.0 TypeScript rewrite removed all Python dependency files, but Dependabot was still configured for `pip`
1278
- - **Symptom**: Dependabot security scans failed with `dependency_file_not_found: / not found`
1279
- - **Resolution**: Replaced `pip` ecosystem with `npm` ecosystem and updated dependency groups to match TypeScript/Node.js packages (MCP SDK, Zod, sql.js, vectra, build tools, linting)
1280
-
1281
- ### Changed
1282
-
1283
- - **Docker Base Image** — Upgraded from `node:22-alpine` to `node:24-alpine` (Active LTS)
1284
- - Node.js 24 is the current Active LTS release (support through April 2028)
1285
- - Node.js 25 was skipped as it's a non-LTS "Current" release (EOL June 2026)
1286
- - **Dependency Updates**
1287
- - `@modelcontextprotocol/sdk` 1.25.1 → 1.25.2 (patch)
1288
- - `@octokit/rest` 21.1.1 → 22.0.1 (major)
1289
- - `globals` 16.5.0 → 17.0.0 (major)
1290
- - `typescript-eslint` 8.50.1 → 8.52.0 (minor)
1291
- - `vectra` 0.9.0 → 0.11.1 (minor) — Updated `queryItems` call to new API signature with BM25 hybrid search support
1292
- - `zod` 4.2.1 → 4.3.5 (minor)
1293
-
1294
- ## [3.0.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v2.2.0...v3.0.0) - 2025-12-28
1295
-
1296
- ### 🎉 Complete TypeScript Rewrite
1297
-
1298
- This release is a **complete ground-up rewrite in TypeScript**, delivering a pure JavaScript stack with zero native dependencies. The Python codebase is deprecated and archived in `archive/python-v2`.
1299
-
1300
- ### Added - Backup & Restore Tools
1301
-
1302
- - **New Tool Group: `backup`** - Never lose your journal data again
1303
- - `backup_journal` - Create timestamped database backups with custom naming
1304
- - `list_backups` - List all available backup files with metadata
1305
- - `restore_backup` - Restore from any backup (auto-creates safety backup before restore)
1306
-
1307
- ### Added - Server Health Resource
1308
-
1309
- - **New Resource: `memory://health`** - Comprehensive server diagnostics
1310
- - Database stats: path, size, entry count, relationship count, tag count
1311
- - Backup info: directory, count, last backup details
1312
- - Vector index: availability, indexed entries, model name
1313
- - Tool filter: active status, enabled/total counts
1314
-
1315
- ### Added - Tool Annotations (MCP 2025-11-25)
1316
-
1317
- - All **29 tools** now include behavioral hints for AI safety:
1318
- - `readOnlyHint` - Indicates read-only operations
1319
- - `destructiveHint` - Warns of data modification
1320
- - `idempotentHint` - Safe to retry
1321
- - `openWorldHint` - External service calls (GitHub)
1322
-
1323
- ### Added - Dynamic Structured Logging
1324
-
1325
- - **RFC 5424 severity levels** - emergency, alert, critical, error, warning, notice, info, debug
1326
- - **Module-prefixed codes** - Operation-specific like `DB_CONNECT`, `VECTOR_SEARCH`
1327
- - **Centralized logger** - All output to stderr (stdout reserved for MCP protocol)
1328
- - **Debug mode** - Enable with `DEBUG=true` environment variable
1329
-
1330
- ### Changed - Technology Stack
1331
-
1332
- - **Language**: Python → TypeScript (Node.js 18+)
1333
- - **Database**: Python sqlite3 → sql.js (pure JavaScript)
1334
- - **Vector Search**: FAISS + sentence-transformers → vectra + @xenova/transformers
1335
- - **Distribution**: PyPI → npm
1336
- - **Installation**: `pip install memory-journal-mcp` → `npm install -g memory-journal-mcp`
1337
-
1338
- ### Changed - CI/CD Modernization
1339
-
1340
- - **Native ARM64 Builds** - No more slow QEMU emulation
1341
- - **NPM Publishing** - Replaces PyPI distribution
1342
- - **CodeQL Analysis** - JavaScript/TypeScript static security analysis
1343
- - **Docker Scout** - Container vulnerability scanning with blocking gates
1344
- - **Dependabot Auto-Merge** - Automatic patch/minor updates
1345
-
1346
- ### Capabilities Summary
1347
-
1348
- | Category | Count | Notes |
1349
- | --------------- | ----- | ---------------------------------------------------------------------- |
1350
- | **Tools** | 29 | +2 Kanban tools (get_kanban_board, move_kanban_item) |
1351
- | **Tool Groups** | 8 | core, search, analytics, relationships, export, admin, github, backup |
1352
- | **Prompts** | 14 | Unchanged from v2.x |
1353
- | **Resources** | 16 | +2 Kanban resources (memory://kanban/{n}, memory://kanban/{n}/diagram) |
1354
-
1355
- ### Migration from v2.x
1356
-
1357
- **Breaking change:** Installation now via npm:
1358
-
1359
- ```bash
1360
- # Old (Python)
1361
- pip install memory-journal-mcp
1362
-
1363
- # New (TypeScript)
1364
- npm install -g memory-journal-mcp
1365
- ```
1366
-
1367
- **Database compatibility:** ✅ Existing databases work without migration!
1368
-
1369
- ### Security
1370
-
1371
- - **Input validation** - Zod schemas for all tool parameters
1372
- - **Path traversal protection** - Backup filename validation
1373
- - **SQL injection prevention** - Parameterized queries throughout
1374
- - **Content size limits** - Configurable per field
1375
-
1376
- ## [2.2.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v2.1.0...v2.2.0) - 2025-12-08
1377
-
1378
- ### Added - Tool Filtering for Token Efficiency
1379
-
1380
- - **Tool Filtering** - Selectively enable/disable tools via `MEMORY_JOURNAL_MCP_TOOL_FILTER` environment variable
1381
- - **Up to 69% token reduction** - Disable unused tools to save context window space
1382
- - **7 tool groups**: `core` (5), `search` (2), `analytics` (2), `relationships` (2), `export` (1), `admin` (2), `test` (2)
1383
- - **Filter syntax**: `-group` to disable group, `-tool` to disable specific tool, `+tool` to re-enable
1384
- - **Left-to-right processing**: Rules applied in order for precise control
1385
- - **Useful for MCP clients with tool limits** (e.g., Windsurf's 100-tool limit)
1386
- - **Default behavior**: All 16 tools enabled (backward compatible)
1387
- - **Token savings by configuration**:
1388
- - Production (`-test`): ~12% reduction (14 tools)
1389
- - Read-only (`-admin`): ~15% reduction (14 tools)
1390
- - Lightweight (core only): **~69% reduction** (5 tools)
1391
- - **New module**: `src/tool_filtering.py` with complete filtering logic
1392
- - **Comprehensive tests**: `tests/test_tool_filtering.py` with 100% coverage
1393
- - **Documentation**: New wiki page [Tool-Filtering](Tool-Filtering) with detailed examples
1394
-
1395
- ### Improved - Dark Mode Visualization
1396
-
1397
- - **Actions Visual Graph** (`memory://graph/actions`) - Improved color scheme for dark mode readability
1398
- - Medium-saturated fill colors with better contrast
1399
- - Black text on colored backgrounds for legibility
1400
- - Darker stroke/border colors for node definition
1401
- - Compact class-based Mermaid styling for smaller output
1402
- - Streamlined footer (single line vs multi-line legend)
1403
-
1404
- ### Changed
1405
-
1406
- - **Server integration** - `handle_list_tools()` and `handle_call_tool()` now respect filtering configuration
1407
- - **Error handling** - Disabled tools return clear error message when called
1408
- - **Constants** - Actions graph colors moved to `src/constants.py` for easy customization
1409
-
1410
- ### Documentation
1411
-
1412
- - Updated [README.md](https://github.com/neverinfamous/memory-journal-mcp#tool-filtering-optional) with tool filtering section and token savings
1413
- - Updated [DOCKER_README.md](https://github.com/neverinfamous/memory-journal-mcp/blob/main/DOCKER_README.md#tool-filtering) with Docker-specific examples
1414
- - Updated `mcp-config-example.json` with environment variable example
1415
- - New wiki page: [Tool-Filtering.md](Tool-Filtering) with comprehensive guide
1416
-
1417
- ### Technical Details
1418
-
1419
- - **Environment variable**: `MEMORY_JOURNAL_MCP_TOOL_FILTER` - comma-separated filter rules
1420
- - **Caching**: Uses `@lru_cache(maxsize=1)` for performance
1421
- - **Logging**: Info/warning messages logged to stderr for debugging
1422
- - **Type safety**: Maintains Pyright strict compliance
1423
-
1424
- ## [2.1.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v2.0.1...v2.1.0) - 2025-11-26
1425
-
1426
- ### Added - Actions Visual Graph Resource
1427
-
1428
- - **New Resource: `memory://graph/actions`** - CI/CD narrative visualization
1429
- - Generates Mermaid diagrams showing workflow runs, failures, investigation entries, and deployments
1430
- - **Narrative flow**: `Commit → Workflow Run → Failure → Investigation Entry → Fix Commit → Success → Deployment`
1431
- - **Node types**: Commits (hexagon), PRs (stadium), Workflow runs (rectangle), Failed jobs (parallelogram), Journal entries, Deployments
1432
- - **Query parameters**: `?branch=X&workflow=Y&limit=15` for filtering
1433
- - Identifies "fix patterns" - when failed workflows are followed by successful ones
1434
- - Links journal entries to workflow run investigations
1435
- - Color-coded styling: green (success), red (failure), yellow (pending), blue (entries)
1436
-
1437
- ### Fixed - Pyright Strict Type Compliance
1438
-
1439
- - **700+ type issues fixed** - Complete Pyright strict mode compliance achieved
1440
- - **All exclusions removed** from `pyrightconfig.json`:
1441
- - Removed `reportMissingTypeStubs` exclusion
1442
- - Removed `reportUnknownVariableType` exclusion
1443
- - Removed `reportUnknownMemberType` exclusion
1444
- - Removed `reportUnknownArgumentType` exclusion
1445
- - Removed `reportUnknownParameterType` exclusion
1446
- - Removed `reportUnknownLambdaType` exclusion
1447
- - **Type safety badge now accurate** - `[![Type Safety](https://img.shields.io/badge/Pyright-Strict-blue.svg)]` reflects true strict compliance
1448
- - All `Any` types replaced with proper TypedDicts and explicit annotations
1449
- - Improved code maintainability and IDE support through complete type coverage
1450
-
1451
- ### Added - GitHub Actions Failure Summarizer Prompt
1452
-
1453
- - **New Prompt: `actions-failure-digest`** - Comprehensive GitHub Actions failure analysis
1454
- - Generates digest of recent CI/CD failures with root cause analysis
1455
- - **Failing Jobs Summary** - Lists failed workflows, jobs, and specific failed steps
1456
- - **Linked Journal Entries** - Finds entries connected to affected commits/PRs
1457
- - **Recent Code/PR Changes** - Context from current branch and associated PRs
1458
- - **Previous Similar Failures** - Semantic search for recurring patterns
1459
- - **Possible Root Causes** - AI-assisted analysis of failure patterns
1460
- - **Next Steps** - Actionable recommendations for resolution
1461
- - Optional filters: `branch`, `workflow_name`, `pr_number`, `days_back`, `limit`
1462
- - Leverages existing semantic search, clustering, and relationship enumeration
1463
- - **New API Helper Function**: `get_workflow_run_jobs()` - Fetch job-level details for workflow runs
1464
- - **New API Helper Function**: `get_failed_workflow_runs()` - Convenience function for fetching recent failures
1465
-
1466
- ### Added - GitHub Actions Resources
1467
-
1468
- - **4 New MCP Resources for CI/CD Visibility** - Expose GitHub Actions as first-class resources
1469
- - `memory://actions/recent` - Recent workflow runs with filtering (JSON)
1470
- - Query params: `?branch=X&workflow=Y&commit=SHA&pr=N&limit=10`
1471
- - Returns: CI status, run list, related journal entries
1472
- - `memory://actions/workflows/{workflow_name}/timeline` - Workflow-specific timeline (Markdown)
1473
- - Blends: workflow runs, journal entries, PR events
1474
- - `memory://actions/branches/{branch}/timeline` - Branch CI timeline (Markdown)
1475
- - Blends: workflow runs, journal entries, PR lifecycle events
1476
- - `memory://actions/commits/{sha}/timeline` - Commit-specific timeline (Markdown)
1477
- - Blends: workflow runs for commit, related journal entries
1478
- - **New API Helper Functions** (in `src/github/api.py`):
1479
- - `get_workflow_runs_by_name()` - Filter runs by workflow name (case-insensitive)
1480
- - `get_unique_workflow_names()` - Extract unique workflow names from recent runs
1481
- - **Enhanced Resource URI Parsing** - Support for query parameters and new action patterns
1482
-
1483
- ### Added - GitHub Actions Integration (Phase 1)
1484
-
1485
- - **GitHub Actions Workflow Runs Support** - Foundation layer for CI/CD integration
1486
- - Link journal entries to workflow runs via `workflow_run_id`, `workflow_name`, `workflow_status` parameters
1487
- - Automatic CI status detection in context bundle (`passing`, `failing`, `pending`, `unknown`)
1488
- - Search and filter entries by workflow run ID
1489
- - Database migration adds `workflow_run_id`, `workflow_name`, `workflow_status` columns with index
1490
- - **Enhanced Context Capture** - Project context now includes:
1491
- - Up to 5 recent workflow runs for current branch
1492
- - Overall CI status computed from latest workflow runs
1493
- - Automatic caching (5 min TTL) for workflow run data
1494
- - **New API Functions** (in `src/github/api.py`):
1495
- - `get_repo_workflow_runs()` - Fetch workflow runs with caching, branch/status filters
1496
- - `get_workflow_run_details()` - Get detailed workflow run information
1497
- - `get_workflow_runs_for_commit()` - Find runs for a specific commit SHA
1498
- - `get_workflow_runs_for_pr()` - Find runs associated with a PR
1499
- - `compute_ci_status()` - Compute overall CI status from workflow runs
1500
- - All functions include `gh` CLI fallbacks
1501
- - **Enhanced Search Capabilities**
1502
- - `search_entries` tool: New filter for `workflow_run_id`
1503
- - `search_by_date_range` tool: New filter for `workflow_run_id`
1504
- - Find all journal entries related to specific workflow runs
1505
- - **Enhanced Entry Display**
1506
- - `get_entry_by_id` now shows linked workflow runs with name and status
1507
- - Entry creation confirms workflow linkage (e.g., "Linked to: Workflow Run #12345 (CI Tests) [completed]")
1508
- - **New TypedDict Model**: `GitHubWorkflowRunDict` for type-safe workflow run data
1509
-
1510
- ### Added - GitHub Issues & Pull Requests Integration
1511
-
1512
- - **GitHub Issues Support** - Complete integration with GitHub Issues
1513
- - Auto-link entries to issues via branch name detection (patterns: `issue-123`, `#123`, `feature/issue-456`)
1514
- - Manual issue linking via `issue_number` and `issue_url` parameters
1515
- - Issue context automatically captured from GitHub API (open issues for current repo)
1516
- - Search and filter entries by issue number
1517
- - Database migration adds `issue_number` and `issue_url` columns
1518
- - **GitHub Pull Requests Support** - Full PR integration with auto-detection
1519
- - Auto-detect current PR from branch (finds matching head branch)
1520
- - Manual PR linking via `pr_number`, `pr_url`, and `pr_status` parameters
1521
- - PR status tracking (draft, open, merged, closed)
1522
- - PR context automatically captured including linked issues, reviewers, and stats
1523
- - Search and filter entries by PR number and status
1524
- - Database migration adds `pr_number`, `pr_url`, `pr_status` columns
1525
- - **Enhanced Context Capture** - Project context now includes:
1526
- - Up to 10 recent open issues from current repository
1527
- - Up to 5 recent open PRs from current repository
1528
- - Current PR detection based on active branch
1529
- - Automatic caching (15 min TTL) to minimize API calls
1530
- - **Enhanced Search Capabilities**
1531
- - `search_entries` tool: New filters for `issue_number`, `pr_number`, `pr_status`
1532
- - `search_by_date_range` tool: New filters for `issue_number`, `pr_number`
1533
- - Find all journal entries related to specific issues or PRs
1534
- - **Enhanced Entry Display**
1535
- - `get_entry_by_id` now shows linked issues and PRs with URLs
1536
- - Entry creation confirms GitHub linkage (e.g., "Linked to: Issue #123, PR #456 (open)")
1537
-
1538
- ### Fixed
1539
-
1540
- - **Missing GitHub Issues Implementation** - Fixed incomplete `github_issues` field in models
1541
- - Was referenced in `ContextData` but never populated
1542
- - Now fully implemented with API functions, caching, and context integration
1543
-
1544
- ### Technical Details
1545
-
1546
- - **New API Functions** (in `src/github/api.py`):
1547
- - `get_repo_issues()` - Fetch repository issues with caching
1548
- - `get_issue_details()` - Get detailed issue information
1549
- - `get_repo_pull_requests()` - Fetch repository PRs with caching
1550
- - `get_pr_details()` - Get detailed PR information including stats
1551
- - `get_pr_from_branch()` - Find PR by head branch name
1552
- - `_parse_linked_issues()` - Extract issue references from PR bodies
1553
- - All functions include `gh` CLI fallbacks for environments without `requests` library
1554
- - **Database Schema Changes**:
1555
- - Added `issue_number`, `issue_url` columns to `memory_journal` table
1556
- - Added `pr_number`, `pr_url`, `pr_status` columns to `memory_journal` table
1557
- - Created indexes for efficient filtering: `idx_memory_journal_issue_number`, `idx_memory_journal_pr_number`
1558
- - Automatic migrations run on server startup
1559
- - **New Models** (in `src/models.py`):
1560
- - `GitHubIssueDict` - Type definition for issue data
1561
- - `GitHubPullRequestDict` - Type definition for PR data with review stats
1562
- - Updated `EntryDict` with issue and PR fields
1563
- - Updated `ContextData` with `github_issues`, `current_pr`, `github_pull_requests` fields
1564
- - **Branch Name Patterns** - Auto-detection supports:
1565
- - `issue-123`, `issue/123`, `fix/issue-456`
1566
- - `#123` (shorthand)
1567
- - `/123-` or `/123/` patterns
1568
- - **Backward Compatibility** - All new fields are optional; existing databases migrate seamlessly
1569
-
1570
- ## [2.0.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v2.0.0...v2.0.1) - 2025-10-28
1571
-
1572
- ### Fixed - Windows Platform Support
1573
-
1574
- - **Git subprocess hang fix** - All Git operations now work reliably on Windows
1575
- - Migrated all `subprocess.run()` calls to `Popen()` with `stdin=subprocess.DEVNULL`
1576
- - Prevents stdin inheritance from MCP server's stdio channel
1577
- - Eliminates deadlocks/hangs when running Git commands
1578
- - Affected files: `database/context.py`, `github/integration.py`
1579
- - **Working directory detection** - Server now reliably detects Git context
1580
- - Added `os.chdir(project_root)` on server startup
1581
- - Server automatically changes to project root directory
1582
- - Resolves "Not a Git repository" errors
1583
- - Recommendation: Add `"cwd"` parameter to MCP configuration
1584
-
1585
- ### Changed - GitHub Projects v2 Migration
1586
-
1587
- - **GraphQL API migration** - Migrated from deprecated REST API to GraphQL
1588
- - Old REST API endpoints return HTTP 410 Gone (deprecated)
1589
- - New GraphQL API (`projectsV2` query) for Projects v2
1590
- - **New module**: `github/graphql.py` with GraphQL query definitions
1591
- - **Token requirement**: `read:project` or `project` scope now required
1592
- - Supports both user and organization projects
1593
- - Returns same data structure for backward compatibility
1594
- - **Enhanced debugging** - Added comprehensive debug logging throughout Git and GitHub operations
1595
- - Tracks subprocess execution times
1596
- - Logs API call results
1597
- - Helps diagnose configuration issues
1598
-
1599
- ### Documentation
1600
-
1601
- - Updated Configuration.md with Windows-specific troubleshooting
1602
- - Updated GitHub-Projects-Integration.md with GraphQL migration notes
1603
- - Updated Architecture.md with v2.0.1 technical improvements
1604
- - Added token scope requirements and MCP configuration examples
1605
-
1606
- ## [2.0.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.2.2...v2.0.0) - 2025-10-28
1607
-
1608
- ### Added - Git-Based Team Collaboration
1609
-
1610
- - **Team Collaboration Feature** - Share journal entries with your team via Git while maintaining privacy
1611
- - **Two-database architecture**: Personal DB (local) + Team DB (Git-tracked)
1612
- - **Explicit opt-in sharing**: `share_with_team` parameter on entry creation
1613
- - **Privacy-first design**: All entries private by default, sharing requires explicit consent
1614
- - **New database file**: `.memory-journal-team.db` (Git-tracked for team synchronization)
1615
- - **New database column**: `share_with_team` (integer, default 0) in `memory_journal` table
1616
- - **Automatic schema migration**: Existing databases updated automatically
1617
- - **New Module**: `src/database/team_db.py` - TeamDatabaseManager class
1618
- - Copy entries to team database
1619
- - Query team entries with filters (tags, date range, entry type)
1620
- - Git status checking for synchronization
1621
- - Entry count and statistics
1622
- - **Enhanced Search**: All search operations automatically query both personal and team databases
1623
- - `search_entries` - Returns combined results with team indicator (👥)
1624
- - `search_by_date_range` - Includes team entries in date-based queries
1625
- - Results show source (personal vs team) for clarity
1626
- - **New Resource**: `memory://team/recent` - Access recent team-shared entries
1627
- - Returns JSON with team entry count and formatted entries
1628
- - Marked with `source: team_shared` for identification
1629
- - **Enhanced Tool**: `create_entry` gains `share_with_team` parameter
1630
- - Set to `true` to copy entry to team database
1631
- - Confirmation message shows sharing status
1632
- - Preserves all entry data (tags, significance, relationships, GitHub Projects)
1633
-
1634
- ### Changed - Major Refactoring
1635
-
1636
- - **Complete Internal Architecture Refactoring** - Transformed from monolithic codebase to modular architecture
1637
- - **96% reduction** in main file size (4,093 lines → 175 lines)
1638
- - **30 focused modules** organized into logical layers (~150-300 lines each)
1639
- - **Clear separation of concerns** - Database, GitHub, MCP handlers isolated
1640
- - **Module structure**:
1641
- - `server.py` (175 lines) - Entry point & MCP protocol dispatchers
1642
- - `database/` (4 modules) - MemoryJournalDB, operations, context management, team_db
1643
- - `github/` (3 modules) - Integration, caching, API operations
1644
- - `handlers/` (20 modules) - MCP tools, prompts, resources
1645
- - Core utilities - constants, exceptions, utils, vector_search
1646
- - **Design patterns implemented**:
1647
- - Dispatcher pattern for MCP protocol routing
1648
- - Dependency injection for component initialization
1649
- - Module-level state for handler dependencies
1650
- - **Benefits**:
1651
- - 10x improvement in code maintainability
1652
- - Independent, testable components
1653
- - Self-documenting structure
1654
- - Easier debugging and optimization
1655
- - Foundation for rapid feature development
1656
-
1657
- ### Added
1658
-
1659
- - **Custom exception classes** - Centralized error handling with specific exception types
1660
- - **Constants module** - All configuration and magic values extracted (including team DB path)
1661
- - **Utilities module** - Common functions deduplicated (FTS5 escaping, Mermaid sanitization, etc.)
1662
- - **Enhanced documentation** - REFACTORING_SUMMARY.md with complete architecture analysis
1663
- - **Team Collaboration Wiki Page** - Comprehensive guide to Git-based entry sharing
1664
-
1665
- ### Performance
1666
-
1667
- - ✅ **No degradation** - All async operations preserved
1668
- - ✅ **Same startup time** - 2-3 seconds maintained
1669
- - ✅ **Same operation speed** - No overhead from modularization
1670
-
1671
- ### Compatibility
1672
-
1673
- - ✅ **100% backward compatible** - Zero breaking changes
1674
- - ✅ **API unchanged** - All 16 tools, 10 prompts, 4 resources work identically
1675
- - ✅ **Database schema** - No changes required
1676
- - ✅ **Environment variables** - Same configuration
1677
- - ✅ **Seamless upgrade** - Simply update and restart
1678
-
1679
- ### Documentation
1680
-
1681
- - Updated Architecture Wiki with complete v2.0.0 module documentation
1682
- - Updated Performance Wiki with refactoring analysis
1683
- - Added REFACTORING_SUMMARY.md with detailed technical breakdown
1684
- - Updated all README files with v2.0.0 highlights
1685
-
1686
- ## [1.2.2](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.2.1...v1.2.2) - 2025-10-26
1687
-
1688
- ### Security
1689
-
1690
- - **URL Parsing Vulnerability Fix (CodeQL #110, #111)** - Fixed incomplete URL substring sanitization in GitHub remote URL parsing
1691
- - **Impact**: Prevented potential URL spoofing attacks where malicious URLs could bypass GitHub hostname checks
1692
- - **Root Cause**: Used substring checks (`'github.com' in url`) instead of proper URL parsing
1693
- - **Fix**: Implemented proper `urllib.parse.urlparse()` validation with exact hostname matching
1694
- - **Details**:
1695
- - SSH URLs: Explicit prefix validation with `startswith('git@github.com:')`
1696
- - HTTPS/HTTP URLs: Parse with `urlparse()` and verify `hostname == 'github.com'`
1697
- - Prevents bypasses like `http://evil.com/github.com/fake` or `http://github.com.evil.com/fake`
1698
- - **Severity**: Medium (limited to Git remote URL parsing in local repository context)
1699
- - **Reference**: [CWE-20: Improper Input Validation](https://cwe.mitre.org/data/definitions/20.html)
1700
-
1701
- ## [1.2.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.2.0...v1.2.1) - 2025-10-26
1702
-
1703
- ### Fixed
1704
-
1705
- - **Semantic search initialization** - Resolved async/lazy loading race condition that could cause semantic_search to hang on first use
1706
- - Moved ML dependency imports to module-level initialization
1707
- - Eliminated async lock deadlock during model loading
1708
- - First semantic search call now completes in <1 second (previously could timeout)
1709
- - **Thread pool optimization** - Increased worker count from 2 to 4 to prevent contention during ML model loading
1710
-
1711
- ### Changed
1712
-
1713
- - Improved initialization progress messages with step-by-step feedback (Step X/3)
1714
- - Added explicit stderr flushing for real-time progress updates
1715
-
1716
- ## [1.2.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.1.3...v1.2.0) - 2025-10-26
1717
-
1718
- ### Added - Phase 3: Organization Support
1719
-
1720
- - **Organization-Level GitHub Projects** - Full support for org-level projects alongside user projects
1721
- - Automatic owner detection (user vs organization)
1722
- - Dual project lookup showing both user and org projects
1723
- - Separate `GITHUB_ORG_TOKEN` support for org-specific permissions
1724
- - All Phase 2 analytics work with org projects
1725
- - **Enhanced Phase 2 Features for Organizations**
1726
- - Cross-project insights spanning user and org projects
1727
- - Status summaries for org project teams
1728
- - Milestone tracking with org-level milestones
1729
- - Smart caching (80%+ API reduction, 24hr owner type cache)
1730
-
1731
- ### Added - Phase 2: Advanced Project Analytics
1732
-
1733
- - **New Tool:** `get_cross_project_insights` - Multi-project analysis and pattern detection
1734
- - **New Prompts:**
1735
- - `project-status-summary` - Comprehensive GitHub Project status reports
1736
- - `project-milestone-tracker` - Milestone progress with velocity tracking
1737
- - **New Resource:** `memory://projects/{number}/timeline` - Live activity feed combining journal + GitHub events
1738
- - **Enhanced:** `get_statistics` with `project_breakdown` parameter for per-project metrics
1739
- - **Smart Caching System** - GitHub API response caching with configurable TTLs (1hr projects, 15min items)
1740
-
1741
- ### Added - Phase 1: GitHub Projects Integration
1742
-
1743
- - **GitHub Projects Support** - Connect journal entries with GitHub Projects (user & org)
1744
- - Entry creation with `project_number`, `project_item_id`, `github_project_url` parameters
1745
- - Automatic project detection from repository context
1746
- - Search and filter entries by project
1747
- - Project context in context bundles
1748
- - **New Database Columns:** `project_number`, `project_item_id`, `github_project_url`
1749
- - **Graceful Degradation:** Works without GitHub token (project features disabled)
1750
-
1751
- ### Fixed
1752
-
1753
- - **FTS5 Search Query Escaping** - Special characters (hyphens, dots, colons) in search queries now handled correctly
1754
- - Organization names like "my-company" now searchable
1755
- - Version numbers like "v1.2.0" work properly
1756
- - Implemented `escape_fts5_query()` function with quote wrapping
1757
-
1758
- ## [1.1.3](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.1.2...v1.1.3) - 2025-10-04
1759
-
1760
- ### Fixed
1761
-
1762
- - **Migration Logic** - Fixed schema migration check to properly handle fresh database installations
1763
-
1764
- ## [1.1.2](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.1.1...v1.1.2) - 2025-10-04
1765
-
1766
- ### Security
1767
-
1768
- - **CVE-2025-8869** - Mitigated pip symbolic link vulnerability by upgrading to pip >=25.0
1769
-
1770
- ## [1.1.1](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.1.0...v1.1.1) - 2025-10-04
1771
-
1772
- ### Fixed
1773
-
1774
- - **F-String Syntax** - Fixed Python syntax error preventing builds on clean environments
1775
-
1776
- ## [1.1.0](https://github.com/neverinfamous/memory-journal-mcp/compare/v1.0.2...v1.1.0) - 2025-10-04
1777
-
1778
- ### Added
1779
-
1780
- - **Entry Relationships** - Link entries with typed relationships (references, implements, clarifies, evolves_from, response_to)
1781
- - **New Tool:** `link_entries` - Create relationships between entries
1782
- - **New Tool:** `visualize_relationships` - Generate Mermaid diagrams of entry connections
1783
- - **New Resource:** `memory://graph/recent` - Live relationship graph visualization
1784
- - **New Prompts:** `find-related`, `get-context-bundle`
1785
- - **Soft Delete** - Entries can be soft-deleted and recovered
1786
- - **Database Schema Enhancements** - `relationships` table, `deleted_at` column
1787
-
1788
- ### Fixed
1789
-
1790
- - **Database Locking** - Eliminated race conditions in concurrent tag updates
1791
- - **Thread Safety** - Single-connection transactions prevent conflicts
1792
-
1793
- ### Changed
1794
-
1795
- - **Performance:** 10x faster startup (14s → 2-3s) through lazy loading of ML dependencies
1796
- - **Optimized Database:** Removed expensive PRAGMA operations from startup
1797
-
1798
- ### Documentation
1799
-
1800
- - Created comprehensive GitHub Wiki (17 pages)
1801
- - Enhanced README with feature overview
1802
- - Added Docker Hub README
1803
-
1804
- ## [1.0.2](https://github.com/neverinfamous/memory-journal-mcp/releases/tag/v1.0.2) - 2025-09-15
1805
-
1806
- ### Initial Beta Release
1807
-
1808
- - 13 MCP tools for journal management
1809
- - Triple search system (FTS5, date range, semantic)
1810
- - 6 workflow prompts
1811
- - 2 MCP resources
1812
- - Git and GitHub CLI integration
1813
- - SQLite FTS5 full-text search
1814
- - Optional FAISS semantic search