@remnic/core 1.1.11 → 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 (1462) hide show
  1. package/README.md +3 -3
  2. package/dist/access-cli.d.ts +2 -1
  3. package/dist/access-cli.js +293 -104
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +31 -62
  6. package/dist/access-http.js +53 -35
  7. package/dist/access-mcp.d.ts +31 -8
  8. package/dist/access-mcp.js +45 -34
  9. package/dist/access-schema.d.ts +197 -14
  10. package/dist/access-schema.js +16 -5
  11. package/dist/access-service-DcCDmNYC.d.ts +1542 -0
  12. package/dist/access-service.d.ts +30 -9
  13. package/dist/access-service.js +42 -32
  14. package/dist/action-confidence.d.ts +83 -0
  15. package/dist/action-confidence.js +22 -0
  16. package/dist/active-memory-bridge.d.ts +1 -1
  17. package/dist/active-memory-bridge.js +2 -2
  18. package/dist/active-recall.d.ts +1 -1
  19. package/dist/active-recall.js +11 -3
  20. package/dist/active-recall.js.map +1 -1
  21. package/dist/adapters/claude-code.d.ts +24 -0
  22. package/dist/adapters/claude-code.js +9 -0
  23. package/dist/adapters/codex.d.ts +25 -0
  24. package/dist/adapters/codex.js +9 -0
  25. package/dist/adapters/hermes.d.ts +35 -0
  26. package/dist/adapters/hermes.js +9 -0
  27. package/dist/adapters/index.d.ts +6 -0
  28. package/dist/adapters/index.js +26 -0
  29. package/dist/adapters/registry.d.ts +20 -0
  30. package/dist/adapters/registry.js +13 -0
  31. package/dist/adapters/replit.d.ts +28 -0
  32. package/dist/adapters/replit.js +9 -0
  33. package/dist/adapters/types.d.ts +43 -0
  34. package/dist/adapters/types.js +8 -0
  35. package/dist/behavior-learner.d.ts +1 -1
  36. package/dist/behavior-signals.d.ts +1 -1
  37. package/dist/bootstrap.d.ts +23 -6
  38. package/dist/boxes.d.ts +7 -0
  39. package/dist/boxes.js +1 -1
  40. package/dist/briefing.d.ts +5 -3
  41. package/dist/briefing.js +10 -7
  42. package/dist/buffer-surprise-report.d.ts +1 -1
  43. package/dist/buffer-surprise-report.js +1 -1
  44. package/dist/buffer.d.ts +18 -4
  45. package/dist/buffer.js +1 -1
  46. package/dist/calibration.d.ts +1 -1
  47. package/dist/calibration.js +6 -6
  48. package/dist/capsule-cli.d.ts +4 -4
  49. package/dist/capsule-cli.js +1 -1
  50. package/dist/capsule-crypto-5CYAGVC5.js +18 -0
  51. package/dist/capsule-merge-4MGKE7C5.js +189 -0
  52. package/dist/causal-behavior.d.ts +9 -29
  53. package/dist/causal-behavior.js +6 -3
  54. package/dist/causal-behavior.js.map +1 -1
  55. package/dist/causal-chain.js +3 -2
  56. package/dist/causal-consolidation.d.ts +2 -2
  57. package/dist/causal-consolidation.js +28 -17
  58. package/dist/causal-consolidation.js.map +1 -1
  59. package/dist/causal-retrieval.js +3 -3
  60. package/dist/causal-trajectory.js +1 -1
  61. package/dist/chunk-25MQ7IHJ.js +427 -0
  62. package/dist/chunk-25MQ7IHJ.js.map +1 -0
  63. package/dist/chunk-2F2W355T.js +256 -0
  64. package/dist/chunk-2F2W355T.js.map +1 -0
  65. package/dist/chunk-2KI4QFHU.js +228 -0
  66. package/dist/chunk-2KI4QFHU.js.map +1 -0
  67. package/dist/chunk-2PRQG7PV.js +86 -0
  68. package/dist/chunk-2PRQG7PV.js.map +1 -0
  69. package/dist/chunk-2QR3XXIC.js +2272 -0
  70. package/dist/chunk-2QR3XXIC.js.map +1 -0
  71. package/dist/chunk-2WWLHTZY.js +121 -0
  72. package/dist/chunk-326G7DJK.js +2185 -0
  73. package/dist/chunk-326G7DJK.js.map +1 -0
  74. package/dist/chunk-34DQE4KF.js +174 -0
  75. package/dist/chunk-34DQE4KF.js.map +1 -0
  76. package/dist/chunk-3APJ5EVB.js +601 -0
  77. package/dist/chunk-3APJ5EVB.js.map +1 -0
  78. package/dist/chunk-3HPAPHUK.js +51 -0
  79. package/dist/chunk-3HPAPHUK.js.map +1 -0
  80. package/dist/chunk-3JXBXXM2.js +69 -0
  81. package/dist/chunk-3JXBXXM2.js.map +1 -0
  82. package/dist/chunk-3KW65B36.js +681 -0
  83. package/dist/chunk-3KW65B36.js.map +1 -0
  84. package/dist/chunk-3UXOZBHV.js +20 -0
  85. package/dist/chunk-3UXOZBHV.js.map +1 -0
  86. package/dist/chunk-3VAL7ZL2.js +266 -0
  87. package/dist/chunk-3VAL7ZL2.js.map +1 -0
  88. package/dist/chunk-3Y4P7RXM.js +31 -0
  89. package/dist/chunk-3Y4P7RXM.js.map +1 -0
  90. package/dist/chunk-47VWKCAF.js +273 -0
  91. package/dist/chunk-47VWKCAF.js.map +1 -0
  92. package/dist/chunk-4CRG46BG.js +271 -0
  93. package/dist/chunk-4RA3C3EV.js +60 -0
  94. package/dist/chunk-4RA3C3EV.js.map +1 -0
  95. package/dist/chunk-5375UYTQ.js +914 -0
  96. package/dist/chunk-5375UYTQ.js.map +1 -0
  97. package/dist/chunk-56K5QLHX.js +506 -0
  98. package/dist/chunk-56K5QLHX.js.map +1 -0
  99. package/dist/chunk-5NXIJZFX.js +180 -0
  100. package/dist/chunk-5NXIJZFX.js.map +1 -0
  101. package/dist/chunk-5RGLBDQF.js +596 -0
  102. package/dist/chunk-5RGLBDQF.js.map +1 -0
  103. package/dist/chunk-5UZXUTVO.js +9 -0
  104. package/dist/chunk-5UZXUTVO.js.map +1 -0
  105. package/dist/chunk-65PG43EQ.js +105 -0
  106. package/dist/chunk-65PG43EQ.js.map +1 -0
  107. package/dist/chunk-66DHUKLO.js +57 -0
  108. package/dist/chunk-66DHUKLO.js.map +1 -0
  109. package/dist/chunk-6FC5EGNV.js +46 -0
  110. package/dist/chunk-6FC5EGNV.js.map +1 -0
  111. package/dist/chunk-6H2TESSP.js +62 -0
  112. package/dist/chunk-6H2TESSP.js.map +1 -0
  113. package/dist/chunk-6LVVDPJ4.js +32 -0
  114. package/dist/chunk-6LVVDPJ4.js.map +1 -0
  115. package/dist/chunk-6NKAQ74D.js +2237 -0
  116. package/dist/chunk-6NKAQ74D.js.map +1 -0
  117. package/dist/chunk-6RVI47ZR.js +159 -0
  118. package/dist/chunk-6RVI47ZR.js.map +1 -0
  119. package/dist/chunk-7AAT6G4Q.js +5117 -0
  120. package/dist/chunk-7AAT6G4Q.js.map +1 -0
  121. package/dist/chunk-7DTASS5T.js +29 -0
  122. package/dist/chunk-7DTASS5T.js.map +1 -0
  123. package/dist/chunk-7IASACLB.js +596 -0
  124. package/dist/chunk-7MNMYOFP.js +32 -0
  125. package/dist/chunk-7MNMYOFP.js.map +1 -0
  126. package/dist/chunk-7N4KAIGN.js +133 -0
  127. package/dist/chunk-7N4KAIGN.js.map +1 -0
  128. package/dist/chunk-7OZ53EXP.js +101 -0
  129. package/dist/chunk-7OZ53EXP.js.map +1 -0
  130. package/dist/chunk-7XYTQGCC.js +134 -0
  131. package/dist/chunk-7XYTQGCC.js.map +1 -0
  132. package/dist/chunk-A2XUIMJ3.js +341 -0
  133. package/dist/chunk-A2XUIMJ3.js.map +1 -0
  134. package/dist/chunk-AC5LO7IU.js +308 -0
  135. package/dist/chunk-AC5LO7IU.js.map +1 -0
  136. package/dist/chunk-AGZQD76C.js +201 -0
  137. package/dist/chunk-AGZQD76C.js.map +1 -0
  138. package/dist/chunk-AH2JUU6X.js +336 -0
  139. package/dist/chunk-AH2JUU6X.js.map +1 -0
  140. package/dist/chunk-APO3DCMU.js +361 -0
  141. package/dist/chunk-APO3DCMU.js.map +1 -0
  142. package/dist/chunk-BFBF3XEF.js +283 -0
  143. package/dist/chunk-BFBF3XEF.js.map +1 -0
  144. package/dist/chunk-BJ3KMYTB.js +1974 -0
  145. package/dist/chunk-BJ3KMYTB.js.map +1 -0
  146. package/dist/chunk-C5BCH4ZS.js +317 -0
  147. package/dist/chunk-C5BCH4ZS.js.map +1 -0
  148. package/dist/chunk-CHEL3SKB.js +6758 -0
  149. package/dist/chunk-CHEL3SKB.js.map +1 -0
  150. package/dist/chunk-CQZRLNMV.js +1491 -0
  151. package/dist/chunk-CQZRLNMV.js.map +1 -0
  152. package/dist/chunk-D46YSIYX.js +892 -0
  153. package/dist/chunk-D46YSIYX.js.map +1 -0
  154. package/dist/chunk-DB5A3NHS.js +906 -0
  155. package/dist/chunk-DB5A3NHS.js.map +1 -0
  156. package/dist/chunk-DINWEURR.js +648 -0
  157. package/dist/chunk-DINWEURR.js.map +1 -0
  158. package/dist/chunk-DK5LDEQM.js +530 -0
  159. package/dist/chunk-DK5LDEQM.js.map +1 -0
  160. package/dist/chunk-DOM4GKSW.js +34 -0
  161. package/dist/chunk-DOM4GKSW.js.map +1 -0
  162. package/dist/chunk-EDTHC6UD.js +1075 -0
  163. package/dist/chunk-EDTHC6UD.js.map +1 -0
  164. package/dist/chunk-EFJ3MQ4V.js +721 -0
  165. package/dist/chunk-EHRTFRWW.js +89 -0
  166. package/dist/chunk-EHRTFRWW.js.map +1 -0
  167. package/dist/chunk-FAJ7FZYM.js +11 -0
  168. package/dist/chunk-FAJ7FZYM.js.map +1 -0
  169. package/dist/chunk-FBYESMQ2.js +570 -0
  170. package/dist/chunk-FBYESMQ2.js.map +1 -0
  171. package/dist/chunk-FDU6HUUL.js +147 -0
  172. package/dist/chunk-FF4KLI5W.js +99 -0
  173. package/dist/chunk-FF4KLI5W.js.map +1 -0
  174. package/dist/chunk-FIT6DMX6.js +310 -0
  175. package/dist/chunk-FIT6DMX6.js.map +1 -0
  176. package/dist/chunk-FJ43PRLT.js +272 -0
  177. package/dist/chunk-FJ43PRLT.js.map +1 -0
  178. package/dist/chunk-FKFMOY3N.js +32 -0
  179. package/dist/chunk-FKFMOY3N.js.map +1 -0
  180. package/dist/chunk-FLTNHQK6.js +262 -0
  181. package/dist/chunk-FLTNHQK6.js.map +1 -0
  182. package/dist/chunk-GA454ALV.js +12436 -0
  183. package/dist/chunk-GA454ALV.js.map +1 -0
  184. package/dist/chunk-GGKRUQOO.js +228 -0
  185. package/dist/chunk-GIF42EW3.js +63 -0
  186. package/dist/chunk-GIF42EW3.js.map +1 -0
  187. package/dist/chunk-GL6I6MEQ.js +647 -0
  188. package/dist/chunk-H3ME6L6D.js +709 -0
  189. package/dist/chunk-H3ME6L6D.js.map +1 -0
  190. package/dist/chunk-HHLLAQGZ.js +1 -0
  191. package/dist/chunk-HXXBL2KD.js +2040 -0
  192. package/dist/chunk-I5V2VDIW.js +219 -0
  193. package/dist/chunk-I5V2VDIW.js.map +1 -0
  194. package/dist/chunk-I6K5FBRQ.js +35 -0
  195. package/dist/chunk-I6K5FBRQ.js.map +1 -0
  196. package/dist/chunk-ICRIXAP2.js +121 -0
  197. package/dist/chunk-ICRIXAP2.js.map +1 -0
  198. package/dist/chunk-J4EB7DNW.js +11 -0
  199. package/dist/chunk-J4EB7DNW.js.map +1 -0
  200. package/dist/chunk-JLFA7DQG.js +62 -0
  201. package/dist/chunk-JLFA7DQG.js.map +1 -0
  202. package/dist/chunk-KJTKLXTH.js +9 -0
  203. package/dist/chunk-KJTKLXTH.js.map +1 -0
  204. package/dist/chunk-KLAO5DGL.js +917 -0
  205. package/dist/chunk-KLAO5DGL.js.map +1 -0
  206. package/dist/chunk-KNKUID7G.js +183 -0
  207. package/dist/chunk-KOSORCJG.js +624 -0
  208. package/dist/chunk-KOSORCJG.js.map +1 -0
  209. package/dist/chunk-KUJVMMZQ.js +1262 -0
  210. package/dist/chunk-KUJVMMZQ.js.map +1 -0
  211. package/dist/chunk-LCR46JY5.js +123 -0
  212. package/dist/chunk-LCR46JY5.js.map +1 -0
  213. package/dist/chunk-LLQ2LLWF.js +148 -0
  214. package/dist/chunk-LLQ2LLWF.js.map +1 -0
  215. package/dist/chunk-LPMVBPA3.js +236 -0
  216. package/dist/chunk-LT3NLYSI.js +50 -0
  217. package/dist/chunk-LT3NLYSI.js.map +1 -0
  218. package/dist/chunk-LUDTDZLK.js +287 -0
  219. package/dist/chunk-LUDTDZLK.js.map +1 -0
  220. package/dist/chunk-M23FSH32.js +3963 -0
  221. package/dist/chunk-M23FSH32.js.map +1 -0
  222. package/dist/chunk-MC26UJIM.js +118 -0
  223. package/dist/chunk-ME6ESPZU.js +119 -0
  224. package/dist/chunk-ME6ESPZU.js.map +1 -0
  225. package/dist/chunk-MGKYQQYF.js +272 -0
  226. package/dist/chunk-MGKYQQYF.js.map +1 -0
  227. package/dist/chunk-MJFNCJXV.js +66 -0
  228. package/dist/chunk-MJFNCJXV.js.map +1 -0
  229. package/dist/chunk-MSWG7JI6.js +237 -0
  230. package/dist/chunk-MSWG7JI6.js.map +1 -0
  231. package/dist/chunk-MT25YHYH.js +141 -0
  232. package/dist/chunk-MT25YHYH.js.map +1 -0
  233. package/dist/chunk-MT4HVDUZ.js +53 -0
  234. package/dist/chunk-MY6TPVXW.js +219 -0
  235. package/dist/chunk-N2D6GXBM.js +267 -0
  236. package/dist/chunk-N2D6GXBM.js.map +1 -0
  237. package/dist/chunk-NJ3MJQZX.js +46 -0
  238. package/dist/chunk-NJ3MJQZX.js.map +1 -0
  239. package/dist/chunk-NMZY542O.js +335 -0
  240. package/dist/chunk-NMZY542O.js.map +1 -0
  241. package/dist/chunk-NNVTUXEB.js +23 -0
  242. package/dist/chunk-NZL6GGQE.js +375 -0
  243. package/dist/chunk-NZL6GGQE.js.map +1 -0
  244. package/dist/chunk-OAZ5MFUB.js +4124 -0
  245. package/dist/chunk-OAZ5MFUB.js.map +1 -0
  246. package/dist/chunk-OIGNEXKZ.js +237 -0
  247. package/dist/chunk-OIGNEXKZ.js.map +1 -0
  248. package/dist/chunk-OZKZ2TRP.js +3729 -0
  249. package/dist/chunk-OZKZ2TRP.js.map +1 -0
  250. package/dist/chunk-P4NEIHUT.js +108 -0
  251. package/dist/chunk-P7FMDTKL.js +103 -0
  252. package/dist/chunk-P7FMDTKL.js.map +1 -0
  253. package/dist/chunk-PD6O7AXF.js +110 -0
  254. package/dist/chunk-PD6O7AXF.js.map +1 -0
  255. package/dist/chunk-PHK3HARR.js +32 -0
  256. package/dist/chunk-PHK3HARR.js.map +1 -0
  257. package/dist/chunk-PIRJPV5T.js +98 -0
  258. package/dist/chunk-PIRJPV5T.js.map +1 -0
  259. package/dist/chunk-PK7H5L6Y.js +159 -0
  260. package/dist/chunk-PK7H5L6Y.js.map +1 -0
  261. package/dist/chunk-PR5FBTFU.js +233 -0
  262. package/dist/chunk-PR5FBTFU.js.map +1 -0
  263. package/dist/chunk-PU63GXWS.js +174 -0
  264. package/dist/chunk-PU63GXWS.js.map +1 -0
  265. package/dist/chunk-PYPOFEMK.js +294 -0
  266. package/dist/chunk-PYPOFEMK.js.map +1 -0
  267. package/dist/chunk-PZIAX57I.js +124 -0
  268. package/dist/chunk-PZIAX57I.js.map +1 -0
  269. package/dist/chunk-Q7P4WJDP.js +26 -0
  270. package/dist/chunk-Q7P4WJDP.js.map +1 -0
  271. package/dist/chunk-QDZ2RLEC.js +908 -0
  272. package/dist/chunk-QDZ2RLEC.js.map +1 -0
  273. package/dist/chunk-QQUAB63I.js +63 -0
  274. package/dist/chunk-QQUAB63I.js.map +1 -0
  275. package/dist/chunk-QRNI5JBH.js +18 -0
  276. package/dist/chunk-RHY3HH7P.js +601 -0
  277. package/dist/chunk-RHY3HH7P.js.map +1 -0
  278. package/dist/chunk-RK6F44Y6.js +84 -0
  279. package/dist/chunk-RK6F44Y6.js.map +1 -0
  280. package/dist/chunk-RRF5UOBJ.js +91 -0
  281. package/dist/chunk-RXDLTSWT.js +124 -0
  282. package/dist/chunk-RXDLTSWT.js.map +1 -0
  283. package/dist/chunk-RYED3SPJ.js +42 -0
  284. package/dist/chunk-RYED3SPJ.js.map +1 -0
  285. package/dist/chunk-S7KDBTWT.js +106 -0
  286. package/dist/chunk-S7KDBTWT.js.map +1 -0
  287. package/dist/chunk-SEDEKFYQ.js +1 -0
  288. package/dist/chunk-SOAU2OE2.js +125 -0
  289. package/dist/chunk-SOAU2OE2.js.map +1 -0
  290. package/dist/chunk-TECVW3JP.js +36 -0
  291. package/dist/chunk-TECVW3JP.js.map +1 -0
  292. package/dist/chunk-TFO23QT4.js +88 -0
  293. package/dist/chunk-TFO23QT4.js.map +1 -0
  294. package/dist/chunk-TK4UEOSK.js +76 -0
  295. package/dist/chunk-TK4UEOSK.js.map +1 -0
  296. package/dist/chunk-TKWGAOLV.js +122 -0
  297. package/dist/chunk-TKWGAOLV.js.map +1 -0
  298. package/dist/chunk-TMM4S4IJ.js +597 -0
  299. package/dist/chunk-TMM4S4IJ.js.map +1 -0
  300. package/dist/chunk-TMQLARTH.js +188 -0
  301. package/dist/chunk-TMQLARTH.js.map +1 -0
  302. package/dist/chunk-TPDBFYEG.js +130 -0
  303. package/dist/chunk-TPDBFYEG.js.map +1 -0
  304. package/dist/chunk-TPMQ3G6Z.js +145 -0
  305. package/dist/chunk-TPMQ3G6Z.js.map +1 -0
  306. package/dist/chunk-TZOLIGIG.js +61 -0
  307. package/dist/chunk-TZOLIGIG.js.map +1 -0
  308. package/dist/chunk-U3PN77QT.js +113 -0
  309. package/dist/chunk-U3WSW6PZ.js +277 -0
  310. package/dist/chunk-U4SCL7B7.js +640 -0
  311. package/dist/chunk-U4SCL7B7.js.map +1 -0
  312. package/dist/chunk-UWK5OXUJ.js +156 -0
  313. package/dist/chunk-UWK5OXUJ.js.map +1 -0
  314. package/dist/chunk-UWVJF25J.js +74 -0
  315. package/dist/chunk-UXHQAFNA.js +1317 -0
  316. package/dist/chunk-UXHQAFNA.js.map +1 -0
  317. package/dist/chunk-V5OCT34X.js +1 -0
  318. package/dist/chunk-V5OCT34X.js.map +1 -0
  319. package/dist/chunk-VLXA6PI2.js +304 -0
  320. package/dist/chunk-VLXA6PI2.js.map +1 -0
  321. package/dist/chunk-VNO6ZJ35.js +500 -0
  322. package/dist/chunk-VNO6ZJ35.js.map +1 -0
  323. package/dist/chunk-VW676BEI.js +827 -0
  324. package/dist/chunk-VW676BEI.js.map +1 -0
  325. package/dist/chunk-VWT3F4IV.js +2161 -0
  326. package/dist/chunk-VWT3F4IV.js.map +1 -0
  327. package/dist/chunk-W3LR522O.js +2296 -0
  328. package/dist/chunk-W3LR522O.js.map +1 -0
  329. package/dist/chunk-W4L6CZKA.js +96 -0
  330. package/dist/chunk-W4L6CZKA.js.map +1 -0
  331. package/dist/chunk-W4RVMTHR.js +372 -0
  332. package/dist/chunk-W4RVMTHR.js.map +1 -0
  333. package/dist/chunk-WEHSQBFR.js +188 -0
  334. package/dist/chunk-WEHSQBFR.js.map +1 -0
  335. package/dist/chunk-WELDCG6C.js +380 -0
  336. package/dist/chunk-WELDCG6C.js.map +1 -0
  337. package/dist/chunk-WZYKANL3.js +2800 -0
  338. package/dist/chunk-WZYKANL3.js.map +1 -0
  339. package/dist/chunk-XIG5PDM7.js +48 -0
  340. package/dist/chunk-XJNBEDFE.js +193 -0
  341. package/dist/chunk-XJNBEDFE.js.map +1 -0
  342. package/dist/chunk-XVVIG67A.js +291 -0
  343. package/dist/chunk-XVVIG67A.js.map +1 -0
  344. package/dist/chunk-XVZ7B3HG.js +135 -0
  345. package/dist/chunk-YBPYIAA5.js +73 -0
  346. package/dist/chunk-YBPYIAA5.js.map +1 -0
  347. package/dist/chunk-Z734BLO3.js +21 -0
  348. package/dist/chunk-Z734BLO3.js.map +1 -0
  349. package/dist/chunk-ZKSK55RC.js +269 -0
  350. package/dist/chunk-ZKSK55RC.js.map +1 -0
  351. package/dist/chunk-ZTFCYYEZ.js +69 -0
  352. package/dist/chunk-ZTFCYYEZ.js.map +1 -0
  353. package/dist/chunk-ZY2MNJR6.js +329 -0
  354. package/dist/chunk-ZY2MNJR6.js.map +1 -0
  355. package/dist/cli-D3VpkVwB.d.ts +1136 -0
  356. package/dist/cli.d.ts +42 -10
  357. package/dist/cli.js +121 -58
  358. package/dist/codex-cli-fallback.d.ts +1 -0
  359. package/dist/codex-cli-fallback.js +1 -1
  360. package/dist/commitment-ledger.js +1 -1
  361. package/dist/compat/checks.d.ts +5 -0
  362. package/dist/compat/checks.js +11 -0
  363. package/dist/compat/checks.js.map +1 -0
  364. package/dist/compat/types.d.ts +30 -0
  365. package/dist/compat/types.js +1 -0
  366. package/dist/compat/types.js.map +1 -0
  367. package/dist/compounding/engine.d.ts +221 -0
  368. package/dist/compounding/engine.js +32 -0
  369. package/dist/compounding/engine.js.map +1 -0
  370. package/dist/compounding/preference-consolidator.d.ts +92 -0
  371. package/dist/compounding/preference-consolidator.js +553 -0
  372. package/dist/compounding/preference-consolidator.js.map +1 -0
  373. package/dist/compression-optimizer.d.ts +1 -1
  374. package/dist/config.d.ts +5 -3
  375. package/dist/config.js +9 -4
  376. package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
  377. package/dist/connectors/codex-materialize-runner.d.ts +64 -0
  378. package/dist/connectors/codex-materialize-runner.js +33 -0
  379. package/dist/connectors/codex-materialize-runner.js.map +1 -0
  380. package/dist/connectors/codex-materialize.d.ts +195 -0
  381. package/dist/connectors/codex-materialize.js +38 -0
  382. package/dist/connectors/codex-materialize.js.map +1 -0
  383. package/dist/connectors/index.d.ts +444 -0
  384. package/dist/connectors/index.js +115 -0
  385. package/dist/connectors/index.js.map +1 -0
  386. package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
  387. package/dist/connectors-cli.d.ts +1 -1
  388. package/dist/consolidation-provenance-check.d.ts +4 -2
  389. package/dist/consolidation-undo.d.ts +4 -2
  390. package/dist/contradiction/index.d.ts +258 -0
  391. package/dist/contradiction/index.js +43 -0
  392. package/dist/contradiction/index.js.map +1 -0
  393. package/dist/contradiction-review-ATP4S6IC.js +30 -0
  394. package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
  395. package/dist/contradiction-scan-5A4IDZV5.js +13 -0
  396. package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
  397. package/dist/conversation-index/backend.d.ts +97 -0
  398. package/dist/conversation-index/backend.js +13 -0
  399. package/dist/conversation-index/backend.js.map +1 -0
  400. package/dist/conversation-index/chunker.d.ts +16 -0
  401. package/dist/conversation-index/chunker.js +8 -0
  402. package/dist/conversation-index/chunker.js.map +1 -0
  403. package/dist/conversation-index/cleanup.d.ts +11 -0
  404. package/dist/conversation-index/cleanup.js +9 -0
  405. package/dist/conversation-index/cleanup.js.map +1 -0
  406. package/dist/conversation-index/faiss-adapter.d.ts +6 -0
  407. package/dist/conversation-index/faiss-adapter.js +16 -0
  408. package/dist/conversation-index/faiss-adapter.js.map +1 -0
  409. package/dist/conversation-index/indexer.d.ts +23 -0
  410. package/dist/conversation-index/indexer.js +15 -0
  411. package/dist/conversation-index/indexer.js.map +1 -0
  412. package/dist/conversation-index/search.d.ts +6 -0
  413. package/dist/conversation-index/search.js +11 -0
  414. package/dist/conversation-index/search.js.map +1 -0
  415. package/dist/day-summary.d.ts +1 -1
  416. package/dist/delinearize.d.ts +1 -1
  417. package/dist/direct-answer-wiring.d.ts +1 -1
  418. package/dist/direct-answer-wiring.js +1 -1
  419. package/dist/direct-answer.d.ts +1 -1
  420. package/dist/embedding-fallback.d.ts +1 -1
  421. package/dist/embedding-fallback.js +2 -2
  422. package/dist/enrichment/index.d.ts +163 -0
  423. package/dist/enrichment/index.js +18 -0
  424. package/dist/enrichment/index.js.map +1 -0
  425. package/dist/entity-retrieval.d.ts +4 -2
  426. package/dist/entity-retrieval.js +9 -6
  427. package/dist/entity-schema.d.ts +1 -1
  428. package/dist/evals.js +1 -1
  429. package/dist/event-order-recall.d.ts +17 -0
  430. package/dist/event-order-recall.js +11 -0
  431. package/dist/event-order-recall.js.map +1 -0
  432. package/dist/evidence-pack.d.ts +3 -1
  433. package/dist/evidence-pack.js +5 -3
  434. package/dist/explicit-capture.d.ts +23 -6
  435. package/dist/explicit-capture.js +2 -2
  436. package/dist/explicit-cue-recall.d.ts +4 -1
  437. package/dist/explicit-cue-recall.js +4 -2
  438. package/dist/extraction-judge-telemetry.d.ts +1 -1
  439. package/dist/extraction-judge-training.d.ts +1 -1
  440. package/dist/extraction-judge-training.js +1 -1
  441. package/dist/extraction-judge.d.ts +1 -1
  442. package/dist/extraction.d.ts +1 -1
  443. package/dist/extraction.js +11 -10
  444. package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
  445. package/dist/fallback-llm.d.ts +4 -1
  446. package/dist/fallback-llm.js +6 -6
  447. package/dist/focused-list-recall.d.ts +17 -0
  448. package/dist/focused-list-recall.js +11 -0
  449. package/dist/focused-list-recall.js.map +1 -0
  450. package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
  451. package/dist/identity-continuity.d.ts +1 -1
  452. package/dist/importance.d.ts +1 -1
  453. package/dist/index-DJ9QWMw-.d.ts +35 -0
  454. package/dist/index.d.ts +107 -715
  455. package/dist/index.js +657 -2611
  456. package/dist/index.js.map +1 -1
  457. package/dist/intent.d.ts +1 -1
  458. package/dist/intent.js +1 -1
  459. package/dist/lcm/archive.d.ts +89 -0
  460. package/dist/lcm/archive.js +12 -0
  461. package/dist/lcm/archive.js.map +1 -0
  462. package/dist/lcm/dag.d.ts +48 -0
  463. package/dist/lcm/dag.js +8 -0
  464. package/dist/lcm/dag.js.map +1 -0
  465. package/dist/lcm/engine.d.ts +116 -0
  466. package/dist/lcm/engine.js +20 -0
  467. package/dist/lcm/engine.js.map +1 -0
  468. package/dist/lcm/index.d.ts +12 -0
  469. package/dist/lcm/index.js +44 -0
  470. package/dist/lcm/index.js.map +1 -0
  471. package/dist/lcm/queue.d.ts +62 -0
  472. package/dist/lcm/queue.js +8 -0
  473. package/dist/lcm/queue.js.map +1 -0
  474. package/dist/lcm/recall.d.ts +20 -0
  475. package/dist/lcm/recall.js +8 -0
  476. package/dist/lcm/recall.js.map +1 -0
  477. package/dist/lcm/schema.d.ts +16 -0
  478. package/dist/lcm/schema.js +14 -0
  479. package/dist/lcm/schema.js.map +1 -0
  480. package/dist/lcm/summarizer.d.ts +38 -0
  481. package/dist/lcm/summarizer.js +12 -0
  482. package/dist/lcm/summarizer.js.map +1 -0
  483. package/dist/lcm/tools.d.ts +29 -0
  484. package/dist/lcm/tools.js +8 -0
  485. package/dist/lcm/tools.js.map +1 -0
  486. package/dist/lifecycle.d.ts +1 -1
  487. package/dist/live-connectors-runner.d.ts +1 -1
  488. package/dist/live-connectors-runner.js +5 -5
  489. package/dist/local-llm.d.ts +8 -4
  490. package/dist/local-llm.js +3 -3
  491. package/dist/maintenance/archive-observations.d.ts +18 -0
  492. package/dist/maintenance/archive-observations.js +8 -0
  493. package/dist/maintenance/archive-observations.js.map +1 -0
  494. package/dist/maintenance/backup-stamp.d.ts +3 -0
  495. package/dist/maintenance/backup-stamp.js +8 -0
  496. package/dist/maintenance/backup-stamp.js.map +1 -0
  497. package/dist/maintenance/memory-governance-cron.d.ts +85 -0
  498. package/dist/maintenance/memory-governance-cron.js +22 -0
  499. package/dist/maintenance/memory-governance-cron.js.map +1 -0
  500. package/dist/maintenance/memory-governance.d.ts +137 -0
  501. package/dist/maintenance/memory-governance.js +40 -0
  502. package/dist/maintenance/memory-governance.js.map +1 -0
  503. package/dist/maintenance/migrate-observations.d.ts +18 -0
  504. package/dist/maintenance/migrate-observations.js +9 -0
  505. package/dist/maintenance/migrate-observations.js.map +1 -0
  506. package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
  507. package/dist/maintenance/observation-ledger-utils.js +10 -0
  508. package/dist/maintenance/observation-ledger-utils.js.map +1 -0
  509. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
  510. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
  511. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
  512. package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
  513. package/dist/maintenance/rebuild-memory-projection.js +35 -0
  514. package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
  515. package/dist/maintenance/rebuild-observations.d.ts +17 -0
  516. package/dist/maintenance/rebuild-observations.js +9 -0
  517. package/dist/maintenance/rebuild-observations.js.map +1 -0
  518. package/dist/mcp-memory-inspector-app.d.ts +124 -0
  519. package/dist/mcp-memory-inspector-app.js +20 -0
  520. package/dist/mcp-memory-inspector-app.js.map +1 -0
  521. package/dist/memory-action-policy.d.ts +1 -1
  522. package/dist/memory-cache.d.ts +1 -1
  523. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  524. package/dist/memory-projection-store.d.ts +108 -3
  525. package/dist/memory-projection-store.js +2 -1
  526. package/dist/memory-provenance.d.ts +57 -0
  527. package/dist/memory-provenance.js +13 -0
  528. package/dist/memory-provenance.js.map +1 -0
  529. package/dist/memory-worth-outcomes.d.ts +4 -2
  530. package/dist/migrate/from-engram.d.ts +24 -0
  531. package/dist/migrate/from-engram.js +12 -0
  532. package/dist/migrate/from-engram.js.map +1 -0
  533. package/dist/models-json.d.ts +1 -1
  534. package/dist/namespaces/migrate.d.ts +50 -0
  535. package/dist/namespaces/migrate.js +50 -0
  536. package/dist/namespaces/migrate.js.map +1 -0
  537. package/dist/namespaces/principal.d.ts +17 -0
  538. package/dist/namespaces/principal.js +16 -0
  539. package/dist/namespaces/principal.js.map +1 -0
  540. package/dist/namespaces/search.d.ts +46 -0
  541. package/dist/namespaces/search.js +28 -0
  542. package/dist/namespaces/search.js.map +1 -0
  543. package/dist/namespaces/storage.d.ts +32 -0
  544. package/dist/namespaces/storage.js +28 -0
  545. package/dist/namespaces/storage.js.map +1 -0
  546. package/dist/native-knowledge.d.ts +1 -1
  547. package/dist/network/tailscale.d.ts +41 -0
  548. package/dist/network/tailscale.js +9 -0
  549. package/dist/network/tailscale.js.map +1 -0
  550. package/dist/network/webdav.d.ts +39 -0
  551. package/dist/network/webdav.js +10 -0
  552. package/dist/network/webdav.js.map +1 -0
  553. package/dist/objective-state-writers.d.ts +1 -1
  554. package/dist/objective-state-writers.js +2 -2
  555. package/dist/operator-toolkit.d.ts +4 -2
  556. package/dist/operator-toolkit.js +35 -17
  557. package/dist/opik-exporter.js +2 -2
  558. package/dist/opik-exporter.js.map +1 -1
  559. package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
  560. package/dist/orchestrator.d.ts +24 -7
  561. package/dist/orchestrator.js +107 -65
  562. package/dist/path-MR5JPYOP.js +9 -0
  563. package/dist/path-MR5JPYOP.js.map +1 -0
  564. package/dist/patterns-cli.d.ts +1 -1
  565. package/dist/policy-runtime.d.ts +1 -1
  566. package/dist/qmd-recall-cache.d.ts +2 -2
  567. package/dist/qmd.d.ts +103 -4
  568. package/dist/qmd.js +23 -5
  569. package/dist/recall-disclosure-escalation.d.ts +1 -1
  570. package/dist/recall-explain-renderer.d.ts +3 -1
  571. package/dist/recall-explain-renderer.js +5 -3
  572. package/dist/recall-state.d.ts +1 -1
  573. package/dist/recall-tag-filter.d.ts +3 -1
  574. package/dist/recall-xray-cli.d.ts +3 -1
  575. package/dist/recall-xray-cli.js +6 -4
  576. package/dist/recall-xray-renderer.d.ts +3 -1
  577. package/dist/recall-xray-renderer.js +5 -3
  578. package/dist/recall-xray.d.ts +8 -1
  579. package/dist/recall-xray.js +4 -2
  580. package/dist/replay/normalizers/chatgpt.d.ts +6 -0
  581. package/dist/replay/normalizers/chatgpt.js +11 -0
  582. package/dist/replay/normalizers/chatgpt.js.map +1 -0
  583. package/dist/replay/normalizers/claude.d.ts +6 -0
  584. package/dist/replay/normalizers/claude.js +11 -0
  585. package/dist/replay/normalizers/claude.js.map +1 -0
  586. package/dist/replay/normalizers/openclaw.d.ts +6 -0
  587. package/dist/replay/normalizers/openclaw.js +11 -0
  588. package/dist/replay/normalizers/openclaw.js.map +1 -0
  589. package/dist/replay/normalizers/shared.d.ts +16 -0
  590. package/dist/replay/normalizers/shared.js +14 -0
  591. package/dist/replay/normalizers/shared.js.map +1 -0
  592. package/dist/replay/runner.d.ts +35 -0
  593. package/dist/replay/runner.js +16 -0
  594. package/dist/replay/runner.js.map +1 -0
  595. package/dist/replay/types.d.ts +57 -0
  596. package/dist/replay/types.js +19 -0
  597. package/dist/replay/types.js.map +1 -0
  598. package/dist/resolution-B7FNQSSP.js +12 -0
  599. package/dist/resolution-B7FNQSSP.js.map +1 -0
  600. package/dist/resolve-auth-token.d.ts +1 -1
  601. package/dist/resolve-provider-secret.js +2 -2
  602. package/dist/response-guidance-recall.d.ts +18 -0
  603. package/dist/response-guidance-recall.js +11 -0
  604. package/dist/response-guidance-recall.js.map +1 -0
  605. package/dist/resume-bundles.js +7 -5
  606. package/dist/retrieval-agents.d.ts +2 -2
  607. package/dist/retrieval-tiers.d.ts +1 -1
  608. package/dist/routing/engine.d.ts +35 -0
  609. package/dist/routing/engine.js +16 -0
  610. package/dist/routing/engine.js.map +1 -0
  611. package/dist/routing/store.d.ts +27 -0
  612. package/dist/routing/store.js +10 -0
  613. package/dist/routing/store.js.map +1 -0
  614. package/dist/runtime/better-sqlite.d.ts +8 -0
  615. package/dist/runtime/better-sqlite.js +10 -0
  616. package/dist/runtime/better-sqlite.js.map +1 -0
  617. package/dist/runtime/child-process.d.ts +32 -0
  618. package/dist/runtime/child-process.js +10 -0
  619. package/dist/runtime/child-process.js.map +1 -0
  620. package/dist/runtime/env.d.ts +5 -0
  621. package/dist/runtime/env.js +12 -0
  622. package/dist/runtime/env.js.map +1 -0
  623. package/dist/sdk-compat.js +1 -1
  624. package/dist/search/document-scanner.d.ts +22 -0
  625. package/dist/search/document-scanner.js +8 -0
  626. package/dist/search/document-scanner.js.map +1 -0
  627. package/dist/search/embed-helper.d.ts +35 -0
  628. package/dist/search/embed-helper.js +9 -0
  629. package/dist/search/embed-helper.js.map +1 -0
  630. package/dist/search/factory.d.ts +32 -0
  631. package/dist/search/factory.js +29 -0
  632. package/dist/search/factory.js.map +1 -0
  633. package/dist/search/index.d.ts +15 -0
  634. package/dist/search/index.js +50 -0
  635. package/dist/search/index.js.map +1 -0
  636. package/dist/search/lancedb-backend.d.ts +51 -0
  637. package/dist/search/lancedb-backend.js +10 -0
  638. package/dist/search/lancedb-backend.js.map +1 -0
  639. package/dist/search/meilisearch-backend.d.ts +48 -0
  640. package/dist/search/meilisearch-backend.js +10 -0
  641. package/dist/search/meilisearch-backend.js.map +1 -0
  642. package/dist/search/noop-backend.d.ts +26 -0
  643. package/dist/search/noop-backend.js +8 -0
  644. package/dist/search/noop-backend.js.map +1 -0
  645. package/dist/search/orama-backend.d.ts +53 -0
  646. package/dist/search/orama-backend.js +10 -0
  647. package/dist/search/orama-backend.js.map +1 -0
  648. package/dist/search/port.d.ts +61 -0
  649. package/dist/search/port.js +1 -0
  650. package/dist/search/port.js.map +1 -0
  651. package/dist/search/remote-backend.d.ts +39 -0
  652. package/dist/search/remote-backend.js +9 -0
  653. package/dist/search/remote-backend.js.map +1 -0
  654. package/dist/secure-store/index.d.ts +890 -0
  655. package/dist/secure-store/index.js +156 -0
  656. package/dist/secure-store/index.js.map +1 -0
  657. package/dist/semantic-VwGI14Ok.d.ts +69 -0
  658. package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
  659. package/dist/semantic-consolidation.d.ts +3 -3
  660. package/dist/semantic-consolidation.js +15 -8
  661. package/dist/semantic-rule-promotion.js +9 -6
  662. package/dist/semantic-rule-verifier.d.ts +1 -1
  663. package/dist/semantic-rule-verifier.js +10 -7
  664. package/dist/session-observer-bands.d.ts +1 -1
  665. package/dist/session-observer-state.d.ts +1 -1
  666. package/dist/shared-context/manager.d.ts +131 -0
  667. package/dist/shared-context/manager.js +15 -0
  668. package/dist/shared-context/manager.js.map +1 -0
  669. package/dist/signal.d.ts +1 -1
  670. package/dist/skills-registry.js +13 -1
  671. package/dist/skills-registry.js.map +1 -1
  672. package/dist/state-store-VZU2IA53.js +16 -0
  673. package/dist/state-store-VZU2IA53.js.map +1 -0
  674. package/dist/storage-paths.d.ts +9 -0
  675. package/dist/storage-paths.js +20 -0
  676. package/dist/storage-paths.js.map +1 -0
  677. package/dist/storage.d.ts +6 -2
  678. package/dist/storage.js +8 -5
  679. package/dist/summarizer.d.ts +6 -1
  680. package/dist/summarizer.js +11 -10
  681. package/dist/summary-snapshot.d.ts +1 -1
  682. package/dist/summary-snapshot.js +2 -1
  683. package/dist/surfaces/dreams.d.ts +16 -0
  684. package/dist/surfaces/dreams.js +282 -0
  685. package/dist/surfaces/dreams.js.map +1 -0
  686. package/dist/surfaces/heartbeat.d.ts +17 -0
  687. package/dist/surfaces/heartbeat.js +265 -0
  688. package/dist/surfaces/heartbeat.js.map +1 -0
  689. package/dist/targeted-fact-recall.d.ts +17 -0
  690. package/dist/targeted-fact-recall.js +11 -0
  691. package/dist/targeted-fact-recall.js.map +1 -0
  692. package/dist/telemetry-transcript.d.ts +7 -0
  693. package/dist/telemetry-transcript.js +16 -0
  694. package/dist/telemetry-transcript.js.map +1 -0
  695. package/dist/temporal-supersession.d.ts +4 -2
  696. package/dist/temporal-supersession.js +2 -1
  697. package/dist/temporal-validity.d.ts +1 -1
  698. package/dist/threading.d.ts +6 -1
  699. package/dist/threading.js +2 -1
  700. package/dist/tier-migration.d.ts +5 -3
  701. package/dist/tier-routing.d.ts +1 -1
  702. package/dist/tokens.js +2 -2
  703. package/dist/topics.d.ts +1 -1
  704. package/dist/transcript.d.ts +16 -2
  705. package/dist/transcript.js +2 -1
  706. package/dist/transfer/autodetect.d.ts +4 -0
  707. package/dist/transfer/autodetect.js +15 -0
  708. package/dist/transfer/autodetect.js.map +1 -0
  709. package/dist/transfer/backup.d.ts +21 -0
  710. package/dist/transfer/backup.js +17 -0
  711. package/dist/transfer/backup.js.map +1 -0
  712. package/dist/transfer/capsule-export.d.ts +113 -0
  713. package/dist/transfer/capsule-export.js +19 -0
  714. package/dist/transfer/capsule-export.js.map +1 -0
  715. package/dist/transfer/capsule-import.d.ts +124 -0
  716. package/dist/transfer/capsule-import.js +16 -0
  717. package/dist/transfer/capsule-import.js.map +1 -0
  718. package/dist/transfer/constants.d.ts +13 -0
  719. package/dist/transfer/constants.js +12 -0
  720. package/dist/transfer/constants.js.map +1 -0
  721. package/dist/transfer/export-json.d.ts +11 -0
  722. package/dist/transfer/export-json.js +11 -0
  723. package/dist/transfer/export-json.js.map +1 -0
  724. package/dist/transfer/export-md.d.ts +10 -0
  725. package/dist/transfer/export-md.js +13 -0
  726. package/dist/transfer/export-md.js.map +1 -0
  727. package/dist/transfer/export-sqlite.d.ts +9 -0
  728. package/dist/transfer/export-sqlite.js +12 -0
  729. package/dist/transfer/export-sqlite.js.map +1 -0
  730. package/dist/transfer/fs-utils.d.ts +61 -0
  731. package/dist/transfer/fs-utils.js +40 -0
  732. package/dist/transfer/fs-utils.js.map +1 -0
  733. package/dist/transfer/import-json.d.ts +16 -0
  734. package/dist/transfer/import-json.js +13 -0
  735. package/dist/transfer/import-json.js.map +1 -0
  736. package/dist/transfer/import-md.d.ts +14 -0
  737. package/dist/transfer/import-md.js +11 -0
  738. package/dist/transfer/import-md.js.map +1 -0
  739. package/dist/transfer/import-sqlite.d.ts +14 -0
  740. package/dist/transfer/import-sqlite.js +12 -0
  741. package/dist/transfer/import-sqlite.js.map +1 -0
  742. package/dist/transfer/sqlite-schema.d.ts +4 -0
  743. package/dist/transfer/sqlite-schema.js +10 -0
  744. package/dist/transfer/sqlite-schema.js.map +1 -0
  745. package/dist/transfer/types.d.ts +916 -0
  746. package/dist/transfer/types.js +30 -0
  747. package/dist/transfer/types.js.map +1 -0
  748. package/dist/trust-zones.d.ts +3 -2
  749. package/dist/trust-zones.js +1 -1
  750. package/dist/types.d.ts +88 -3
  751. package/dist/types.js +1 -1
  752. package/dist/user-model.d.ts +37 -0
  753. package/dist/user-model.js +28 -0
  754. package/dist/user-model.js.map +1 -0
  755. package/dist/utility-runtime.d.ts +1 -1
  756. package/dist/verified-recall.js +11 -8
  757. package/dist/work/board.d.ts +43 -0
  758. package/dist/work/board.js +14 -0
  759. package/dist/work/board.js.map +1 -0
  760. package/dist/work/boundary.d.ts +8 -0
  761. package/dist/work/boundary.js +14 -0
  762. package/dist/work/boundary.js.map +1 -0
  763. package/dist/work/storage.d.ts +39 -0
  764. package/dist/work/storage.js +11 -0
  765. package/dist/work/storage.js.map +1 -0
  766. package/dist/work/types.d.ts +75 -0
  767. package/dist/work/types.js +1 -0
  768. package/dist/work/types.js.map +1 -0
  769. package/package.json +2767 -6
  770. package/scripts/faiss_index.py +816 -0
  771. package/scripts/faiss_requirements.txt +3 -0
  772. package/skills/remnic-entities/SKILL.md +51 -0
  773. package/skills/remnic-memory-workflow/SKILL.md +61 -0
  774. package/skills/remnic-recall/SKILL.md +51 -0
  775. package/skills/remnic-remember/SKILL.md +56 -0
  776. package/skills/remnic-search/SKILL.md +51 -0
  777. package/skills/remnic-status/SKILL.md +51 -0
  778. package/src/abort-error.test.ts +49 -0
  779. package/src/abort-error.ts +46 -0
  780. package/src/abstraction-nodes.ts +162 -0
  781. package/src/access-audit.test.ts +178 -0
  782. package/src/access-audit.ts +125 -0
  783. package/src/access-cli.test.ts +439 -0
  784. package/src/access-cli.ts +438 -0
  785. package/src/access-http.test.ts +225 -0
  786. package/src/access-http.ts +1899 -0
  787. package/src/access-idempotency.ts +232 -0
  788. package/src/access-mcp.test.ts +568 -0
  789. package/src/access-mcp.ts +3056 -0
  790. package/src/access-schema-pi.test.ts +60 -0
  791. package/src/access-schema.ts +522 -0
  792. package/src/access-service-namespace.test.ts +123 -0
  793. package/src/access-service.ts +5629 -0
  794. package/src/action-confidence.test.ts +206 -0
  795. package/src/action-confidence.ts +466 -0
  796. package/src/active-memory-bridge.test.ts +285 -0
  797. package/src/active-memory-bridge.ts +217 -0
  798. package/src/active-recall.test.ts +484 -0
  799. package/src/active-recall.ts +459 -0
  800. package/src/adapters/claude-code.ts +56 -0
  801. package/src/adapters/codex.ts +57 -0
  802. package/src/adapters/hermes.ts +64 -0
  803. package/src/adapters/index.ts +6 -0
  804. package/src/adapters/registry.ts +41 -0
  805. package/src/adapters/replit.ts +55 -0
  806. package/src/adapters/types.ts +51 -0
  807. package/src/behavior-learner.ts +144 -0
  808. package/src/behavior-signals.ts +73 -0
  809. package/src/binary-lifecycle/backend.ts +117 -0
  810. package/src/binary-lifecycle/index.ts +35 -0
  811. package/src/binary-lifecycle/manifest.ts +79 -0
  812. package/src/binary-lifecycle/pipeline.ts +352 -0
  813. package/src/binary-lifecycle/scanner.ts +89 -0
  814. package/src/binary-lifecycle/types.ts +89 -0
  815. package/src/bootstrap.ts +178 -0
  816. package/src/boxes.ts +521 -0
  817. package/src/briefing.test.ts +1535 -0
  818. package/src/briefing.ts +1382 -0
  819. package/src/buffer-session.test.ts +443 -0
  820. package/src/buffer-surprise-report.ts +176 -0
  821. package/src/buffer-surprise-telemetry.test.ts +606 -0
  822. package/src/buffer-surprise-trigger.test.ts +766 -0
  823. package/src/buffer-surprise.test.ts +339 -0
  824. package/src/buffer-surprise.ts +203 -0
  825. package/src/buffer.ts +900 -0
  826. package/src/bulk-import/cli-command.test.ts +204 -0
  827. package/src/bulk-import/index.ts +34 -0
  828. package/src/bulk-import/pipeline.test.ts +445 -0
  829. package/src/bulk-import/pipeline.ts +178 -0
  830. package/src/bulk-import/registry.test.ts +151 -0
  831. package/src/bulk-import/registry.ts +72 -0
  832. package/src/bulk-import/types.test.ts +272 -0
  833. package/src/bulk-import/types.ts +145 -0
  834. package/src/calibration.ts +394 -0
  835. package/src/capsule-cli.test.ts +398 -0
  836. package/src/capsule-cli.ts +565 -0
  837. package/src/causal-behavior.ts +308 -0
  838. package/src/causal-chain.ts +419 -0
  839. package/src/causal-consolidation.ts +370 -0
  840. package/src/causal-retrieval.ts +286 -0
  841. package/src/causal-trajectory-graph.ts +60 -0
  842. package/src/causal-trajectory.ts +303 -0
  843. package/src/chunking.ts +220 -0
  844. package/src/citations.ts +232 -0
  845. package/src/cli.ts +9403 -0
  846. package/src/codex-cli-fallback.ts +162 -0
  847. package/src/codex-thread-key.ts +1 -0
  848. package/src/coding/access-coding-context.test.ts +197 -0
  849. package/src/coding/coding-branch-scope.test.ts +281 -0
  850. package/src/coding/coding-namespace.test.ts +360 -0
  851. package/src/coding/coding-namespace.ts +412 -0
  852. package/src/coding/coding-orchestrator.test.ts +249 -0
  853. package/src/coding/git-context.test.ts +507 -0
  854. package/src/coding/git-context.ts +336 -0
  855. package/src/coding/mcp-set-coding-context.test.ts +174 -0
  856. package/src/coding/review-context.test.ts +316 -0
  857. package/src/coding/review-context.ts +349 -0
  858. package/src/coding/wire-coding-context.test.ts +468 -0
  859. package/src/commitment-ledger.test.ts +78 -0
  860. package/src/commitment-ledger.ts +337 -0
  861. package/src/compat/checks.test.ts +206 -0
  862. package/src/compat/checks.ts +716 -0
  863. package/src/compat/types.ts +33 -0
  864. package/src/compounding/engine.ts +1686 -0
  865. package/src/compounding/preference-consolidator.ts +778 -0
  866. package/src/compression-optimizer.ts +312 -0
  867. package/src/config.test.ts +930 -0
  868. package/src/config.ts +3807 -0
  869. package/src/connectors/codex/instructions.md +160 -0
  870. package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
  871. package/src/connectors/codex-marketplace.ts +500 -0
  872. package/src/connectors/codex-materialize-runner.ts +212 -0
  873. package/src/connectors/codex-materialize.ts +983 -0
  874. package/src/connectors/coerce.ts +62 -0
  875. package/src/connectors/index.test.ts +1570 -0
  876. package/src/connectors/index.ts +3222 -0
  877. package/src/connectors/live/framework.ts +164 -0
  878. package/src/connectors/live/github.test.ts +1218 -0
  879. package/src/connectors/live/github.ts +1068 -0
  880. package/src/connectors/live/gmail.test.ts +1706 -0
  881. package/src/connectors/live/gmail.ts +1293 -0
  882. package/src/connectors/live/google-drive.test.ts +696 -0
  883. package/src/connectors/live/google-drive.ts +724 -0
  884. package/src/connectors/live/index.ts +101 -0
  885. package/src/connectors/live/live-connectors.test.ts +689 -0
  886. package/src/connectors/live/notion.test.ts +1109 -0
  887. package/src/connectors/live/notion.ts +978 -0
  888. package/src/connectors/live/registry.ts +103 -0
  889. package/src/connectors/live/state-store.ts +399 -0
  890. package/src/connectors/live/transient-errors.ts +150 -0
  891. package/src/connectors/weclone-installer.test.ts +850 -0
  892. package/src/connectors-cli.ts +513 -0
  893. package/src/console/state.test.ts +224 -0
  894. package/src/console/state.ts +514 -0
  895. package/src/console/trace.test.ts +813 -0
  896. package/src/console/trace.ts +603 -0
  897. package/src/console/tui.test.ts +582 -0
  898. package/src/console/tui.ts +508 -0
  899. package/src/consolidation-operator.ts +182 -0
  900. package/src/consolidation-provenance-check.ts +551 -0
  901. package/src/consolidation-undo.ts +718 -0
  902. package/src/contradiction/contradiction-judge.test.ts +189 -0
  903. package/src/contradiction/contradiction-judge.ts +333 -0
  904. package/src/contradiction/contradiction-review.ts +574 -0
  905. package/src/contradiction/contradiction-scan.ts +504 -0
  906. package/src/contradiction/contradiction.test.ts +2230 -0
  907. package/src/contradiction/index.ts +37 -0
  908. package/src/contradiction/resolution.ts +383 -0
  909. package/src/conversation-index/backend.ts +323 -0
  910. package/src/conversation-index/chunker.ts +47 -0
  911. package/src/conversation-index/cleanup.ts +53 -0
  912. package/src/conversation-index/faiss-adapter.ts +384 -0
  913. package/src/conversation-index/indexer.test.ts +164 -0
  914. package/src/conversation-index/indexer.ts +192 -0
  915. package/src/conversation-index/search.ts +37 -0
  916. package/src/cross-namespace-budget.test.ts +275 -0
  917. package/src/cross-namespace-budget.ts +365 -0
  918. package/src/cue-anchors.ts +163 -0
  919. package/src/curation/index.ts +544 -0
  920. package/src/dashboard-runtime.ts +337 -0
  921. package/src/day-summary.ts +122 -0
  922. package/src/dedup/index.ts +330 -0
  923. package/src/dedup/semantic.test.ts +1577 -0
  924. package/src/dedup/semantic.ts +148 -0
  925. package/src/delinearize.ts +193 -0
  926. package/src/direct-answer-wiring.test.ts +473 -0
  927. package/src/direct-answer-wiring.ts +180 -0
  928. package/src/direct-answer.test.ts +484 -0
  929. package/src/direct-answer.ts +273 -0
  930. package/src/embedding-fallback.ts +565 -0
  931. package/src/enrichment/audit.ts +89 -0
  932. package/src/enrichment/index.ts +27 -0
  933. package/src/enrichment/pipeline.ts +197 -0
  934. package/src/enrichment/provider-registry.ts +85 -0
  935. package/src/enrichment/types.ts +100 -0
  936. package/src/enrichment/web-search-provider.ts +63 -0
  937. package/src/entity-retrieval.ts +774 -0
  938. package/src/entity-schema.ts +239 -0
  939. package/src/evals.ts +1312 -0
  940. package/src/event-order-recall.test.ts +4164 -0
  941. package/src/event-order-recall.ts +2802 -0
  942. package/src/evidence-pack.test.ts +89 -0
  943. package/src/evidence-pack.ts +388 -0
  944. package/src/explicit-capture.ts +530 -0
  945. package/src/explicit-cue-recall.test.ts +3019 -0
  946. package/src/explicit-cue-recall.ts +5545 -0
  947. package/src/extraction-judge-telemetry.ts +234 -0
  948. package/src/extraction-judge-training.ts +221 -0
  949. package/src/extraction-judge.ts +846 -0
  950. package/src/extraction-timeout.test.ts +265 -0
  951. package/src/extraction.ts +2719 -0
  952. package/src/fallback-llm.test.ts +1060 -0
  953. package/src/fallback-llm.ts +918 -0
  954. package/src/focused-list-recall.test.ts +734 -0
  955. package/src/focused-list-recall.ts +1160 -0
  956. package/src/graph-dashboard-diff.ts +35 -0
  957. package/src/graph-dashboard-key.ts +5 -0
  958. package/src/graph-dashboard-parser.ts +104 -0
  959. package/src/graph-edge-reinforcement.ts +192 -0
  960. package/src/graph-events.ts +151 -0
  961. package/src/graph-recall.test.ts +164 -0
  962. package/src/graph-recall.ts +189 -0
  963. package/src/graph-retrieval.test.ts +809 -0
  964. package/src/graph-retrieval.ts +823 -0
  965. package/src/graph-snapshot.ts +329 -0
  966. package/src/graph.ts +813 -0
  967. package/src/harmonic-retrieval.ts +223 -0
  968. package/src/himem.ts +154 -0
  969. package/src/hygiene.ts +87 -0
  970. package/src/identity-continuity.ts +333 -0
  971. package/src/importance.ts +328 -0
  972. package/src/importers/base.test.ts +294 -0
  973. package/src/importers/base.ts +436 -0
  974. package/src/importers/index.ts +21 -0
  975. package/src/index.ts +1204 -0
  976. package/src/intent.ts +154 -0
  977. package/src/json-extract.ts +85 -0
  978. package/src/json-store.ts +42 -0
  979. package/src/lcm/archive.ts +617 -0
  980. package/src/lcm/dag.ts +199 -0
  981. package/src/lcm/engine.ts +645 -0
  982. package/src/lcm/index.ts +7 -0
  983. package/src/lcm/queue.test.ts +178 -0
  984. package/src/lcm/queue.ts +200 -0
  985. package/src/lcm/recall.ts +117 -0
  986. package/src/lcm/schema.ts +154 -0
  987. package/src/lcm/summarizer.ts +235 -0
  988. package/src/lcm/tools.ts +191 -0
  989. package/src/lcm-engine.test.ts +660 -0
  990. package/src/legacy-hook-compat.test.ts +20 -0
  991. package/src/legacy-hook-compat.ts +45 -0
  992. package/src/lifecycle.ts +289 -0
  993. package/src/live-connectors-runner.ts +385 -0
  994. package/src/local-llm-qos.test.ts +303 -0
  995. package/src/local-llm-thinking.test.ts +292 -0
  996. package/src/local-llm.ts +1464 -0
  997. package/src/logger.ts +49 -0
  998. package/src/maintenance/archive-observations.ts +147 -0
  999. package/src/maintenance/backup-stamp.ts +3 -0
  1000. package/src/maintenance/dreams-ledger.ts +516 -0
  1001. package/src/maintenance/first-start-migration.ts +362 -0
  1002. package/src/maintenance/forget.test.ts +206 -0
  1003. package/src/maintenance/forget.ts +126 -0
  1004. package/src/maintenance/graph-edge-decay.test.ts +409 -0
  1005. package/src/maintenance/graph-edge-decay.ts +394 -0
  1006. package/src/maintenance/memory-governance-cron.ts +447 -0
  1007. package/src/maintenance/memory-governance.ts +1039 -0
  1008. package/src/maintenance/migrate-observations.ts +216 -0
  1009. package/src/maintenance/observation-ledger-utils.ts +54 -0
  1010. package/src/maintenance/pattern-reinforcement.test.ts +875 -0
  1011. package/src/maintenance/pattern-reinforcement.ts +369 -0
  1012. package/src/maintenance/purge.ts +334 -0
  1013. package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
  1014. package/src/maintenance/rebuild-memory-projection.ts +1234 -0
  1015. package/src/maintenance/rebuild-observations.ts +178 -0
  1016. package/src/maintenance/tier-stats.test.ts +378 -0
  1017. package/src/maintenance/tier-stats.ts +222 -0
  1018. package/src/mcp-memory-inspector-app.ts +421 -0
  1019. package/src/memory-action-policy.ts +80 -0
  1020. package/src/memory-cache.ts +208 -0
  1021. package/src/memory-extension/claude-code-publisher.ts +51 -0
  1022. package/src/memory-extension/codex-publisher.ts +149 -0
  1023. package/src/memory-extension/hermes-publisher.ts +51 -0
  1024. package/src/memory-extension/index.ts +100 -0
  1025. package/src/memory-extension/shared-instructions.ts +133 -0
  1026. package/src/memory-extension/types.ts +86 -0
  1027. package/src/memory-extension-host/host-discovery.ts +276 -0
  1028. package/src/memory-extension-host/index.ts +14 -0
  1029. package/src/memory-extension-host/render-extensions-block.ts +73 -0
  1030. package/src/memory-extension-host/types.ts +21 -0
  1031. package/src/memory-lifecycle-ledger-utils.ts +116 -0
  1032. package/src/memory-projection-format.ts +11 -0
  1033. package/src/memory-projection-store.ts +951 -0
  1034. package/src/memory-provenance.test.ts +196 -0
  1035. package/src/memory-provenance.ts +484 -0
  1036. package/src/memory-worth-bench.test.ts +71 -0
  1037. package/src/memory-worth-bench.ts +265 -0
  1038. package/src/memory-worth-filter.test.ts +209 -0
  1039. package/src/memory-worth-filter.ts +204 -0
  1040. package/src/memory-worth-frontmatter.test.ts +311 -0
  1041. package/src/memory-worth-outcomes.test.ts +316 -0
  1042. package/src/memory-worth-outcomes.ts +286 -0
  1043. package/src/memory-worth.test.ts +317 -0
  1044. package/src/memory-worth.ts +215 -0
  1045. package/src/message-parts/index.ts +806 -0
  1046. package/src/message-parts/message-parts.test.ts +421 -0
  1047. package/src/migrate/from-engram.ts +789 -0
  1048. package/src/model-registry.ts +313 -0
  1049. package/src/models-json.ts +76 -0
  1050. package/src/namespaces/migrate.ts +187 -0
  1051. package/src/namespaces/path.ts +25 -0
  1052. package/src/namespaces/principal.test.ts +195 -0
  1053. package/src/namespaces/principal.ts +86 -0
  1054. package/src/namespaces/search.test.ts +105 -0
  1055. package/src/namespaces/search.ts +233 -0
  1056. package/src/namespaces/storage.ts +74 -0
  1057. package/src/native-knowledge.ts +1823 -0
  1058. package/src/negative.ts +72 -0
  1059. package/src/network/tailscale.ts +179 -0
  1060. package/src/network/webdav.ts +385 -0
  1061. package/src/objective-state-writers.ts +951 -0
  1062. package/src/objective-state.ts +320 -0
  1063. package/src/onboarding/index.ts +529 -0
  1064. package/src/openai-chat-compat.ts +56 -0
  1065. package/src/operator-toolkit.ts +2132 -0
  1066. package/src/opik-exporter.test.ts +72 -0
  1067. package/src/opik-exporter.ts +587 -0
  1068. package/src/orchestrator-extraction-queue.test.ts +197 -0
  1069. package/src/orchestrator-flush.test.ts +1171 -0
  1070. package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
  1071. package/src/orchestrator-source-attribution.test.ts +701 -0
  1072. package/src/orchestrator.ts +16368 -0
  1073. package/src/page-versioning.ts +450 -0
  1074. package/src/patterns-cli.ts +574 -0
  1075. package/src/peers/index.ts +54 -0
  1076. package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
  1077. package/src/peers/migrate-from-identity-anchor.ts +350 -0
  1078. package/src/peers/peers.test.ts +419 -0
  1079. package/src/peers/profile-reasoner.ts +694 -0
  1080. package/src/peers/storage.ts +1350 -0
  1081. package/src/peers/types.ts +138 -0
  1082. package/src/plugin-id.ts +84 -0
  1083. package/src/policy-runtime.ts +209 -0
  1084. package/src/procedural/procedure-miner.ts +150 -0
  1085. package/src/procedural/procedure-recall.ts +93 -0
  1086. package/src/procedural/procedure-stats.ts +213 -0
  1087. package/src/procedural/procedure-types.ts +132 -0
  1088. package/src/procedural/reinforcement-core.test.ts +132 -0
  1089. package/src/procedural/reinforcement-core.ts +73 -0
  1090. package/src/profiling.test.ts +263 -0
  1091. package/src/profiling.ts +435 -0
  1092. package/src/projection/index.ts +398 -0
  1093. package/src/qmd-recall-cache.test.ts +138 -0
  1094. package/src/qmd-recall-cache.ts +111 -0
  1095. package/src/qmd.test.ts +257 -0
  1096. package/src/qmd.ts +2614 -0
  1097. package/src/reasoning-trace-recall.ts +201 -0
  1098. package/src/reasoning-trace-types.ts +235 -0
  1099. package/src/recall-audit-anomaly.test.ts +246 -0
  1100. package/src/recall-audit-anomaly.ts +297 -0
  1101. package/src/recall-audit.test.ts +51 -0
  1102. package/src/recall-audit.ts +72 -0
  1103. package/src/recall-budget-config.test.ts +87 -0
  1104. package/src/recall-disclosure-escalation.test.ts +196 -0
  1105. package/src/recall-disclosure-escalation.ts +158 -0
  1106. package/src/recall-disclosure-shaping.test.ts +146 -0
  1107. package/src/recall-disclosure.test.ts +214 -0
  1108. package/src/recall-explain-renderer.test.ts +140 -0
  1109. package/src/recall-explain-renderer.ts +356 -0
  1110. package/src/recall-mmr.test.ts +808 -0
  1111. package/src/recall-mmr.ts +607 -0
  1112. package/src/recall-qos.test.ts +85 -0
  1113. package/src/recall-qos.ts +82 -0
  1114. package/src/recall-query-policy.ts +221 -0
  1115. package/src/recall-state.test.ts +233 -0
  1116. package/src/recall-state.ts +456 -0
  1117. package/src/recall-tag-filter.ts +143 -0
  1118. package/src/recall-tokenization.ts +35 -0
  1119. package/src/recall-xray-cli.test.ts +118 -0
  1120. package/src/recall-xray-cli.ts +100 -0
  1121. package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
  1122. package/src/recall-xray-renderer.test.ts +539 -0
  1123. package/src/recall-xray-renderer.ts +487 -0
  1124. package/src/recall-xray.test.ts +503 -0
  1125. package/src/recall-xray.ts +621 -0
  1126. package/src/reconstruct.ts +41 -0
  1127. package/src/release-changelog.ts +35 -0
  1128. package/src/relevance.ts +67 -0
  1129. package/src/replay/normalizers/chatgpt.ts +133 -0
  1130. package/src/replay/normalizers/claude.ts +102 -0
  1131. package/src/replay/normalizers/openclaw.ts +119 -0
  1132. package/src/replay/normalizers/shared.ts +69 -0
  1133. package/src/replay/runner.ts +197 -0
  1134. package/src/replay/types.ts +143 -0
  1135. package/src/rerank.test.ts +48 -0
  1136. package/src/rerank.ts +176 -0
  1137. package/src/resolve-auth-token.test.ts +226 -0
  1138. package/src/resolve-auth-token.ts +151 -0
  1139. package/src/resolve-provider-secret.test.ts +187 -0
  1140. package/src/resolve-provider-secret.ts +410 -0
  1141. package/src/response-guidance-recall.test.ts +3952 -0
  1142. package/src/response-guidance-recall.ts +4431 -0
  1143. package/src/resume-bundles.ts +415 -0
  1144. package/src/retrieval-agents.ts +623 -0
  1145. package/src/retrieval-tiers.ts +25 -0
  1146. package/src/retrieval.ts +104 -0
  1147. package/src/review/index.test.ts +201 -0
  1148. package/src/review/index.ts +536 -0
  1149. package/src/routing/engine.ts +162 -0
  1150. package/src/routing/store.ts +321 -0
  1151. package/src/runtime/better-sqlite.test.ts +32 -0
  1152. package/src/runtime/better-sqlite.ts +76 -0
  1153. package/src/runtime/child-process.ts +67 -0
  1154. package/src/runtime/env.ts +48 -0
  1155. package/src/sanitize.ts +58 -0
  1156. package/src/schemas.ts +449 -0
  1157. package/src/sdk-compat.ts +87 -0
  1158. package/src/search/document-scanner.ts +96 -0
  1159. package/src/search/embed-helper.ts +142 -0
  1160. package/src/search/factory.ts +189 -0
  1161. package/src/search/index.ts +10 -0
  1162. package/src/search/lancedb-backend.ts +342 -0
  1163. package/src/search/meilisearch-backend.ts +232 -0
  1164. package/src/search/noop-backend.ts +57 -0
  1165. package/src/search/orama-backend.ts +358 -0
  1166. package/src/search/port.ts +86 -0
  1167. package/src/search/remote-backend.ts +124 -0
  1168. package/src/secure-store/cipher.ts +271 -0
  1169. package/src/secure-store/cli-handlers.ts +355 -0
  1170. package/src/secure-store/cli-renderer.ts +131 -0
  1171. package/src/secure-store/header.ts +373 -0
  1172. package/src/secure-store/index.ts +137 -0
  1173. package/src/secure-store/kdf.ts +263 -0
  1174. package/src/secure-store/keyring.ts +106 -0
  1175. package/src/secure-store/metadata.ts +394 -0
  1176. package/src/secure-store/passphrase-reader.ts +252 -0
  1177. package/src/secure-store/secure-fs.ts +571 -0
  1178. package/src/secure-store/secure-store.test.ts +755 -0
  1179. package/src/semantic-chunking.ts +545 -0
  1180. package/src/semantic-consolidation.test.ts +182 -0
  1181. package/src/semantic-consolidation.ts +432 -0
  1182. package/src/semantic-rule-promotion.ts +183 -0
  1183. package/src/semantic-rule-verifier.ts +160 -0
  1184. package/src/session-integrity.ts +569 -0
  1185. package/src/session-observer-bands.ts +11 -0
  1186. package/src/session-observer-state.ts +346 -0
  1187. package/src/session-toggles.test.ts +96 -0
  1188. package/src/session-toggles.ts +159 -0
  1189. package/src/shared-context/manager.ts +810 -0
  1190. package/src/signal.ts +84 -0
  1191. package/src/skills-registry.test.ts +277 -0
  1192. package/src/skills-registry.ts +120 -0
  1193. package/src/source-attribution-roundtrip.test.ts +215 -0
  1194. package/src/source-attribution.test.ts +1425 -0
  1195. package/src/source-attribution.ts +639 -0
  1196. package/src/spaces/index.ts +627 -0
  1197. package/src/storage-paths.ts +117 -0
  1198. package/src/storage.ts +6657 -0
  1199. package/src/store-contract.ts +55 -0
  1200. package/src/summarizer.ts +844 -0
  1201. package/src/summary-snapshot.test.ts +681 -0
  1202. package/src/summary-snapshot.ts +238 -0
  1203. package/src/surfaces/dreams.test.ts +394 -0
  1204. package/src/surfaces/dreams.ts +346 -0
  1205. package/src/surfaces/heartbeat.test.ts +415 -0
  1206. package/src/surfaces/heartbeat.ts +325 -0
  1207. package/src/sync/index.ts +308 -0
  1208. package/src/targeted-fact-recall.test.ts +1694 -0
  1209. package/src/targeted-fact-recall.ts +2905 -0
  1210. package/src/taxonomy/default-taxonomy.ts +87 -0
  1211. package/src/taxonomy/index.ts +26 -0
  1212. package/src/taxonomy/resolver-doc-generator.ts +57 -0
  1213. package/src/taxonomy/resolver.ts +184 -0
  1214. package/src/taxonomy/taxonomy-loader.ts +186 -0
  1215. package/src/taxonomy/types.ts +48 -0
  1216. package/src/telemetry-transcript.ts +70 -0
  1217. package/src/temporal-index.ts +890 -0
  1218. package/src/temporal-supersession.test.ts +2703 -0
  1219. package/src/temporal-supersession.ts +493 -0
  1220. package/src/temporal-validity.test.ts +448 -0
  1221. package/src/temporal-validity.ts +123 -0
  1222. package/src/threading.ts +395 -0
  1223. package/src/tier-migration.ts +124 -0
  1224. package/src/tier-routing.ts +102 -0
  1225. package/src/tmt.ts +462 -0
  1226. package/src/tokens.test.ts +178 -0
  1227. package/src/tokens.ts +279 -0
  1228. package/src/topics.ts +147 -0
  1229. package/src/training-export/cli-date-validation.test.ts +258 -0
  1230. package/src/training-export/converter.test.ts +452 -0
  1231. package/src/training-export/converter.ts +319 -0
  1232. package/src/training-export/date-parse.ts +117 -0
  1233. package/src/training-export/index.ts +26 -0
  1234. package/src/training-export/registry.test.ts +85 -0
  1235. package/src/training-export/registry.ts +57 -0
  1236. package/src/training-export/types.ts +31 -0
  1237. package/src/transcript.ts +1179 -0
  1238. package/src/transfer/autodetect.ts +30 -0
  1239. package/src/transfer/backup.ts +138 -0
  1240. package/src/transfer/capsule-crypto.ts +485 -0
  1241. package/src/transfer/capsule-encrypt.test.ts +690 -0
  1242. package/src/transfer/capsule-export.ts +543 -0
  1243. package/src/transfer/capsule-fork.ts +375 -0
  1244. package/src/transfer/capsule-import.ts +564 -0
  1245. package/src/transfer/capsule-merge.ts +433 -0
  1246. package/src/transfer/conflict-policy.ts +16 -0
  1247. package/src/transfer/constants.ts +13 -0
  1248. package/src/transfer/exclusions.ts +37 -0
  1249. package/src/transfer/export-json.ts +65 -0
  1250. package/src/transfer/export-md.ts +59 -0
  1251. package/src/transfer/export-sqlite.ts +52 -0
  1252. package/src/transfer/fs-utils.ts +269 -0
  1253. package/src/transfer/import-json.ts +108 -0
  1254. package/src/transfer/import-md.ts +84 -0
  1255. package/src/transfer/import-sqlite.ts +100 -0
  1256. package/src/transfer/integrity.ts +71 -0
  1257. package/src/transfer/sqlite-schema.ts +16 -0
  1258. package/src/transfer/types.ts +297 -0
  1259. package/src/trust-zones.ts +1186 -0
  1260. package/src/types.ts +3074 -0
  1261. package/src/user-model.test.ts +124 -0
  1262. package/src/user-model.ts +162 -0
  1263. package/src/utility-learner.ts +353 -0
  1264. package/src/utility-runtime.ts +88 -0
  1265. package/src/utility-telemetry.ts +215 -0
  1266. package/src/utils/category-dir.ts +44 -0
  1267. package/src/utils/errno.ts +6 -0
  1268. package/src/utils/iso-timestamp.test.ts +37 -0
  1269. package/src/utils/iso-timestamp.ts +164 -0
  1270. package/src/utils/path.ts +26 -0
  1271. package/src/verified-recall.ts +138 -0
  1272. package/src/version-utils.test.ts +10 -0
  1273. package/src/version-utils.ts +9 -0
  1274. package/src/whitespace.ts +10 -0
  1275. package/src/work/board.ts +359 -0
  1276. package/src/work/boundary.ts +107 -0
  1277. package/src/work/storage.ts +436 -0
  1278. package/src/work/types.ts +82 -0
  1279. package/src/work-product-ledger.ts +265 -0
  1280. package/dist/access-service-BkXt3di1.d.ts +0 -2039
  1281. package/dist/capsule-crypto-SJS5VVAP.js +0 -18
  1282. package/dist/capsule-export-LLEVB2RG.js +0 -17
  1283. package/dist/capsule-import-UW45R2MZ.js +0 -16
  1284. package/dist/capsule-merge-DI7PNQ2H.js +0 -189
  1285. package/dist/chunk-2LGMW3DJ.js +0 -111
  1286. package/dist/chunk-2YMTO4ZJ.js +0 -265
  1287. package/dist/chunk-2YMTO4ZJ.js.map +0 -1
  1288. package/dist/chunk-363MWCD3.js +0 -9683
  1289. package/dist/chunk-363MWCD3.js.map +0 -1
  1290. package/dist/chunk-36CTNQY7.js +0 -1554
  1291. package/dist/chunk-36CTNQY7.js.map +0 -1
  1292. package/dist/chunk-457A4P3L.js +0 -119
  1293. package/dist/chunk-457A4P3L.js.map +0 -1
  1294. package/dist/chunk-4DXC6HQQ.js +0 -1837
  1295. package/dist/chunk-4DXC6HQQ.js.map +0 -1
  1296. package/dist/chunk-4IS4SXIQ.js +0 -2040
  1297. package/dist/chunk-57QNCUEZ.js +0 -1914
  1298. package/dist/chunk-57QNCUEZ.js.map +0 -1
  1299. package/dist/chunk-6AUUAZEX.js +0 -150
  1300. package/dist/chunk-6AUUAZEX.js.map +0 -1
  1301. package/dist/chunk-6TBWYBJ3.js +0 -236
  1302. package/dist/chunk-6XA7UN4Z.js +0 -135
  1303. package/dist/chunk-6Z6UH6TK.js +0 -2129
  1304. package/dist/chunk-6Z6UH6TK.js.map +0 -1
  1305. package/dist/chunk-74EMIVE4.js +0 -329
  1306. package/dist/chunk-74EMIVE4.js.map +0 -1
  1307. package/dist/chunk-74WWN7ZW.js +0 -82
  1308. package/dist/chunk-74WWN7ZW.js.map +0 -1
  1309. package/dist/chunk-767ODGE6.js +0 -183
  1310. package/dist/chunk-A4ACKWIW.js +0 -289
  1311. package/dist/chunk-A4ACKWIW.js.map +0 -1
  1312. package/dist/chunk-ASAITVLA.js +0 -64
  1313. package/dist/chunk-ASAITVLA.js.map +0 -1
  1314. package/dist/chunk-C5HUWVH2.js +0 -891
  1315. package/dist/chunk-C5HUWVH2.js.map +0 -1
  1316. package/dist/chunk-D54LZC5L.js +0 -147
  1317. package/dist/chunk-DF3RVK3X.js +0 -119
  1318. package/dist/chunk-DF3RVK3X.js.map +0 -1
  1319. package/dist/chunk-E6K4NIEU.js +0 -747
  1320. package/dist/chunk-E6K4NIEU.js.map +0 -1
  1321. package/dist/chunk-EEQLFRUM.js +0 -89
  1322. package/dist/chunk-EQINRHYR.js +0 -672
  1323. package/dist/chunk-EQINRHYR.js.map +0 -1
  1324. package/dist/chunk-ETOW6ACV.js +0 -158
  1325. package/dist/chunk-ETOW6ACV.js.map +0 -1
  1326. package/dist/chunk-EYNQTST2.js +0 -721
  1327. package/dist/chunk-FYIYMQ5N.js +0 -221
  1328. package/dist/chunk-FYIYMQ5N.js.map +0 -1
  1329. package/dist/chunk-G2WADRQ3.js +0 -219
  1330. package/dist/chunk-G4SK7DSQ.js +0 -121
  1331. package/dist/chunk-GGD5W7TB.js +0 -105
  1332. package/dist/chunk-GGD5W7TB.js.map +0 -1
  1333. package/dist/chunk-GVPWB7EY.js +0 -390
  1334. package/dist/chunk-GVPWB7EY.js.map +0 -1
  1335. package/dist/chunk-HJYHRE4S.js +0 -647
  1336. package/dist/chunk-I6BQZSML.js +0 -1451
  1337. package/dist/chunk-I6BQZSML.js.map +0 -1
  1338. package/dist/chunk-IBX3VFOM.js +0 -446
  1339. package/dist/chunk-IBX3VFOM.js.map +0 -1
  1340. package/dist/chunk-IXEJRKCZ.js +0 -18
  1341. package/dist/chunk-JBMSGZEQ.js +0 -441
  1342. package/dist/chunk-JBMSGZEQ.js.map +0 -1
  1343. package/dist/chunk-JRNQ3RNA.js +0 -284
  1344. package/dist/chunk-JRNQ3RNA.js.map +0 -1
  1345. package/dist/chunk-K6WK37A6.js +0 -865
  1346. package/dist/chunk-K6WK37A6.js.map +0 -1
  1347. package/dist/chunk-KBYWQWSB.js +0 -271
  1348. package/dist/chunk-KUHRUM6B.js +0 -14397
  1349. package/dist/chunk-KUHRUM6B.js.map +0 -1
  1350. package/dist/chunk-KWBPHZUU.js +0 -83
  1351. package/dist/chunk-KWBPHZUU.js.map +0 -1
  1352. package/dist/chunk-LIO5X3CM.js +0 -596
  1353. package/dist/chunk-MARWOCVP.js +0 -48
  1354. package/dist/chunk-MCC6KDQF.js +0 -5095
  1355. package/dist/chunk-MCC6KDQF.js.map +0 -1
  1356. package/dist/chunk-N5AKDXAI.js +0 -74
  1357. package/dist/chunk-NN3LPQ5D.js +0 -936
  1358. package/dist/chunk-NN3LPQ5D.js.map +0 -1
  1359. package/dist/chunk-O4XJUPSF.js +0 -533
  1360. package/dist/chunk-O4XJUPSF.js.map +0 -1
  1361. package/dist/chunk-OA3L7BFR.js +0 -183
  1362. package/dist/chunk-OA3L7BFR.js.map +0 -1
  1363. package/dist/chunk-OR64ZGRZ.js +0 -23
  1364. package/dist/chunk-P73JTV34.js +0 -275
  1365. package/dist/chunk-P73JTV34.js.map +0 -1
  1366. package/dist/chunk-P77UEOU2.js +0 -1521
  1367. package/dist/chunk-P77UEOU2.js.map +0 -1
  1368. package/dist/chunk-PB5KW5PL.js +0 -118
  1369. package/dist/chunk-PHNGXFQ6.js +0 -623
  1370. package/dist/chunk-PHNGXFQ6.js.map +0 -1
  1371. package/dist/chunk-QIGOEM65.js +0 -228
  1372. package/dist/chunk-RXTFCYQF.js +0 -108
  1373. package/dist/chunk-S2JJBLJG.js +0 -2101
  1374. package/dist/chunk-S2JJBLJG.js.map +0 -1
  1375. package/dist/chunk-S3IP6R6K.js +0 -219
  1376. package/dist/chunk-S3IP6R6K.js.map +0 -1
  1377. package/dist/chunk-SRBJUAMP.js +0 -403
  1378. package/dist/chunk-SRBJUAMP.js.map +0 -1
  1379. package/dist/chunk-URB2WSKZ.js +0 -350
  1380. package/dist/chunk-URB2WSKZ.js.map +0 -1
  1381. package/dist/chunk-VQXK37XA.js +0 -26
  1382. package/dist/chunk-VQXK37XA.js.map +0 -1
  1383. package/dist/chunk-VTU2B4VF.js +0 -146
  1384. package/dist/chunk-VTU2B4VF.js.map +0 -1
  1385. package/dist/chunk-VX2IUQFE.js +0 -613
  1386. package/dist/chunk-VX2IUQFE.js.map +0 -1
  1387. package/dist/chunk-WGK4VHGP.js +0 -4292
  1388. package/dist/chunk-WGK4VHGP.js.map +0 -1
  1389. package/dist/chunk-WTFWLUSX.js +0 -827
  1390. package/dist/chunk-WTFWLUSX.js.map +0 -1
  1391. package/dist/chunk-XJKFSSDW.js +0 -726
  1392. package/dist/chunk-XJKFSSDW.js.map +0 -1
  1393. package/dist/chunk-XMHBH5H6.js +0 -283
  1394. package/dist/chunk-XMHBH5H6.js.map +0 -1
  1395. package/dist/chunk-XMVFHBHT.js +0 -277
  1396. package/dist/chunk-Y5KDIOKF.js +0 -2403
  1397. package/dist/chunk-Y5KDIOKF.js.map +0 -1
  1398. package/dist/chunk-YNB73F22.js +0 -137
  1399. package/dist/chunk-YNB73F22.js.map +0 -1
  1400. package/dist/chunk-Z2E7VW55.js +0 -335
  1401. package/dist/chunk-Z2E7VW55.js.map +0 -1
  1402. package/dist/chunk-Z5S5HNGY.js +0 -2280
  1403. package/dist/chunk-Z5S5HNGY.js.map +0 -1
  1404. package/dist/chunk-ZL4S7ARC.js +0 -53
  1405. package/dist/chunk-ZTSE2ZJ6.js +0 -190
  1406. package/dist/chunk-ZTSE2ZJ6.js.map +0 -1
  1407. package/dist/cli-Cvy2SNhF.d.ts +0 -1259
  1408. package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
  1409. package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
  1410. package/dist/contradiction-review-5LTTVDQV.js +0 -22
  1411. package/dist/contradiction-scan-3Z6YW7YA.js +0 -413
  1412. package/dist/contradiction-scan-3Z6YW7YA.js.map +0 -1
  1413. package/dist/engine-FOC3IJLA.js +0 -28
  1414. package/dist/fs-utils-IRVUFB6G.js +0 -30
  1415. package/dist/graph-edge-decay-PWB63GRE.js +0 -207
  1416. package/dist/index-1qIcnbG1.d.ts +0 -34
  1417. package/dist/memory-governance-F3QOJGEY.js +0 -37
  1418. package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
  1419. package/dist/orchestrator-AOQMo7QI.d.ts +0 -1784
  1420. package/dist/path-RMTY5Y5A.js +0 -9
  1421. package/dist/port-B6VEDIkC.d.ts +0 -53
  1422. package/dist/resolution-YGIBORXI.js +0 -101
  1423. package/dist/resolution-YGIBORXI.js.map +0 -1
  1424. package/dist/secure-store-4R2GSO7S.js +0 -156
  1425. package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
  1426. package/dist/state-store-3EH7HYIN.js +0 -16
  1427. package/dist/types-V3FJ26TF.js +0 -30
  1428. /package/dist/{capsule-crypto-SJS5VVAP.js.map → action-confidence.js.map} +0 -0
  1429. /package/dist/{capsule-export-LLEVB2RG.js.map → adapters/claude-code.js.map} +0 -0
  1430. /package/dist/{capsule-import-UW45R2MZ.js.map → adapters/codex.js.map} +0 -0
  1431. /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/hermes.js.map} +0 -0
  1432. /package/dist/{engine-FOC3IJLA.js.map → adapters/index.js.map} +0 -0
  1433. /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/registry.js.map} +0 -0
  1434. /package/dist/{memory-governance-F3QOJGEY.js.map → adapters/replit.js.map} +0 -0
  1435. /package/dist/{path-RMTY5Y5A.js.map → adapters/types.js.map} +0 -0
  1436. /package/dist/{secure-store-4R2GSO7S.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
  1437. /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
  1438. /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
  1439. /package/dist/{chunk-KBYWQWSB.js.map → chunk-4CRG46BG.js.map} +0 -0
  1440. /package/dist/{chunk-LIO5X3CM.js.map → chunk-7IASACLB.js.map} +0 -0
  1441. /package/dist/{chunk-EYNQTST2.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
  1442. /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
  1443. /package/dist/{chunk-QIGOEM65.js.map → chunk-GGKRUQOO.js.map} +0 -0
  1444. /package/dist/{chunk-HJYHRE4S.js.map → chunk-GL6I6MEQ.js.map} +0 -0
  1445. /package/dist/{state-store-3EH7HYIN.js.map → chunk-HHLLAQGZ.js.map} +0 -0
  1446. /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
  1447. /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
  1448. /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
  1449. /package/dist/{chunk-PB5KW5PL.js.map → chunk-MC26UJIM.js.map} +0 -0
  1450. /package/dist/{chunk-ZL4S7ARC.js.map → chunk-MT4HVDUZ.js.map} +0 -0
  1451. /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
  1452. /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
  1453. /package/dist/{chunk-RXTFCYQF.js.map → chunk-P4NEIHUT.js.map} +0 -0
  1454. /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
  1455. /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
  1456. /package/dist/{types-V3FJ26TF.js.map → chunk-SEDEKFYQ.js.map} +0 -0
  1457. /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
  1458. /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
  1459. /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
  1460. /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
  1461. /package/dist/{chunk-6XA7UN4Z.js.map → chunk-XVZ7B3HG.js.map} +0 -0
  1462. /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
@@ -0,0 +1,3952 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import {
5
+ buildResponseGuidanceRecallSection,
6
+ shouldRecallResponseGuidance,
7
+ } from "./response-guidance-recall.js";
8
+
9
+ class FakeGuidanceEngine {
10
+ readonly searchCalls: Array<{ query: string; limit: number; sessionId?: string }> = [];
11
+ readonly expandCalls: Array<{ sessionId: string; fromTurn: number; toTurn: number; maxTokens: number }> = [];
12
+
13
+ constructor(
14
+ private readonly sessionId: string,
15
+ private readonly messages: Array<{ turn_index: number; role: string; content: string }>,
16
+ private readonly searchTurnIndexes: number[] = [],
17
+ ) {}
18
+
19
+ async searchContextFull(
20
+ query: string,
21
+ limit: number,
22
+ sessionId?: string,
23
+ ): Promise<
24
+ Array<{
25
+ turn_index: number;
26
+ role: string;
27
+ content: string;
28
+ session_id: string;
29
+ score: number;
30
+ }>
31
+ > {
32
+ this.searchCalls.push({ query, limit, sessionId });
33
+ if (sessionId && sessionId !== this.sessionId) return [];
34
+ return this.searchTurnIndexes
35
+ .map((turnIndex, index) => {
36
+ const message = this.messages.find((entry) => entry.turn_index === turnIndex);
37
+ if (!message) return null;
38
+ return {
39
+ turn_index: message.turn_index,
40
+ role: message.role,
41
+ content: message.content,
42
+ session_id: this.sessionId,
43
+ score: 100 - index,
44
+ };
45
+ })
46
+ .filter((entry): entry is NonNullable<typeof entry> => entry !== null);
47
+ }
48
+
49
+ async expandContext(
50
+ sessionId: string,
51
+ fromTurn: number,
52
+ toTurn: number,
53
+ maxTokens: number,
54
+ ): Promise<Array<{ turn_index: number; role: string; content: string }>> {
55
+ this.expandCalls.push({ sessionId, fromTurn, toTurn, maxTokens });
56
+ if (sessionId !== this.sessionId) return [];
57
+ return this.messages.filter(
58
+ (message) => message.turn_index >= fromTurn && message.turn_index <= toTurn,
59
+ );
60
+ }
61
+
62
+ async getStats(sessionId?: string): Promise<{
63
+ totalMessages: number;
64
+ maxTurnIndex?: number;
65
+ }> {
66
+ if (sessionId && sessionId !== this.sessionId) {
67
+ return { totalMessages: 0 };
68
+ }
69
+ return {
70
+ totalMessages: this.messages.length,
71
+ maxTurnIndex: Math.max(...this.messages.map((message) => message.turn_index)),
72
+ };
73
+ }
74
+ }
75
+
76
+ class BudgetedGuidanceEngine extends FakeGuidanceEngine {
77
+ async expandContext(
78
+ sessionId: string,
79
+ fromTurn: number,
80
+ toTurn: number,
81
+ maxTokens: number,
82
+ ): Promise<Array<{ turn_index: number; role: string; content: string }>> {
83
+ const expanded = await super.expandContext(sessionId, fromTurn, toTurn, maxTokens);
84
+ const selected: Array<{ turn_index: number; role: string; content: string }> = [];
85
+ let used = 0;
86
+ for (const message of expanded) {
87
+ const size = message.content.length;
88
+ if (used > 0 && used + size > maxTokens) break;
89
+ selected.push(message);
90
+ used += size;
91
+ }
92
+ return selected;
93
+ }
94
+ }
95
+
96
+ test("response guidance recall is query-triggered", () => {
97
+ assert.equal(
98
+ shouldRecallResponseGuidance("How should I approach editting my draft?"),
99
+ true,
100
+ );
101
+ assert.equal(
102
+ shouldRecallResponseGuidance("What are popular tools to organize digital files?"),
103
+ true,
104
+ );
105
+ assert.equal(
106
+ shouldRecallResponseGuidance("What technologies are used in my current setup?"),
107
+ true,
108
+ );
109
+ assert.equal(
110
+ shouldRecallResponseGuidance("How should I organize my day to stay on track?"),
111
+ true,
112
+ );
113
+ assert.equal(
114
+ shouldRecallResponseGuidance(
115
+ "When building an application that communicates with a REST API, what typical errors should I be prepared to handle?",
116
+ ),
117
+ true,
118
+ );
119
+ assert.equal(
120
+ shouldRecallResponseGuidance(
121
+ "I'm working on making multiple API requests to gather tweet metrics efficiently. How would you suggest structuring the code to handle these calls?",
122
+ ),
123
+ true,
124
+ );
125
+ assert.equal(
126
+ shouldRecallResponseGuidance(
127
+ "What approach did you recommend to balance speeding up the hiring process with ensuring fairness throughout the candidate evaluation?",
128
+ ),
129
+ true,
130
+ );
131
+ assert.equal(
132
+ shouldRecallResponseGuidance(
133
+ "How do I find the distance between the points (4, 7) and (1, 3)?",
134
+ ),
135
+ true,
136
+ );
137
+ assert.equal(
138
+ shouldRecallResponseGuidance(
139
+ "I'm preparing for my upcoming exam and want to practice different types of problems. How should I organize my study sessions?",
140
+ ),
141
+ true,
142
+ );
143
+ assert.equal(
144
+ shouldRecallResponseGuidance(
145
+ "Can you summarize my overall learning journey and progress with mathematical induction based on our conversations?",
146
+ ),
147
+ true,
148
+ );
149
+ assert.equal(
150
+ shouldRecallResponseGuidance(
151
+ "Can you explain the properties of congruences in number theory?",
152
+ ),
153
+ true,
154
+ );
155
+ assert.equal(
156
+ shouldRecallResponseGuidance(
157
+ "Can you summarize how my reading goals and strategies have developed over time based on our conversations?",
158
+ ),
159
+ true,
160
+ );
161
+ assert.equal(
162
+ shouldRecallResponseGuidance(
163
+ "How did you recommend structuring my writing process to maintain steady progress and stay motivated throughout the weeks leading up to my deadline?",
164
+ ),
165
+ true,
166
+ );
167
+ assert.equal(
168
+ shouldRecallResponseGuidance(
169
+ "Could you provide a detailed and cohesive summary of conic sections, integrating their mathematical foundations with practical applications?",
170
+ ),
171
+ true,
172
+ );
173
+ assert.equal(
174
+ shouldRecallResponseGuidance(
175
+ "How do the derivatives I asked about change in complexity from the simplest to the most complex implicit differentiation equations I mentioned?",
176
+ ),
177
+ true,
178
+ );
179
+ assert.equal(
180
+ shouldRecallResponseGuidance(
181
+ "Can you walk me through how to find the derivative of f(x) = (2x + 1)(x^2 - 3) using the product rule and chain rule?",
182
+ ),
183
+ true,
184
+ );
185
+ assert.equal(
186
+ shouldRecallResponseGuidance(
187
+ "How does changing the step size affect the accuracy of Euler's method for solving differential equations?",
188
+ ),
189
+ true,
190
+ );
191
+ assert.equal(
192
+ shouldRecallResponseGuidance(
193
+ "How can I combine my exponential and logistic growth models to predict population trends more accurately, and what parameter estimation improvements should I prioritize based on my data points?",
194
+ ),
195
+ true,
196
+ );
197
+ assert.equal(
198
+ shouldRecallResponseGuidance(
199
+ "Can you help me work through a problem involving variance where the random variable is defined?",
200
+ ),
201
+ true,
202
+ );
203
+ assert.equal(
204
+ shouldRecallResponseGuidance(
205
+ "Can you show me how to find the shortest path between two points on a sphere?",
206
+ ),
207
+ true,
208
+ );
209
+ assert.equal(
210
+ shouldRecallResponseGuidance(
211
+ "What can you tell me about the skills I've gained recently?",
212
+ ),
213
+ true,
214
+ );
215
+ assert.equal(
216
+ shouldRecallResponseGuidance(
217
+ "I have a coffee meeting coming up soon. What are some tips to help me prepare and make the most of it?",
218
+ ),
219
+ true,
220
+ );
221
+ assert.equal(
222
+ shouldRecallResponseGuidance(
223
+ "Can you provide a detailed and comprehensive summary of the entire process I went through in expanding my telepsychology services, managing professional development investments, balancing research and client work, and navigating key career decisions?",
224
+ ),
225
+ true,
226
+ );
227
+ assert.equal(
228
+ shouldRecallResponseGuidance(
229
+ "Can you provide a detailed and comprehensive summary of everything involved in preparing for and participating in the upcoming professional events and projects I have planned, covering all aspects from initial planning through execution and follow-up?",
230
+ ),
231
+ true,
232
+ );
233
+ assert.equal(
234
+ shouldRecallResponseGuidance(
235
+ "I'm looking at a few job listings and trying to figure out which ones might be the best fit for me. How would you help me narrow down the options?",
236
+ ),
237
+ true,
238
+ );
239
+ assert.equal(
240
+ shouldRecallResponseGuidance(
241
+ "How did my initial interaction at the conference influence the timeline and approach I took to revising my professional documents?",
242
+ ),
243
+ true,
244
+ );
245
+ assert.equal(
246
+ shouldRecallResponseGuidance(
247
+ "I'm looking at two investment properties: one offers consistent monthly returns but slower appreciation, and the other might sell for a higher price soon but has less predictable income. How should I approach deciding between them?",
248
+ ),
249
+ true,
250
+ );
251
+ assert.equal(
252
+ shouldRecallResponseGuidance(
253
+ "Can you give me a comprehensive summary of my journey and decision-making process around investing in rental properties, including how my budget, property choices, management considerations, and financing plans have developed over time?",
254
+ ),
255
+ true,
256
+ );
257
+ assert.equal(
258
+ shouldRecallResponseGuidance(
259
+ "Can you give me a thorough summary of everything we've covered about managing and growing my cryptocurrency investments, including the strategies, tools, risks, and community engagement involved?",
260
+ ),
261
+ true,
262
+ );
263
+ assert.equal(
264
+ shouldRecallResponseGuidance(
265
+ "Can you provide a detailed summary of how all aspects of supporting Scott, from his academic challenges and tutoring to his extracurricular activities, social development, and digital habits, have been addressed and coordinated over time?",
266
+ ),
267
+ true,
268
+ );
269
+ assert.equal(
270
+ shouldRecallResponseGuidance(
271
+ "Can you provide a detailed and comprehensive summary of how my investment strategy and portfolio management evolved over time, including all key decisions, adjustments, and advice I received across my various meetings and discussions?",
272
+ ),
273
+ true,
274
+ );
275
+ assert.equal(
276
+ shouldRecallResponseGuidance("What should I keep in mind to maintain a healthy diet?"),
277
+ true,
278
+ );
279
+ assert.equal(
280
+ shouldRecallResponseGuidance(
281
+ "I'm looking to add some cardio activities to my routine. What options would you suggest?",
282
+ ),
283
+ true,
284
+ );
285
+ assert.equal(
286
+ shouldRecallResponseGuidance(
287
+ "How did you explain the connection between my heart's pumping efficiency and the symptoms I might experience during physical activities, and what ongoing steps did you recommend to manage these effects?",
288
+ ),
289
+ true,
290
+ );
291
+ assert.equal(
292
+ shouldRecallResponseGuidance("How much has my sleep improved recently?"),
293
+ true,
294
+ );
295
+ assert.equal(
296
+ shouldRecallResponseGuidance(
297
+ "Considering my changes like adjusting thermostat settings, installing blackout curtains, adding meditation, and using 2200K lamps, how have these combined affected my sleep quality and night sweats overall?",
298
+ ),
299
+ true,
300
+ );
301
+ assert.equal(
302
+ shouldRecallResponseGuidance(
303
+ "Can you give me a comprehensive summary of how I've worked on improving my sleep environment and habits over time?",
304
+ ),
305
+ true,
306
+ );
307
+ assert.equal(
308
+ shouldRecallResponseGuidance(
309
+ "I'm thinking about buying a new mattress. What should I know about it?",
310
+ ),
311
+ true,
312
+ );
313
+ assert.equal(
314
+ shouldRecallResponseGuidance("What are some good ways to unwind before bed that I could try?"),
315
+ true,
316
+ );
317
+ assert.equal(
318
+ shouldRecallResponseGuidance(
319
+ "I'm planning to have a meaningful conversation with April this weekend. When do you think would be a good time to start it?",
320
+ ),
321
+ true,
322
+ );
323
+ assert.equal(
324
+ shouldRecallResponseGuidance(
325
+ "What are some good ways to organize activities with my partner over the weekend?",
326
+ ),
327
+ true,
328
+ );
329
+ assert.equal(
330
+ shouldRecallResponseGuidance(
331
+ "Can you give me a thorough summary of everything we've covered about my relationship with April, capturing how all the different aspects we've discussed connect and evolve over time?",
332
+ ),
333
+ true,
334
+ );
335
+ assert.equal(
336
+ shouldRecallResponseGuidance(
337
+ "Can you give me a summary of how I planned to reduce my work hours and balance my personal life?",
338
+ ),
339
+ true,
340
+ );
341
+ assert.equal(
342
+ shouldRecallResponseGuidance("How has my pronunciation been improving lately?"),
343
+ true,
344
+ );
345
+ assert.equal(
346
+ shouldRecallResponseGuidance(
347
+ "I'm looking to improve my Turkish skills and want to explore different learning formats. What options would you suggest?",
348
+ ),
349
+ true,
350
+ );
351
+ assert.equal(
352
+ shouldRecallResponseGuidance(
353
+ "How many different study tools or decorations have I added to my study space across my sessions?",
354
+ ),
355
+ true,
356
+ );
357
+ assert.equal(
358
+ shouldRecallResponseGuidance(
359
+ "Should I consider my mom Crystal's financial assistance for my down payment and repayment plan?",
360
+ ),
361
+ true,
362
+ );
363
+ assert.equal(
364
+ shouldRecallResponseGuidance("What was the updated repair cost estimate for the minor plumbing leaks?"),
365
+ true,
366
+ );
367
+ assert.equal(
368
+ shouldRecallResponseGuidance("What do I know about the condition of the house before we finalize everything?"),
369
+ true,
370
+ );
371
+ assert.equal(
372
+ shouldRecallResponseGuidance("When does my neighborhood tour with Samantha start?"),
373
+ true,
374
+ );
375
+ assert.equal(
376
+ shouldRecallResponseGuidance("What should I consider when deciding on a neighborhood to move to?"),
377
+ true,
378
+ );
379
+ assert.equal(
380
+ shouldRecallResponseGuidance("What stove brands or models should I look into adding to my new kitchen?"),
381
+ true,
382
+ );
383
+ assert.equal(
384
+ shouldRecallResponseGuidance("How much more does the 3-bedroom apartment cost compared with the 2-bedroom?"),
385
+ true,
386
+ );
387
+ assert.equal(
388
+ shouldRecallResponseGuidance("Given my cash flow, what is left after monthly expenses and repayment commitments?"),
389
+ true,
390
+ );
391
+ assert.equal(
392
+ shouldRecallResponseGuidance("Can you walk me through the timeline and financial steps to prepare for buying my home?"),
393
+ true,
394
+ );
395
+ assert.equal(
396
+ shouldRecallResponseGuidance("Can you give me a complete summary of my home buying plans and financial arrangements?"),
397
+ true,
398
+ );
399
+ assert.equal(
400
+ shouldRecallResponseGuidance("Can you summarize the fixed-rate and variable-rate mortgage options I was choosing between?"),
401
+ true,
402
+ );
403
+ assert.equal(
404
+ shouldRecallResponseGuidance("How many days after the home inspection was the report delivered, and how many days before the lawyer contract review?"),
405
+ true,
406
+ );
407
+ assert.equal(
408
+ shouldRecallResponseGuidance("What service was arranged for home preparation and photography, and how should I prepare before and after the session?"),
409
+ true,
410
+ );
411
+ assert.equal(
412
+ shouldRecallResponseGuidance("What costs should I consider when planning my finances for next year after selling my home?"),
413
+ true,
414
+ );
415
+ assert.equal(
416
+ shouldRecallResponseGuidance("When I rent out the place, what terms about payment adjustments should I remember?"),
417
+ true,
418
+ );
419
+ assert.equal(
420
+ shouldRecallResponseGuidance("What rental price was set for my Kadikoy apartment?"),
421
+ true,
422
+ );
423
+ assert.equal(
424
+ shouldRecallResponseGuidance("How much did the staging and photography services cost in total?"),
425
+ true,
426
+ );
427
+ assert.equal(
428
+ shouldRecallResponseGuidance("What sequence should I follow for repairs, staging, and marketing so I can avoid delays?"),
429
+ true,
430
+ );
431
+ assert.equal(
432
+ shouldRecallResponseGuidance("How should I prepare my home to be attractive to buyers: professional staging or DIY?"),
433
+ true,
434
+ );
435
+ assert.equal(
436
+ shouldRecallResponseGuidance("What should I keep in mind when preparing my home for sale to make it more attractive to buyers?"),
437
+ true,
438
+ );
439
+ assert.equal(
440
+ shouldRecallResponseGuidance("How should I schedule appointments next week if I prefer morning time slots?"),
441
+ true,
442
+ );
443
+ assert.equal(
444
+ shouldRecallResponseGuidance("Can you give me a thorough summary of preparing and selling my home?"),
445
+ true,
446
+ );
447
+ assert.equal(
448
+ shouldRecallResponseGuidance("Can you summarize how I managed stress throughout the home selling and moving process?"),
449
+ true,
450
+ );
451
+ assert.equal(
452
+ shouldRecallResponseGuidance("How many days were between the roof repair and the first offer in April?"),
453
+ true,
454
+ );
455
+ assert.equal(
456
+ shouldRecallResponseGuidance("How long have James and I been living together in the house on Atatürk Street?"),
457
+ true,
458
+ );
459
+ assert.equal(
460
+ shouldRecallResponseGuidance("I'm fixing a leaking pipe in the bathroom; what safety steps should I follow?"),
461
+ true,
462
+ );
463
+ assert.equal(
464
+ shouldRecallResponseGuidance("How should I go about fixing a leaking pipe in my bathroom?"),
465
+ true,
466
+ );
467
+ assert.equal(
468
+ shouldRecallResponseGuidance("What exact model should I recommend for a new drill?"),
469
+ true,
470
+ );
471
+ assert.equal(
472
+ shouldRecallResponseGuidance("Can you give me a complete summary of the attic insulation project?"),
473
+ true,
474
+ );
475
+ assert.equal(
476
+ shouldRecallResponseGuidance("How many days passed from April 10 until April 29 for the faucet washer practice?"),
477
+ true,
478
+ );
479
+ assert.equal(
480
+ shouldRecallResponseGuidance(
481
+ "What options do I have for getting from New York to Paris next month?",
482
+ ),
483
+ true,
484
+ );
485
+ assert.equal(
486
+ shouldRecallResponseGuidance(
487
+ "What should I consider when organizing my upcoming event?",
488
+ ),
489
+ true,
490
+ );
491
+ assert.equal(
492
+ shouldRecallResponseGuidance(
493
+ "I'm looking to update my living space. What kinds of decor items would you suggest?",
494
+ ),
495
+ true,
496
+ );
497
+ assert.equal(
498
+ shouldRecallResponseGuidance(
499
+ "What are the financial limits I should keep in mind for this project?",
500
+ ),
501
+ true,
502
+ );
503
+ assert.equal(
504
+ shouldRecallResponseGuidance(
505
+ "What should I consider if I want to take money out of my investment account?",
506
+ ),
507
+ true,
508
+ );
509
+ assert.equal(
510
+ shouldRecallResponseGuidance(
511
+ "Can you give me a detailed summary of everything we've covered about rebuilding trust and strengthening my relationship, including the challenges, strategies, interactions, and progress over time?",
512
+ ),
513
+ true,
514
+ );
515
+ assert.equal(
516
+ shouldRecallResponseGuidance(
517
+ "Have I spent time reading articles on mathematical modeling in emergency medicine?",
518
+ ),
519
+ true,
520
+ );
521
+ assert.equal(
522
+ shouldRecallResponseGuidance(
523
+ "Have I completed any practice problems on separable equations?",
524
+ ),
525
+ true,
526
+ );
527
+ assert.equal(
528
+ shouldRecallResponseGuidance(
529
+ "Can you suggest some good audiobooks for me to listen to?",
530
+ ),
531
+ true,
532
+ );
533
+ assert.equal(
534
+ shouldRecallResponseGuidance(
535
+ "What happened during my recent rehearsals and coaching sessions?",
536
+ ),
537
+ true,
538
+ );
539
+ assert.equal(
540
+ shouldRecallResponseGuidance("What happened at the last team practice?"),
541
+ true,
542
+ );
543
+ assert.equal(
544
+ shouldRecallResponseGuidance(
545
+ "Have I ever made a watchlist for family movie marathons before?",
546
+ ),
547
+ true,
548
+ );
549
+ assert.equal(
550
+ shouldRecallResponseGuidance("What snacks do you recommend for me to try?"),
551
+ true,
552
+ );
553
+ assert.equal(
554
+ shouldRecallResponseGuidance(
555
+ "What was my emotional reaction to confusing mutually exclusive and independent events during my dice roll problems?",
556
+ ),
557
+ true,
558
+ );
559
+ assert.equal(
560
+ shouldRecallResponseGuidance("What movies would you recommend for me to watch?"),
561
+ true,
562
+ );
563
+ assert.equal(
564
+ shouldRecallResponseGuidance(
565
+ "Can you help me organize a cooking plan that breaks down what I should focus on each week?",
566
+ ),
567
+ true,
568
+ );
569
+ assert.equal(
570
+ shouldRecallResponseGuidance(
571
+ "What approach did you recommend for preparing the dishes so that the flavors and textures come out just right, especially considering how to handle the leaves and balance the seasoning?",
572
+ ),
573
+ true,
574
+ );
575
+ assert.equal(
576
+ shouldRecallResponseGuidance(
577
+ "Can you give me a detailed summary of how my culinary journey has progressed, highlighting milestones and strategies to stay on track?",
578
+ ),
579
+ true,
580
+ );
581
+ assert.equal(shouldRecallResponseGuidance("What is my espresso code?"), false);
582
+ });
583
+
584
+ test("response guidance recall honors zero max results without search or scan", async () => {
585
+ const engine = new FakeGuidanceEngine("guidance-zero", [
586
+ {
587
+ turn_index: 0,
588
+ role: "user",
589
+ content: "I need a step-by-step editing process for revising drafts.",
590
+ },
591
+ ], [0]);
592
+
593
+ const recalled = await buildResponseGuidanceRecallSection({
594
+ engine,
595
+ sessionId: "guidance-zero",
596
+ query: "How should I approach editing my draft?",
597
+ maxChars: 2000,
598
+ maxSearchResults: 0,
599
+ });
600
+
601
+ assert.equal(recalled, "");
602
+ assert.deepEqual(engine.searchCalls, []);
603
+ assert.deepEqual(engine.expandCalls, []);
604
+ });
605
+
606
+ test("response guidance recall applies scan-window caps to search expansion", async () => {
607
+ const engine = new FakeGuidanceEngine("guidance-search-window", [
608
+ {
609
+ turn_index: 9,
610
+ role: "user",
611
+ content: "Earlier unrelated process note.",
612
+ },
613
+ {
614
+ turn_index: 10,
615
+ role: "user",
616
+ content:
617
+ "For draft revision, please use Scrivener's split-screen mode for side-by-side comparison.",
618
+ },
619
+ {
620
+ turn_index: 11,
621
+ role: "assistant",
622
+ content: "Later unrelated process note.",
623
+ },
624
+ ], [10]);
625
+
626
+ const recalled = await buildResponseGuidanceRecallSection({
627
+ engine,
628
+ query: "How should I approach editing my draft?",
629
+ maxChars: 2_000,
630
+ maxScanWindowTurns: 1,
631
+ maxScanWindowTokens: 123,
632
+ });
633
+
634
+ assert.match(recalled, /Scrivener's split-screen mode/);
635
+ assert.deepEqual(engine.expandCalls, [
636
+ {
637
+ sessionId: "guidance-search-window",
638
+ fromTurn: 10,
639
+ toTurn: 10,
640
+ maxTokens: 123,
641
+ },
642
+ ]);
643
+ });
644
+
645
+ test("response guidance recall recovers durable editing instructions", async () => {
646
+ const sessionId = "guidance-editing";
647
+ const engine = new FakeGuidanceEngine(sessionId, [
648
+ {
649
+ turn_index: 5,
650
+ role: "user",
651
+ content:
652
+ "I prefer drafting essays in Microsoft Word, but for revisions please use Scrivener's split-screen mode for simultaneous note-taking and side-by-side comparison.",
653
+ },
654
+ ]);
655
+
656
+ const recalled = await buildResponseGuidanceRecallSection({
657
+ engine,
658
+ sessionId,
659
+ query: "How should I approach editting my draft?",
660
+ maxChars: 4_000,
661
+ });
662
+
663
+ assert.match(recalled, /## Response guidance evidence/);
664
+ assert.match(recalled, /use split-screen view/);
665
+ assert.match(recalled, /side-by-side comparison/);
666
+ assert.match(recalled, /Scrivener's split-screen mode/);
667
+ });
668
+
669
+ test("response guidance recall respects zero maxSearchResults after scan collection", async () => {
670
+ const sessionId = "guidance-max-results";
671
+ const engine = new FakeGuidanceEngine(sessionId, [
672
+ {
673
+ turn_index: 5,
674
+ role: "user",
675
+ content:
676
+ "For editing drafts, I prefer Scrivener split-screen so revisions can compare notes side by side.",
677
+ },
678
+ ]);
679
+
680
+ const recalled = await buildResponseGuidanceRecallSection({
681
+ engine,
682
+ sessionId,
683
+ query: "How should I approach editting my draft?",
684
+ maxChars: 1_000,
685
+ maxSearchResults: 0,
686
+ maxScanWindowTurns: 10,
687
+ });
688
+
689
+ assert.equal(recalled, "");
690
+ });
691
+
692
+ test("forced response guidance scans only the recent window", async () => {
693
+ const sessionId = "guidance-forced-recent";
694
+ const engine = new FakeGuidanceEngine(sessionId, [
695
+ {
696
+ turn_index: 2,
697
+ role: "user",
698
+ content: "Please always answer every planning question in haiku form.",
699
+ },
700
+ {
701
+ turn_index: 18,
702
+ role: "assistant",
703
+ content: "Unrelated recent context.",
704
+ },
705
+ {
706
+ turn_index: 19,
707
+ role: "user",
708
+ content: "Always keep general answers concise and direct.",
709
+ },
710
+ {
711
+ turn_index: 20,
712
+ role: "assistant",
713
+ content: "Noted.",
714
+ },
715
+ ]);
716
+
717
+ const recalled = await buildResponseGuidanceRecallSection({
718
+ engine,
719
+ sessionId,
720
+ query: "What should I do next?",
721
+ maxChars: 2_000,
722
+ maxScanWindowTurns: 3,
723
+ forceGeneric: true,
724
+ });
725
+
726
+ assert.match(recalled, /concise and direct/);
727
+ assert.doesNotMatch(recalled, /haiku/);
728
+ assert.deepEqual(engine.expandCalls, [
729
+ {
730
+ sessionId,
731
+ fromTurn: 18,
732
+ toTurn: 20,
733
+ maxTokens: 16_000,
734
+ },
735
+ ]);
736
+ });
737
+
738
+ test("response guidance recall keeps cue summaries inside the section budget", async () => {
739
+ const sessionId = "guidance-budget";
740
+ const engine = new FakeGuidanceEngine(sessionId, [
741
+ {
742
+ turn_index: 5,
743
+ role: "user",
744
+ content:
745
+ "For draft revision, please use Scrivener's split-screen mode for simultaneous note-taking and side-by-side comparison, then do tone calibration manually before peer review.",
746
+ },
747
+ ], [5]);
748
+
749
+ const recalled = await buildResponseGuidanceRecallSection({
750
+ engine,
751
+ sessionId,
752
+ query: "How should I approach editing my draft?",
753
+ maxChars: 260,
754
+ maxItemChars: 500,
755
+ });
756
+
757
+ assert.ok(recalled.length <= 260, `expected section <= 260 chars, got ${recalled.length}`);
758
+ assert.match(recalled, /## Response guidance evidence/);
759
+ assert.match(recalled, /Normalized response guidance:/);
760
+ assert.match(recalled, /Scrivener|split-screen|side-by-side/);
761
+ });
762
+
763
+ test("response guidance recall normalizes AI-assisted editing and daily routine cues", async () => {
764
+ const sessionId = "guidance-editing-routine";
765
+ const engine = new FakeGuidanceEngine(sessionId, [
766
+ {
767
+ turn_index: 3,
768
+ role: "user",
769
+ content:
770
+ "I will use AI tools for the initial edits and then do tone calibration manually before peer review.",
771
+ },
772
+ {
773
+ turn_index: 7,
774
+ role: "user",
775
+ content:
776
+ "I prefer having a structured daily routine, so I set my wake-up and sleep times to 7 AM and 9 PM to stay organized.",
777
+ },
778
+ ], [3, 7]);
779
+
780
+ const editing = await buildResponseGuidanceRecallSection({
781
+ engine,
782
+ sessionId,
783
+ query: "What efficient editing steps should I use for my draft?",
784
+ maxChars: 4_000,
785
+ });
786
+ assert.match(editing, /start with AI-assisted tools for initial edits/);
787
+ assert.match(editing, /starting with AI-assisted tools for initial edits/);
788
+ assert.match(editing, /use AI tools to handle tone calibration/);
789
+
790
+ const routine = await buildResponseGuidanceRecallSection({
791
+ engine,
792
+ sessionId,
793
+ query: "How should I organize my day to stay on track with responsibilities?",
794
+ maxChars: 4_000,
795
+ });
796
+ assert.match(routine, /suggests routines that emphasize regularity and structure/);
797
+ assert.match(routine, /recommends a daily plan with consistent timing/);
798
+ assert.match(routine, /wake-up and sleep times to 7 AM and 9 PM/);
799
+ });
800
+
801
+ test("response guidance recall normalizes dated rehearsal outcome instructions", async () => {
802
+ const sessionId = "guidance-rehearsal-dates";
803
+ const engine = new FakeGuidanceEngine(sessionId, [
804
+ {
805
+ turn_index: 12,
806
+ role: "user",
807
+ content:
808
+ "The April 12 rehearsal and April 19 coaching session both had useful performance outcomes.",
809
+ },
810
+ ], [12]);
811
+
812
+ const recalled = await buildResponseGuidanceRecallSection({
813
+ engine,
814
+ sessionId,
815
+ query: "What happened during my recent rehearsals and coaching sessions?",
816
+ maxChars: 4_000,
817
+ });
818
+
819
+ assert.match(recalled, /include specific dates for each event/);
820
+ assert.match(recalled, /avoid vague time references/);
821
+ assert.match(recalled, /avoid general descriptions without dates/);
822
+ assert.match(recalled, /date shown as month-day-year: April-12/);
823
+ assert.match(recalled, /date shown as month-day-year: April-19/);
824
+ });
825
+
826
+ test("response guidance recall normalizes team-event attendance instructions", async () => {
827
+ const sessionId = "guidance-team-event-attendance";
828
+ const engine = new FakeGuidanceEngine(sessionId, [
829
+ {
830
+ turn_index: 12,
831
+ role: "user",
832
+ content:
833
+ "Always provide player attendance numbers when I ask about team events.",
834
+ },
835
+ {
836
+ turn_index: 13,
837
+ role: "assistant",
838
+ content:
839
+ "Got it. Example Team Event Summary: Event: Practice Session. Date: July 25, 2024. Attendance: 15 players out of 20 (75%). Details: spot shooting drills, catch-and-shoot exercises, free throw practice, and a full-court scrimmage.",
840
+ },
841
+ ], [12]);
842
+
843
+ const recalled = await buildResponseGuidanceRecallSection({
844
+ engine,
845
+ sessionId,
846
+ query: "What happened at the last team practice?",
847
+ maxChars: 4_000,
848
+ });
849
+
850
+ assert.match(recalled, /include player attendance numbers when answering team-event questions/);
851
+ assert.match(recalled, /mention attendance count and total players when available/);
852
+ assert.match(recalled, /example attendance: 15 players out of 20 \(75%\)/);
853
+ assert.match(recalled, /Always provide player attendance numbers/);
854
+ });
855
+
856
+ test("response guidance recall normalizes budget and health cues", async () => {
857
+ const sessionId = "guidance-budget-health";
858
+ const engine = new FakeGuidanceEngine(sessionId, [
859
+ {
860
+ turn_index: 2,
861
+ role: "user",
862
+ content:
863
+ "Preference Statement: I prefer straightforward budgeting methods over complex apps, favoring Excel for control and customization.",
864
+ },
865
+ {
866
+ turn_index: 4,
867
+ role: "user",
868
+ content:
869
+ "I want to reduce recurring monthly expenses and avoid focusing on one-time purchases.",
870
+ },
871
+ {
872
+ turn_index: 8,
873
+ role: "user",
874
+ content:
875
+ "I'm concerned about injury risk on uneven terrain, so I need sneaker grip soles, cushioning, comfort, and medium arch support.",
876
+ },
877
+ ]);
878
+
879
+ const budget = await buildResponseGuidanceRecallSection({
880
+ engine,
881
+ sessionId,
882
+ query: "I'm looking to reduce my monthly expenses. What are some ways you suggest?",
883
+ maxChars: 4_000,
884
+ });
885
+ assert.match(budget, /suggest Excel or spreadsheet-based solutions/);
886
+ assert.match(budget, /focus on recurring expenses/);
887
+ assert.match(budget, /avoid emphasizing one-time purchases or expenses/);
888
+
889
+ const health = await buildResponseGuidanceRecallSection({
890
+ engine,
891
+ sessionId,
892
+ query: "What features should I pay attention to in sneakers?",
893
+ maxChars: 4_000,
894
+ });
895
+ assert.match(health, /comfort related to physical well-being/);
896
+ assert.match(health, /injury prevention aspects/);
897
+ });
898
+
899
+ test("response guidance recall normalizes nutrition hydration and outdoor cardio preferences", async () => {
900
+ const sessionId = "guidance-fitness-preferences";
901
+ const engine = new FakeGuidanceEngine(sessionId, [
902
+ {
903
+ turn_index: 384,
904
+ role: "user",
905
+ content:
906
+ "Always include hydration tips when I ask about nutrition advice.",
907
+ },
908
+ {
909
+ turn_index: 296,
910
+ role: "user",
911
+ content:
912
+ "I prefer trail running over treadmill because I like fresh air and varied terrain.",
913
+ },
914
+ ], [384, 296]);
915
+
916
+ const diet = await buildResponseGuidanceRecallSection({
917
+ engine,
918
+ sessionId,
919
+ query: "What should I keep in mind to maintain a healthy diet?",
920
+ maxChars: 4_000,
921
+ });
922
+ assert.match(diet, /mention the importance of drinking fluids/);
923
+ assert.match(diet, /suggest ways to stay properly hydrated/);
924
+ assert.match(diet, /include hydration tips alongside food-related nutrition advice/);
925
+
926
+ const cardio = await buildResponseGuidanceRecallSection({
927
+ engine,
928
+ sessionId,
929
+ query: "I'm looking to add some cardio activities to my routine. What options would you suggest?",
930
+ maxChars: 4_000,
931
+ });
932
+ assert.match(cardio, /suggest outdoor cardio activities/);
933
+ assert.match(cardio, /mention varied terrain or natural settings/);
934
+ assert.match(cardio, /avoid recommending treadmill or indoor-only exercises/);
935
+ });
936
+
937
+ test("response guidance recall normalizes heart-function activity management", async () => {
938
+ const sessionId = "guidance-heart-function";
939
+ const engine = new FakeGuidanceEngine(sessionId, [
940
+ {
941
+ turn_index: 240,
942
+ role: "assistant",
943
+ content:
944
+ "An ejection fraction of 55% means the heart is pumping slightly less efficiently than usual. During physical activity, especially strenuous activity or climbing stairs, you may experience fatigue or shortness of breath more quickly. I recommended gradually increasing physical activity levels, monitoring symptoms, regular follow-ups with your cardiologist, lifestyle modifications such as a healthy diet low in sodium and saturated fats plus weight management, avoiding smoking, limiting alcohol, taking prescribed treatments as directed, and stress management with mindfulness or relaxation.",
945
+ },
946
+ ], [240]);
947
+
948
+ const recalled = await buildResponseGuidanceRecallSection({
949
+ engine,
950
+ sessionId,
951
+ query:
952
+ "How did you explain the connection between my heart's pumping efficiency and the symptoms I might experience during physical activities, and what ongoing steps did you recommend to manage these effects?",
953
+ maxChars: 2_000,
954
+ maxItemChars: 450,
955
+ });
956
+
957
+ assert.match(recalled, /explain ejection fraction as heart pumping efficiency/);
958
+ assert.match(recalled, /mention EF 55% as a mild reduction in heart function/);
959
+ assert.match(recalled, /fatigue or shortness of breath during physical activities/);
960
+ assert.match(recalled, /gradual physical activity increases and symptom monitoring/);
961
+ assert.match(recalled, /regular cardiology follow-ups/);
962
+ assert.match(recalled, /maintaining a heart-healthy diet/);
963
+ assert.match(recalled, /avoiding smoking/);
964
+ assert.match(recalled, /excessive alcohol/);
965
+ assert.doesNotMatch(recalled, /suggest outdoor cardio activities/);
966
+ });
967
+
968
+ test("response guidance recall normalizes exact sleep improvement percentages", async () => {
969
+ const sessionId = "guidance-sleep-improvement-percent";
970
+ const engine = new FakeGuidanceEngine(sessionId, [
971
+ {
972
+ turn_index: 420,
973
+ role: "user",
974
+ content:
975
+ "Always provide exact percentages when I ask about sleep efficiency improvements.",
976
+ },
977
+ {
978
+ turn_index: 445,
979
+ role: "assistant",
980
+ content:
981
+ "Your sleep efficiency improved from 70% in January to 78% on February 1; the exact percentage increase is 11.43%. Moving from 78% to 85% by March 10 requires an additional 8.97% increase.",
982
+ },
983
+ {
984
+ turn_index: 453,
985
+ role: "assistant",
986
+ content:
987
+ "Your sleep efficiency increased from 70% to 82%, a precise 17.14% relative improvement, with the context describing that as a 12 percentage-point gain.",
988
+ },
989
+ ], [420, 445, 453]);
990
+
991
+ const recalled = await buildResponseGuidanceRecallSection({
992
+ engine,
993
+ sessionId,
994
+ query: "How much has my sleep improved recently?",
995
+ maxChars: 4_000,
996
+ });
997
+
998
+ assert.match(recalled, /exact percentage values/);
999
+ assert.match(recalled, /precise numerical improvement/);
1000
+ assert.match(recalled, /11\.43%/);
1001
+ assert.match(recalled, /8\.97%/);
1002
+ assert.match(recalled, /17\.14%/);
1003
+ });
1004
+
1005
+ test("response guidance recall normalizes sleep environment summaries", async () => {
1006
+ const sessionId = "guidance-sleep-environment-summary";
1007
+ const engine = new FakeGuidanceEngine(sessionId, [
1008
+ {
1009
+ turn_index: 131,
1010
+ role: "assistant",
1011
+ content:
1012
+ "For sleep environment upgrades, we examined alternative affordable DIY solutions such as reflective window films, blackout curtains, and room darkening shades.",
1013
+ },
1014
+ {
1015
+ turn_index: 787,
1016
+ role: "assistant",
1017
+ content:
1018
+ "A consistent sleep schedule and meditation helped stabilize circadian rhythms, while adjusting thermostat settings improved bedroom temperature control.",
1019
+ },
1020
+ {
1021
+ turn_index: 900,
1022
+ role: "assistant",
1023
+ content:
1024
+ "The combined changes of thermostat settings, blackout curtains, meditation, and 2200K lamps improved sleep quality and reduced night sweats.",
1025
+ },
1026
+ ], [131, 787, 900]);
1027
+
1028
+ const combined = await buildResponseGuidanceRecallSection({
1029
+ engine,
1030
+ sessionId,
1031
+ query:
1032
+ "Considering my changes like adjusting thermostat settings, installing blackout curtains, adding meditation, and using 2200K lamps, how have these combined affected my sleep quality and night sweats overall?",
1033
+ maxChars: 4_000,
1034
+ });
1035
+ assert.match(combined, /stabilized circadian rhythms/);
1036
+ assert.match(combined, /improved sleep quality and reduced night sweats/);
1037
+
1038
+ const summary = await buildResponseGuidanceRecallSection({
1039
+ engine,
1040
+ sessionId,
1041
+ query:
1042
+ "Can you give me a comprehensive summary of how I've worked on improving my sleep environment and habits over time?",
1043
+ maxChars: 4_000,
1044
+ });
1045
+ assert.match(summary, /alternative affordable DIY solutions/);
1046
+ assert.match(summary, /window films and room darkening shades/);
1047
+ });
1048
+
1049
+ test("response guidance recall normalizes mattress warranty and screen-free wind-down cues", async () => {
1050
+ const sessionId = "guidance-sleep-purchase-winddown";
1051
+ const engine = new FakeGuidanceEngine(sessionId, [
1052
+ {
1053
+ turn_index: 807,
1054
+ role: "assistant",
1055
+ content:
1056
+ "For the SleepWell Deluxe mattress, the 5-year warranty extension provides longer warranty coverage for defects, repairs, and replacements; also check the trial period and return policy.",
1057
+ },
1058
+ {
1059
+ turn_index: 930,
1060
+ role: "assistant",
1061
+ content:
1062
+ "Good ways to unwind before bed include reading physical books, journaling, and breathing exercises. Avoid screen-based activities; meditation can be secondary or optional for relaxation without screen exposure.",
1063
+ },
1064
+ ], [807, 930]);
1065
+
1066
+ const mattress = await buildResponseGuidanceRecallSection({
1067
+ engine,
1068
+ sessionId,
1069
+ query: "I'm thinking about buying a new mattress. What should I know about it?",
1070
+ maxChars: 4_000,
1071
+ });
1072
+ assert.match(mattress, /mattress warranty details/);
1073
+ assert.match(mattress, /details about warranty coverage/);
1074
+ assert.match(mattress, /defects, repairs, or replacements/);
1075
+
1076
+ const windDown = await buildResponseGuidanceRecallSection({
1077
+ engine,
1078
+ sessionId,
1079
+ query: "What are some good ways to unwind before bed that I could try?",
1080
+ maxChars: 4_000,
1081
+ });
1082
+ assert.match(windDown, /recommend reading physical books/);
1083
+ assert.match(windDown, /avoid suggesting screen-based activities/);
1084
+ assert.match(windDown, /secondary or optional/);
1085
+ assert.match(windDown, /relaxation without screen exposure/);
1086
+ });
1087
+
1088
+ test("response guidance recall normalizes April timing and relationship summary cues", async () => {
1089
+ const sessionId = "guidance-april-relationship";
1090
+ const engine = new FakeGuidanceEngine(sessionId, [
1091
+ {
1092
+ turn_index: 288,
1093
+ role: "assistant",
1094
+ content:
1095
+ "Balance calm mornings with April's evening conversation needs by using mornings when you are both most alert, avoiding late evenings when people are tired, and choosing timing that supports energy levels.",
1096
+ },
1097
+ {
1098
+ turn_index: 709,
1099
+ role: "assistant",
1100
+ content:
1101
+ "Follow through after missing April's birthday dinner by planning special outings, enhancing thoughtful gestures like flowers, and creating meaningful relationship traditions.",
1102
+ },
1103
+ {
1104
+ turn_index: 2279,
1105
+ role: "assistant",
1106
+ content:
1107
+ "Keep the relationship fresh with date nights, surprises, shared hobbies, daily check-ins, emotional intimacy, and physical touch as April's love language.",
1108
+ },
1109
+ ], [288, 709, 2279]);
1110
+
1111
+ const timing = await buildResponseGuidanceRecallSection({
1112
+ engine,
1113
+ sessionId,
1114
+ query:
1115
+ "I'm planning to have a meaningful conversation with April this weekend. When do you think would be a good time to start it?",
1116
+ maxChars: 4_000,
1117
+ });
1118
+ assert.match(timing, /morning or early weekend times/);
1119
+ assert.match(timing, /avoid suggesting late evenings/);
1120
+ assert.match(timing, /supports energy levels/);
1121
+
1122
+ const activities = await buildResponseGuidanceRecallSection({
1123
+ engine,
1124
+ sessionId,
1125
+ query: "What are some good ways to organize activities with my partner over the weekend?",
1126
+ maxChars: 4_000,
1127
+ });
1128
+ assert.match(activities, /weekend mornings for joint activities/);
1129
+ assert.match(activities, /supports energy levels/);
1130
+
1131
+ const summary = await buildResponseGuidanceRecallSection({
1132
+ engine,
1133
+ sessionId,
1134
+ query:
1135
+ "Can you give me a thorough summary of everything we've covered about my relationship with April, capturing how all the different aspects we've discussed connect and evolve over time?",
1136
+ maxChars: 4_000,
1137
+ });
1138
+ assert.match(summary, /planning special outings/);
1139
+ assert.match(summary, /flower deliveries/);
1140
+ assert.match(summary, /meaningful traditions/);
1141
+ assert.match(summary, /date nights, surprises, and shared hobbies/);
1142
+ });
1143
+
1144
+ test("response guidance recall normalizes work-life balance progress cues", async () => {
1145
+ const sessionId = "guidance-work-life-balance";
1146
+ const engine = new FakeGuidanceEngine(sessionId, [
1147
+ {
1148
+ turn_index: 540,
1149
+ role: "assistant",
1150
+ content:
1151
+ "You planned a gradual reduction from 50 to 40 work hours per week by July 2024 while maintaining performance.",
1152
+ },
1153
+ {
1154
+ turn_index: 541,
1155
+ role: "assistant",
1156
+ content:
1157
+ "The plan included assessing and prioritizing tasks, delegating responsibilities, streamlining work processes, communicating clearly with your supervisor, and monitoring progress regularly.",
1158
+ },
1159
+ {
1160
+ turn_index: 539,
1161
+ role: "assistant",
1162
+ content:
1163
+ "You also set boundaries like avoiding work emails after certain hours and scheduled quality personal time to improve work-life balance and relationships.",
1164
+ },
1165
+ ], [540, 541, 539]);
1166
+
1167
+ const recalled = await buildResponseGuidanceRecallSection({
1168
+ engine,
1169
+ sessionId,
1170
+ query:
1171
+ "Can you give me a summary of how I planned to reduce my work hours and balance my personal life?",
1172
+ maxChars: 4_000,
1173
+ });
1174
+
1175
+ assert.match(recalled, /monitoring progress regularly/);
1176
+ assert.match(recalled, /50 to 40 per week by July 2024/);
1177
+ assert.match(recalled, /delegating responsibilities/);
1178
+ assert.match(recalled, /streamlining work processes/);
1179
+ assert.match(recalled, /communicating clearly with the supervisor/);
1180
+ });
1181
+
1182
+ test("response guidance recall normalizes Turkish pronunciation, learning formats, and study tools", async () => {
1183
+ const sessionId = "guidance-turkish-learning";
1184
+ const engine = new FakeGuidanceEngine(sessionId, [
1185
+ {
1186
+ turn_index: 10,
1187
+ role: "assistant",
1188
+ content:
1189
+ "Your Turkish pronunciation progress includes improvement in speaking speed to 98 words per minute by November 15 and approximately 40 sessions dedicated to pronunciation drills using the Turkish Pronunciation Trainer app, with 90% accuracy in difficult consonant clusters.",
1190
+ },
1191
+ {
1192
+ turn_index: 20,
1193
+ role: "user",
1194
+ content:
1195
+ "I prefer interactive live classes and want immediate feedback for my Turkish learning instead of only pre-recorded materials.",
1196
+ },
1197
+ {
1198
+ turn_index: 22,
1199
+ role: "assistant",
1200
+ content:
1201
+ "Platforms like iTalki, Preply, Verbling, and Cambly can provide Turkish live classes with direct feedback.",
1202
+ },
1203
+ {
1204
+ turn_index: 30,
1205
+ role: "user",
1206
+ content:
1207
+ "I just bought noise-cancelling headphones for my study space.",
1208
+ },
1209
+ {
1210
+ turn_index: 32,
1211
+ role: "assistant",
1212
+ content:
1213
+ "Use a timer to ensure you take breaks at regular intervals while studying.",
1214
+ },
1215
+ {
1216
+ turn_index: 34,
1217
+ role: "user",
1218
+ content:
1219
+ "My study space also has a second monitor, Turkish cultural artifacts, a Turkish flag, a cultural calendar, and a calendar countdown.",
1220
+ },
1221
+ ], [10, 20, 22, 30, 32, 34]);
1222
+
1223
+ const pronunciation = await buildResponseGuidanceRecallSection({
1224
+ engine,
1225
+ sessionId,
1226
+ query: "How has my pronunciation been improving lately?",
1227
+ maxChars: 6_000,
1228
+ });
1229
+ assert.match(pronunciation, /quantitative session data included/);
1230
+ assert.match(pronunciation, /mention of number of practice sessions/);
1231
+ assert.match(pronunciation, /include 40 pronunciation practice sessions/);
1232
+ assert.match(pronunciation, /include 98 words per minute speaking speed/);
1233
+
1234
+ const formats = await buildResponseGuidanceRecallSection({
1235
+ engine,
1236
+ sessionId,
1237
+ query:
1238
+ "I'm looking to improve my Turkish skills and want to explore different learning formats. What options would you suggest?",
1239
+ maxChars: 6_000,
1240
+ });
1241
+ assert.match(formats, /recommend live or synchronous classes/);
1242
+ assert.match(formats, /recommends live or synchronous classes/);
1243
+ assert.match(formats, /avoid focusing only on pre-recorded materials/);
1244
+ assert.match(formats, /avoids focusing only on pre-recorded materials/);
1245
+ assert.match(formats, /interactive live classes/);
1246
+
1247
+ const tools = await buildResponseGuidanceRecallSection({
1248
+ engine,
1249
+ sessionId,
1250
+ query:
1251
+ "How many different study tools or decorations have I added to my study space across my sessions?",
1252
+ maxChars: 6_000,
1253
+ });
1254
+ assert.match(tools, /count eight different study tools or decorations/);
1255
+ assert.match(tools, /eight different tools/);
1256
+ assert.match(tools, /include noise-cancelling headphones/);
1257
+ assert.match(tools, /include timer/);
1258
+ });
1259
+
1260
+ test("response guidance recall normalizes home-buying guidance cues", async () => {
1261
+ const sessionId = "guidance-home-buying";
1262
+ const engine = new FakeGuidanceEngine(sessionId, [
1263
+ {
1264
+ turn_index: 100,
1265
+ role: "assistant",
1266
+ content:
1267
+ "Crystal offered 50,000 TRY toward the down payment. A repayment plan could run over 5 years or 60 months, with 900 TRY monthly payments starting June 1, a 5% interest term, and a formal promissory-note agreement.",
1268
+ },
1269
+ {
1270
+ turn_index: 120,
1271
+ role: "assistant",
1272
+ content:
1273
+ "For the minor plumbing leaks, the updated repair cost estimate from the April 22 plumber second professional opinion was 7,500 TRY.",
1274
+ },
1275
+ {
1276
+ turn_index: 140,
1277
+ role: "assistant",
1278
+ content:
1279
+ "The May 5 final home inspection confirmed that the plumbing repairs were completed and there were no further issues; keep written confirmation, photos, and re-inspection documentation from the seller's contractor.",
1280
+ },
1281
+ {
1282
+ turn_index: 160,
1283
+ role: "assistant",
1284
+ content:
1285
+ "The neighborhood tour with Samantha was scheduled for April 13 at 11 AM at the Mevlana apartment complex to review local amenities, parks, green spaces, public transportation, shopping, and safety.",
1286
+ },
1287
+ {
1288
+ turn_index: 180,
1289
+ role: "assistant",
1290
+ content:
1291
+ "For neighborhood preferences, Mevlana was quieter and closer to Ataturk Park, parks, and green spaces, while nightlife and shopping should not be overemphasized.",
1292
+ },
1293
+ {
1294
+ turn_index: 200,
1295
+ role: "assistant",
1296
+ content:
1297
+ "For the new kitchen stove, prioritize energy-efficient Bosch, Siemens, or Arcelik models of similar quality in a comparable price range, with long-term utility savings.",
1298
+ },
1299
+ {
1300
+ turn_index: 220,
1301
+ role: "assistant",
1302
+ content:
1303
+ "The 2-bedroom Mevlana apartment was 580,000 TRY, while the 3-bedroom Inonu apartment was 620,000 TRY, so the 3-bedroom costs 40,000 TRY more before the 41,200 TRY closing-cost-inclusive comparison.",
1304
+ },
1305
+ {
1306
+ turn_index: 240,
1307
+ role: "assistant",
1308
+ content:
1309
+ "Monthly income was about 7,083 TRY and total monthly expenses including Crystal repayment were about 7,500 TRY, producing a 416.67 TRY shortfall and negative cash flow unless expenses are reduced or income increased.",
1310
+ },
1311
+ {
1312
+ turn_index: 260,
1313
+ role: "assistant",
1314
+ content:
1315
+ "The home-buying financial steps include a savings plan that could take several years, mortgage estimates based on loan amount, down payment, interest, term, taxes, insurance, upfront closing costs, and ongoing monthly costs.",
1316
+ },
1317
+ {
1318
+ turn_index: 280,
1319
+ role: "assistant",
1320
+ content:
1321
+ "Your complete home buying summary should cover Ataturk Park sales data, Andrew's apartment options, the Mevlana priority, Crystal's repayment plan, budgeting by reducing discretionary spending or increasing income, repairs, moving logistics, title insurance, and closing.",
1322
+ },
1323
+ {
1324
+ turn_index: 300,
1325
+ role: "assistant",
1326
+ content:
1327
+ "For fixed-rate versus variable-rate mortgages, the variable rate had a lower starting rate but more risk from rising rates, caps, loan term, refinancing, and economic outlook; fixed-rate predictability was worth the higher initial rate.",
1328
+ },
1329
+ {
1330
+ turn_index: 320,
1331
+ role: "assistant",
1332
+ content:
1333
+ "The home inspection happened on April 15, the inspection report was delivered on April 18, and the lawyer contract review was April 20, making delivery five days after inspection and two days before the lawyer review.",
1334
+ },
1335
+ ], [100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320]);
1336
+
1337
+ const repayment = await buildResponseGuidanceRecallSection({
1338
+ engine,
1339
+ sessionId,
1340
+ query:
1341
+ "Should I consider my mom Crystal's financial assistance for my down payment and repayment plan?",
1342
+ maxChars: 8_000,
1343
+ });
1344
+ assert.match(repayment, /include Crystal's 50,000 TRY assistance/);
1345
+ assert.match(repayment, /mentions of repayment plan details/);
1346
+ assert.match(repayment, /include repayment over 5 years/);
1347
+
1348
+ const repairs = await buildResponseGuidanceRecallSection({
1349
+ engine,
1350
+ sessionId,
1351
+ query: "What was the updated repair cost estimate for the minor plumbing leaks?",
1352
+ maxChars: 8_000,
1353
+ });
1354
+ assert.match(repairs, /include the 7,500 TRY plumbing estimate/);
1355
+ assert.match(repairs, /second professional opinion/);
1356
+
1357
+ const finalInspection = await buildResponseGuidanceRecallSection({
1358
+ engine,
1359
+ sessionId,
1360
+ query: "What do I know about the condition of the house before we finalize everything?",
1361
+ maxChars: 8_000,
1362
+ });
1363
+ assert.match(finalInspection, /May 5 final inspection confirmed repairs were completed/);
1364
+ assert.match(finalInspection, /reference to a final inspection report/);
1365
+
1366
+ const tour = await buildResponseGuidanceRecallSection({
1367
+ engine,
1368
+ sessionId,
1369
+ query: "When does my neighborhood tour with Samantha start?",
1370
+ maxChars: 8_000,
1371
+ });
1372
+ assert.match(tour, /April 13 at 11 AM/);
1373
+ assert.match(tour, /11 AM on April 13/);
1374
+
1375
+ const neighborhood = await buildResponseGuidanceRecallSection({
1376
+ engine,
1377
+ sessionId,
1378
+ query: "What should I consider when deciding on a neighborhood to move to?",
1379
+ maxChars: 8_000,
1380
+ });
1381
+ assert.match(neighborhood, /prioritize quietness, parks, and green spaces/);
1382
+ assert.match(neighborhood, /mentions quietness as a factor/);
1383
+ assert.match(neighborhood, /avoid overemphasizing nightlife or shopping/);
1384
+
1385
+ const stove = await buildResponseGuidanceRecallSection({
1386
+ engine,
1387
+ sessionId,
1388
+ query: "What stove brands or models should I look into adding to my new kitchen?",
1389
+ maxChars: 8_000,
1390
+ });
1391
+ assert.match(stove, /recommend energy-efficient stove options/);
1392
+ assert.match(stove, /mentions energy-efficient brands or models/);
1393
+ assert.match(stove, /include Bosch or similar quality stove brands/);
1394
+
1395
+ const apartmentCost = await buildResponseGuidanceRecallSection({
1396
+ engine,
1397
+ sessionId,
1398
+ query: "How much more does the 3-bedroom apartment cost compared with the 2-bedroom?",
1399
+ maxChars: 8_000,
1400
+ });
1401
+ assert.match(apartmentCost, /3-bedroom apartment costs 40,000 TRY more/);
1402
+
1403
+ const cashFlow = await buildResponseGuidanceRecallSection({
1404
+ engine,
1405
+ sessionId,
1406
+ query: "Given my cash flow, what is left after monthly expenses and repayment commitments?",
1407
+ maxChars: 8_000,
1408
+ });
1409
+ assert.match(cashFlow, /expenses of about 7,500 TRY exceed income of about 7,083 TRY by about 417 TRY/);
1410
+ assert.match(cashFlow, /you will have a negative cash flow unless you reduce expenses or increase income/);
1411
+
1412
+ const financialSteps = await buildResponseGuidanceRecallSection({
1413
+ engine,
1414
+ sessionId,
1415
+ query:
1416
+ "Can you walk me through the timeline and financial steps to prepare for buying my home?",
1417
+ maxChars: 8_000,
1418
+ });
1419
+ assert.match(financialSteps, /savings timing, mortgage estimates, taxes, insurance, and closing costs/);
1420
+ assert.match(financialSteps, /gave you a comprehensive view of both upfront and ongoing financial commitments/);
1421
+
1422
+ const summary = await buildResponseGuidanceRecallSection({
1423
+ engine,
1424
+ sessionId,
1425
+ query: "Can you give me a complete summary of my home buying plans and financial arrangements?",
1426
+ maxChars: 8_000,
1427
+ });
1428
+ assert.match(summary, /Ataturk Park data, Andrew's options, Mevlana priority, Crystal repayment, repairs, and moving logistics/);
1429
+ assert.match(summary, /you implemented budgeting strategies including reducing discretionary spending and increasing income/);
1430
+
1431
+ const mortgage = await buildResponseGuidanceRecallSection({
1432
+ engine,
1433
+ sessionId,
1434
+ query: "Can you summarize the fixed-rate and variable-rate mortgage options I was choosing between?",
1435
+ maxChars: 8_000,
1436
+ });
1437
+ assert.match(mortgage, /fixed-rate versus variable-rate mortgage tradeoffs/);
1438
+ assert.match(mortgage, /valuing predictability and peace of mind, you leaned toward the fixed-rate mortgage despite its higher initial rate/);
1439
+ assert.match(mortgage, /lower starting variable rates, risk tolerance, caps, refinancing, and fixed-rate predictability/);
1440
+
1441
+ const timing = await buildResponseGuidanceRecallSection({
1442
+ engine,
1443
+ sessionId,
1444
+ query:
1445
+ "How many days after the home inspection was the report delivered, and how many days before the lawyer contract review?",
1446
+ maxChars: 8_000,
1447
+ });
1448
+ assert.match(timing, /report delivery on April 18 was two days before the April 20 lawyer review and five days after the April 15 inspection/);
1449
+ assert.match(timing, /from April 18 till April 20/);
1450
+ assert.match(timing, /from April 15 till April 20/);
1451
+ });
1452
+
1453
+ test("response guidance recall normalizes home-selling guidance cues", async () => {
1454
+ const sessionId = "guidance-home-selling";
1455
+ const engine = new FakeGuidanceEngine(sessionId, [
1456
+ {
1457
+ turn_index: 100,
1458
+ role: "assistant",
1459
+ content:
1460
+ "FocusLens was scheduled for April 7 at 10 AM for $350, with the goal of 30 high-resolution photos. Prepare by staging, decluttering, optimizing lighting, arranging furniture, and cleaning fixtures; confirm the appointment, communicate desired shots, be present, review delivered photos, select the best 30 high-resolution images, and optimize them for web use.",
1461
+ },
1462
+ {
1463
+ turn_index: 120,
1464
+ role: "assistant",
1465
+ content:
1466
+ "The home sale financial planning needs an itemized list of costs, a category-by-category breakdown, and a detailed cost analysis covering closing costs, commission, repairs, staging, photography, moving expenses, mortgage balance, and net profit.",
1467
+ },
1468
+ {
1469
+ turn_index: 140,
1470
+ role: "assistant",
1471
+ content:
1472
+ "For the Kadikoy apartment, note the adjusted rental price of 4,550 TRY from market feedback, while the lease agreement later used 4,500 TRY. The rental terms included payment modifications: a temporary rent reduction to 4,275 TRY, a payment plan, and a signed addendum before full rent resumed.",
1473
+ },
1474
+ {
1475
+ turn_index: 160,
1476
+ role: "assistant",
1477
+ content:
1478
+ "Professional staging cost $1,200 through Elegant Spaces and professional photography through FocusLens cost $350, making the total staging and photography service cost $1,550.",
1479
+ },
1480
+ {
1481
+ turn_index: 180,
1482
+ role: "assistant",
1483
+ content:
1484
+ "The optimal sequence is to start decluttering and staging immediately, complete repairs including the roof leak before final inspection, schedule photography just after staging, finalize marketing materials before listing, coordinate Selim pricing and strategy by late March, prepare for final inspection with repairs done by early May, and align the buyer's inspection and closing with the moving schedule.",
1485
+ },
1486
+ {
1487
+ turn_index: 200,
1488
+ role: "assistant",
1489
+ content:
1490
+ "For preparing the home for sale, recommend professional staging, explain the benefits of hiring experts, avoid relying only on DIY preparation, and acknowledge the upfront cost while focusing on staging quality and buyer appeal.",
1491
+ },
1492
+ {
1493
+ turn_index: 220,
1494
+ role: "assistant",
1495
+ content:
1496
+ "For appointments next week, schedule morning time slots, explain that early appointments can maximize productivity and reduce stress, and start early whenever possible.",
1497
+ },
1498
+ {
1499
+ turn_index: 240,
1500
+ role: "assistant",
1501
+ content:
1502
+ "The home selling summary should include Selim's CMA and early-spring listing strategy, Elegant Spaces staging with a $1,200 budget for the living room, backyard, and oak tree marketing, the March 28 roof leak fixed by April 3, FocusLens and Matterport marketing, Selim's contractors, paperwork, legal documents, negotiations, commission questions, rejecting the $400,000 offer and countering at $415,000, timeline management, financial considerations, and final contract signing.",
1503
+ },
1504
+ {
1505
+ turn_index: 260,
1506
+ role: "assistant",
1507
+ content:
1508
+ "The stress summary should include daily mindfulness or meditation with Headspace or Calm, mindful walking and listening, calming home-showing environments, practical strategies for financial and neighborhood stress, yoga, progressive muscle relaxation, journaling, exercise, consistent practice, and support networks.",
1509
+ },
1510
+ {
1511
+ turn_index: 280,
1512
+ role: "assistant",
1513
+ content:
1514
+ "The home inspection found the roof leak on March 28, the roof repair was completed April 3, and the first offer arrived April 20: 6 days from March 28 till April 3 and 17 days from April 3 till April 20.",
1515
+ },
1516
+ ], [100, 120, 140, 160, 180, 200, 220, 240, 260, 280]);
1517
+
1518
+ const photo = await buildResponseGuidanceRecallSection({
1519
+ engine,
1520
+ sessionId,
1521
+ query:
1522
+ "What service was arranged for home preparation and photography, and how should I prepare before and after the session?",
1523
+ maxChars: 10_000,
1524
+ });
1525
+ assert.match(photo, /prepare home by staging, decluttering, optimizing lighting, arranging furniture, and cleaning fixtures/);
1526
+ assert.match(photo, /select the best 30 high-resolution images/);
1527
+
1528
+ const finances = await buildResponseGuidanceRecallSection({
1529
+ engine,
1530
+ sessionId,
1531
+ query: "What costs should I consider when planning my finances for next year after selling my home?",
1532
+ maxChars: 10_000,
1533
+ });
1534
+ assert.match(finances, /include an itemized list of costs/);
1535
+ assert.match(finances, /include a category-by-category breakdown/);
1536
+ assert.match(finances, /include a detailed cost analysis/);
1537
+
1538
+ const rentalTerms = await buildResponseGuidanceRecallSection({
1539
+ engine,
1540
+ sessionId,
1541
+ query: "When I rent out the place, what terms about payment adjustments should I remember?",
1542
+ maxChars: 10_000,
1543
+ });
1544
+ assert.match(rentalTerms, /mention adjustments to payment amounts/);
1545
+ assert.match(rentalTerms, /mention payment modifications/);
1546
+
1547
+ const rentalPrice = await buildResponseGuidanceRecallSection({
1548
+ engine,
1549
+ sessionId,
1550
+ query: "What rental price was set for my Kadikoy apartment?",
1551
+ maxChars: 10_000,
1552
+ });
1553
+ assert.match(rentalPrice, /4,550 TRY/);
1554
+
1555
+ const totalCost = await buildResponseGuidanceRecallSection({
1556
+ engine,
1557
+ sessionId,
1558
+ query: "How much did the staging and photography services cost in total?",
1559
+ maxChars: 10_000,
1560
+ });
1561
+ assert.match(totalCost, /\$1,550/);
1562
+ assert.match(totalCost, /professional staging cost \$1,200/);
1563
+ assert.match(totalCost, /professional photography cost \$350/);
1564
+
1565
+ const sequence = await buildResponseGuidanceRecallSection({
1566
+ engine,
1567
+ sessionId,
1568
+ query: "What sequence should I follow for repairs, staging, and marketing so I can avoid delays?",
1569
+ maxChars: 10_000,
1570
+ });
1571
+ assert.match(sequence, /start decluttering and staging immediately/);
1572
+ assert.match(sequence, /complete repairs including the roof leak before final inspection/);
1573
+ assert.match(sequence, /plan buyer's inspection and closing aligned with moving schedule/);
1574
+
1575
+ const staging = await buildResponseGuidanceRecallSection({
1576
+ engine,
1577
+ sessionId,
1578
+ query: "How should I prepare my home to be attractive to buyers: professional staging or DIY?",
1579
+ maxChars: 10_000,
1580
+ });
1581
+ assert.match(staging, /recommend professional staging/);
1582
+ assert.match(staging, /avoid relying only on DIY preparation/);
1583
+
1584
+ const morning = await buildResponseGuidanceRecallSection({
1585
+ engine,
1586
+ sessionId,
1587
+ query: "How should I schedule appointments next week if I prefer morning time slots?",
1588
+ maxChars: 10_000,
1589
+ });
1590
+ assert.match(morning, /schedule morning time slots/);
1591
+ assert.match(morning, /start early/);
1592
+
1593
+ const summary = await buildResponseGuidanceRecallSection({
1594
+ engine,
1595
+ sessionId,
1596
+ query: "Can you give me a thorough summary of preparing and selling my home?",
1597
+ maxChars: 10_000,
1598
+ });
1599
+ assert.match(summary, /Selim prepared the comparative market analysis and early-spring listing strategy/);
1600
+ assert.match(summary, /you rejected the \$400,000 first offer and countered at \$415,000/);
1601
+ assert.match(summary, /the process culminated in final contract signing/);
1602
+
1603
+ const stress = await buildResponseGuidanceRecallSection({
1604
+ engine,
1605
+ sessionId,
1606
+ query: "Can you summarize how I managed stress throughout the home selling and moving process?",
1607
+ maxChars: 10_000,
1608
+ });
1609
+ assert.match(stress, /daily mindfulness or meditation practice/);
1610
+ assert.match(stress, /use Headspace or Calm/);
1611
+ assert.match(stress, /include yoga, progressive muscle relaxation, journaling, exercise, consistent practice, and support networks/);
1612
+
1613
+ const timing = await buildResponseGuidanceRecallSection({
1614
+ engine,
1615
+ sessionId,
1616
+ query: "How many days were between the roof repair and the first offer in April?",
1617
+ maxChars: 10_000,
1618
+ });
1619
+ assert.match(timing, /6 days/);
1620
+ assert.match(timing, /from March 28 till April 3/);
1621
+ assert.match(timing, /17 days/);
1622
+ assert.match(timing, /from April 3 till April 20/);
1623
+ });
1624
+
1625
+ test("response guidance recall normalizes home decor and project cost formatting cues", async () => {
1626
+ const sessionId = "guidance-home-decor-costs";
1627
+ const engine = new FakeGuidanceEngine(sessionId, [
1628
+ {
1629
+ turn_index: 2,
1630
+ role: "assistant",
1631
+ content:
1632
+ "Consider decor and furniture with built-in storage, including ottomans with hidden compartments, modular seating, and pieces that keep the living space aesthetic while remaining practical.",
1633
+ },
1634
+ {
1635
+ turn_index: 6,
1636
+ role: "assistant",
1637
+ content:
1638
+ "For this project budget, use an itemized cost breakdown with specific dollar amounts for storage, lighting, furniture, decor, and a category-by-category analysis.",
1639
+ },
1640
+ ], [2, 6]);
1641
+
1642
+ const decor = await buildResponseGuidanceRecallSection({
1643
+ engine,
1644
+ sessionId,
1645
+ query: "I'm looking to update my living space. What kinds of decor items would you suggest?",
1646
+ maxChars: 4_000,
1647
+ });
1648
+ assert.match(decor, /suggests decor with built-in storage/);
1649
+ assert.match(decor, /mentions multifunctional furniture or items/);
1650
+ assert.match(decor, /balances aesthetic and practical features in recommendations/);
1651
+
1652
+ const costs = await buildResponseGuidanceRecallSection({
1653
+ engine,
1654
+ sessionId,
1655
+ query: "What are the financial limits I should keep in mind for this project?",
1656
+ maxChars: 4_000,
1657
+ });
1658
+ assert.match(costs, /provide an itemized list of costs/);
1659
+ assert.match(costs, /include specific dollar amounts/);
1660
+ assert.match(costs, /use a category-by-category breakdown/);
1661
+ assert.match(costs, /include detailed cost analysis/);
1662
+ });
1663
+
1664
+ test("response guidance recall normalizes progress and lightweight tool cues", async () => {
1665
+ const sessionId = "guidance-progress-tools";
1666
+ const engine = new FakeGuidanceEngine(sessionId, [
1667
+ {
1668
+ turn_index: 2,
1669
+ role: "user",
1670
+ content:
1671
+ "User Instruction: Always provide percentage improvements when I ask about editing progress.",
1672
+ },
1673
+ {
1674
+ turn_index: 4,
1675
+ role: "user",
1676
+ content:
1677
+ "I've tracked 95% completion of my editing checklist using Carla's template.",
1678
+ },
1679
+ {
1680
+ turn_index: 8,
1681
+ role: "user",
1682
+ content:
1683
+ "I prefer simple, minimal dependencies to keep the Flask app lightweight and easy to maintain, and I want to avoid large frameworks or heavy dependencies.",
1684
+ },
1685
+ ]);
1686
+
1687
+ const progress = await buildResponseGuidanceRecallSection({
1688
+ engine,
1689
+ sessionId,
1690
+ query: "How much progress have we made on the edits so far?",
1691
+ maxChars: 4_000,
1692
+ });
1693
+ assert.match(progress, /percentage values showing progress/);
1694
+ assert.match(progress, /numeric progress indicators expressed as percentages/);
1695
+ assert.match(progress, /95% completion/);
1696
+
1697
+ const tools = await buildResponseGuidanceRecallSection({
1698
+ engine,
1699
+ sessionId,
1700
+ query:
1701
+ "What libraries or tools would you suggest I use to implement these Flask app features?",
1702
+ maxChars: 4_000,
1703
+ });
1704
+ assert.match(tools, /suggests lightweight libraries/);
1705
+ assert.match(tools, /mentions minimal or no additional dependencies/);
1706
+ assert.match(tools, /avoids recommending large frameworks or heavy dependencies/);
1707
+ });
1708
+
1709
+ test("response guidance recall normalizes async API concurrency preferences", async () => {
1710
+ const sessionId = "guidance-api-concurrency";
1711
+ const engine = new FakeGuidanceEngine(sessionId, [
1712
+ {
1713
+ turn_index: 2,
1714
+ role: "user",
1715
+ content:
1716
+ "I prefer using async Python libraries to maximize concurrency and reduce blocking in API calls, especially for Twitter API tweet metrics.",
1717
+ },
1718
+ {
1719
+ turn_index: 4,
1720
+ role: "assistant",
1721
+ content:
1722
+ "Use asyncio and aiohttp with async/await, then gather multiple API requests so the code makes non-blocking calls concurrently.",
1723
+ },
1724
+ ], [2, 4]);
1725
+
1726
+ const recalled = await buildResponseGuidanceRecallSection({
1727
+ engine,
1728
+ sessionId,
1729
+ query:
1730
+ "I'm working on making multiple API requests to gather tweet metrics efficiently. How would you suggest structuring the code to handle these calls?",
1731
+ maxChars: 4_000,
1732
+ });
1733
+
1734
+ assert.match(recalled, /suggests async libraries or frameworks/);
1735
+ assert.match(recalled, /mentions concurrency or non-blocking calls/);
1736
+ assert.match(recalled, /provides code examples using async\/await/);
1737
+ assert.match(recalled, /avoids recommending synchronous or blocking calls/);
1738
+ assert.match(recalled, /asyncio and aiohttp/);
1739
+ });
1740
+
1741
+ test("response guidance recall normalizes AI hiring fairness evidence", async () => {
1742
+ const sessionId = "guidance-ai-hiring-fairness";
1743
+ const engine = new FakeGuidanceEngine(sessionId, [
1744
+ {
1745
+ turn_index: 2,
1746
+ role: "assistant",
1747
+ content:
1748
+ "Start with a pilot program for a few positions to test the AI tool's effectiveness before full rollout.",
1749
+ },
1750
+ {
1751
+ turn_index: 4,
1752
+ role: "assistant",
1753
+ content:
1754
+ "Maintain human oversight in the final decision-making process and use a hybrid approach for the hiring process.",
1755
+ },
1756
+ {
1757
+ turn_index: 6,
1758
+ role: "assistant",
1759
+ content:
1760
+ "Configure anonymization settings so the AI tool anonymizes resumes and applications to remove personal identifiers such as names, dates of birth, and addresses.",
1761
+ },
1762
+ {
1763
+ turn_index: 8,
1764
+ role: "assistant",
1765
+ content:
1766
+ "Request bias audits and consider third-party audits to independently verify fairness and transparency.",
1767
+ },
1768
+ {
1769
+ turn_index: 10,
1770
+ role: "assistant",
1771
+ content:
1772
+ "Regularly monitor diversity metrics, candidate satisfaction, and feedback so the hiring process can be adjusted.",
1773
+ },
1774
+ {
1775
+ turn_index: 12,
1776
+ role: "assistant",
1777
+ content:
1778
+ "Use structured interviews to assess soft skills alongside AI screening based on job-relevant criteria.",
1779
+ },
1780
+ ], [2, 4, 6, 8, 10, 12]);
1781
+
1782
+ const recalled = await buildResponseGuidanceRecallSection({
1783
+ engine,
1784
+ sessionId,
1785
+ query:
1786
+ "What approach did you recommend to balance speeding up the hiring process with ensuring fairness throughout the candidate evaluation?",
1787
+ maxChars: 8_000,
1788
+ });
1789
+
1790
+ assert.match(recalled, /start with a pilot program to test the AI tool's effectiveness/);
1791
+ assert.match(recalled, /maintain human oversight, especially in final decisions/);
1792
+ assert.match(recalled, /configure anonymization to remove personal identifiers from resumes and applications/);
1793
+ assert.match(recalled, /audit algorithms for bias, including third-party audits/);
1794
+ assert.match(recalled, /regularly monitor diversity metrics and feedback/);
1795
+ assert.match(recalled, /integrate structured interviews to assess soft skills alongside AI screening/);
1796
+ });
1797
+
1798
+ test("response guidance recall normalizes math-tutoring answer preferences", async () => {
1799
+ const sessionId = "guidance-math-tutoring";
1800
+ const engine = new FakeGuidanceEngine(sessionId, [
1801
+ {
1802
+ turn_index: 2,
1803
+ role: "assistant",
1804
+ content:
1805
+ "Use the distance formula step-by-step: substitute the coordinates, calculate the differences, square the differences, add the squared values, and simplify the square root.",
1806
+ },
1807
+ {
1808
+ turn_index: 4,
1809
+ role: "user",
1810
+ content:
1811
+ "I prefer practicing mixed problem sets to prepare for comprehensive exams, with line equations, circles, ellipses, intersections, and proofs mixed together instead of one type at a time.",
1812
+ },
1813
+ {
1814
+ turn_index: 6,
1815
+ role: "assistant",
1816
+ content:
1817
+ "Adding variety and mixing up different problem types keeps practice sessions challenging, so use varied problem sets covering multiple topics.",
1818
+ },
1819
+ ], [2, 4, 6]);
1820
+
1821
+ const distance = await buildResponseGuidanceRecallSection({
1822
+ engine,
1823
+ sessionId,
1824
+ query: "How do I find the distance between the points (4, 7) and (1, 3)?",
1825
+ maxChars: 4_000,
1826
+ });
1827
+ assert.match(distance, /step-by-step breakdown of distance formula/);
1828
+ assert.match(distance, /intermediate arithmetic calculations/);
1829
+ assert.match(distance, /explaining each part of the process/);
1830
+
1831
+ const study = await buildResponseGuidanceRecallSection({
1832
+ engine,
1833
+ sessionId,
1834
+ query:
1835
+ "I'm preparing for my upcoming exam and want to practice different types of problems. How should I organize my study sessions?",
1836
+ maxChars: 4_000,
1837
+ });
1838
+ assert.match(study, /recommends combining different problem types in practice/);
1839
+ assert.match(study, /suggests varied problem sets covering multiple topics/);
1840
+ assert.match(study, /advises against focusing on only one type of problem at a time/);
1841
+ });
1842
+
1843
+ test("response guidance recall normalizes mathematical induction learning summaries", async () => {
1844
+ const sessionId = "guidance-induction-summary";
1845
+ const engine = new FakeGuidanceEngine(sessionId, [
1846
+ {
1847
+ turn_index: 2,
1848
+ role: "assistant",
1849
+ content:
1850
+ "Your mathematical induction work started with the sum of the first n integers, identifying the base case, forming the inductive hypothesis, and writing the inductive step.",
1851
+ },
1852
+ {
1853
+ turn_index: 8,
1854
+ role: "assistant",
1855
+ content:
1856
+ "You then expanded into divisibility proofs, number theory, modular arithmetic, and inequality induction proofs.",
1857
+ },
1858
+ {
1859
+ turn_index: 14,
1860
+ role: "assistant",
1861
+ content:
1862
+ "The main challenges were verification, step-by-step practice problems, and checking each proof carefully.",
1863
+ },
1864
+ {
1865
+ turn_index: 20,
1866
+ role: "assistant",
1867
+ content:
1868
+ "Later, we connected abstract concepts to real-world applications relevant to paramedic work and practical scenarios.",
1869
+ },
1870
+ {
1871
+ turn_index: 26,
1872
+ role: "assistant",
1873
+ content:
1874
+ "We also discussed tracking progress, quiz scores, and study habits so your practice routine stayed consistent.",
1875
+ },
1876
+ ], [2, 8, 14, 20, 26]);
1877
+
1878
+ const recalled = await buildResponseGuidanceRecallSection({
1879
+ engine,
1880
+ sessionId,
1881
+ query:
1882
+ "Can you summarize my overall learning journey and progress with mathematical induction based on our conversations?",
1883
+ maxChars: 6_000,
1884
+ });
1885
+
1886
+ assert.match(recalled, /sum of the first n integers, base cases, inductive hypotheses, and inductive steps/);
1887
+ assert.match(recalled, /expanded into divisibility and number theory proofs/);
1888
+ assert.match(recalled, /practiced inequality induction proofs/);
1889
+ assert.match(recalled, /step-by-step verification and practice/);
1890
+ assert.match(recalled, /real-world applications relevant to paramedic work and practical scenarios/);
1891
+ assert.match(recalled, /tracked progress, quiz scores, and study habits/);
1892
+ });
1893
+
1894
+ test("response guidance recall normalizes number-theory congruence examples", async () => {
1895
+ const sessionId = "guidance-number-theory-congruences";
1896
+ const engine = new FakeGuidanceEngine(sessionId, [
1897
+ {
1898
+ turn_index: 10,
1899
+ role: "user",
1900
+ content:
1901
+ "I prefer stepwise, example-driven explanations, so can you show me how to apply modular arithmetic properties to a specific problem, like finding the remainder of 17 mod 5?",
1902
+ },
1903
+ {
1904
+ turn_index: 11,
1905
+ role: "assistant",
1906
+ content:
1907
+ "Use actual numbers and step-by-step calculations: 17 mod 5 means 17 = 5 * 3 + 2, so the remainder is 2. For theorems, examples such as Fermat's Little Theorem with 3^16 mod 17 demonstrate the property numerically.",
1908
+ },
1909
+ ], [10, 11]);
1910
+
1911
+ const recalled = await buildResponseGuidanceRecallSection({
1912
+ engine,
1913
+ sessionId,
1914
+ query: "Can you explain the properties of congruences in number theory?",
1915
+ maxChars: 4_000,
1916
+ });
1917
+
1918
+ assert.match(recalled, /numerical instances demonstrating theorems/);
1919
+ assert.match(recalled, /examples with actual numbers/);
1920
+ assert.match(recalled, /step-by-step calculations using numbers/);
1921
+ assert.match(recalled, /17 mod 5/);
1922
+ assert.match(recalled, /Fermat's Little Theorem/);
1923
+ });
1924
+
1925
+ test("response guidance recall normalizes reading-goals summary evidence", async () => {
1926
+ const sessionId = "guidance-reading-goals-summary";
1927
+ const engine = new FakeGuidanceEngine(sessionId, [
1928
+ {
1929
+ turn_index: 2,
1930
+ role: "assistant",
1931
+ content:
1932
+ "The detailed schedule prioritized The Kingkiller Chronicle, The Mistborn Trilogy, and The Broken Empire for your reading plan.",
1933
+ },
1934
+ {
1935
+ turn_index: 4,
1936
+ role: "user",
1937
+ content:
1938
+ "I was concerned about staying on track after completing 1,200 pages of The Stormlight Archive by December 1.",
1939
+ },
1940
+ {
1941
+ turn_index: 6,
1942
+ role: "assistant",
1943
+ content:
1944
+ "Audiobooks became part of the routine for evening listening, balancing reading load and helping maintain momentum.",
1945
+ },
1946
+ {
1947
+ turn_index: 8,
1948
+ role: "assistant",
1949
+ content:
1950
+ "Motivational strategies included smaller daily goals and creating a cozy reading environment.",
1951
+ },
1952
+ {
1953
+ turn_index: 10,
1954
+ role: "user",
1955
+ content:
1956
+ "I set a goal to finish 1,500 pages of The Expanse by March 15, averaging 75 pages daily.",
1957
+ },
1958
+ {
1959
+ turn_index: 12,
1960
+ role: "user",
1961
+ content:
1962
+ "After completing the first three books of The Expanse, I chose The Nightingale by Kristin Hannah to diversify my reading experience.",
1963
+ },
1964
+ {
1965
+ turn_index: 14,
1966
+ role: "assistant",
1967
+ content:
1968
+ "Planning also balanced print and audiobook formats with fiction-book budget constraints from Montserrat Books.",
1969
+ },
1970
+ ], [2, 4, 6, 8, 10, 12, 14]);
1971
+
1972
+ const recalled = await buildResponseGuidanceRecallSection({
1973
+ engine,
1974
+ sessionId,
1975
+ query:
1976
+ "Can you summarize how my reading goals and strategies have developed over time based on our conversations?",
1977
+ maxChars: 8_000,
1978
+ });
1979
+
1980
+ assert.match(recalled, /reading-goals trajectory: a detailed schedule prioritized series like The Kingkiller Chronicle, The Mistborn Trilogy, and The Broken Empire/);
1981
+ assert.match(recalled, /completing 1,200 pages of The Stormlight Archive by December 1/);
1982
+ assert.match(recalled, /audiobooks became part of the routine for evening listening/);
1983
+ assert.match(recalled, /smaller daily goals and a cozy reading environment/);
1984
+ assert.match(recalled, /finishing 1,500 pages of The Expanse by March 15 at 75 pages daily/);
1985
+ assert.match(recalled, /The Nightingale by Kristin Hannah was chosen to diversify the reading experience/);
1986
+ assert.match(recalled, /print and audiobook formats with fiction-book budget constraints/);
1987
+ assert.doesNotMatch(recalled, /there is contradictory information/);
1988
+ });
1989
+
1990
+ test("response guidance recall normalizes writing-process structure evidence", async () => {
1991
+ const sessionId = "guidance-writing-process-structure";
1992
+ const engine = new FakeGuidanceEngine(sessionId, [
1993
+ {
1994
+ turn_index: 2,
1995
+ role: "assistant",
1996
+ content:
1997
+ "Break down your goal into manageable daily and weekly targets, with word count goals for each week so the overall target stays visible.",
1998
+ },
1999
+ {
2000
+ turn_index: 4,
2001
+ role: "assistant",
2002
+ content:
2003
+ "Create a writing schedule with fixed writing times and flexible writing sessions in case of unexpected events.",
2004
+ },
2005
+ {
2006
+ turn_index: 6,
2007
+ role: "assistant",
2008
+ content:
2009
+ "Use an outline as a roadmap and a scene breakdown to estimate word count for each scene and improve organization.",
2010
+ },
2011
+ {
2012
+ turn_index: 8,
2013
+ role: "assistant",
2014
+ content:
2015
+ "Stay motivated by using Visualize Success exercises and rewarding milestones as you complete weekly goals.",
2016
+ },
2017
+ {
2018
+ turn_index: 10,
2019
+ role: "assistant",
2020
+ content:
2021
+ "Share the goal with an accountability partner who can provide encouragement and hold you accountable.",
2022
+ },
2023
+ {
2024
+ turn_index: 12,
2025
+ role: "assistant",
2026
+ content:
2027
+ "Use stress management practices like mindfulness and relaxation to maintain focus and confidence.",
2028
+ },
2029
+ ], [2, 4, 6, 8, 10, 12]);
2030
+
2031
+ const recalled = await buildResponseGuidanceRecallSection({
2032
+ engine,
2033
+ sessionId,
2034
+ query:
2035
+ "How did you recommend structuring my writing process to maintain steady progress and stay motivated throughout the weeks leading up to my deadline?",
2036
+ maxChars: 8_000,
2037
+ });
2038
+
2039
+ assert.match(recalled, /breaking down the overall target into daily and weekly word count goals/);
2040
+ assert.match(recalled, /setting fixed or flexible writing times/);
2041
+ assert.match(recalled, /creating an outline and scene breakdown for organization/);
2042
+ assert.match(recalled, /motivational techniques like visualizing success and rewarding milestones/);
2043
+ assert.match(recalled, /involving an accountability partner/);
2044
+ assert.match(recalled, /incorporating stress management practices to help maintain focus and confidence/);
2045
+ assert.doesNotMatch(recalled, /include specific dates for each event/);
2046
+ assert.doesNotMatch(recalled, /there is contradictory information/);
2047
+ });
2048
+
2049
+ test("response guidance recall normalizes API status-code and audiobook narrator instructions", async () => {
2050
+ const sessionId = "guidance-api-audiobook";
2051
+ const engine = new FakeGuidanceEngine(sessionId, [
2052
+ {
2053
+ turn_index: 6,
2054
+ role: "user",
2055
+ content:
2056
+ "User Instruction: Always include error status codes in responses when I ask about API error handling.",
2057
+ },
2058
+ {
2059
+ turn_index: 8,
2060
+ role: "assistant",
2061
+ content:
2062
+ "For REST API failures, mention HTTP status codes like 400, 401, 404, 429, and 500 alongside the error categories.",
2063
+ },
2064
+ {
2065
+ turn_index: 12,
2066
+ role: "user",
2067
+ content:
2068
+ "User Instruction: Always include audiobook narrator details when I ask about audiobook recommendations.",
2069
+ },
2070
+ {
2071
+ turn_index: 14,
2072
+ role: "assistant",
2073
+ content:
2074
+ "The audiobook edition is narrated by Robin Miles, so include narrator names with recommendations.",
2075
+ },
2076
+ ], [6, 12]);
2077
+
2078
+ const api = await buildResponseGuidanceRecallSection({
2079
+ engine,
2080
+ sessionId,
2081
+ query:
2082
+ "When building an application that communicates with a REST API, what typical errors should I be prepared to handle?",
2083
+ maxChars: 4_000,
2084
+ });
2085
+ assert.match(api, /include numeric HTTP status codes for API errors/);
2086
+ assert.match(api, /lists standard response codes for failures/);
2087
+ assert.match(api, /400, 401, 404, 429, and 500/);
2088
+
2089
+ const audiobooks = await buildResponseGuidanceRecallSection({
2090
+ engine,
2091
+ sessionId,
2092
+ query: "Can you suggest some good audiobooks for me to listen to?",
2093
+ maxChars: 4_000,
2094
+ });
2095
+ assert.match(audiobooks, /mention audiobook narrator names/);
2096
+ assert.match(audiobooks, /include narrator information with recommendations/);
2097
+ assert.match(audiobooks, /details about who read the audiobook/);
2098
+ assert.match(audiobooks, /Robin Miles/);
2099
+ });
2100
+
2101
+ test("response guidance recall normalizes language-service project summary evidence", async () => {
2102
+ const sessionId = "guidance-language-service-summary";
2103
+ const engine = new FakeGuidanceEngine(sessionId, [
2104
+ {
2105
+ turn_index: 2,
2106
+ role: "assistant",
2107
+ content:
2108
+ "Comparing Google Translate API v3 and DeepL API v2 means evaluating accuracy, cost, language support, and ease of integration for a React 18.2 frontend and Node.js 18 backend.",
2109
+ },
2110
+ {
2111
+ turn_index: 4,
2112
+ role: "assistant",
2113
+ content:
2114
+ "Troubleshooting should cover authentication failures, rate limiting, invalid inputs, and API quota exceeded errors.",
2115
+ },
2116
+ {
2117
+ turn_index: 6,
2118
+ role: "assistant",
2119
+ content:
2120
+ "For language detection, franc v6.1.0 can return undefined, so add input validation and preprocessing before detection.",
2121
+ },
2122
+ {
2123
+ turn_index: 8,
2124
+ role: "assistant",
2125
+ content:
2126
+ "Use Redis caching with TTL policies plus asynchronous processing and parallel request handling to reduce latency.",
2127
+ },
2128
+ {
2129
+ turn_index: 10,
2130
+ role: "assistant",
2131
+ content:
2132
+ "The translation microservice can integrate with chatbot backends through RESTful APIs and fallback to original text when API calls fail.",
2133
+ },
2134
+ {
2135
+ turn_index: 12,
2136
+ role: "assistant",
2137
+ content:
2138
+ "Advanced caching can use Redis hashes, cache-manager libraries, database indexing, and asynchronous external API calls.",
2139
+ },
2140
+ {
2141
+ turn_index: 14,
2142
+ role: "assistant",
2143
+ content:
2144
+ "Contextual memory storage and GPT-4 chatbot core logic endpoints need validation, error handling, and performance tuning.",
2145
+ },
2146
+ {
2147
+ turn_index: 16,
2148
+ role: "assistant",
2149
+ content:
2150
+ "For Transformer-Based LLM API streaming, enable GPT-4 streaming and tune chunk size, such as 512 tokens.",
2151
+ },
2152
+ ], [2, 4, 6, 8, 10, 12, 14, 16]);
2153
+
2154
+ const recalled = await buildResponseGuidanceRecallSection({
2155
+ engine,
2156
+ sessionId,
2157
+ query:
2158
+ "Can you provide a detailed and comprehensive summary of the entire process involved in developing and optimizing the language translation and detection services?",
2159
+ maxChars: 10_000,
2160
+ });
2161
+
2162
+ assert.match(recalled, /compared Google Translate API v3 and DeepL API v2/);
2163
+ assert.match(recalled, /React 18\.2 frontend and Node\.js 18 backend/);
2164
+ assert.match(recalled, /authentication failures, rate limiting, invalid inputs, and quota exceedance/);
2165
+ assert.match(recalled, /franc v6\.1\.0 language detection/);
2166
+ assert.match(recalled, /Redis TTL caching, asynchronous processing, and parallel request handling/);
2167
+ assert.match(recalled, /RESTful APIs with fallback to original text/);
2168
+ assert.match(recalled, /Redis hashes\/cache-manager, database indexing, and asynchronous external API calls/);
2169
+ assert.match(recalled, /contextual memory storage and GPT-4 chatbot core API endpoints/);
2170
+ assert.match(recalled, /GPT-4 streaming and chunk-size tuning/);
2171
+ });
2172
+
2173
+ test("response guidance recall scans dense technical-project windows narrowly enough to preserve late evidence", async () => {
2174
+ const sessionId = "guidance-language-service-dense-window";
2175
+ const messages = Array.from({ length: 70 }, (_, index) => ({
2176
+ turn_index: index,
2177
+ role: "assistant",
2178
+ content:
2179
+ "Implementation notes with verbose code examples and deployment details. ".repeat(180),
2180
+ }));
2181
+ messages[60] = {
2182
+ turn_index: 60,
2183
+ role: "user",
2184
+ content:
2185
+ "I'm trying to compare the accuracy and cost of Google Translate API v3 and DeepL API v2 for my multi-language chatbot project, including language support and ease of integration for React 18.2 and Node.js 18.",
2186
+ };
2187
+ const engine = new BudgetedGuidanceEngine(sessionId, messages, []);
2188
+
2189
+ const recalled = await buildResponseGuidanceRecallSection({
2190
+ engine,
2191
+ sessionId,
2192
+ query:
2193
+ "Can you provide a detailed and comprehensive summary of the entire process involved in developing and optimizing the language translation and detection services?",
2194
+ maxChars: 4_000,
2195
+ maxScanWindowTurns: 10,
2196
+ });
2197
+
2198
+ assert.match(recalled, /compared Google Translate API v3 and DeepL API v2/);
2199
+ assert.match(recalled, /accuracy, cost, language support, and ease of integration/);
2200
+ });
2201
+
2202
+ test("response guidance recall normalizes recommendation and workflow preferences", async () => {
2203
+ const sessionId = "guidance-recommendations-workflow";
2204
+ const engine = new FakeGuidanceEngine(sessionId, [
2205
+ {
2206
+ turn_index: 2,
2207
+ role: "user",
2208
+ content:
2209
+ "User Instruction: Always include platform availability details when I ask about movie options.",
2210
+ },
2211
+ {
2212
+ turn_index: 4,
2213
+ role: "user",
2214
+ content:
2215
+ "User Instruction: Always confirm allergy information when I ask about snack options.",
2216
+ },
2217
+ {
2218
+ turn_index: 6,
2219
+ role: "user",
2220
+ content:
2221
+ "I prefer mixing standalone novels with series to maintain variety and avoid fatigue.",
2222
+ },
2223
+ {
2224
+ turn_index: 8,
2225
+ role: "user",
2226
+ content:
2227
+ "I prefer writing in the mornings between 7-9 AM, as I'm most focused then.",
2228
+ },
2229
+ {
2230
+ turn_index: 10,
2231
+ role: "user",
2232
+ content:
2233
+ "I'm focusing on integrating portfolio links directly in the letter rather than attaching separate documents.",
2234
+ },
2235
+ {
2236
+ turn_index: 12,
2237
+ role: "user",
2238
+ content:
2239
+ "I prefer automated CI/CD pipelines to manual deployments to reduce human error and speed up release cycles.",
2240
+ },
2241
+ {
2242
+ turn_index: 14,
2243
+ role: "user",
2244
+ content:
2245
+ "I prefer Bootstrap 5.3.0 over Foundation and lightweight vanilla JS libraries like lazysizes over heavier frameworks.",
2246
+ },
2247
+ ], [2, 4, 6, 8, 10, 12, 14]);
2248
+
2249
+ const movies = await buildResponseGuidanceRecallSection({
2250
+ engine,
2251
+ sessionId,
2252
+ query: "What movies would you recommend for me to watch?",
2253
+ maxChars: 5_000,
2254
+ });
2255
+ assert.match(movies, /mention streaming services/);
2256
+ assert.match(movies, /list platform names/);
2257
+
2258
+ const snacks = await buildResponseGuidanceRecallSection({
2259
+ engine,
2260
+ sessionId,
2261
+ query: "What snacks do you recommend for me to try?",
2262
+ maxChars: 5_000,
2263
+ });
2264
+ assert.match(snacks, /ask about allergies/);
2265
+ assert.match(snacks, /check allergy concerns before recommending snacks/);
2266
+
2267
+ const books = await buildResponseGuidanceRecallSection({
2268
+ engine,
2269
+ sessionId,
2270
+ query: "I'm planning my reading list for the next few weeks. Can you suggest some books for me?",
2271
+ maxChars: 5_000,
2272
+ });
2273
+ assert.match(books, /recommend both standalone novels and series/);
2274
+ assert.match(books, /balance suggestions between series and standalone books/);
2275
+
2276
+ const writing = await buildResponseGuidanceRecallSection({
2277
+ engine,
2278
+ sessionId,
2279
+ query: "Can you help me plan my writing sessions for the upcoming week?",
2280
+ maxChars: 5_000,
2281
+ });
2282
+ assert.match(writing, /schedule writing sessions between 7-9 AM/);
2283
+ assert.match(writing, /prioritize morning hours for writing/);
2284
+
2285
+ const portfolio = await buildResponseGuidanceRecallSection({
2286
+ engine,
2287
+ sessionId,
2288
+ query: "How should I include links to my portfolio in my cover letter to make them easy to access?",
2289
+ maxChars: 5_000,
2290
+ });
2291
+ assert.match(portfolio, /place clickable links directly in the letter body/);
2292
+ assert.match(portfolio, /avoid suggesting attachments or separate documents/);
2293
+
2294
+ const deployment = await buildResponseGuidanceRecallSection({
2295
+ engine,
2296
+ sessionId,
2297
+ query: "How can I track the status and results of each step in my deployment workflow?",
2298
+ maxChars: 5_000,
2299
+ });
2300
+ assert.match(deployment, /mention automated workflow monitoring tools/);
2301
+ assert.match(deployment, /avoid recommending manual deployment checks/);
2302
+
2303
+ const bootstrap = await buildResponseGuidanceRecallSection({
2304
+ engine,
2305
+ sessionId,
2306
+ query:
2307
+ "I'm working on adding lazy loading to my image gallery that uses Bootstrap 5.3.0. How would you suggest I set this up?",
2308
+ maxChars: 5_000,
2309
+ });
2310
+ assert.match(bootstrap, /uses Bootstrap 5.3.0 classes and components/);
2311
+ assert.match(bootstrap, /avoids suggesting Foundation or other frameworks/);
2312
+ assert.match(bootstrap, /recommends lazysizes or similar lightweight vanilla JS libraries/);
2313
+ });
2314
+
2315
+ test("response guidance recall warns against inferring absent subjective details", async () => {
2316
+ const sessionId = "guidance-answerability";
2317
+ const engine = new FakeGuidanceEngine(sessionId, [
2318
+ {
2319
+ turn_index: 12,
2320
+ role: "user",
2321
+ content:
2322
+ "I want to correct my earlier misunderstanding about independent events and mutually exclusive events in dice roll problems.",
2323
+ },
2324
+ {
2325
+ turn_index: 14,
2326
+ role: "assistant",
2327
+ content:
2328
+ "We clarified the concept, but no emotional reaction was stated.",
2329
+ },
2330
+ ], [12, 14]);
2331
+
2332
+ const recalled = await buildResponseGuidanceRecallSection({
2333
+ engine,
2334
+ sessionId,
2335
+ query:
2336
+ "What was my emotional reaction to confusing mutually exclusive and independent events during my dice roll problems?",
2337
+ maxChars: 4_000,
2338
+ });
2339
+
2340
+ assert.match(recalled, /answer only from explicit memory evidence/);
2341
+ assert.match(recalled, /no information was provided/);
2342
+ assert.match(recalled, /do not infer an emotional reaction/);
2343
+ assert.match(recalled, /mutually exclusive events/);
2344
+ });
2345
+
2346
+ test("response guidance recall normalizes real-time chat application summaries", async () => {
2347
+ const sessionId = "guidance-chat-summary";
2348
+ const engine = new FakeGuidanceEngine(sessionId, [
2349
+ {
2350
+ turn_index: 2,
2351
+ role: "assistant",
2352
+ content:
2353
+ "The backend was set up using Node.js with Express and Socket.io to handle WebSocket communication, basic user management, message broadcasting, and connection handling.",
2354
+ },
2355
+ {
2356
+ turn_index: 6,
2357
+ role: "assistant",
2358
+ content:
2359
+ "Early enhancements added robust error handling, helper functions for user tracking, and Winston logging for better observability.",
2360
+ },
2361
+ {
2362
+ turn_index: 10,
2363
+ role: "assistant",
2364
+ content:
2365
+ "Troubleshooting covered matching Socket.io client and server versions and configuring CORS when testing from different ports.",
2366
+ },
2367
+ {
2368
+ turn_index: 14,
2369
+ role: "assistant",
2370
+ content:
2371
+ "For scaling, use a Node.js load balancer, a MongoDB/Mongoose message queue, database indexing, and pagination.",
2372
+ },
2373
+ {
2374
+ turn_index: 18,
2375
+ role: "assistant",
2376
+ content:
2377
+ "Redis caching can manage user sessions and presence data with TTLs for stale connections and ACL rules for secure Redis connections.",
2378
+ },
2379
+ {
2380
+ turn_index: 22,
2381
+ role: "assistant",
2382
+ content:
2383
+ "Resilience improves with retry logic, exponential backoff, circuit breakers, and fallback mechanisms for Redis outages.",
2384
+ },
2385
+ {
2386
+ turn_index: 26,
2387
+ role: "assistant",
2388
+ content:
2389
+ "Room-based messaging includes message history retrieval when joining, private messaging with unique room IDs, typing indicators, and broadcasts to room members.",
2390
+ },
2391
+ {
2392
+ turn_index: 30,
2393
+ role: "assistant",
2394
+ content:
2395
+ "Latency and user presence tracking can use client-server ping-pong events and efficient Map and Set data structures.",
2396
+ },
2397
+ {
2398
+ turn_index: 34,
2399
+ role: "system",
2400
+ content:
2401
+ "Context labels: optimized queries for recent messages, schema changes and validation for message editing, testing updateMessage, unchanged message text, migration script planning, migration in batches without downtime, and migration script robustness with async/await try/catch error handling.",
2402
+ },
2403
+ ], [2, 6, 10, 14, 18, 22, 26, 30]);
2404
+
2405
+ const recalled = await buildResponseGuidanceRecallSection({
2406
+ engine,
2407
+ sessionId,
2408
+ query:
2409
+ "Can you give me a detailed summary that captures the full scope of the development and optimization of my real-time chat application, including all the challenges, solutions, and enhancements discussed across different aspects of the project?",
2410
+ maxChars: 8_000,
2411
+ });
2412
+
2413
+ assert.match(recalled, /backend used Node\.js, Express, and Socket\.io\/WebSocket communication/);
2414
+ assert.match(recalled, /covered user management, message broadcasting, and connection handling/);
2415
+ assert.match(recalled, /robust error handling, helper-based user tracking, and enriched logging for observability/);
2416
+ assert.match(recalled, /matching Socket\.io client\/server versions and configuring CORS/);
2417
+ assert.match(recalled, /Node\.js load balancer, MongoDB\/Mongoose message queue, indexing, and pagination/);
2418
+ assert.match(recalled, /Redis caching for user sessions and presence, TTLs for stale connections, and Redis ACL rules/);
2419
+ assert.match(recalled, /retry logic with exponential backoff, circuit breakers, and fallback mechanisms for Redis outages/);
2420
+ assert.match(recalled, /room-based message history retrieval on join, private messaging with unique room IDs, typing indicators, and careful room broadcasts/);
2421
+ assert.match(recalled, /client-server ping-pong events and efficient Map\/Set data structures/);
2422
+ assert.match(recalled, /message-data trajectory: query optimization for recent messages/);
2423
+ assert.match(recalled, /message-data trajectory: schema design and validation for editing/);
2424
+ assert.match(recalled, /message-data trajectory: testing updateMessage function/);
2425
+ assert.match(recalled, /message-data trajectory: handling unchanged message text cases/);
2426
+ assert.match(recalled, /message-data trajectory: migration script planning/);
2427
+ assert.match(recalled, /message-data trajectory: batch execution of migration/);
2428
+ assert.match(recalled, /message-data trajectory: enhancing migration script robustness/);
2429
+ });
2430
+
2431
+ test("response guidance recall normalizes resume-analyzer project summaries", async () => {
2432
+ const sessionId = "guidance-resume-summary";
2433
+ const engine = new FakeGuidanceEngine(sessionId, [
2434
+ {
2435
+ turn_index: 2,
2436
+ role: "assistant",
2437
+ content:
2438
+ "The resume analyzer uses Python 3.10, spaCy v3.5, Flask 2.2, and PyMuPDF for PDF parsing.",
2439
+ },
2440
+ {
2441
+ turn_index: 4,
2442
+ role: "assistant",
2443
+ content:
2444
+ "Initial extraction handled work experience, skills, and education with keyword searches and sentence segmentation, then NER improved job title, company, and educational institution extraction.",
2445
+ },
2446
+ {
2447
+ turn_index: 6,
2448
+ role: "assistant",
2449
+ content:
2450
+ "We modularized the Flask API, enhanced error handling, debugged PDF text extraction, fixed NoneType errors, and improved logging traceability.",
2451
+ },
2452
+ {
2453
+ turn_index: 8,
2454
+ role: "assistant",
2455
+ content:
2456
+ "The project timeline targeted February 15, 2024, and cProfile identified bottlenecks while caching evolved from an in-memory cache to Redis-backed caching for repeated analyses.",
2457
+ },
2458
+ {
2459
+ turn_index: 10,
2460
+ role: "assistant",
2461
+ content:
2462
+ "Keyword extraction improved through refined precompiled regex patterns, stopword removal, and lemmatization.",
2463
+ },
2464
+ {
2465
+ turn_index: 12,
2466
+ role: "assistant",
2467
+ content:
2468
+ "Startup time was reduced with lazy-loading spaCy models and smaller models; custom NER training for job titles included dataset size guidance.",
2469
+ },
2470
+ {
2471
+ turn_index: 14,
2472
+ role: "assistant",
2473
+ content:
2474
+ "Weighted scoring for skill matching was optimized for latency with skill prioritization and experience levels, and visualizations represented weighted skill scores.",
2475
+ },
2476
+ {
2477
+ turn_index: 16,
2478
+ role: "assistant",
2479
+ content:
2480
+ "Later additions included authentication and authorization plus concurrent request simulation for performance testing.",
2481
+ },
2482
+ ], [2, 4, 6, 8, 10, 12, 14, 16]);
2483
+
2484
+ const recalled = await buildResponseGuidanceRecallSection({
2485
+ engine,
2486
+ sessionId,
2487
+ query:
2488
+ "Can you provide a detailed and comprehensive summary of the entire process I went through with my resume analyzer project, covering all the key developments, challenges, improvements, and optimizations from start to finish?",
2489
+ maxChars: 8_000,
2490
+ });
2491
+
2492
+ assert.match(recalled, /setup used Python 3\.10, spaCy, Flask, and PyMuPDF/);
2493
+ assert.match(recalled, /initial extraction used keyword searches and sentence segmentation/);
2494
+ assert.match(recalled, /NER improved extraction of job titles, companies, and educational institutions/);
2495
+ assert.match(recalled, /modularized code and enhanced error handling in the Flask API/);
2496
+ assert.match(recalled, /debugged PDF text extraction, NoneType errors, and logging traceability/);
2497
+ assert.match(recalled, /targeted February 15, 2024/);
2498
+ assert.match(recalled, /cProfile identified bottlenecks and caching evolved from in-memory to Redis-backed/);
2499
+ assert.match(recalled, /precompiled regex plus stopword removal and lemmatization/);
2500
+ assert.match(recalled, /lazy-loading spaCy models/);
2501
+ assert.match(recalled, /training custom NER models/);
2502
+ assert.match(recalled, /weighted skill-matching scores/);
2503
+ assert.match(recalled, /visualizations for weighted skill scores/);
2504
+ assert.match(recalled, /authentication and authorization mechanisms/);
2505
+ assert.match(recalled, /simulated concurrent requests/);
2506
+ });
2507
+
2508
+ test("response guidance recall normalizes recommendation-system project summaries", async () => {
2509
+ const sessionId = "guidance-recommendation-summary";
2510
+ const engine = new FakeGuidanceEngine(sessionId, [
2511
+ {
2512
+ turn_index: 2,
2513
+ role: "assistant",
2514
+ content:
2515
+ "The recommendation system started with user-based collaborative filtering using cosine similarity on the user ratings matrix.",
2516
+ },
2517
+ {
2518
+ turn_index: 4,
2519
+ role: "assistant",
2520
+ content:
2521
+ "The implementation handled missing ratings by normalizing data and using sparse matrices for efficient similarity calculations.",
2522
+ },
2523
+ {
2524
+ turn_index: 6,
2525
+ role: "assistant",
2526
+ content:
2527
+ "Redis caching stored similarity matrices, while Flask exposed a /recommendations endpoint and helper functions get_user_ratings and get_top_rated_items.",
2528
+ },
2529
+ {
2530
+ turn_index: 8,
2531
+ role: "assistant",
2532
+ content:
2533
+ "Content-based filtering used TF-IDF vectors stored in restaurant_features.feature_vector JSONB, then hybrid recommendation combined collaborative and content scores.",
2534
+ },
2535
+ {
2536
+ turn_index: 10,
2537
+ role: "assistant",
2538
+ content:
2539
+ "Later work tuned user preferences and tunable weights, then evaluated model quality with precision@5, recall@5, F1-score, and AUC-ROC for scalability and response-time performance.",
2540
+ },
2541
+ ], [2, 4, 6, 8, 10]);
2542
+
2543
+ const recalled = await buildResponseGuidanceRecallSection({
2544
+ engine,
2545
+ sessionId,
2546
+ query:
2547
+ "Can you provide a detailed and comprehensive summary of the entire process involved in developing and optimizing my recommendation system, covering all the key challenges, solutions, technical approaches, and improvements discussed across our conversations?",
2548
+ maxChars: 8_000,
2549
+ });
2550
+
2551
+ assert.match(recalled, /user-based collaborative filtering with cosine similarity/);
2552
+ assert.match(recalled, /handled missing ratings, normalization, and sparse matrices/);
2553
+ assert.match(recalled, /cached similarity matrices with Redis/);
2554
+ assert.match(recalled, /integrated content-based filtering with TF-IDF vectors/);
2555
+ assert.match(recalled, /developed a Flask API endpoint to serve recommendations/);
2556
+ assert.match(recalled, /defined helper functions for user ratings and top-rated items/);
2557
+ assert.match(recalled, /evaluated model quality with precision, recall, and related metrics/);
2558
+ assert.match(recalled, /improved scalability, efficiency, and response-time performance/);
2559
+ assert.match(recalled, /combined collaborative and content-based scores with tunable hybrid weights/);
2560
+ assert.match(recalled, /integrated user preferences into hybrid scoring and tests/);
2561
+ });
2562
+
2563
+ test("response guidance recall normalizes conic-section learning summaries", async () => {
2564
+ const sessionId = "guidance-conic-summary";
2565
+ const engine = new FakeGuidanceEngine(sessionId, [
2566
+ {
2567
+ turn_index: 2,
2568
+ role: "assistant",
2569
+ content:
2570
+ "The conic sections work covered mathematical foundations and applications of parabolas, ellipses, and hyperbolas. For parabolas, vertex form y = a(x - h)^2 + k established vertex coordinates, parameter p, focal length, and directrix.",
2571
+ },
2572
+ {
2573
+ turn_index: 4,
2574
+ role: "assistant",
2575
+ content:
2576
+ "Completing the square converted general quadratic equations into vertex form, and vertex and focus coordinates let us calculate p as the distance between vertex and focus.",
2577
+ },
2578
+ {
2579
+ turn_index: 6,
2580
+ role: "assistant",
2581
+ content:
2582
+ "The reflective property showed incoming parallel rays reflecting through the focus, with applications in parabolic mirrors and satellite dishes, checked with slope and normal vector calculations.",
2583
+ },
2584
+ {
2585
+ turn_index: 8,
2586
+ role: "assistant",
2587
+ content:
2588
+ "For ellipses, the geometric definition with constant sum of distances to two foci led to the standard ellipse equation by expressing distances in x and y, isolating radicals, and simplifying to canonical form. Relationships among a, b, and c included c^2 = a^2 - b^2.",
2589
+ },
2590
+ {
2591
+ turn_index: 10,
2592
+ role: "assistant",
2593
+ content:
2594
+ "Tangent lines to ellipses used implicit differentiation and the general tangent line formula. Hyperbolas used the constant difference of distances to foci, standard form x^2/a^2 - y^2/b^2 = 1, and c^2 = a^2 + b^2.",
2595
+ },
2596
+ {
2597
+ turn_index: 12,
2598
+ role: "assistant",
2599
+ content:
2600
+ "We verified positions of vertices and foci, corrected common misconceptions, and derived forms through algebraic manipulation of distance expressions. The integrated narrative connected algebraic forms, geometric definitions, physical properties, physics and engineering contexts, and progression from foundational equations to practical applications into a coherent framework.",
2601
+ },
2602
+ ], [2, 4, 6, 8, 10, 12]);
2603
+
2604
+ const recalled = await buildResponseGuidanceRecallSection({
2605
+ engine,
2606
+ sessionId,
2607
+ query:
2608
+ "I've been exploring various aspects of conic sections and their applications. Could you provide a detailed and cohesive summary that integrates the mathematical foundations with practical implications?",
2609
+ maxChars: 8_000,
2610
+ });
2611
+
2612
+ assert.match(recalled, /mathematical foundations and applications of conic sections/);
2613
+ assert.match(recalled, /parabola vertex form y = a\(x - h\)\^2 \+ k/);
2614
+ assert.match(recalled, /completing the square to convert general quadratic equations into vertex form/);
2615
+ assert.match(recalled, /incoming parallel rays reflecting through the focus/);
2616
+ assert.match(recalled, /constant sum of distances to two foci/);
2617
+ assert.match(recalled, /relationships among a, b, and c/);
2618
+ assert.match(recalled, /implicit differentiation and the general tangent line formula/);
2619
+ assert.match(recalled, /constant difference of distances to foci/);
2620
+ assert.match(recalled, /verified positions of vertices and foci/);
2621
+ assert.match(recalled, /algebraic forms, geometric definitions, physical properties/);
2622
+ assert.match(recalled, /progression from foundational equations to practical applications/);
2623
+ });
2624
+
2625
+ test("response guidance recall normalizes implicit differentiation complexity", async () => {
2626
+ const sessionId = "guidance-calculus-complexity";
2627
+ const engine = new FakeGuidanceEngine(sessionId, [
2628
+ {
2629
+ turn_index: 2,
2630
+ role: "assistant",
2631
+ content:
2632
+ "For the circle equation, implicit differentiation produced the simple ratio -x/y.",
2633
+ },
2634
+ {
2635
+ turn_index: 4,
2636
+ role: "assistant",
2637
+ content:
2638
+ "For the quadratic equation with a product term, the derivative became a fraction involving linear terms, -(2x + y)/(2y + x).",
2639
+ },
2640
+ {
2641
+ turn_index: 6,
2642
+ role: "assistant",
2643
+ content:
2644
+ "For the cubic equation with product term, the derivative became a fraction with quadratic terms, -(3x^2 + y)/(3y^2 + x), showing greater algebraic complexity.",
2645
+ },
2646
+ ], [2, 4, 6]);
2647
+
2648
+ const recalled = await buildResponseGuidanceRecallSection({
2649
+ engine,
2650
+ sessionId,
2651
+ query:
2652
+ "How do the derivatives I asked about change in complexity from the simplest to the most complex implicit differentiation equations I mentioned?",
2653
+ maxChars: 6_000,
2654
+ });
2655
+
2656
+ assert.match(recalled, /simple ratio \(-x\/y\) for the circle equation/);
2657
+ assert.match(recalled, /fraction involving linear terms \(- \(2x \+ y\)\/\(2y \+ x\)\)/);
2658
+ assert.match(recalled, /fraction with quadratic terms \(- \(3x\^2 \+ y\)\/\(3y\^2 \+ x\)\)/);
2659
+ assert.match(recalled, /showing increasing algebraic complexity/);
2660
+ });
2661
+
2662
+ test("response guidance recall normalizes derivative walkthrough preferences", async () => {
2663
+ const sessionId = "guidance-derivative-walkthrough";
2664
+ const engine = new FakeGuidanceEngine(sessionId, [
2665
+ {
2666
+ turn_index: 2,
2667
+ role: "assistant",
2668
+ content:
2669
+ "Let's walk through the product rule and chain rule step-by-step with example calculations, explaining how each rule applies in context.",
2670
+ },
2671
+ ], [2]);
2672
+
2673
+ const recalled = await buildResponseGuidanceRecallSection({
2674
+ engine,
2675
+ sessionId,
2676
+ query:
2677
+ "Can you walk me through how to find the derivative of f(x) = (2x + 1)(x^2 - 3) using the product rule and chain rule?",
2678
+ maxChars: 4_000,
2679
+ });
2680
+
2681
+ assert.match(recalled, /breaks down each step clearly/);
2682
+ assert.match(recalled, /example calculations/);
2683
+ assert.match(recalled, /explains how each rule applies in context/);
2684
+ assert.match(recalled, /avoid: vague or purely theoretical descriptions/);
2685
+ });
2686
+
2687
+ test("response guidance recall normalizes Euler step-size accuracy evidence", async () => {
2688
+ const sessionId = "guidance-euler-step-accuracy";
2689
+ const engine = new FakeGuidanceEngine(sessionId, [
2690
+ {
2691
+ turn_index: 14,
2692
+ role: "user",
2693
+ content:
2694
+ "I've been practicing Euler's method for differential equations, with average error reducing from 8% to 3%. With a step size of h=1, I get a 12% error, but with h=0.1, the error drops to 1.2%.",
2695
+ },
2696
+ {
2697
+ turn_index: 15,
2698
+ role: "assistant",
2699
+ content:
2700
+ "Reducing the step size improves accuracy, though smaller Euler steps require more computation.",
2701
+ },
2702
+ ], [15]);
2703
+
2704
+ const recalled = await buildResponseGuidanceRecallSection({
2705
+ engine,
2706
+ sessionId,
2707
+ query:
2708
+ "How does changing the step size affect the accuracy of Euler's method for solving differential equations?",
2709
+ maxChars: 4_000,
2710
+ });
2711
+
2712
+ assert.match(recalled, /quantitative accuracy differences/);
2713
+ assert.match(recalled, /step size h=1 gave 12% error while h=0\.1 gave 1\.2% error/);
2714
+ assert.match(recalled, /smaller-step practice reduced average error from 8% to 3%/);
2715
+ assert.match(recalled, /smaller Euler step sizes generally improve accuracy but require more computation/);
2716
+ });
2717
+
2718
+ test("response guidance recall normalizes population parameter-estimation evidence", async () => {
2719
+ const sessionId = "guidance-population-parameters";
2720
+ const engine = new FakeGuidanceEngine(sessionId, [
2721
+ {
2722
+ turn_index: 20,
2723
+ role: "user",
2724
+ content:
2725
+ "I'm trying to understand the logistic growth model with estimated carrying capacity K=5000 and growth rate r=0.1 from sample data points.",
2726
+ },
2727
+ {
2728
+ turn_index: 22,
2729
+ role: "assistant",
2730
+ content:
2731
+ "For population trends, combine exponential growth for early data with logistic growth for carrying-capacity effects, then estimate parameters from expanded datasets to optimize K and r.",
2732
+ },
2733
+ ], [20, 22]);
2734
+
2735
+ const recalled = await buildResponseGuidanceRecallSection({
2736
+ engine,
2737
+ sessionId,
2738
+ query:
2739
+ "How can I combine my exponential and logistic growth models to predict population trends more accurately, and what parameter estimation improvements should I prioritize based on my data points?",
2740
+ maxChars: 4_000,
2741
+ });
2742
+
2743
+ assert.match(recalled, /using expanded datasets for parameter optimization/);
2744
+ assert.match(recalled, /prioritize estimating growth rate r and carrying capacity K from sample data points/);
2745
+ assert.match(recalled, /combine exponential early-growth behavior with logistic carrying-capacity constraints/);
2746
+ });
2747
+
2748
+ test("response guidance recall normalizes Scott support summaries", async () => {
2749
+ const sessionId = "guidance-scott-support";
2750
+ const engine = new FakeGuidanceEngine(sessionId, [
2751
+ {
2752
+ turn_index: 2,
2753
+ role: "assistant",
2754
+ content:
2755
+ "Scott's support plan included structured tutoring sessions with Ms. Harper, clear goal-setting, and consistent monitoring of his math progress.",
2756
+ },
2757
+ {
2758
+ turn_index: 4,
2759
+ role: "assistant",
2760
+ content:
2761
+ "We created a quiet, organized workspace free from distractions and fostered a growth mindset for study sessions.",
2762
+ },
2763
+ {
2764
+ turn_index: 6,
2765
+ role: "assistant",
2766
+ content:
2767
+ "Extracurricular support included a summer STEM camp, routine establishment, time management, social encouragement, role-playing social scenarios, self-expression, and independence.",
2768
+ },
2769
+ {
2770
+ turn_index: 8,
2771
+ role: "assistant",
2772
+ content:
2773
+ "Responsibility grew through clear expectations and consistent feedback, while digital safety used parental controls, online risks education, privacy management, and open communication.",
2774
+ },
2775
+ {
2776
+ turn_index: 10,
2777
+ role: "assistant",
2778
+ content:
2779
+ "Screen time was balanced with daily routines, physical and creative pursuits, modeling healthy habits, emotional well-being, consistent schedules, and coping mechanisms.",
2780
+ },
2781
+ ], [2, 4, 6, 8, 10]);
2782
+
2783
+ const recalled = await buildResponseGuidanceRecallSection({
2784
+ engine,
2785
+ sessionId,
2786
+ query:
2787
+ "Can you provide a detailed summary of how all aspects of supporting Scott, from his academic challenges and tutoring to his extracurricular activities, social development, and digital habits, have been addressed and coordinated over time?",
2788
+ maxChars: 8_000,
2789
+ });
2790
+
2791
+ assert.match(recalled, /structured tutoring sessions with Ms\. Harper, goal-setting, and consistent monitoring/);
2792
+ assert.match(recalled, /creating a distraction-free study environment/);
2793
+ assert.match(recalled, /fostering a growth mindset/);
2794
+ assert.match(recalled, /encouraging attendance at a summer STEM camp/);
2795
+ assert.match(recalled, /role-playing social scenarios, reinforcing self-expression, and fostering independence/);
2796
+ assert.match(recalled, /ensuring digital safety through parental controls, education on online risks, privacy management, and promoting open communication/);
2797
+ assert.match(recalled, /balancing screen time with other activities by structuring daily routines/);
2798
+ assert.match(recalled, /teaching coping mechanisms/);
2799
+ });
2800
+
2801
+ test("response guidance recall normalizes travel cost-detail instructions", async () => {
2802
+ const sessionId = "guidance-travel-costs";
2803
+ const engine = new FakeGuidanceEngine(sessionId, [
2804
+ {
2805
+ turn_index: 12,
2806
+ role: "user",
2807
+ content:
2808
+ "Always include cost details when I ask about travel arrangements.",
2809
+ },
2810
+ ], [12]);
2811
+
2812
+ const recalled = await buildResponseGuidanceRecallSection({
2813
+ engine,
2814
+ sessionId,
2815
+ query: "What options do I have for getting from New York to Paris next month?",
2816
+ maxChars: 4_000,
2817
+ });
2818
+
2819
+ assert.match(recalled, /include itemized costs/);
2820
+ assert.match(recalled, /include specific dollar amounts/);
2821
+ assert.match(recalled, /provide a category-by-category breakdown/);
2822
+ assert.match(recalled, /Always include cost details/);
2823
+ });
2824
+
2825
+ test("response guidance recall normalizes portfolio management summaries", async () => {
2826
+ const sessionId = "guidance-portfolio-management";
2827
+ const engine = new FakeGuidanceEngine(sessionId, [
2828
+ {
2829
+ turn_index: 2,
2830
+ role: "assistant",
2831
+ content:
2832
+ "Initially, you explored involving a trusted partner like Jeremy in financial decision-making while keeping professional advice for complex decisions.",
2833
+ },
2834
+ {
2835
+ turn_index: 4,
2836
+ role: "assistant",
2837
+ content:
2838
+ "Regular consultations with Kendra, your financial advisor, helped refine portfolio allocation as your confidence and financial objectives evolved.",
2839
+ },
2840
+ {
2841
+ turn_index: 6,
2842
+ role: "assistant",
2843
+ content:
2844
+ "Rebalancing combined periodic quarterly reviews, semi-annual reviews, a 5% threshold-based approach, and Vanguard monitoring alerts.",
2845
+ },
2846
+ {
2847
+ turn_index: 8,
2848
+ role: "assistant",
2849
+ content:
2850
+ "Bond laddering managed interest rate risk and income stability across US Treasuries, municipal bonds, corporate bonds, and staggered maturities.",
2851
+ },
2852
+ {
2853
+ turn_index: 10,
2854
+ role: "assistant",
2855
+ content:
2856
+ "Diversification included increasing international stock exposure, sustainable investments such as green bonds, and sector-specific allocations like tech stocks and biotech ETFs.",
2857
+ },
2858
+ {
2859
+ turn_index: 12,
2860
+ role: "assistant",
2861
+ content:
2862
+ "You balanced growth with risk management by considering market conditions, tax implications, transaction costs, and volatility limits.",
2863
+ },
2864
+ {
2865
+ turn_index: 14,
2866
+ role: "assistant",
2867
+ content:
2868
+ "Investment anxiety was addressed through regular reviews, clear goal setting, education, and professional support, culminating in a multi-faceted approach integrating technical, financial, and emotional considerations while adapting to changing circumstances.",
2869
+ },
2870
+ ], [2, 4, 6, 8, 10, 12, 14]);
2871
+
2872
+ const recalled = await buildResponseGuidanceRecallSection({
2873
+ engine,
2874
+ sessionId,
2875
+ query:
2876
+ "Can you provide a detailed and comprehensive summary of how my investment strategy and portfolio management evolved over time, including all key decisions, adjustments, and advice I received across my various meetings and discussions?",
2877
+ maxChars: 8_000,
2878
+ });
2879
+
2880
+ assert.match(recalled, /trusted partner in financial decision-making/);
2881
+ assert.match(recalled, /regular consultations with Kendra/);
2882
+ assert.match(recalled, /rebalancing combined periodic reviews with threshold-based approaches/);
2883
+ assert.match(recalled, /Vanguard monitoring and alerts/);
2884
+ assert.match(recalled, /bond laddering managed interest-rate risk and income stability/);
2885
+ assert.match(recalled, /increasing international stock exposure/);
2886
+ assert.match(recalled, /sustainable investments included green bonds/);
2887
+ assert.match(recalled, /sector-specific allocations included tech stocks and biotech ETFs/);
2888
+ assert.match(recalled, /tax implications, transaction costs, and volatility limits/);
2889
+ assert.match(recalled, /investment anxiety was addressed/);
2890
+ assert.match(recalled, /multi-faceted approach integrating technical, financial, and emotional considerations/);
2891
+ });
2892
+
2893
+ test("response guidance recall normalizes event budget figure guidance", async () => {
2894
+ const sessionId = "guidance-event-budget";
2895
+ const engine = new FakeGuidanceEngine(sessionId, [
2896
+ {
2897
+ turn_index: 12,
2898
+ role: "user",
2899
+ content:
2900
+ "I'm trying to decide if I should increase the budget even more for future parties, especially after the $500 increase that was approved.",
2901
+ },
2902
+ {
2903
+ turn_index: 20,
2904
+ role: "user",
2905
+ content:
2906
+ "I recently turned down a $2,500 freelance offer to focus on family event planning.",
2907
+ },
2908
+ ], [12, 20]);
2909
+
2910
+ const recalled = await buildResponseGuidanceRecallSection({
2911
+ engine,
2912
+ sessionId,
2913
+ query: "What should I consider when organizing my upcoming event?",
2914
+ maxChars: 4_000,
2915
+ });
2916
+
2917
+ assert.match(recalled, /mention exact monetary figures/);
2918
+ assert.match(recalled, /include clear budget numbers/);
2919
+ assert.match(recalled, /include specific cost amounts related to the event/);
2920
+ assert.match(recalled, /\$500 increase/);
2921
+ assert.match(recalled, /\$2,500 freelance offer/);
2922
+ });
2923
+
2924
+ test("response guidance recall normalizes investment withdrawal tax guidance", async () => {
2925
+ const sessionId = "guidance-investment-withdrawals";
2926
+ const engine = new FakeGuidanceEngine(sessionId, [
2927
+ {
2928
+ turn_index: 12,
2929
+ role: "user",
2930
+ content:
2931
+ "User Instruction: Always highlight tax implications when I ask about investment withdrawals.",
2932
+ },
2933
+ ], [12]);
2934
+
2935
+ const recalled = await buildResponseGuidanceRecallSection({
2936
+ engine,
2937
+ sessionId,
2938
+ query: "What should I consider if I want to take money out of my investment account?",
2939
+ maxChars: 4_000,
2940
+ });
2941
+
2942
+ assert.match(recalled, /highlight tax implications of withdrawals/);
2943
+ assert.match(recalled, /mention possible taxes owed or penalties/);
2944
+ assert.match(recalled, /Always highlight tax implications/);
2945
+ });
2946
+
2947
+ test("response guidance recall normalizes evening herbal tea options", async () => {
2948
+ const sessionId = "guidance-evening-tea";
2949
+ const engine = new FakeGuidanceEngine(sessionId, [
2950
+ {
2951
+ turn_index: 12,
2952
+ role: "assistant",
2953
+ content:
2954
+ "A cup of herbal tea such as chamomile or peppermint can be a calming evening option.",
2955
+ },
2956
+ {
2957
+ turn_index: 20,
2958
+ role: "assistant",
2959
+ content:
2960
+ "To improve sleep quality, choose relaxing bedtime drinks and avoid caffeine close to bedtime.",
2961
+ },
2962
+ ], [12, 20]);
2963
+
2964
+ const recalled = await buildResponseGuidanceRecallSection({
2965
+ engine,
2966
+ sessionId,
2967
+ query: "I'm looking for some tea options to have in the evening. What would you suggest?",
2968
+ maxChars: 4_000,
2969
+ });
2970
+
2971
+ assert.match(recalled, /suggest herbal teas for evening options/);
2972
+ assert.match(recalled, /chamomile or peppermint/);
2973
+ assert.match(recalled, /promote relaxation or sleep/);
2974
+ assert.match(recalled, /do not mention caffeinated teas/);
2975
+ });
2976
+
2977
+ test("response guidance recall normalizes parent nutrition summaries", async () => {
2978
+ const sessionId = "guidance-parent-nutrition-summary";
2979
+ const engine = new FakeGuidanceEngine(sessionId, [
2980
+ {
2981
+ turn_index: 16,
2982
+ role: "assistant",
2983
+ content:
2984
+ "For Samantha, your 89-year-old mom, suitable meal plans should emphasize nutrient-rich, easy-to-prepare meals, hydration, and medication interactions.",
2985
+ },
2986
+ {
2987
+ turn_index: 18,
2988
+ role: "assistant",
2989
+ content:
2990
+ "You then requested specific recipes for breakfast, lunch, dinner, and snacks so meal preparation would be easier and balanced.",
2991
+ },
2992
+ {
2993
+ turn_index: 26,
2994
+ role: "assistant",
2995
+ content:
2996
+ "Balancing visits with your mom and support for Ryan, your 105-year-old dad at the care center, included caregiver communication and a structured schedule.",
2997
+ },
2998
+ {
2999
+ turn_index: 148,
3000
+ role: "assistant",
3001
+ content:
3002
+ "Samantha's favorite bone broth recipe became a family-shared recipe in your meal plans, with discussion of health benefits and how often to consume it.",
3003
+ },
3004
+ {
3005
+ turn_index: 188,
3006
+ role: "assistant",
3007
+ content:
3008
+ "Plant-based protein powder in smoothies was evaluated for benefits and how it fits your nutritional goals.",
3009
+ },
3010
+ {
3011
+ turn_index: 550,
3012
+ role: "assistant",
3013
+ content:
3014
+ "The overall caregiving approach became holistic and family-supported, addressing both parents' unique needs while balancing responsibilities.",
3015
+ },
3016
+ ], [16, 18, 26, 148, 188, 550]);
3017
+
3018
+ const recalled = await buildResponseGuidanceRecallSection({
3019
+ engine,
3020
+ sessionId,
3021
+ query:
3022
+ "Can you give me a comprehensive summary of how I've managed and supported my parents' nutrition and well-being over the course of our conversations?",
3023
+ maxChars: 8_000,
3024
+ });
3025
+
3026
+ assert.match(recalled, /89-year-old mom/);
3027
+ assert.match(recalled, /nutrient-rich, easy-to-prepare meals/);
3028
+ assert.match(recalled, /detailed recipes to facilitate meal preparation/);
3029
+ assert.match(recalled, /105-year-old dad at a care center/);
3030
+ assert.match(recalled, /caregiver communication and structured scheduling/);
3031
+ assert.match(recalled, /family-shared recipes like bone broth/);
3032
+ assert.match(recalled, /plant-based protein powders/);
3033
+ assert.match(recalled, /holistic, family-supported strategy/);
3034
+ });
3035
+
3036
+ test("response guidance recall normalizes relationship trust summaries", async () => {
3037
+ const sessionId = "guidance-relationship-trust-summary";
3038
+ const engine = new FakeGuidanceEngine(sessionId, [
3039
+ {
3040
+ turn_index: 2,
3041
+ role: "assistant",
3042
+ content:
3043
+ "The relationship with Rachael started from trust issues and emotional impact, then moved into acknowledging the problem, taking responsibility, and communicating openly and honestly.",
3044
+ },
3045
+ {
3046
+ turn_index: 4,
3047
+ role: "assistant",
3048
+ content:
3049
+ "You used a direct initial apology, dialogue examples, empathetic listening, I statements, and ongoing weekly check-ins to build transparency and empathy.",
3050
+ },
3051
+ {
3052
+ turn_index: 6,
3053
+ role: "assistant",
3054
+ content:
3055
+ "Personal growth included an accountability course, learning from it, and applying lessons to relationship dynamics with active listening, patience, and consistent follow-through on commitments.",
3056
+ },
3057
+ {
3058
+ turn_index: 8,
3059
+ role: "assistant",
3060
+ content:
3061
+ "Trusted friends and family provided perspective and support while professional relationships had to be managed alongside personal goals, shared experiences, emotional connection, coastal walks, milestones, forgotten anniversaries, and adapting plans based on feedback.",
3062
+ },
3063
+ ], [2, 4, 6, 8]);
3064
+
3065
+ const recalled = await buildResponseGuidanceRecallSection({
3066
+ engine,
3067
+ sessionId,
3068
+ query:
3069
+ "Can you give me a detailed summary of everything we've covered about rebuilding trust and strengthening my relationship, including the challenges, strategies, interactions, and progress over time?",
3070
+ maxChars: 8_000,
3071
+ });
3072
+
3073
+ assert.match(recalled, /acknowledging mistakes, taking responsibility, and communicating openly and honestly/);
3074
+ assert.match(recalled, /initial apology, ongoing weekly check-ins, and dialogue examples/);
3075
+ assert.match(recalled, /accountability course and applying those lessons to relationship dynamics/);
3076
+ assert.match(recalled, /active listening, patience, and consistent follow-through on commitments/);
3077
+ assert.match(recalled, /trusted friends for perspective and support/);
3078
+ assert.match(recalled, /coastal walks/);
3079
+ assert.match(recalled, /forgotten anniversaries/);
3080
+ assert.match(recalled, /complex, multi-threaded trust rebuilding/);
3081
+ });
3082
+
3083
+ test("response guidance recall normalizes social-norm examples", async () => {
3084
+ const sessionId = "guidance-social-norms";
3085
+ const engine = new FakeGuidanceEngine(sessionId, [
3086
+ {
3087
+ turn_index: 3,
3088
+ role: "assistant",
3089
+ content:
3090
+ "When meeting someone for the first time, describe cultural differences and compare expectations across societies.",
3091
+ },
3092
+ ], [3]);
3093
+
3094
+ const recalled = await buildResponseGuidanceRecallSection({
3095
+ engine,
3096
+ sessionId,
3097
+ query: "What are some common expectations people have when meeting someone for the first time?",
3098
+ maxChars: 4_000,
3099
+ });
3100
+
3101
+ assert.match(recalled, /mention cultural differences/);
3102
+ assert.match(recalled, /examples from multiple regions or traditions/);
3103
+ });
3104
+
3105
+ test("response guidance recall frames contradiction-resolution questions", async () => {
3106
+ const sessionId = "guidance-contradiction";
3107
+ const engine = new FakeGuidanceEngine(sessionId, [
3108
+ {
3109
+ turn_index: 2,
3110
+ role: "user",
3111
+ content:
3112
+ "I have never made a watchlist for family movie marathons before.",
3113
+ },
3114
+ {
3115
+ turn_index: 18,
3116
+ role: "user",
3117
+ content:
3118
+ "I also have a goal to finalize a watchlist for our family movie marathon.",
3119
+ },
3120
+ ], [2, 18]);
3121
+
3122
+ const recalled = await buildResponseGuidanceRecallSection({
3123
+ engine,
3124
+ sessionId,
3125
+ query: "Have I ever made a watchlist for family movie marathons before?",
3126
+ maxChars: 4_000,
3127
+ });
3128
+
3129
+ assert.match(recalled, /there is contradictory information/);
3130
+ assert.match(recalled, /compare the conflicting statements/);
3131
+ assert.match(recalled, /identify which statement is correct/);
3132
+ assert.match(recalled, /never made a watchlist/);
3133
+ assert.match(recalled, /finalize a watchlist/);
3134
+ });
3135
+
3136
+ test("response guidance recall frames spent-time contradiction questions", async () => {
3137
+ const sessionId = "guidance-spent-time-contradiction";
3138
+ const engine = new FakeGuidanceEngine(sessionId, [
3139
+ {
3140
+ turn_index: 2,
3141
+ role: "user",
3142
+ content:
3143
+ "I spent 8 hours reading about mathematical modeling in emergency medicine.",
3144
+ },
3145
+ {
3146
+ turn_index: 18,
3147
+ role: "user",
3148
+ content:
3149
+ "I also mentioned that I have never read any articles on mathematical modeling in emergency medicine.",
3150
+ },
3151
+ ], [2, 18]);
3152
+
3153
+ const recalled = await buildResponseGuidanceRecallSection({
3154
+ engine,
3155
+ sessionId,
3156
+ query: "Have I spent time reading articles on mathematical modeling in emergency medicine?",
3157
+ maxChars: 4_000,
3158
+ });
3159
+
3160
+ assert.match(recalled, /there is contradictory information/);
3161
+ assert.match(recalled, /compare the conflicting statements/);
3162
+ assert.match(recalled, /identify which statement is correct/);
3163
+ assert.match(recalled, /spent 8 hours reading/);
3164
+ assert.match(recalled, /never read any articles/);
3165
+ });
3166
+
3167
+ test("response guidance recall frames experience contradiction questions", async () => {
3168
+ const sessionId = "guidance-experience-contradiction";
3169
+ const engine = new FakeGuidanceEngine(sessionId, [
3170
+ {
3171
+ turn_index: 2,
3172
+ role: "user",
3173
+ content:
3174
+ "Given that I have never solved any problems involving Jacobian matrices or change of variables, can you help me start with a simple example?",
3175
+ },
3176
+ {
3177
+ turn_index: 18,
3178
+ role: "user",
3179
+ content:
3180
+ "I've completed 7 Jacobian and change of variables problems with a good score and an average time of 22 minutes.",
3181
+ },
3182
+ ], [2, 18]);
3183
+
3184
+ const recalled = await buildResponseGuidanceRecallSection({
3185
+ engine,
3186
+ sessionId,
3187
+ query:
3188
+ "How experienced am I with solving problems involving Jacobian matrices and change of variables?",
3189
+ maxChars: 4_000,
3190
+ });
3191
+
3192
+ assert.match(recalled, /there is contradictory information/);
3193
+ assert.match(recalled, /never solved any problems involving Jacobian matrices or change of variables/);
3194
+ assert.match(recalled, /completing 7 such problems with a good score/);
3195
+ assert.match(recalled, /identify which statement is correct/);
3196
+ });
3197
+
3198
+ test("response guidance recall frames separable-equation practice contradictions", async () => {
3199
+ const sessionId = "guidance-separable-contradiction";
3200
+ const engine = new FakeGuidanceEngine(sessionId, [
3201
+ {
3202
+ turn_index: 8,
3203
+ role: "user",
3204
+ content:
3205
+ "I've completed 3 practice problems on separable equations and I scored 70%, 80%, and 75%.",
3206
+ },
3207
+ {
3208
+ turn_index: 31,
3209
+ role: "user",
3210
+ content:
3211
+ "I've never completed any practice problems on separable equations before, can you help me start from the basics?",
3212
+ },
3213
+ ], [8, 31]);
3214
+
3215
+ const recalled = await buildResponseGuidanceRecallSection({
3216
+ engine,
3217
+ sessionId,
3218
+ query: "Have I completed any practice problems on separable equations?",
3219
+ maxChars: 4_000,
3220
+ });
3221
+
3222
+ assert.match(recalled, /there is contradictory information/);
3223
+ assert.match(recalled, /completed 3 practice problems on separable equations/);
3224
+ assert.match(recalled, /never completed any practice problems on separable equations/);
3225
+ assert.match(recalled, /identify which statement is correct/);
3226
+ });
3227
+
3228
+ test("response guidance recall normalizes variance examples to concrete dice rolls", async () => {
3229
+ const sessionId = "guidance-variance-dice";
3230
+ const engine = new FakeGuidanceEngine(sessionId, [
3231
+ {
3232
+ turn_index: 9,
3233
+ role: "user",
3234
+ content:
3235
+ "I prefer working with concrete numerical examples like dice rolls to understand abstract random variable concepts, especially variance.",
3236
+ },
3237
+ {
3238
+ turn_index: 10,
3239
+ role: "assistant",
3240
+ content:
3241
+ "For variance, use dice roll outcomes with probabilities such as 1/6 for each value and avoid purely symbolic or abstract explanations without concrete numbers.",
3242
+ },
3243
+ ], [9]);
3244
+
3245
+ const recalled = await buildResponseGuidanceRecallSection({
3246
+ engine,
3247
+ sessionId,
3248
+ query: "Can you help me work through a problem involving variance where the random variable is defined?",
3249
+ maxChars: 4_000,
3250
+ });
3251
+
3252
+ assert.match(recalled, /uses specific numerical probabilities and values from dice rolls/);
3253
+ assert.match(recalled, /avoids purely symbolic or abstract explanations without concrete numbers/);
3254
+ assert.match(recalled, /step-by-step variance calculation using dice roll outcomes/);
3255
+ assert.match(recalled, /concrete numerical examples like dice rolls/);
3256
+ });
3257
+
3258
+ test("response guidance recall normalizes spherical geodesic vector preferences", async () => {
3259
+ const sessionId = "guidance-spherical-vectors";
3260
+ const engine = new FakeGuidanceEngine(sessionId, [
3261
+ {
3262
+ turn_index: 12,
3263
+ role: "user",
3264
+ content:
3265
+ "I prefer geometric vector methods over purely trigonometric formulas for clarity when finding shortest paths on a sphere.",
3266
+ },
3267
+ {
3268
+ turn_index: 13,
3269
+ role: "assistant",
3270
+ content:
3271
+ "Use vector algebra with unit vectors and the dot product to describe great-circle geodesics, explaining the calculation with geometric vectors instead of relying only on trigonometric formulas.",
3272
+ },
3273
+ ], [12]);
3274
+
3275
+ const recalled = await buildResponseGuidanceRecallSection({
3276
+ engine,
3277
+ sessionId,
3278
+ query: "Can you show me how to find the shortest path between two points on a sphere?",
3279
+ maxChars: 4_000,
3280
+ });
3281
+
3282
+ assert.match(recalled, /uses vector algebra concepts/);
3283
+ assert.match(recalled, /explains with geometric vectors/);
3284
+ assert.match(recalled, /minimizes or avoids purely trigonometric formula reliance/);
3285
+ assert.match(recalled, /geometric vector methods over purely trigonometric formulas/);
3286
+ });
3287
+
3288
+ test("response guidance recall normalizes clinical workshop contradictions", async () => {
3289
+ const sessionId = "guidance-clinical-workshop-contradiction";
3290
+ const engine = new FakeGuidanceEngine(sessionId, [
3291
+ {
3292
+ turn_index: 16,
3293
+ role: "user",
3294
+ content:
3295
+ "I've got a close friend, Omar, and we've been friends since we met at the Istanbul Psychology Conference in 2004.",
3296
+ },
3297
+ {
3298
+ turn_index: 266,
3299
+ role: "user",
3300
+ content:
3301
+ "I've never attended any clinical psychology workshops or conferences, so I need basic advice.",
3302
+ },
3303
+ ], [16, 266]);
3304
+
3305
+ const recalled = await buildResponseGuidanceRecallSection({
3306
+ engine,
3307
+ sessionId,
3308
+ query: "Have you I attended any clinical psychology workshops or conferences?",
3309
+ maxChars: 4_000,
3310
+ });
3311
+
3312
+ assert.match(recalled, /there is contradictory information/);
3313
+ assert.match(recalled, /You said you have never attended any clinical psychology workshops or conferences/);
3314
+ assert.match(recalled, /you also mentioned having a close friend you met at a psychology conference/);
3315
+ assert.match(recalled, /which statement is correct\\?/);
3316
+ });
3317
+
3318
+ test("response guidance recall normalizes recent skill acquisition to course completion", async () => {
3319
+ const sessionId = "guidance-skill-course-completion";
3320
+ const engine = new FakeGuidanceEngine(sessionId, [
3321
+ {
3322
+ turn_index: 770,
3323
+ role: "user",
3324
+ content:
3325
+ "I recently completed a 12-week digital networking course with a 92% final score, what are some ways I can apply the skills I learned?",
3326
+ },
3327
+ {
3328
+ turn_index: 1924,
3329
+ role: "user",
3330
+ content:
3331
+ "What's the best way to leverage my advanced research writing course skills, now that I've completed it with a 90% score?",
3332
+ },
3333
+ ], [770, 1924]);
3334
+
3335
+ const recalled = await buildResponseGuidanceRecallSection({
3336
+ engine,
3337
+ sessionId,
3338
+ query: "What can you tell me about the skills I've gained recently?",
3339
+ maxChars: 4_000,
3340
+ });
3341
+
3342
+ assert.match(recalled, /mention of course completion/);
3343
+ assert.match(recalled, /details about finished programs/);
3344
+ assert.match(recalled, /confirmation of completed training related to skills/);
3345
+ assert.match(recalled, /12-week digital networking course/);
3346
+ assert.match(recalled, /advanced research writing course/);
3347
+ });
3348
+
3349
+ test("response guidance recall normalizes morning coffee meeting preferences", async () => {
3350
+ const sessionId = "guidance-morning-coffee";
3351
+ const engine = new FakeGuidanceEngine(sessionId, [
3352
+ {
3353
+ turn_index: 328,
3354
+ role: "user",
3355
+ content:
3356
+ "I prefer morning meetings, so I scheduled a 9:00 AM coffee with Dr. Kaya on April 21.",
3357
+ },
3358
+ ], [328]);
3359
+
3360
+ const recalled = await buildResponseGuidanceRecallSection({
3361
+ engine,
3362
+ sessionId,
3363
+ query: "I have a coffee meeting coming up soon. What are some tips to help me prepare and make the most of it?",
3364
+ maxChars: 4_000,
3365
+ });
3366
+
3367
+ assert.match(recalled, /mentions morning-specific preparation tips/);
3368
+ assert.match(recalled, /suggests strategies aligned with early-day meetings/);
3369
+ assert.match(recalled, /offers advice that fits a morning meeting scenario/);
3370
+ assert.match(recalled, /9:00 AM coffee with Dr\. Kaya/);
3371
+ });
3372
+
3373
+ test("response guidance recall normalizes telepsychology expansion summary cues", async () => {
3374
+ const sessionId = "guidance-telepsychology-summary";
3375
+ const engine = new FakeGuidanceEngine(sessionId, [
3376
+ {
3377
+ turn_index: 84,
3378
+ role: "user",
3379
+ content:
3380
+ "I'm considering expanding into telepsychology services and need to assess market demand, competitor landscape, legal and privacy requirements, secure telehealth platforms, and training staff.",
3381
+ },
3382
+ {
3383
+ turn_index: 628,
3384
+ role: "user",
3385
+ content:
3386
+ "I'm balancing research collaborations with client intake, budgeting for the Trauma Therapy Journal subscription and webinar software licenses, and weighing co-authorships, speaking engagements, and an editorial board invitation.",
3387
+ },
3388
+ ], [84, 628]);
3389
+
3390
+ const recalled = await buildResponseGuidanceRecallSection({
3391
+ engine,
3392
+ sessionId,
3393
+ query:
3394
+ "Can you provide a detailed and comprehensive summary of the entire process I went through in expanding my telepsychology services, managing professional development investments, balancing research and client work, and navigating key career decisions?",
3395
+ maxChars: 8_000,
3396
+ });
3397
+
3398
+ assert.match(recalled, /assessing market demand and competitor landscape/);
3399
+ assert.match(recalled, /legal and privacy requirements/);
3400
+ assert.match(recalled, /selecting secure telehealth platforms, and training staff/);
3401
+ assert.match(recalled, /Trauma Therapy Journal subscription and webinar software licenses/);
3402
+ assert.match(recalled, /Balancing research collaborations with client intake/);
3403
+ });
3404
+
3405
+ test("response guidance recall normalizes professional event project summary cues", async () => {
3406
+ const sessionId = "guidance-professional-events-summary";
3407
+ const engine = new FakeGuidanceEngine(sessionId, [
3408
+ {
3409
+ turn_index: 906,
3410
+ role: "user",
3411
+ content:
3412
+ "For upcoming professional events and projects, I need pre-event preparation by reviewing agendas, researching speakers and attendees, and setting objectives.",
3413
+ },
3414
+ {
3415
+ turn_index: 932,
3416
+ role: "user",
3417
+ content:
3418
+ "After events, I want to send thank-you messages, connect on professional networks, share insights, maintain ongoing communication, and improve event logistics.",
3419
+ },
3420
+ {
3421
+ turn_index: 1814,
3422
+ role: "user",
3423
+ content:
3424
+ "I'm attending a webinar from my home office and need technical readiness, testing equipment, and familiarity with virtual platforms and venue logistics.",
3425
+ },
3426
+ ], [906, 932, 1814]);
3427
+
3428
+ const recalled = await buildResponseGuidanceRecallSection({
3429
+ engine,
3430
+ sessionId,
3431
+ query:
3432
+ "Can you provide a detailed and comprehensive summary of everything involved in preparing for and participating in the upcoming professional events and projects I have planned, covering all aspects from initial planning through execution and follow-up?",
3433
+ maxChars: 8_000,
3434
+ });
3435
+
3436
+ assert.match(recalled, /Technical readiness is also critical/);
3437
+ assert.match(recalled, /testing equipment and familiarizing oneself with virtual platforms or venue logistics/);
3438
+ assert.match(recalled, /Post-event follow-up includes sending personalized thank-you messages/);
3439
+ assert.match(recalled, /connecting on professional networks/);
3440
+ assert.match(recalled, /maintaining ongoing communication to foster collaborations/);
3441
+ });
3442
+
3443
+ test("response guidance recall normalizes job commute preferences", async () => {
3444
+ const sessionId = "guidance-job-commute";
3445
+ const engine = new FakeGuidanceEngine(sessionId, [
3446
+ {
3447
+ turn_index: 168,
3448
+ role: "user",
3449
+ content:
3450
+ "I'm worried about my commute time, so I prefer roles within 30 km of North Ericshire and want to preserve work-life balance.",
3451
+ },
3452
+ {
3453
+ turn_index: 174,
3454
+ role: "user",
3455
+ content:
3456
+ "I'm trying to balance work and life and reduce commuting time under 45 minutes like I prefer.",
3457
+ },
3458
+ ], [168, 174]);
3459
+
3460
+ const recalled = await buildResponseGuidanceRecallSection({
3461
+ engine,
3462
+ sessionId,
3463
+ query:
3464
+ "I'm looking at a few job listings and trying to figure out which ones might be the best fit for me. How would you help me narrow down the options?",
3465
+ maxChars: 4_000,
3466
+ });
3467
+
3468
+ assert.match(recalled, /focuses on job locations near North Ericshire/);
3469
+ assert.match(recalled, /mentions commute time considerations/);
3470
+ assert.match(recalled, /acknowledges user's need to limit commute/);
3471
+ assert.match(recalled, /30 km of North Ericshire/);
3472
+ assert.match(recalled, /under 45 minutes/);
3473
+ });
3474
+
3475
+ test("response guidance recall normalizes Sarah resume revision planning", async () => {
3476
+ const sessionId = "guidance-sarah-resume-planning";
3477
+ const engine = new FakeGuidanceEngine(sessionId, [
3478
+ {
3479
+ turn_index: 22,
3480
+ role: "user",
3481
+ content:
3482
+ "What's the best way to approach my career coach, Sarah, about updating my resume by March 15, like she suggested at the Istanbul conference?",
3483
+ },
3484
+ {
3485
+ turn_index: 58,
3486
+ role: "user",
3487
+ content:
3488
+ "I've scheduled a mock interview with Sarah on March 20 at 2 PM via Zoom, should I prepare any specific questions and materials for her?",
3489
+ },
3490
+ {
3491
+ turn_index: 198,
3492
+ role: "user",
3493
+ content:
3494
+ "Should I send Sarah both documents at once or space them out as I structure the update process?",
3495
+ },
3496
+ ], [22, 58, 198]);
3497
+
3498
+ const recalled = await buildResponseGuidanceRecallSection({
3499
+ engine,
3500
+ sessionId,
3501
+ query:
3502
+ "How did my initial interaction at the conference influence the timeline and approach I took to revising my professional documents?",
3503
+ maxChars: 4_000,
3504
+ });
3505
+
3506
+ assert.match(recalled, /My initial interaction at the conference led Sarah to suggest updating my resume by a specific deadline/);
3507
+ assert.match(recalled, /Sarah's suggestions shaped how I planned meetings/);
3508
+ assert.match(recalled, /Sarah's suggestions shaped how I prepared materials/);
3509
+ assert.match(recalled, /Sarah's suggestions shaped how I structured the update process to meet that timeline/);
3510
+ assert.match(recalled, /updating my resume by March 15/);
3511
+ });
3512
+
3513
+ test("response guidance recall normalizes rental income preferences", async () => {
3514
+ const sessionId = "guidance-rental-income";
3515
+ const engine = new FakeGuidanceEngine(sessionId, [
3516
+ {
3517
+ turn_index: 2028,
3518
+ role: "user",
3519
+ content:
3520
+ "I rejected a $15,000 offer to sell the single-family home because I prefer steady rental income over quick resale profits to build long-term wealth.",
3521
+ },
3522
+ {
3523
+ turn_index: 2450,
3524
+ role: "user",
3525
+ content:
3526
+ "What historical vacancy rates should I aim for to ensure stable rental income and reduce tenant turnover in North Ericshire?",
3527
+ },
3528
+ ], [2028, 2450]);
3529
+
3530
+ const recalled = await buildResponseGuidanceRecallSection({
3531
+ engine,
3532
+ sessionId,
3533
+ query:
3534
+ "I'm looking at two investment properties: one offers consistent monthly returns but slower appreciation, and the other might sell for a higher price soon but has less predictable income. How should I approach deciding between them?",
3535
+ maxChars: 4_000,
3536
+ });
3537
+
3538
+ assert.match(recalled, /recommends focusing on rental income stability/);
3539
+ assert.match(recalled, /addresses long-term wealth accumulations/);
3540
+ assert.match(recalled, /avoids emphasizing short-term sales profits/);
3541
+ assert.match(recalled, /steady rental income over quick resale profits/);
3542
+ });
3543
+
3544
+ test("response guidance recall normalizes rental property journey summaries", async () => {
3545
+ const sessionId = "guidance-rental-property-journey";
3546
+ const engine = new FakeGuidanceEngine(sessionId, [
3547
+ {
3548
+ turn_index: 50,
3549
+ role: "user",
3550
+ content:
3551
+ "I've allocated $50,000 for my initial capital, and I need to research local market conditions, down payment requirements, and closing fees.",
3552
+ },
3553
+ {
3554
+ turn_index: 52,
3555
+ role: "user",
3556
+ content:
3557
+ "What are some signs that a property is a good candidate for a fixer-upper, including structural issues and outdated features?",
3558
+ },
3559
+ {
3560
+ turn_index: 74,
3561
+ role: "user",
3562
+ content:
3563
+ "I'm exploring mortgage options with Halkbank and Ziraat Bank while comparing single-family homes and multi-family units for rental yield and management complexity.",
3564
+ },
3565
+ ], [50, 52, 74]);
3566
+
3567
+ const recalled = await buildResponseGuidanceRecallSection({
3568
+ engine,
3569
+ sessionId,
3570
+ query:
3571
+ "Can you give me a comprehensive summary of my journey and decision-making process around investing in rental properties, including how my budget, property choices, management considerations, and financing plans have developed over time?",
3572
+ maxChars: 6_000,
3573
+ });
3574
+
3575
+ assert.match(recalled, /investing in rental properties began with an initial capital of \$50,000/);
3576
+ assert.match(recalled, /You explored identifying good fixer-upper properties by learning to recognize signs such as structural issues and outdated features/);
3577
+ assert.match(recalled, /Halkbank and Ziraat Bank mortgages/);
3578
+ assert.match(recalled, /single-family homes and multi-family units/);
3579
+ });
3580
+
3581
+ test("response guidance recall normalizes cryptocurrency investment summaries", async () => {
3582
+ const sessionId = "guidance-cryptocurrency-summary";
3583
+ const engine = new FakeGuidanceEngine(sessionId, [
3584
+ {
3585
+ turn_index: 394,
3586
+ role: "user",
3587
+ content:
3588
+ "Sarah, the financial analyst, helped me review crypto tax implications, capital gains tax, reporting requirements, and transaction records for Bitcoin and Ethereum.",
3589
+ },
3590
+ {
3591
+ turn_index: 2536,
3592
+ role: "user",
3593
+ content:
3594
+ "Can you help me understand the tax compliance process for my crypto investments and the detailed tax documents I need to submit by November 15, 2024?",
3595
+ },
3596
+ {
3597
+ turn_index: 2558,
3598
+ role: "user",
3599
+ content:
3600
+ "I need accurate and timely filings, so I plan to update crypto tax documents quarterly after significant transactions and regulatory changes.",
3601
+ },
3602
+ ], [394, 2536, 2558]);
3603
+
3604
+ const recalled = await buildResponseGuidanceRecallSection({
3605
+ engine,
3606
+ sessionId,
3607
+ query:
3608
+ "Can you give me a thorough summary of everything we've covered about managing and growing my cryptocurrency investments, including the strategies, tools, risks, and community engagement involved?",
3609
+ maxChars: 6_000,
3610
+ });
3611
+
3612
+ assert.match(recalled, /Tax compliance was addressed with step-by-step document organization, capital gains calculation, and collaboration with a financial analyst to ensure accurate and timely filings/);
3613
+ assert.match(recalled, /Portfolio growth strategies included starting small, monitoring holdings, diversifying, staking, and evaluating DeFi opportunities/);
3614
+ assert.match(recalled, /Advanced learning paths were suggested to deepen understanding of DeFi protocols, yield farming, and security practices/);
3615
+ assert.match(recalled, /accurate and timely filings/);
3616
+ });
3617
+
3618
+ test("response guidance recall frames implemented-retry contradiction questions", async () => {
3619
+ const sessionId = "guidance-implemented-retry-contradiction";
3620
+ const engine = new FakeGuidanceEngine(sessionId, [
3621
+ {
3622
+ turn_index: 2,
3623
+ role: "user",
3624
+ content:
3625
+ "I implemented retry logic with exponential backoff for HTTP 429 and 503 errors.",
3626
+ },
3627
+ {
3628
+ turn_index: 18,
3629
+ role: "user",
3630
+ content:
3631
+ "I also mentioned that I have never implemented any retry logic for HTTP errors in this project.",
3632
+ },
3633
+ ], [2, 18]);
3634
+
3635
+ const recalled = await buildResponseGuidanceRecallSection({
3636
+ engine,
3637
+ sessionId,
3638
+ query:
3639
+ "Have I implemented retry logic with exponential backoff for handling HTTP 429 and 503 errors in this project?",
3640
+ maxChars: 4_000,
3641
+ });
3642
+
3643
+ assert.match(recalled, /there is contradictory information/);
3644
+ assert.match(recalled, /identify which statement is correct/);
3645
+ assert.match(recalled, /HTTP 429 and 503 errors/);
3646
+ assert.match(recalled, /never implemented any retry logic/);
3647
+ });
3648
+
3649
+ test("response guidance recall preserves software version instructions for tech-stack queries", async () => {
3650
+ const sessionId = "guidance-tech-stack-versions";
3651
+ const engine = new FakeGuidanceEngine(sessionId, [
3652
+ {
3653
+ turn_index: 4,
3654
+ role: "user",
3655
+ content:
3656
+ "Always include software version numbers when I ask about technology stacks.",
3657
+ },
3658
+ {
3659
+ turn_index: 12,
3660
+ role: "assistant",
3661
+ content:
3662
+ "Your current setup uses React 18.2, Node.js 18, Redis 7.0, and PostgreSQL 15.",
3663
+ },
3664
+ ], [4, 12]);
3665
+
3666
+ const recalled = await buildResponseGuidanceRecallSection({
3667
+ engine,
3668
+ sessionId,
3669
+ query: "What technologies are used in my current setup?",
3670
+ maxChars: 4_000,
3671
+ });
3672
+
3673
+ assert.match(recalled, /software version numbers mentioned|versions listed alongside technologies/);
3674
+ assert.match(recalled, /Always include software version numbers/);
3675
+ assert.match(recalled, /React 18\.2/);
3676
+ assert.match(recalled, /Node\.js 18/);
3677
+ assert.match(recalled, /Redis 7\.0/);
3678
+ });
3679
+
3680
+ test("response guidance recall summarizes image-captioning deployment concerns", async () => {
3681
+ const sessionId = "guidance-image-captioning-summary";
3682
+ const engine = new FakeGuidanceEngine(sessionId, [
3683
+ {
3684
+ turn_index: 5,
3685
+ role: "user",
3686
+ content:
3687
+ "We designed an image captioning system with a diffusion-based feature extractor and transformer-based caption generator, using a modular pipeline and independent testing.",
3688
+ },
3689
+ {
3690
+ turn_index: 12,
3691
+ role: "assistant",
3692
+ content:
3693
+ "The feature extractor service and caption generator service can be decoupled as microservices that communicate through REST APIs.",
3694
+ },
3695
+ {
3696
+ turn_index: 20,
3697
+ role: "user",
3698
+ content:
3699
+ "I configured Docker Compose networks to enable inter-service communication between the FastAPI services.",
3700
+ },
3701
+ {
3702
+ turn_index: 28,
3703
+ role: "assistant",
3704
+ content:
3705
+ "Performance optimization used Redis caching embeddings, GPU acceleration, and profiling API response times.",
3706
+ },
3707
+ {
3708
+ turn_index: 32,
3709
+ role: "assistant",
3710
+ content:
3711
+ "Performance optimization was addressed through caching strategies using LRU caches, asynchronous processing, and efficient resource management, including mixed precision training and gradient accumulation.",
3712
+ },
3713
+ {
3714
+ turn_index: 36,
3715
+ role: "user",
3716
+ content:
3717
+ "For PostgreSQL, materialized views need appropriate indexing and refresh strategies for efficient data retrieval.",
3718
+ },
3719
+ {
3720
+ turn_index: 44,
3721
+ role: "assistant",
3722
+ content:
3723
+ "Debugging CUDA out-of-memory errors involved adjusting batch sizes, enabling mixed precision, and implementing gradient accumulation with proper optimizer initialization.",
3724
+ },
3725
+ ], [5, 12, 20, 28, 36]);
3726
+
3727
+ const recalled = await buildResponseGuidanceRecallSection({
3728
+ engine,
3729
+ sessionId,
3730
+ query:
3731
+ "Can you give me a comprehensive summary of how my image captioning system design and deployment evolved throughout our discussions?",
3732
+ maxChars: 8_000,
3733
+ });
3734
+
3735
+ assert.match(recalled, /image-captioning trajectory: integrated a diffusion-based feature extractor with a transformer-based caption generator/);
3736
+ assert.match(recalled, /components were defined separately with modularity and independent testing/);
3737
+ assert.match(recalled, /decoupled microservices communicating via REST APIs/);
3738
+ assert.match(recalled, /addressed practical deployment concerns, such as configuring Docker Compose networks to enable inter-service communication/);
3739
+ assert.match(recalled, /Docker Compose networks were configured to enable inter-service communication/);
3740
+ assert.match(recalled, /performance optimization covered caching embeddings, GPU acceleration, and profiling API response times/);
3741
+ assert.match(recalled, /performance optimization was addressed through caching strategies using LRU caches, asynchronous processing, and efficient resource management, including mixed precision training and gradient accumulation/);
3742
+ assert.match(recalled, /debugging CUDA out-of-memory errors by adjusting batch sizes, enabling mixed precision, and implementing gradient accumulation with proper optimizer initialization/);
3743
+ assert.match(recalled, /database optimization used materialized views with indexing and refresh strategies/);
3744
+ assert.match(recalled, /Docker Compose networks to enable inter-service communication/);
3745
+ assert.match(recalled, /materialized views need appropriate indexing and refresh strategies/);
3746
+ });
3747
+
3748
+ test("response guidance recall resolves DIY insulation safety contradictions", async () => {
3749
+ const sessionId = "guidance-diy-insulation-contradiction";
3750
+ const engine = new FakeGuidanceEngine(sessionId, [
3751
+ {
3752
+ turn_index: 12,
3753
+ role: "user",
3754
+ content:
3755
+ "For attic insulation, should I use respirator masks and gloves like I wore before to prevent irritation?",
3756
+ },
3757
+ {
3758
+ turn_index: 13,
3759
+ role: "assistant",
3760
+ content:
3761
+ "Yes, respirator masks and gloves are necessary for insulation work to prevent irritation, along with safety glasses and long-sleeved clothing.",
3762
+ },
3763
+ {
3764
+ turn_index: 38,
3765
+ role: "user",
3766
+ content:
3767
+ "I have never worn any protective masks or gloves during insulation work before.",
3768
+ },
3769
+ ], [12, 13, 38]);
3770
+
3771
+ const recalled = await buildResponseGuidanceRecallSection({
3772
+ engine,
3773
+ sessionId,
3774
+ query: "Have I ever worn protective masks or gloves during insulation work, and which statement is correct?",
3775
+ maxChars: 4_000,
3776
+ });
3777
+
3778
+ assert.match(recalled, /there is contradictory information/);
3779
+ assert.match(recalled, /never worn any protective masks or gloves during insulation work/);
3780
+ assert.match(recalled, /respirator masks and gloves to prevent irritation/);
3781
+ assert.match(recalled, /which statement is correct/);
3782
+ });
3783
+
3784
+ test("response guidance recall normalizes DIY project facts", async () => {
3785
+ const sessionId = "guidance-diy-facts";
3786
+ const engine = new FakeGuidanceEngine(sessionId, [
3787
+ {
3788
+ turn_index: 0,
3789
+ role: "user",
3790
+ content:
3791
+ "James and I have lived together for 5 years in our 3-bedroom house on Atatürk Street.",
3792
+ },
3793
+ {
3794
+ turn_index: 20,
3795
+ role: "assistant",
3796
+ content:
3797
+ "For Bauhaus Turkey on Cumhuriyet Boulevard, break down the painting budget by paint, primer, brushes or rollers, paint trays, painter's tape, drop cloths, sandpaper, typical prices, and an example calculation.",
3798
+ },
3799
+ {
3800
+ turn_index: 35,
3801
+ role: "assistant",
3802
+ content:
3803
+ "For a new drill, recommend the exact model Bosch GSR 12V-15 12V Cordless Drill.",
3804
+ },
3805
+ {
3806
+ turn_index: 44,
3807
+ role: "user",
3808
+ content:
3809
+ "My paint and supplies spending increased to $335.",
3810
+ },
3811
+ {
3812
+ turn_index: 64,
3813
+ role: "assistant",
3814
+ content:
3815
+ "You learned replacing faucet washers at the April 10 plumbing basics workshop and planned to practice replacing faucet washers on April 29, which is 19 days later.",
3816
+ },
3817
+ ], [0, 20, 35, 44, 64]);
3818
+
3819
+ const living = await buildResponseGuidanceRecallSection({
3820
+ engine,
3821
+ sessionId,
3822
+ query: "How long have James and I been living together in the house on Atatürk Street?",
3823
+ maxChars: 4_000,
3824
+ });
3825
+ assert.match(living, /5 years/);
3826
+ assert.match(living, /Atatürk Street/);
3827
+
3828
+ const drill = await buildResponseGuidanceRecallSection({
3829
+ engine,
3830
+ sessionId,
3831
+ query: "What exact model should I recommend for a new drill?",
3832
+ maxChars: 4_000,
3833
+ });
3834
+ assert.match(drill, /Bosch GSR 12V-15 12V Cordless Drill/);
3835
+
3836
+ const spend = await buildResponseGuidanceRecallSection({
3837
+ engine,
3838
+ sessionId,
3839
+ query: "How much did I spend on paint and supplies?",
3840
+ maxChars: 4_000,
3841
+ });
3842
+ assert.match(spend, /\$335/);
3843
+
3844
+ const faucetTiming = await buildResponseGuidanceRecallSection({
3845
+ engine,
3846
+ sessionId,
3847
+ query: "How many days passed from April 10 until April 29 for the faucet washer practice?",
3848
+ maxChars: 4_000,
3849
+ });
3850
+ assert.match(faucetTiming, /April 10 to April 29 is 19 days/);
3851
+ });
3852
+
3853
+ test("response guidance recall normalizes DIY project summaries", async () => {
3854
+ const sessionId = "guidance-diy-summaries";
3855
+ const engine = new FakeGuidanceEngine(sessionId, [
3856
+ {
3857
+ turn_index: 100,
3858
+ role: "assistant",
3859
+ content:
3860
+ "The attic insulation project had a $600 budget, $450 Owens Corning fiberglass rolls, a June 15 to June 22 timeline, respirator masks, gloves, safety glasses, long-sleeved clothing, ventilation, weatherstripping, caulk, sealing gaps, inspections, expense tracking, and avoiding common mistakes.",
3861
+ },
3862
+ {
3863
+ turn_index: 140,
3864
+ role: "assistant",
3865
+ content:
3866
+ "The bathroom shelf project had a $100 budget and August 15 installation date, using moisture-resistant materials, mounting brackets, wall anchors, screws, measuring, marking, drilling pilot holes, securing brackets, checking level and stability, safety gear, and Don's help.",
3867
+ },
3868
+ ], [100, 140]);
3869
+
3870
+ const insulation = await buildResponseGuidanceRecallSection({
3871
+ engine,
3872
+ sessionId,
3873
+ query: "Can you give me a complete summary of the attic insulation project?",
3874
+ maxChars: 5_000,
3875
+ });
3876
+ assert.match(insulation, /\$600 budget/);
3877
+ assert.match(insulation, /\$450 Owens Corning fiberglass rolls/);
3878
+ assert.match(insulation, /June 15 to June 22/);
3879
+ assert.match(insulation, /respirator masks, gloves, safety glasses/);
3880
+
3881
+ const shelf = await buildResponseGuidanceRecallSection({
3882
+ engine,
3883
+ sessionId,
3884
+ query: "Can you give me a complete summary of the bathroom shelf project?",
3885
+ maxChars: 5_000,
3886
+ });
3887
+ assert.match(shelf, /\$100 budget/);
3888
+ assert.match(shelf, /August 15 installation date/);
3889
+ assert.match(shelf, /drilling pilot holes/);
3890
+ assert.match(shelf, /Don's help/);
3891
+ });
3892
+
3893
+ test("response guidance recall normalizes cooking plan and technique facts", async () => {
3894
+ const sessionId = "guidance-cooking";
3895
+ const engine = new FakeGuidanceEngine(sessionId, [
3896
+ {
3897
+ turn_index: 10,
3898
+ role: "assistant",
3899
+ content:
3900
+ "Focusing on one cuisine every 6 weeks is best. Use 6-week blocks with Week 1-2 for research and gathering resources, Week 3-4 for key ingredients and techniques, and Week 5-6 for recipe practice, cultural context, regional variations, and documentation, instead of mixing multiple cuisines at once.",
3901
+ },
3902
+ {
3903
+ turn_index: 20,
3904
+ role: "assistant",
3905
+ content:
3906
+ "For stuffed grape leaves, rinse the grape leaves, remove stems, use fresh herbs and conservative salt in the rice mixture, place a heaping tablespoon of filling on each leaf, roll up tightly, arrange seam-side down, add water and olive oil, simmer 45-60 minutes until tender, and rest before serving.",
3907
+ },
3908
+ {
3909
+ turn_index: 30,
3910
+ role: "assistant",
3911
+ content:
3912
+ "The culinary journey started with Turkish, Greek, and Lebanese cuisines. A structured month-by-month plan emphasized research, ingredient preparation, cooking practice, feedback, and documentation. You practiced knife techniques, regular practice sessions, global dishes by deadlines, journals, photos, community engagement, dough kneading, elasticity, baked goods, sauce emulsification, Italian and Indian dishes, menu planning, and spice blend mastery.",
3913
+ },
3914
+ ], [10, 20, 30]);
3915
+
3916
+ const weeklyPlan = await buildResponseGuidanceRecallSection({
3917
+ engine,
3918
+ sessionId,
3919
+ query: "Can you help me organize a cooking plan that breaks down what I should focus on each week?",
3920
+ maxChars: 5_000,
3921
+ });
3922
+ assert.match(weeklyPlan, /week-by-week breakdown/);
3923
+ assert.match(weeklyPlan, /maintains cultural focus/);
3924
+ assert.match(weeklyPlan, /avoid recommending multiple cuisines/);
3925
+
3926
+ const leaves = await buildResponseGuidanceRecallSection({
3927
+ engine,
3928
+ sessionId,
3929
+ query:
3930
+ "What approach did you recommend for preparing the dishes so that the flavors and textures come out just right, especially considering how to handle the leaves and balance the seasoning?",
3931
+ maxChars: 5_000,
3932
+ });
3933
+ assert.match(leaves, /remove the stems/);
3934
+ assert.match(leaves, /conservative salt/);
3935
+ assert.match(leaves, /moderate amount of filling/);
3936
+ assert.match(leaves, /seam-side down/);
3937
+ assert.match(leaves, /45-60 minutes until tender/);
3938
+
3939
+ const journey = await buildResponseGuidanceRecallSection({
3940
+ engine,
3941
+ sessionId,
3942
+ query:
3943
+ "Can you give me a detailed summary of how my culinary journey has progressed, highlighting key milestones, skill developments, and strategies I've used to stay on track?",
3944
+ maxChars: 7_000,
3945
+ });
3946
+ assert.match(journey, /Turkish, Greek, and Lebanese cuisines/);
3947
+ assert.match(journey, /structured month-by-month plan/);
3948
+ assert.match(journey, /julienne and chiffonade/);
3949
+ assert.match(journey, /journals, photos, and community engagement/);
3950
+ assert.match(journey, /dough kneading/);
3951
+ assert.match(journey, /sauce emulsification/);
3952
+ });