@romiluz/clawmongo 2026.3.26 → 2026.3.28

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 (507) hide show
  1. package/README.md +84 -49
  2. package/dist/{accounts-boH28BFM.js → accounts-lL2y51Ag.js} +46 -46
  3. package/dist/{acp-cli-DLaTb29R.js → acp-cli-BZvVHRY8.js} +46 -46
  4. package/dist/{action-runtime-Bk-7pvN2.js → action-runtime-DMYRUL4q.js} +10 -10
  5. package/dist/{actions.runtime-Y529miLb.js → actions.runtime-Bd-NMAq6.js} +46 -46
  6. package/dist/{actions.runtime-DVQ4pmcp.js → actions.runtime-gPSeXscW.js} +49 -49
  7. package/dist/{agent-scope-BROpmzKv.js → agent-scope-DXZH506l.js} +1 -1
  8. package/dist/{agents-DZqtbDMD.js → agents-Bt25bmDR.js} +13 -13
  9. package/dist/{agents-BbO-i90j.js → agents-CyJmttnS.js} +114 -114
  10. package/dist/{agents.config-CDS6iAat.js → agents.config-BWm70Hr6.js} +2 -2
  11. package/dist/{agents.config-iY500LY-.js → agents.config-UsCw0kOR.js} +4 -4
  12. package/dist/{audit-Cmj7BNcZ.js → audit-Dg8ZiJrJ.js} +9 -9
  13. package/dist/{audit-DmXeao7s.js → audit-DhXhWoiv.js} +1 -1
  14. package/dist/{audit-channel.collect.runtime-DhP09fjv.js → audit-channel.collect.runtime-CvPUHy1X.js} +2 -2
  15. package/dist/{audit-channel.runtime-C-watgwg.js → audit-channel.runtime-B6ZnOPFc.js} +46 -46
  16. package/dist/{audit-extra.async-B-7dzgcz.js → audit-extra.async-826UZZhJ.js} +3 -3
  17. package/dist/{audit-membership-runtime-CbLi3-5b.js → audit-membership-runtime-DLQrV7Rr.js} +46 -46
  18. package/dist/{audit.deep.runtime-D5VgrTOT.js → audit.deep.runtime-DQDtV7Bc.js} +4 -4
  19. package/dist/{audit.nondeep.runtime-B7M0-7FZ.js → audit.nondeep.runtime-H6B-2xal.js} +4 -4
  20. package/dist/{audit.runtime-BUknqGaP.js → audit.runtime-D2ZRC2A_.js} +47 -47
  21. package/dist/{auth-choice-DfJRosb4.js → auth-choice-CEowrO66.js} +57 -57
  22. package/dist/{auth-choice-CpB99A-L.js → auth-choice-DiufM1b8.js} +55 -55
  23. package/dist/{auth-choice-Bnnngmkx.js → auth-choice-YrGxwB9A.js} +5 -5
  24. package/dist/{auth-choice-options-DvqJHFOp.js → auth-choice-options-n3_uFdT5.js} +2 -2
  25. package/dist/{auth-choice-prompt-DtTjWfPT.js → auth-choice-prompt-DYFzoWa6.js} +50 -50
  26. package/dist/{auth-choice-prompt-Cxz8du6E.js → auth-choice-prompt-sLET2Bkw.js} +1 -1
  27. package/dist/{auth-choice.apply-helpers-Bm5p2ZX7.js → auth-choice.apply-helpers-GU6nZntg.js} +1 -1
  28. package/dist/{auth-choice.plugin-providers.runtime-Dsu6-vb8.js → auth-choice.plugin-providers.runtime-BNqOEEtb.js} +47 -47
  29. package/dist/{auth-profiles-2-OV37OF.js → auth-profiles-BWBQJ6X_.js} +67 -76
  30. package/dist/{auth-profiles.runtime-HcQMBs3K.js → auth-profiles.runtime-DfKRAmQR.js} +46 -46
  31. package/dist/{backend-config-avgzgS5Z.js → backend-config--L236wE2.js} +26 -1
  32. package/dist/{backup-create-B9F0M7-J.js → backup-create-Bll6DgoT.js} +2 -2
  33. package/dist/{base-session-key-DyLtSGkj.js → base-session-key-CA4SoGLF.js} +1 -1
  34. package/dist/{bluebubbles-BTR7u4zE.js → bluebubbles-BsX68JOY.js} +6 -6
  35. package/dist/{browser-cli-tmytvFaa.js → browser-cli-B5euA0cQ.js} +8 -8
  36. package/dist/build-info.json +3 -3
  37. package/dist/bundled/boot-md/handler.js +46 -46
  38. package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
  39. package/dist/bundled/session-memory/handler.js +47 -47
  40. package/dist/{call-Cqem-bCB.js → call-C-_XQxw5.js} +1 -1
  41. package/dist/{call-CxVOiYz-.js → call-lPTaDgAg.js} +6 -6
  42. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  43. package/dist/{channel-Br8MF00M.js → channel-5o-oIU2B.js} +1 -1
  44. package/dist/{channel-BvRm4jSj.js → channel-C1zZg_8b.js} +2 -2
  45. package/dist/{channel-CqkxOhz2.js → channel-CEytBPH-.js} +4 -4
  46. package/dist/{channel-D_h7IfYK.js → channel-Cm65A1lo.js} +7 -7
  47. package/dist/{channel-ngZRDeE3.js → channel-D4K0MVgr.js} +5 -5
  48. package/dist/{channel-account-context-DZhZw4oo.js → channel-account-context-CNZZPDSe.js} +1 -1
  49. package/dist/{channel-plugin-resolution-CXm5HIcm.js → channel-plugin-resolution-WWO690RK.js} +3 -3
  50. package/dist/{channel-reply-pipeline-DdDsf-Lc.js → channel-reply-pipeline-B17-tBLU.js} +1 -1
  51. package/dist/{channel-shared-VIRIADYn.js → channel-shared-RH6YsZ0I.js} +1 -1
  52. package/dist/{channel-summary-BTJxLPN8.js → channel-summary-Cy7WDRjQ.js} +7 -7
  53. package/dist/{channel-summary-DdJtHlvH.js → channel-summary-DV4_b3HZ.js} +2 -2
  54. package/dist/{channel-tFDEkWt9.js → channel-yCiI29Ju.js} +6 -6
  55. package/dist/{channel.runtime-DGnRryi2.js → channel.runtime-C3m1vacV.js} +47 -47
  56. package/dist/{channel.runtime-CdPEA_wb.js → channel.runtime-CUSE7Dn0.js} +47 -47
  57. package/dist/{channel.runtime-0n3_Hz_Y.js → channel.runtime-CtWi36oj.js} +49 -49
  58. package/dist/{channel.runtime-CkHcsWQ3.js → channel.runtime-LUpQZiWg.js} +49 -49
  59. package/dist/{channel.runtime-msXRrVzC.js → channel.runtime-QOkM4mJV.js} +51 -51
  60. package/dist/{channel.runtime-khqV1QRG.js → channel.runtime-rYuUs2po.js} +4 -4
  61. package/dist/{channels-DNza27NY.js → channels-4VTbN2Gt.js} +103 -103
  62. package/dist/{channels-CLZoq3SY.js → channels-BUMnLXLQ.js} +1 -1
  63. package/dist/{channels-cli-Bhsnjsix.js → channels-cli-BYmLj8zw.js} +55 -55
  64. package/dist/{clawbot-cli-9YJNF9pF.js → clawbot-cli-CIYY1u-6.js} +47 -47
  65. package/dist/cli/daemon-cli.js +1 -1
  66. package/dist/{cli-FF5823nM.js → cli-DUA0FvhM.js} +46 -46
  67. package/dist/{command-registry-Dw-TONf0.js → command-registry-B1ECZip_.js} +13 -13
  68. package/dist/{command-registry-TeN0aKPi.js → command-registry-DOAwIs0Y.js} +2 -2
  69. package/dist/{command-secret-gateway-CzHSHmXG.js → command-secret-gateway-Big-n6JY.js} +46 -46
  70. package/dist/{compact.runtime-Bye-pm7Z.js → compact.runtime-BKnPPv9X.js} +46 -46
  71. package/dist/{completion-cli-D08RAGPz.js → completion-cli-BeLNvVTI.js} +3 -3
  72. package/dist/{completion-cli-C0mwyiAb.js → completion-cli-CHwHDPuI.js} +2 -2
  73. package/dist/{config-Ca7pLyBD.js → config-BOWZMmDA.js} +1 -1
  74. package/dist/{config-GKOWhVMv.js → config-C68iwvDj.js} +5 -5
  75. package/dist/{config-cli-CxPspN-S.js → config-cli-BnC336Lu.js} +48 -48
  76. package/dist/{config-guard-BK2hWyPi.js → config-guard-Bn6rZnzK.js} +6 -6
  77. package/dist/{config-validation-DO6o_Kt_.js → config-validation-BBuJZ-WH.js} +2 -2
  78. package/dist/{configure-CODqvxU-.js → configure-CHJDsjOD.js} +120 -120
  79. package/dist/{configure-Dg65gBEw.js → configure-Cctw7tyJ.js} +19 -23
  80. package/dist/{connection-auth-zhL6PVn0.js → connection-auth-C2XaPpF5.js} +1 -1
  81. package/dist/{control-ui-shared-_VwcOcc_.js → control-ui-shared-BC-g150y.js} +1 -1
  82. package/dist/{core-CzwQmKcn.js → core-Cb3XxL6S.js} +1 -1
  83. package/dist/{cron-cli-Dp_EQt2v.js → cron-cli-C10feOtH.js} +7 -7
  84. package/dist/{daemon-cli-Dgpv6Y0R.js → daemon-cli-Ds8mu2VZ.js} +4 -4
  85. package/dist/{daemon-install-Dq1Ix-FO.js → daemon-install-B__sP_7j.js} +49 -49
  86. package/dist/{delegate-BVapk4rY.js → delegate-ByCLviVI.js} +1 -1
  87. package/dist/{deliver-runtime-DPzMjhNU.js → deliver-Co7G5ubS.js} +46 -46
  88. package/dist/{deliver-C32Gg-xU.js → deliver-runtime-2svrtAf1.js} +46 -46
  89. package/dist/{devices-cli-3WN_wB1C.js → devices-cli-CH8nWgcU.js} +6 -6
  90. package/dist/{diagnostic-BbXfhLMi.js → diagnostic-DHTG43d_.js} +1 -1
  91. package/dist/{directory-cli-D_5BYdXm.js → directory-cli-B0REFlKo.js} +48 -48
  92. package/dist/{directory.static-CsajbHw1.js → directory.static-wnw_R8dE.js} +1 -1
  93. package/dist/{discord-C-4y9vOT.js → discord-Cws9MsXn.js} +4 -4
  94. package/dist/{discord-B3mmVXuG.js → discord-b8Ff_BKB.js} +46 -46
  95. package/dist/{dns-cli-CdAnUzRi.js → dns-cli-aRTleL5e.js} +5 -5
  96. package/dist/{doctor-completion-BnqTtLhL.js → doctor-completion-KQWBMnEi.js} +1 -1
  97. package/dist/{doctor-config-preflight-BJ0lGLTO.js → doctor-config-preflight-BDYe5di1.js} +2 -2
  98. package/dist/{doctor-config-preflight-D32oVOWD.js → doctor-config-preflight-Dn5a_Dbr.js} +6 -6
  99. package/dist/{doctor-state-migrations-BklDIib1.js → doctor-state-migrations-BI6HzFyq.js} +47 -47
  100. package/dist/{doctor-state-migrations-Cdk3ep_f.js → doctor-state-migrations-DUPe9zNr.js} +2 -2
  101. package/dist/entry.js +1 -1
  102. package/dist/{exec-approvals-D8OOtgGc.js → exec-approvals-CZz2LqIW.js} +1 -1
  103. package/dist/{exec-approvals-cli-dGISWHE3.js → exec-approvals-cli-KbFpgd-p.js} +9 -9
  104. package/dist/extensionAPI.js +46 -46
  105. package/dist/extensions/amazon-bedrock/index.js +46 -46
  106. package/dist/extensions/anthropic/index.js +46 -46
  107. package/dist/extensions/bluebubbles/index.js +50 -50
  108. package/dist/extensions/bluebubbles/setup-entry.js +48 -48
  109. package/dist/extensions/byteplus/index.js +46 -46
  110. package/dist/extensions/chutes/index.js +48 -48
  111. package/dist/extensions/cloudflare-ai-gateway/index.js +47 -47
  112. package/dist/extensions/device-pair/index.js +46 -46
  113. package/dist/extensions/discord/index.js +48 -48
  114. package/dist/extensions/discord/node_modules/.package-lock.json +3 -3
  115. package/dist/extensions/discord/node_modules/hono/dist/adapter/service-worker/index.js +1 -3
  116. package/dist/extensions/discord/node_modules/hono/dist/cjs/adapter/service-worker/index.js +1 -3
  117. package/dist/extensions/discord/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  118. package/dist/extensions/discord/node_modules/hono/dist/cjs/middleware/cors/index.js +5 -2
  119. package/dist/extensions/discord/node_modules/hono/dist/cjs/request.js +1 -1
  120. package/dist/extensions/discord/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  121. package/dist/extensions/discord/node_modules/hono/dist/middleware/cors/index.js +5 -2
  122. package/dist/extensions/discord/node_modules/hono/dist/request.js +1 -1
  123. package/dist/extensions/discord/node_modules/hono/dist/tsconfig.build.tsbuildinfo +1 -1
  124. package/dist/extensions/discord/node_modules/hono/dist/types/client/index.d.ts +1 -1
  125. package/dist/extensions/discord/node_modules/hono/dist/types/client/types.d.ts +20 -0
  126. package/dist/extensions/discord/node_modules/hono/dist/types/request.d.ts +1 -3
  127. package/dist/extensions/discord/node_modules/hono/package.json +1 -1
  128. package/dist/extensions/discord/setup-entry.js +48 -48
  129. package/dist/extensions/elevenlabs/index.js +46 -46
  130. package/dist/extensions/fal/index.js +46 -46
  131. package/dist/extensions/feishu/index.js +55 -55
  132. package/dist/extensions/feishu/setup-entry.js +51 -51
  133. package/dist/extensions/firecrawl/index.js +46 -46
  134. package/dist/extensions/github-copilot/index.js +47 -47
  135. package/dist/extensions/google/index.js +46 -46
  136. package/dist/extensions/huggingface/index.js +47 -47
  137. package/dist/extensions/imessage/index.js +49 -49
  138. package/dist/extensions/imessage/setup-entry.js +49 -49
  139. package/dist/extensions/irc/index.js +49 -49
  140. package/dist/extensions/irc/setup-entry.js +48 -48
  141. package/dist/extensions/kilocode/index.js +47 -47
  142. package/dist/extensions/kimi-coding/index.js +47 -47
  143. package/dist/extensions/line/index.js +9 -9
  144. package/dist/extensions/line/setup-entry.js +8 -8
  145. package/dist/extensions/llm-task/index.js +46 -46
  146. package/dist/extensions/lobster/index.js +5 -5
  147. package/dist/extensions/mattermost/index.js +49 -49
  148. package/dist/extensions/mattermost/setup-entry.js +48 -48
  149. package/dist/extensions/microsoft/index.js +46 -46
  150. package/dist/extensions/minimax/index.js +48 -48
  151. package/dist/extensions/mistral/index.js +47 -47
  152. package/dist/extensions/modelstudio/index.js +47 -47
  153. package/dist/extensions/moonshot/index.js +46 -46
  154. package/dist/extensions/nextcloud-talk/index.js +50 -50
  155. package/dist/extensions/nextcloud-talk/setup-entry.js +49 -49
  156. package/dist/extensions/ollama/index.js +5 -5
  157. package/dist/extensions/openai/index.js +47 -47
  158. package/dist/extensions/opencode/index.js +47 -47
  159. package/dist/extensions/opencode-go/index.js +47 -47
  160. package/dist/extensions/openrouter/index.js +47 -47
  161. package/dist/extensions/openshell/index.js +46 -46
  162. package/dist/extensions/qianfan/index.js +47 -47
  163. package/dist/extensions/qwen-portal-auth/index.js +47 -47
  164. package/dist/extensions/sglang/index.js +46 -46
  165. package/dist/extensions/signal/index.js +49 -49
  166. package/dist/extensions/signal/setup-entry.js +49 -49
  167. package/dist/extensions/slack/index.js +50 -50
  168. package/dist/extensions/slack/setup-entry.js +50 -50
  169. package/dist/extensions/synology-chat/index.js +9 -9
  170. package/dist/extensions/synology-chat/setup-entry.js +8 -8
  171. package/dist/extensions/synthetic/index.js +47 -47
  172. package/dist/extensions/talk-voice/index.js +46 -46
  173. package/dist/extensions/tavily/index.js +46 -46
  174. package/dist/extensions/telegram/index.js +48 -48
  175. package/dist/extensions/telegram/setup-entry.js +48 -48
  176. package/dist/extensions/together/index.js +47 -47
  177. package/dist/extensions/venice/index.js +47 -47
  178. package/dist/extensions/vercel-ai-gateway/index.js +47 -47
  179. package/dist/extensions/vllm/index.js +46 -46
  180. package/dist/extensions/voice-call/index.js +46 -46
  181. package/dist/extensions/volcengine/index.js +46 -46
  182. package/dist/extensions/xai/index.js +46 -46
  183. package/dist/extensions/xiaomi/index.js +47 -47
  184. package/dist/extensions/zai/index.js +47 -47
  185. package/dist/extensions/zalo/index.js +49 -49
  186. package/dist/extensions/zalo/setup-entry.js +48 -48
  187. package/dist/{feishu-C637DYYe.js → feishu-D2fuiOiy.js} +4 -4
  188. package/dist/{gateway-cli-Cuk9d7J2.js → gateway-cli-nOgyXtih.js} +72 -106
  189. package/dist/{gateway-install-token-DlcVm1rP.js → gateway-install-token-nvsTK8KN.js} +4 -4
  190. package/dist/{gateway-rpc-siKa8KpM.js → gateway-rpc-DrH142-v.js} +1 -1
  191. package/dist/{gateway-runtime-roiTaOKO.js → gateway-runtime-CQXKGzrv.js} +2 -2
  192. package/dist/{github-copilot-auth-DJljh3gq.js → github-copilot-auth-C4z2AAd8.js} +3 -3
  193. package/dist/{health-DU_pBiid.js → health-DEgLPyA9.js} +7 -7
  194. package/dist/{health-B1OK1kJg.js → health-H5nbiXvA.js} +48 -48
  195. package/dist/{heartbeat-summary-CMwt9qam.js → heartbeat-summary-CNCptWmA.js} +1 -1
  196. package/dist/{hooks-cli-D42hQEUb.js → hooks-cli-jBhsJaOg.js} +46 -46
  197. package/dist/{identity-file-8MUyIAOy.js → identity-file-CYQnH12I.js} +1 -1
  198. package/dist/{imessage-zqZjecTU.js → imessage-DYqgZpLc.js} +6 -6
  199. package/dist/{imessage-CZb_pS8U.js → imessage-Dau6WdE3.js} +46 -46
  200. package/dist/{inbound-reply-dispatch-B73AkQh4.js → inbound-reply-dispatch-BFE3xy1S.js} +2 -2
  201. package/dist/index.js +2 -2
  202. package/dist/{internal-Bg_k56Pk.js → internal-DLE9baj7.js} +0 -24
  203. package/dist/{io-DE9vm7Eo.js → io-Du0b8gMO.js} +2 -2
  204. package/dist/{io-B7rO2wud.js → io-dJgqp8U8.js} +4 -4
  205. package/dist/{irc-BWzsfr2V.js → irc-BRaOVUse.js} +2 -2
  206. package/dist/{kb-cli-BOPGkNfJ.js → kb-cli-Cdif_vwn.js} +12 -12
  207. package/dist/{library-i-2ymInt.js → library-BwjFIWw3.js} +46 -46
  208. package/dist/{lifecycle-core-DwIo1PfK.js → lifecycle-core-DNO4MItg.js} +1 -1
  209. package/dist/line/send.js +6 -6
  210. package/dist/{line-DbTKdVgY.js → line-BCXUGrVz.js} +2 -2
  211. package/dist/{llm-slug-generator-Dm30OM2W.js → llm-slug-generator-B55FZ1aG.js} +3 -3
  212. package/dist/llm-slug-generator.js +47 -47
  213. package/dist/{logging-BM4mQ53W.js → logging-BvOzg0cM.js} +1 -1
  214. package/dist/{logging-0tvlVvFG.js → logging-nWyKsj9d.js} +5 -5
  215. package/dist/{login-qr-DQPSabxI.js → login-qr-C0QA3j4x.js} +46 -46
  216. package/dist/{logs-cli-ZnHk5eku.js → logs-cli-thlXBA9n.js} +7 -7
  217. package/dist/{manager.runtime-D3vjUOZF.js → manager.runtime-SoTq-tT4.js} +46 -46
  218. package/dist/{matrix-migration-snapshot-CRKiHq6Y.js → matrix-migration-snapshot-_6Rg-iLO.js} +2 -2
  219. package/dist/{mattermost-Bqn7Fd5U.js → mattermost-2nv5O_jQ.js} +2 -2
  220. package/dist/{mcp-cli-7aN2vJv-.js → mcp-cli-1vpy_yti.js} +5 -5
  221. package/dist/{mcp-config-NVrqojpu.js → mcp-config-Bmi2GUum.js} +1 -1
  222. package/dist/{media-understanding.runtime-DesF8Xhs.js → media-understanding.runtime-Wh-_SFK_.js} +46 -46
  223. package/dist/{memory-cli-CWqIJQS5.js → memory-cli-COJRHkaJ.js} +46 -46
  224. package/dist/{memory-search-DyxoUpq2.js → memory-search-CGmdrdM1.js} +1 -1
  225. package/dist/{memory-search-CgoWYj0V.js → memory-search-Cy36nO15.js} +3 -3
  226. package/dist/{model-picker-DX9P5pDr.js → model-picker-CYWvoS3z.js} +48 -48
  227. package/dist/{model-picker-Ds7-VqDS.js → model-picker-_32ihKqK.js} +4 -4
  228. package/dist/{model-picker.runtime-DqDt4s3S.js → model-picker.runtime-DBT5uEFi.js} +49 -49
  229. package/dist/{model-selection-DXFVauys.js → model-selection-014eeYCV.js} +1 -1
  230. package/dist/{model-suppression.runtime-8mU0VJs6.js → model-suppression.runtime-GTI9Rm85.js} +46 -46
  231. package/dist/{models-GXQSWyBX.js → models-Be9EWpVm.js} +54 -54
  232. package/dist/{models-CVG-VMBa.js → models-CX35daXC.js} +14 -14
  233. package/dist/{models-cli-Cvy8rGqU.js → models-cli-BYjac3oq.js} +54 -54
  234. package/dist/{models-config-BdanqM9X.js → models-config-Agv-ThDH.js} +46 -46
  235. package/dist/{models-config.providers.discovery-BHZ3WglC.js → models-config.providers.discovery-BJwjDHsg.js} +1 -1
  236. package/dist/{mongodb-analytics-BszyEhsq.js → mongodb-analytics-HJKYeseb.js} +2 -2
  237. package/dist/{mongodb-analytics-CcSYo_ae.js → mongodb-analytics-mnKJih5x.js} +1 -1
  238. package/dist/{mongodb-auto-setup-QcwgZSN9.js → mongodb-auto-setup-CCElSwNy.js} +2 -2
  239. package/dist/{mongodb-kb-C-VmGOq7.js → mongodb-kb-1tSOXXb9.js} +3 -3
  240. package/dist/{mongodb-kb-BotgVda9.js → mongodb-kb-CdSvNe3w.js} +2 -2
  241. package/dist/{mongodb-kb-search-CoIAFX8n.js → mongodb-kb-search-Dq6E746K.js} +1 -1
  242. package/dist/{mongodb-kb-search-BBYY_d_r.js → mongodb-kb-search-DvsXIUy6.js} +3 -3
  243. package/dist/{mongodb-manager-BVfTfpHf.js → mongodb-manager-DEZIQXuo.js} +10 -10
  244. package/dist/{mongodb-manager-BJ0PAYF_.js → mongodb-manager-NkerSpvH.js} +1183 -331
  245. package/dist/{mongodb-procedures-DNPmmW5r.js → mongodb-procedures-DI-_Dakz.js} +7 -3
  246. package/dist/{mongodb-procedures-D3M2Ph8E.js → mongodb-procedures-tjhGdBV7.js} +3 -3
  247. package/dist/{mongodb-schema-JpDXcAUV.js → mongodb-schema-DN3aspLa.js} +1 -1
  248. package/dist/{mongodb-schema-BI4Ze_ZV.js → mongodb-schema-Dt6jxcPL.js} +298 -4
  249. package/dist/{mongodb-search-VFKd72IZ.js → mongodb-search-DMsUyfpa.js} +2 -2
  250. package/dist/{mongodb-structured-memory-DnwUJ6SA.js → mongodb-structured-memory-D-3SEfTu.js} +58 -2
  251. package/dist/{mongodb-structured-memory-BySGexcm.js → mongodb-structured-memory-lpyyW0kn.js} +3 -3
  252. package/dist/{monitor-DGE0bx3s.js → monitor-BZFy1RTb.js} +47 -47
  253. package/dist/{monitor-Dfc0KXMD.js → monitor-DPYGxeY_.js} +5 -5
  254. package/dist/{monitor-CZZlkQUU.js → monitor-Duykki-j.js} +51 -51
  255. package/dist/{monitor-B61bVnMW.js → monitor-gq31SALd.js} +8 -8
  256. package/dist/{nextcloud-talk-CnwOv1rG.js → nextcloud-talk-C_-LfGeq.js} +2 -2
  257. package/dist/{node-cli-Avub0RKe.js → node-cli-NpJzvfQW.js} +12 -12
  258. package/dist/{nodes-cli-qSE-cmgX.js → nodes-cli-O5HciXeP.js} +10 -10
  259. package/dist/{nodes-screen-DQw8F5rA.js → nodes-screen-BIwiB35h.js} +1 -1
  260. package/dist/{oauth.runtime-825pMCgB.js → oauth.runtime-BxjW8DFO.js} +46 -46
  261. package/dist/{oauth.runtime-BCwH9-Yl.js → oauth.runtime-DKU2STuA.js} +46 -46
  262. package/dist/{oauth.runtime-BSddaUzc.js → oauth.runtime-mFizWM72.js} +46 -46
  263. package/dist/{onboard-CUbnVxXL.js → onboard-B6H0qDtg.js} +1 -1
  264. package/dist/{onboard-BwC0LbCx.js → onboard-C1AmXQ6f.js} +8 -8
  265. package/dist/{onboard-Cw65XmEU.js → onboard-DPdj0IBu.js} +2 -2
  266. package/dist/{onboard-channels-BYNDTtRI.js → onboard-channels-Cmj_5qXQ.js} +24 -24
  267. package/dist/{onboard-channels-CIR1ZSii.js → onboard-channels-Wf3nY9Bf.js} +97 -97
  268. package/dist/{onboard-custom-FImARgQC.js → onboard-custom-DILgXkiq.js} +50 -50
  269. package/dist/{onboard-custom-C4qOVxtG.js → onboard-custom-DlDCjvIw.js} +4 -4
  270. package/dist/{onboard-helpers-DW9Mskds.js → onboard-helpers-CqpD9TVU.js} +48 -48
  271. package/dist/{onboard-helpers-D3xV_T96.js → onboard-helpers-D-PLdtHT.js} +3 -3
  272. package/dist/{onboard-hooks-B0gJVtBY.js → onboard-hooks-MQ8QOguv.js} +2 -2
  273. package/dist/{onboard-remote-BMLo6WKH.js → onboard-remote-BZKWgKVw.js} +50 -50
  274. package/dist/{onboard-remote-XUah3N3G.js → onboard-remote-Bnad5LMv.js} +2 -2
  275. package/dist/{onboard-search-DHCzqxgq.js → onboard-search-Dyv1IuQ4.js} +46 -46
  276. package/dist/{onboard-skills-LXCIpyir.js → onboard-skills-DdCu1_hE.js} +1 -1
  277. package/dist/{onboard-skills-CH6q90Pf.js → onboard-skills-W_252asS.js} +49 -49
  278. package/dist/{onboarding-memory-BWEsBe08.js → onboarding-memory-BRHSmwx3.js} +24 -15
  279. package/dist/{outbound-media-CqfP0r4a.js → outbound-media-CHc08Sj8.js} +1 -1
  280. package/dist/{pairing-cli-BdCkQG2S.js → pairing-cli-oNWkjwCt.js} +5 -5
  281. package/dist/{persistent-dedupe-DNnh7hrR.js → persistent-dedupe-CS_uyVoq.js} +1 -1
  282. package/dist/{pi-model-discovery-runtime-DyT9C3Ap.js → pi-model-discovery-runtime-BJVREOXf.js} +46 -46
  283. package/dist/{pi-tools.before-tool-call.runtime-CA2js1Ig.js → pi-tools.before-tool-call.runtime-w-Q4HA_S.js} +6 -6
  284. package/dist/{plugin-install-DgvJfz7X.js → plugin-install-BysMw7Sl.js} +47 -47
  285. package/dist/{plugin-install-BKuy_--2.js → plugin-install-EyES0vGP.js} +2 -2
  286. package/dist/{plugin-registry-D-6OBqUU.js → plugin-registry-BenF9SYR.js} +47 -47
  287. package/dist/{plugin-registry-Dsx_6z3N.js → plugin-registry-CRV_Bc8K.js} +3 -3
  288. package/dist/plugin-sdk/account-resolution.js +46 -46
  289. package/dist/plugin-sdk/acp-runtime.js +46 -46
  290. package/dist/plugin-sdk/agent-runtime.js +46 -46
  291. package/dist/plugin-sdk/channel-inbound.js +46 -46
  292. package/dist/plugin-sdk/channel-reply-pipeline.js +3 -3
  293. package/dist/plugin-sdk/channel-runtime.js +46 -46
  294. package/dist/plugin-sdk/channel-setup.js +1 -1
  295. package/dist/plugin-sdk/command-auth.js +46 -46
  296. package/dist/plugin-sdk/compat.js +5 -5
  297. package/dist/plugin-sdk/config-runtime.js +46 -46
  298. package/dist/plugin-sdk/conversation-runtime.js +46 -46
  299. package/dist/plugin-sdk/core.js +5 -5
  300. package/dist/plugin-sdk/directory-runtime.js +1 -1
  301. package/dist/plugin-sdk/discord.js +46 -46
  302. package/dist/plugin-sdk/gateway-runtime.js +8 -8
  303. package/dist/plugin-sdk/image-generation.js +46 -46
  304. package/dist/plugin-sdk/index.js +46 -46
  305. package/dist/plugin-sdk/infra-runtime.js +46 -46
  306. package/dist/plugin-sdk/llm-task.js +46 -46
  307. package/dist/plugin-sdk/matrix-runtime-heavy.js +50 -50
  308. package/dist/plugin-sdk/media-runtime.js +46 -46
  309. package/dist/plugin-sdk/media-understanding-runtime.js +46 -46
  310. package/dist/plugin-sdk/media-understanding.js +46 -46
  311. package/dist/plugin-sdk/ollama-setup.js +8 -8
  312. package/dist/plugin-sdk/plugin-runtime.js +46 -46
  313. package/dist/plugin-sdk/provider-auth-api-key.js +46 -46
  314. package/dist/plugin-sdk/provider-auth-login.js +1 -1
  315. package/dist/plugin-sdk/provider-auth.js +46 -46
  316. package/dist/plugin-sdk/provider-models.js +5 -5
  317. package/dist/plugin-sdk/provider-onboard.js +5 -5
  318. package/dist/plugin-sdk/provider-setup.js +49 -49
  319. package/dist/plugin-sdk/provider-stream.js +46 -46
  320. package/dist/plugin-sdk/provider-usage.js +4 -4
  321. package/dist/plugin-sdk/reply-history.js +3 -3
  322. package/dist/plugin-sdk/reply-runtime.js +46 -46
  323. package/dist/plugin-sdk/routing.js +3 -3
  324. package/dist/plugin-sdk/sandbox.js +46 -46
  325. package/dist/plugin-sdk/self-hosted-provider-setup.js +48 -48
  326. package/dist/plugin-sdk/setup-runtime.js +1 -1
  327. package/dist/plugin-sdk/setup.js +1 -1
  328. package/dist/plugin-sdk/speech-runtime.js +46 -46
  329. package/dist/plugin-sdk/speech.js +46 -46
  330. package/dist/plugin-sdk/src/agents/workspace.d.ts +1 -3
  331. package/dist/plugin-sdk/src/config/types.memory.d.ts +44 -0
  332. package/dist/plugin-sdk/src/memory/backend-config.d.ts +24 -0
  333. package/dist/plugin-sdk/src/memory/index.d.ts +12 -4
  334. package/dist/plugin-sdk/src/memory/mongodb-entity-extractor.d.ts +33 -0
  335. package/dist/plugin-sdk/src/memory/mongodb-episodes.d.ts +16 -0
  336. package/dist/plugin-sdk/src/memory/mongodb-events.d.ts +9 -0
  337. package/dist/plugin-sdk/src/memory/mongodb-graph.d.ts +30 -3
  338. package/dist/plugin-sdk/src/memory/mongodb-manager.d.ts +18 -0
  339. package/dist/plugin-sdk/src/memory/mongodb-mutations.d.ts +38 -0
  340. package/dist/plugin-sdk/src/memory/mongodb-procedures.d.ts +32 -0
  341. package/dist/plugin-sdk/src/memory/mongodb-profile.d.ts +71 -0
  342. package/dist/plugin-sdk/src/memory/mongodb-query-cache.d.ts +68 -0
  343. package/dist/plugin-sdk/src/memory/mongodb-query-rewriter.d.ts +39 -0
  344. package/dist/plugin-sdk/src/memory/mongodb-reranker.d.ts +32 -0
  345. package/dist/plugin-sdk/src/memory/mongodb-schema.d.ts +3 -0
  346. package/dist/plugin-sdk/src/memory/mongodb-telemetry.d.ts +69 -0
  347. package/dist/plugin-sdk/text-runtime.js +6 -6
  348. package/dist/plugin-sdk/web-media.js +3 -3
  349. package/dist/plugin-sdk/zalo.js +47 -47
  350. package/dist/plugin-sdk/zalouser.js +47 -47
  351. package/dist/plugins/build-smoke-entry.js +46 -46
  352. package/dist/plugins/runtime/index.js +46 -46
  353. package/dist/{plugins-cli-C6wGAkD9.js → plugins-cli-BUiP4x7l.js} +46 -46
  354. package/dist/{policy-CcgojW9R.js → policy-DnUfJkOZ.js} +1 -1
  355. package/dist/{preflight-audio.runtime-Cyz9Zu89.js → preflight-audio.runtime-D3_iaSgF.js} +46 -46
  356. package/dist/{probe-auth-BmluVNJZ.js → probe-auth-BbNdYwb0.js} +1 -1
  357. package/dist/{probe-auth-DrgTJ7ki.js → probe-auth-CB9y2dLl.js} +7 -7
  358. package/dist/{program-CHFcfOlC.js → program-uHYlUP3c.js} +4 -4
  359. package/dist/{prompt-select-styled-Ck38XMb3.js → prompt-select-styled-DoTAWghe.js} +25 -51
  360. package/dist/{provider-api-key-auth.runtime-AT16DTa8.js → provider-api-key-auth.runtime-B3H0dODg.js} +46 -46
  361. package/dist/{provider-auth-choice-UhIkLc6q.js → provider-auth-choice-HRfxXEHk.js} +6 -6
  362. package/dist/{provider-auth-choice-helpers-CXWmWOdR.js → provider-auth-choice-helpers-2jZnBKMm.js} +1 -1
  363. package/dist/{provider-auth-choice-preference-TgulgKlz.js → provider-auth-choice-preference-CqKryjBB.js} +6 -6
  364. package/dist/{provider-auth-choice.runtime-FTNgi8Yh.js → provider-auth-choice.runtime-BaFSZgQG.js} +48 -48
  365. package/dist/{provider-auth-choice.runtime-CP91b3vK.js → provider-auth-choice.runtime-DPHuj1_l.js} +2 -2
  366. package/dist/{provider-auth-choices-BfWvatIg.js → provider-auth-choices-CqFh00uK.js} +1 -1
  367. package/dist/{provider-auth-guidance-D4-q7IHl.js → provider-auth-guidance-DmdBoDfS.js} +2 -2
  368. package/dist/{provider-auth-input-DnQ-RiX5.js → provider-auth-input-FZYEJh19.js} +46 -46
  369. package/dist/{provider-auth-login-D7eLUZwy.js → provider-auth-login-B-XedaK5.js} +1 -1
  370. package/dist/{provider-auth-login.runtime-BG_qqxZk.js → provider-auth-login.runtime-f9dxfJUB.js} +49 -49
  371. package/dist/{provider-model-allowlist-CC0lIQ6w.js → provider-model-allowlist-C16pn0B8.js} +1 -1
  372. package/dist/{provider-models-DbK6xrje.js → provider-models-PaymKOme.js} +1 -1
  373. package/dist/{provider-ollama-setup-B4RWr9oj.js → provider-ollama-setup-k5ozCUi2.js} +3 -3
  374. package/dist/{provider-onboarding-config-W5sF0oD8.js → provider-onboarding-config-qCltsaVl.js} +1 -1
  375. package/dist/{provider-runtime.runtime-Cva8S4wx.js → provider-runtime.runtime-CzVe0WBb.js} +46 -46
  376. package/dist/{provider-self-hosted-setup-jAzqLaqv.js → provider-self-hosted-setup-zxYnIftX.js} +3 -3
  377. package/dist/{provider-usage-CEgSCMW4.js → provider-usage-C9KdAhuS.js} +46 -46
  378. package/dist/{provider-usage-CCIC3SdY.js → provider-usage-DexJNI_0.js} +1 -1
  379. package/dist/{provider-wizard-DQd5eYhX.js → provider-wizard-D4RbMR2D.js} +2 -2
  380. package/dist/{push-apns-DQN5pcl6.js → push-apns-BAc0-Jy5.js} +1 -1
  381. package/dist/{pw-ai-BiXz8un2.js → pw-ai-C8v0s5wH.js} +6 -6
  382. package/dist/{qr-cli-B8bBpCd2.js → qr-cli-BpqLcmYC.js} +47 -47
  383. package/dist/{qr-cli-DOuhqzho.js → qr-cli-D0zqiQMl.js} +4 -4
  384. package/dist/{reactions-BkyHqIw4.js → reactions-CjJbniYK.js} +1 -1
  385. package/dist/{read-only-account-inspect-Cfaj7PFb.js → read-only-account-inspect-CEJ1r7AW.js} +3 -3
  386. package/dist/{read-only-account-inspect.discord.runtime-kreMwVgq.js → read-only-account-inspect.discord.runtime-C1n8r_Kj.js} +46 -46
  387. package/dist/{read-only-account-inspect.slack.runtime-DgV5VZ-n.js → read-only-account-inspect.slack.runtime-DAOzA9ke.js} +46 -46
  388. package/dist/{read-only-account-inspect.telegram.runtime-BQaHHCIS.js → read-only-account-inspect.telegram.runtime-CfNlnogC.js} +46 -46
  389. package/dist/{redact-snapshot-PisBVQFW.js → redact-snapshot-qQFn3bz8.js} +3 -3
  390. package/dist/{register.agent-CXTssAWM.js → register.agent-DC5QbIE7.js} +114 -114
  391. package/dist/{register.backup-MRTb86c6.js → register.backup-BRxspFkM.js} +6 -6
  392. package/dist/{register.configure-BfE3p-3h.js → register.configure-B7zhRBla.js} +120 -120
  393. package/dist/{register.maintenance-D_Gn-ZDc.js → register.maintenance-CCmppLW1.js} +65 -65
  394. package/dist/{register.message-s1z2QSP2.js → register.message-DSBPJS4x.js} +47 -47
  395. package/dist/{register.onboard-Cd-OV7xm.js → register.onboard-C4D9pjf7.js} +54 -54
  396. package/dist/{register.setup-DclQVR9m.js → register.setup-C4pDa0HW.js} +52 -52
  397. package/dist/{register.status-health-sessions-D-Xp8ae7.js → register.status-health-sessions-ClxLTjC5.js} +55 -55
  398. package/dist/{register.subclis-pcAQ13jU.js → register.subclis-BauDruMA.js} +30 -30
  399. package/dist/{register.subclis-BCvQmGkr.js → register.subclis-WyYRaoa-.js} +1 -1
  400. package/dist/{replies-DQwDaTBP.js → replies-CZGcXYVE.js} +1 -1
  401. package/dist/{reply-history-DVLrt4Es.js → reply-history-1yT9Tzib.js} +1 -1
  402. package/dist/{routes-CBWjQBhD.js → routes-D8CYDLDF.js} +5 -5
  403. package/dist/{rpc-O719GSVf.js → rpc-D8I_Qzen.js} +1 -1
  404. package/dist/{run-main-C_W2kjf-.js → run-main-BwEbDjI-.js} +19 -19
  405. package/dist/{runtime-COpSaRtb.js → runtime-CmSMHqwN.js} +1 -1
  406. package/dist/{runtime-PbP8BVEV.js → runtime-DQaeo-1L.js} +2 -2
  407. package/dist/{runtime-discord-ops.runtime-CmStqYK4.js → runtime-discord-ops.runtime-8w-055sR.js} +46 -46
  408. package/dist/{runtime-slack-ops.runtime-Cm1935hR.js → runtime-slack-ops.runtime-XJJrByCY.js} +48 -48
  409. package/dist/{runtime-telegram-ops.runtime-CKozoVxf.js → runtime-telegram-ops.runtime-wOdrd2eH.js} +46 -46
  410. package/dist/{sandbox-cli-BIyJ-1r-.js → sandbox-cli-CvFmY6Kq.js} +46 -46
  411. package/dist/{search-manager-BVE1EPHv.js → search-manager-ZNiamJHa.js} +6 -6
  412. package/dist/{search-manager-DMTYqpmg.js → search-manager-zaZ4tAYz.js} +5 -5
  413. package/dist/{secrets-cli-CMMtWzst.js → secrets-cli-D5a_lvAP.js} +47 -47
  414. package/dist/{security-cli-Bw4cVkTN.js → security-cli-DJovxmST.js} +47 -47
  415. package/dist/{send-CfI8y11o.js → send-C3KhjjcU.js} +1 -1
  416. package/dist/{send-C8HDmafP.js → send-CIkS5fLj.js} +2 -2
  417. package/dist/{server-0n2tu0ff.js → server-B1z10Ohi.js} +6 -6
  418. package/dist/{server-node-events-J5-mGOea.js → server-node-events-D3_b2nU-.js} +47 -47
  419. package/dist/{server-startup-matrix-migration-CMBUtdN2.js → server-startup-matrix-migration-DDRaKUPQ.js} +3 -3
  420. package/dist/{session-cost-usage-CrPCO4HN.js → session-cost-usage-BwIud0lY.js} +46 -46
  421. package/dist/{sessions-n_Z6bcbr.js → sessions-B5Pffwj6.js} +3 -3
  422. package/dist/{sessions-BK_M3Nu1.js → sessions-ClamZkvP.js} +47 -47
  423. package/dist/{setup-OCrVlmv7.js → setup-B8gsbmH4.js} +18 -18
  424. package/dist/{setup-core-BVBCTInv.js → setup-core-B6csKf5s.js} +2 -2
  425. package/dist/{setup-core-z8Q1sgUU.js → setup-core-DkgiVKzw.js} +2 -2
  426. package/dist/{setup-entry-CvuaW-4I.js → setup-entry-C8XH3da9.js} +2 -2
  427. package/dist/{setup-entry-Jf6V23s6.js → setup-entry-CMSlnfft.js} +3 -3
  428. package/dist/{setup-entry-Bo3chgoG.js → setup-entry-CZVAwPKZ.js} +2 -2
  429. package/dist/{setup-entry-Co-YP41_.js → setup-entry-Duh-ewBV.js} +3 -3
  430. package/dist/{setup-entry-BnSZlMP1.js → setup-entry-ksUWY45r.js} +2 -2
  431. package/dist/{setup-entry-BNSYJMzp.js → setup-entry-vQgAuveW.js} +2 -2
  432. package/dist/{setup-group-access-BYV3O8yu.js → setup-group-access-CTlnq-M9.js} +1 -1
  433. package/dist/{setup-surface-B6XBqyMJ.js → setup-surface-B7uYEI9F.js} +2 -2
  434. package/dist/{setup-surface-fixjWejm.js → setup-surface-CMgQr2R9.js} +5 -5
  435. package/dist/{setup-surface-CzzV3QV6.js → setup-surface-Yd-YLGfa.js} +46 -46
  436. package/dist/{setup-wizard-proxy-DFDQV7FN.js → setup-wizard-proxy-CHGAY6ob.js} +1 -1
  437. package/dist/{setup.finalize-WT9kXSLX.js → setup.finalize-C2bq4D8j.js} +58 -58
  438. package/dist/{setup.gateway-config-Bp50kjo3.js → setup.gateway-config-BGgVOvQf.js} +48 -48
  439. package/dist/{shared-CyR3Ki--.js → shared-BEMZg0vb.js} +5 -5
  440. package/dist/{shared-DXzPv5D7.js → shared-BYRyVoVx.js} +5 -5
  441. package/dist/{shared-DCOVJ3QB.js → shared-Bj3fwdyM.js} +4 -4
  442. package/dist/{shared-B8_JHpU2.js → shared-CSydqOgE.js} +4 -4
  443. package/dist/{shared-C3fKAUbw.js → shared-DLAg-pKT.js} +3 -3
  444. package/dist/{signal-D16eMrBf.js → signal-Dh6z2uaT.js} +5 -5
  445. package/dist/{signal-oGrspg1k.js → signal-FEtxekyc.js} +46 -46
  446. package/dist/{skills-cli-CY6lUTRv.js → skills-cli-9NuRJd3Z.js} +5 -5
  447. package/dist/{slack-ueYeeNF7.js → slack-Ci1VArkq.js} +48 -48
  448. package/dist/{slack-B1GgT1_u.js → slack-CjslLjTc.js} +5 -5
  449. package/dist/{slash-commands.runtime-1q-llUpe.js → slash-commands.runtime-COXzcGjL.js} +46 -46
  450. package/dist/{slash-dispatch.runtime-BqJ1FZZ6.js → slash-dispatch.runtime-D5j8d7dg.js} +47 -47
  451. package/dist/{slash-skill-commands.runtime-D-BEZgQ1.js → slash-skill-commands.runtime-6U65Nany.js} +46 -46
  452. package/dist/{status-CnKcjD2h.js → status-BWUft8B5.js} +16 -16
  453. package/dist/{status-C1BR9Hft.js → status-BjV1ysoW.js} +50 -50
  454. package/dist/{status-D_1nxvoi.js → status-CM77XYRR.js} +4 -4
  455. package/dist/{status-Dp3OriYl.js → status-D7XHAzLz.js} +46 -46
  456. package/dist/{status-DoSH4nEL.js → status-DwO4xEHI.js} +54 -54
  457. package/dist/{status-json-DwNPzoCk.js → status-json-BYDBfkr3.js} +19 -19
  458. package/dist/{status-B45v-A8b.js → status-yoA_KX2O.js} +1 -1
  459. package/dist/{status.link-channel-Cz8GoHZ2.js → status.link-channel-DkISMfW8.js} +2 -2
  460. package/dist/{status.scan.deps.runtime-BQGei2B_.js → status.scan.deps.runtime-B6__B0kL.js} +14 -14
  461. package/dist/{status.scan.runtime-D4HkKTZu.js → status.scan.runtime-BAkcX3vO.js} +2 -2
  462. package/dist/{status.summary-Dxo5qDuD.js → status.summary-DNaMhaXy.js} +8 -8
  463. package/dist/{subagent-orphan-recovery-BPa7yoId.js → subagent-orphan-recovery-DtK8inah.js} +46 -46
  464. package/dist/{subagent-registry-runtime-B6homy_H.js → subagent-registry-runtime-02s7QJo3.js} +46 -46
  465. package/dist/{synology-chat-DY8xNv_g.js → synology-chat-QURTpvMf.js} +2 -2
  466. package/dist/{system-cli-CkWRbLu4.js → system-cli-BXd7evEt.js} +7 -7
  467. package/dist/{system-run-command-jY6Is_ri.js → system-run-command-CQCx0f24.js} +1 -1
  468. package/dist/telegram/audit.js +1 -1
  469. package/dist/telegram/token.js +46 -46
  470. package/dist/{telegram-uQdpyLeS.js → telegram-Btwvg0PX.js} +46 -46
  471. package/dist/{telegram-Bnigf1Qe.js → telegram-Dh5gM1mc.js} +7 -7
  472. package/dist/{tool-policy-match-BLASiL8y.js → tool-policy-match-B6J0bSfQ.js} +1 -1
  473. package/dist/{tui-Dj52JiFV.js → tui-CKGcNyM8.js} +6 -6
  474. package/dist/{tui-cli-B4SN4wzX.js → tui-cli-D3CLnnB9.js} +47 -47
  475. package/dist/{update-cli-CEAEBCp2.js → update-cli-DQ4j_nIh.js} +69 -69
  476. package/dist/{update-offset-store-Bp1RjZK2.js → update-offset-store-RxVdgbyo.js} +46 -46
  477. package/dist/{upsert-with-lock-CFIy4b7I.js → upsert-with-lock-BqkAnFym.js} +1 -1
  478. package/dist/{web-media-BJ-azd7j.js → web-media-BM1Mg6AN.js} +1 -1
  479. package/dist/{webhook-shared-DYKTXPVw.js → webhook-shared-UDKLpQnU.js} +1 -1
  480. package/dist/{webhooks-cli-CEBJbLqS.js → webhooks-cli-Ca3PlK8h.js} +5 -5
  481. package/dist/{whatsapp-63jqHVrE.js → whatsapp-CHEvDa2g.js} +46 -46
  482. package/dist/{with-timeout-CvaBvNie.js → with-timeout-CvBH67nj.js} +2 -2
  483. package/dist/{workspace-DuH1agxz.js → workspace-uCYzunu4.js} +5 -33
  484. package/dist/{zalo-CTrI2C4i.js → zalo-Dr4ysJLW.js} +1 -1
  485. package/dist/{zalo-Sw_XHo3-.js → zalo-keqX1Wnx.js} +2 -2
  486. package/docs/concepts/agent-workspace.md +0 -5
  487. package/docs/concepts/memory.md +6 -12
  488. package/docs/plans/2026-03-22-semantic-cache-telemetry-docs-plan.md +1431 -0
  489. package/docs/plans/2026-03-22-supermemory-steals-plan.md +1679 -0
  490. package/docs/plans/2026-03-23-almost-perfect-sprint-plan.md +1080 -0
  491. package/docs/plans/2026-03-23-master-steal-list.md +224 -0
  492. package/docs/plans/2026-03-23-memory-md-deprecation-plan.md +632 -0
  493. package/docs/plans/2026-03-23-production-readiness-e2e-plan.md +659 -0
  494. package/docs/plans/2026-03-23-supermemory-audit-fixes-plan.md +1291 -0
  495. package/docs/reference/clawmongo-vs-default-memory.md +2 -2
  496. package/docs/reference/heart-brain-boundary.md +8 -10
  497. package/docs/reference/memory-config.md +3 -4
  498. package/docs/reference/mongodb-capabilities.md +246 -9
  499. package/docs/reference/templates/AGENTS.md +5 -10
  500. package/docs/research/2026-03-22-atlas-local-preview-web.md +41 -31
  501. package/docs/research/2026-03-23-agent-management-ui-github.md +482 -0
  502. package/docs/research/2026-03-23-almost-perfect-mongodb-docs.md +255 -0
  503. package/docs/research/2026-03-23-company-os-agent-ui-web.md +511 -0
  504. package/docs/research/2026-03-23-supermemory-audit-fixes-mongodb-research.md +995 -0
  505. package/docs/start/clawmongo-getting-started.md +1 -1
  506. package/package.json +1 -1
  507. /package/dist/{memory-BAVM2Jxh.js → memory-CcbELE82.js} +0 -0
