@remnic/core 1.1.12 → 1.1.13

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 (1324) hide show
  1. package/dist/access-cli.d.ts +2 -1
  2. package/dist/access-cli.js +263 -82
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-http.d.ts +26 -60
  5. package/dist/access-http.js +43 -29
  6. package/dist/access-mcp.d.ts +24 -6
  7. package/dist/access-mcp.js +35 -28
  8. package/dist/access-schema.d.ts +9 -6
  9. package/dist/access-schema.js +7 -5
  10. package/dist/access-service-DcCDmNYC.d.ts +1542 -0
  11. package/dist/access-service.d.ts +25 -7
  12. package/dist/access-service.js +33 -26
  13. package/dist/active-memory-bridge.js +2 -2
  14. package/dist/active-recall.js +11 -3
  15. package/dist/active-recall.js.map +1 -1
  16. package/dist/adapters/claude-code.d.ts +24 -0
  17. package/dist/adapters/claude-code.js +9 -0
  18. package/dist/adapters/codex.d.ts +25 -0
  19. package/dist/adapters/codex.js +9 -0
  20. package/dist/adapters/hermes.d.ts +35 -0
  21. package/dist/adapters/hermes.js +9 -0
  22. package/dist/adapters/index.d.ts +6 -0
  23. package/dist/adapters/index.js +26 -0
  24. package/dist/adapters/registry.d.ts +20 -0
  25. package/dist/adapters/registry.js +13 -0
  26. package/dist/adapters/replit.d.ts +28 -0
  27. package/dist/adapters/replit.js +9 -0
  28. package/dist/adapters/types.d.ts +43 -0
  29. package/dist/adapters/types.js +8 -0
  30. package/dist/bootstrap.d.ts +20 -5
  31. package/dist/boxes.d.ts +7 -0
  32. package/dist/boxes.js +1 -1
  33. package/dist/briefing.d.ts +5 -3
  34. package/dist/briefing.js +9 -6
  35. package/dist/buffer-surprise-report.js +1 -1
  36. package/dist/buffer.d.ts +18 -4
  37. package/dist/buffer.js +1 -1
  38. package/dist/calibration.js +4 -4
  39. package/dist/capsule-cli.d.ts +4 -4
  40. package/dist/capsule-cli.js +1 -1
  41. package/dist/capsule-crypto-5CYAGVC5.js +18 -0
  42. package/dist/capsule-merge-4MGKE7C5.js +189 -0
  43. package/dist/causal-behavior.d.ts +8 -28
  44. package/dist/causal-behavior.js +6 -3
  45. package/dist/causal-behavior.js.map +1 -1
  46. package/dist/causal-chain.js +3 -2
  47. package/dist/causal-consolidation.d.ts +1 -1
  48. package/dist/causal-consolidation.js +24 -13
  49. package/dist/causal-consolidation.js.map +1 -1
  50. package/dist/causal-retrieval.js +3 -3
  51. package/dist/causal-trajectory.js +1 -1
  52. package/dist/chunk-25MQ7IHJ.js +427 -0
  53. package/dist/chunk-25MQ7IHJ.js.map +1 -0
  54. package/dist/chunk-2F2W355T.js +256 -0
  55. package/dist/chunk-2F2W355T.js.map +1 -0
  56. package/dist/chunk-2KI4QFHU.js +228 -0
  57. package/dist/chunk-2KI4QFHU.js.map +1 -0
  58. package/dist/chunk-2PRQG7PV.js +86 -0
  59. package/dist/chunk-2PRQG7PV.js.map +1 -0
  60. package/dist/chunk-2QR3XXIC.js +2272 -0
  61. package/dist/chunk-2QR3XXIC.js.map +1 -0
  62. package/dist/chunk-2WWLHTZY.js +121 -0
  63. package/dist/chunk-326G7DJK.js +2185 -0
  64. package/dist/chunk-326G7DJK.js.map +1 -0
  65. package/dist/chunk-34DQE4KF.js +174 -0
  66. package/dist/chunk-34DQE4KF.js.map +1 -0
  67. package/dist/chunk-3APJ5EVB.js +601 -0
  68. package/dist/chunk-3APJ5EVB.js.map +1 -0
  69. package/dist/chunk-3HPAPHUK.js +51 -0
  70. package/dist/chunk-3HPAPHUK.js.map +1 -0
  71. package/dist/chunk-3JXBXXM2.js +69 -0
  72. package/dist/chunk-3JXBXXM2.js.map +1 -0
  73. package/dist/chunk-3KW65B36.js +681 -0
  74. package/dist/chunk-3KW65B36.js.map +1 -0
  75. package/dist/chunk-3UXOZBHV.js +20 -0
  76. package/dist/chunk-3UXOZBHV.js.map +1 -0
  77. package/dist/chunk-3VAL7ZL2.js +266 -0
  78. package/dist/chunk-3VAL7ZL2.js.map +1 -0
  79. package/dist/chunk-3Y4P7RXM.js +31 -0
  80. package/dist/chunk-3Y4P7RXM.js.map +1 -0
  81. package/dist/chunk-47VWKCAF.js +273 -0
  82. package/dist/chunk-47VWKCAF.js.map +1 -0
  83. package/dist/chunk-4CRG46BG.js +271 -0
  84. package/dist/chunk-5375UYTQ.js +914 -0
  85. package/dist/chunk-5375UYTQ.js.map +1 -0
  86. package/dist/chunk-56K5QLHX.js +506 -0
  87. package/dist/chunk-56K5QLHX.js.map +1 -0
  88. package/dist/chunk-5RGLBDQF.js +596 -0
  89. package/dist/chunk-5RGLBDQF.js.map +1 -0
  90. package/dist/chunk-5UZXUTVO.js +9 -0
  91. package/dist/chunk-5UZXUTVO.js.map +1 -0
  92. package/dist/chunk-65PG43EQ.js +105 -0
  93. package/dist/chunk-65PG43EQ.js.map +1 -0
  94. package/dist/chunk-66DHUKLO.js +57 -0
  95. package/dist/chunk-66DHUKLO.js.map +1 -0
  96. package/dist/chunk-6FC5EGNV.js +46 -0
  97. package/dist/chunk-6FC5EGNV.js.map +1 -0
  98. package/dist/chunk-6H2TESSP.js +62 -0
  99. package/dist/chunk-6H2TESSP.js.map +1 -0
  100. package/dist/chunk-6LVVDPJ4.js +32 -0
  101. package/dist/chunk-6LVVDPJ4.js.map +1 -0
  102. package/dist/chunk-6RVI47ZR.js +159 -0
  103. package/dist/chunk-6RVI47ZR.js.map +1 -0
  104. package/dist/chunk-7AAT6G4Q.js +5117 -0
  105. package/dist/chunk-7AAT6G4Q.js.map +1 -0
  106. package/dist/chunk-7DTASS5T.js +29 -0
  107. package/dist/chunk-7DTASS5T.js.map +1 -0
  108. package/dist/chunk-7IASACLB.js +596 -0
  109. package/dist/chunk-7MNMYOFP.js +32 -0
  110. package/dist/chunk-7MNMYOFP.js.map +1 -0
  111. package/dist/chunk-7N4KAIGN.js +133 -0
  112. package/dist/chunk-7N4KAIGN.js.map +1 -0
  113. package/dist/chunk-7OZ53EXP.js +101 -0
  114. package/dist/chunk-7OZ53EXP.js.map +1 -0
  115. package/dist/chunk-7XYTQGCC.js +134 -0
  116. package/dist/chunk-7XYTQGCC.js.map +1 -0
  117. package/dist/chunk-A2XUIMJ3.js +341 -0
  118. package/dist/chunk-A2XUIMJ3.js.map +1 -0
  119. package/dist/chunk-AGZQD76C.js +201 -0
  120. package/dist/chunk-AGZQD76C.js.map +1 -0
  121. package/dist/chunk-APO3DCMU.js +361 -0
  122. package/dist/chunk-APO3DCMU.js.map +1 -0
  123. package/dist/chunk-BFBF3XEF.js +283 -0
  124. package/dist/chunk-BFBF3XEF.js.map +1 -0
  125. package/dist/chunk-BJ3KMYTB.js +1974 -0
  126. package/dist/chunk-BJ3KMYTB.js.map +1 -0
  127. package/dist/chunk-CHEL3SKB.js +6758 -0
  128. package/dist/chunk-CHEL3SKB.js.map +1 -0
  129. package/dist/chunk-CQZRLNMV.js +1491 -0
  130. package/dist/chunk-CQZRLNMV.js.map +1 -0
  131. package/dist/chunk-D46YSIYX.js +892 -0
  132. package/dist/chunk-D46YSIYX.js.map +1 -0
  133. package/dist/chunk-DINWEURR.js +648 -0
  134. package/dist/chunk-DINWEURR.js.map +1 -0
  135. package/dist/chunk-DK5LDEQM.js +530 -0
  136. package/dist/chunk-DK5LDEQM.js.map +1 -0
  137. package/dist/chunk-DOM4GKSW.js +34 -0
  138. package/dist/chunk-DOM4GKSW.js.map +1 -0
  139. package/dist/chunk-EDTHC6UD.js +1075 -0
  140. package/dist/chunk-EFJ3MQ4V.js +721 -0
  141. package/dist/chunk-EHRTFRWW.js +89 -0
  142. package/dist/chunk-EHRTFRWW.js.map +1 -0
  143. package/dist/chunk-FAJ7FZYM.js +11 -0
  144. package/dist/chunk-FAJ7FZYM.js.map +1 -0
  145. package/dist/chunk-FBYESMQ2.js +570 -0
  146. package/dist/chunk-FDU6HUUL.js +147 -0
  147. package/dist/chunk-FF4KLI5W.js +99 -0
  148. package/dist/chunk-FF4KLI5W.js.map +1 -0
  149. package/dist/chunk-FIT6DMX6.js +310 -0
  150. package/dist/chunk-FIT6DMX6.js.map +1 -0
  151. package/dist/chunk-FJ43PRLT.js +272 -0
  152. package/dist/chunk-FJ43PRLT.js.map +1 -0
  153. package/dist/chunk-FKFMOY3N.js +32 -0
  154. package/dist/chunk-FKFMOY3N.js.map +1 -0
  155. package/dist/chunk-FLTNHQK6.js +262 -0
  156. package/dist/chunk-FLTNHQK6.js.map +1 -0
  157. package/dist/chunk-GA454ALV.js +12436 -0
  158. package/dist/chunk-GA454ALV.js.map +1 -0
  159. package/dist/chunk-GGKRUQOO.js +228 -0
  160. package/dist/chunk-GIF42EW3.js +63 -0
  161. package/dist/chunk-GIF42EW3.js.map +1 -0
  162. package/dist/chunk-GL6I6MEQ.js +647 -0
  163. package/dist/chunk-H3ME6L6D.js +709 -0
  164. package/dist/chunk-H3ME6L6D.js.map +1 -0
  165. package/dist/chunk-HHLLAQGZ.js +1 -0
  166. package/dist/chunk-HXXBL2KD.js +2040 -0
  167. package/dist/chunk-I5V2VDIW.js +219 -0
  168. package/dist/chunk-I5V2VDIW.js.map +1 -0
  169. package/dist/chunk-I6K5FBRQ.js +35 -0
  170. package/dist/chunk-I6K5FBRQ.js.map +1 -0
  171. package/dist/chunk-ICRIXAP2.js +121 -0
  172. package/dist/chunk-ICRIXAP2.js.map +1 -0
  173. package/dist/chunk-J4EB7DNW.js +11 -0
  174. package/dist/chunk-J4EB7DNW.js.map +1 -0
  175. package/dist/chunk-JLFA7DQG.js +62 -0
  176. package/dist/chunk-JLFA7DQG.js.map +1 -0
  177. package/dist/chunk-KJTKLXTH.js +9 -0
  178. package/dist/chunk-KJTKLXTH.js.map +1 -0
  179. package/dist/chunk-KLAO5DGL.js +917 -0
  180. package/dist/chunk-KLAO5DGL.js.map +1 -0
  181. package/dist/chunk-KNKUID7G.js +183 -0
  182. package/dist/chunk-KOSORCJG.js +624 -0
  183. package/dist/chunk-KOSORCJG.js.map +1 -0
  184. package/dist/chunk-KUJVMMZQ.js +1262 -0
  185. package/dist/chunk-KUJVMMZQ.js.map +1 -0
  186. package/dist/chunk-LCR46JY5.js +123 -0
  187. package/dist/chunk-LCR46JY5.js.map +1 -0
  188. package/dist/chunk-LLQ2LLWF.js +148 -0
  189. package/dist/chunk-LLQ2LLWF.js.map +1 -0
  190. package/dist/chunk-LPMVBPA3.js +236 -0
  191. package/dist/chunk-LT3NLYSI.js +50 -0
  192. package/dist/chunk-LT3NLYSI.js.map +1 -0
  193. package/dist/chunk-LUDTDZLK.js +287 -0
  194. package/dist/chunk-LUDTDZLK.js.map +1 -0
  195. package/dist/chunk-M23FSH32.js +3963 -0
  196. package/dist/chunk-M23FSH32.js.map +1 -0
  197. package/dist/chunk-MC26UJIM.js +118 -0
  198. package/dist/chunk-ME6ESPZU.js +119 -0
  199. package/dist/chunk-ME6ESPZU.js.map +1 -0
  200. package/dist/chunk-MGKYQQYF.js +272 -0
  201. package/dist/chunk-MJFNCJXV.js +66 -0
  202. package/dist/chunk-MJFNCJXV.js.map +1 -0
  203. package/dist/chunk-MSWG7JI6.js +237 -0
  204. package/dist/chunk-MSWG7JI6.js.map +1 -0
  205. package/dist/chunk-MT25YHYH.js +141 -0
  206. package/dist/chunk-MT25YHYH.js.map +1 -0
  207. package/dist/chunk-MT4HVDUZ.js +53 -0
  208. package/dist/chunk-MY6TPVXW.js +219 -0
  209. package/dist/chunk-N2D6GXBM.js +267 -0
  210. package/dist/chunk-N2D6GXBM.js.map +1 -0
  211. package/dist/chunk-NJ3MJQZX.js +46 -0
  212. package/dist/chunk-NJ3MJQZX.js.map +1 -0
  213. package/dist/chunk-NMZY542O.js +335 -0
  214. package/dist/chunk-NMZY542O.js.map +1 -0
  215. package/dist/chunk-NNVTUXEB.js +23 -0
  216. package/dist/chunk-NZL6GGQE.js +375 -0
  217. package/dist/chunk-NZL6GGQE.js.map +1 -0
  218. package/dist/chunk-P4NEIHUT.js +108 -0
  219. package/dist/chunk-P7FMDTKL.js +103 -0
  220. package/dist/chunk-P7FMDTKL.js.map +1 -0
  221. package/dist/chunk-PHK3HARR.js +32 -0
  222. package/dist/chunk-PHK3HARR.js.map +1 -0
  223. package/dist/chunk-PIRJPV5T.js +98 -0
  224. package/dist/chunk-PIRJPV5T.js.map +1 -0
  225. package/dist/chunk-PK7H5L6Y.js +159 -0
  226. package/dist/chunk-PK7H5L6Y.js.map +1 -0
  227. package/dist/chunk-PR5FBTFU.js +233 -0
  228. package/dist/chunk-PR5FBTFU.js.map +1 -0
  229. package/dist/chunk-PU63GXWS.js +174 -0
  230. package/dist/chunk-PU63GXWS.js.map +1 -0
  231. package/dist/chunk-PZIAX57I.js +124 -0
  232. package/dist/chunk-PZIAX57I.js.map +1 -0
  233. package/dist/chunk-Q7P4WJDP.js +26 -0
  234. package/dist/chunk-Q7P4WJDP.js.map +1 -0
  235. package/dist/chunk-QQUAB63I.js +63 -0
  236. package/dist/chunk-QQUAB63I.js.map +1 -0
  237. package/dist/chunk-QRNI5JBH.js +18 -0
  238. package/dist/chunk-RHY3HH7P.js +601 -0
  239. package/dist/chunk-RHY3HH7P.js.map +1 -0
  240. package/dist/chunk-RRF5UOBJ.js +91 -0
  241. package/dist/chunk-RXDLTSWT.js +124 -0
  242. package/dist/chunk-RXDLTSWT.js.map +1 -0
  243. package/dist/chunk-RYED3SPJ.js +42 -0
  244. package/dist/chunk-RYED3SPJ.js.map +1 -0
  245. package/dist/chunk-S7KDBTWT.js +106 -0
  246. package/dist/chunk-S7KDBTWT.js.map +1 -0
  247. package/dist/chunk-SEDEKFYQ.js +1 -0
  248. package/dist/chunk-TECVW3JP.js +36 -0
  249. package/dist/chunk-TECVW3JP.js.map +1 -0
  250. package/dist/chunk-TFO23QT4.js +88 -0
  251. package/dist/chunk-TFO23QT4.js.map +1 -0
  252. package/dist/chunk-TK4UEOSK.js +76 -0
  253. package/dist/chunk-TK4UEOSK.js.map +1 -0
  254. package/dist/chunk-TKWGAOLV.js +122 -0
  255. package/dist/chunk-TKWGAOLV.js.map +1 -0
  256. package/dist/chunk-TMM4S4IJ.js +597 -0
  257. package/dist/chunk-TMM4S4IJ.js.map +1 -0
  258. package/dist/chunk-TMQLARTH.js +188 -0
  259. package/dist/chunk-TMQLARTH.js.map +1 -0
  260. package/dist/chunk-TPDBFYEG.js +130 -0
  261. package/dist/chunk-TPDBFYEG.js.map +1 -0
  262. package/dist/chunk-TPMQ3G6Z.js +145 -0
  263. package/dist/chunk-TPMQ3G6Z.js.map +1 -0
  264. package/dist/chunk-TZOLIGIG.js +61 -0
  265. package/dist/chunk-TZOLIGIG.js.map +1 -0
  266. package/dist/chunk-U3PN77QT.js +113 -0
  267. package/dist/chunk-U3WSW6PZ.js +277 -0
  268. package/dist/chunk-U4SCL7B7.js +640 -0
  269. package/dist/chunk-U4SCL7B7.js.map +1 -0
  270. package/dist/chunk-UWK5OXUJ.js +156 -0
  271. package/dist/chunk-UWK5OXUJ.js.map +1 -0
  272. package/dist/chunk-UWVJF25J.js +74 -0
  273. package/dist/chunk-UXHQAFNA.js +1317 -0
  274. package/dist/chunk-UXHQAFNA.js.map +1 -0
  275. package/dist/chunk-V5OCT34X.js +1 -0
  276. package/dist/chunk-VLXA6PI2.js +304 -0
  277. package/dist/chunk-VLXA6PI2.js.map +1 -0
  278. package/dist/chunk-VNO6ZJ35.js +500 -0
  279. package/dist/chunk-VNO6ZJ35.js.map +1 -0
  280. package/dist/chunk-VW676BEI.js +827 -0
  281. package/dist/chunk-VW676BEI.js.map +1 -0
  282. package/dist/chunk-W3LR522O.js +2296 -0
  283. package/dist/chunk-W4L6CZKA.js +96 -0
  284. package/dist/chunk-W4L6CZKA.js.map +1 -0
  285. package/dist/chunk-W4RVMTHR.js +372 -0
  286. package/dist/chunk-W4RVMTHR.js.map +1 -0
  287. package/dist/chunk-WEHSQBFR.js +188 -0
  288. package/dist/chunk-WEHSQBFR.js.map +1 -0
  289. package/dist/chunk-WELDCG6C.js +380 -0
  290. package/dist/chunk-WELDCG6C.js.map +1 -0
  291. package/dist/chunk-WZYKANL3.js +2800 -0
  292. package/dist/chunk-WZYKANL3.js.map +1 -0
  293. package/dist/chunk-XIG5PDM7.js +48 -0
  294. package/dist/chunk-XJNBEDFE.js +193 -0
  295. package/dist/chunk-XJNBEDFE.js.map +1 -0
  296. package/dist/chunk-XVVIG67A.js +291 -0
  297. package/dist/chunk-XVVIG67A.js.map +1 -0
  298. package/dist/chunk-XVZ7B3HG.js +135 -0
  299. package/dist/chunk-YBPYIAA5.js +73 -0
  300. package/dist/chunk-YBPYIAA5.js.map +1 -0
  301. package/dist/chunk-Z734BLO3.js +21 -0
  302. package/dist/chunk-Z734BLO3.js.map +1 -0
  303. package/dist/chunk-ZKSK55RC.js +269 -0
  304. package/dist/chunk-ZKSK55RC.js.map +1 -0
  305. package/dist/chunk-ZTFCYYEZ.js +69 -0
  306. package/dist/chunk-ZTFCYYEZ.js.map +1 -0
  307. package/dist/chunk-ZY2MNJR6.js +329 -0
  308. package/dist/chunk-ZY2MNJR6.js.map +1 -0
  309. package/dist/cli-D3VpkVwB.d.ts +1136 -0
  310. package/dist/cli.d.ts +39 -10
  311. package/dist/cli.js +108 -49
  312. package/dist/commitment-ledger.js +1 -1
  313. package/dist/compat/checks.d.ts +5 -0
  314. package/dist/compat/checks.js +11 -0
  315. package/dist/compat/checks.js.map +1 -0
  316. package/dist/compat/types.d.ts +30 -0
  317. package/dist/compat/types.js +1 -0
  318. package/dist/compat/types.js.map +1 -0
  319. package/dist/compounding/engine.d.ts +221 -0
  320. package/dist/compounding/engine.js +32 -0
  321. package/dist/compounding/engine.js.map +1 -0
  322. package/dist/compounding/preference-consolidator.d.ts +92 -0
  323. package/dist/compounding/preference-consolidator.js +553 -0
  324. package/dist/compounding/preference-consolidator.js.map +1 -0
  325. package/dist/config.d.ts +4 -2
  326. package/dist/config.js +9 -4
  327. package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
  328. package/dist/connectors/codex-materialize-runner.d.ts +64 -0
  329. package/dist/connectors/codex-materialize-runner.js +33 -0
  330. package/dist/connectors/codex-materialize-runner.js.map +1 -0
  331. package/dist/connectors/codex-materialize.d.ts +195 -0
  332. package/dist/connectors/codex-materialize.js +38 -0
  333. package/dist/connectors/codex-materialize.js.map +1 -0
  334. package/dist/connectors/index.d.ts +444 -0
  335. package/dist/connectors/index.js +115 -0
  336. package/dist/connectors/index.js.map +1 -0
  337. package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
  338. package/dist/connectors-cli.d.ts +1 -1
  339. package/dist/consolidation-provenance-check.d.ts +3 -1
  340. package/dist/consolidation-undo.d.ts +3 -1
  341. package/dist/contradiction/index.d.ts +258 -0
  342. package/dist/contradiction/index.js +43 -0
  343. package/dist/contradiction/index.js.map +1 -0
  344. package/dist/contradiction-review-ATP4S6IC.js +30 -0
  345. package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
  346. package/dist/contradiction-scan-5A4IDZV5.js +13 -0
  347. package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
  348. package/dist/conversation-index/backend.d.ts +97 -0
  349. package/dist/conversation-index/backend.js +13 -0
  350. package/dist/conversation-index/backend.js.map +1 -0
  351. package/dist/conversation-index/chunker.d.ts +16 -0
  352. package/dist/conversation-index/chunker.js +8 -0
  353. package/dist/conversation-index/chunker.js.map +1 -0
  354. package/dist/conversation-index/cleanup.d.ts +11 -0
  355. package/dist/conversation-index/cleanup.js +9 -0
  356. package/dist/conversation-index/cleanup.js.map +1 -0
  357. package/dist/conversation-index/faiss-adapter.d.ts +6 -0
  358. package/dist/conversation-index/faiss-adapter.js +16 -0
  359. package/dist/conversation-index/faiss-adapter.js.map +1 -0
  360. package/dist/conversation-index/indexer.d.ts +23 -0
  361. package/dist/conversation-index/indexer.js +15 -0
  362. package/dist/conversation-index/indexer.js.map +1 -0
  363. package/dist/conversation-index/search.d.ts +6 -0
  364. package/dist/conversation-index/search.js +11 -0
  365. package/dist/conversation-index/search.js.map +1 -0
  366. package/dist/embedding-fallback.js +2 -2
  367. package/dist/enrichment/index.d.ts +163 -0
  368. package/dist/enrichment/index.js +18 -0
  369. package/dist/enrichment/index.js.map +1 -0
  370. package/dist/entity-retrieval.d.ts +4 -2
  371. package/dist/entity-retrieval.js +8 -5
  372. package/dist/evals.js +1 -1
  373. package/dist/explicit-capture.d.ts +20 -5
  374. package/dist/explicit-capture.js +2 -2
  375. package/dist/extraction-judge-training.js +1 -1
  376. package/dist/extraction.js +8 -8
  377. package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
  378. package/dist/fallback-llm.d.ts +2 -0
  379. package/dist/fallback-llm.js +4 -4
  380. package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
  381. package/dist/index.d.ts +66 -711
  382. package/dist/index.js +556 -2680
  383. package/dist/index.js.map +1 -1
  384. package/dist/lcm/archive.d.ts +89 -0
  385. package/dist/lcm/archive.js +12 -0
  386. package/dist/lcm/archive.js.map +1 -0
  387. package/dist/lcm/dag.d.ts +48 -0
  388. package/dist/lcm/dag.js +8 -0
  389. package/dist/lcm/dag.js.map +1 -0
  390. package/dist/lcm/engine.d.ts +116 -0
  391. package/dist/lcm/engine.js +20 -0
  392. package/dist/lcm/engine.js.map +1 -0
  393. package/dist/lcm/index.d.ts +12 -0
  394. package/dist/lcm/index.js +44 -0
  395. package/dist/lcm/index.js.map +1 -0
  396. package/dist/lcm/queue.d.ts +62 -0
  397. package/dist/lcm/queue.js +8 -0
  398. package/dist/lcm/queue.js.map +1 -0
  399. package/dist/lcm/recall.d.ts +20 -0
  400. package/dist/lcm/recall.js +8 -0
  401. package/dist/lcm/recall.js.map +1 -0
  402. package/dist/lcm/schema.d.ts +16 -0
  403. package/dist/lcm/schema.js +14 -0
  404. package/dist/lcm/schema.js.map +1 -0
  405. package/dist/lcm/summarizer.d.ts +38 -0
  406. package/dist/lcm/summarizer.js +12 -0
  407. package/dist/lcm/summarizer.js.map +1 -0
  408. package/dist/lcm/tools.d.ts +29 -0
  409. package/dist/lcm/tools.js +8 -0
  410. package/dist/lcm/tools.js.map +1 -0
  411. package/dist/live-connectors-runner.js +5 -5
  412. package/dist/local-llm.js +3 -3
  413. package/dist/maintenance/archive-observations.d.ts +18 -0
  414. package/dist/maintenance/archive-observations.js +8 -0
  415. package/dist/maintenance/archive-observations.js.map +1 -0
  416. package/dist/maintenance/backup-stamp.d.ts +3 -0
  417. package/dist/maintenance/backup-stamp.js +8 -0
  418. package/dist/maintenance/backup-stamp.js.map +1 -0
  419. package/dist/maintenance/memory-governance-cron.d.ts +85 -0
  420. package/dist/maintenance/memory-governance-cron.js +22 -0
  421. package/dist/maintenance/memory-governance-cron.js.map +1 -0
  422. package/dist/maintenance/memory-governance.d.ts +137 -0
  423. package/dist/maintenance/memory-governance.js +40 -0
  424. package/dist/maintenance/memory-governance.js.map +1 -0
  425. package/dist/maintenance/migrate-observations.d.ts +18 -0
  426. package/dist/maintenance/migrate-observations.js +9 -0
  427. package/dist/maintenance/migrate-observations.js.map +1 -0
  428. package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
  429. package/dist/maintenance/observation-ledger-utils.js +10 -0
  430. package/dist/maintenance/observation-ledger-utils.js.map +1 -0
  431. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
  432. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
  433. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
  434. package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
  435. package/dist/maintenance/rebuild-memory-projection.js +35 -0
  436. package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
  437. package/dist/maintenance/rebuild-observations.d.ts +17 -0
  438. package/dist/maintenance/rebuild-observations.js +9 -0
  439. package/dist/maintenance/rebuild-observations.js.map +1 -0
  440. package/dist/mcp-memory-inspector-app.d.ts +24 -6
  441. package/dist/memory-projection-store.d.ts +108 -3
  442. package/dist/memory-projection-store.js +2 -1
  443. package/dist/memory-worth-outcomes.d.ts +4 -2
  444. package/dist/migrate/from-engram.d.ts +24 -0
  445. package/dist/migrate/from-engram.js +12 -0
  446. package/dist/migrate/from-engram.js.map +1 -0
  447. package/dist/namespaces/migrate.d.ts +50 -0
  448. package/dist/namespaces/migrate.js +50 -0
  449. package/dist/namespaces/migrate.js.map +1 -0
  450. package/dist/namespaces/principal.d.ts +17 -0
  451. package/dist/namespaces/principal.js +16 -0
  452. package/dist/namespaces/principal.js.map +1 -0
  453. package/dist/namespaces/search.d.ts +46 -0
  454. package/dist/namespaces/search.js +28 -0
  455. package/dist/namespaces/search.js.map +1 -0
  456. package/dist/namespaces/storage.d.ts +32 -0
  457. package/dist/namespaces/storage.js +28 -0
  458. package/dist/namespaces/storage.js.map +1 -0
  459. package/dist/network/tailscale.d.ts +41 -0
  460. package/dist/network/tailscale.js +9 -0
  461. package/dist/network/tailscale.js.map +1 -0
  462. package/dist/network/webdav.d.ts +39 -0
  463. package/dist/network/webdav.js +10 -0
  464. package/dist/network/webdav.js.map +1 -0
  465. package/dist/objective-state-writers.js +2 -2
  466. package/dist/operator-toolkit.d.ts +4 -2
  467. package/dist/operator-toolkit.js +32 -14
  468. package/dist/opik-exporter.js +2 -2
  469. package/dist/opik-exporter.js.map +1 -1
  470. package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
  471. package/dist/orchestrator.d.ts +22 -7
  472. package/dist/orchestrator.js +79 -44
  473. package/dist/path-MR5JPYOP.js +9 -0
  474. package/dist/path-MR5JPYOP.js.map +1 -0
  475. package/dist/qmd-recall-cache.d.ts +1 -1
  476. package/dist/qmd.d.ts +102 -3
  477. package/dist/qmd.js +23 -5
  478. package/dist/recall-explain-renderer.js +3 -3
  479. package/dist/recall-xray-cli.js +4 -4
  480. package/dist/recall-xray-renderer.js +3 -3
  481. package/dist/recall-xray.js +2 -2
  482. package/dist/replay/normalizers/chatgpt.d.ts +6 -0
  483. package/dist/replay/normalizers/chatgpt.js +11 -0
  484. package/dist/replay/normalizers/chatgpt.js.map +1 -0
  485. package/dist/replay/normalizers/claude.d.ts +6 -0
  486. package/dist/replay/normalizers/claude.js +11 -0
  487. package/dist/replay/normalizers/claude.js.map +1 -0
  488. package/dist/replay/normalizers/openclaw.d.ts +6 -0
  489. package/dist/replay/normalizers/openclaw.js +11 -0
  490. package/dist/replay/normalizers/openclaw.js.map +1 -0
  491. package/dist/replay/normalizers/shared.d.ts +16 -0
  492. package/dist/replay/normalizers/shared.js +14 -0
  493. package/dist/replay/normalizers/shared.js.map +1 -0
  494. package/dist/replay/runner.d.ts +35 -0
  495. package/dist/replay/runner.js +16 -0
  496. package/dist/replay/runner.js.map +1 -0
  497. package/dist/replay/types.d.ts +57 -0
  498. package/dist/replay/types.js +19 -0
  499. package/dist/replay/types.js.map +1 -0
  500. package/dist/resolution-B7FNQSSP.js +12 -0
  501. package/dist/resolution-B7FNQSSP.js.map +1 -0
  502. package/dist/resolve-provider-secret.js +2 -2
  503. package/dist/resume-bundles.js +8 -6
  504. package/dist/retrieval-agents.d.ts +1 -1
  505. package/dist/routing/engine.d.ts +35 -0
  506. package/dist/routing/engine.js +16 -0
  507. package/dist/routing/engine.js.map +1 -0
  508. package/dist/routing/store.d.ts +27 -0
  509. package/dist/routing/store.js +10 -0
  510. package/dist/routing/store.js.map +1 -0
  511. package/dist/runtime/better-sqlite.d.ts +8 -0
  512. package/dist/runtime/better-sqlite.js +10 -0
  513. package/dist/runtime/better-sqlite.js.map +1 -0
  514. package/dist/runtime/child-process.d.ts +32 -0
  515. package/dist/runtime/child-process.js +10 -0
  516. package/dist/runtime/child-process.js.map +1 -0
  517. package/dist/runtime/env.d.ts +5 -0
  518. package/dist/runtime/env.js +12 -0
  519. package/dist/runtime/env.js.map +1 -0
  520. package/dist/schemas.d.ts +22 -22
  521. package/dist/sdk-compat.js +1 -1
  522. package/dist/search/document-scanner.d.ts +22 -0
  523. package/dist/search/document-scanner.js +8 -0
  524. package/dist/search/document-scanner.js.map +1 -0
  525. package/dist/search/embed-helper.d.ts +35 -0
  526. package/dist/search/embed-helper.js +9 -0
  527. package/dist/search/embed-helper.js.map +1 -0
  528. package/dist/search/factory.d.ts +32 -0
  529. package/dist/search/factory.js +29 -0
  530. package/dist/search/factory.js.map +1 -0
  531. package/dist/search/index.d.ts +15 -0
  532. package/dist/search/index.js +50 -0
  533. package/dist/search/index.js.map +1 -0
  534. package/dist/search/lancedb-backend.d.ts +51 -0
  535. package/dist/search/lancedb-backend.js +10 -0
  536. package/dist/search/lancedb-backend.js.map +1 -0
  537. package/dist/search/meilisearch-backend.d.ts +48 -0
  538. package/dist/search/meilisearch-backend.js +10 -0
  539. package/dist/search/meilisearch-backend.js.map +1 -0
  540. package/dist/search/noop-backend.d.ts +26 -0
  541. package/dist/search/noop-backend.js +8 -0
  542. package/dist/search/noop-backend.js.map +1 -0
  543. package/dist/search/orama-backend.d.ts +53 -0
  544. package/dist/search/orama-backend.js +10 -0
  545. package/dist/search/orama-backend.js.map +1 -0
  546. package/dist/search/port.d.ts +61 -0
  547. package/dist/search/port.js +1 -0
  548. package/dist/search/port.js.map +1 -0
  549. package/dist/search/remote-backend.d.ts +39 -0
  550. package/dist/search/remote-backend.js +9 -0
  551. package/dist/search/remote-backend.js.map +1 -0
  552. package/dist/secure-store/index.d.ts +890 -0
  553. package/dist/secure-store/index.js +156 -0
  554. package/dist/secure-store/index.js.map +1 -0
  555. package/dist/semantic-VwGI14Ok.d.ts +69 -0
  556. package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
  557. package/dist/semantic-consolidation.d.ts +2 -2
  558. package/dist/semantic-consolidation.js +13 -6
  559. package/dist/semantic-rule-promotion.js +8 -5
  560. package/dist/semantic-rule-verifier.js +8 -5
  561. package/dist/shared-context/manager.d.ts +131 -0
  562. package/dist/shared-context/manager.js +15 -0
  563. package/dist/shared-context/manager.js.map +1 -0
  564. package/dist/skills-registry.js +13 -1
  565. package/dist/skills-registry.js.map +1 -1
  566. package/dist/state-store-VZU2IA53.js +16 -0
  567. package/dist/state-store-VZU2IA53.js.map +1 -0
  568. package/dist/storage-paths.d.ts +9 -0
  569. package/dist/storage-paths.js +20 -0
  570. package/dist/storage-paths.js.map +1 -0
  571. package/dist/storage.d.ts +3 -1
  572. package/dist/storage.js +7 -4
  573. package/dist/summarizer.d.ts +5 -0
  574. package/dist/summarizer.js +9 -8
  575. package/dist/summary-snapshot.js +2 -1
  576. package/dist/surfaces/dreams.d.ts +16 -0
  577. package/dist/surfaces/dreams.js +282 -0
  578. package/dist/surfaces/dreams.js.map +1 -0
  579. package/dist/surfaces/heartbeat.d.ts +17 -0
  580. package/dist/surfaces/heartbeat.js +265 -0
  581. package/dist/surfaces/heartbeat.js.map +1 -0
  582. package/dist/temporal-supersession.d.ts +3 -1
  583. package/dist/threading.d.ts +5 -0
  584. package/dist/threading.js +2 -1
  585. package/dist/tier-migration.d.ts +4 -2
  586. package/dist/tokens.js +2 -2
  587. package/dist/transcript.d.ts +15 -1
  588. package/dist/transcript.js +2 -1
  589. package/dist/transfer/autodetect.d.ts +4 -0
  590. package/dist/transfer/autodetect.js +15 -0
  591. package/dist/transfer/autodetect.js.map +1 -0
  592. package/dist/transfer/backup.d.ts +21 -0
  593. package/dist/transfer/backup.js +17 -0
  594. package/dist/transfer/backup.js.map +1 -0
  595. package/dist/transfer/capsule-export.d.ts +113 -0
  596. package/dist/transfer/capsule-export.js +19 -0
  597. package/dist/transfer/capsule-export.js.map +1 -0
  598. package/dist/transfer/capsule-import.d.ts +124 -0
  599. package/dist/transfer/capsule-import.js +16 -0
  600. package/dist/transfer/capsule-import.js.map +1 -0
  601. package/dist/transfer/constants.d.ts +13 -0
  602. package/dist/transfer/constants.js +12 -0
  603. package/dist/transfer/constants.js.map +1 -0
  604. package/dist/transfer/export-json.d.ts +11 -0
  605. package/dist/transfer/export-json.js +11 -0
  606. package/dist/transfer/export-json.js.map +1 -0
  607. package/dist/transfer/export-md.d.ts +10 -0
  608. package/dist/transfer/export-md.js +13 -0
  609. package/dist/transfer/export-md.js.map +1 -0
  610. package/dist/transfer/export-sqlite.d.ts +9 -0
  611. package/dist/transfer/export-sqlite.js +12 -0
  612. package/dist/transfer/export-sqlite.js.map +1 -0
  613. package/dist/transfer/fs-utils.d.ts +61 -0
  614. package/dist/transfer/fs-utils.js +40 -0
  615. package/dist/transfer/fs-utils.js.map +1 -0
  616. package/dist/transfer/import-json.d.ts +16 -0
  617. package/dist/transfer/import-json.js +13 -0
  618. package/dist/transfer/import-json.js.map +1 -0
  619. package/dist/transfer/import-md.d.ts +14 -0
  620. package/dist/transfer/import-md.js +11 -0
  621. package/dist/transfer/import-md.js.map +1 -0
  622. package/dist/transfer/import-sqlite.d.ts +14 -0
  623. package/dist/transfer/import-sqlite.js +12 -0
  624. package/dist/transfer/import-sqlite.js.map +1 -0
  625. package/dist/transfer/sqlite-schema.d.ts +4 -0
  626. package/dist/transfer/sqlite-schema.js +10 -0
  627. package/dist/transfer/sqlite-schema.js.map +1 -0
  628. package/dist/transfer/types.d.ts +916 -0
  629. package/dist/transfer/types.js +30 -0
  630. package/dist/transfer/types.js.map +1 -0
  631. package/dist/types.d.ts +28 -1
  632. package/dist/types.js +1 -1
  633. package/dist/verified-recall.js +9 -6
  634. package/dist/work/board.d.ts +43 -0
  635. package/dist/work/board.js +14 -0
  636. package/dist/work/board.js.map +1 -0
  637. package/dist/work/boundary.d.ts +8 -0
  638. package/dist/work/boundary.js +14 -0
  639. package/dist/work/boundary.js.map +1 -0
  640. package/dist/work/storage.d.ts +39 -0
  641. package/dist/work/storage.js +11 -0
  642. package/dist/work/storage.js.map +1 -0
  643. package/dist/work/types.d.ts +75 -0
  644. package/dist/work/types.js +1 -0
  645. package/dist/work/types.js.map +1 -0
  646. package/package.json +2767 -6
  647. package/scripts/faiss_index.py +816 -0
  648. package/scripts/faiss_requirements.txt +3 -0
  649. package/skills/remnic-entities/SKILL.md +51 -0
  650. package/skills/remnic-memory-workflow/SKILL.md +61 -0
  651. package/skills/remnic-recall/SKILL.md +51 -0
  652. package/skills/remnic-remember/SKILL.md +56 -0
  653. package/skills/remnic-search/SKILL.md +51 -0
  654. package/skills/remnic-status/SKILL.md +51 -0
  655. package/src/abort-error.test.ts +49 -0
  656. package/src/abort-error.ts +46 -0
  657. package/src/abstraction-nodes.ts +162 -0
  658. package/src/access-audit.test.ts +178 -0
  659. package/src/access-audit.ts +125 -0
  660. package/src/access-cli.test.ts +439 -0
  661. package/src/access-cli.ts +438 -0
  662. package/src/access-http.test.ts +225 -0
  663. package/src/access-http.ts +1899 -0
  664. package/src/access-idempotency.ts +232 -0
  665. package/src/access-mcp.test.ts +568 -0
  666. package/src/access-mcp.ts +3056 -0
  667. package/src/access-schema-pi.test.ts +60 -0
  668. package/src/access-schema.ts +522 -0
  669. package/src/access-service-namespace.test.ts +123 -0
  670. package/src/access-service.ts +5629 -0
  671. package/src/action-confidence.test.ts +206 -0
  672. package/src/action-confidence.ts +466 -0
  673. package/src/active-memory-bridge.test.ts +285 -0
  674. package/src/active-memory-bridge.ts +217 -0
  675. package/src/active-recall.test.ts +484 -0
  676. package/src/active-recall.ts +459 -0
  677. package/src/adapters/claude-code.ts +56 -0
  678. package/src/adapters/codex.ts +57 -0
  679. package/src/adapters/hermes.ts +64 -0
  680. package/src/adapters/index.ts +6 -0
  681. package/src/adapters/registry.ts +41 -0
  682. package/src/adapters/replit.ts +55 -0
  683. package/src/adapters/types.ts +51 -0
  684. package/src/behavior-learner.ts +144 -0
  685. package/src/behavior-signals.ts +73 -0
  686. package/src/binary-lifecycle/backend.ts +117 -0
  687. package/src/binary-lifecycle/index.ts +35 -0
  688. package/src/binary-lifecycle/manifest.ts +79 -0
  689. package/src/binary-lifecycle/pipeline.ts +352 -0
  690. package/src/binary-lifecycle/scanner.ts +89 -0
  691. package/src/binary-lifecycle/types.ts +89 -0
  692. package/src/bootstrap.ts +178 -0
  693. package/src/boxes.ts +521 -0
  694. package/src/briefing.test.ts +1535 -0
  695. package/src/briefing.ts +1382 -0
  696. package/src/buffer-session.test.ts +443 -0
  697. package/src/buffer-surprise-report.ts +176 -0
  698. package/src/buffer-surprise-telemetry.test.ts +606 -0
  699. package/src/buffer-surprise-trigger.test.ts +766 -0
  700. package/src/buffer-surprise.test.ts +339 -0
  701. package/src/buffer-surprise.ts +203 -0
  702. package/src/buffer.ts +900 -0
  703. package/src/bulk-import/cli-command.test.ts +204 -0
  704. package/src/bulk-import/index.ts +34 -0
  705. package/src/bulk-import/pipeline.test.ts +445 -0
  706. package/src/bulk-import/pipeline.ts +178 -0
  707. package/src/bulk-import/registry.test.ts +151 -0
  708. package/src/bulk-import/registry.ts +72 -0
  709. package/src/bulk-import/types.test.ts +272 -0
  710. package/src/bulk-import/types.ts +145 -0
  711. package/src/calibration.ts +394 -0
  712. package/src/capsule-cli.test.ts +398 -0
  713. package/src/capsule-cli.ts +565 -0
  714. package/src/causal-behavior.ts +308 -0
  715. package/src/causal-chain.ts +419 -0
  716. package/src/causal-consolidation.ts +370 -0
  717. package/src/causal-retrieval.ts +286 -0
  718. package/src/causal-trajectory-graph.ts +60 -0
  719. package/src/causal-trajectory.ts +303 -0
  720. package/src/chunking.ts +220 -0
  721. package/src/citations.ts +232 -0
  722. package/src/cli.ts +9403 -0
  723. package/src/codex-cli-fallback.ts +162 -0
  724. package/src/codex-thread-key.ts +1 -0
  725. package/src/coding/access-coding-context.test.ts +197 -0
  726. package/src/coding/coding-branch-scope.test.ts +281 -0
  727. package/src/coding/coding-namespace.test.ts +360 -0
  728. package/src/coding/coding-namespace.ts +412 -0
  729. package/src/coding/coding-orchestrator.test.ts +249 -0
  730. package/src/coding/git-context.test.ts +507 -0
  731. package/src/coding/git-context.ts +336 -0
  732. package/src/coding/mcp-set-coding-context.test.ts +174 -0
  733. package/src/coding/review-context.test.ts +316 -0
  734. package/src/coding/review-context.ts +349 -0
  735. package/src/coding/wire-coding-context.test.ts +468 -0
  736. package/src/commitment-ledger.test.ts +78 -0
  737. package/src/commitment-ledger.ts +337 -0
  738. package/src/compat/checks.test.ts +206 -0
  739. package/src/compat/checks.ts +716 -0
  740. package/src/compat/types.ts +33 -0
  741. package/src/compounding/engine.ts +1686 -0
  742. package/src/compounding/preference-consolidator.ts +778 -0
  743. package/src/compression-optimizer.ts +312 -0
  744. package/src/config.test.ts +930 -0
  745. package/src/config.ts +3807 -0
  746. package/src/connectors/codex/instructions.md +160 -0
  747. package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
  748. package/src/connectors/codex-marketplace.ts +500 -0
  749. package/src/connectors/codex-materialize-runner.ts +212 -0
  750. package/src/connectors/codex-materialize.ts +983 -0
  751. package/src/connectors/coerce.ts +62 -0
  752. package/src/connectors/index.test.ts +1570 -0
  753. package/src/connectors/index.ts +3222 -0
  754. package/src/connectors/live/framework.ts +164 -0
  755. package/src/connectors/live/github.test.ts +1218 -0
  756. package/src/connectors/live/github.ts +1068 -0
  757. package/src/connectors/live/gmail.test.ts +1706 -0
  758. package/src/connectors/live/gmail.ts +1293 -0
  759. package/src/connectors/live/google-drive.test.ts +696 -0
  760. package/src/connectors/live/google-drive.ts +724 -0
  761. package/src/connectors/live/index.ts +101 -0
  762. package/src/connectors/live/live-connectors.test.ts +689 -0
  763. package/src/connectors/live/notion.test.ts +1109 -0
  764. package/src/connectors/live/notion.ts +978 -0
  765. package/src/connectors/live/registry.ts +103 -0
  766. package/src/connectors/live/state-store.ts +399 -0
  767. package/src/connectors/live/transient-errors.ts +150 -0
  768. package/src/connectors/weclone-installer.test.ts +850 -0
  769. package/src/connectors-cli.ts +513 -0
  770. package/src/console/state.test.ts +224 -0
  771. package/src/console/state.ts +514 -0
  772. package/src/console/trace.test.ts +813 -0
  773. package/src/console/trace.ts +603 -0
  774. package/src/console/tui.test.ts +582 -0
  775. package/src/console/tui.ts +508 -0
  776. package/src/consolidation-operator.ts +182 -0
  777. package/src/consolidation-provenance-check.ts +551 -0
  778. package/src/consolidation-undo.ts +718 -0
  779. package/src/contradiction/contradiction-judge.test.ts +189 -0
  780. package/src/contradiction/contradiction-judge.ts +333 -0
  781. package/src/contradiction/contradiction-review.ts +574 -0
  782. package/src/contradiction/contradiction-scan.ts +504 -0
  783. package/src/contradiction/contradiction.test.ts +2230 -0
  784. package/src/contradiction/index.ts +37 -0
  785. package/src/contradiction/resolution.ts +383 -0
  786. package/src/conversation-index/backend.ts +323 -0
  787. package/src/conversation-index/chunker.ts +47 -0
  788. package/src/conversation-index/cleanup.ts +53 -0
  789. package/src/conversation-index/faiss-adapter.ts +384 -0
  790. package/src/conversation-index/indexer.test.ts +164 -0
  791. package/src/conversation-index/indexer.ts +192 -0
  792. package/src/conversation-index/search.ts +37 -0
  793. package/src/cross-namespace-budget.test.ts +275 -0
  794. package/src/cross-namespace-budget.ts +365 -0
  795. package/src/cue-anchors.ts +163 -0
  796. package/src/curation/index.ts +544 -0
  797. package/src/dashboard-runtime.ts +337 -0
  798. package/src/day-summary.ts +122 -0
  799. package/src/dedup/index.ts +330 -0
  800. package/src/dedup/semantic.test.ts +1577 -0
  801. package/src/dedup/semantic.ts +148 -0
  802. package/src/delinearize.ts +193 -0
  803. package/src/direct-answer-wiring.test.ts +473 -0
  804. package/src/direct-answer-wiring.ts +180 -0
  805. package/src/direct-answer.test.ts +484 -0
  806. package/src/direct-answer.ts +273 -0
  807. package/src/embedding-fallback.ts +565 -0
  808. package/src/enrichment/audit.ts +89 -0
  809. package/src/enrichment/index.ts +27 -0
  810. package/src/enrichment/pipeline.ts +197 -0
  811. package/src/enrichment/provider-registry.ts +85 -0
  812. package/src/enrichment/types.ts +100 -0
  813. package/src/enrichment/web-search-provider.ts +63 -0
  814. package/src/entity-retrieval.ts +774 -0
  815. package/src/entity-schema.ts +239 -0
  816. package/src/evals.ts +1312 -0
  817. package/src/event-order-recall.test.ts +4164 -0
  818. package/src/event-order-recall.ts +2802 -0
  819. package/src/evidence-pack.test.ts +89 -0
  820. package/src/evidence-pack.ts +388 -0
  821. package/src/explicit-capture.ts +530 -0
  822. package/src/explicit-cue-recall.test.ts +3019 -0
  823. package/src/explicit-cue-recall.ts +5545 -0
  824. package/src/extraction-judge-telemetry.ts +234 -0
  825. package/src/extraction-judge-training.ts +221 -0
  826. package/src/extraction-judge.ts +846 -0
  827. package/src/extraction-timeout.test.ts +265 -0
  828. package/src/extraction.ts +2719 -0
  829. package/src/fallback-llm.test.ts +1060 -0
  830. package/src/fallback-llm.ts +918 -0
  831. package/src/focused-list-recall.test.ts +734 -0
  832. package/src/focused-list-recall.ts +1160 -0
  833. package/src/graph-dashboard-diff.ts +35 -0
  834. package/src/graph-dashboard-key.ts +5 -0
  835. package/src/graph-dashboard-parser.ts +104 -0
  836. package/src/graph-edge-reinforcement.ts +192 -0
  837. package/src/graph-events.ts +151 -0
  838. package/src/graph-recall.test.ts +164 -0
  839. package/src/graph-recall.ts +189 -0
  840. package/src/graph-retrieval.test.ts +809 -0
  841. package/src/graph-retrieval.ts +823 -0
  842. package/src/graph-snapshot.ts +329 -0
  843. package/src/graph.ts +813 -0
  844. package/src/harmonic-retrieval.ts +223 -0
  845. package/src/himem.ts +154 -0
  846. package/src/hygiene.ts +87 -0
  847. package/src/identity-continuity.ts +333 -0
  848. package/src/importance.ts +328 -0
  849. package/src/importers/base.test.ts +294 -0
  850. package/src/importers/base.ts +436 -0
  851. package/src/importers/index.ts +21 -0
  852. package/src/index.ts +1204 -0
  853. package/src/intent.ts +154 -0
  854. package/src/json-extract.ts +85 -0
  855. package/src/json-store.ts +42 -0
  856. package/src/lcm/archive.ts +617 -0
  857. package/src/lcm/dag.ts +199 -0
  858. package/src/lcm/engine.ts +645 -0
  859. package/src/lcm/index.ts +7 -0
  860. package/src/lcm/queue.test.ts +178 -0
  861. package/src/lcm/queue.ts +200 -0
  862. package/src/lcm/recall.ts +117 -0
  863. package/src/lcm/schema.ts +154 -0
  864. package/src/lcm/summarizer.ts +235 -0
  865. package/src/lcm/tools.ts +191 -0
  866. package/src/lcm-engine.test.ts +660 -0
  867. package/src/legacy-hook-compat.test.ts +20 -0
  868. package/src/legacy-hook-compat.ts +45 -0
  869. package/src/lifecycle.ts +289 -0
  870. package/src/live-connectors-runner.ts +385 -0
  871. package/src/local-llm-qos.test.ts +303 -0
  872. package/src/local-llm-thinking.test.ts +292 -0
  873. package/src/local-llm.ts +1464 -0
  874. package/src/logger.ts +49 -0
  875. package/src/maintenance/archive-observations.ts +147 -0
  876. package/src/maintenance/backup-stamp.ts +3 -0
  877. package/src/maintenance/dreams-ledger.ts +516 -0
  878. package/src/maintenance/first-start-migration.ts +362 -0
  879. package/src/maintenance/forget.test.ts +206 -0
  880. package/src/maintenance/forget.ts +126 -0
  881. package/src/maintenance/graph-edge-decay.test.ts +409 -0
  882. package/src/maintenance/graph-edge-decay.ts +394 -0
  883. package/src/maintenance/memory-governance-cron.ts +447 -0
  884. package/src/maintenance/memory-governance.ts +1039 -0
  885. package/src/maintenance/migrate-observations.ts +216 -0
  886. package/src/maintenance/observation-ledger-utils.ts +54 -0
  887. package/src/maintenance/pattern-reinforcement.test.ts +875 -0
  888. package/src/maintenance/pattern-reinforcement.ts +369 -0
  889. package/src/maintenance/purge.ts +334 -0
  890. package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
  891. package/src/maintenance/rebuild-memory-projection.ts +1234 -0
  892. package/src/maintenance/rebuild-observations.ts +178 -0
  893. package/src/maintenance/tier-stats.test.ts +378 -0
  894. package/src/maintenance/tier-stats.ts +222 -0
  895. package/src/mcp-memory-inspector-app.ts +421 -0
  896. package/src/memory-action-policy.ts +80 -0
  897. package/src/memory-cache.ts +208 -0
  898. package/src/memory-extension/claude-code-publisher.ts +51 -0
  899. package/src/memory-extension/codex-publisher.ts +149 -0
  900. package/src/memory-extension/hermes-publisher.ts +51 -0
  901. package/src/memory-extension/index.ts +100 -0
  902. package/src/memory-extension/shared-instructions.ts +133 -0
  903. package/src/memory-extension/types.ts +86 -0
  904. package/src/memory-extension-host/host-discovery.ts +276 -0
  905. package/src/memory-extension-host/index.ts +14 -0
  906. package/src/memory-extension-host/render-extensions-block.ts +73 -0
  907. package/src/memory-extension-host/types.ts +21 -0
  908. package/src/memory-lifecycle-ledger-utils.ts +116 -0
  909. package/src/memory-projection-format.ts +11 -0
  910. package/src/memory-projection-store.ts +951 -0
  911. package/src/memory-provenance.test.ts +196 -0
  912. package/src/memory-provenance.ts +484 -0
  913. package/src/memory-worth-bench.test.ts +71 -0
  914. package/src/memory-worth-bench.ts +265 -0
  915. package/src/memory-worth-filter.test.ts +209 -0
  916. package/src/memory-worth-filter.ts +204 -0
  917. package/src/memory-worth-frontmatter.test.ts +311 -0
  918. package/src/memory-worth-outcomes.test.ts +316 -0
  919. package/src/memory-worth-outcomes.ts +286 -0
  920. package/src/memory-worth.test.ts +317 -0
  921. package/src/memory-worth.ts +215 -0
  922. package/src/message-parts/index.ts +806 -0
  923. package/src/message-parts/message-parts.test.ts +421 -0
  924. package/src/migrate/from-engram.ts +789 -0
  925. package/src/model-registry.ts +313 -0
  926. package/src/models-json.ts +76 -0
  927. package/src/namespaces/migrate.ts +187 -0
  928. package/src/namespaces/path.ts +25 -0
  929. package/src/namespaces/principal.test.ts +195 -0
  930. package/src/namespaces/principal.ts +86 -0
  931. package/src/namespaces/search.test.ts +105 -0
  932. package/src/namespaces/search.ts +233 -0
  933. package/src/namespaces/storage.ts +74 -0
  934. package/src/native-knowledge.ts +1823 -0
  935. package/src/negative.ts +72 -0
  936. package/src/network/tailscale.ts +179 -0
  937. package/src/network/webdav.ts +385 -0
  938. package/src/objective-state-writers.ts +951 -0
  939. package/src/objective-state.ts +320 -0
  940. package/src/onboarding/index.ts +529 -0
  941. package/src/openai-chat-compat.ts +56 -0
  942. package/src/operator-toolkit.ts +2132 -0
  943. package/src/opik-exporter.test.ts +72 -0
  944. package/src/opik-exporter.ts +587 -0
  945. package/src/orchestrator-extraction-queue.test.ts +197 -0
  946. package/src/orchestrator-flush.test.ts +1171 -0
  947. package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
  948. package/src/orchestrator-source-attribution.test.ts +701 -0
  949. package/src/orchestrator.ts +16368 -0
  950. package/src/page-versioning.ts +450 -0
  951. package/src/patterns-cli.ts +574 -0
  952. package/src/peers/index.ts +54 -0
  953. package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
  954. package/src/peers/migrate-from-identity-anchor.ts +350 -0
  955. package/src/peers/peers.test.ts +419 -0
  956. package/src/peers/profile-reasoner.ts +694 -0
  957. package/src/peers/storage.ts +1350 -0
  958. package/src/peers/types.ts +138 -0
  959. package/src/plugin-id.ts +84 -0
  960. package/src/policy-runtime.ts +209 -0
  961. package/src/procedural/procedure-miner.ts +150 -0
  962. package/src/procedural/procedure-recall.ts +93 -0
  963. package/src/procedural/procedure-stats.ts +213 -0
  964. package/src/procedural/procedure-types.ts +132 -0
  965. package/src/procedural/reinforcement-core.test.ts +132 -0
  966. package/src/procedural/reinforcement-core.ts +73 -0
  967. package/src/profiling.test.ts +263 -0
  968. package/src/profiling.ts +435 -0
  969. package/src/projection/index.ts +398 -0
  970. package/src/qmd-recall-cache.test.ts +138 -0
  971. package/src/qmd-recall-cache.ts +111 -0
  972. package/src/qmd.test.ts +257 -0
  973. package/src/qmd.ts +2614 -0
  974. package/src/reasoning-trace-recall.ts +201 -0
  975. package/src/reasoning-trace-types.ts +235 -0
  976. package/src/recall-audit-anomaly.test.ts +246 -0
  977. package/src/recall-audit-anomaly.ts +297 -0
  978. package/src/recall-audit.test.ts +51 -0
  979. package/src/recall-audit.ts +72 -0
  980. package/src/recall-budget-config.test.ts +87 -0
  981. package/src/recall-disclosure-escalation.test.ts +196 -0
  982. package/src/recall-disclosure-escalation.ts +158 -0
  983. package/src/recall-disclosure-shaping.test.ts +146 -0
  984. package/src/recall-disclosure.test.ts +214 -0
  985. package/src/recall-explain-renderer.test.ts +140 -0
  986. package/src/recall-explain-renderer.ts +356 -0
  987. package/src/recall-mmr.test.ts +808 -0
  988. package/src/recall-mmr.ts +607 -0
  989. package/src/recall-qos.test.ts +85 -0
  990. package/src/recall-qos.ts +82 -0
  991. package/src/recall-query-policy.ts +221 -0
  992. package/src/recall-state.test.ts +233 -0
  993. package/src/recall-state.ts +456 -0
  994. package/src/recall-tag-filter.ts +143 -0
  995. package/src/recall-tokenization.ts +35 -0
  996. package/src/recall-xray-cli.test.ts +118 -0
  997. package/src/recall-xray-cli.ts +100 -0
  998. package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
  999. package/src/recall-xray-renderer.test.ts +539 -0
  1000. package/src/recall-xray-renderer.ts +487 -0
  1001. package/src/recall-xray.test.ts +503 -0
  1002. package/src/recall-xray.ts +621 -0
  1003. package/src/reconstruct.ts +41 -0
  1004. package/src/release-changelog.ts +35 -0
  1005. package/src/relevance.ts +67 -0
  1006. package/src/replay/normalizers/chatgpt.ts +133 -0
  1007. package/src/replay/normalizers/claude.ts +102 -0
  1008. package/src/replay/normalizers/openclaw.ts +119 -0
  1009. package/src/replay/normalizers/shared.ts +69 -0
  1010. package/src/replay/runner.ts +197 -0
  1011. package/src/replay/types.ts +143 -0
  1012. package/src/rerank.test.ts +48 -0
  1013. package/src/rerank.ts +176 -0
  1014. package/src/resolve-auth-token.test.ts +226 -0
  1015. package/src/resolve-auth-token.ts +151 -0
  1016. package/src/resolve-provider-secret.test.ts +187 -0
  1017. package/src/resolve-provider-secret.ts +410 -0
  1018. package/src/response-guidance-recall.test.ts +3952 -0
  1019. package/src/response-guidance-recall.ts +4431 -0
  1020. package/src/resume-bundles.ts +415 -0
  1021. package/src/retrieval-agents.ts +623 -0
  1022. package/src/retrieval-tiers.ts +25 -0
  1023. package/src/retrieval.ts +104 -0
  1024. package/src/review/index.test.ts +201 -0
  1025. package/src/review/index.ts +536 -0
  1026. package/src/routing/engine.ts +162 -0
  1027. package/src/routing/store.ts +321 -0
  1028. package/src/runtime/better-sqlite.test.ts +32 -0
  1029. package/src/runtime/better-sqlite.ts +76 -0
  1030. package/src/runtime/child-process.ts +67 -0
  1031. package/src/runtime/env.ts +48 -0
  1032. package/src/sanitize.ts +58 -0
  1033. package/src/schemas.ts +449 -0
  1034. package/src/sdk-compat.ts +87 -0
  1035. package/src/search/document-scanner.ts +96 -0
  1036. package/src/search/embed-helper.ts +142 -0
  1037. package/src/search/factory.ts +189 -0
  1038. package/src/search/index.ts +10 -0
  1039. package/src/search/lancedb-backend.ts +342 -0
  1040. package/src/search/meilisearch-backend.ts +232 -0
  1041. package/src/search/noop-backend.ts +57 -0
  1042. package/src/search/orama-backend.ts +358 -0
  1043. package/src/search/port.ts +86 -0
  1044. package/src/search/remote-backend.ts +124 -0
  1045. package/src/secure-store/cipher.ts +271 -0
  1046. package/src/secure-store/cli-handlers.ts +355 -0
  1047. package/src/secure-store/cli-renderer.ts +131 -0
  1048. package/src/secure-store/header.ts +373 -0
  1049. package/src/secure-store/index.ts +137 -0
  1050. package/src/secure-store/kdf.ts +263 -0
  1051. package/src/secure-store/keyring.ts +106 -0
  1052. package/src/secure-store/metadata.ts +394 -0
  1053. package/src/secure-store/passphrase-reader.ts +252 -0
  1054. package/src/secure-store/secure-fs.ts +571 -0
  1055. package/src/secure-store/secure-store.test.ts +755 -0
  1056. package/src/semantic-chunking.ts +545 -0
  1057. package/src/semantic-consolidation.test.ts +182 -0
  1058. package/src/semantic-consolidation.ts +432 -0
  1059. package/src/semantic-rule-promotion.ts +183 -0
  1060. package/src/semantic-rule-verifier.ts +160 -0
  1061. package/src/session-integrity.ts +569 -0
  1062. package/src/session-observer-bands.ts +11 -0
  1063. package/src/session-observer-state.ts +346 -0
  1064. package/src/session-toggles.test.ts +96 -0
  1065. package/src/session-toggles.ts +159 -0
  1066. package/src/shared-context/manager.ts +810 -0
  1067. package/src/signal.ts +84 -0
  1068. package/src/skills-registry.test.ts +277 -0
  1069. package/src/skills-registry.ts +120 -0
  1070. package/src/source-attribution-roundtrip.test.ts +215 -0
  1071. package/src/source-attribution.test.ts +1425 -0
  1072. package/src/source-attribution.ts +639 -0
  1073. package/src/spaces/index.ts +627 -0
  1074. package/src/storage-paths.ts +117 -0
  1075. package/src/storage.ts +6657 -0
  1076. package/src/store-contract.ts +55 -0
  1077. package/src/summarizer.ts +844 -0
  1078. package/src/summary-snapshot.test.ts +681 -0
  1079. package/src/summary-snapshot.ts +238 -0
  1080. package/src/surfaces/dreams.test.ts +394 -0
  1081. package/src/surfaces/dreams.ts +346 -0
  1082. package/src/surfaces/heartbeat.test.ts +415 -0
  1083. package/src/surfaces/heartbeat.ts +325 -0
  1084. package/src/sync/index.ts +308 -0
  1085. package/src/targeted-fact-recall.test.ts +1694 -0
  1086. package/src/targeted-fact-recall.ts +2905 -0
  1087. package/src/taxonomy/default-taxonomy.ts +87 -0
  1088. package/src/taxonomy/index.ts +26 -0
  1089. package/src/taxonomy/resolver-doc-generator.ts +57 -0
  1090. package/src/taxonomy/resolver.ts +184 -0
  1091. package/src/taxonomy/taxonomy-loader.ts +186 -0
  1092. package/src/taxonomy/types.ts +48 -0
  1093. package/src/telemetry-transcript.ts +70 -0
  1094. package/src/temporal-index.ts +890 -0
  1095. package/src/temporal-supersession.test.ts +2703 -0
  1096. package/src/temporal-supersession.ts +493 -0
  1097. package/src/temporal-validity.test.ts +448 -0
  1098. package/src/temporal-validity.ts +123 -0
  1099. package/src/threading.ts +395 -0
  1100. package/src/tier-migration.ts +124 -0
  1101. package/src/tier-routing.ts +102 -0
  1102. package/src/tmt.ts +462 -0
  1103. package/src/tokens.test.ts +178 -0
  1104. package/src/tokens.ts +279 -0
  1105. package/src/topics.ts +147 -0
  1106. package/src/training-export/cli-date-validation.test.ts +258 -0
  1107. package/src/training-export/converter.test.ts +452 -0
  1108. package/src/training-export/converter.ts +319 -0
  1109. package/src/training-export/date-parse.ts +117 -0
  1110. package/src/training-export/index.ts +26 -0
  1111. package/src/training-export/registry.test.ts +85 -0
  1112. package/src/training-export/registry.ts +57 -0
  1113. package/src/training-export/types.ts +31 -0
  1114. package/src/transcript.ts +1179 -0
  1115. package/src/transfer/autodetect.ts +30 -0
  1116. package/src/transfer/backup.ts +138 -0
  1117. package/src/transfer/capsule-crypto.ts +485 -0
  1118. package/src/transfer/capsule-encrypt.test.ts +690 -0
  1119. package/src/transfer/capsule-export.ts +543 -0
  1120. package/src/transfer/capsule-fork.ts +375 -0
  1121. package/src/transfer/capsule-import.ts +564 -0
  1122. package/src/transfer/capsule-merge.ts +433 -0
  1123. package/src/transfer/conflict-policy.ts +16 -0
  1124. package/src/transfer/constants.ts +13 -0
  1125. package/src/transfer/exclusions.ts +37 -0
  1126. package/src/transfer/export-json.ts +65 -0
  1127. package/src/transfer/export-md.ts +59 -0
  1128. package/src/transfer/export-sqlite.ts +52 -0
  1129. package/src/transfer/fs-utils.ts +269 -0
  1130. package/src/transfer/import-json.ts +108 -0
  1131. package/src/transfer/import-md.ts +84 -0
  1132. package/src/transfer/import-sqlite.ts +100 -0
  1133. package/src/transfer/integrity.ts +71 -0
  1134. package/src/transfer/sqlite-schema.ts +16 -0
  1135. package/src/transfer/types.ts +297 -0
  1136. package/src/trust-zones.ts +1186 -0
  1137. package/src/types.ts +3074 -0
  1138. package/src/user-model.test.ts +124 -0
  1139. package/src/user-model.ts +162 -0
  1140. package/src/utility-learner.ts +353 -0
  1141. package/src/utility-runtime.ts +88 -0
  1142. package/src/utility-telemetry.ts +215 -0
  1143. package/src/utils/category-dir.ts +44 -0
  1144. package/src/utils/errno.ts +6 -0
  1145. package/src/utils/iso-timestamp.test.ts +37 -0
  1146. package/src/utils/iso-timestamp.ts +164 -0
  1147. package/src/utils/path.ts +26 -0
  1148. package/src/verified-recall.ts +138 -0
  1149. package/src/version-utils.test.ts +10 -0
  1150. package/src/version-utils.ts +9 -0
  1151. package/src/whitespace.ts +10 -0
  1152. package/src/work/board.ts +359 -0
  1153. package/src/work/boundary.ts +107 -0
  1154. package/src/work/storage.ts +436 -0
  1155. package/src/work/types.ts +82 -0
  1156. package/src/work-product-ledger.ts +265 -0
  1157. package/dist/access-service-DDjzFALq.d.ts +0 -2088
  1158. package/dist/capsule-crypto-SJS5VVAP.js +0 -18
  1159. package/dist/capsule-export-7QNCBZOQ.js +0 -17
  1160. package/dist/capsule-import-EPBHD2EN.js +0 -16
  1161. package/dist/capsule-merge-DI7PNQ2H.js +0 -189
  1162. package/dist/chunk-23ZZK64Y.js +0 -26
  1163. package/dist/chunk-23ZZK64Y.js.map +0 -1
  1164. package/dist/chunk-242S3I2A.js +0 -647
  1165. package/dist/chunk-2LGMW3DJ.js +0 -111
  1166. package/dist/chunk-3B6KIRBH.js +0 -5213
  1167. package/dist/chunk-3B6KIRBH.js.map +0 -1
  1168. package/dist/chunk-457A4P3L.js +0 -119
  1169. package/dist/chunk-457A4P3L.js.map +0 -1
  1170. package/dist/chunk-4IS4SXIQ.js +0 -2040
  1171. package/dist/chunk-4YM32CRU.js +0 -721
  1172. package/dist/chunk-6TBWYBJ3.js +0 -236
  1173. package/dist/chunk-74EMIVE4.js +0 -329
  1174. package/dist/chunk-74EMIVE4.js.map +0 -1
  1175. package/dist/chunk-767ODGE6.js +0 -183
  1176. package/dist/chunk-7V22HTMD.js +0 -623
  1177. package/dist/chunk-7V22HTMD.js.map +0 -1
  1178. package/dist/chunk-7ZM3BFKK.js +0 -9705
  1179. package/dist/chunk-7ZM3BFKK.js.map +0 -1
  1180. package/dist/chunk-AQJNPMOA.js +0 -643
  1181. package/dist/chunk-AQJNPMOA.js.map +0 -1
  1182. package/dist/chunk-ASAITVLA.js +0 -64
  1183. package/dist/chunk-ASAITVLA.js.map +0 -1
  1184. package/dist/chunk-BBE34QBJ.js +0 -275
  1185. package/dist/chunk-BBE34QBJ.js.map +0 -1
  1186. package/dist/chunk-BZSQEPRW.js +0 -14710
  1187. package/dist/chunk-BZSQEPRW.js.map +0 -1
  1188. package/dist/chunk-CPKTBRS2.js +0 -891
  1189. package/dist/chunk-CPKTBRS2.js.map +0 -1
  1190. package/dist/chunk-D4GAOFF6.js +0 -562
  1191. package/dist/chunk-D4GAOFF6.js.map +0 -1
  1192. package/dist/chunk-D54LZC5L.js +0 -147
  1193. package/dist/chunk-DF3RVK3X.js +0 -119
  1194. package/dist/chunk-DF3RVK3X.js.map +0 -1
  1195. package/dist/chunk-DZZPC36E.js +0 -1451
  1196. package/dist/chunk-DZZPC36E.js.map +0 -1
  1197. package/dist/chunk-E2UCDP5S.js +0 -570
  1198. package/dist/chunk-E6K4NIEU.js +0 -747
  1199. package/dist/chunk-E6K4NIEU.js.map +0 -1
  1200. package/dist/chunk-EEQLFRUM.js +0 -89
  1201. package/dist/chunk-ETOW6ACV.js +0 -158
  1202. package/dist/chunk-ETOW6ACV.js.map +0 -1
  1203. package/dist/chunk-FMEBPEAO.js +0 -347
  1204. package/dist/chunk-FMEBPEAO.js.map +0 -1
  1205. package/dist/chunk-FQDPCE3I.js +0 -1837
  1206. package/dist/chunk-FQDPCE3I.js.map +0 -1
  1207. package/dist/chunk-FYIYMQ5N.js +0 -221
  1208. package/dist/chunk-FYIYMQ5N.js.map +0 -1
  1209. package/dist/chunk-G2WADRQ3.js +0 -219
  1210. package/dist/chunk-G4SK7DSQ.js +0 -121
  1211. package/dist/chunk-GVPWB7EY.js +0 -390
  1212. package/dist/chunk-GVPWB7EY.js.map +0 -1
  1213. package/dist/chunk-HELQZFZO.js +0 -1075
  1214. package/dist/chunk-HL5LRPNA.js +0 -1914
  1215. package/dist/chunk-HL5LRPNA.js.map +0 -1
  1216. package/dist/chunk-HQZVVSVB.js +0 -147
  1217. package/dist/chunk-HQZVVSVB.js.map +0 -1
  1218. package/dist/chunk-HY3L4WKC.js +0 -2195
  1219. package/dist/chunk-HY3L4WKC.js.map +0 -1
  1220. package/dist/chunk-IB3BFHGN.js +0 -228
  1221. package/dist/chunk-IXEJRKCZ.js +0 -18
  1222. package/dist/chunk-JBMSGZEQ.js +0 -441
  1223. package/dist/chunk-JBMSGZEQ.js.map +0 -1
  1224. package/dist/chunk-JESOB2HO.js +0 -108
  1225. package/dist/chunk-JKDVIE52.js +0 -272
  1226. package/dist/chunk-JRNQ3RNA.js +0 -284
  1227. package/dist/chunk-JRNQ3RNA.js.map +0 -1
  1228. package/dist/chunk-K6WK37A6.js +0 -865
  1229. package/dist/chunk-K6WK37A6.js.map +0 -1
  1230. package/dist/chunk-MARWOCVP.js +0 -48
  1231. package/dist/chunk-MNU6ZBWT.js +0 -4454
  1232. package/dist/chunk-MNU6ZBWT.js.map +0 -1
  1233. package/dist/chunk-N5AKDXAI.js +0 -74
  1234. package/dist/chunk-OA3L7BFR.js +0 -183
  1235. package/dist/chunk-OA3L7BFR.js.map +0 -1
  1236. package/dist/chunk-OR64ZGRZ.js +0 -23
  1237. package/dist/chunk-P77UEOU2.js +0 -1521
  1238. package/dist/chunk-P77UEOU2.js.map +0 -1
  1239. package/dist/chunk-PH4C2U43.js +0 -239
  1240. package/dist/chunk-PH4C2U43.js.map +0 -1
  1241. package/dist/chunk-RVPLBATS.js +0 -1586
  1242. package/dist/chunk-RVPLBATS.js.map +0 -1
  1243. package/dist/chunk-U5JMRGKX.js +0 -340
  1244. package/dist/chunk-U5JMRGKX.js.map +0 -1
  1245. package/dist/chunk-URB2WSKZ.js +0 -350
  1246. package/dist/chunk-URB2WSKZ.js.map +0 -1
  1247. package/dist/chunk-UVMUAWVT.js +0 -596
  1248. package/dist/chunk-WEJG4TB5.js +0 -118
  1249. package/dist/chunk-X7HPGUVG.js +0 -271
  1250. package/dist/chunk-XAMBKFQS.js +0 -2777
  1251. package/dist/chunk-XAMBKFQS.js.map +0 -1
  1252. package/dist/chunk-XJKFSSDW.js +0 -726
  1253. package/dist/chunk-XJKFSSDW.js.map +0 -1
  1254. package/dist/chunk-XMHBH5H6.js +0 -283
  1255. package/dist/chunk-XMHBH5H6.js.map +0 -1
  1256. package/dist/chunk-XMVFHBHT.js +0 -277
  1257. package/dist/chunk-Y3VMVTYX.js +0 -53
  1258. package/dist/chunk-YNB73F22.js +0 -137
  1259. package/dist/chunk-YNB73F22.js.map +0 -1
  1260. package/dist/chunk-Z2E7VW55.js +0 -335
  1261. package/dist/chunk-Z2E7VW55.js.map +0 -1
  1262. package/dist/chunk-ZG7PTKBK.js +0 -2296
  1263. package/dist/chunk-ZNQN6ZTA.js +0 -135
  1264. package/dist/chunk-ZVTKDVVM.js +0 -827
  1265. package/dist/chunk-ZVTKDVVM.js.map +0 -1
  1266. package/dist/cli-BR8KpIU0.d.ts +0 -1259
  1267. package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
  1268. package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
  1269. package/dist/contradiction-review-5LTTVDQV.js +0 -22
  1270. package/dist/contradiction-scan-QTXAMBUA.js +0 -414
  1271. package/dist/contradiction-scan-QTXAMBUA.js.map +0 -1
  1272. package/dist/engine-35M5BKQ7.js +0 -28
  1273. package/dist/fs-utils-IRVUFB6G.js +0 -30
  1274. package/dist/graph-edge-decay-PWB63GRE.js +0 -207
  1275. package/dist/memory-governance-IMPQZXFC.js +0 -37
  1276. package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
  1277. package/dist/orchestrator-DDMPqU6R.d.ts +0 -1792
  1278. package/dist/path-RMTY5Y5A.js +0 -9
  1279. package/dist/port-B6VEDIkC.d.ts +0 -53
  1280. package/dist/resolution-YGIBORXI.js +0 -101
  1281. package/dist/resolution-YGIBORXI.js.map +0 -1
  1282. package/dist/secure-store-4R2GSO7S.js +0 -156
  1283. package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
  1284. package/dist/state-store-3EH7HYIN.js +0 -16
  1285. package/dist/types-V3FJ26TF.js +0 -30
  1286. /package/dist/{capsule-crypto-SJS5VVAP.js.map → adapters/claude-code.js.map} +0 -0
  1287. /package/dist/{capsule-export-7QNCBZOQ.js.map → adapters/codex.js.map} +0 -0
  1288. /package/dist/{capsule-import-EPBHD2EN.js.map → adapters/hermes.js.map} +0 -0
  1289. /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/index.js.map} +0 -0
  1290. /package/dist/{engine-35M5BKQ7.js.map → adapters/registry.js.map} +0 -0
  1291. /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/replit.js.map} +0 -0
  1292. /package/dist/{memory-governance-IMPQZXFC.js.map → adapters/types.js.map} +0 -0
  1293. /package/dist/{path-RMTY5Y5A.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
  1294. /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
  1295. /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
  1296. /package/dist/{chunk-X7HPGUVG.js.map → chunk-4CRG46BG.js.map} +0 -0
  1297. /package/dist/{chunk-UVMUAWVT.js.map → chunk-7IASACLB.js.map} +0 -0
  1298. /package/dist/{chunk-HELQZFZO.js.map → chunk-EDTHC6UD.js.map} +0 -0
  1299. /package/dist/{chunk-4YM32CRU.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
  1300. /package/dist/{chunk-E2UCDP5S.js.map → chunk-FBYESMQ2.js.map} +0 -0
  1301. /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
  1302. /package/dist/{chunk-IB3BFHGN.js.map → chunk-GGKRUQOO.js.map} +0 -0
  1303. /package/dist/{chunk-242S3I2A.js.map → chunk-GL6I6MEQ.js.map} +0 -0
  1304. /package/dist/{secure-store-4R2GSO7S.js.map → chunk-HHLLAQGZ.js.map} +0 -0
  1305. /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
  1306. /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
  1307. /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
  1308. /package/dist/{chunk-WEJG4TB5.js.map → chunk-MC26UJIM.js.map} +0 -0
  1309. /package/dist/{chunk-JKDVIE52.js.map → chunk-MGKYQQYF.js.map} +0 -0
  1310. /package/dist/{chunk-Y3VMVTYX.js.map → chunk-MT4HVDUZ.js.map} +0 -0
  1311. /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
  1312. /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
  1313. /package/dist/{chunk-JESOB2HO.js.map → chunk-P4NEIHUT.js.map} +0 -0
  1314. /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
  1315. /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
  1316. /package/dist/{state-store-3EH7HYIN.js.map → chunk-SEDEKFYQ.js.map} +0 -0
  1317. /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
  1318. /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
  1319. /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
  1320. /package/dist/{types-V3FJ26TF.js.map → chunk-V5OCT34X.js.map} +0 -0
  1321. /package/dist/{chunk-ZG7PTKBK.js.map → chunk-W3LR522O.js.map} +0 -0
  1322. /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
  1323. /package/dist/{chunk-ZNQN6ZTA.js.map → chunk-XVZ7B3HG.js.map} +0 -0
  1324. /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
@@ -0,0 +1,4164 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import {
5
+ buildEventOrderRecallSection,
6
+ shouldRecallEventOrderEvidence,
7
+ } from "./event-order-recall.js";
8
+
9
+ class FakeEventOrderEngine {
10
+ readonly expandCalls: Array<{ sessionId: string; fromTurn: number; toTurn: number; maxTokens: number }> = [];
11
+
12
+ constructor(
13
+ private readonly sessionId: string,
14
+ private readonly messages: Array<{ turn_index: number; role: string; content: string }>,
15
+ ) {}
16
+
17
+ async searchContextFull(): Promise<
18
+ Array<{
19
+ turn_index: number;
20
+ role: string;
21
+ content: string;
22
+ session_id: string;
23
+ score: number;
24
+ }>
25
+ > {
26
+ return [];
27
+ }
28
+
29
+ async expandContext(
30
+ sessionId: string,
31
+ fromTurn: number,
32
+ toTurn: number,
33
+ maxTokens: number,
34
+ ): Promise<Array<{ turn_index: number; role: string; content: string }>> {
35
+ this.expandCalls.push({ sessionId, fromTurn, toTurn, maxTokens });
36
+ if (sessionId !== this.sessionId) return [];
37
+ return this.messages.filter(
38
+ (message) => message.turn_index >= fromTurn && message.turn_index <= toTurn,
39
+ );
40
+ }
41
+
42
+ async getStats(sessionId?: string): Promise<{
43
+ totalMessages: number;
44
+ maxTurnIndex?: number;
45
+ }> {
46
+ if (sessionId && sessionId !== this.sessionId) {
47
+ return { totalMessages: 0 };
48
+ }
49
+ return {
50
+ totalMessages: this.messages.length,
51
+ maxTurnIndex: Math.max(...this.messages.map((message) => message.turn_index)),
52
+ };
53
+ }
54
+ }
55
+
56
+ test("event order recall is query-triggered", () => {
57
+ assert.equal(
58
+ shouldRecallEventOrderEvidence(
59
+ "Can you walk me through the order in which I brought up interactions with Patrick, in order?",
60
+ ),
61
+ true,
62
+ );
63
+ assert.equal(
64
+ shouldRecallEventOrderEvidence("Can you give me a summary of what happened with the project over time?"),
65
+ true,
66
+ );
67
+ assert.equal(
68
+ shouldRecallEventOrderEvidence(
69
+ "Can you reconstruct the timeline of when I first mentioned each aspect of my system architecture and related tooling in order? Mention ONLY and ONLY ten items.",
70
+ ),
71
+ true,
72
+ );
73
+ assert.equal(
74
+ shouldRecallEventOrderEvidence(
75
+ "How did my discussions about managing and optimizing database and data handling evolve in order? Mention ONLY and ONLY nine items.",
76
+ ),
77
+ true,
78
+ );
79
+ assert.equal(
80
+ shouldRecallEventOrderEvidence(
81
+ "Can you reconstruct the sequence in which I introduced different facets of the combinatorial principles we discussed in order? Mention ONLY and ONLY ten items.",
82
+ ),
83
+ true,
84
+ );
85
+ assert.equal(
86
+ shouldRecallEventOrderEvidence(
87
+ "How did my focus on different types of professional meetings and collaborations develop throughout our conversations in order? Mention ONLY and ONLY ten items.",
88
+ ),
89
+ true,
90
+ );
91
+ assert.equal(
92
+ shouldRecallEventOrderEvidence(
93
+ "How did my mentions about my involvement with a particular investment interest and related collaborations develop in order? Mention ONLY and ONLY eight items.",
94
+ ),
95
+ true,
96
+ );
97
+ assert.equal(
98
+ shouldRecallEventOrderEvidence(
99
+ "How did my focus on different aspects of sleep tracking devices develop throughout our conversations in order? Mention ONLY and ONLY ten items.",
100
+ ),
101
+ true,
102
+ );
103
+ assert.equal(
104
+ shouldRecallEventOrderEvidence(
105
+ "How did my focus on balancing work, income, and relationship priorities shift throughout our conversations in order? Mention ONLY and ONLY eight items.",
106
+ ),
107
+ true,
108
+ );
109
+ assert.equal(
110
+ shouldRecallEventOrderEvidence(
111
+ "Can you walk me through the order in which I brought up different ways of engaging with Turkish culture and language throughout our conversations, in order? Mention ONLY and ONLY ten items.",
112
+ ),
113
+ true,
114
+ );
115
+ assert.equal(
116
+ shouldRecallEventOrderEvidence(
117
+ "Can you give me a thorough summary of managing my housing situation from lease concerns through moving and settling in, covering the key decisions I faced along the way?",
118
+ ),
119
+ true,
120
+ );
121
+ assert.equal(
122
+ shouldRecallEventOrderEvidence(
123
+ "How did my focus on different aspects of the moving and home setup process shift throughout our conversations in order? Mention ONLY and ONLY eight items.",
124
+ ),
125
+ true,
126
+ );
127
+ assert.equal(
128
+ shouldRecallEventOrderEvidence(
129
+ "How did my focus on different aspects of Jesse's recommendations develop throughout our conversations in order? Mention ONLY and ONLY eight items.",
130
+ ),
131
+ true,
132
+ );
133
+ assert.equal(
134
+ shouldRecallEventOrderEvidence(
135
+ "How did my focus on different financial aspects of the property sale evolve throughout our conversations in order? Mention ONLY and ONLY eight items.",
136
+ ),
137
+ true,
138
+ );
139
+ assert.equal(
140
+ shouldRecallEventOrderEvidence(
141
+ "How did my family's involvement in the home preparation process shift throughout our conversations in order? Mention ONLY and ONLY six items.",
142
+ ),
143
+ true,
144
+ );
145
+ assert.equal(
146
+ shouldRecallEventOrderEvidence(
147
+ "How did my focus on different types of home improvement projects develop throughout our conversations in order? Mention ONLY and ONLY twelve items.",
148
+ ),
149
+ true,
150
+ );
151
+ assert.equal(
152
+ shouldRecallEventOrderEvidence(
153
+ "How did my DIY project recommendations develop in order? Mention ONLY and ONLY ten items.",
154
+ ),
155
+ true,
156
+ );
157
+ assert.equal(
158
+ shouldRecallEventOrderEvidence("What was my espresso code?"),
159
+ false,
160
+ );
161
+ });
162
+
163
+ test("event order recall honors zero max items without scanning", async () => {
164
+ const engine = new FakeEventOrderEngine("event-order-zero", [
165
+ {
166
+ turn_index: 0,
167
+ role: "user",
168
+ content: "First I introduced the database migration issue.",
169
+ },
170
+ ]);
171
+
172
+ const recalled = await buildEventOrderRecallSection({
173
+ engine,
174
+ sessionId: "event-order-zero",
175
+ query: "Walk me through the order in which I introduced project topics in order.",
176
+ maxChars: 2000,
177
+ maxItems: 0,
178
+ });
179
+
180
+ assert.equal(recalled, "");
181
+ assert.deepEqual(engine.expandCalls, []);
182
+ });
183
+
184
+ test("event order recall keeps summary within the section budget", async () => {
185
+ const sessionId = "event-order-budget";
186
+ const engine = new FakeEventOrderEngine(sessionId, [
187
+ {
188
+ turn_index: 10,
189
+ role: "user",
190
+ content:
191
+ "First I introduced database migration planning, project timeline sequencing, and follow-up testing details.",
192
+ },
193
+ {
194
+ turn_index: 20,
195
+ role: "user",
196
+ content:
197
+ "Later I discussed deployment sequencing, review checkpoints, and how the implementation plan evolved.",
198
+ },
199
+ ]);
200
+
201
+ const maxChars = 220;
202
+ const recalled = await buildEventOrderRecallSection({
203
+ engine,
204
+ sessionId,
205
+ query:
206
+ "Walk me through the order in which project planning developed in order. Mention ONLY and ONLY two items.",
207
+ maxChars,
208
+ maxScanWindowTurns: 2,
209
+ });
210
+
211
+ assert.ok(recalled.length > 0);
212
+ assert.ok(
213
+ recalled.length <= maxChars,
214
+ `expected recalled section length ${recalled.length} to fit ${maxChars}`,
215
+ );
216
+ assert.match(recalled, /^## Chronological event evidence/);
217
+ });
218
+
219
+ test("event order recall returns relevant user turns in chronological order", async () => {
220
+ const sessionId = "event-order-core";
221
+ const engine = new FakeEventOrderEngine(sessionId, [
222
+ {
223
+ turn_index: 30,
224
+ role: "user",
225
+ content:
226
+ "Patrick suggested the March 15 workshop on workflow optimization, but I'm not sure whether to attend.",
227
+ },
228
+ {
229
+ turn_index: 44,
230
+ role: "user",
231
+ content:
232
+ "I want to discuss a relaxation technique Patrick mentioned for managing stress before meetings.",
233
+ },
234
+ {
235
+ turn_index: 58,
236
+ role: "assistant",
237
+ content: "Here are several general leadership articles.",
238
+ },
239
+ {
240
+ turn_index: 72,
241
+ role: "user",
242
+ content:
243
+ "Patrick and I have an interview tips meeting tomorrow, and I want a short checklist.",
244
+ },
245
+ ]);
246
+
247
+ const recalled = await buildEventOrderRecallSection({
248
+ engine,
249
+ sessionId,
250
+ query:
251
+ "Can you walk me through the order in which I brought up different aspects of my interactions with Patrick throughout our conversations, in order? Mention ONLY and ONLY three items.",
252
+ maxChars: 5_000,
253
+ maxScanWindowTurns: 2,
254
+ });
255
+
256
+ assert.match(recalled, /## Chronological event evidence/);
257
+ assert.match(recalled, /Requested item count: 3/);
258
+ assert.match(recalled, /workshop suggestion/);
259
+ assert.match(recalled, /relaxation technique discussion/);
260
+ assert.match(recalled, /interview tips meeting/);
261
+ assert.ok(
262
+ recalled.indexOf("workshop suggestion") <
263
+ recalled.indexOf("relaxation technique discussion"),
264
+ );
265
+ assert.ok(
266
+ recalled.indexOf("relaxation technique discussion") <
267
+ recalled.indexOf("interview tips meeting"),
268
+ );
269
+ assert.doesNotMatch(recalled, /general leadership articles/);
270
+ });
271
+
272
+ test("event order recall adds generic chronological labels for summary and planning milestones", async () => {
273
+ const sessionId = "event-order-labels-core";
274
+ const engine = new FakeEventOrderEngine(sessionId, [
275
+ {
276
+ turn_index: 4,
277
+ role: "user",
278
+ content:
279
+ "I started with initial planning and resource gathering for the project before the main development phase.",
280
+ },
281
+ {
282
+ turn_index: 12,
283
+ role: "user",
284
+ content:
285
+ "Later I refined retry logic with exponential backoff to handle contact form submissions.",
286
+ },
287
+ {
288
+ turn_index: 20,
289
+ role: "user",
290
+ content:
291
+ "For funding, I decided to choose a crowdfunding platform after comparing quick funding options.",
292
+ },
293
+ ]);
294
+
295
+ const recalled = await buildEventOrderRecallSection({
296
+ engine,
297
+ sessionId,
298
+ query:
299
+ "Can you walk me through the order in which I brought up different project and funding milestones, in order? Mention ONLY and ONLY three items.",
300
+ maxChars: 5_000,
301
+ maxScanWindowTurns: 3,
302
+ });
303
+
304
+ assert.match(recalled, /initial planning and resource gathering/);
305
+ assert.match(recalled, /retry logic with exponential backoff for contact form submissions/);
306
+ assert.match(recalled, /crowdfunding platform choice/);
307
+ });
308
+
309
+ test("event order recall labels combinatorial principle trajectories", async () => {
310
+ const sessionId = "event-order-combinatorics";
311
+ const engine = new FakeEventOrderEngine(sessionId, [
312
+ {
313
+ turn_index: 12,
314
+ role: "user",
315
+ content:
316
+ "I'm trying initial combinatorial formula questions with C(n, r) and P(n, r) for combinations and permutations.",
317
+ },
318
+ {
319
+ turn_index: 38,
320
+ role: "user",
321
+ content:
322
+ "Can you show examples with varied group sizes using the multinomial coefficient for groups of sizes 3, 2, and 2?",
323
+ },
324
+ {
325
+ turn_index: 72,
326
+ role: "user",
327
+ content:
328
+ "I want to apply the inclusion-exclusion principle for three sets A, B, and C.",
329
+ },
330
+ {
331
+ turn_index: 96,
332
+ role: "user",
333
+ content:
334
+ "Can we extend inclusion-exclusion to four sets so I can handle more complex scenarios?",
335
+ },
336
+ {
337
+ turn_index: 120,
338
+ role: "user",
339
+ content:
340
+ "I made a mistake in inclusion-exclusion by forgetting to subtract the triple intersections; help me identify and correct it.",
341
+ },
342
+ {
343
+ turn_index: 144,
344
+ role: "user",
345
+ content:
346
+ "Can you explain why the formula components like triple intersections are included?",
347
+ },
348
+ {
349
+ turn_index: 188,
350
+ role: "user",
351
+ content:
352
+ "I'm using the multinomial theorem for polynomial coefficient calculations in an expansion.",
353
+ },
354
+ {
355
+ turn_index: 220,
356
+ role: "user",
357
+ content:
358
+ "I need the distinction between multinomial coefficients and permutations with repeated elements.",
359
+ },
360
+ {
361
+ turn_index: 260,
362
+ role: "user",
363
+ content:
364
+ "I want combined use of multinomial and inclusion-exclusion principles for complex counting problems.",
365
+ },
366
+ {
367
+ turn_index: 300,
368
+ role: "user",
369
+ content:
370
+ "How do I ensure I'm applying the right combinatorial methods and improve formula accuracy with more practice problems?",
371
+ },
372
+ ]);
373
+
374
+ const recalled = await buildEventOrderRecallSection({
375
+ engine,
376
+ sessionId,
377
+ query:
378
+ "Can you reconstruct the sequence in which I introduced different facets of the combinatorial principles we discussed, including how I approached various problem types and formula applications, in order? Mention ONLY and ONLY ten items.",
379
+ maxChars: 10_000,
380
+ maxScanWindowTurns: 8,
381
+ });
382
+
383
+ assert.match(recalled, /initial combinatorial formula questions/);
384
+ assert.match(recalled, /examples with varied group sizes/);
385
+ assert.match(recalled, /inclusion-exclusion principle for three sets/);
386
+ assert.match(recalled, /inclusion-exclusion extension to four sets/);
387
+ assert.match(recalled, /error identification and correction in inclusion-exclusion/);
388
+ assert.match(recalled, /explanation of formula components like triple intersections/);
389
+ assert.match(recalled, /multinomial theorem and polynomial coefficient calculations/);
390
+ assert.match(recalled, /distinction between multinomial coefficients and permutations/);
391
+ assert.match(recalled, /combined use of multinomial and inclusion-exclusion principles/);
392
+ assert.match(recalled, /clarifications and accuracy improvements/);
393
+ });
394
+
395
+ test("event order recall labels non-Euclidean geometry trajectories", async () => {
396
+ const sessionId = "event-order-non-euclidean-geometry";
397
+ const engine = new FakeEventOrderEngine(sessionId, [
398
+ {
399
+ turn_index: 76,
400
+ role: "user",
401
+ content:
402
+ "I've been using GeoGebra to model spherical triangles and measure the angles to confirm the theoretical angle sums.",
403
+ },
404
+ {
405
+ turn_index: 174,
406
+ role: "user",
407
+ content:
408
+ "I'm calculating the angle sum of a hyperbolic triangle in the Poincare disk model and want to verify it with the hyperbolic law of cosines.",
409
+ },
410
+ {
411
+ turn_index: 611,
412
+ role: "user",
413
+ content:
414
+ "Can you verify my hyperbolic distance computation between points in the Poincare half-plane model?",
415
+ },
416
+ {
417
+ turn_index: 1434,
418
+ role: "user",
419
+ content:
420
+ "I want a step-by-step tutorial for creating custom hyperbolic tessellations with KaleidoTile, including generation and measurement.",
421
+ },
422
+ {
423
+ turn_index: 1502,
424
+ role: "user",
425
+ content:
426
+ "Can you help with visualization and plotting in GeoGebra 3D for the Poincare disk?",
427
+ },
428
+ ]);
429
+
430
+ const recalled = await buildEventOrderRecallSection({
431
+ engine,
432
+ sessionId,
433
+ query:
434
+ "How did my focus on different aspects of non-Euclidean geometry progress throughout our conversations in order? Mention ONLY and ONLY five items.",
435
+ maxChars: 8_000,
436
+ maxScanWindowTurns: 8,
437
+ });
438
+
439
+ assert.match(recalled, /spherical triangle modeling and angle sums with GeoGebra/i);
440
+ assert.match(recalled, /hyperbolic triangle calculations and verification/);
441
+ assert.match(recalled, /hyperbolic distance computations in Poincare models/);
442
+ assert.match(recalled, /hyperbolic tessellation generation and measurement with KaleidoTile/i);
443
+ assert.match(recalled, /visualization and plotting in GeoGebra 3D for Poincare disk/i);
444
+ });
445
+
446
+ test("event order recall labels collaboration, webinar, and relationship milestones", async () => {
447
+ const sessionId = "event-order-benchmark-shapes";
448
+ const engine = new FakeEventOrderEngine(sessionId, [
449
+ {
450
+ turn_index: 24,
451
+ role: "user",
452
+ content:
453
+ "I'm stressed about collaborating with Greg on editing schedules and need ways to make our weekly meetings more productive.",
454
+ },
455
+ {
456
+ turn_index: 78,
457
+ role: "user",
458
+ content:
459
+ "I'm worried my passive voice reduction after Carla revealed her editing checklist might not be enough.",
460
+ },
461
+ {
462
+ turn_index: 120,
463
+ role: "user",
464
+ content:
465
+ "I need help promoting the webinar through guild leadership newsletters and deciding what incentives to offer.",
466
+ },
467
+ {
468
+ turn_index: 262,
469
+ role: "user",
470
+ content:
471
+ "David planned a surprise picnic to celebrate my promotion, and I want to return the favor with something just as special.",
472
+ },
473
+ ]);
474
+
475
+ const recalled = await buildEventOrderRecallSection({
476
+ engine,
477
+ sessionId,
478
+ query:
479
+ "Can you walk me through the order in which I brought up different personal and work-related challenges during our chats, in order? Mention ONLY and ONLY four items.",
480
+ maxChars: 6_000,
481
+ maxScanWindowTurns: 8,
482
+ });
483
+
484
+ assert.match(recalled, /work collaboration stress and meeting strategies/);
485
+ assert.match(recalled, /Chronology outline:/);
486
+ assert.match(recalled, /passive voice reduction and checklist/);
487
+ assert.match(recalled, /webinar planning and promotion/);
488
+ assert.match(recalled, /engagement and incentives discussion/);
489
+ assert.match(recalled, /surprise celebration and returning the favor/);
490
+ });
491
+
492
+ test("event order recall labels webinar rehearsals with multiple presenters", async () => {
493
+ const sessionId = "event-order-webinar-rehearsal-presenters";
494
+ const engine = new FakeEventOrderEngine(sessionId, [
495
+ {
496
+ turn_index: 716,
497
+ role: "user",
498
+ content:
499
+ "What's the best way to prepare for a webinar rehearsal with Jason and Russell via Zoom on May 15 at 10:00 AM?",
500
+ },
501
+ {
502
+ turn_index: 736,
503
+ role: "user",
504
+ content:
505
+ "Can you provide guidance on how to effectively coordinate a webinar rehearsal with multiple presenters like Jason and Russell?",
506
+ },
507
+ {
508
+ turn_index: 744,
509
+ role: "user",
510
+ content:
511
+ "Ok cool, do I need to rehearse with Jason and Russell too, or just on my own?",
512
+ },
513
+ ]);
514
+
515
+ const recalled = await buildEventOrderRecallSection({
516
+ engine,
517
+ sessionId,
518
+ query:
519
+ "How did my focus on different types of professional meetings and collaborations develop throughout our conversations in order? Mention ONLY and ONLY ten items.",
520
+ maxChars: 6_000,
521
+ maxScanWindowTurns: 8,
522
+ });
523
+
524
+ assert.match(recalled, /Chronology outline:/);
525
+ assert.match(recalled, /webinar rehearsals with multiple presenters/);
526
+ });
527
+
528
+ test("event order recall labels Microsoft Teams adoption", async () => {
529
+ const sessionId = "event-order-microsoft-teams";
530
+ const engine = new FakeEventOrderEngine(sessionId, [
531
+ {
532
+ turn_index: 1716,
533
+ role: "user",
534
+ content:
535
+ "How can I effectively use Microsoft Teams for team collaboration starting July 5 to improve our communication?",
536
+ },
537
+ {
538
+ turn_index: 1734,
539
+ role: "user",
540
+ content:
541
+ "How can I leverage the adoption of Microsoft Teams to enhance our team's productivity and patient outcomes?",
542
+ },
543
+ ]);
544
+
545
+ const recalled = await buildEventOrderRecallSection({
546
+ engine,
547
+ sessionId,
548
+ query:
549
+ "How did my focus on different professional tools and collaboration methods develop throughout our conversations in order? Mention ONLY and ONLY nine items.",
550
+ maxChars: 6_000,
551
+ maxScanWindowTurns: 8,
552
+ });
553
+
554
+ assert.match(recalled, /Chronology outline:/);
555
+ assert.match(recalled, /Microsoft Teams adoption/);
556
+ });
557
+
558
+ test("event order recall labels property investment and Randy cash-flow milestones", async () => {
559
+ const sessionId = "event-order-property-investment";
560
+ const engine = new FakeEventOrderEngine(sessionId, [
561
+ {
562
+ turn_index: 120,
563
+ role: "user",
564
+ content:
565
+ "I've contacted Mehmet Yilmaz, a local agent with 15 years of experience, for property viewings scheduled on March 25 and 27, what should I expect from these meetings?",
566
+ },
567
+ {
568
+ turn_index: 162,
569
+ role: "user",
570
+ content:
571
+ "Randy and I reviewed the financial projection and cash flow difference between a single-family home and a duplex, with projected monthly rental income of $600 versus $1,000 factoring in 10% vacancy.",
572
+ },
573
+ {
574
+ turn_index: 378,
575
+ role: "user",
576
+ content:
577
+ "I have a scheduled home inspection on April 14 at 10 AM with contractor Cem Yildiz, and I want to coordinate the viewing with Mehmet and the contractor.",
578
+ },
579
+ ]);
580
+
581
+ const recalled = await buildEventOrderRecallSection({
582
+ engine,
583
+ sessionId,
584
+ query:
585
+ "How did my focus on different aspects of property investment and management develop throughout our conversations in order? Mention ONLY and ONLY ten items.",
586
+ maxChars: 6_000,
587
+ maxScanWindowTurns: 8,
588
+ });
589
+
590
+ assert.match(recalled, /Chronology outline:/);
591
+ assert.match(recalled, /agent interaction and viewing preparation/);
592
+ assert.match(recalled, /viewing preparation with agent and contractor/);
593
+ assert.match(recalled, /financial projection and cash flow review/);
594
+ });
595
+
596
+ test("event order recall keeps high-value labels when query-term overlap is sparse", async () => {
597
+ const sessionId = "event-order-sparse-labels";
598
+ const engine = new FakeEventOrderEngine(sessionId, [
599
+ {
600
+ turn_index: 18,
601
+ role: "user",
602
+ content:
603
+ "I'm worried my $12.99/month Canva Pro subscription might not be enough to make my resume ATS compatible.",
604
+ },
605
+ {
606
+ turn_index: 116,
607
+ role: "user",
608
+ content:
609
+ "I'm feeling really grateful that Ashlee celebrated my progress and suggested mindfulness exercises before the interview.",
610
+ },
611
+ {
612
+ turn_index: 174,
613
+ role: "user",
614
+ content:
615
+ "I'm celebrating with Ashlee and she's supportive of my decision, so I want reassurance that it was the right choice.",
616
+ },
617
+ {
618
+ turn_index: 228,
619
+ role: "user",
620
+ content:
621
+ "I feel grateful that Ashlee joined me for the July 10 weekend retreat, and I want to show my appreciation.",
622
+ },
623
+ ]);
624
+
625
+ const recalled = await buildEventOrderRecallSection({
626
+ engine,
627
+ sessionId,
628
+ query:
629
+ "Can you walk me through the order in which I brought up different aspects of my personal and professional progress throughout our conversations, in order? Mention ONLY and ONLY five items.",
630
+ maxChars: 6_000,
631
+ maxScanWindowTurns: 8,
632
+ });
633
+
634
+ assert.match(recalled, /subscription service concern/);
635
+ assert.match(recalled, /gratitude and mindfulness advice/);
636
+ assert.match(recalled, /celebration and decision reassurance/);
637
+ assert.match(recalled, /retreat reflection and appreciation/);
638
+ });
639
+
640
+ test("event order recall labels real-time chat message-management trajectories", async () => {
641
+ const sessionId = "event-order-chat-app";
642
+ const engine = new FakeEventOrderEngine(sessionId, [
643
+ {
644
+ turn_index: 20,
645
+ role: "user",
646
+ content:
647
+ "I need query optimization for recent messages in my chat app, including getRecentMessages by roomId.",
648
+ },
649
+ {
650
+ turn_index: 34,
651
+ role: "user",
652
+ content:
653
+ "Now I'm working on schema design and validation for editing messages, especially the updateMessage function.",
654
+ },
655
+ {
656
+ turn_index: 48,
657
+ role: "user",
658
+ content:
659
+ "Next I want to test the updateMessage function and handle unchanged message text cases cleanly.",
660
+ },
661
+ {
662
+ turn_index: 60,
663
+ role: "user",
664
+ content:
665
+ "I'm planning a migration script, then batch execution of the migration, and finally enhancing migration script robustness.",
666
+ },
667
+ ]);
668
+
669
+ const recalled = await buildEventOrderRecallSection({
670
+ engine,
671
+ sessionId,
672
+ query:
673
+ "How did my discussions about managing message data in the chat app progress in order (mention 7 items in order)?",
674
+ maxChars: 6_000,
675
+ maxScanWindowTurns: 4,
676
+ });
677
+
678
+ assert.match(recalled, /query optimization for recent messages/);
679
+ assert.match(recalled, /schema design and validation for editing/);
680
+ assert.match(recalled, /testing updateMessage function/);
681
+ assert.match(recalled, /handling unchanged message text cases/);
682
+ assert.match(recalled, /migration script planning/);
683
+ assert.match(recalled, /batch execution of migration/);
684
+ assert.match(recalled, /enhancing migration script robustness/);
685
+ });
686
+
687
+ test("event order recall labels real-time messaging optimization trajectories", async () => {
688
+ const sessionId = "event-order-chat-optimization";
689
+ const engine = new FakeEventOrderEngine(sessionId, [
690
+ {
691
+ turn_index: 10,
692
+ role: "user",
693
+ content:
694
+ "The basic setup uses Node.js, Express, and Socket.io, but I need better error handling.",
695
+ },
696
+ {
697
+ turn_index: 22,
698
+ role: "user",
699
+ content:
700
+ "I'm troubleshooting connection problems from CORS and matching Socket.io client/server versions.",
701
+ },
702
+ {
703
+ turn_index: 36,
704
+ role: "user",
705
+ content:
706
+ "I need multi-user broadcast optimizations because the app slows down near 1000 users.",
707
+ },
708
+ {
709
+ turn_index: 50,
710
+ role: "user",
711
+ content:
712
+ "For scaling I want a load balancer and message queue, then Redis caching for sessions.",
713
+ },
714
+ {
715
+ turn_index: 64,
716
+ role: "user",
717
+ content:
718
+ "When users joinRoom I need room message history retrieval, plus Redis pub/sub error handling and retry.",
719
+ },
720
+ {
721
+ turn_index: 78,
722
+ role: "user",
723
+ content:
724
+ "Finally I want to refactor broadcast logic and use Map and Set data structures for user and room management.",
725
+ },
726
+ ]);
727
+
728
+ const recalled = await buildEventOrderRecallSection({
729
+ engine,
730
+ sessionId,
731
+ query:
732
+ "Can you walk me through the order in which I brought up different aspects of optimizing and handling real-time messaging in my chat app throughout our conversations, in order (mention 9 items in order)?",
733
+ maxChars: 6_000,
734
+ maxScanWindowTurns: 4,
735
+ });
736
+
737
+ assert.match(recalled, /basic setup and error handling/);
738
+ assert.match(recalled, /connection troubleshooting/);
739
+ assert.match(recalled, /multi-user and broadcast optimizations/);
740
+ assert.match(recalled, /scaling with load balancer and message queue/);
741
+ assert.match(recalled, /Redis caching for sessions/);
742
+ assert.match(recalled, /room-based messaging and retrieval/);
743
+ assert.match(recalled, /Redis pub\/sub error handling and retry/);
744
+ assert.match(recalled, /broadcast logic refactoring and further optimization/);
745
+ assert.match(recalled, /performance bottlenecks and data structures/);
746
+ });
747
+
748
+ test("event order recall labels resume-analyzer optimization trajectories", async () => {
749
+ const sessionId = "event-order-resume-analyzer";
750
+ const engine = new FakeEventOrderEngine(sessionId, [
751
+ {
752
+ turn_index: 4,
753
+ role: "user",
754
+ content:
755
+ "I'm setting up a resume analyzer with Python, spaCy, Flask, and PyMuPDF for feature extraction.",
756
+ },
757
+ {
758
+ turn_index: 16,
759
+ role: "user",
760
+ content:
761
+ "I'm debugging PDF text extraction and NoneType errors before the February 15 project timeline deadline.",
762
+ },
763
+ {
764
+ turn_index: 28,
765
+ role: "user",
766
+ content:
767
+ "I used cProfile for API response time optimization and found bottlenecks.",
768
+ },
769
+ {
770
+ turn_index: 42,
771
+ role: "user",
772
+ content:
773
+ "Now I'm improving memory usage and keyword extraction with precompiled regex, stopword removal, and lemmatization.",
774
+ },
775
+ {
776
+ turn_index: 56,
777
+ role: "user",
778
+ content:
779
+ "Next I want job description parsing enhancements, startup time and caching strategies with lazy-loading spaCy and Redis-backed caching.",
780
+ },
781
+ {
782
+ turn_index: 70,
783
+ role: "user",
784
+ content:
785
+ "I'm optimizing the weighted scoring function and similarity calculations, then adding authentication and authorization.",
786
+ },
787
+ {
788
+ turn_index: 84,
789
+ role: "user",
790
+ content:
791
+ "Finally I need to simulate concurrent requests for performance testing.",
792
+ },
793
+ ]);
794
+
795
+ const recalled = await buildEventOrderRecallSection({
796
+ engine,
797
+ sessionId,
798
+ query:
799
+ "Can you list the order in which I brought up different aspects of optimizing and enhancing my resume analyzer project throughout our conversations, in order (mention 10 items in order)?",
800
+ maxChars: 7_000,
801
+ maxScanWindowTurns: 4,
802
+ });
803
+
804
+ assert.match(recalled, /initial setup and feature extraction/);
805
+ assert.match(recalled, /debugging PDF text extraction/);
806
+ assert.match(recalled, /project timeline and deadlines/);
807
+ assert.match(recalled, /API response time optimization/);
808
+ assert.match(recalled, /memory usage and keyword extraction improvements/);
809
+ assert.match(recalled, /job description parsing enhancements/);
810
+ assert.match(recalled, /startup time and caching strategies/);
811
+ assert.match(recalled, /scoring function and similarity optimization/);
812
+ assert.match(recalled, /authentication and authorization/);
813
+ assert.match(recalled, /concurrent request simulation/);
814
+ });
815
+
816
+ test("event order recall labels recommendation-system development trajectories", async () => {
817
+ const sessionId = "event-order-recommendation-system";
818
+ const engine = new FakeEventOrderEngine(sessionId, [
819
+ {
820
+ turn_index: 20,
821
+ role: "user",
822
+ content:
823
+ "I'm implementing user-based collaborative filtering using cosine similarity on the user ratings matrix.",
824
+ },
825
+ {
826
+ turn_index: 82,
827
+ role: "user",
828
+ content:
829
+ "I'm creating the Flask /recommendations endpoint to serve top 5 recommendations per user_id query parameter.",
830
+ },
831
+ {
832
+ turn_index: 84,
833
+ role: "user",
834
+ content:
835
+ "How do I define the get_user_ratings and get_top_rated_items helper functions based on my dataset?",
836
+ },
837
+ {
838
+ turn_index: 176,
839
+ role: "user",
840
+ content:
841
+ "I'm implementing a hybrid recommendation system with Redis caching for similarity matrices and TF-IDF content-based filtering.",
842
+ },
843
+ {
844
+ turn_index: 330,
845
+ role: "user",
846
+ content:
847
+ "I'm integrating user preferences into hybrid recommendation scoring and writing tests for preference filtering.",
848
+ },
849
+ {
850
+ turn_index: 432,
851
+ role: "user",
852
+ content:
853
+ "Here's my hybrid scoring formula using weighted hybrid scoring with 0.6 collaborative and 0.4 content-based scores.",
854
+ },
855
+ {
856
+ turn_index: 434,
857
+ role: "user",
858
+ content:
859
+ "I want to test different weight combinations and measure their impact on recommendation accuracy.",
860
+ },
861
+ {
862
+ turn_index: 678,
863
+ role: "user",
864
+ content:
865
+ "I'm exploring evaluation metrics for performance optimization, including precision, recall, F1-score, and AUC-ROC.",
866
+ },
867
+ ]);
868
+
869
+ const recalled = await buildEventOrderRecallSection({
870
+ engine,
871
+ sessionId,
872
+ query:
873
+ "How did my discussions about recommendation system development progress in order (mention 8 items in order)?",
874
+ maxChars: 8_000,
875
+ maxScanWindowTurns: 4,
876
+ });
877
+
878
+ assert.match(recalled, /user-based collaborative filtering implementation/);
879
+ assert.match(recalled, /Flask recommendations endpoint/);
880
+ assert.match(recalled, /helper function definitions/);
881
+ assert.match(recalled, /hybrid recommendation system with caching/);
882
+ assert.match(recalled, /user preferences integration and testing/);
883
+ assert.match(recalled, /hybrid scoring formula refinement/);
884
+ assert.match(recalled, /testing weight combinations and accuracy impact/);
885
+ assert.match(recalled, /evaluation metrics for performance optimization/);
886
+ });
887
+
888
+ test("event order recall labels system architecture and benchmark recommendation trajectories", async () => {
889
+ const architectureSessionId = "event-order-system-architecture";
890
+ const architectureEngine = new FakeEventOrderEngine(architectureSessionId, [
891
+ {
892
+ turn_index: 10,
893
+ role: "user",
894
+ content:
895
+ "I'm planning a microservices architecture with scraping, NLP, and API boundaries for the news aggregator.",
896
+ },
897
+ {
898
+ turn_index: 22,
899
+ role: "user",
900
+ content:
901
+ "I reviewed the OpenAPI documentation before upgrading the FastAPI service for async handlers and WebSocket support.",
902
+ },
903
+ {
904
+ turn_index: 34,
905
+ role: "user",
906
+ content:
907
+ "The WebSocket integration still needs stability work, and the database query/schema optimization is next.",
908
+ },
909
+ {
910
+ turn_index: 46,
911
+ role: "user",
912
+ content:
913
+ "Now I need Scrapy configuration for robots.txt compliance and user-agent rotation.",
914
+ },
915
+ {
916
+ turn_index: 58,
917
+ role: "user",
918
+ content:
919
+ "I added centralized error logging with Sentry, paywall detection in the scraper, Twilio Verify API integration with rate limiting, and Istio service mesh routing with mutual TLS.",
920
+ },
921
+ ]);
922
+
923
+ const architecture = await buildEventOrderRecallSection({
924
+ engine: architectureEngine,
925
+ sessionId: architectureSessionId,
926
+ query:
927
+ "Can you reconstruct the timeline of when I first mentioned each aspect of my system architecture and related tooling in order? Mention ONLY and ONLY ten items.",
928
+ maxChars: 8_000,
929
+ maxScanWindowTurns: 4,
930
+ });
931
+
932
+ assert.match(architecture, /Microservices architecture planning with scraping, NLP, API/);
933
+ assert.match(architecture, /OpenAPI documentation review/);
934
+ assert.match(architecture, /FastAPI upgrade for async and WebSocket/);
935
+ assert.match(architecture, /WebSocket integration and stability/);
936
+ assert.match(architecture, /Database query and schema optimization/);
937
+ assert.match(architecture, /Scrapy configuration for robots\.txt and user-agent rotation/);
938
+ assert.match(architecture, /Centralized error logging with Sentry/);
939
+ assert.match(architecture, /Paywall detection in scraper/);
940
+ assert.match(architecture, /Twilio Verify API integration with rate limiting/);
941
+ assert.match(architecture, /Istio service mesh setup with mutual TLS and routing/);
942
+
943
+ const recommendationSessionId = "event-order-recommendation-benchmark-labels";
944
+ const recommendationEngine = new FakeEventOrderEngine(recommendationSessionId, [
945
+ {
946
+ turn_index: 10,
947
+ role: "user",
948
+ content:
949
+ "I'm debugging the collaborative filtering implementation and handling missing user interactions.",
950
+ },
951
+ {
952
+ turn_index: 22,
953
+ role: "user",
954
+ content:
955
+ "I need help debugging error messages while incorporating user ratings and matrix factorization.",
956
+ },
957
+ {
958
+ turn_index: 34,
959
+ role: "user",
960
+ content:
961
+ "Next I'm applying diversity filters and improving caching strategies for performance.",
962
+ },
963
+ {
964
+ turn_index: 46,
965
+ role: "user",
966
+ content:
967
+ "I'm doing parallel processing optimization for recommendation generation.",
968
+ },
969
+ {
970
+ turn_index: 58,
971
+ role: "user",
972
+ content:
973
+ "I added user feedback collection with error handling, efficient feedback data querying, and advanced caching plus parallelization integration.",
974
+ },
975
+ ]);
976
+
977
+ const recommendation = await buildEventOrderRecallSection({
978
+ engine: recommendationEngine,
979
+ sessionId: recommendationSessionId,
980
+ query:
981
+ "Can you reconstruct the sequence in which I brought up different aspects of my recommendation engine development and optimization in order? Mention ONLY and ONLY ten items.",
982
+ maxChars: 8_000,
983
+ maxScanWindowTurns: 4,
984
+ });
985
+
986
+ assert.match(recommendation, /Collaborative filtering implementation and debugging/);
987
+ assert.match(recommendation, /Handling missing user interactions/);
988
+ assert.match(recommendation, /Debugging error messages/);
989
+ assert.match(recommendation, /Incorporating user ratings and matrix factorization/);
990
+ assert.match(recommendation, /Applying diversity filters/);
991
+ assert.match(recommendation, /Caching strategies for performance/);
992
+ assert.match(recommendation, /Parallel processing optimization/);
993
+ assert.match(recommendation, /User feedback collection and error handling/);
994
+ assert.match(recommendation, /Efficient feedback data querying/);
995
+ assert.match(recommendation, /Advanced caching and parallelization integration/);
996
+ });
997
+
998
+ test("event order recall labels mathematical induction proof trajectories", async () => {
999
+ const sessionId = "event-order-induction-proofs";
1000
+ const engine = new FakeEventOrderEngine(sessionId, [
1001
+ {
1002
+ turn_index: 8,
1003
+ role: "user",
1004
+ content:
1005
+ "I'm struggling with the inductive step in inequality proofs and need help seeing why the proof works.",
1006
+ },
1007
+ {
1008
+ turn_index: 22,
1009
+ role: "user",
1010
+ content:
1011
+ "Can I get more inequality induction examples and practice problems?",
1012
+ },
1013
+ {
1014
+ turn_index: 48,
1015
+ role: "user",
1016
+ content:
1017
+ "I need to carefully handle the >= signs because changing directions affects the conclusion.",
1018
+ },
1019
+ {
1020
+ turn_index: 74,
1021
+ role: "user",
1022
+ content:
1023
+ "I'm exploring algebraic steps that connect the inductive hypothesis to the conclusion.",
1024
+ },
1025
+ {
1026
+ turn_index: 96,
1027
+ role: "user",
1028
+ content:
1029
+ "I'm starting modular arithmetic and modular reasoning for divisibility proofs.",
1030
+ },
1031
+ {
1032
+ turn_index: 122,
1033
+ role: "user",
1034
+ content:
1035
+ "Can we work through divisibility problems involving powers and modular reasoning?",
1036
+ },
1037
+ {
1038
+ turn_index: 140,
1039
+ role: "user",
1040
+ content:
1041
+ "I'm confused about notation and terminology in divisibility induction proofs.",
1042
+ },
1043
+ {
1044
+ turn_index: 166,
1045
+ role: "user",
1046
+ content:
1047
+ "Let's revisit base case verification and inductive step articulation for inequalities.",
1048
+ },
1049
+ {
1050
+ turn_index: 190,
1051
+ role: "user",
1052
+ content:
1053
+ "I have deeper questions about preserving the direction of the inequality during algebraic manipulations.",
1054
+ },
1055
+ {
1056
+ turn_index: 220,
1057
+ role: "user",
1058
+ content:
1059
+ "I'm reflecting on the logical flow and careful handling of inequalities in induction.",
1060
+ },
1061
+ ]);
1062
+
1063
+ const recalled = await buildEventOrderRecallSection({
1064
+ engine,
1065
+ sessionId,
1066
+ query:
1067
+ "How did my focus on different aspects of mathematical induction proofs develop throughout our conversations in order (mention 10 items)?",
1068
+ maxChars: 8_000,
1069
+ maxScanWindowTurns: 4,
1070
+ });
1071
+
1072
+ assert.match(recalled, /initial struggles with inductive step in inequality proofs/);
1073
+ assert.match(recalled, /requests for additional inequality examples/);
1074
+ assert.match(recalled, /handling inequality signs carefully/);
1075
+ assert.match(recalled, /algebraic steps connecting inductive hypotheses to conclusions/);
1076
+ assert.match(recalled, /modular arithmetic introduction/);
1077
+ assert.match(recalled, /divisibility problems involving powers and modular reasoning/);
1078
+ assert.match(recalled, /notation and terminology clarifications/);
1079
+ assert.match(recalled, /base case verification and inductive step articulation for inequalities/);
1080
+ assert.match(recalled, /preserving inequality directions and algebraic concerns/);
1081
+ assert.match(recalled, /logical flow and careful inequality handling/);
1082
+ });
1083
+
1084
+ test("event order recall labels cryptographic theorem and function trajectories", async () => {
1085
+ const sessionId = "event-order-crypto-concepts";
1086
+ const engine = new FakeEventOrderEngine(sessionId, [
1087
+ {
1088
+ turn_index: 20,
1089
+ role: "user",
1090
+ content:
1091
+ "I'm trying to understand the concept of one-way functions and trapdoor functions in cryptography, but I'm having trouble seeing how they apply to real-world problems.",
1092
+ },
1093
+ {
1094
+ turn_index: 48,
1095
+ role: "user",
1096
+ content:
1097
+ "Can you explain the concept of necessary and sufficient conditions in theorem statements, specifically in the context of Euler's theorem and RSA decryption? I'm having trouble understanding how these conditions apply to cryptographic security arguments.",
1098
+ },
1099
+ {
1100
+ turn_index: 64,
1101
+ role: "user",
1102
+ content:
1103
+ "Can you explain necessary and sufficient conditions in theorem statements like Euler's theorem or the Chinese Remainder Theorem, using RSA or Diffie-Hellman key exchange to illustrate cryptographic applications?",
1104
+ },
1105
+ ]);
1106
+
1107
+ const recalled = await buildEventOrderRecallSection({
1108
+ engine,
1109
+ sessionId,
1110
+ query:
1111
+ "Can you reconstruct the timeline of when I first mentioned each aspect of the mathematical and cryptographic concepts we discussed in order? Mention ONLY and ONLY eight items.",
1112
+ maxChars: 6_000,
1113
+ maxScanWindowTurns: 4,
1114
+ });
1115
+
1116
+ assert.match(recalled, /one-way and trapdoor functions/);
1117
+ assert.match(recalled, /combined cryptographic conditions and applications/);
1118
+ assert.ok(
1119
+ recalled.indexOf("one-way and trapdoor functions") <
1120
+ recalled.indexOf("combined cryptographic conditions and applications"),
1121
+ );
1122
+ });
1123
+
1124
+ test("event order recall labels calculus concept and application trajectories", async () => {
1125
+ const sessionId = "event-order-calculus-concepts";
1126
+ const engine = new FakeEventOrderEngine(sessionId, [
1127
+ {
1128
+ turn_index: 8,
1129
+ role: "user",
1130
+ content:
1131
+ "I'm trying to understand the basic idea and purpose of derivatives before moving deeper.",
1132
+ },
1133
+ {
1134
+ turn_index: 20,
1135
+ role: "user",
1136
+ content:
1137
+ "Can we apply derivatives to real-life paramedic scenarios involving rates like heart rate changes?",
1138
+ },
1139
+ {
1140
+ turn_index: 34,
1141
+ role: "user",
1142
+ content:
1143
+ "I want step-by-step differentiation practice with polynomial functions using the power rule.",
1144
+ },
1145
+ {
1146
+ turn_index: 48,
1147
+ role: "user",
1148
+ content:
1149
+ "Now I want to explore tangent lines and slope interpretation at specific points.",
1150
+ },
1151
+ {
1152
+ turn_index: 62,
1153
+ role: "user",
1154
+ content:
1155
+ "Let's work on related rates problems involving blood flow and respiratory rates.",
1156
+ },
1157
+ {
1158
+ turn_index: 76,
1159
+ role: "user",
1160
+ content:
1161
+ "I need derivative tests for optimization and analyzing flow rates.",
1162
+ },
1163
+ {
1164
+ turn_index: 90,
1165
+ role: "user",
1166
+ content:
1167
+ "I'm analyzing critical points and solving derivative equations in paramedic contexts.",
1168
+ },
1169
+ {
1170
+ turn_index: 104,
1171
+ role: "user",
1172
+ content:
1173
+ "Finally, I want related rates with a geometric sliding ladder problem.",
1174
+ },
1175
+ ]);
1176
+
1177
+ const recalled = await buildEventOrderRecallSection({
1178
+ engine,
1179
+ sessionId,
1180
+ query:
1181
+ "Can you walk me through the order in which I brought up different calculus concepts and their applications throughout our conversations, in order (mention 8 items)?",
1182
+ maxChars: 8_000,
1183
+ maxScanWindowTurns: 4,
1184
+ });
1185
+
1186
+ assert.match(recalled, /basic derivative concept/);
1187
+ assert.match(recalled, /real-life paramedic rate applications/);
1188
+ assert.match(recalled, /power rule differentiation practice/);
1189
+ assert.match(recalled, /tangent line and slope meaning/);
1190
+ assert.match(recalled, /related rates with blood flow/);
1191
+ assert.match(recalled, /derivative tests for optimization/);
1192
+ assert.match(recalled, /critical points and solving derivative equations/);
1193
+ assert.match(recalled, /related rates with geometric problem/);
1194
+ });
1195
+
1196
+ test("event order recall labels laptop topic trajectories", async () => {
1197
+ const sessionId = "event-order-laptop-topics";
1198
+ const engine = new FakeEventOrderEngine(sessionId, [
1199
+ {
1200
+ turn_index: 1,
1201
+ role: "user",
1202
+ content:
1203
+ "I'm looking for a laptop that's perfect for work, travel, and entertainment as a science writer, and I need recommendations.",
1204
+ },
1205
+ {
1206
+ turn_index: 154,
1207
+ role: "user",
1208
+ content:
1209
+ "Michele invited me to The Green Bean on March 16 at 6 PM to test laptop portability and see how lightweight laptops feel in person.",
1210
+ },
1211
+ {
1212
+ turn_index: 253,
1213
+ role: "user",
1214
+ content:
1215
+ "My colleague Judy recommended attending the April 10 digital storytelling workshop at Saint Helena Library for skill growth.",
1216
+ },
1217
+ {
1218
+ turn_index: 386,
1219
+ role: "user",
1220
+ content:
1221
+ "I've been looking at the MacBook Air laptop specs, including its 8-core CPU and 16GB RAM, for daily writing performance.",
1222
+ },
1223
+ {
1224
+ turn_index: 987,
1225
+ role: "user",
1226
+ content:
1227
+ "I designed custom graphics for a presentation using Adobe Illustrator, and now I need a laptop choice that can handle similar tasks efficiently.",
1228
+ },
1229
+ ]);
1230
+
1231
+ const recalled = await buildEventOrderRecallSection({
1232
+ engine,
1233
+ sessionId,
1234
+ query:
1235
+ "Can you list the order in which I brought up different laptop-related topics throughout our conversations in order (mention 5 items)?",
1236
+ maxChars: 8_000,
1237
+ maxScanWindowTurns: 4,
1238
+ });
1239
+
1240
+ assert.match(recalled, /initial laptop needs and recommendations/);
1241
+ assert.match(recalled, /testing portability and meeting at The Green Bean/);
1242
+ assert.match(recalled, /workshops and skill development/);
1243
+ assert.match(recalled, /laptop specs and writing performance/);
1244
+ assert.match(recalled, /final laptop choice and presentation preparation/);
1245
+ assert.ok(
1246
+ recalled.indexOf("initial laptop needs and recommendations") <
1247
+ recalled.indexOf("testing portability and meeting at The Green Bean"),
1248
+ );
1249
+ assert.ok(
1250
+ recalled.indexOf("testing portability and meeting at The Green Bean") <
1251
+ recalled.indexOf("workshops and skill development"),
1252
+ );
1253
+ assert.ok(
1254
+ recalled.indexOf("workshops and skill development") <
1255
+ recalled.indexOf("laptop specs and writing performance"),
1256
+ );
1257
+ assert.ok(
1258
+ recalled.indexOf("laptop specs and writing performance") <
1259
+ recalled.indexOf("final laptop choice and presentation preparation"),
1260
+ );
1261
+ });
1262
+
1263
+ test("event order recall labels screen-time strategy trajectories", async () => {
1264
+ const sessionId = "event-order-screen-time";
1265
+ const engine = new FakeEventOrderEngine(sessionId, [
1266
+ {
1267
+ turn_index: 66,
1268
+ role: "user",
1269
+ content:
1270
+ "I'm worried about Scott's internet use, so I want Norton Family monitoring that limits his screen time to 2 hours daily.",
1271
+ },
1272
+ {
1273
+ turn_index: 82,
1274
+ role: "user",
1275
+ content:
1276
+ "How can I make sure Scott balances his screen time with exercise and outdoor activities?",
1277
+ },
1278
+ {
1279
+ turn_index: 204,
1280
+ role: "user",
1281
+ content:
1282
+ "What digital safety monitoring updates should I use for Scott's online risks and privacy?",
1283
+ },
1284
+ {
1285
+ turn_index: 341,
1286
+ role: "user",
1287
+ content:
1288
+ "We've set up no-device zones and tech-free Sundays for Scott at home.",
1289
+ },
1290
+ {
1291
+ turn_index: 468,
1292
+ role: "user",
1293
+ content:
1294
+ "Cynthia and I agreed on stricter screen time rules, adjusting limits for weekdays and weekends.",
1295
+ },
1296
+ {
1297
+ turn_index: 620,
1298
+ role: "user",
1299
+ content:
1300
+ "I want to introduce an educational app for Scott's math learning.",
1301
+ },
1302
+ {
1303
+ turn_index: 740,
1304
+ role: "user",
1305
+ content:
1306
+ "Should we keep screen time limits stricter during exam prep and studying?",
1307
+ },
1308
+ {
1309
+ turn_index: 930,
1310
+ role: "user",
1311
+ content:
1312
+ "How flexible should we be with Scott's screen time given his social life with friends?",
1313
+ },
1314
+ {
1315
+ turn_index: 1100,
1316
+ role: "user",
1317
+ content:
1318
+ "I need communication and involvement strategies so Scott understands screen time limits.",
1319
+ },
1320
+ ]);
1321
+
1322
+ const recalled = await buildEventOrderRecallSection({
1323
+ engine,
1324
+ sessionId,
1325
+ query:
1326
+ "How did my focus on managing screen time and related strategies develop throughout our conversations in order (mention 9 items)?",
1327
+ maxChars: 9_000,
1328
+ maxScanWindowTurns: 4,
1329
+ });
1330
+
1331
+ assert.match(recalled, /initial limits and monitoring/);
1332
+ assert.match(recalled, /balancing screen time with other activities/);
1333
+ assert.match(recalled, /digital safety and monitoring updates/);
1334
+ assert.match(recalled, /tech-free zones establishment/);
1335
+ assert.match(recalled, /adjusting screen time limits/);
1336
+ assert.match(recalled, /educational app introduction/);
1337
+ assert.match(recalled, /limits during exam prep/);
1338
+ assert.match(recalled, /social life and flexibility considerations/);
1339
+ assert.match(recalled, /communication and involvement strategies/);
1340
+ });
1341
+
1342
+ test("event order recall labels Scott support summary trajectories", async () => {
1343
+ const sessionId = "event-order-scott-support";
1344
+ const engine = new FakeEventOrderEngine(sessionId, [
1345
+ {
1346
+ turn_index: 60,
1347
+ role: "user",
1348
+ content:
1349
+ "Scott has twice weekly tutoring sessions with Ms. Harper, and I want goal-setting with consistent monitoring.",
1350
+ },
1351
+ {
1352
+ turn_index: 90,
1353
+ role: "user",
1354
+ content:
1355
+ "How can I create a distraction-free study environment and foster a growth mindset for Scott?",
1356
+ },
1357
+ {
1358
+ turn_index: 140,
1359
+ role: "user",
1360
+ content:
1361
+ "I want to celebrate incremental progress with achievable milestones and positive reinforcement.",
1362
+ },
1363
+ {
1364
+ turn_index: 210,
1365
+ role: "user",
1366
+ content:
1367
+ "Can role-playing social scenarios help Scott practice self-expression and foster independence?",
1368
+ },
1369
+ {
1370
+ turn_index: 300,
1371
+ role: "user",
1372
+ content:
1373
+ "How do we cultivate responsibility with clear expectations, consistent feedback, and gradual increases in responsibility?",
1374
+ },
1375
+ {
1376
+ turn_index: 360,
1377
+ role: "user",
1378
+ content:
1379
+ "I need digital safety with parental controls, online risks education, privacy management, and open communication.",
1380
+ },
1381
+ {
1382
+ turn_index: 420,
1383
+ role: "user",
1384
+ content:
1385
+ "How do we balance screen time by structuring daily routines, encouraging physical and creative pursuits, and modeling healthy habits?",
1386
+ },
1387
+ {
1388
+ turn_index: 520,
1389
+ role: "user",
1390
+ content:
1391
+ "Scott's emotional well-being needs open communication, consistent schedules, and coping mechanisms.",
1392
+ },
1393
+ ]);
1394
+
1395
+ const recalled = await buildEventOrderRecallSection({
1396
+ engine,
1397
+ sessionId,
1398
+ query:
1399
+ "Can you provide a detailed summary of how all aspects of supporting Scott have been addressed and coordinated over time?",
1400
+ maxChars: 9_000,
1401
+ maxScanWindowTurns: 4,
1402
+ });
1403
+
1404
+ assert.match(recalled, /structured tutoring sessions with goal-setting and consistent monitoring/);
1405
+ assert.match(recalled, /distraction-free study environment and growth mindset/);
1406
+ assert.match(recalled, /celebrating incremental progress with positive reinforcement/);
1407
+ assert.match(recalled, /role-playing social scenarios and self-expression/);
1408
+ assert.match(recalled, /clear expectations and gradual responsibility/);
1409
+ assert.match(recalled, /digital safety with parental controls and privacy/);
1410
+ assert.match(recalled, /screen time routines and healthy habits/);
1411
+ assert.match(recalled, /emotional support with coping mechanisms/);
1412
+ });
1413
+
1414
+ test("event order recall labels relationship progress and emotional regulation trajectories", async () => {
1415
+ const sessionId = "event-order-relationship-progress";
1416
+ const engine = new FakeEventOrderEngine(sessionId, [
1417
+ {
1418
+ turn_index: 23,
1419
+ role: "user",
1420
+ content:
1421
+ "I'm worried about my relationship with Rachael, we've been together for 3 years and I met her at the Donaldsonside Community Center in 2021.",
1422
+ },
1423
+ {
1424
+ turn_index: 37,
1425
+ role: "user",
1426
+ content:
1427
+ "I'm trying to rebuild trust with Rachael, who's 74, and I'm thinking about our age difference.",
1428
+ },
1429
+ {
1430
+ turn_index: 88,
1431
+ role: "user",
1432
+ content:
1433
+ "I'm worried about our couples counseling session with Dr. Marie Leclerc and how it will affect rebuilding trust.",
1434
+ },
1435
+ {
1436
+ turn_index: 158,
1437
+ role: "user",
1438
+ content:
1439
+ "I've been practicing breathing exercises during tense conversations and it's reduced conflict duration by 30%.",
1440
+ },
1441
+ {
1442
+ turn_index: 380,
1443
+ role: "user",
1444
+ content:
1445
+ "We set a goal to increase our mutual trust score from 6 to 8/10 by July 15, measured via weekly surveys.",
1446
+ },
1447
+ {
1448
+ turn_index: 714,
1449
+ role: "user",
1450
+ content:
1451
+ "Rachael and I had a disagreement over social media boundaries and compromised to share only positive updates.",
1452
+ },
1453
+ {
1454
+ turn_index: 735,
1455
+ role: "user",
1456
+ content:
1457
+ "Our daily rehearsals of music recital pieces should strengthen our bond and emotional intimacy.",
1458
+ },
1459
+ {
1460
+ turn_index: 800,
1461
+ role: "user",
1462
+ content:
1463
+ "I've been using breathing exercises during stressful packing sessions to manage emotional regulation while traveling.",
1464
+ },
1465
+ {
1466
+ turn_index: 830,
1467
+ role: "user",
1468
+ content:
1469
+ "How can I reach 95% relationship satisfaction by November 1 with monthly progress reviews and communication?",
1470
+ },
1471
+ {
1472
+ turn_index: 982,
1473
+ role: "user",
1474
+ content:
1475
+ "How do I balance songwriting sessions with intimacy-focused counseling and creative collaboration planning?",
1476
+ },
1477
+ {
1478
+ turn_index: 1200,
1479
+ role: "user",
1480
+ content:
1481
+ "We're finalizing the album by December 15, including songwriting, recording, and mixing milestones.",
1482
+ },
1483
+ {
1484
+ turn_index: 1295,
1485
+ role: "user",
1486
+ content:
1487
+ "Can I use emotional regulation techniques, like the ones I used to manage party-day nerves, in other stressful situations?",
1488
+ },
1489
+ ]);
1490
+
1491
+ const relationship = await buildEventOrderRecallSection({
1492
+ engine,
1493
+ sessionId,
1494
+ query:
1495
+ "Can you walk me through the order in which I brought up different aspects of my relationship progress and goals throughout our conversations in order (mention 10 items)?",
1496
+ maxChars: 10_000,
1497
+ maxScanWindowTurns: 4,
1498
+ });
1499
+
1500
+ assert.match(relationship, /relationship concerns and origins/);
1501
+ assert.match(relationship, /trust issues and age difference/);
1502
+ assert.match(relationship, /trust improvement goals with surveys/);
1503
+ assert.match(relationship, /sustaining satisfaction and social compromises/);
1504
+ assert.match(relationship, /intimacy through music sessions/);
1505
+ assert.match(relationship, /maintaining satisfaction with communication/);
1506
+ assert.match(relationship, /creative collaboration planning/);
1507
+ assert.match(relationship, /finalizing creative projects/);
1508
+
1509
+ const emotional = await buildEventOrderRecallSection({
1510
+ engine,
1511
+ sessionId,
1512
+ query:
1513
+ "Can you walk me through the order in which I brought up different strategies and concerns related to managing my emotional well-being and relationship throughout our conversations, in order (mention 8 items)?",
1514
+ maxChars: 10_000,
1515
+ maxScanWindowTurns: 4,
1516
+ });
1517
+
1518
+ assert.match(emotional, /couples counseling and trust rebuilding/);
1519
+ assert.match(emotional, /breathing exercises for conflict reduction/);
1520
+ assert.match(emotional, /intimacy through music sessions/);
1521
+ assert.match(emotional, /emotional regulation during travel/);
1522
+ assert.match(emotional, /creative collaboration planning/);
1523
+ assert.match(emotional, /finalizing creative projects/);
1524
+ assert.match(emotional, /managing party-day nerves and applying techniques elsewhere/);
1525
+ });
1526
+
1527
+ test("event order recall labels work collaboration advice trajectories", async () => {
1528
+ const sessionId = "event-order-work-collaboration";
1529
+ const engine = new FakeEventOrderEngine(sessionId, [
1530
+ {
1531
+ turn_index: 116,
1532
+ role: "user",
1533
+ content:
1534
+ "I've collaborated with Kelli on a March 28 article that increased readership by 18%, should I ask her to help with my next project?",
1535
+ },
1536
+ {
1537
+ turn_index: 318,
1538
+ role: "user",
1539
+ content:
1540
+ "I met Mary at the September 3 editorial meeting, and she seems knowledgeable, so I'm thinking of asking her for guidance.",
1541
+ },
1542
+ {
1543
+ turn_index: 430,
1544
+ role: "user",
1545
+ content:
1546
+ "I've been thinking about what James said on November 5 about aligning projects with company goals.",
1547
+ },
1548
+ {
1549
+ turn_index: 536,
1550
+ role: "user",
1551
+ content:
1552
+ "What strategies can I use to build on the January 10 strategy meeting where Mary and I co-presented?",
1553
+ },
1554
+ {
1555
+ turn_index: 652,
1556
+ role: "user",
1557
+ content:
1558
+ "I've been working closely with Kelli, and we co-led a workshop on cross-department collaboration on March 5.",
1559
+ },
1560
+ {
1561
+ turn_index: 768,
1562
+ role: "user",
1563
+ content:
1564
+ "James offered strategic advice on April 25 for the sustainability project, and I want to build on this advice.",
1565
+ },
1566
+ {
1567
+ turn_index: 838,
1568
+ role: "user",
1569
+ content:
1570
+ "I co-authored an article with Mary on project impact and it was published on July 12.",
1571
+ },
1572
+ {
1573
+ turn_index: 944,
1574
+ role: "user",
1575
+ content:
1576
+ "How will James's letter of recommendation from October 5 impact my Editorial Manager application?",
1577
+ },
1578
+ ]);
1579
+
1580
+ const recalled = await buildEventOrderRecallSection({
1581
+ engine,
1582
+ sessionId,
1583
+ query:
1584
+ "Can you list the order in which I brought up different collaborations and advice related to my work projects in our conversations, in order (mention 8 items)?",
1585
+ maxChars: 12_000,
1586
+ maxScanWindowTurns: 4,
1587
+ });
1588
+
1589
+ assert.match(recalled, /collaboration with Kelli on article/);
1590
+ assert.match(recalled, /meeting Mary at editorial meeting/);
1591
+ assert.match(recalled, /advice from James on project alignment/);
1592
+ assert.match(recalled, /strategy meeting co-presented with Mary/);
1593
+ assert.match(recalled, /workshop co-led with Kelli/);
1594
+ assert.match(recalled, /strategic advice from James on sustainability project/);
1595
+ assert.match(recalled, /co-authoring article with Mary/);
1596
+ assert.match(recalled, /James's letter of recommendation/);
1597
+ });
1598
+
1599
+ test("event order recall labels investment strategy trajectories", async () => {
1600
+ const sessionId = "event-order-investment-strategy";
1601
+ const engine = new FakeEventOrderEngine(sessionId, [
1602
+ {
1603
+ turn_index: 10,
1604
+ role: "user",
1605
+ content:
1606
+ "I'm starting with a broad-market ETF strategy using VOO, VEU, and AGG with automatic contributions.",
1607
+ },
1608
+ {
1609
+ turn_index: 32,
1610
+ role: "user",
1611
+ content:
1612
+ "Raymond helped me compare financial advisor options and set up a managed portfolio focused on ETFs.",
1613
+ },
1614
+ {
1615
+ turn_index: 306,
1616
+ role: "user",
1617
+ content:
1618
+ "I'm considering robo-advisors so my portfolio can keep automatic contributions on schedule.",
1619
+ },
1620
+ {
1621
+ turn_index: 320,
1622
+ role: "user",
1623
+ content:
1624
+ "I added VXUS and other international ETFs for global diversification.",
1625
+ },
1626
+ {
1627
+ turn_index: 430,
1628
+ role: "user",
1629
+ content:
1630
+ "Raymond suggested REIT ETFs like VNQ for real estate exposure.",
1631
+ },
1632
+ {
1633
+ turn_index: 562,
1634
+ role: "user",
1635
+ content:
1636
+ "I added VWO for emerging markets exposure.",
1637
+ },
1638
+ {
1639
+ turn_index: 673,
1640
+ role: "user",
1641
+ content:
1642
+ "I'm allocating to municipal bond funds like VTEB.",
1643
+ },
1644
+ {
1645
+ turn_index: 804,
1646
+ role: "user",
1647
+ content:
1648
+ "I added the SCZ international small-cap ETF.",
1649
+ },
1650
+ {
1651
+ turn_index: 913,
1652
+ role: "user",
1653
+ content:
1654
+ "I'm exploring sector-specific ETFs like XLV for healthcare.",
1655
+ },
1656
+ ]);
1657
+
1658
+ const recalled = await buildEventOrderRecallSection({
1659
+ engine,
1660
+ sessionId,
1661
+ query:
1662
+ "How did my investment strategy develop throughout our conversations in order (mention 9 items)?",
1663
+ maxChars: 12_000,
1664
+ maxScanWindowTurns: 4,
1665
+ });
1666
+
1667
+ assert.match(recalled, /initial ETF strategy discussion/);
1668
+ assert.match(recalled, /advisor comparison and managed portfolio setup/);
1669
+ assert.match(recalled, /robo-advisor automatic contributions/);
1670
+ assert.match(recalled, /international ETF diversification/);
1671
+ assert.match(recalled, /REIT and real-estate ETF exploration/);
1672
+ assert.match(recalled, /emerging markets ETF addition/);
1673
+ assert.match(recalled, /municipal bond fund allocation/);
1674
+ assert.match(recalled, /international small-cap ETF addition/);
1675
+ assert.match(recalled, /sector ETF focus/);
1676
+ });
1677
+
1678
+ test("event order recall labels Brittney financial-boundary trajectories", async () => {
1679
+ const sessionId = "event-order-brittney-finance";
1680
+ const engine = new FakeEventOrderEngine(sessionId, [
1681
+ {
1682
+ turn_index: 204,
1683
+ role: "user",
1684
+ content:
1685
+ "Brittney asked for stock tips, so I shared only educational resources instead of direct investment advice.",
1686
+ },
1687
+ {
1688
+ turn_index: 340,
1689
+ role: "user",
1690
+ content:
1691
+ "I declined Brittney's $500 loan request and emphasized financial independence.",
1692
+ },
1693
+ {
1694
+ turn_index: 460,
1695
+ role: "user",
1696
+ content:
1697
+ "I agreed to help manage Brittney's $500 custodial account with monthly check-ins.",
1698
+ },
1699
+ {
1700
+ turn_index: 580,
1701
+ role: "user",
1702
+ content:
1703
+ "Brittney and I decided to co-invest $1,000 and hold quarterly review meetings.",
1704
+ },
1705
+ {
1706
+ turn_index: 916,
1707
+ role: "user",
1708
+ content:
1709
+ "Brittney and I raised the co-investment to $2,500 with quarterly reviews covering pros and cons.",
1710
+ },
1711
+ ]);
1712
+
1713
+ const recalled = await buildEventOrderRecallSection({
1714
+ engine,
1715
+ sessionId,
1716
+ query:
1717
+ "How did my financial boundaries and arrangements with Brittney develop throughout our conversations in order (mention 5 items)?",
1718
+ maxChars: 10_000,
1719
+ maxScanWindowTurns: 4,
1720
+ });
1721
+
1722
+ assert.match(recalled, /Brittney financial boundaries and education/);
1723
+ assert.match(recalled, /declining Brittney loan and emphasizing independence/);
1724
+ assert.match(recalled, /Brittney custodial account with monthly check-ins/);
1725
+ assert.match(recalled, /later co-investments with quarterly reviews and pros and cons/);
1726
+ assert.ok(
1727
+ recalled.indexOf("declining Brittney loan and emphasizing independence") <
1728
+ recalled.indexOf("Brittney custodial account with monthly check-ins"),
1729
+ );
1730
+ });
1731
+
1732
+ test("event order recall labels portfolio concern trajectories", async () => {
1733
+ const sessionId = "event-order-portfolio-concerns";
1734
+ const engine = new FakeEventOrderEngine(sessionId, [
1735
+ {
1736
+ turn_index: 172,
1737
+ role: "user",
1738
+ content:
1739
+ "I verified that my ESG funds comply with Saint Helena's 2024 updated financial regulations.",
1740
+ },
1741
+ {
1742
+ turn_index: 178,
1743
+ role: "user",
1744
+ content:
1745
+ "What specific ESG funds do you recommend for lower volatility and good returns, and which option has the lowest expense ratio?",
1746
+ },
1747
+ {
1748
+ turn_index: 360,
1749
+ role: "user",
1750
+ content:
1751
+ "I'm worried about my friend John's portfolio because he shared that it had an 8% loss in August but expects recovery by 2025.",
1752
+ },
1753
+ {
1754
+ turn_index: 488,
1755
+ role: "user",
1756
+ content:
1757
+ "Stephen's recommendation of Wealthfront's tax tools has been helpful since I adopted them on December 1.",
1758
+ },
1759
+ {
1760
+ turn_index: 1250,
1761
+ role: "user",
1762
+ content:
1763
+ "I'm weighing regional market risks and inflation hedging with Stephen, including TIPS and emerging market currency risk.",
1764
+ },
1765
+ ]);
1766
+
1767
+ const recalled = await buildEventOrderRecallSection({
1768
+ engine,
1769
+ sessionId,
1770
+ query:
1771
+ "Can you list the order in which I brought up different concerns and discussions about my investment portfolio throughout our conversations in order (mention 5 items)?",
1772
+ maxChars: 10_000,
1773
+ maxScanWindowTurns: 4,
1774
+ });
1775
+
1776
+ assert.match(recalled, /compliance with financial regulations/);
1777
+ assert.match(recalled, /ESG fund options and decisions/);
1778
+ assert.match(recalled, /friend John's portfolio losses and recovery/);
1779
+ assert.match(recalled, /adoption and use of tax tools/);
1780
+ assert.match(recalled, /regional market risks and inflation hedging/);
1781
+ });
1782
+
1783
+ test("event order recall labels Stephanie shared-meal and social-plan trajectories", async () => {
1784
+ const sessionId = "event-order-stephanie-social-meals";
1785
+ const engine = new FakeEventOrderEngine(sessionId, [
1786
+ {
1787
+ turn_index: 24,
1788
+ role: "user",
1789
+ content:
1790
+ "My partner Stephanie and I have a regular dinner date at The Blue Heron, but I'm not sure what the healthiest options are there.",
1791
+ },
1792
+ {
1793
+ turn_index: 156,
1794
+ role: "user",
1795
+ content:
1796
+ "I agreed to let Stephanie add desserts to our meal plan once weekly, but I'm wondering if that's gonna affect my calorie goals.",
1797
+ },
1798
+ {
1799
+ turn_index: 246,
1800
+ role: "user",
1801
+ content:
1802
+ "I compromised with Stephanie on reducing salt by 25% in our shared recipes, but how can I further reduce sodium?",
1803
+ },
1804
+ {
1805
+ turn_index: 384,
1806
+ role: "user",
1807
+ content:
1808
+ "Stephanie has been requesting more social dinners, and I've agreed to host friends monthly starting May.",
1809
+ },
1810
+ {
1811
+ turn_index: 512,
1812
+ role: "user",
1813
+ content:
1814
+ "Stephanie wants to increase our dining out to 3 times weekly, and I declined because I need better budget boundaries.",
1815
+ },
1816
+ {
1817
+ turn_index: 516,
1818
+ role: "user",
1819
+ content:
1820
+ "I'm feeling a bit overwhelmed with all these changes and Stephanie's requests.",
1821
+ },
1822
+ {
1823
+ turn_index: 708,
1824
+ role: "user",
1825
+ content:
1826
+ "I'm thinking of hosting a dinner party on August 24 for Stephanie with healthy meal options.",
1827
+ },
1828
+ {
1829
+ turn_index: 716,
1830
+ role: "user",
1831
+ content:
1832
+ "I'm trying to prioritize my relationships and health by balancing time with Stephanie and my wellness goals.",
1833
+ },
1834
+ {
1835
+ turn_index: 844,
1836
+ role: "user",
1837
+ content:
1838
+ "I'm thinking of attending the monthly book club with Stephanie starting in October, but I'm not sure I can commit every month.",
1839
+ },
1840
+ {
1841
+ turn_index: 942,
1842
+ role: "user",
1843
+ content:
1844
+ "Stephanie and I agreed on 4 parties per year starting December, and I want to stick to that party hosting limit.",
1845
+ },
1846
+ {
1847
+ turn_index: 1036,
1848
+ role: "user",
1849
+ content:
1850
+ "Stephanie requested no alcohol at our parties, and we agreed to serve only wine and sparkling water.",
1851
+ },
1852
+ ]);
1853
+
1854
+ const recalled = await buildEventOrderRecallSection({
1855
+ engine,
1856
+ sessionId,
1857
+ query:
1858
+ "Can you walk me through the order in which I brought up different aspects of managing my shared meals and social plans with Stephanie throughout our conversations, in order (mention 11 items)?",
1859
+ maxChars: 16_000,
1860
+ maxScanWindowTurns: 4,
1861
+ });
1862
+
1863
+ assert.match(recalled, /healthy dinner options/);
1864
+ assert.match(recalled, /dessert frequency and calories/);
1865
+ assert.match(recalled, /salt reduction in recipes/);
1866
+ assert.match(recalled, /monthly social dinners/);
1867
+ assert.match(recalled, /dining out frequency and budget boundaries/);
1868
+ assert.match(recalled, /emotional overwhelm/);
1869
+ assert.match(recalled, /dinner party planning/);
1870
+ assert.match(recalled, /balancing relationships and wellness/);
1871
+ assert.match(recalled, /book club attendance commitment/);
1872
+ assert.match(recalled, /party hosting limits/);
1873
+ assert.match(recalled, /party drink restrictions/);
1874
+ });
1875
+
1876
+ test("event order recall labels nutrition and activity plan trajectories", async () => {
1877
+ const sessionId = "event-order-nutrition-activity";
1878
+ const engine = new FakeEventOrderEngine(sessionId, [
1879
+ {
1880
+ turn_index: 32,
1881
+ role: "user",
1882
+ content:
1883
+ "My close friends John and Patricia meet with me every other Thursday at 10 AM at Cafe Verona, what healthy breakfast options can I suggest?",
1884
+ },
1885
+ {
1886
+ turn_index: 186,
1887
+ role: "user",
1888
+ content:
1889
+ "I'm worried about what to bring to Patricia's potluck on February 3 and need help deciding on a healthy dish to share.",
1890
+ },
1891
+ {
1892
+ turn_index: 190,
1893
+ role: "user",
1894
+ content:
1895
+ "I've allocated 30 minutes daily for light stretching and walking after lunch, but I'm struggling to stick to the walking routine and stay motivated.",
1896
+ },
1897
+ {
1898
+ turn_index: 422,
1899
+ role: "user",
1900
+ content:
1901
+ "I'm trying to plan a nutrition lecture follow-up with my friend John after attending a lecture at Saint Helena Community Center.",
1902
+ },
1903
+ {
1904
+ turn_index: 974,
1905
+ role: "user",
1906
+ content:
1907
+ "I'm worried about my LDL cholesterol levels, so I was thinking of asking John during my visit at Saint Helena Botanical Gardens if he knows ways to reduce it.",
1908
+ },
1909
+ ]);
1910
+
1911
+ const recalled = await buildEventOrderRecallSection({
1912
+ engine,
1913
+ sessionId,
1914
+ query:
1915
+ "Can you list the order in which I brought up different aspects of my nutrition and activity plans throughout our conversations in order (mention 5 items)?",
1916
+ maxChars: 10_000,
1917
+ maxScanWindowTurns: 4,
1918
+ });
1919
+
1920
+ assert.match(recalled, /regular meetings and breakfast options/);
1921
+ assert.match(recalled, /potluck planning and healthy dishes/);
1922
+ assert.match(recalled, /walking routine and motivation/);
1923
+ assert.match(recalled, /nutrition lecture follow-up and related discussions/);
1924
+ assert.match(recalled, /cholesterol concerns and visit planning/);
1925
+ });
1926
+
1927
+ test("event order recall labels dietary adjustment trajectories", async () => {
1928
+ const sessionId = "event-order-dietary-adjustments";
1929
+ const engine = new FakeEventOrderEngine(sessionId, [
1930
+ {
1931
+ turn_index: 32,
1932
+ role: "user",
1933
+ content:
1934
+ "My close friends John and Patricia meet with me every other Thursday at Cafe Verona, what healthy breakfast options can I suggest?",
1935
+ },
1936
+ {
1937
+ turn_index: 186,
1938
+ role: "user",
1939
+ content:
1940
+ "I'm worried about what to bring to Patricia's potluck and need help deciding on a healthy dish to share.",
1941
+ },
1942
+ {
1943
+ turn_index: 190,
1944
+ role: "user",
1945
+ content:
1946
+ "I've allocated 30 minutes daily for light stretching and walking after lunch, but I'm struggling to stick to the walking routine and stay motivated.",
1947
+ },
1948
+ {
1949
+ turn_index: 346,
1950
+ role: "user",
1951
+ content:
1952
+ "I feel like I need to learn more about micronutrient deficiencies, especially after Jessica sent that infographic on May 6.",
1953
+ },
1954
+ {
1955
+ turn_index: 442,
1956
+ role: "user",
1957
+ content:
1958
+ "I attended a webinar on June 14 about balancing macronutrients in keto and plant-based diets.",
1959
+ },
1960
+ {
1961
+ turn_index: 536,
1962
+ role: "user",
1963
+ content:
1964
+ "Jessica provided an update on micronutrient supplementation for restricted diets on July 20.",
1965
+ },
1966
+ {
1967
+ turn_index: 624,
1968
+ role: "user",
1969
+ content:
1970
+ "I've been meaning to learn more about balancing calcium intake in dairy-free diets after Jessica's August 18 note.",
1971
+ },
1972
+ {
1973
+ turn_index: 716,
1974
+ role: "user",
1975
+ content:
1976
+ "Jessica provided an update on plant-based protein combinations for complete amino acids on September 25.",
1977
+ },
1978
+ {
1979
+ turn_index: 974,
1980
+ role: "user",
1981
+ content:
1982
+ "I'm worried about my LDL cholesterol levels, so I was thinking of asking John about ways to reduce it.",
1983
+ },
1984
+ {
1985
+ turn_index: 1020,
1986
+ role: "user",
1987
+ content:
1988
+ "I'd love to get some guidance on micronutrient needs for growing children on restricted diets from Jessica's January 20 update.",
1989
+ },
1990
+ ]);
1991
+
1992
+ const recalled = await buildEventOrderRecallSection({
1993
+ engine,
1994
+ sessionId,
1995
+ query:
1996
+ "How did my focus on various aspects of dietary adjustments develop throughout our conversations in order (10 items)?",
1997
+ maxChars: 14_000,
1998
+ maxScanWindowTurns: 4,
1999
+ });
2000
+
2001
+ assert.match(recalled, /Requested item count: 10/);
2002
+ const deficiencies = recalled.indexOf("micronutrient deficiencies");
2003
+ const macronutrients = recalled.indexOf("macronutrient balancing");
2004
+ const supplementation = recalled.indexOf("micronutrient supplementation updates");
2005
+ const calcium = recalled.indexOf("calcium intake balancing");
2006
+ const proteins = recalled.indexOf("plant-based protein combinations");
2007
+ const children = recalled.indexOf("micronutrient needs for growing children");
2008
+
2009
+ assert.ok(deficiencies >= 0);
2010
+ assert.ok(macronutrients > deficiencies);
2011
+ assert.ok(supplementation > macronutrients);
2012
+ assert.ok(calcium > supplementation);
2013
+ assert.ok(proteins > calcium);
2014
+ assert.ok(children > proteins);
2015
+ });
2016
+
2017
+ test("event order recall labels flavor-enhancement cooking trajectories", async () => {
2018
+ const sessionId = "event-order-flavor-enhancements";
2019
+ const engine = new FakeEventOrderEngine(sessionId, [
2020
+ {
2021
+ turn_index: 24,
2022
+ role: "user",
2023
+ content:
2024
+ "I'm trying healthy cooking methods for roasted vegetables and want flavor without making dinner complicated.",
2025
+ },
2026
+ {
2027
+ turn_index: 154,
2028
+ role: "user",
2029
+ content:
2030
+ "I added turmeric and ginger to roasted carrots and want other spice combinations for roasted vegetables.",
2031
+ },
2032
+ {
2033
+ turn_index: 246,
2034
+ role: "user",
2035
+ content:
2036
+ "I added smoked paprika and chipotle powder to roasted sweet potatoes on April 4, what other spices can I experiment with to enhance flavor depth?",
2037
+ },
2038
+ {
2039
+ turn_index: 334,
2040
+ role: "user",
2041
+ content:
2042
+ "I added za'atar spice blend to roasted vegetables and want other Middle Eastern flavors I can experiment with.",
2043
+ },
2044
+ {
2045
+ turn_index: 819,
2046
+ role: "user",
2047
+ content:
2048
+ "I've been experimenting with za'atar again and want further Middle Eastern spice exploration for vegetables.",
2049
+ },
2050
+ {
2051
+ turn_index: 882,
2052
+ role: "user",
2053
+ content:
2054
+ "I added turmeric and ginger to roasted carrots on July 13 and it enhanced the flavor and color, what other spices can I experiment with?",
2055
+ },
2056
+ {
2057
+ turn_index: 884,
2058
+ role: "user",
2059
+ content:
2060
+ "I'm looking for ways to enhance the flavor of my roasted carrots, can you suggest some other spice combinations I can try, like the turmeric and ginger I used on July 13?",
2061
+ },
2062
+ ]);
2063
+
2064
+ const recalled = await buildEventOrderRecallSection({
2065
+ engine,
2066
+ sessionId,
2067
+ query:
2068
+ "How did my discussions about experimenting with different flavor enhancements progress throughout our conversations in order (mention 8 items)?",
2069
+ maxChars: 12_000,
2070
+ maxScanWindowTurns: 4,
2071
+ });
2072
+
2073
+ assert.match(recalled, /healthy cooking methods/);
2074
+ assert.match(recalled, /initial spice combinations for roasted vegetables/);
2075
+ assert.match(recalled, /additional spices to enhance flavor depth/);
2076
+ assert.match(recalled, /Middle Eastern flavor experimentation/);
2077
+ assert.match(recalled, /further Middle Eastern spice exploration/);
2078
+ assert.match(recalled, /enhancing flavor and color with spices/);
2079
+ assert.match(recalled, /revisiting smoky and spicy seasonings/);
2080
+ assert.match(recalled, /seeking new seasoning ideas for roasted vegetables/);
2081
+ assert.ok(
2082
+ recalled.indexOf("additional spices to enhance flavor depth") <
2083
+ recalled.indexOf("Middle Eastern flavor experimentation"),
2084
+ );
2085
+ assert.ok(
2086
+ recalled.indexOf("enhancing flavor and color with spices") <
2087
+ recalled.indexOf("revisiting smoky and spicy seasonings"),
2088
+ );
2089
+ });
2090
+
2091
+ test("event order recall labels health-management trajectories", async () => {
2092
+ const sessionId = "event-order-health-management";
2093
+ const engine = new FakeEventOrderEngine(sessionId, [
2094
+ {
2095
+ turn_index: 16,
2096
+ role: "user",
2097
+ content:
2098
+ "I was diagnosed with type 2 diabetes six months ago by Dr. Linda Chen; how often should I follow up with her?",
2099
+ },
2100
+ {
2101
+ turn_index: 108,
2102
+ role: "user",
2103
+ content:
2104
+ "Dr. Chen recommended insulin options, including starting low-dose basal insulin, and I chose to delay it while deciding.",
2105
+ },
2106
+ {
2107
+ turn_index: 216,
2108
+ role: "user",
2109
+ content:
2110
+ "I'm managing arthritis pain and joint mobility with ibuprofen, but I need better symptom management.",
2111
+ },
2112
+ {
2113
+ turn_index: 244,
2114
+ role: "user",
2115
+ content:
2116
+ "My physical therapist Mark Lewis at Saint Helena Rehab Center says my joint progress is improving after physical therapy.",
2117
+ },
2118
+ {
2119
+ turn_index: 312,
2120
+ role: "user",
2121
+ content:
2122
+ "I'm worried about my insulin dosage and whether 10 units of Lantus nightly is the right dose to review.",
2123
+ },
2124
+ {
2125
+ turn_index: 530,
2126
+ role: "user",
2127
+ content:
2128
+ "I scheduled an eye exam at VisionCare Optometry to check retinopathy and eye health.",
2129
+ },
2130
+ {
2131
+ turn_index: 650,
2132
+ role: "user",
2133
+ content:
2134
+ "I have a cardiology follow-up appointment to review my blood pressure and heart health.",
2135
+ },
2136
+ {
2137
+ turn_index: 1000,
2138
+ role: "user",
2139
+ content:
2140
+ "My latest lab results and CGM data changed the treatment plan Sarah Kim gave me for my health goals.",
2141
+ },
2142
+ ]);
2143
+
2144
+ const recalled = await buildEventOrderRecallSection({
2145
+ engine,
2146
+ sessionId,
2147
+ query:
2148
+ "Can you list the order in which I brought up different aspects of managing my health throughout our conversations in order (mention 8 items)?",
2149
+ maxChars: 12_000,
2150
+ maxScanWindowTurns: 4,
2151
+ });
2152
+
2153
+ assert.match(recalled, /initial diagnosis and follow-up/);
2154
+ assert.match(recalled, /insulin options and decisions/);
2155
+ assert.match(recalled, /arthritis pain management/);
2156
+ assert.match(recalled, /physical therapy progress/);
2157
+ assert.match(recalled, /insulin dosage concerns/);
2158
+ assert.match(recalled, /eye health exams/);
2159
+ assert.match(recalled, /cardiology visits/);
2160
+ assert.match(recalled, /lab results and treatment plan/);
2161
+ assert.ok(
2162
+ recalled.indexOf("initial diagnosis and follow-up") <
2163
+ recalled.indexOf("insulin options and decisions"),
2164
+ );
2165
+ assert.ok(
2166
+ recalled.indexOf("eye health exams") <
2167
+ recalled.indexOf("cardiology visits"),
2168
+ );
2169
+ assert.doesNotMatch(recalled, /interaction with health/);
2170
+ assert.doesNotMatch(recalled, /interaction with managing/);
2171
+ });
2172
+
2173
+ test("event order recall labels David support trajectories", async () => {
2174
+ const sessionId = "event-order-david-support";
2175
+ const engine = new FakeEventOrderEngine(sessionId, [
2176
+ {
2177
+ turn_index: 22,
2178
+ role: "user",
2179
+ content:
2180
+ "I met David at a wine tasting event on January 5, 2023, and he's been supportive, but I'm not sure how to explain my diabetes to him.",
2181
+ },
2182
+ {
2183
+ turn_index: 118,
2184
+ role: "user",
2185
+ content:
2186
+ "David helped me with Mediterranean meals on April 5 and 7, reducing my sodium intake by 20%, and I want to thank him for that support.",
2187
+ },
2188
+ {
2189
+ turn_index: 238,
2190
+ role: "user",
2191
+ content:
2192
+ "My partner David surprised me with a homemade Mediterranean dinner on May 7, which really boosted my morale.",
2193
+ },
2194
+ {
2195
+ turn_index: 328,
2196
+ role: "user",
2197
+ content:
2198
+ "David attended the June 3 diabetes education refresher at Saint Helena Clinic with me.",
2199
+ },
2200
+ {
2201
+ turn_index: 748,
2202
+ role: "user",
2203
+ content:
2204
+ "David and I are planning a visit to the Napa Valley Opera House for a concert on October 12 as part of getting back to social events.",
2205
+ },
2206
+ {
2207
+ turn_index: 852,
2208
+ role: "user",
2209
+ content:
2210
+ "My partner David and I are planning a visit to the Napa Art Walk on November 15, and we're going to do a 3-mile walking tour.",
2211
+ },
2212
+ ]);
2213
+
2214
+ const recalled = await buildEventOrderRecallSection({
2215
+ engine,
2216
+ sessionId,
2217
+ query:
2218
+ "Can you list the order in which I mentioned different ways David has supported me throughout our conversations in order (mention 5 items)?",
2219
+ maxChars: 12_000,
2220
+ maxScanWindowTurns: 4,
2221
+ });
2222
+
2223
+ assert.match(recalled, /meeting and discussing diabetes explanation with david/);
2224
+ assert.match(recalled, /assistance with mediterranean meals from david/);
2225
+ assert.match(recalled, /surprise homemade dinner from david/);
2226
+ assert.match(recalled, /attending diabetes education refresher with david/);
2227
+ assert.match(recalled, /planning active and social outings with david/);
2228
+ assert.ok(
2229
+ recalled.indexOf("attending diabetes education refresher with david") <
2230
+ recalled.indexOf("planning active and social outings with david"),
2231
+ );
2232
+ });
2233
+
2234
+ test("event order recall labels performing-arts development trajectories", async () => {
2235
+ const sessionId = "event-order-performing-arts";
2236
+ const engine = new FakeEventOrderEngine(sessionId, [
2237
+ {
2238
+ turn_index: 30,
2239
+ role: "user",
2240
+ content:
2241
+ "I'm thinking of trying acting to boost my confidence, like my friend Michael suggested when we met at that writing workshop.",
2242
+ },
2243
+ {
2244
+ turn_index: 38,
2245
+ role: "user",
2246
+ content:
2247
+ "I'm nervous about this 10-week acting course starting April 1, 2024, and I want tips for the first day of class.",
2248
+ },
2249
+ {
2250
+ turn_index: 132,
2251
+ role: "user",
2252
+ content:
2253
+ "Michael recommended a voice coach named Sarah Lee, who offers 30-minute voice coaching sessions.",
2254
+ },
2255
+ {
2256
+ turn_index: 180,
2257
+ role: "user",
2258
+ content:
2259
+ "I accepted a minor role in the community play and need to work on character development by reading the script before voice coaching with Sarah Lee.",
2260
+ },
2261
+ {
2262
+ turn_index: 224,
2263
+ role: "user",
2264
+ content:
2265
+ "What was it like attending the dance workshop at New Gary Dance Studio with Michael, and did we get useful feedback?",
2266
+ },
2267
+ {
2268
+ turn_index: 244,
2269
+ role: "user",
2270
+ content:
2271
+ "I'm nervous about my dance recital audition on May 9 and need preparation advice after choosing contemporary over ballet.",
2272
+ },
2273
+ {
2274
+ turn_index: 380,
2275
+ role: "user",
2276
+ content:
2277
+ "I'm worried about what career path to choose and need advice on local theater involvement like Michael and I discussed.",
2278
+ },
2279
+ {
2280
+ turn_index: 386,
2281
+ role: "user",
2282
+ content:
2283
+ "How can I make sure I stay in touch with Michael after our discussion and talk more about theater opportunities?",
2284
+ },
2285
+ {
2286
+ turn_index: 502,
2287
+ role: "user",
2288
+ content:
2289
+ "I'm trying to balance part-time theater roles and writing commitments without overloading myself.",
2290
+ },
2291
+ {
2292
+ turn_index: 576,
2293
+ role: "user",
2294
+ content:
2295
+ "I'm considering joining a weekly improv group starting September 3 to enhance spontaneity like Michael suggested.",
2296
+ },
2297
+ {
2298
+ turn_index: 600,
2299
+ role: "user",
2300
+ content:
2301
+ "I accepted a supporting role in the community play and need to balance rehearsals with portfolio work.",
2302
+ },
2303
+ {
2304
+ turn_index: 694,
2305
+ role: "user",
2306
+ content:
2307
+ "I declined the lead role to focus on my current play and existing commitments.",
2308
+ },
2309
+ {
2310
+ turn_index: 772,
2311
+ role: "user",
2312
+ content:
2313
+ "How did the improv showcase with Michael go, and what feedback should I use for future group activities?",
2314
+ },
2315
+ {
2316
+ turn_index: 790,
2317
+ role: "user",
2318
+ content:
2319
+ "I'm preparing for regional theater auditions and continuing coaching to improve my chances.",
2320
+ },
2321
+ {
2322
+ turn_index: 900,
2323
+ role: "user",
2324
+ content:
2325
+ "I accepted a winter season supporting role and need to plan rehearsals around the rest of my schedule.",
2326
+ },
2327
+ {
2328
+ turn_index: 1018,
2329
+ role: "user",
2330
+ content:
2331
+ "I'm considering conservatory applications and whether professional acting conservatory prep should be my focus.",
2332
+ },
2333
+ ]);
2334
+
2335
+ const creative = await buildEventOrderRecallSection({
2336
+ engine,
2337
+ sessionId,
2338
+ query:
2339
+ "Can you list the order in which I brought up different aspects of my creative development journey in order (mention 5 items)?",
2340
+ maxChars: 14_000,
2341
+ maxScanWindowTurns: 4,
2342
+ });
2343
+
2344
+ assert.match(creative, /acting and michael's suggestion/);
2345
+ assert.match(creative, /voice coaching sessions/);
2346
+ assert.match(creative, /dance workshop and feedback/);
2347
+ assert.match(creative, /local theater involvement and staying in touch/);
2348
+ assert.match(creative, /improv group activities and feedback/);
2349
+ assert.doesNotMatch(creative, /regional market risks and inflation hedging/);
2350
+
2351
+ const performingArts = await buildEventOrderRecallSection({
2352
+ engine,
2353
+ sessionId,
2354
+ query:
2355
+ "Can you walk me through the order in which I brought up different aspects of my performing arts journey throughout our conversations, in order (mention 9 items)?",
2356
+ maxChars: 16_000,
2357
+ maxScanWindowTurns: 4,
2358
+ });
2359
+
2360
+ assert.match(performingArts, /acting course and first day tips/);
2361
+ assert.match(performingArts, /minor role and character\/voice coaching/);
2362
+ assert.match(performingArts, /dance recital audition and prep/);
2363
+ assert.match(performingArts, /part-time theater roles and writing balance/);
2364
+ assert.match(performingArts, /supporting role acceptance and rehearsal\/portfolio balance/);
2365
+ assert.match(performingArts, /declining lead role to focus on current play/);
2366
+ assert.match(performingArts, /regional theater auditions and coaching/);
2367
+ assert.match(performingArts, /winter season supporting role and rehearsals/);
2368
+ assert.match(performingArts, /conservatory application considerations/);
2369
+ });
2370
+
2371
+ test("event order recall labels relationship custody and holiday-visit trajectories", async () => {
2372
+ const sessionId = "event-order-sarah-custody";
2373
+ const engine = new FakeEventOrderEngine(sessionId, [
2374
+ {
2375
+ turn_index: 1,
2376
+ role: "user",
2377
+ content:
2378
+ "I'm struggling to cope with the emotional pain after my breakup with Sarah, and I need help processing my feelings.",
2379
+ },
2380
+ {
2381
+ turn_index: 28,
2382
+ role: "user",
2383
+ content:
2384
+ "The breakup made me reflect on the relationship and learn from how my attachment style affected our dynamics.",
2385
+ },
2386
+ {
2387
+ turn_index: 202,
2388
+ role: "user",
2389
+ content:
2390
+ "I insisted on supervised visits with Holly on April 10, but Sarah and I eventually agreed on April 15 at school.",
2391
+ },
2392
+ {
2393
+ turn_index: 320,
2394
+ role: "user",
2395
+ content:
2396
+ "I'm trying to understand custody and visitation arrangements with Sarah as supervised visits start on May 15.",
2397
+ },
2398
+ {
2399
+ turn_index: 456,
2400
+ role: "user",
2401
+ content:
2402
+ "Sarah missed two supervised visits in June, so I reported it to the mediator and the mediator issued a warning letter.",
2403
+ },
2404
+ {
2405
+ turn_index: 490,
2406
+ role: "user",
2407
+ content:
2408
+ "I've been maintaining no direct contact with Sarah since May 15 and using a mediator for communication.",
2409
+ },
2410
+ {
2411
+ turn_index: 764,
2412
+ role: "user",
2413
+ content:
2414
+ "Sarah agreed to supervised holiday visits scheduled for December 24-26 at the community center.",
2415
+ },
2416
+ {
2417
+ turn_index: 796,
2418
+ role: "user",
2419
+ content:
2420
+ "I'm worried about child safety and emotional safety during the supervised holiday visits with Sarah.",
2421
+ },
2422
+ {
2423
+ turn_index: 990,
2424
+ role: "user",
2425
+ content:
2426
+ "My focus in this unrelated situation is organizing a woodworking schedule around teaching prep.",
2427
+ },
2428
+ {
2429
+ turn_index: 1016,
2430
+ role: "user",
2431
+ content:
2432
+ "I'm worried about my mood after the supervised visits with Sarah on December 24-26 and how to keep my emotional healing progress going.",
2433
+ },
2434
+ ]);
2435
+
2436
+ const recalled = await buildEventOrderRecallSection({
2437
+ engine,
2438
+ sessionId,
2439
+ query:
2440
+ "How did my focus on different aspects of my personal situation with Sarah shift and develop throughout our conversations in order (mention 8 items)?",
2441
+ maxChars: 12_000,
2442
+ maxScanWindowTurns: 4,
2443
+ });
2444
+
2445
+ assert.match(recalled, /coping with emotional pain after the breakup/);
2446
+ assert.match(recalled, /reflecting on the relationship and learning from it/);
2447
+ assert.match(recalled, /managing communication boundaries with Sarah/);
2448
+ assert.match(recalled, /addressing custody and visitation arrangements/);
2449
+ assert.match(recalled, /handling mediation and legal involvement/);
2450
+ assert.match(recalled, /navigating holiday scheduling and supervised visits/);
2451
+ assert.match(recalled, /dealing with emotional safety and boundary setting during interactions/);
2452
+ assert.match(recalled, /processing emotional healing and mood after visits/);
2453
+ assert.doesNotMatch(recalled, /interaction with focus/);
2454
+ assert.doesNotMatch(recalled, /interaction with situation/);
2455
+ });
2456
+
2457
+ test("event order recall labels healing journey support and activity trajectories", async () => {
2458
+ const sessionId = "event-healing-journey";
2459
+ const engine = new FakeEventOrderEngine(sessionId, [
2460
+ {
2461
+ turn_index: 38,
2462
+ role: "user",
2463
+ content:
2464
+ "I'm opening up about my grief and loss with my parents, and I want to remember my uncle with a photo album.",
2465
+ },
2466
+ {
2467
+ turn_index: 140,
2468
+ role: "user",
2469
+ content:
2470
+ "I'm considering whether to attend the healing workshop Andrew recommended and deciding if it fits my schedule.",
2471
+ },
2472
+ {
2473
+ turn_index: 356,
2474
+ role: "user",
2475
+ content:
2476
+ "Andrew DJed at the remembrance event with my uncle's favorite jazz tunes, and I appreciated the music support.",
2477
+ },
2478
+ {
2479
+ turn_index: 546,
2480
+ role: "user",
2481
+ content:
2482
+ "I'm connecting through Andrew's DJ page and reflecting on the support he has shown during my grief.",
2483
+ },
2484
+ {
2485
+ turn_index: 620,
2486
+ role: "user",
2487
+ content:
2488
+ "Andrew invited me to a concert and I accepted the invitation as another step toward social connection.",
2489
+ },
2490
+ {
2491
+ turn_index: 702,
2492
+ role: "user",
2493
+ content:
2494
+ "I'm exploring and preparing for the healing book club Cynthia mentioned.",
2495
+ },
2496
+ {
2497
+ turn_index: 760,
2498
+ role: "user",
2499
+ content:
2500
+ "I'm preparing for my job interview with a friend's help from Andrew.",
2501
+ },
2502
+ {
2503
+ turn_index: 840,
2504
+ role: "user",
2505
+ content:
2506
+ "I've been reflecting on friendship and support nurturing with Andrew after everything he has helped with.",
2507
+ },
2508
+ {
2509
+ turn_index: 916,
2510
+ role: "user",
2511
+ content:
2512
+ "I want to express gratitude for Andrew's transportation help after he drove me to the appointment.",
2513
+ },
2514
+ {
2515
+ turn_index: 990,
2516
+ role: "user",
2517
+ content:
2518
+ "I've been thinking about my art exhibit with Andrew in March 2025 and how to showcase my beach sketches.",
2519
+ },
2520
+ ]);
2521
+
2522
+ const recalled = await buildEventOrderRecallSection({
2523
+ engine,
2524
+ sessionId,
2525
+ query:
2526
+ "How did my conversations about the support and activities related to my healing journey progress in order (mention 10 items)?",
2527
+ maxChars: 12_000,
2528
+ maxScanWindowTurns: 4,
2529
+ });
2530
+
2531
+ assert.match(recalled, /sharing struggle and honoring loss/);
2532
+ assert.match(recalled, /considering and deciding on workshop attendance/);
2533
+ assert.match(recalled, /planning remembrance event and music support/);
2534
+ assert.match(recalled, /connecting through DJ page and reflecting on support/);
2535
+ assert.match(recalled, /accepting concert invitation/);
2536
+ assert.match(recalled, /exploring and preparing for healing book club/);
2537
+ assert.match(recalled, /preparing for job interview with friend's help/);
2538
+ assert.match(recalled, /reflecting on friendship and support nurturing/);
2539
+ assert.match(recalled, /expressing gratitude for transportation help/);
2540
+ assert.match(recalled, /contemplating art exhibit collaboration/);
2541
+ });
2542
+
2543
+ test("event order recall supports summary-over-time prompts", async () => {
2544
+ const sessionId = "event-summary-core";
2545
+ const engine = new FakeEventOrderEngine(sessionId, [
2546
+ {
2547
+ turn_index: 2,
2548
+ role: "user",
2549
+ content:
2550
+ "I began the project with initial planning and resource gathering.",
2551
+ },
2552
+ {
2553
+ turn_index: 8,
2554
+ role: "user",
2555
+ content:
2556
+ "Later I entered the main development phase where key tasks were completed.",
2557
+ },
2558
+ {
2559
+ turn_index: 14,
2560
+ role: "user",
2561
+ content:
2562
+ "Then I moved into testing and review before the project handoff.",
2563
+ },
2564
+ ]);
2565
+
2566
+ const recalled = await buildEventOrderRecallSection({
2567
+ engine,
2568
+ sessionId,
2569
+ query: "Can you give me a summary of what happened with the project over time?",
2570
+ maxChars: 5_000,
2571
+ maxScanWindowTurns: 3,
2572
+ });
2573
+
2574
+ assert.match(recalled, /Chronological evidence is sorted by turn number/);
2575
+ assert.match(recalled, /initial planning and resource gathering/);
2576
+ assert.match(recalled, /main development phase where key tasks were completed/);
2577
+ assert.match(recalled, /testing and review/);
2578
+ });
2579
+
2580
+ test("event order recall preserves language-service integration and streaming chronology", async () => {
2581
+ const sessionId = "event-language-services";
2582
+ const engine = new FakeEventOrderEngine(sessionId, [
2583
+ {
2584
+ turn_index: 118,
2585
+ role: "user",
2586
+ content:
2587
+ "I'm trying to compare Google Translate API v3 and DeepL API v2 for my multi-language chatbot and need integration help plus error handling guidance.",
2588
+ },
2589
+ {
2590
+ turn_index: 124,
2591
+ role: "user",
2592
+ content:
2593
+ "How do I set up the translation API endpoint usage and authentication with a service account?",
2594
+ },
2595
+ {
2596
+ turn_index: 188,
2597
+ role: "user",
2598
+ content:
2599
+ "I'm running into rate limiting and request queue management problems with translation requests.",
2600
+ },
2601
+ {
2602
+ turn_index: 252,
2603
+ role: "user",
2604
+ content:
2605
+ "I reduced database query load with Redis caching and want more performance optimization for queries.",
2606
+ },
2607
+ {
2608
+ turn_index: 420,
2609
+ role: "user",
2610
+ content:
2611
+ "I'm fine-tuning and debugging language models for the multilingual assistant.",
2612
+ },
2613
+ {
2614
+ turn_index: 610,
2615
+ role: "user",
2616
+ content:
2617
+ "How should I handle authentication and role-based access control for the language services?",
2618
+ },
2619
+ {
2620
+ turn_index: 760,
2621
+ role: "user",
2622
+ content:
2623
+ "I need microservices deployment and scaling guidance for the language detection and translation services.",
2624
+ },
2625
+ {
2626
+ turn_index: 920,
2627
+ role: "user",
2628
+ content:
2629
+ "How should I enforce security and TLS configuration for the translation API?",
2630
+ },
2631
+ {
2632
+ turn_index: 1514,
2633
+ role: "user",
2634
+ content:
2635
+ "I'm trying to optimize my Transformer-Based LLM API by enabling GPT-4 streaming in Python.",
2636
+ },
2637
+ {
2638
+ turn_index: 1560,
2639
+ role: "user",
2640
+ content:
2641
+ "I need streaming performance tuning and chunk size adjustments, including whether 512 tokens is right.",
2642
+ },
2643
+ ]);
2644
+
2645
+ const recalled = await buildEventOrderRecallSection({
2646
+ engine,
2647
+ sessionId,
2648
+ query:
2649
+ "How did my discussions about integrating and optimizing language and translation services progress in order? Mention ONLY and ONLY ten items.",
2650
+ maxChars: 12_000,
2651
+ maxScanWindowTurns: 64,
2652
+ });
2653
+
2654
+ assert.match(recalled, /translation API integration and error handling/);
2655
+ assert.match(recalled, /API endpoint usage and authentication/);
2656
+ assert.match(recalled, /rate limiting and request queue management/);
2657
+ assert.match(recalled, /performance optimization with caching and queries/);
2658
+ assert.match(recalled, /fine-tuning and debugging language models/);
2659
+ assert.match(recalled, /authentication and role-based access control/);
2660
+ assert.match(recalled, /microservices deployment and scaling/);
2661
+ assert.match(recalled, /security and TLS configuration/);
2662
+ assert.match(recalled, /Transformer-Based LLM API streaming integration/);
2663
+ assert.match(recalled, /streaming performance tuning and chunk size/);
2664
+ assert.ok(
2665
+ recalled.indexOf("translation API integration and error handling") <
2666
+ recalled.indexOf("streaming performance tuning and chunk size"),
2667
+ );
2668
+ });
2669
+
2670
+ test("event order recall preserves late project-summary summit, forum, and ethics evidence", async () => {
2671
+ const sessionId = "event-project-summary-late-evidence";
2672
+ const engine = new FakeEventOrderEngine(sessionId, [
2673
+ {
2674
+ turn_index: 12,
2675
+ role: "user",
2676
+ content:
2677
+ "I began the project with initial planning and resource gathering before the development phase.",
2678
+ },
2679
+ {
2680
+ turn_index: 224,
2681
+ role: "user",
2682
+ content:
2683
+ "Can you help me understand the key takeaways from the Indian Ocean Startup Summit I attended from August 18-20, 2025, and how I can apply them to our business?",
2684
+ },
2685
+ {
2686
+ turn_index: 225,
2687
+ role: "assistant",
2688
+ content:
2689
+ "The Indian Ocean Startup Summit takeaways include market expansion in the region, emerging technologies like AI and machine learning, local partnerships to expand reach, and green initiatives plus sustainability practices in operations.",
2690
+ },
2691
+ {
2692
+ turn_index: 260,
2693
+ role: "user",
2694
+ content:
2695
+ "What's the best way to utilize the 250 active members in the Seychelles user forum to drive business growth and engagement, considering I've never hired a regional sales manager or expanded into the Seychelles market?",
2696
+ },
2697
+ {
2698
+ turn_index: 310,
2699
+ role: "user",
2700
+ content:
2701
+ "Always include ethical considerations when I ask about product development, especially AI ethics and responsible product decisions.",
2702
+ },
2703
+ ]);
2704
+
2705
+ const recalled = await buildEventOrderRecallSection({
2706
+ engine,
2707
+ sessionId,
2708
+ query:
2709
+ "Can you provide a detailed and comprehensive summary of the entire process, including all key developments, decisions, and adjustments that took place throughout this project?",
2710
+ maxChars: 7_000,
2711
+ maxScanWindowTurns: 4,
2712
+ });
2713
+
2714
+ assert.match(recalled, /initial planning and resource gathering/);
2715
+ assert.match(recalled, /Indian Ocean Startup Summit takeaways to expand market reach, adopt emerging technologies, partnerships, and sustainability practices/);
2716
+ assert.match(recalled, /regional business forums and Seychelles community growth to expand market reach and engagement/);
2717
+ assert.match(recalled, /ethical AI and product development practices embedded into operations/);
2718
+ assert.doesNotMatch(recalled, /interaction with detailed/);
2719
+ assert.doesNotMatch(recalled, /interaction with process/);
2720
+ });
2721
+
2722
+ test("event order recall labels housing timeline summaries from lease concerns through move-out", async () => {
2723
+ const sessionId = "event-housing-summary";
2724
+ const engine = new FakeEventOrderEngine(sessionId, [
2725
+ {
2726
+ turn_index: 36,
2727
+ role: "user",
2728
+ content:
2729
+ "I'm worried about my lease ending on June 30, 2024, and want options like lease renewal, subletting, or moving to a new apartment.",
2730
+ },
2731
+ {
2732
+ turn_index: 38,
2733
+ role: "user",
2734
+ content:
2735
+ "I'll talk to my landlord about renewing, and if that does not work I'll look for a new 4-bedroom place within $2,500 monthly rent near Lincoln Park with good internet.",
2736
+ },
2737
+ {
2738
+ turn_index: 288,
2739
+ role: "user",
2740
+ content:
2741
+ "I'll finalize utility setups, coordinate with the movers, pack essentials, prepare for safety and mold inspections, and set up the home office in the new apartment.",
2742
+ },
2743
+ {
2744
+ turn_index: 1084,
2745
+ role: "user",
2746
+ content:
2747
+ "I have never participated in final apartment walk-throughs or inspections and want to understand how that might affect lease termination and my security deposit refund.",
2748
+ },
2749
+ {
2750
+ turn_index: 1096,
2751
+ role: "user",
2752
+ content:
2753
+ "What's the deal with the lease termination and security deposit refund process? I got my $2,100 back and want to make sure I did everything right.",
2754
+ },
2755
+ ]);
2756
+
2757
+ const recalled = await buildEventOrderRecallSection({
2758
+ engine,
2759
+ sessionId,
2760
+ query:
2761
+ "Can you give me a thorough summary of everything involved in managing my housing situation from lease concerns through moving and settling in, covering all the key steps, challenges, and decisions I faced along the way?",
2762
+ maxChars: 10_000,
2763
+ maxScanWindowTurns: 4,
2764
+ });
2765
+
2766
+ assert.match(recalled, /lease ending on june 30 2024/);
2767
+ assert.match(recalled, /lease renewal subletting or moving to a new apartment options/);
2768
+ assert.match(recalled, /landlord about lease renewal/);
2769
+ assert.match(recalled, /4-bedroom rental within a \$2,500 budget near Lincoln Park/);
2770
+ assert.match(recalled, /move-in coordination for the new apartment confirming movers utility setups/);
2771
+ assert.match(recalled, /move-out process from current apartment with timely landlord notification final walk-through inspection disagreements and security deposit refund/);
2772
+ });
2773
+
2774
+ test("event order recall prioritizes home and career chronology labels", async () => {
2775
+ const sessionId = "event-home-career";
2776
+ const engine = new FakeEventOrderEngine(sessionId, [
2777
+ {
2778
+ turn_index: 7,
2779
+ role: "user",
2780
+ content:
2781
+ "I'm thinking about dining out frequency and budget boundaries, but this is unrelated to my home and career timeline.",
2782
+ },
2783
+ {
2784
+ turn_index: 40,
2785
+ role: "user",
2786
+ content:
2787
+ "I've been advised by James, my colleague and mentor, on career moves, but I'm not sure if he can help with renting.",
2788
+ },
2789
+ {
2790
+ turn_index: 200,
2791
+ role: "user",
2792
+ content:
2793
+ "My friend James suggested I contact local handyman Joseph for repairs, and Joseph quoted $75/hour but is only available starting July 2.",
2794
+ },
2795
+ {
2796
+ turn_index: 522,
2797
+ role: "user",
2798
+ content:
2799
+ "I've coordinated with Joseph, a handyman, to fix the door lock and install shelves on July 3, and I want to think through other moving-related considerations.",
2800
+ },
2801
+ {
2802
+ turn_index: 1172,
2803
+ role: "user",
2804
+ content:
2805
+ "What's the best way to pay utility bills like electricity, water, and internet on time and keep an eye on energy usage?",
2806
+ },
2807
+ {
2808
+ turn_index: 1176,
2809
+ role: "user",
2810
+ content:
2811
+ "James invited us to a writers' dinner on March 5, and I want to use it for professional networking opportunities.",
2812
+ },
2813
+ ]);
2814
+
2815
+ const recalled = await buildEventOrderRecallSection({
2816
+ engine,
2817
+ sessionId,
2818
+ query:
2819
+ "Can you list the order in which I brought up different topics related to my home and career throughout our conversations in order (mention 5 items)?",
2820
+ maxChars: 10_000,
2821
+ maxScanWindowTurns: 3,
2822
+ });
2823
+
2824
+ const career = recalled.indexOf("advice from James as colleague and mentor regarding career moves");
2825
+ const handyman = recalled.indexOf("contacting and scheduling local handyman Joseph for repairs");
2826
+ const repairs = recalled.indexOf("coordinating repair tasks with Joseph including door lock shelves and moving-related considerations");
2827
+ const utilities = recalled.indexOf("utility bills and energy usage concerns");
2828
+ const networking = recalled.indexOf("writing conference and professional networking opportunities");
2829
+
2830
+ assert.ok(career >= 0);
2831
+ assert.ok(handyman > career);
2832
+ assert.ok(repairs > handyman);
2833
+ assert.ok(utilities > repairs);
2834
+ assert.ok(networking > utilities);
2835
+ });
2836
+
2837
+ test("event order recall labels baking experience trajectories including late croissant samples", async () => {
2838
+ const sessionId = "event-baking-experiences";
2839
+ const engine = new FakeEventOrderEngine(sessionId, [
2840
+ {
2841
+ turn_index: 28,
2842
+ role: "user",
2843
+ content:
2844
+ "I'm kinda excited to meet Michele, she's 43 and owns Sweet Crust Bakery, what can I learn from her about baking?",
2845
+ },
2846
+ {
2847
+ turn_index: 30,
2848
+ role: "user",
2849
+ content:
2850
+ "I'll ask Michele about scaling recipes and maintaining consistency, plus her inventory management and marketing strategies.",
2851
+ },
2852
+ {
2853
+ turn_index: 154,
2854
+ role: "user",
2855
+ content:
2856
+ "I shared my vegan cake with Michele at Sweet Crust Bakery and she gave me positive feedback, how can I improve my social baking skills?",
2857
+ },
2858
+ {
2859
+ turn_index: 194,
2860
+ role: "user",
2861
+ content:
2862
+ "I've been using Michele's proofing box and it's really improved my dough rise by 25%, but I'm not sure if I should invest in one for myself.",
2863
+ },
2864
+ {
2865
+ turn_index: 288,
2866
+ role: "user",
2867
+ content:
2868
+ "I'm trying to decide how to balance my baking schedule with other commitments, like the writing seminar I skipped, and Michele suggested using her bakery's proofing box.",
2869
+ },
2870
+ {
2871
+ turn_index: 460,
2872
+ role: "user",
2873
+ content:
2874
+ "I hosted a cake decorating session with Marisa and Courtney on May 3, and it was a blast, but how can I make our next session even better?",
2875
+ },
2876
+ {
2877
+ turn_index: 606,
2878
+ role: "user",
2879
+ content:
2880
+ "What's the best way to get a 4.4/5 rating like I did with Michele and Ryan when I shared those gluten-free bread samples?",
2881
+ },
2882
+ {
2883
+ turn_index: 838,
2884
+ role: "user",
2885
+ content:
2886
+ "I shared my croissant samples with Michele and Audrey on August 15, and they gave me a 4.6/5 rating, what could I do to improve that score?",
2887
+ },
2888
+ {
2889
+ turn_index: 928,
2890
+ role: "user",
2891
+ content:
2892
+ "I recently shared some dessert plating photos with the Saint Helena Baking Club on September 22, can you give me tips to improve my plating skills?",
2893
+ },
2894
+ {
2895
+ turn_index: 1016,
2896
+ role: "user",
2897
+ content:
2898
+ "I'm planning a party for Ryan's promotion and I want to make sure my breads and desserts are perfect, can you help me host a successful baking party?",
2899
+ },
2900
+ ]);
2901
+
2902
+ const recalled = await buildEventOrderRecallSection({
2903
+ engine,
2904
+ sessionId,
2905
+ query:
2906
+ "Can you list the order in which I brought up different aspects of my baking experiences and related activities throughout our conversations in order (mention 10 items)?",
2907
+ maxChars: 10_000,
2908
+ maxScanWindowTurns: 3,
2909
+ });
2910
+
2911
+ const michele = recalled.indexOf("meeting and learning from Michele about baking");
2912
+ const scaling = recalled.indexOf("discussing recipe scaling, inventory, and marketing strategies with Michele");
2913
+ const veganCake = recalled.indexOf("sharing vegan cake and seeking social baking improvement");
2914
+ const proofingBox = recalled.indexOf("using Michele's proofing box and debating investing in one");
2915
+ const balance = recalled.indexOf("balancing baking schedule with other commitments and Michele's proofing box advice");
2916
+ const decorating = recalled.indexOf("hosting a cake decorating session and seeking improvement ideas");
2917
+ const breadSamples = recalled.indexOf("asking about achieving high ratings from sharing gluten-free bread samples");
2918
+ const croissants = recalled.indexOf("Sharing croissant samples and aiming to improve ratings");
2919
+ const plating = recalled.indexOf("sharing dessert plating photos and seeking plating tips");
2920
+ const promotion = recalled.indexOf("planning a party for Ryan's promotion and requesting hosting tips");
2921
+
2922
+ assert.ok(michele >= 0);
2923
+ assert.ok(scaling > michele);
2924
+ assert.ok(veganCake > scaling);
2925
+ assert.ok(proofingBox > veganCake);
2926
+ assert.ok(balance > proofingBox);
2927
+ assert.ok(decorating > balance);
2928
+ assert.ok(breadSamples > decorating);
2929
+ assert.ok(croissants > breadSamples);
2930
+ assert.ok(plating > croissants);
2931
+ assert.ok(promotion > plating);
2932
+ });
2933
+
2934
+ test("event order recall labels microservices communication and stock trading trajectories", async () => {
2935
+ const microservicesSessionId = "event-order-microservices-communication";
2936
+ const microservicesEngine = new FakeEventOrderEngine(microservicesSessionId, [
2937
+ {
2938
+ turn_index: 10,
2939
+ role: "user",
2940
+ content:
2941
+ "I'm starting with REST API error handling between microservices.",
2942
+ },
2943
+ {
2944
+ turn_index: 22,
2945
+ role: "user",
2946
+ content:
2947
+ "Next I need data serialization choices and an HTTP/2 implementation for service-to-service calls.",
2948
+ },
2949
+ {
2950
+ turn_index: 34,
2951
+ role: "user",
2952
+ content:
2953
+ "RabbitMQ messaging is now part of the communication plan.",
2954
+ },
2955
+ {
2956
+ turn_index: 46,
2957
+ role: "user",
2958
+ content:
2959
+ "I'm optimizing gRPC communication and then migrating gRPC with TLS.",
2960
+ },
2961
+ {
2962
+ turn_index: 58,
2963
+ role: "user",
2964
+ content:
2965
+ "For later phases I added WebSocket multiplexing, AWS SNS pub/sub messaging, service mesh with Istio, and Kafka API performance work.",
2966
+ },
2967
+ ]);
2968
+
2969
+ const microservices = await buildEventOrderRecallSection({
2970
+ engine: microservicesEngine,
2971
+ sessionId: microservicesSessionId,
2972
+ query:
2973
+ "How did my discussions about microservices communication evolve throughout our conversations in order? Mention ONLY and ONLY ten items.",
2974
+ maxChars: 8_000,
2975
+ maxScanWindowTurns: 4,
2976
+ });
2977
+
2978
+ assert.match(microservices, /REST API and error handling/);
2979
+ assert.match(microservices, /Data serialization/);
2980
+ assert.match(microservices, /HTTP\/2 implementation/);
2981
+ assert.match(microservices, /RabbitMQ messaging/);
2982
+ assert.match(microservices, /gRPC communication and optimization/);
2983
+ assert.match(microservices, /gRPC with TLS migration/);
2984
+ assert.match(microservices, /WebSocket multiplexing/);
2985
+ assert.match(microservices, /AWS SNS pub\/sub messaging/);
2986
+ assert.match(microservices, /Service mesh with Istio/);
2987
+ assert.match(microservices, /Kafka and API performance/);
2988
+
2989
+ const tradingSessionId = "event-order-stock-trading";
2990
+ const tradingEngine = new FakeEventOrderEngine(tradingSessionId, [
2991
+ {
2992
+ turn_index: 12,
2993
+ role: "user",
2994
+ content:
2995
+ "For my stock trading system, API rate limiting and efficiency are the first concerns.",
2996
+ },
2997
+ {
2998
+ turn_index: 24,
2999
+ role: "user",
3000
+ content:
3001
+ "The trading platform needs microservices architecture and integration, plus data availability and uptime monitoring.",
3002
+ },
3003
+ {
3004
+ turn_index: 36,
3005
+ role: "user",
3006
+ content:
3007
+ "I'm adding REST API endpoints for backtesting and trade data.",
3008
+ },
3009
+ {
3010
+ turn_index: 48,
3011
+ role: "user",
3012
+ content:
3013
+ "Alpaca API optimization and debugging led into OAuth 2.0 token refresh and auth issues.",
3014
+ },
3015
+ {
3016
+ turn_index: 60,
3017
+ role: "user",
3018
+ content:
3019
+ "Later I added an ML prediction endpoint with input handling, alert notifications integration, error handling in the trading bot, and secure API access with SSL and load balancers.",
3020
+ },
3021
+ ]);
3022
+
3023
+ const trading = await buildEventOrderRecallSection({
3024
+ engine: tradingEngine,
3025
+ sessionId: tradingSessionId,
3026
+ query:
3027
+ "Can you reconstruct the timeline of when I first mentioned each aspect of my stock trading system development in order? Mention ONLY and ONLY ten items.",
3028
+ maxChars: 8_000,
3029
+ maxScanWindowTurns: 4,
3030
+ });
3031
+
3032
+ assert.match(trading, /API rate limiting and efficiency/);
3033
+ assert.match(trading, /Microservices architecture and integration/);
3034
+ assert.match(trading, /Data availability and uptime/);
3035
+ assert.match(trading, /REST API endpoints for backtesting and trade data/);
3036
+ assert.match(trading, /Alpaca API optimization and debugging/);
3037
+ assert.match(trading, /OAuth 2\.0 token refresh and auth issues/);
3038
+ assert.match(trading, /ML prediction endpoint and input handling/);
3039
+ assert.match(trading, /Alert notifications integration/);
3040
+ assert.match(trading, /Error handling in trading bot/);
3041
+ assert.match(trading, /Secure API access with SSL and load balancers/);
3042
+ });
3043
+
3044
+ test("event order recall labels image-captioning model and database trajectories", async () => {
3045
+ const modelSessionId = "event-order-image-captioning-model";
3046
+ const modelEngine = new FakeEventOrderEngine(modelSessionId, [
3047
+ {
3048
+ turn_index: 10,
3049
+ role: "user",
3050
+ content:
3051
+ "I started with diffusion-based image feature enhancement for the image captioning model.",
3052
+ },
3053
+ {
3054
+ turn_index: 22,
3055
+ role: "user",
3056
+ content:
3057
+ "Then I integrated caption generation with a transformer-based caption generator.",
3058
+ },
3059
+ {
3060
+ turn_index: 34,
3061
+ role: "user",
3062
+ content:
3063
+ "I hit CUDA out of memory errors while training the captioning model on the GPU.",
3064
+ },
3065
+ {
3066
+ turn_index: 46,
3067
+ role: "user",
3068
+ content:
3069
+ "Deployment moved toward FastAPI microservices with REST APIs for the feature extractor and caption generator.",
3070
+ },
3071
+ {
3072
+ turn_index: 58,
3073
+ role: "user",
3074
+ content:
3075
+ "Next I optimized the transformer model architecture and evaluated smaller models.",
3076
+ },
3077
+ {
3078
+ turn_index: 70,
3079
+ role: "user",
3080
+ content:
3081
+ "I improved tokenizer performance to reduce latency.",
3082
+ },
3083
+ {
3084
+ turn_index: 82,
3085
+ role: "user",
3086
+ content:
3087
+ "I upgraded PyTorch and torchvision library versions.",
3088
+ },
3089
+ {
3090
+ turn_index: 94,
3091
+ role: "user",
3092
+ content:
3093
+ "I added distributed training with acceleration libraries.",
3094
+ },
3095
+ {
3096
+ turn_index: 106,
3097
+ role: "user",
3098
+ content:
3099
+ "I handled API authentication and security for secure endpoints.",
3100
+ },
3101
+ {
3102
+ turn_index: 118,
3103
+ role: "user",
3104
+ content:
3105
+ "Finally I debugged PyTorch and Transformers version locking.",
3106
+ },
3107
+ ]);
3108
+
3109
+ const model = await buildEventOrderRecallSection({
3110
+ engine: modelEngine,
3111
+ sessionId: modelSessionId,
3112
+ query:
3113
+ "How did my discussions about model development and deployment progress in order? Mention ONLY and ONLY ten items.",
3114
+ maxChars: 10_000,
3115
+ maxScanWindowTurns: 4,
3116
+ });
3117
+
3118
+ assert.match(model, /Diffusion-based image feature enhancement/);
3119
+ assert.match(model, /Caption generation integration/);
3120
+ assert.match(model, /Debugging memory errors/);
3121
+ assert.match(model, /Model deployment via REST API/);
3122
+ assert.match(model, /Transformer model optimization/);
3123
+ assert.match(model, /Tokenizer performance improvements/);
3124
+ assert.match(model, /Library upgrades for PyTorch and torchvision/);
3125
+ assert.match(model, /Distributed training with acceleration/);
3126
+ assert.match(model, /API authentication and security/);
3127
+ assert.match(model, /Debugging and version locking with PyTorch and Transformers/);
3128
+
3129
+ const databaseSessionId = "event-order-image-captioning-database";
3130
+ const databaseEngine = new FakeEventOrderEngine(databaseSessionId, [
3131
+ {
3132
+ turn_index: 10,
3133
+ role: "user",
3134
+ content:
3135
+ "I began with initial data retrieval and preparation for image datasets and captions using a dataloader.",
3136
+ },
3137
+ {
3138
+ turn_index: 22,
3139
+ role: "user",
3140
+ content:
3141
+ "I troubleshot schema and data insertion errors for image captions, including JSONB invalid input and foreign key issues.",
3142
+ },
3143
+ {
3144
+ turn_index: 34,
3145
+ role: "user",
3146
+ content:
3147
+ "I enhanced the schema with confidence_score and optimized database queries with indexes for highest confidence captions.",
3148
+ },
3149
+ {
3150
+ turn_index: 46,
3151
+ role: "user",
3152
+ content:
3153
+ "I created materialized views with indexing and refresh strategies for joined tables and query performance.",
3154
+ },
3155
+ {
3156
+ turn_index: 58,
3157
+ role: "user",
3158
+ content:
3159
+ "I created the user_captions table and fixed insertion errors like relation does not exist and user IDs.",
3160
+ },
3161
+ {
3162
+ turn_index: 70,
3163
+ role: "user",
3164
+ content:
3165
+ "I scheduled a nightly ETL to Redshift at 2 AM and dealt with Redis cache consistency and stale captions.",
3166
+ },
3167
+ {
3168
+ turn_index: 82,
3169
+ role: "user",
3170
+ content:
3171
+ "I extended edit_history as JSONB to track caption changes and updates.",
3172
+ },
3173
+ {
3174
+ turn_index: 94,
3175
+ role: "user",
3176
+ content:
3177
+ "I handled Lambda timeout issues by chaining functions with Step Functions.",
3178
+ },
3179
+ {
3180
+ turn_index: 106,
3181
+ role: "user",
3182
+ content:
3183
+ "I planned DynamoDB migration and deployment using SAM templates for serverless rollout.",
3184
+ },
3185
+ ]);
3186
+
3187
+ const database = await buildEventOrderRecallSection({
3188
+ engine: databaseEngine,
3189
+ sessionId: databaseSessionId,
3190
+ query:
3191
+ "How did my discussions about database and data handling progress in order while optimizing the image-captioning system? Mention ONLY and ONLY nine items.",
3192
+ maxChars: 10_000,
3193
+ maxScanWindowTurns: 4,
3194
+ });
3195
+
3196
+ assert.match(database, /Initial data retrieval and preparation/);
3197
+ assert.match(database, /Schema and data insertion troubleshooting/);
3198
+ assert.match(database, /Schema enhancement and query optimization/);
3199
+ assert.match(database, /Materialized views and indexing/);
3200
+ assert.match(database, /User captions table creation and insertion errors/);
3201
+ assert.match(database, /ETL scheduling and cache consistency issues/);
3202
+ assert.match(database, /Edit history extension and updates/);
3203
+ assert.match(database, /Lambda timeout and function chaining/);
3204
+ assert.match(database, /DynamoDB migration and deployment/);
3205
+ });
3206
+
3207
+ test("event order recall labels game development component trajectories", async () => {
3208
+ const sessionId = "event-order-game-development-components";
3209
+ const engine = new FakeEventOrderEngine(sessionId, [
3210
+ {
3211
+ turn_index: 6,
3212
+ role: "user",
3213
+ content:
3214
+ "I'm having trouble understanding how to implement the matchmaking service for my game and which algorithms handle similar skills and preferences.",
3215
+ },
3216
+ {
3217
+ turn_index: 196,
3218
+ role: "user",
3219
+ content:
3220
+ "I'm trying to optimize the performance of my game loop, and serialization overhead in player state updates is a major bottleneck.",
3221
+ },
3222
+ {
3223
+ turn_index: 352,
3224
+ role: "user",
3225
+ content:
3226
+ "I'm trying to implement a microservices strategy for my matchmaking service using RabbitMQ 3.8.9 and Node.js.",
3227
+ },
3228
+ {
3229
+ turn_index: 560,
3230
+ role: "user",
3231
+ content:
3232
+ "I'm working on implementing the LagCompensation module with interpolation and extrapolation algorithms for player movement data.",
3233
+ },
3234
+ {
3235
+ turn_index: 754,
3236
+ role: "user",
3237
+ content:
3238
+ "Can you review my dedicated anti-cheat microservice with a REST API, and then help optimize its Redis caching strategy?",
3239
+ },
3240
+ {
3241
+ turn_index: 952,
3242
+ role: "user",
3243
+ content:
3244
+ "I'm designing a platform abstraction layer to unify input handling across desktop and mobile clients and integrate it with UI components.",
3245
+ },
3246
+ ]);
3247
+
3248
+ const recalled = await buildEventOrderRecallSection({
3249
+ engine,
3250
+ sessionId,
3251
+ query:
3252
+ "How did my discussions about the different components of my game development projects unfold in order? Mention ONLY and ONLY six items.",
3253
+ maxChars: 10_000,
3254
+ maxScanWindowTurns: 4,
3255
+ });
3256
+
3257
+ assert.match(recalled, /Matchmaking service design and algorithm challenges/);
3258
+ assert.match(recalled, /Game loop performance and serialization optimization/);
3259
+ assert.match(recalled, /Microservices implementation and RabbitMQ integration/);
3260
+ assert.match(recalled, /Lag compensation with interpolation and extrapolation/);
3261
+ assert.match(recalled, /Anti-cheat microservice development and caching optimization/);
3262
+ assert.match(recalled, /Platform abstraction layer for input handling and integration/);
3263
+ assert.ok(
3264
+ recalled.indexOf("Microservices implementation and RabbitMQ integration") <
3265
+ recalled.indexOf("Lag compensation with interpolation and extrapolation"),
3266
+ );
3267
+ });
3268
+
3269
+ test("event order recall labels real-time communication implementation trajectories", async () => {
3270
+ const sessionId = "event-order-realtime-communication";
3271
+ const engine = new FakeEventOrderEngine(sessionId, [
3272
+ {
3273
+ turn_index: 48,
3274
+ role: "user",
3275
+ content:
3276
+ "I'm trying to implement basic WebSocket connections with Socket.IO, but I'm getting connection issues.",
3277
+ },
3278
+ {
3279
+ turn_index: 182,
3280
+ role: "user",
3281
+ content:
3282
+ "Socket.IO namespaces for lobby and game rooms are failing because the namespace does not exist, and I need to debug the game logic.",
3283
+ },
3284
+ {
3285
+ turn_index: 556,
3286
+ role: "user",
3287
+ content:
3288
+ "I'm trying to integrate WebRTC data channels alongside WebSocket for low-latency peer-to-peer communication fallback.",
3289
+ },
3290
+ {
3291
+ turn_index: 756,
3292
+ role: "user",
3293
+ content:
3294
+ "I need encrypted WebSocket subprotocols for sensitive data transmission between clients.",
3295
+ },
3296
+ {
3297
+ turn_index: 944,
3298
+ role: "user",
3299
+ content:
3300
+ "I'm debugging WebRTC peer-to-peer connection issues and TURN server configurations.",
3301
+ },
3302
+ {
3303
+ turn_index: 372,
3304
+ role: "user",
3305
+ content:
3306
+ "Refresh token rotation with Redis usage is now part of my real-time service authentication plan.",
3307
+ },
3308
+ {
3309
+ turn_index: 366,
3310
+ role: "user",
3311
+ content:
3312
+ "I want WebSocket performance optimization and better room management for real-time rooms.",
3313
+ },
3314
+ {
3315
+ turn_index: 1120,
3316
+ role: "user",
3317
+ content:
3318
+ "I added Redis Pub/Sub for real-time updates and need retry handling.",
3319
+ },
3320
+ {
3321
+ turn_index: 1200,
3322
+ role: "user",
3323
+ content:
3324
+ "I'm trying to implement a feature to reduce perceived lag in our multiplayer game using client-side prediction and server reconciliation.",
3325
+ },
3326
+ {
3327
+ turn_index: 1292,
3328
+ role: "user",
3329
+ content:
3330
+ "I'm building a voice chat application and need signaling plus caching strategies for tokens.",
3331
+ },
3332
+ ]);
3333
+
3334
+ const recalled = await buildEventOrderRecallSection({
3335
+ engine,
3336
+ sessionId,
3337
+ query:
3338
+ "How did my discussions about real-time communication technologies and their related implementation challenges progress in order? Mention ONLY and ONLY ten items.",
3339
+ maxChars: 12_000,
3340
+ maxScanWindowTurns: 4,
3341
+ });
3342
+
3343
+ assert.match(recalled, /Basic WebSocket implementation and connection issues/);
3344
+ assert.match(recalled, /Namespace and game logic debugging/);
3345
+ assert.match(recalled, /WebRTC integration and fallback handling/);
3346
+ assert.match(recalled, /Encrypted WebSocket subprotocol setup/);
3347
+ assert.match(recalled, /WebRTC connection troubleshooting and TURN server setup/);
3348
+ assert.match(recalled, /Token rotation and Redis usage/);
3349
+ assert.match(recalled, /WebSocket performance optimization and room management/);
3350
+ assert.match(recalled, /Redis Pub\/Sub for real-time updates/);
3351
+ assert.match(recalled, /Multiplayer game latency reduction techniques/);
3352
+ assert.match(recalled, /Voice chat application signaling and caching/);
3353
+ assert.ok(
3354
+ recalled.indexOf("Redis Pub/Sub for real-time updates") <
3355
+ recalled.indexOf("Multiplayer game latency reduction techniques"),
3356
+ );
3357
+ });
3358
+
3359
+ test("event order recall labels initial crypto curiosity", async () => {
3360
+ const sessionId = "event-order-crypto-curiosity";
3361
+ const engine = new FakeEventOrderEngine(sessionId, [
3362
+ {
3363
+ turn_index: 0,
3364
+ role: "user",
3365
+ content:
3366
+ "I'm kinda new to investing and want to understand how to get started with cryptocurrency.",
3367
+ },
3368
+ {
3369
+ turn_index: 4,
3370
+ role: "user",
3371
+ content:
3372
+ "I'm looking for advice on how to navigate the world of cryptocurrency before making bigger commitments.",
3373
+ },
3374
+ {
3375
+ turn_index: 20,
3376
+ role: "user",
3377
+ content:
3378
+ "I started small investments and began monitoring Bitcoin and Ethereum with tracking tools.",
3379
+ },
3380
+ {
3381
+ turn_index: 32,
3382
+ role: "user",
3383
+ content:
3384
+ "I attended the Istanbul Crypto Expo for conference participation and later co-hosted a webinar about cryptocurrency strategy with Jason.",
3385
+ },
3386
+ ]);
3387
+
3388
+ const recalled = await buildEventOrderRecallSection({
3389
+ engine,
3390
+ sessionId,
3391
+ query:
3392
+ "How did my mentions about my involvement with a particular investment interest and related collaborations develop in order? Mention ONLY and ONLY eight items.",
3393
+ maxChars: 6_000,
3394
+ maxScanWindowTurns: 4,
3395
+ });
3396
+
3397
+ assert.match(recalled, /Chronology outline:/);
3398
+ assert.match(recalled, /Initial curiosity and advice seeking/);
3399
+ assert.match(recalled, /Starting small investments and monitoring/);
3400
+ assert.match(recalled, /Conference participation and webinar co-hosting/);
3401
+ assert.ok(
3402
+ recalled.indexOf("Initial curiosity and advice seeking") <
3403
+ recalled.indexOf("Starting small investments and monitoring"),
3404
+ );
3405
+ assert.ok(
3406
+ recalled.indexOf("Starting small investments and monitoring") <
3407
+ recalled.indexOf("Conference participation and webinar co-hosting"),
3408
+ );
3409
+ });
3410
+
3411
+ test("event order recall labels fitness support milestones", async () => {
3412
+ const sessionId = "event-order-fitness-support";
3413
+ const engine = new FakeEventOrderEngine(sessionId, [
3414
+ {
3415
+ turn_index: 48,
3416
+ role: "user",
3417
+ content:
3418
+ "My mom, Nancy, is really supportive, what are some ways she can help me stay motivated with my fitness goals?",
3419
+ },
3420
+ {
3421
+ turn_index: 218,
3422
+ role: "user",
3423
+ content:
3424
+ "My workout partner Jenny suggested trying something new like trail running at Green Valley Park.",
3425
+ },
3426
+ {
3427
+ turn_index: 518,
3428
+ role: "user",
3429
+ content:
3430
+ "How can I best support Jenny in her half marathon training without feeling pressured to increase my own running distance too much?",
3431
+ },
3432
+ {
3433
+ turn_index: 642,
3434
+ role: "user",
3435
+ content:
3436
+ "My friend Don invited me to join his weekend hiking group starting June 22, should I accept the invitation and how can I prepare for the hikes?",
3437
+ },
3438
+ {
3439
+ turn_index: 910,
3440
+ role: "user",
3441
+ content:
3442
+ "What's the best way to convince my family members like Nancy and Craig to join me for more fitness activities after they enjoyed the Pilates class trial?",
3443
+ },
3444
+ {
3445
+ turn_index: 1116,
3446
+ role: "user",
3447
+ content:
3448
+ "What's the best way to prep protein-rich dishes like Craig did for me during my injury week?",
3449
+ },
3450
+ {
3451
+ turn_index: 1196,
3452
+ role: "user",
3453
+ content:
3454
+ "How can I best prepare for Christopher's 40 km cycling race on October 5?",
3455
+ },
3456
+ {
3457
+ turn_index: 1424,
3458
+ role: "user",
3459
+ content:
3460
+ "I've been attending Pilates classes with Kristen, and I'm wondering if having a workout partner like her can really improve my technique and motivation?",
3461
+ },
3462
+ {
3463
+ turn_index: 1438,
3464
+ role: "user",
3465
+ content:
3466
+ "I'm trying to balance my Pilates schedule with my clinical workload, and I was wondering if it's a good idea to reschedule my evening shifts to attend classes.",
3467
+ },
3468
+ {
3469
+ turn_index: 1578,
3470
+ role: "user",
3471
+ content:
3472
+ "How can I best prepare for the New Year's 5K fun run that Jenny invited me to on January 1, 2025?",
3473
+ },
3474
+ ]);
3475
+
3476
+ const recalled = await buildEventOrderRecallSection({
3477
+ engine,
3478
+ sessionId,
3479
+ query:
3480
+ "Can you walk me through the order in which I brought up different people and their roles in supporting my fitness journey throughout our conversations, in order? Mention ONLY and ONLY ten items.",
3481
+ maxChars: 10_000,
3482
+ maxScanWindowTurns: 4,
3483
+ });
3484
+
3485
+ assert.match(recalled, /Mom's support/);
3486
+ assert.match(recalled, /Jenny's motivation and new activities/);
3487
+ assert.match(recalled, /Supporting Jenny's half marathon training/);
3488
+ assert.match(recalled, /Don's hiking invitation/);
3489
+ assert.match(recalled, /Nancy and Craig joining Pilates and runs/);
3490
+ assert.match(recalled, /Craig's meal prep assistance/);
3491
+ assert.match(recalled, /Christopher's cycling race/);
3492
+ assert.match(recalled, /Pilates partner Kristen and group motivation/);
3493
+ assert.match(recalled, /Balancing Pilates with clinical workload/);
3494
+ assert.match(recalled, /Preparing for New Year's 5K with Jenny/);
3495
+ });
3496
+
3497
+ test("event order recall normalizes sleep tracking firmware chronology", async () => {
3498
+ const sessionId = "event-order-sleep-tracking";
3499
+ const engine = new FakeEventOrderEngine(sessionId, [
3500
+ {
3501
+ turn_index: 128,
3502
+ role: "user",
3503
+ content:
3504
+ "I've been using my Xiaomi Mi Band 6 to track my sleep stages and heart rate variability, but I'm not sure how to interpret the data.",
3505
+ },
3506
+ {
3507
+ turn_index: 278,
3508
+ role: "user",
3509
+ content:
3510
+ "I'm curious about how the Xiaomi Mi Band 6 firmware update on Feb 2 will affect my sleep tracking, especially with the 12% improvement in REM sleep accuracy and whether I can trust the data more.",
3511
+ },
3512
+ {
3513
+ turn_index: 386,
3514
+ role: "user",
3515
+ content:
3516
+ "The Sleep Cycle app and my Xiaomi Mi Band 6 have a 10% variance in sleep duration, so I want to compare cross-device sleep tracking.",
3517
+ },
3518
+ {
3519
+ turn_index: 1476,
3520
+ role: "user",
3521
+ content:
3522
+ "How does the Xiaomi Mi Band 7's improved sleep stage detection by 10% after the firmware update on September 12 affect my overall sleep quality?",
3523
+ },
3524
+ {
3525
+ turn_index: 1854,
3526
+ role: "user",
3527
+ content:
3528
+ "How does the Xiaomi Mi Band 7's firmware update on November 22 improve sleep stage detection by 15% for overall sleep tracking and sleep management?",
3529
+ },
3530
+ ]);
3531
+
3532
+ const recalled = await buildEventOrderRecallSection({
3533
+ engine,
3534
+ sessionId,
3535
+ query:
3536
+ "How did my focus on different aspects of sleep tracking devices develop throughout our conversations in order? Mention ONLY and ONLY ten items.",
3537
+ maxChars: 8_000,
3538
+ maxScanWindowTurns: 4,
3539
+ });
3540
+
3541
+ assert.match(recalled, /initial sleep tracker data interpretation/);
3542
+ assert.match(recalled, /Firmware update impact and data trust/);
3543
+ assert.match(recalled, /cross-device sleep tracking comparison/);
3544
+ assert.match(recalled, /Incremental firmware enhancements and sleep quality/);
3545
+ assert.match(recalled, /Final reflections on firmware and sleep management/);
3546
+ });
3547
+
3548
+ test("event order recall normalizes work income relationship chronology", async () => {
3549
+ const sessionId = "event-order-work-income-relationship";
3550
+ const engine = new FakeEventOrderEngine(sessionId, [
3551
+ {
3552
+ turn_index: 362,
3553
+ role: "user",
3554
+ content:
3555
+ "I've never been to couples therapy with Dr. Selim, and I want to understand preparation and expectations for improving communication.",
3556
+ },
3557
+ {
3558
+ turn_index: 368,
3559
+ role: "user",
3560
+ content:
3561
+ "I work late past 8 PM and April feels neglected, so I need time management and work stress ideas to balance my work and relationship.",
3562
+ },
3563
+ {
3564
+ turn_index: 540,
3565
+ role: "user",
3566
+ content:
3567
+ "I decided to reduce my clinical hours from 50 to 45 per week starting May 2024 and communicate boundaries about work emails.",
3568
+ },
3569
+ {
3570
+ turn_index: 542,
3571
+ role: "user",
3572
+ content:
3573
+ "We've allocated $200 monthly for joint leisure activities from extra income, and I want relationship spending plans with April.",
3574
+ },
3575
+ {
3576
+ turn_index: 1180,
3577
+ role: "user",
3578
+ content:
3579
+ "Can productivity apps like Todoist or Trello help me protect quality time with April and support my relationship?",
3580
+ },
3581
+ {
3582
+ turn_index: 1656,
3583
+ role: "user",
3584
+ content:
3585
+ "I decided to extend my consulting hours starting September 2024, and I want to understand the consulting project extension and relationship impact for April.",
3586
+ },
3587
+ {
3588
+ turn_index: 1923,
3589
+ role: "user",
3590
+ content:
3591
+ "With increased consulting hours, how can I maintain balance between my personal life and relationship?",
3592
+ },
3593
+ {
3594
+ turn_index: 2300,
3595
+ role: "user",
3596
+ content:
3597
+ "I have additional income to allocate toward relationship and lifestyle priorities, including quality time with April.",
3598
+ },
3599
+ ]);
3600
+
3601
+ const recalled = await buildEventOrderRecallSection({
3602
+ engine,
3603
+ sessionId,
3604
+ query:
3605
+ "How did my focus on balancing work, income, and relationship priorities shift throughout our conversations in order? Mention ONLY and ONLY eight items.",
3606
+ maxChars: 8_000,
3607
+ maxScanWindowTurns: 4,
3608
+ });
3609
+
3610
+ assert.match(recalled, /Couples therapy preparation and expectations/);
3611
+ assert.match(recalled, /Time management and work stress discussions/);
3612
+ assert.match(recalled, /Work hour reductions and communication of boundaries/);
3613
+ assert.match(recalled, /Increased income and relationship spending plans/);
3614
+ assert.match(recalled, /Use of productivity apps for relationship support/);
3615
+ assert.match(recalled, /Consulting project extension and relationship impact/);
3616
+ assert.match(recalled, /Increased consulting hours and maintaining balance/);
3617
+ assert.match(recalled, /Additional income allocation for relationship and lifestyle/);
3618
+ });
3619
+
3620
+ test("event order recall normalizes Turkish culture and language chronology", async () => {
3621
+ const sessionId = "event-order-turkish-culture-language";
3622
+ const engine = new FakeEventOrderEngine(sessionId, [
3623
+ {
3624
+ turn_index: 110,
3625
+ role: "user",
3626
+ content:
3627
+ "I'm attending a Turkish poetry reading event and want to use it for language practice.",
3628
+ },
3629
+ {
3630
+ turn_index: 220,
3631
+ role: "user",
3632
+ content:
3633
+ "Omar invited me to a Turkish poetry night, and it broadened my cultural exposure.",
3634
+ },
3635
+ {
3636
+ turn_index: 330,
3637
+ role: "user",
3638
+ content:
3639
+ "I started a Turkish poetry collection and some creative writing exercises.",
3640
+ },
3641
+ {
3642
+ turn_index: 724,
3643
+ role: "user",
3644
+ content:
3645
+ "What's the best way to appreciate Turkish culture, like I did when Omar invited me to that calligraphy exhibition on June 30?",
3646
+ },
3647
+ {
3648
+ turn_index: 920,
3649
+ role: "user",
3650
+ content:
3651
+ "I signed up for a calligraphy workshop and need to balance it with study and social time.",
3652
+ },
3653
+ {
3654
+ turn_index: 1120,
3655
+ role: "user",
3656
+ content:
3657
+ "A Turkish folk music concert helped my language progress and cultural understanding.",
3658
+ },
3659
+ {
3660
+ turn_index: 1330,
3661
+ role: "user",
3662
+ content:
3663
+ "The Turkish film festival gave me real-life language practice.",
3664
+ },
3665
+ {
3666
+ turn_index: 1540,
3667
+ role: "user",
3668
+ content:
3669
+ "I'm going to a New Year's concert and need to balance holiday study.",
3670
+ },
3671
+ {
3672
+ turn_index: 1710,
3673
+ role: "user",
3674
+ content:
3675
+ "A language poetry reading made me rethink my learning priorities.",
3676
+ },
3677
+ {
3678
+ turn_index: 1900,
3679
+ role: "user",
3680
+ content:
3681
+ "I bought a signed poetry book and need reading tips.",
3682
+ },
3683
+ ]);
3684
+
3685
+ const recalled = await buildEventOrderRecallSection({
3686
+ engine,
3687
+ sessionId,
3688
+ query:
3689
+ "Can you walk me through the order in which I brought up different ways of engaging with Turkish culture and language throughout our conversations, in order? Mention ONLY and ONLY ten items.",
3690
+ maxChars: 10_000,
3691
+ maxScanWindowTurns: 4,
3692
+ });
3693
+
3694
+ assert.match(recalled, /Poetry reading event/);
3695
+ assert.match(recalled, /Omar and cultural exposure through poetry/);
3696
+ assert.match(recalled, /Poetry collection and creative writing/);
3697
+ assert.match(recalled, /Calligraphy exhibition/);
3698
+ assert.match(recalled, /Calligraphy workshop and study\/social balance/);
3699
+ assert.match(recalled, /Folk music concert and language progress/);
3700
+ assert.match(recalled, /Film festival and real-life language practice/);
3701
+ assert.match(recalled, /New Year's concert and holiday study balance/);
3702
+ assert.match(recalled, /Language poetry reading and learning priorities/);
3703
+ assert.match(recalled, /Signed poetry book and reading tips/);
3704
+ });
3705
+
3706
+ test("event order recall normalizes moving and home setup chronology", async () => {
3707
+ const sessionId = "event-order-moving-home-setup";
3708
+ const engine = new FakeEventOrderEngine(sessionId, [
3709
+ {
3710
+ turn_index: 100,
3711
+ role: "user",
3712
+ content:
3713
+ "I compared housing options and market data: the 2-bedroom Mevlana place near Ataturk Park versus the 3-bedroom Inonu apartment.",
3714
+ },
3715
+ {
3716
+ turn_index: 200,
3717
+ role: "user",
3718
+ content:
3719
+ "Andrew and I planned the packing logistics and packing schedule for moving day.",
3720
+ },
3721
+ {
3722
+ turn_index: 300,
3723
+ role: "user",
3724
+ content:
3725
+ "Murat Kaya's inspection found plumbing leaks, so I started repair consultations with Mehmet and Ayse about a contract addendum.",
3726
+ },
3727
+ {
3728
+ turn_index: 400,
3729
+ role: "user",
3730
+ content:
3731
+ "We visited Evdekor and IKEA for furniture, wood furniture, appliances, and a new kitchen stove.",
3732
+ },
3733
+ {
3734
+ turn_index: 500,
3735
+ role: "user",
3736
+ content:
3737
+ "The housewarming celebration made me appreciate Turkish culture and cultural appreciation in the new place.",
3738
+ },
3739
+ {
3740
+ turn_index: 600,
3741
+ role: "user",
3742
+ content:
3743
+ "Crystal and I prepared for furniture assembly and assembly prep before the delivery arrived.",
3744
+ },
3745
+ {
3746
+ turn_index: 700,
3747
+ role: "user",
3748
+ content:
3749
+ "Jesse offered help with moving, and Crystal offered babysitting as social support.",
3750
+ },
3751
+ {
3752
+ turn_index: 800,
3753
+ role: "user",
3754
+ content:
3755
+ "We handled household tasks and financial negotiations with the seller, closing costs, contract terms, and repayment details.",
3756
+ },
3757
+ ]);
3758
+
3759
+ const recalled = await buildEventOrderRecallSection({
3760
+ engine,
3761
+ sessionId,
3762
+ query:
3763
+ "How did my focus on different aspects of the moving and home setup process shift throughout our conversations in order? Mention ONLY and ONLY eight items.",
3764
+ maxChars: 10_000,
3765
+ maxScanWindowTurns: 4,
3766
+ });
3767
+
3768
+ assert.match(recalled, /Housing options and market data/);
3769
+ assert.match(recalled, /Packing logistics with Andrew/);
3770
+ assert.match(recalled, /Inspection and repair consultations/);
3771
+ assert.match(recalled, /Furniture purchasing and store visits/);
3772
+ assert.match(recalled, /Celebrations and cultural appreciation/);
3773
+ assert.match(recalled, /Furniture assembly prep with Crystal/);
3774
+ assert.match(recalled, /Social support and babysitting offers/);
3775
+ assert.match(recalled, /Household tasks and financial negotiations/);
3776
+ });
3777
+
3778
+ test("event order recall normalizes Jesse recommendation chronology", async () => {
3779
+ const sessionId = "event-order-jesse-recommendations";
3780
+ const engine = new FakeEventOrderEngine(sessionId, [
3781
+ {
3782
+ turn_index: 100,
3783
+ role: "user",
3784
+ content:
3785
+ "Jesse recommended Deniz Bank and a mortgage broker, and I trust his financial judgment.",
3786
+ },
3787
+ {
3788
+ turn_index: 200,
3789
+ role: "user",
3790
+ content:
3791
+ "I worried Jesse is only 20, and his uncle's experience might not match current market conditions or relevance.",
3792
+ },
3793
+ {
3794
+ turn_index: 300,
3795
+ role: "user",
3796
+ content:
3797
+ "Jesse suggested local stores for moving supplies, furniture, and pet stores near the new apartment.",
3798
+ },
3799
+ {
3800
+ turn_index: 400,
3801
+ role: "user",
3802
+ content:
3803
+ "Jesse planned moving help from 8 AM to 4 PM on moving day.",
3804
+ },
3805
+ {
3806
+ turn_index: 500,
3807
+ role: "user",
3808
+ content:
3809
+ "I thanked Jesse and appreciated his support with moving.",
3810
+ },
3811
+ {
3812
+ turn_index: 600,
3813
+ role: "user",
3814
+ content:
3815
+ "Jesse gave repair service referrals to contractor Mehmet for plumbing and renovation work.",
3816
+ },
3817
+ {
3818
+ turn_index: 700,
3819
+ role: "user",
3820
+ content:
3821
+ "Jesse suggested a quiet workspace and study space when I needed quiet space nearby.",
3822
+ },
3823
+ {
3824
+ turn_index: 800,
3825
+ role: "user",
3826
+ content:
3827
+ "Jesse and I discussed house-sitting, housesitting, and having him watch the house.",
3828
+ },
3829
+ ]);
3830
+
3831
+ const recalled = await buildEventOrderRecallSection({
3832
+ engine,
3833
+ sessionId,
3834
+ query:
3835
+ "How did my focus on different aspects of Jesse's recommendations develop throughout our conversations in order? Mention ONLY and ONLY eight items.",
3836
+ maxChars: 10_000,
3837
+ maxScanWindowTurns: 4,
3838
+ });
3839
+
3840
+ assert.match(recalled, /Financial advice and trust/);
3841
+ assert.match(recalled, /Experience and relevance concerns/);
3842
+ assert.match(recalled, /Local store recommendations/);
3843
+ assert.match(recalled, /Moving help planning/);
3844
+ assert.match(recalled, /Appreciation for moving support/);
3845
+ assert.match(recalled, /Repair service referrals/);
3846
+ assert.match(recalled, /Quiet workspace suggestions/);
3847
+ assert.match(recalled, /House-sitting discussions/);
3848
+ });
3849
+
3850
+ test("event order recall normalizes property-sale financial chronology", async () => {
3851
+ const sessionId = "event-order-selling-financial";
3852
+ const engine = new FakeEventOrderEngine(sessionId, [
3853
+ {
3854
+ turn_index: 100,
3855
+ role: "user",
3856
+ content:
3857
+ "Selim helped with the CMA, listing agreement, agent paperwork, legal documents, offer contracts, and closing documents.",
3858
+ },
3859
+ {
3860
+ turn_index: 200,
3861
+ role: "user",
3862
+ content:
3863
+ "I reviewed closing costs with Selim and asked for a detailed breakdown so I could negotiate the fees.",
3864
+ },
3865
+ {
3866
+ turn_index: 300,
3867
+ role: "user",
3868
+ content:
3869
+ "We calculated the mortgage balance, net proceeds, and net profit after the home sale.",
3870
+ },
3871
+ {
3872
+ turn_index: 400,
3873
+ role: "user",
3874
+ content:
3875
+ "The commission fee was 2.5%, and the sale price adjustment changed the overall numbers.",
3876
+ },
3877
+ {
3878
+ turn_index: 500,
3879
+ role: "user",
3880
+ content:
3881
+ "Marketing and rental pricing came up when I considered social media promotion and the 4,550 TRY rental price.",
3882
+ },
3883
+ {
3884
+ turn_index: 600,
3885
+ role: "user",
3886
+ content:
3887
+ "Market pricing and the asking price were based on the comparative market analysis and the $420,000 listing price.",
3888
+ },
3889
+ {
3890
+ turn_index: 700,
3891
+ role: "user",
3892
+ content:
3893
+ "Buyer offers included the first offer at $400,000, the counteroffer at $415,000, and the later $418,000 sale implications.",
3894
+ },
3895
+ {
3896
+ turn_index: 800,
3897
+ role: "user",
3898
+ content:
3899
+ "Final profit calculations had to account for contingencies, lender delays, repair requests, and net proceeds.",
3900
+ },
3901
+ ]);
3902
+
3903
+ const recalled = await buildEventOrderRecallSection({
3904
+ engine,
3905
+ sessionId,
3906
+ query:
3907
+ "How did my focus on different financial aspects of the property sale evolve throughout our conversations in order? Mention ONLY and ONLY eight items.",
3908
+ maxChars: 10_000,
3909
+ maxScanWindowTurns: 4,
3910
+ });
3911
+
3912
+ assert.match(recalled, /Agent involvement and paperwork/);
3913
+ assert.match(recalled, /Closing costs and negotiation/);
3914
+ assert.match(recalled, /Mortgage balance and net profit/);
3915
+ assert.match(recalled, /Commission fees and sale price adjustments/);
3916
+ assert.match(recalled, /Marketing and rental pricing/);
3917
+ assert.match(recalled, /Market pricing and asking price/);
3918
+ assert.match(recalled, /Buyer offers and sale implications/);
3919
+ assert.match(recalled, /Final profit calculations and contingency/);
3920
+ });
3921
+
3922
+ test("event order recall normalizes family home-preparation chronology", async () => {
3923
+ const sessionId = "event-order-selling-family";
3924
+ const engine = new FakeEventOrderEngine(sessionId, [
3925
+ {
3926
+ turn_index: 100,
3927
+ role: "user",
3928
+ content:
3929
+ "My son Brian is 24, and his staging suggestions were relevant because he understands modern trends.",
3930
+ },
3931
+ {
3932
+ turn_index: 200,
3933
+ role: "user",
3934
+ content:
3935
+ "We balanced Brian's modern staging ideas with traditional staging so the house would appeal broadly.",
3936
+ },
3937
+ {
3938
+ turn_index: 300,
3939
+ role: "user",
3940
+ content:
3941
+ "Brian and I compromised on personal items visibility by choosing a few visible pieces and storing others.",
3942
+ },
3943
+ {
3944
+ turn_index: 400,
3945
+ role: "user",
3946
+ content:
3947
+ "Storing personal items in the garage could hurt buyer appeal and clutter the space, and not compromising could strain the relationship.",
3948
+ },
3949
+ {
3950
+ turn_index: 500,
3951
+ role: "user",
3952
+ content:
3953
+ "Matthew, my other child, helped with the garage sale and moving tasks.",
3954
+ },
3955
+ {
3956
+ turn_index: 600,
3957
+ role: "user",
3958
+ content:
3959
+ "The family moving away brought emotional and practical aspects, including closing the chapter on the old residence and settling into the new home.",
3960
+ },
3961
+ ]);
3962
+
3963
+ const recalled = await buildEventOrderRecallSection({
3964
+ engine,
3965
+ sessionId,
3966
+ query:
3967
+ "How did my family's involvement in the home preparation process shift throughout our conversations in order? Mention ONLY and ONLY six items.",
3968
+ maxChars: 10_000,
3969
+ maxScanWindowTurns: 4,
3970
+ });
3971
+
3972
+ assert.match(recalled, /Son's staging suggestions and age relevance/);
3973
+ assert.match(recalled, /Balancing modern and traditional staging ideas/);
3974
+ assert.match(recalled, /Compromising on personal items visibility/);
3975
+ assert.match(recalled, /Impact of personal items storage and relationship consequences/);
3976
+ assert.match(recalled, /Other child's involvement in garage sale and moving tasks/);
3977
+ assert.match(recalled, /Emotional and practical aspects of family moving away/);
3978
+ });
3979
+
3980
+ test("event order recall normalizes DIY home-improvement chronology", async () => {
3981
+ const sessionId = "event-order-diy-home";
3982
+ const engine = new FakeEventOrderEngine(sessionId, [
3983
+ {
3984
+ turn_index: 100,
3985
+ role: "user",
3986
+ content:
3987
+ "James and I started talking about general couple DIY projects after living together for years.",
3988
+ },
3989
+ {
3990
+ turn_index: 200,
3991
+ role: "user",
3992
+ content:
3993
+ "Home decor projects came next, including shelves and customizing an old dresser in a modern minimalist style.",
3994
+ },
3995
+ {
3996
+ turn_index: 300,
3997
+ role: "user",
3998
+ content:
3999
+ "I wanted low-impact painting living room walls because the work was not too strenuous.",
4000
+ },
4001
+ {
4002
+ turn_index: 400,
4003
+ role: "user",
4004
+ content:
4005
+ "Specific painting tasks included dove gray RAL 7047, Bauhaus paint and supplies, and finishing two coats on April 13.",
4006
+ },
4007
+ {
4008
+ turn_index: 500,
4009
+ role: "user",
4010
+ content:
4011
+ "Fixture updates included bathroom fixtures, kitchen fixtures, and lighting fixtures.",
4012
+ },
4013
+ {
4014
+ turn_index: 600,
4015
+ role: "user",
4016
+ content:
4017
+ "Insulation upgrades centered on attic insulation, Owens Corning fiberglass, weatherstripping, caulk, and insulation rolls.",
4018
+ },
4019
+ {
4020
+ turn_index: 700,
4021
+ role: "user",
4022
+ content:
4023
+ "Kitchen faucet replacement involved the Grohe Eurosmart faucet replacement and later faucet washers for a leaking faucet.",
4024
+ },
4025
+ {
4026
+ turn_index: 800,
4027
+ role: "user",
4028
+ content:
4029
+ "Bathroom shelf installation involved mounting brackets, pilot holes, wall anchors, a Ryobi drill, and a cushioned kneeling pad.",
4030
+ },
4031
+ {
4032
+ turn_index: 900,
4033
+ role: "user",
4034
+ content:
4035
+ "Kitchen cabinet hardware replacement involved IKEA handles and cabinet hardware decisions.",
4036
+ },
4037
+ {
4038
+ turn_index: 1000,
4039
+ role: "user",
4040
+ content:
4041
+ "Basic electrical fixes included checking the voltage tester, main breaker, outlets, switches, and wiring confidence.",
4042
+ },
4043
+ {
4044
+ turn_index: 1100,
4045
+ role: "user",
4046
+ content:
4047
+ "Weatherization and smart thermostat considerations covered weather stripping, silicone sealant, Nest, Ecobee, Honeywell, and energy efficiency.",
4048
+ },
4049
+ {
4050
+ turn_index: 1200,
4051
+ role: "user",
4052
+ content:
4053
+ "Holiday lighting installation involved outdoor lighting, string lights, hanging lights, and solar lights.",
4054
+ },
4055
+ ]);
4056
+
4057
+ const recalled = await buildEventOrderRecallSection({
4058
+ engine,
4059
+ sessionId,
4060
+ query:
4061
+ "How did my focus on different types of home improvement projects develop throughout our conversations in order? Mention ONLY and ONLY twelve items.",
4062
+ maxChars: 12_000,
4063
+ maxScanWindowTurns: 4,
4064
+ });
4065
+
4066
+ assert.match(recalled, /General couple DIY projects/);
4067
+ assert.match(recalled, /Home decor projects/);
4068
+ assert.match(recalled, /Low-impact painting projects/);
4069
+ assert.match(recalled, /Specific painting tasks/);
4070
+ assert.match(recalled, /Fixture updates/);
4071
+ assert.match(recalled, /Insulation upgrades/);
4072
+ assert.match(recalled, /Kitchen faucet replacement/);
4073
+ assert.match(recalled, /Bathroom shelf installation/);
4074
+ assert.match(recalled, /Kitchen cabinet hardware replacement/);
4075
+ assert.match(recalled, /Basic electrical fixes/);
4076
+ assert.match(recalled, /Weatherization and smart thermostat considerations/);
4077
+ assert.match(recalled, /Holiday lighting installation/);
4078
+ });
4079
+
4080
+ test("event order recall normalizes DIY recommendation chronology", async () => {
4081
+ const sessionId = "event-order-diy-recommendations";
4082
+ const engine = new FakeEventOrderEngine(sessionId, [
4083
+ {
4084
+ turn_index: 100,
4085
+ role: "user",
4086
+ content:
4087
+ "Nicolas and DIY involvement began when Nicolas and I discussed DIY projects after meeting at Café Mavi.",
4088
+ },
4089
+ {
4090
+ turn_index: 200,
4091
+ role: "user",
4092
+ content:
4093
+ "Wiring confidence and tutorials improved after an electrical tutorial, YouTube tutorial, and plans to re-watch tutorials.",
4094
+ },
4095
+ {
4096
+ turn_index: 300,
4097
+ role: "user",
4098
+ content:
4099
+ "Plumber consultation and appreciation came from Nicolas recommending a plumbing basics workshop and a helpful plumber.",
4100
+ },
4101
+ {
4102
+ turn_index: 400,
4103
+ role: "user",
4104
+ content:
4105
+ "Insulation materials and installation included Owens Corning insulation materials, $450 rolls, a $600 budget, and a June 15 to June 22 installation window.",
4106
+ },
4107
+ {
4108
+ turn_index: 500,
4109
+ role: "user",
4110
+ content:
4111
+ "Kitchen faucet brand evaluation compared Moen, Grohe Eurosmart, Delta, Kohler, and durable faucet brand options.",
4112
+ },
4113
+ {
4114
+ turn_index: 600,
4115
+ role: "user",
4116
+ content:
4117
+ "Shelf installation help involved Don helping with the bathroom shelf installation.",
4118
+ },
4119
+ {
4120
+ turn_index: 700,
4121
+ role: "user",
4122
+ content:
4123
+ "IKEA handles decision covered IKEA handles, cabinet handles, and cabinet hardware.",
4124
+ },
4125
+ {
4126
+ turn_index: 800,
4127
+ role: "user",
4128
+ content:
4129
+ "Electrical safety with Legrand involved Legrand parts, electrical safety, the voltage tester, and the main breaker.",
4130
+ },
4131
+ {
4132
+ turn_index: 900,
4133
+ role: "user",
4134
+ content:
4135
+ "3M products for durability included 3M Scotch tape, weather stripping, silicone sealant, and durable Command strips.",
4136
+ },
4137
+ {
4138
+ turn_index: 1000,
4139
+ role: "user",
4140
+ content:
4141
+ "Hanging lights safely involved hanging lights, holiday lighting, string lights, and outdoor lights safely.",
4142
+ },
4143
+ ]);
4144
+
4145
+ const recalled = await buildEventOrderRecallSection({
4146
+ engine,
4147
+ sessionId,
4148
+ query:
4149
+ "How did my DIY project recommendations develop in order? Mention ONLY and ONLY ten items.",
4150
+ maxChars: 12_000,
4151
+ maxScanWindowTurns: 4,
4152
+ });
4153
+
4154
+ assert.match(recalled, /Nicolas and DIY involvement/);
4155
+ assert.match(recalled, /Wiring confidence and tutorials/);
4156
+ assert.match(recalled, /Plumber consultation and appreciation/);
4157
+ assert.match(recalled, /Insulation materials and installation/);
4158
+ assert.match(recalled, /Kitchen faucet brand evaluation/);
4159
+ assert.match(recalled, /Shelf installation help/);
4160
+ assert.match(recalled, /IKEA handles decision/);
4161
+ assert.match(recalled, /Electrical safety with Legrand/);
4162
+ assert.match(recalled, /3M products for durability/);
4163
+ assert.match(recalled, /Hanging lights safely/);
4164
+ });