@@ -0,0 +1,1080 @@
1
+ # Almost Perfect Sprint Implementation Plan
2
+
3
+ > **For Claude:** REQUIRED: Follow this plan task-by-task using TDD. Each phase extends `production-readiness.e2e.test.ts` and MUST NOT break the existing 66 tests.
4
+ > **Research:** See `docs/research/2026-03-23-almost-perfect-mongodb-docs.md` for MongoDB capability verification.
5
+
6
+ **Goal:** Implement 8 harmony-filtered memory improvements that are MongoDB-native, zero-risk to the existing 66 production-readiness tests, and verified against official MongoDB 8.2 documentation.
7
+
8
+ **Architecture:** Extend existing standalone-function pattern (db, prefix, ...) with new functions in existing modules. One new collection (`memory_mutations`), schema additions to existing collections, and prompt-engineering changes for entity extraction. All features are additive -- no breaking changes.
9
+
10
+ **Tech Stack:** TypeScript ESM, MongoDB 8.2 (community + mongot), Vitest, Voyage AI (autoEmbed)
11
+
12
+ **Prerequisites:** All 66 production-readiness.e2e.test.ts tests pass. MongoDB 8.2 with mongot available via atlas-local:preview.
13
+
14
+ ---
15
+
16
+ ## Plan Mode
17
+
18
+ - Plan mode: `execution_plan`
19
+ - Verification rigor: `critical_path`
20
+
21
+ ## Requirements Snapshot
22
+
23
+ 1. **Tiered Token-Efficient Retrieval** -- `$project` after `$vectorSearch` to return IDs+scores first, full content on demand
24
+ 2. **Mutation Audit Trail** -- Application-level audit records for structured_mem/entity/relation writes with before/after snapshots
25
+ 3. **Status Lifecycle** -- `status` field on episodes and chunks (active/archived/deleted) with retrieval filter
26
+ 4. **Procedural Memory Evolution** -- Version tracking, success/fail counts, and bounded evolution history on procedures
27
+ 5. **Conservative Graph Deletion** -- Conflict detection before graph entity/relation deletion, audit trail integration
28
+ 6. **Working Memory Bounds** -- Configurable capacity limit on session event queries with `$sort + $limit` optimization
29
+ 7. **Temporal Grounding** -- Date/time extraction in entity extractor prompts + `extractedAt` field on entities
30
+ 8. **Role-Based Memory Extraction** -- Separate extraction prompts for user vs assistant events + `sourceRole` field on entities
31
+
32
+ ## Constraints Snapshot
33
+
34
+ - MongoDB-native only (no external graph/vector DB)
35
+ - Zero risk to existing 66 production-readiness e2e tests
36
+ - Every feature verified against MongoDB 8.2 official docs
37
+ - Must extend `production-readiness.e2e.test.ts` with new Phase 14+
38
+ - Standalone function pattern (db, prefix, ...) -- not class methods
39
+ - Idempotent upserts with $setOnInsert for creation-time fields
40
+ - All new schema fields are optional (backward compatible)
41
+ - TypeScript strict typing, no `any`
42
+
43
+ ## In Scope
44
+
45
+ - 8 features listed above
46
+ - New `memory_mutations` collection + schema + indexes
47
+ - Schema additions to: `procedures`, `episodes`, `chunks`, `entities`
48
+ - New functions in existing modules
49
+ - New Phase 14-21 in production-readiness.e2e.test.ts (one phase per feature)
50
+ - Barrel exports from `src/memory/index.ts`
51
+
52
+ ## Out Of Scope
53
+
54
+ - ACT-R vitality, LLM mutation arbitration, RMH paradigm
55
+ - Q-value learning, LinUCB, co-occurrence auto-generation
56
+ - Emotional valence scoring
57
+ - Changes to searchV2 signature (only internal behavior changes)
58
+ - Changes to existing test assertions (zero regression)
59
+ - Vector search index definition changes (status filter deferred to when search indexes rebuilt)
60
+
61
+ ## Open Decisions
62
+
63
+ None -- all pre-answered by research and verification.
64
+
65
+ ## Differences From Agreement
66
+
67
+ None.
68
+
69
+ ## Recommended Defaults
70
+
71
+ - Working memory bound: 50 events (matches research recommendation, configurable)
72
+ - Mutation audit TTL: 90 days (7776000 seconds)
73
+ - Evolution history cap: 20 entries per procedure ($push + $slice: -20)
74
+ - Status lifecycle default: "active" (backward compatible)
75
+
76
+ ---
77
+
78
+ ## Critical-Path Verification Design
79
+
80
+ ### Behavior Contract
81
+
82
+ Each feature MUST satisfy:
83
+
84
+ 1. **Additive only** -- no existing collection schemas modified in breaking ways; all new fields optional
85
+ 2. **Idempotent** -- all write operations safe to retry
86
+ 3. **Isolated** -- each feature testable independently; no cross-feature coupling in Phase 14+
87
+ 4. **Observable** -- each feature emits telemetry via `emitTelemetry`
88
+ 5. **Bounded** -- no unbounded arrays or queries; all arrays capped, all queries limited
89
+
90
+ ### Edge-Case Catalog
91
+
92
+ | Feature | Edge Case | Mitigation |
93
+ | --------------------- | ------------------------------------- | ---------------------------------------------------------- |
94
+ | Tiered retrieval | Empty results from $vectorSearch | Return empty array, no expand step |
95
+ | Tiered retrieval | getEpisodesByIds with 0 IDs | Early return, no DB call |
96
+ | Mutation audit | oldValue is null (new insert) | Record operation as "create", oldValue: null |
97
+ | Mutation audit | Concurrent writes to same doc | Each mutation gets unique mutationId (randomUUID) |
98
+ | Status lifecycle | Episodes without status field | Default to "active" in queries via `$ne: "deleted"` filter |
99
+ | Status lifecycle | Archived episodes in time range query | `$ne: "deleted"` filter excludes only deleted |
100
+ | Procedural evolution | Procedure at version 0 (new) | $setOnInsert sets version: 1, evolutionHistory: [] |
101
+ | Procedural evolution | evolutionHistory at cap (20) | $push + $slice: -20 keeps bounded |
102
+ | Conservative deletion | Entity not found | Return { deletedEntity: false, deletedRelations: 0 } |
103
+ | Conservative deletion | Entity has 0 relations | Skip conflict check, proceed with delete |
104
+ | Working memory bounds | bound=0 | Clamp to minimum 1 |
105
+ | Working memory bounds | Fewer events than bound | Return all events |
106
+ | Temporal grounding | No dates in text | No temporal entities extracted, no error |
107
+ | Role-based extraction | role="system" or "tool" | Fall through to user prompt (safe default) |
108
+
109
+ ### Provable Properties
110
+
111
+ 1. `recordMutation` always writes to `memory_mutations` collection with TTL index -- never grows unbounded
112
+ 2. `evolutionHistory.length <= 20` enforced by `$push` + `$slice: -20`
113
+ 3. `workingMemoryBound >= 1` enforced by `Math.max(1, bound)` clamp
114
+ 4. All `status` queries use `{ status: { $ne: "deleted" } }` -- never return deleted records
115
+ 5. `sourceRole` is always `"user"` or `"assistant"` -- validated before write
116
+
117
+ ### Purity Boundary Map
118
+
119
+ | Module | Pure Functions | IO Functions |
120
+ | --------------------------- | ------------------------------- | ---------------------------------- |
121
+ | mongodb-mutations.ts | buildMutationRecord | recordMutation, getMutationHistory |
122
+ | mongodb-graph.ts | existing pure fns | deleteEntityConservative (new) |
123
+ | mongodb-episodes.ts | existing pure fns | getEpisodesByIds (new) |
124
+ | mongodb-events.ts | existing pure fns | getSessionEvents (new) |
125
+ | mongodb-entity-extractor.ts | buildExtractionPrompt variants | extract (existing) |
126
+ | mongodb-schema.ts | MEMORY_MUTATIONS_SCHEMA (const) | ensureCollections (modified) |
127
+
128
+ ### Verification Strategy
129
+
130
+ - **Unit tests:** Each new function gets dedicated tests via TDD
131
+ - **E2e tests:** Phase 14-21 in production-readiness.e2e.test.ts (8 new phases)
132
+ - **Regression:** All 66 existing tests must pass after every phase
133
+ - **Index health:** New indexes verified via explain() in Phase 4 additions
134
+ - **Scale:** New features tested against 200+ event dataset from Phase 13
135
+
136
+ ---
137
+
138
+ ## Relevant Codebase Files
139
+
140
+ ### Files to Modify
141
+
142
+ - `src/memory/mongodb-schema.ts` (lines 293-333, 570-610, 382-398, 698-748, 822-1220) -- Add MEMORY_MUTATIONS_SCHEMA, add status to EPISODES_SCHEMA/CHUNKS_SCHEMA, add evolution fields to PROCEDURES_SCHEMA, add sourceRole/extractedAt to ENTITIES_SCHEMA, add memory_mutations to ensureCollections/ensureStandardIndexes
143
+ - `src/memory/mongodb-graph.ts` (lines 768-800) -- Wrap deleteEntity with conflict detection + audit trail
144
+ - `src/memory/mongodb-episodes.ts` (lines 279-317) -- Add status filter + getEpisodesByIds
145
+ - `src/memory/mongodb-events.ts` (lines 40-60) -- Add getSessionEvents with working memory bound
146
+ - `src/memory/mongodb-entity-extractor.ts` (lines 170-265) -- Add role-based prompts + temporal grounding
147
+ - `src/memory/mongodb-manager.ts` (lines 2603-2660) -- Wire tiered retrieval projection mode into searchV2
148
+ - `src/memory/index.ts` -- Export new functions
149
+ - `src/memory/production-readiness.e2e.test.ts` -- Add Phase 14-21
150
+
151
+ ### Files to Create
152
+
153
+ - `src/memory/mongodb-mutations.ts` -- Mutation audit trail module
154
+ - `src/memory/mongodb-mutations.test.ts` -- Unit tests for mutations
155
+
156
+ ### Patterns to Follow
157
+
158
+ - `src/memory/mongodb-graph.ts` (lines 179-226) -- Standalone function pattern with db/prefix params
159
+ - `src/memory/mongodb-episodes.ts` (lines 98-273) -- Idempotent upsert with $setOnInsert
160
+ - `src/memory/mongodb-ops.ts` -- Simple CRUD module pattern
161
+ - `src/memory/mongodb-telemetry.ts` -- emitTelemetry fire-and-forget pattern
162
+
163
+ ---
164
+
165
+ ## Phase Plan
166
+
167
+ ### Phase 1: Mutation Audit Trail (Foundation)
168
+
169
+ **ID:** P1-mutations
170
+ **Objective:** Create `memory_mutations` collection with application-level audit records. This comes first because later phases (conservative graph deletion) depend on it.
171
+
172
+ **Inputs:** Research item #2 (app-level audit trail)
173
+
174
+ **Files:**
175
+
176
+ - Create: `src/memory/mongodb-mutations.ts`
177
+ - Create: `src/memory/mongodb-mutations.test.ts`
178
+ - Modify: `src/memory/mongodb-schema.ts` -- Add MEMORY_MUTATIONS_SCHEMA + collection helper + ensureCollections entry + indexes
179
+ - Modify: `src/memory/index.ts` -- Export new functions
180
+
181
+ **Implementation Details:**
182
+
183
+ New collection schema `memory_mutations`:
184
+
185
+ ```typescript
186
+ // Required fields
187
+ type MutationRecord = {
188
+ mutationId: string; // randomUUID
189
+ collectionName: string; // "structured_mem" | "entities" | "relations" | "procedures"
190
+ documentId: string; // _id or entityId of the modified document
191
+ operation: "create" | "update" | "delete";
192
+ agentId: string;
193
+ oldValue: Document | null; // null for creates
194
+ newValue: Document | null; // null for deletes
195
+ changedFields?: string[]; // field names that changed (for updates)
196
+ timestamp: Date;
197
+ actorRole?: "user" | "assistant" | "system";
198
+ };
199
+ ```
200
+
201
+ New indexes:
202
+
203
+ - `{ agentId: 1, collectionName: 1, timestamp: -1 }` (compound query index)
204
+ - `{ timestamp: 1 }` with `expireAfterSeconds: 7776000` (90-day TTL)
205
+ - `{ documentId: 1, collectionName: 1, timestamp: -1 }` (per-document history)
206
+
207
+ New functions in `mongodb-mutations.ts`:
208
+
209
+ ```typescript
210
+ export async function recordMutation(params: {
211
+ db: Db;
212
+ prefix: string;
213
+ mutation: Omit<MutationRecord, "mutationId" | "timestamp">;
214
+ }): Promise<{ mutationId: string }>;
215
+
216
+ export async function getMutationHistory(params: {
217
+ db: Db;
218
+ prefix: string;
219
+ agentId: string;
220
+ collectionName?: string;
221
+ documentId?: string;
222
+ limit?: number;
223
+ since?: Date;
224
+ }): Promise<MutationRecord[]>;
225
+ ```
226
+
227
+ **Expected Artifacts:**
228
+
229
+ - `src/memory/mongodb-mutations.ts` with recordMutation + getMutationHistory
230
+ - `src/memory/mongodb-mutations.test.ts` with ~8 tests
231
+ - Updated schema in `mongodb-schema.ts`
232
+
233
+ **TDD Scenarios:**
234
+
235
+ 1. `recordMutation` inserts a document into memory_mutations
236
+ 2. `getMutationHistory` returns records filtered by agentId
237
+ 3. `getMutationHistory` filters by collectionName
238
+ 4. `getMutationHistory` filters by documentId
239
+ 5. `getMutationHistory` respects limit
240
+ 6. `getMutationHistory` respects since date
241
+ 7. `recordMutation` with operation "create" stores oldValue as null
242
+ 8. `recordMutation` with operation "delete" stores newValue as null
243
+
244
+ **E2E Test (Phase 14):**
245
+
246
+ ```
247
+ Phase 14: Mutation Audit Trail
248
+ - records mutation on structured_mem write (verify count > 0)
249
+ - getMutationHistory returns correct collectionName filter
250
+ - mutation TTL index exists with expireAfterSeconds=7776000
251
+ - mutation records include changedFields for updates
252
+ ```
253
+
254
+ **Required Checks:**
255
+
256
+ - `pnpm test -- src/memory/mongodb-mutations.test.ts` -- all pass
257
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 66 existing + 4 new pass
258
+
259
+ **Checkpoint:** None (straightforward CRUD)
260
+
261
+ **Exit Criteria:**
262
+
263
+ - memory_mutations collection created with schema validation
264
+ - recordMutation + getMutationHistory work with unit tests
265
+ - Phase 14 e2e tests pass
266
+ - 0 regressions in existing 66 tests
267
+
268
+ ---
269
+
270
+ ### Phase 2: Status Lifecycle
271
+
272
+ **ID:** P2-status
273
+ **Objective:** Add `status` field (active/archived/deleted) to episodes and chunks schemas. Default retrieval queries filter `{ status: { $ne: "deleted" } }`.
274
+
275
+ **Inputs:** Research item #3 ($vectorSearch pre-filter on enum)
276
+
277
+ **Files:**
278
+
279
+ - Modify: `src/memory/mongodb-schema.ts` -- Add `status` to EPISODES_SCHEMA and CHUNKS_SCHEMA
280
+ - Modify: `src/memory/mongodb-episodes.ts` -- Add status filter to queries + `updateEpisodeStatus` function
281
+ - Modify: `src/memory/mongodb-manager.ts` -- searchV2 raw-window path adds `status: { $ne: "deleted" }` to chunk queries
282
+ - Modify: `src/memory/index.ts` -- Export updateEpisodeStatus
283
+
284
+ **Implementation Details:**
285
+
286
+ Schema additions (EPISODES_SCHEMA + CHUNKS_SCHEMA):
287
+
288
+ ```typescript
289
+ status: {
290
+ enum: ["active", "archived", "deleted"],
291
+ description: "Lifecycle status (default: active)"
292
+ }
293
+ ```
294
+
295
+ New function in `mongodb-episodes.ts`:
296
+
297
+ ```typescript
298
+ export async function updateEpisodeStatus(params: {
299
+ db: Db;
300
+ prefix: string;
301
+ episodeId: string;
302
+ agentId: string;
303
+ status: "active" | "archived" | "deleted";
304
+ }): Promise<boolean>;
305
+ ```
306
+
307
+ Query changes:
308
+
309
+ - `getEpisodesByTimeRange`: add `status: { $ne: "deleted" }` to filter
310
+ - `getEpisodesByType`: add `status: { $ne: "deleted" }` to filter
311
+ - `searchEpisodes`: add `status: { $ne: "deleted" }` to filter
312
+ - searchV2 raw-window path: add `status: { $ne: "deleted" }` to chunk filter
313
+ - New episodes default to `status: "active"` via $setOnInsert in materializeEpisode
314
+
315
+ **Critical consideration:** Existing episodes have no `status` field. `{ $ne: "deleted" }` matches documents where the field is absent or any value other than "deleted", so all existing episodes are included. This is backward compatible by design.
316
+
317
+ **TDD Scenarios:**
318
+
319
+ 1. `updateEpisodeStatus` sets status field on episode
320
+ 2. `getEpisodesByTimeRange` excludes deleted episodes
321
+ 3. `getEpisodesByTimeRange` includes episodes without status field (backward compat)
322
+ 4. `searchEpisodes` excludes deleted episodes
323
+ 5. `materializeEpisode` sets status: "active" on new episodes
324
+
325
+ **E2E Test (Phase 15):**
326
+
327
+ ```
328
+ Phase 15: Status Lifecycle
329
+ - new episodes have status "active"
330
+ - updateEpisodeStatus changes status to "archived"
331
+ - archived episodes still returned by time-range queries (only deleted excluded)
332
+ - deleted episodes excluded from search results
333
+ ```
334
+
335
+ **Required Checks:**
336
+
337
+ - `pnpm test -- src/memory/mongodb-episodes.test.ts` -- all pass
338
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 70+ tests pass, 0 regressions
339
+
340
+ **Checkpoint:** None
341
+
342
+ **Exit Criteria:**
343
+
344
+ - Episodes and chunks have optional `status` field
345
+ - Retrieval queries filter out deleted records
346
+ - Backward compatible (existing records without status still returned)
347
+ - Phase 15 e2e tests pass
348
+
349
+ ---
350
+
351
+ ### Phase 3: Procedural Memory Evolution
352
+
353
+ **ID:** P3-procedures
354
+ **Objective:** Add version tracking, success/fail counts, and bounded evolution history to the procedures collection.
355
+
356
+ **Inputs:** Research item #4 (document versioning pattern)
357
+
358
+ **Files:**
359
+
360
+ - Modify: `src/memory/mongodb-schema.ts` -- Add evolution fields to PROCEDURES_SCHEMA
361
+ - Create or modify: `src/memory/mongodb-procedures.ts` -- Add `evolveProcedure` and `recordProcedureOutcome` functions
362
+ - Modify: `src/memory/index.ts` -- Export new functions
363
+
364
+ **Implementation Details:**
365
+
366
+ Schema additions (PROCEDURES_SCHEMA):
367
+
368
+ ```typescript
369
+ version: { bsonType: "number", minimum: 1, description: "Current version number" },
370
+ successCount: { bsonType: "number", minimum: 0 },
371
+ failCount: { bsonType: "number", minimum: 0 },
372
+ lastSuccessAt: { bsonType: "date" },
373
+ lastFailureAt: { bsonType: "date" },
374
+ evolutionHistory: {
375
+ bsonType: "array",
376
+ items: {
377
+ bsonType: "object",
378
+ properties: {
379
+ version: { bsonType: "number" },
380
+ changeType: { bsonType: "string" },
381
+ changeDescription: { bsonType: "string" },
382
+ timestamp: { bsonType: "date" },
383
+ },
384
+ },
385
+ description: "Capped at 20 entries via $push + $slice: -20"
386
+ }
387
+ ```
388
+
389
+ New functions:
390
+
391
+ ```typescript
392
+ // Record success/fail outcome on a procedure (atomic $inc)
393
+ export async function recordProcedureOutcome(params: {
394
+ db: Db;
395
+ prefix: string;
396
+ procedureId: string;
397
+ agentId: string;
398
+ scope: MemoryScope;
399
+ scopeRef?: string;
400
+ success: boolean;
401
+ }): Promise<boolean>;
402
+
403
+ // Evolve a procedure: bump version, update steps, record in evolutionHistory
404
+ export async function evolveProcedure(params: {
405
+ db: Db;
406
+ prefix: string;
407
+ procedureId: string;
408
+ agentId: string;
409
+ scope: MemoryScope;
410
+ scopeRef?: string;
411
+ newSteps: string[];
412
+ changeType: string;
413
+ changeDescription: string;
414
+ }): Promise<{ newVersion: number }>;
415
+ ```
416
+
417
+ MongoDB pattern for evolveProcedure:
418
+
419
+ ```javascript
420
+ db.procedures.updateOne(
421
+ { procedureId, agentId, scope, scopeRef },
422
+ {
423
+ $inc: { version: 1 },
424
+ $set: { steps: newSteps, updatedAt: new Date() },
425
+ $push: {
426
+ evolutionHistory: {
427
+ $each: [{ version, changeType, changeDescription, timestamp }],
428
+ $slice: -20,
429
+ },
430
+ },
431
+ },
432
+ );
433
+ ```
434
+
435
+ **TDD Scenarios:**
436
+
437
+ 1. `recordProcedureOutcome` increments successCount on success
438
+ 2. `recordProcedureOutcome` increments failCount on failure
439
+ 3. `recordProcedureOutcome` sets lastSuccessAt/lastFailureAt
440
+ 4. `evolveProcedure` increments version
441
+ 5. `evolveProcedure` updates steps
442
+ 6. `evolveProcedure` appends to evolutionHistory
443
+ 7. `evolveProcedure` caps evolutionHistory at 20 via $slice
444
+ 8. New procedures get version: 1, successCount: 0, failCount: 0
445
+
446
+ **E2E Test (Phase 16):**
447
+
448
+ ```
449
+ Phase 16: Procedural Memory Evolution
450
+ - recordProcedureOutcome increments counts atomically
451
+ - evolveProcedure bumps version and records history
452
+ - evolutionHistory is bounded at 20 entries
453
+ - procedure version and counts survive concurrent updates
454
+ ```
455
+
456
+ **Required Checks:**
457
+
458
+ - Unit tests for new functions pass
459
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 74+ tests pass, 0 regressions
460
+
461
+ **Checkpoint:** None
462
+
463
+ **Exit Criteria:**
464
+
465
+ - Procedures collection extended with version/evolution fields
466
+ - $inc + $push + $slice pattern works atomically
467
+ - Phase 16 e2e tests pass
468
+ - Bounded arrays proven (provable property #2)
469
+
470
+ ---
471
+
472
+ ### Phase 4: Mutation Audit Integration
473
+
474
+ **ID:** P4-audit-integration
475
+ **Objective:** Wire mutation audit into structured_mem writes and entity/relation writes. This phase depends on Phase 1 (mutations module exists).
476
+
477
+ **Inputs:** Phase 1 (mongodb-mutations.ts)
478
+
479
+ **Files:**
480
+
481
+ - Modify: `src/memory/mongodb-structured-memory.ts` -- Add recordMutation call after upsertStructured
482
+ - Modify: `src/memory/mongodb-graph.ts` -- Add recordMutation call after upsertEntity and upsertRelation
483
+
484
+ **Implementation Details:**
485
+
486
+ In `upsertStructuredMemory` (mongodb-structured-memory.ts):
487
+
488
+ - After the updateOne call, fire-and-forget `recordMutation` with operation "create" or "update"
489
+ - For updates: read old value before write (find + updateOne), compute changedFields
490
+ - Use Promise.allSettled to not block the write path
491
+
492
+ In `upsertEntity` (mongodb-graph.ts):
493
+
494
+ - After the updateOne call, fire-and-forget `recordMutation`
495
+ - For new entities: operation "create", oldValue: null
496
+ - For updates: operation "update" (old value approximated from $set fields)
497
+
498
+ In `upsertRelation` (mongodb-graph.ts):
499
+
500
+ - Same pattern as upsertEntity
501
+
502
+ **Critical consideration:** Audit writes are fire-and-forget (Promise.allSettled). If the audit fails, the primary write still succeeds. This preserves the existing behavior contract.
503
+
504
+ **TDD Scenarios:**
505
+
506
+ 1. Structured memory upsert records a mutation
507
+ 2. Entity upsert records a mutation
508
+ 3. Relation upsert records a mutation
509
+ 4. Audit failure does not break primary write (mock recordMutation to throw)
510
+ 5. Update operations record changedFields
511
+
512
+ **E2E Test (Phase 17):**
513
+
514
+ ```
515
+ Phase 17: Audit Integration
516
+ - structured memory write produces mutation record
517
+ - entity upsert produces mutation record
518
+ - mutation records have correct operation type (create vs update)
519
+ - getMutationHistory returns records sorted by timestamp desc
520
+ ```
521
+
522
+ **Required Checks:**
523
+
524
+ - Unit tests pass
525
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 78+ tests pass, 0 regressions
526
+
527
+ **[CHECKPOINT] Dependency gate:** Phase 1 must be complete before Phase 4 can start.
528
+
529
+ **Exit Criteria:**
530
+
531
+ - All structured_mem/entity/relation writes produce audit records
532
+ - Audit writes are fire-and-forget (non-blocking)
533
+ - Phase 17 e2e tests pass
534
+
535
+ ---
536
+
537
+ ### Phase 5: Conservative Graph Deletion
538
+
539
+ **ID:** P5-graph-delete
540
+ **Objective:** Wrap `deleteEntity` with conflict detection (check relation count) and audit trail integration. Depends on Phase 1 (mutations) and Phase 4 (audit integration).
541
+
542
+ **Inputs:** Research item #5 (conservative graph deletion)
543
+
544
+ **Files:**
545
+
546
+ - Modify: `src/memory/mongodb-graph.ts` -- Add `deleteEntityConservative` function
547
+
548
+ **Implementation Details:**
549
+
550
+ New function in `mongodb-graph.ts`:
551
+
552
+ ```typescript
553
+ export async function deleteEntityConservative(params: {
554
+ db: Db;
555
+ prefix: string;
556
+ entityId: string;
557
+ agentId: string;
558
+ force?: boolean; // skip conflict check
559
+ }): Promise<{
560
+ deletedEntity: boolean;
561
+ deletedRelations: number;
562
+ conflictDetected: boolean;
563
+ conflictingRelationCount?: number;
564
+ auditRecorded: boolean;
565
+ }>;
566
+ ```
567
+
568
+ Logic:
569
+
570
+ 1. Query relations collection for `{ $or: [{ fromEntityId }, { toEntityId }], agentId }` with count
571
+ 2. If relations exist and `force !== true`:
572
+ - Return `{ deletedEntity: false, conflictDetected: true, conflictingRelationCount }`
573
+ - Do NOT delete
574
+ 3. If force=true or no relations:
575
+ - Read entity document before delete (for audit oldValue)
576
+ - Call existing `deleteEntity`
577
+ - Record mutation via `recordMutation` with operation "delete"
578
+ - Return result
579
+
580
+ Existing `deleteEntity` remains unchanged (backward compatible). `deleteEntityConservative` is the new safe wrapper.
581
+
582
+ **TDD Scenarios:**
583
+
584
+ 1. Entity with relations: returns conflictDetected=true, does not delete
585
+ 2. Entity with no relations: deletes and records audit
586
+ 3. Entity with relations + force=true: deletes, records audit
587
+ 4. Entity not found: returns deletedEntity=false, conflictDetected=false
588
+ 5. Audit failure does not prevent deletion (fire-and-forget)
589
+
590
+ **E2E Test (Phase 18):**
591
+
592
+ ```
593
+ Phase 18: Conservative Graph Deletion
594
+ - deleteEntityConservative blocks deletion when relations exist
595
+ - deleteEntityConservative with force=true deletes despite relations
596
+ - deletion produces mutation audit record
597
+ - entity with no relations deletes without conflict
598
+ ```
599
+
600
+ **Required Checks:**
601
+
602
+ - Unit tests pass
603
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 82+ tests pass, 0 regressions
604
+
605
+ **[CHECKPOINT] Dependency gate:** Phase 1 and Phase 4 must be complete.
606
+
607
+ **Exit Criteria:**
608
+
609
+ - `deleteEntityConservative` prevents accidental data loss
610
+ - Audit trail records all deletions
611
+ - Existing `deleteEntity` unchanged (backward compatible)
612
+ - Phase 18 e2e tests pass
613
+
614
+ ---
615
+
616
+ ### Phase 6: Working Memory Bounds
617
+
618
+ **ID:** P6-working-memory
619
+ **Objective:** Add configurable capacity limit on session event queries using `$sort + $limit` optimization (MongoDB coalesces adjacent $sort + $limit).
620
+
621
+ **Inputs:** Research item #6 ($sort + $limit optimization)
622
+
623
+ **Files:**
624
+
625
+ - Modify: `src/memory/mongodb-events.ts` -- Add `getSessionEventsWithBound` function
626
+ - Modify: `src/memory/mongodb-manager.ts` -- Wire into searchV2 raw-window path
627
+ - Modify: `src/memory/index.ts` -- Export new function
628
+
629
+ **Implementation Details:**
630
+
631
+ New function in `mongodb-events.ts`:
632
+
633
+ ```typescript
634
+ export async function getSessionEventsWithBound(params: {
635
+ db: Db;
636
+ prefix: string;
637
+ agentId: string;
638
+ sessionId: string;
639
+ bound?: number; // default 50, minimum 1
640
+ scope?: MemoryScope;
641
+ scopeRef?: string;
642
+ }): Promise<CanonicalEvent[]>;
643
+ ```
644
+
645
+ Implementation:
646
+
647
+ ```javascript
648
+ const effectiveBound = Math.max(1, bound ?? 50);
649
+ db.events
650
+ .find({ agentId, sessionId, ...scopeFilter })
651
+ .sort({ timestamp: -1 })
652
+ .limit(effectiveBound)
653
+ .toArray();
654
+ // Reverse to chronological order after fetch
655
+ ```
656
+
657
+ MongoDB $sort + $limit optimization: when $sort precedes $limit with no intervening stages, the optimizer coalesces them so only top-N are tracked during sort.
658
+
659
+ Existing index `{ sessionId: 1, timestamp: -1 }` (idx_events_session_ts) already supports this pattern.
660
+
661
+ **TDD Scenarios:**
662
+
663
+ 1. Returns at most `bound` events
664
+ 2. Default bound is 50
665
+ 3. bound=0 clamped to 1
666
+ 4. Fewer events than bound returns all events
667
+ 5. Events returned in chronological order (oldest first)
668
+ 6. Respects agentId filter
669
+
670
+ **E2E Test (Phase 19):**
671
+
672
+ ```
673
+ Phase 19: Working Memory Bounds
674
+ - getSessionEventsWithBound returns at most N events
675
+ - bound clamp: bound=0 returns 1 event (not 0)
676
+ - events returned in chronological order
677
+ - uses idx_events_session_ts index (explain)
678
+ ```
679
+
680
+ **Required Checks:**
681
+
682
+ - Unit tests pass
683
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 86+ tests pass, 0 regressions
684
+
685
+ **Checkpoint:** None
686
+
687
+ **Exit Criteria:**
688
+
689
+ - Working memory bounded by configurable limit
690
+ - $sort + $limit optimization verified via explain
691
+ - Provable property #3 (bound >= 1) enforced
692
+ - Phase 19 e2e tests pass
693
+
694
+ ---
695
+
696
+ ### Phase 7: Temporal Grounding in Entity Extraction
697
+
698
+ **ID:** P7-temporal
699
+ **Objective:** Enhance entity extraction prompts to include temporal grounding (dates/times). Add optional `extractedAt` field to entities schema.
700
+
701
+ **Inputs:** Research item #7 (prompt-level, no MongoDB feature needed)
702
+
703
+ **Files:**
704
+
705
+ - Modify: `src/memory/mongodb-entity-extractor.ts` -- Add temporal grounding to LLM prompt
706
+ - Modify: `src/memory/mongodb-schema.ts` -- Add `extractedAt` to ENTITIES_SCHEMA
707
+
708
+ **Implementation Details:**
709
+
710
+ Schema addition (ENTITIES_SCHEMA):
711
+
712
+ ```typescript
713
+ extractedAt: { bsonType: "date", description: "When this entity was extracted" }
714
+ ```
715
+
716
+ Prompt modification in `buildExtractionPrompt`:
717
+
718
+ ```typescript
719
+ // Add temporal grounding instruction
720
+ `Rules:
721
+ - Only extract entities explicitly mentioned in the text
722
+ - Do not invent entities that are not present
723
+ - When extracting facts, ALWAYS include dates/times if mentioned in the text
724
+ Example: "met with Alice on May 7, 2023" should extract "Alice" AND "May 7, 2023" as entities
725
+ - Extract dates as type "concept" with name as the date string
726
+ - Confidence should be 0.0-1.0 based on how certain you are
727
+ - Normalize names (capitalize properly, no leading/trailing whitespace)`;
728
+ ```
729
+
730
+ RegexEntityExtractor enhancement -- add date pattern:
731
+
732
+ ```typescript
733
+ const DATE_REGEX = /\b(\d{4}-\d{2}-\d{2}|\w+ \d{1,2},? \d{4}|\d{1,2}\/\d{1,2}\/\d{4})\b/g;
734
+ // Extract matches as type "concept" with confidence 0.7
735
+ ```
736
+
737
+ Entity upsert: when extractedAt is not set on the entity, the graph module sets it to `new Date()`.
738
+
739
+ **TDD Scenarios:**
740
+
741
+ 1. LLM prompt includes temporal grounding instruction
742
+ 2. Regex extractor finds ISO dates (2023-05-07)
743
+ 3. Regex extractor finds natural dates (May 7, 2023)
744
+ 4. Regex extractor finds US dates (5/7/2023)
745
+ 5. No dates in text: no temporal entities extracted
746
+ 6. Entity upsert includes extractedAt timestamp
747
+
748
+ **E2E Test (Phase 20):**
749
+
750
+ ```
751
+ Phase 20: Temporal Grounding
752
+ - entity extraction captures date references from event text
753
+ - extractedAt field set on newly extracted entities
754
+ - date entity has type "concept"
755
+ - text without dates: no temporal entities extracted
756
+ ```
757
+
758
+ **Required Checks:**
759
+
760
+ - `pnpm test -- src/memory/mongodb-entity-extractor.test.ts` -- all pass
761
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 90+ tests pass, 0 regressions
762
+
763
+ **Checkpoint:** None
764
+
765
+ **Exit Criteria:**
766
+
767
+ - Entity extraction captures temporal references
768
+ - extractedAt field populated on entities
769
+ - Backward compatible (existing entities without extractedAt still work)
770
+ - Phase 20 e2e tests pass
771
+
772
+ ---
773
+
774
+ ### Phase 8: Role-Based Memory Extraction
775
+
776
+ **ID:** P8-role-extraction
777
+ **Objective:** Use different extraction prompts for user vs assistant events. Add `sourceRole` field to entities schema.
778
+
779
+ **Inputs:** Research item #8 (prompt-level, no MongoDB feature needed)
780
+
781
+ **Files:**
782
+
783
+ - Modify: `src/memory/mongodb-entity-extractor.ts` -- Add role-aware prompts + `sourceRole` to ExtractedEntity type
784
+ - Modify: `src/memory/mongodb-schema.ts` -- Add `sourceRole` to ENTITIES_SCHEMA
785
+ - Modify: `src/memory/mongodb-graph.ts` -- Pass `sourceRole` to entity upsert, set on entity document
786
+
787
+ **Implementation Details:**
788
+
789
+ Schema addition (ENTITIES_SCHEMA):
790
+
791
+ ```typescript
792
+ sourceRole: {
793
+ enum: ["user", "assistant"],
794
+ description: "Role of the event that produced this entity"
795
+ }
796
+ ```
797
+
798
+ New prompt builders in `mongodb-entity-extractor.ts`:
799
+
800
+ ```typescript
801
+ export function buildUserExtractionPrompt(
802
+ content: string,
803
+ context?: EntityExtractionContext,
804
+ ): string {
805
+ // Focus on: user preferences, personal facts, relationships, goals
806
+ return `Extract entities from the following USER message. Focus on:
807
+ - People the user mentions (type: person)
808
+ - User preferences and interests (type: concept)
809
+ - Projects or tools the user references (type: project)
810
+ - Locations (type: location)
811
+ - Organizations (type: org)
812
+ ...`;
813
+ }
814
+
815
+ export function buildAssistantExtractionPrompt(
816
+ content: string,
817
+ context?: EntityExtractionContext,
818
+ ): string {
819
+ // Focus on: capabilities used, tools invoked, approaches taken
820
+ return `Extract entities from the following ASSISTANT response. Focus on:
821
+ - Tools or capabilities mentioned (type: system)
822
+ - Technical concepts discussed (type: concept)
823
+ - Projects being worked on (type: project)
824
+ - People referenced (type: person)
825
+ ...`;
826
+ }
827
+ ```
828
+
829
+ Updated `LLMEntityExtractor.extract`:
830
+
831
+ ```typescript
832
+ async extract(content: string, context?: EntityExtractionContext & { role?: string }): Promise<ExtractedEntity[]> {
833
+ const role = context?.role;
834
+ // Choose prompt based on role
835
+ const prompt = role === "assistant"
836
+ ? buildAssistantExtractionPrompt(content, context)
837
+ : buildUserExtractionPrompt(content, context);
838
+ // ... existing logic with role-specific prompt
839
+ }
840
+ ```
841
+
842
+ Updated `extractAndUpsertEntities` in `mongodb-graph.ts`:
843
+
844
+ ```typescript
845
+ // Accept optional role parameter
846
+ export async function extractAndUpsertEntities(params: {
847
+ // ... existing params
848
+ role?: "user" | "assistant" | "system" | "tool";
849
+ }): Promise<...> {
850
+ // Pass role to extractor context
851
+ // Set sourceRole on entity upsert doc
852
+ }
853
+ ```
854
+
855
+ **TDD Scenarios:**
856
+
857
+ 1. `buildUserExtractionPrompt` includes user-specific focus areas
858
+ 2. `buildAssistantExtractionPrompt` includes assistant-specific focus areas
859
+ 3. LLMEntityExtractor uses user prompt for role="user"
860
+ 4. LLMEntityExtractor uses assistant prompt for role="assistant"
861
+ 5. LLMEntityExtractor defaults to user prompt for unknown roles
862
+ 6. Entity upsert sets sourceRole field
863
+ 7. sourceRole validated as "user" or "assistant" before write
864
+
865
+ **E2E Test (Phase 21):**
866
+
867
+ ```
868
+ Phase 21: Role-Based Memory Extraction
869
+ - entity extracted from user event has sourceRole "user"
870
+ - entity extracted from assistant event has sourceRole "assistant"
871
+ - sourceRole field persisted on entity document
872
+ - regex extractor returns entities regardless of role (no regression)
873
+ ```
874
+
875
+ **Required Checks:**
876
+
877
+ - `pnpm test -- src/memory/mongodb-entity-extractor.test.ts` -- all pass
878
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- 94+ tests pass, 0 regressions
879
+
880
+ **Checkpoint:** None
881
+
882
+ **Exit Criteria:**
883
+
884
+ - Role-specific extraction prompts reduce hallucination
885
+ - sourceRole field tracks extraction source
886
+ - Backward compatible (existing entities without sourceRole still work)
887
+ - Phase 21 e2e tests pass
888
+
889
+ ---
890
+
891
+ ### Phase 9: Tiered Token-Efficient Retrieval
892
+
893
+ **ID:** P9-tiered
894
+ **Objective:** Add projection mode to searchV2 and episode queries to return IDs+scores first, then expand to full content on demand. This phase is last because it modifies the searchV2 internal behavior.
895
+
896
+ **Inputs:** Research item #1 ($project after $vectorSearch)
897
+
898
+ **Files:**
899
+
900
+ - Modify: `src/memory/mongodb-episodes.ts` -- Add `getEpisodesByIds` function
901
+ - Modify: `src/memory/mongodb-manager.ts` -- Add `projection` option to searchV2 context
902
+ - Modify: `src/memory/index.ts` -- Export getEpisodesByIds
903
+
904
+ **Implementation Details:**
905
+
906
+ New function in `mongodb-episodes.ts`:
907
+
908
+ ```typescript
909
+ export async function getEpisodesByIds(params: {
910
+ db: Db;
911
+ prefix: string;
912
+ episodeIds: string[];
913
+ agentId: string;
914
+ projection?: "full" | "ids-only";
915
+ }): Promise<Episode[]>;
916
+ ```
917
+
918
+ searchV2 context extension:
919
+
920
+ ```typescript
921
+ context: {
922
+ // ... existing fields
923
+ searchOptions?: {
924
+ // ... existing fields
925
+ projection?: "full" | "ids-only"; // default "full" (backward compatible)
926
+ };
927
+ };
928
+ ```
929
+
930
+ When `projection: "ids-only"`:
931
+
932
+ - Episodic path uses `$project: { _id: 1, episodeId: 1, title: 1, score: { $meta: "vectorSearchScore" } }` (lightweight)
933
+ - Conversation path uses `$project: { _id: 1, path: 1, score: { $meta: "vectorSearchScore" } }` (lightweight)
934
+ - Result `text` field is empty string (caller must fetch full content separately)
935
+
936
+ When `projection: "full"` (default):
937
+
938
+ - Existing behavior unchanged
939
+
940
+ **TDD Scenarios:**
941
+
942
+ 1. `getEpisodesByIds` returns episodes by ID list
943
+ 2. `getEpisodesByIds` returns empty array for empty IDs
944
+ 3. `getEpisodesByIds` respects agentId filter
945
+ 4. searchV2 with projection: "ids-only" returns results with empty text
946
+ 5. searchV2 with projection: "full" returns results with full text (default)
947
+ 6. searchV2 default behavior unchanged (backward compatible)
948
+
949
+ **E2E Test (Phase 22 -- bonus consolidated):**
950
+
951
+ ```
952
+ Phase 22: Tiered Retrieval
953
+ - getEpisodesByIds returns correct episodes
954
+ - getEpisodesByIds with empty array returns empty
955
+ - searchV2 projection: "ids-only" returns lightweight results
956
+ - searchV2 default projection unchanged (backward compat)
957
+ ```
958
+
959
+ **Required Checks:**
960
+
961
+ - Unit tests pass
962
+ - `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- all tests pass, 0 regressions
963
+
964
+ **Checkpoint:** None
965
+
966
+ **Exit Criteria:**
967
+
968
+ - IDs-only retrieval mode available for token-efficient use
969
+ - Default behavior preserved (backward compatible)
970
+ - Phase 22 e2e tests pass
971
+
972
+ ---
973
+
974
+ ## Final Validation Phase
975
+
976
+ **ID:** P10-final
977
+ **Objective:** Run full regression + constant verification + export wiring.
978
+
979
+ **Steps:**
980
+
981
+ 1. Run `pnpm test -- src/memory/production-readiness.e2e.test.ts` -- all phases pass
982
+ 2. Run `pnpm test -- src/memory/` -- full memory module regression
983
+ 3. Run `pnpm build` -- build exit 0
984
+ 4. Verify EXPECTED_COLLECTION_SUFFIXES in `src/memory/mongodb-e2e.e2e.test.ts` updated (was 21 with telemetry, now 22 with memory_mutations)
985
+ 5. Verify EXPECTED_STANDARD_INDEX_COUNT in `src/memory/mongodb-e2e.e2e.test.ts` updated (was 58, now 61 with +3 for memory_mutations indexes)
986
+ 6. Verify all new functions exported from `src/memory/index.ts`
987
+
988
+ **Exit Criteria:**
989
+
990
+ - All production-readiness tests pass (66 existing + ~32 new = ~98 total)
991
+ - Build passes
992
+ - No TypeScript errors in new code
993
+ - Collection and index counts match constants
994
+
995
+ ---
996
+
997
+ ## Phase Dependency Graph
998
+
999
+ ```
1000
+ P1 (Mutations) ─────────────> P4 (Audit Integration) ───> P5 (Conservative Delete)
1001
+ P2 (Status Lifecycle) ────────────────────────────────┐
1002
+ P3 (Procedural Evolution) ────────────────────────────┤
1003
+ P6 (Working Memory Bounds) ───────────────────────────┤
1004
+ P7 (Temporal Grounding) ──────────────────────────────┼──> P10 (Final Validation)
1005
+ P8 (Role-Based Extraction) ───────────────────────────┤
1006
+ P9 (Tiered Retrieval) ────────────────────────────────┘
1007
+ ```
1008
+
1009
+ Phases 2, 3, 6, 7, 8, 9 are independent of each other and of P1.
1010
+ P4 depends on P1. P5 depends on P1 and P4.
1011
+ All phases feed into P10 (final validation).
1012
+
1013
+ ## Acceptance Checks
1014
+
1015
+ 1. `MONGODB_TEST_URI=<uri> pnpm test -- src/memory/production-readiness.e2e.test.ts` -- all phases pass
1016
+ 2. `pnpm test -- src/memory/` -- 0 regressions in memory module
1017
+ 3. `pnpm build` -- exit 0
1018
+ 4. `pnpm check` -- clean (pre-existing baseline only)
1019
+ 5. Each new function has at least 3 unit tests
1020
+ 6. Each feature has at least 3 e2e test assertions
1021
+ 7. No `any` types in new code
1022
+ 8. All new collections have schema validation
1023
+ 9. All new indexes named with `idx_` or `uq_` prefix convention
1024
+ 10. Mutation audit TTL verified at 90 days (7776000s)
1025
+
1026
+ ## Risks And Mitigations
1027
+
1028
+ | Risk | Probability | Impact | Score | Mitigation |
1029
+ | ----------------------------------------------- | ----------- | ------ | ----- | -------------------------------------------------------------------- |
1030
+ | Status filter breaks existing queries | 1 | 5 | 5 | `$ne: "deleted"` matches docs without status field (backward compat) |
1031
+ | Mutation audit adds write latency | 2 | 2 | 4 | Fire-and-forget via Promise.allSettled |
1032
+ | Evolution history unbounded | 1 | 3 | 3 | `$push + $slice: -20` enforced in MongoDB atomic op |
1033
+ | Conservative delete blocks legitimate deletions | 2 | 2 | 4 | `force: true` override parameter |
1034
+ | Temporal regex matches non-dates | 2 | 1 | 2 | Low confidence (0.5) on regex matches; LLM path more accurate |
1035
+ | Role-based prompts reduce entity recall | 2 | 2 | 4 | Regex fallback unaffected; LLM timeout falls back to regex |
1036
+ | EXPECTED_INDEX_COUNT drift | 3 | 1 | 3 | Final validation phase explicitly verifies count |
1037
+ | Tiered retrieval empty text confuses callers | 1 | 3 | 3 | Only used when explicitly requested via projection param |
1038
+
1039
+ ---
1040
+
1041
+ ## Summary
1042
+
1043
+ - Plan saved: docs/plans/2026-03-23-almost-perfect-sprint-plan.md
1044
+ - Phases: 10 (8 features + 1 integration + 1 final validation)
1045
+ - Risks: 8 identified (all LOW score)
1046
+ - Key decisions: app-level audit over Change Streams, `$ne: "deleted"` for backward compat, fire-and-forget audit writes, $push + $slice for bounded arrays
1047
+ - New collection: `memory_mutations`
1048
+ - New functions: ~12 across 6 modules
1049
+ - New tests: ~32 e2e + ~40 unit = ~72 new tests
1050
+ - Total e2e target: ~98 tests (66 existing + ~32 new)
1051
+
1052
+ ## Recommended Skills for BUILD (SKILL_HINTS for Router)
1053
+
1054
+ - `cc10x:architecture-patterns` (multi-component schema/integration work)
1055
+
1056
+ ## Confidence Score: 92/100
1057
+
1058
+ - Context References included with file:line (+25) -- all key files mapped
1059
+ - All edge cases documented (+20) -- edge-case catalog complete
1060
+ - Test commands specific (+20) -- exact pnpm test paths
1061
+ - Risk mitigations defined (+20) -- all 8 risks addressed
1062
+ - File paths exact (+15) -- every file to create/modify listed
1063
+ - Score deduction: -8 for complexity of wiring mutation audit across 3 modules (Phase 4)
1064
+
1065
+ **Key Assumptions:**
1066
+
1067
+ 1. MongoDB 8.2 atlas-local:preview Docker environment available for e2e tests
1068
+ 2. Existing 66 production-readiness tests pass at build start
1069
+ 3. `$ne: "deleted"` backward-compatible filter works with documents lacking the status field
1070
+ 4. Fire-and-forget Promise.allSettled for audit writes does not cause test flakiness
1071
+
1072
+ ## Findings
1073
+
1074
+ - Score-weighted RRF already fully implemented (skip)
1075
+ - Cognitive profile synthesis already fully implemented (skip)
1076
+ - Cross-encoder reranker already fully implemented (skip)
1077
+ - Query rewriter already fully implemented (skip)
1078
+ - 4 of 12 original research items already exist -- sprint is focused on the 8 remaining gaps
1079
+ - Procedures collection exists but lacks evolution fields -- extension only
1080
+ - Structured memory already has state field (active/invalidated/conflicted) -- episodes/chunks do not