@remnic/core 10.0.12 → 10.0.14

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 (560) hide show
  1. package/dist/access-admin-ops-surface.js +97 -95
  2. package/dist/access-authorization-probe.js +98 -96
  3. package/dist/access-boundary.js +97 -95
  4. package/dist/access-cli.js +201 -198
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-extraction-force-flush.js +97 -95
  7. package/dist/access-http-briefing.js +98 -96
  8. package/dist/access-http-query.js +99 -97
  9. package/dist/access-http.js +121 -119
  10. package/dist/access-idempotency.js +3 -2
  11. package/dist/access-identity-continuity-surface.js +97 -95
  12. package/dist/access-lcm-surface.js +97 -95
  13. package/dist/access-mcp.js +110 -108
  14. package/dist/access-memory-search-fanout.js +3 -3
  15. package/dist/access-namespace-preflight.js +97 -95
  16. package/dist/access-observe-write-category.js +18 -18
  17. package/dist/access-observe-write-surface.js +97 -95
  18. package/dist/access-offline-manifest.js +21 -20
  19. package/dist/access-operations-batch.js +101 -99
  20. package/dist/access-operations.js +108 -106
  21. package/dist/access-recall-concurrency.js +97 -95
  22. package/dist/access-recall-diagnostics.js +5 -5
  23. package/dist/access-recall-response.js +97 -95
  24. package/dist/access-recall-surface.js +97 -95
  25. package/dist/access-schema.d.ts +2 -2
  26. package/dist/access-schema.js +12 -12
  27. package/dist/access-service.js +97 -95
  28. package/dist/access-surface-catalog.js +99 -97
  29. package/dist/access-surface-catalog.js.map +1 -1
  30. package/dist/active-memory-bridge.js +3 -3
  31. package/dist/active-recall.js +42 -40
  32. package/dist/active-recall.js.map +1 -1
  33. package/dist/adapters/index.js +4 -4
  34. package/dist/adapters/registry.js +2 -2
  35. package/dist/{auto-sync-WSJAOLOP.js → auto-sync-7WWAKW6F.js} +12 -12
  36. package/dist/briefing.js +31 -29
  37. package/dist/buffer.js +17 -17
  38. package/dist/calibration.d.ts +20 -0
  39. package/dist/calibration.d.ts.map +1 -1
  40. package/dist/calibration.js +60 -13
  41. package/dist/calibration.js.map +1 -1
  42. package/dist/capabilities.d.ts +3 -2
  43. package/dist/capabilities.d.ts.map +1 -1
  44. package/dist/capabilities.js +1 -1
  45. package/dist/{capsule-merge-M4HETD27.js → capsule-merge-LGYURS3C.js} +6 -5
  46. package/dist/{capsule-merge-M4HETD27.js.map → capsule-merge-LGYURS3C.js.map} +1 -1
  47. package/dist/capture-write-lock-backoff.d.ts +50 -0
  48. package/dist/capture-write-lock-backoff.d.ts.map +1 -0
  49. package/dist/capture-write-lock-backoff.js +30 -0
  50. package/dist/capture-write-lock.d.ts +6 -0
  51. package/dist/capture-write-lock.d.ts.map +1 -0
  52. package/dist/capture-write-lock.js +15 -0
  53. package/dist/causal-behavior.js +2 -2
  54. package/dist/causal-chain.js +2 -2
  55. package/dist/causal-consolidation.js +34 -32
  56. package/dist/causal-consolidation.js.map +1 -1
  57. package/dist/causal-retrieval.js +2 -2
  58. package/dist/causal-trajectory-graph.js +7 -6
  59. package/dist/causal-trajectory-graph.js.map +1 -1
  60. package/dist/causal-trajectory.js +1 -1
  61. package/dist/{chunk-RNPJ4GQA.js → chunk-22W2XWGH.js} +6 -6
  62. package/dist/{chunk-AV2OQF2O.js → chunk-3F3HA3R2.js} +2 -2
  63. package/dist/{chunk-QZZPUREO.js → chunk-3GYSZHMT.js} +3 -3
  64. package/dist/{chunk-QWWMS4AE.js → chunk-3MO4LWYU.js} +1 -1
  65. package/dist/chunk-3MO4LWYU.js.map +1 -0
  66. package/dist/{chunk-XYOT5GQU.js → chunk-3NF4QUNZ.js} +3 -3
  67. package/dist/{chunk-AL6EHLB5.js → chunk-3X3PNU3T.js} +2 -2
  68. package/dist/{chunk-BTJ6CAIA.js → chunk-4IYIGN53.js} +10 -10
  69. package/dist/{chunk-OM3RWZQK.js → chunk-4KY5GSMB.js} +2 -2
  70. package/dist/{chunk-4N2MFNTG.js → chunk-4OSG5Y6M.js} +2 -2
  71. package/dist/{chunk-EEDI3OXB.js → chunk-4Q26RNSR.js} +2 -2
  72. package/dist/{chunk-EHRE7ZG3.js → chunk-5B5WYAHQ.js} +2 -2
  73. package/dist/{chunk-WCGJK4NQ.js → chunk-5FNZ3G6X.js} +10 -10
  74. package/dist/{chunk-Y6DZ33PA.js → chunk-5GX5457J.js} +4 -4
  75. package/dist/{chunk-OFCHT2TN.js → chunk-5LRV557D.js} +2 -2
  76. package/dist/{chunk-VAOC6GHN.js → chunk-5PHOU5QI.js} +2 -2
  77. package/dist/{chunk-WL7N5VGG.js → chunk-5TJEOU6Y.js} +2 -2
  78. package/dist/{chunk-A2L3P2IY.js → chunk-5WCJLQTM.js} +2 -2
  79. package/dist/{chunk-MZBWIJJN.js → chunk-63B2IZYE.js} +19 -19
  80. package/dist/{chunk-DGRMWDQY.js → chunk-66BCOVW2.js} +7 -7
  81. package/dist/chunk-6EDW54SQ.js +298 -0
  82. package/dist/chunk-6EDW54SQ.js.map +1 -0
  83. package/dist/{chunk-P2S6P7X6.js → chunk-6LG7BWKW.js} +2 -2
  84. package/dist/chunk-77R7BQZ2.js +152 -0
  85. package/dist/chunk-77R7BQZ2.js.map +1 -0
  86. package/dist/{chunk-4G2YCKLT.js → chunk-7G5NTS7F.js} +2 -2
  87. package/dist/{chunk-IPLYGWQF.js → chunk-7LCGFUMB.js} +6 -6
  88. package/dist/{chunk-KYY4EACB.js → chunk-7Z3DLNSD.js} +2 -2
  89. package/dist/{chunk-LNH76ZJX.js → chunk-AIYXVWUH.js} +27 -2
  90. package/dist/{chunk-LNH76ZJX.js.map → chunk-AIYXVWUH.js.map} +1 -1
  91. package/dist/{chunk-7SUWY37K.js → chunk-B665A6BO.js} +2 -2
  92. package/dist/{chunk-AEGNDL24.js → chunk-BVRZSI7Q.js} +2 -2
  93. package/dist/{chunk-2EMROIXS.js → chunk-C5LWPYS3.js} +2 -1
  94. package/dist/{chunk-2EMROIXS.js.map → chunk-C5LWPYS3.js.map} +1 -1
  95. package/dist/{chunk-KJOGIRMF.js → chunk-CB6ANA2I.js} +2 -2
  96. package/dist/{chunk-5JMI26Q7.js → chunk-CBH2Z4UA.js} +2 -2
  97. package/dist/{chunk-YRH3C2OJ.js → chunk-CIIHIAJ2.js} +13 -5
  98. package/dist/chunk-CIIHIAJ2.js.map +1 -0
  99. package/dist/{chunk-W4RLOZOG.js → chunk-CJRENHVZ.js} +4 -4
  100. package/dist/{chunk-LOFVW6JA.js → chunk-CLWBFR7Q.js} +6 -6
  101. package/dist/{chunk-375ARKRS.js → chunk-D5SSBCYY.js} +70 -59
  102. package/dist/chunk-D5SSBCYY.js.map +1 -0
  103. package/dist/{chunk-KI6UOSNR.js → chunk-DEY7B77Y.js} +2 -2
  104. package/dist/chunk-DEY7B77Y.js.map +1 -0
  105. package/dist/{chunk-6VAHJ2F6.js → chunk-DMDWFQMR.js} +2 -2
  106. package/dist/{chunk-MO25AN7J.js → chunk-DPR2WTN3.js} +22 -22
  107. package/dist/{chunk-JXSYWTFK.js → chunk-DYJHGJZ4.js} +2 -2
  108. package/dist/{chunk-5X4ZJESN.js → chunk-EH4BQ7LT.js} +3 -3
  109. package/dist/chunk-EHHQJTAU.js +131 -0
  110. package/dist/chunk-EHHQJTAU.js.map +1 -0
  111. package/dist/{chunk-JXWTPOMJ.js → chunk-EPJDSQHF.js} +2 -2
  112. package/dist/{chunk-OEIA4IHU.js → chunk-ESG6ITGP.js} +2 -2
  113. package/dist/{chunk-7XI2UJHL.js → chunk-ETZUIRCI.js} +4 -4
  114. package/dist/{chunk-PPIASWWR.js → chunk-EU534WGS.js} +2 -2
  115. package/dist/{chunk-XLIK2VDE.js → chunk-EU6IRUCY.js} +7 -5
  116. package/dist/{chunk-XLIK2VDE.js.map → chunk-EU6IRUCY.js.map} +1 -1
  117. package/dist/{chunk-J7MDPTX7.js → chunk-EUAIYYYR.js} +190 -44
  118. package/dist/chunk-EUAIYYYR.js.map +1 -0
  119. package/dist/{chunk-E6KXJSMA.js → chunk-EUCYTCFP.js} +3 -3
  120. package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
  121. package/dist/{chunk-6OAXWYE3.js → chunk-FFOVKNQV.js} +2 -2
  122. package/dist/{chunk-2KRNPFPK.js → chunk-FLI6DEIU.js} +2 -2
  123. package/dist/{chunk-4G4B3Z2B.js → chunk-FP4JYE66.js} +2 -2
  124. package/dist/{chunk-PDVWGGX4.js → chunk-FSIMZNBC.js} +2 -2
  125. package/dist/{chunk-OAIWPB2I.js → chunk-FT4UQYOV.js} +2 -2
  126. package/dist/{chunk-D5UPBXZM.js → chunk-FUFAXVBA.js} +4 -4
  127. package/dist/{chunk-GKOML66M.js → chunk-G2OYFTUD.js} +5 -5
  128. package/dist/{chunk-XTN54NML.js → chunk-G3T6YMBO.js} +4 -4
  129. package/dist/{chunk-KWVI52ER.js → chunk-GELS5Z5Z.js} +4 -4
  130. package/dist/{chunk-J6FFBORM.js → chunk-GH7AOMJD.js} +2 -2
  131. package/dist/{chunk-TCYLCPC6.js → chunk-GKJJNO7C.js} +3 -3
  132. package/dist/{chunk-N75Q5ZSP.js → chunk-GMXWTJNU.js} +2 -2
  133. package/dist/{chunk-B657ZGDH.js → chunk-HQSK2INQ.js} +2 -2
  134. package/dist/{chunk-SQA2MM2F.js → chunk-I7S55EOB.js} +2 -2
  135. package/dist/{chunk-CAUNCRLQ.js → chunk-J7JWFZHI.js} +108 -108
  136. package/dist/{chunk-NQMG2W5L.js → chunk-JDZFIR2S.js} +2 -2
  137. package/dist/{chunk-O52WWLKU.js → chunk-JIHMUOOS.js} +5 -5
  138. package/dist/{chunk-YYO447A7.js → chunk-JNIVZNIB.js} +41 -253
  139. package/dist/chunk-JNIVZNIB.js.map +1 -0
  140. package/dist/{chunk-VUQDJ3JB.js → chunk-JPTPS4OB.js} +6 -6
  141. package/dist/{chunk-WXFKXCOQ.js → chunk-JQ7XU625.js} +10 -10
  142. package/dist/{chunk-3I3U6FFT.js → chunk-K7BN34IA.js} +2 -2
  143. package/dist/{chunk-7OAIOE5P.js → chunk-KH2LKDX7.js} +2 -2
  144. package/dist/{chunk-VDXTXVFZ.js → chunk-KR6ZKECI.js} +5 -5
  145. package/dist/{chunk-MK552I5J.js → chunk-L5DAHSEZ.js} +4 -4
  146. package/dist/{chunk-XQIHFXYP.js → chunk-LCKVXX5F.js} +2 -2
  147. package/dist/{chunk-ZI7LMSNI.js → chunk-LLHZZOIB.js} +2 -2
  148. package/dist/{chunk-E57LYSHI.js → chunk-LZACDIM2.js} +2 -2
  149. package/dist/{chunk-QAIKLICT.js → chunk-M7KGIW5F.js} +2 -2
  150. package/dist/{chunk-55ZVZBX4.js → chunk-MATDGSJ7.js} +4 -4
  151. package/dist/{chunk-3NFN4Y4P.js → chunk-MGCKZWAE.js} +5 -5
  152. package/dist/{chunk-YS7SA4HD.js → chunk-ML7ZJAKJ.js} +4 -4
  153. package/dist/{chunk-YDH2FSDI.js → chunk-N45NEBOD.js} +2 -2
  154. package/dist/{chunk-7UX44C4N.js → chunk-N4C7QKOG.js} +3 -3
  155. package/dist/{chunk-YYNHJF3N.js → chunk-N7KYEVLK.js} +2 -2
  156. package/dist/{chunk-HT2C4EXO.js → chunk-NIRQGDYC.js} +4 -4
  157. package/dist/{chunk-DXHVD4DS.js → chunk-NW2E4CI2.js} +3 -3
  158. package/dist/{chunk-BFIZXFUG.js → chunk-NWIT3U2N.js} +2 -2
  159. package/dist/{chunk-4NDWE44P.js → chunk-NZFFGO5O.js} +2 -2
  160. package/dist/{chunk-MB5EJ2CT.js → chunk-O2IPAX26.js} +10 -10
  161. package/dist/{chunk-UOA2VQ7C.js → chunk-O4SGYW7H.js} +2 -2
  162. package/dist/{chunk-SSAXGPXY.js → chunk-OP6N4H6A.js} +2 -2
  163. package/dist/{chunk-ZSJGYC3C.js → chunk-OQJKY3Z5.js} +2 -2
  164. package/dist/{chunk-OFEHITAZ.js → chunk-OXNTOHL6.js} +2 -2
  165. package/dist/{chunk-CDWFWOSZ.js → chunk-P4JED3ZL.js} +2 -2
  166. package/dist/{chunk-FQD2KPQH.js → chunk-P55FACBG.js} +2 -2
  167. package/dist/{chunk-KX36OCGK.js → chunk-P5NQN4JE.js} +3 -3
  168. package/dist/{chunk-3ZCRHW7U.js → chunk-P7TOIOT7.js} +2 -2
  169. package/dist/{chunk-BD5QEP3T.js → chunk-PAZ35RJ4.js} +45 -32
  170. package/dist/chunk-PAZ35RJ4.js.map +1 -0
  171. package/dist/chunk-PGRZ3FYC.js +34 -0
  172. package/dist/chunk-PGRZ3FYC.js.map +1 -0
  173. package/dist/{chunk-PBVNVKYN.js → chunk-PIN5OPBA.js} +2 -2
  174. package/dist/{chunk-O6YDGTH4.js → chunk-PZHQWFR3.js} +3 -3
  175. package/dist/{chunk-SVDU4OHO.js → chunk-Q35L7TYB.js} +2 -2
  176. package/dist/{chunk-SOJ3IQD3.js → chunk-QODKDRSP.js} +6 -6
  177. package/dist/{chunk-VJGDQA3D.js → chunk-QOZJCSFO.js} +3 -3
  178. package/dist/{chunk-6T42L5FI.js → chunk-QS3OLP5I.js} +2 -2
  179. package/dist/{chunk-PAAJWQH5.js → chunk-QUMKDRCF.js} +2 -2
  180. package/dist/{chunk-4TP3MJ3D.js → chunk-QX6JN3O4.js} +7 -7
  181. package/dist/{chunk-KZEMFD6E.js → chunk-R2H4ZFBJ.js} +3 -3
  182. package/dist/{chunk-N6UMXWBA.js → chunk-RTKV5XHL.js} +4 -4
  183. package/dist/{chunk-ZQ3WU6JO.js → chunk-RXFCU3CY.js} +2 -2
  184. package/dist/{chunk-BOOFTFFE.js → chunk-S2I7DL5Q.js} +1 -1
  185. package/dist/{chunk-2NCBDGND.js → chunk-SA6GMZJY.js} +3 -3
  186. package/dist/{chunk-2AFHZTPI.js → chunk-SIIRTDJ4.js} +3 -3
  187. package/dist/{chunk-WH4QXVKU.js → chunk-SS3IS2JR.js} +3 -3
  188. package/dist/{chunk-VFTK5WKI.js → chunk-STBX5X6B.js} +2 -2
  189. package/dist/{chunk-WVHRNAXL.js → chunk-SWWHIJUJ.js} +2 -2
  190. package/dist/{chunk-WADSXS4K.js → chunk-SX4QDWXK.js} +2 -2
  191. package/dist/{chunk-2U4BM3TW.js → chunk-TITG2NBS.js} +2 -2
  192. package/dist/{chunk-A5ZYP4K5.js → chunk-TNRCDMQT.js} +2 -2
  193. package/dist/{chunk-LZKOVXMX.js → chunk-TRMJ6BYC.js} +2 -2
  194. package/dist/{chunk-VA2HNBGQ.js → chunk-TZNDKTX5.js} +69 -69
  195. package/dist/{chunk-OFDIGTC2.js → chunk-UMTCNEVQ.js} +17 -17
  196. package/dist/{chunk-L3G5CGL5.js → chunk-UQDG3YLN.js} +68 -24
  197. package/dist/chunk-UQDG3YLN.js.map +1 -0
  198. package/dist/{chunk-AAM66QCP.js → chunk-UZRSI6NX.js} +2 -2
  199. package/dist/{chunk-2CXQZXWM.js → chunk-V4MB5ONM.js} +6 -6
  200. package/dist/{chunk-5BUCKFRE.js → chunk-VOKHZRHW.js} +2 -2
  201. package/dist/{chunk-CYEK6Z3P.js → chunk-VW6VIJOS.js} +2 -2
  202. package/dist/{chunk-I2M4ZVDD.js → chunk-W47S5TIH.js} +9 -9
  203. package/dist/{chunk-CBP4HWCL.js → chunk-W5MCEVUS.js} +3 -3
  204. package/dist/{chunk-E5H4TM4Y.js → chunk-WC3V7HHP.js} +3 -3
  205. package/dist/{chunk-WCTL3PVM.js → chunk-WLMZ2L5P.js} +2 -2
  206. package/dist/{chunk-SQ2O52SU.js → chunk-WSGPFRBH.js} +10 -10
  207. package/dist/{chunk-BH44JOLA.js → chunk-WVADKFWV.js} +3 -3
  208. package/dist/{chunk-JVNEXW6X.js → chunk-XISROV24.js} +2 -2
  209. package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
  210. package/dist/{chunk-56GJLXBA.js → chunk-Y4NKEXQT.js} +4 -4
  211. package/dist/{chunk-EKKAHJ4B.js → chunk-YE36AJL7.js} +4 -4
  212. package/dist/chunk-YET735EZ.js +99 -0
  213. package/dist/chunk-YET735EZ.js.map +1 -0
  214. package/dist/{chunk-OGWEWJRH.js → chunk-YFMBHQRG.js} +2 -2
  215. package/dist/{chunk-JLIGUFPF.js → chunk-YN2DQ2D6.js} +2 -2
  216. package/dist/{chunk-RBJQYMMT.js → chunk-YRULQW5J.js} +4 -4
  217. package/dist/{chunk-UCJINCZT.js → chunk-YUZRI3QU.js} +2 -2
  218. package/dist/{chunk-QUNDYIYZ.js → chunk-YYEOR4XN.js} +3 -3
  219. package/dist/{chunk-O5MW6CQL.js → chunk-ZJVMUBYF.js} +2 -2
  220. package/dist/{chunk-VBJD4RSJ.js → chunk-ZSH2NRDV.js} +2 -2
  221. package/dist/{chunk-BX4WDBTE.js → chunk-ZV65I6ME.js} +78 -78
  222. package/dist/cli.js +150 -148
  223. package/dist/coding/export-okf-codegraph.js +31 -29
  224. package/dist/coding/export-okf-codegraph.js.map +1 -1
  225. package/dist/coding/pre-action-gate.js +2 -2
  226. package/dist/compounding/engine.d.ts +15 -11
  227. package/dist/compounding/engine.d.ts.map +1 -1
  228. package/dist/compounding/engine.js +34 -32
  229. package/dist/compounding/iso-week.d.ts +2 -0
  230. package/dist/compounding/iso-week.d.ts.map +1 -1
  231. package/dist/compounding/weekly-scheduler.d.ts +81 -0
  232. package/dist/compounding/weekly-scheduler.d.ts.map +1 -0
  233. package/dist/compounding/weekly-synthesis-queue.d.ts +9 -0
  234. package/dist/compounding/weekly-synthesis-queue.d.ts.map +1 -0
  235. package/dist/config.js +42 -40
  236. package/dist/connectors/codex-materialize-runner.js +31 -29
  237. package/dist/connectors/index.js +32 -30
  238. package/dist/console/trace.d.ts +5 -14
  239. package/dist/console/trace.d.ts.map +1 -1
  240. package/dist/consolidation-provenance-check.js +7 -6
  241. package/dist/consolidation-undo.js +5 -4
  242. package/dist/consolidation-undo.js.map +1 -1
  243. package/dist/contradiction/index.js +9 -8
  244. package/dist/{contradiction-scan-GGRTVB7C.js → contradiction-scan-P7KXB5R4.js} +3 -3
  245. package/dist/converge-config.d.ts +2 -0
  246. package/dist/converge-config.d.ts.map +1 -1
  247. package/dist/converge-config.js +7 -3
  248. package/dist/convergence-refresh.js +33 -31
  249. package/dist/corpus-watermark.js +33 -31
  250. package/dist/dashboard-runtime.js +2 -2
  251. package/dist/day-summary.js +2 -2
  252. package/dist/deep-recall-http-glue.js +13 -13
  253. package/dist/deep-recall.js +2 -2
  254. package/dist/embedding-fallback.js +6 -5
  255. package/dist/embedding-generation-lock.js +4 -3
  256. package/dist/entity-retrieval.js +32 -30
  257. package/dist/explicit-capture.js +12 -9
  258. package/dist/external-wiki-access.js +98 -96
  259. package/dist/extraction-judge.js +3 -3
  260. package/dist/extraction-normalization.js +3 -3
  261. package/dist/extraction-prompt.js +2 -2
  262. package/dist/extraction-quote-grounding.d.ts +67 -0
  263. package/dist/extraction-quote-grounding.d.ts.map +1 -0
  264. package/dist/extraction-quote-grounding.js +27 -0
  265. package/dist/extraction-quote-grounding.js.map +1 -0
  266. package/dist/extraction-source-grounding-helpers.d.ts +8 -0
  267. package/dist/extraction-source-grounding-helpers.d.ts.map +1 -1
  268. package/dist/extraction-source-grounding-helpers.js +11 -1
  269. package/dist/extraction-source-grounding-rules.d.ts +3 -1
  270. package/dist/extraction-source-grounding-rules.d.ts.map +1 -1
  271. package/dist/extraction-source-grounding-rules.js +3 -2
  272. package/dist/extraction-source-grounding.d.ts +1 -1
  273. package/dist/extraction-source-grounding.d.ts.map +1 -1
  274. package/dist/extraction-source-grounding.js +4 -3
  275. package/dist/extraction-span-materialize.js +2 -2
  276. package/dist/extraction.js +50 -47
  277. package/dist/{first-start-migration-OM3PHMZO.js → first-start-migration-6A5BJPDW.js} +5 -5
  278. package/dist/{forget-OHAJ6PSU.js → forget-GXBWFKRC.js} +5 -4
  279. package/dist/{forget-OHAJ6PSU.js.map → forget-GXBWFKRC.js.map} +1 -1
  280. package/dist/{graph-edge-decay-CZ3SYLM4.js → graph-edge-decay-BYPZVJT4.js} +10 -9
  281. package/dist/graph-edge-decay-BYPZVJT4.js.map +1 -0
  282. package/dist/graph-jsonl.js +8 -7
  283. package/dist/graph-snapshot.js +8 -7
  284. package/dist/graph-write-lock.js +4 -3
  285. package/dist/graph.js +9 -8
  286. package/dist/harmonic-retrieval.js +31 -29
  287. package/dist/http-retry.js +2 -1
  288. package/dist/http-retry.js.map +1 -1
  289. package/dist/index.d.ts +1 -1
  290. package/dist/index.d.ts.map +1 -1
  291. package/dist/index.js +241 -236
  292. package/dist/lcm/engine.js +4 -4
  293. package/dist/lcm/index.js +12 -12
  294. package/dist/local-llm.js +2 -2
  295. package/dist/location/index.js +34 -32
  296. package/dist/maintenance/memory-governance.js +31 -29
  297. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +31 -29
  298. package/dist/maintenance/rebuild-memory-projection-runner.js +33 -31
  299. package/dist/maintenance/rebuild-memory-projection.js +32 -30
  300. package/dist/memory-browse-operations.js +98 -96
  301. package/dist/memory-browse.js +7 -7
  302. package/dist/memory-subject.js +5 -4
  303. package/dist/namespaces/migrate.js +32 -30
  304. package/dist/namespaces/principal.js +2 -2
  305. package/dist/namespaces/search.js +10 -10
  306. package/dist/namespaces/storage.js +31 -29
  307. package/dist/offline-sync-changeset-generations.js +7 -6
  308. package/dist/offline-sync-embedding-generation.js +6 -5
  309. package/dist/offline-sync-impression-drain.js +8 -8
  310. package/dist/offline-sync-snapshot-stream.js +9 -9
  311. package/dist/offline-sync.js +10 -10
  312. package/dist/operator-doctor-corpus.js +34 -32
  313. package/dist/operator-toolkit.js +59 -57
  314. package/dist/orchestration/compression-guideline-coordinator.js +2 -2
  315. package/dist/orchestration/maintenance.d.ts +2 -0
  316. package/dist/orchestration/maintenance.d.ts.map +1 -1
  317. package/dist/orchestration/maintenance.js +49 -43
  318. package/dist/orchestrator.js +203 -200
  319. package/dist/page-versioning.js +5 -4
  320. package/dist/qmd-daemon-session.js +2 -2
  321. package/dist/qmd.js +4 -4
  322. package/dist/recall-explain-renderer.js +3 -3
  323. package/dist/recall-navigate-access.js +2 -2
  324. package/dist/recall-navigate-disclosure.js +2 -2
  325. package/dist/recall-navigate.js +2 -2
  326. package/dist/recall-navigation-operations.js +98 -96
  327. package/dist/recall-navigation.js +97 -95
  328. package/dist/recall-state-view-admission.js +7 -7
  329. package/dist/recall-state.js +4 -3
  330. package/dist/recall-why-service.js +11 -11
  331. package/dist/recall-why.js +3 -3
  332. package/dist/recall-xray-cli.js +4 -4
  333. package/dist/recall-xray-renderer.js +3 -3
  334. package/dist/recall-xray.js +2 -2
  335. package/dist/reconcile/cursor.js +4 -2
  336. package/dist/reconcile/cursor.js.map +1 -1
  337. package/dist/reconcile/manifest.js +9 -6
  338. package/dist/reconcile/plan.js +4 -2
  339. package/dist/rerank-outcome.js +2 -2
  340. package/dist/{resolution-E4GLHLY6.js → resolution-7AY36LGJ.js} +10 -9
  341. package/dist/resolution-7AY36LGJ.js.map +1 -0
  342. package/dist/resume-bundles.js +43 -41
  343. package/dist/salvage-envelope.js +7 -6
  344. package/dist/search/embed-helper.js +2 -2
  345. package/dist/search/factory.js +9 -9
  346. package/dist/search/index.js +15 -15
  347. package/dist/semantic-consolidation.js +36 -34
  348. package/dist/semantic-rule-promotion.js +31 -29
  349. package/dist/semantic-rule-verifier.js +31 -29
  350. package/dist/shared-context/manager.js +2 -2
  351. package/dist/source-agent-qualifier.js +43 -40
  352. package/dist/standup/build.js +31 -29
  353. package/dist/storage/content-hash-index.d.ts +10 -0
  354. package/dist/storage/content-hash-index.d.ts.map +1 -1
  355. package/dist/storage/tombstone-blocked-capture-index.d.ts +3 -0
  356. package/dist/storage/tombstone-blocked-capture-index.d.ts.map +1 -1
  357. package/dist/storage/tombstone-blocked-capture-mutation.d.ts +23 -3
  358. package/dist/storage/tombstone-blocked-capture-mutation.d.ts.map +1 -1
  359. package/dist/storage.d.ts +6 -0
  360. package/dist/storage.d.ts.map +1 -1
  361. package/dist/storage.js +32 -30
  362. package/dist/subject-config.js +6 -5
  363. package/dist/summarizer.js +6 -6
  364. package/dist/summary-snapshot.js +4 -3
  365. package/dist/support-passport/index.js +100 -98
  366. package/dist/{tier-stats-M2FMMD2N.js → tier-stats-RQM76XYY.js} +2 -2
  367. package/dist/{trace-LXXCMZJA.js → trace-QBQVS5BC.js} +5 -21
  368. package/dist/trace-QBQVS5BC.js.map +1 -0
  369. package/dist/transfer/autodetect.js +1 -1
  370. package/dist/transfer/backup.js +1 -1
  371. package/dist/transfer/capsule-export.js +3 -3
  372. package/dist/transfer/capsule-import.js +7 -6
  373. package/dist/transfer/export-okf.js +31 -29
  374. package/dist/types.d.ts +9 -0
  375. package/dist/types.d.ts.map +1 -1
  376. package/dist/types.js +1 -1
  377. package/dist/utils/serialize-mutations.js +3 -2
  378. package/dist/utils/sleep.d.ts +6 -0
  379. package/dist/utils/sleep.d.ts.map +1 -1
  380. package/dist/verified-recall.js +31 -29
  381. package/dist/who-knows-cli.js +32 -30
  382. package/dist/who-knows.js +31 -29
  383. package/dist/write-envelope.js +6 -5
  384. package/package.json +22 -2
  385. package/src/calibration.test.ts +80 -1
  386. package/src/calibration.ts +77 -8
  387. package/src/capabilities.test.ts +1 -0
  388. package/src/capabilities.ts +4 -4
  389. package/src/capture-write-lock-backoff.test.ts +534 -0
  390. package/src/capture-write-lock-backoff.ts +140 -0
  391. package/src/capture-write-lock.ts +8 -0
  392. package/src/compounding/engine.ts +32 -31
  393. package/src/compounding/iso-week.ts +16 -0
  394. package/src/compounding/weekly-scheduler.test.ts +426 -0
  395. package/src/compounding/weekly-scheduler.ts +231 -0
  396. package/src/compounding/weekly-synthesis-queue.ts +23 -0
  397. package/src/console/trace.ts +5 -36
  398. package/src/converge-config.ts +80 -1
  399. package/src/extraction-quote-grounding.test.ts +546 -0
  400. package/src/extraction-quote-grounding.ts +232 -0
  401. package/src/extraction-source-grounding-helpers.ts +35 -0
  402. package/src/extraction-source-grounding-rules.ts +90 -65
  403. package/src/extraction-source-grounding.ts +11 -2
  404. package/src/index.ts +1 -1
  405. package/src/orchestration/maintenance.ts +6 -2
  406. package/src/providers/codex-subscription.test.ts +15 -3
  407. package/src/storage/content-hash-index.ts +10 -0
  408. package/src/storage/tombstone-blocked-capture-index.ts +8 -1
  409. package/src/storage/tombstone-blocked-capture-mutation.ts +133 -43
  410. package/src/storage.ts +13 -0
  411. package/src/types.ts +9 -0
  412. package/src/utils/sleep.ts +28 -0
  413. package/dist/chunk-375ARKRS.js.map +0 -1
  414. package/dist/chunk-6MINUTGJ.js +0 -64
  415. package/dist/chunk-6MINUTGJ.js.map +0 -1
  416. package/dist/chunk-7LEQREP2.js +0 -9
  417. package/dist/chunk-7LEQREP2.js.map +0 -1
  418. package/dist/chunk-BD5QEP3T.js.map +0 -1
  419. package/dist/chunk-J7MDPTX7.js.map +0 -1
  420. package/dist/chunk-KI6UOSNR.js.map +0 -1
  421. package/dist/chunk-L3G5CGL5.js.map +0 -1
  422. package/dist/chunk-QWWMS4AE.js.map +0 -1
  423. package/dist/chunk-YRH3C2OJ.js.map +0 -1
  424. package/dist/chunk-YYO447A7.js.map +0 -1
  425. package/dist/trace-LXXCMZJA.js.map +0 -1
  426. /package/dist/{auto-sync-WSJAOLOP.js.map → auto-sync-7WWAKW6F.js.map} +0 -0
  427. /package/dist/{contradiction-scan-GGRTVB7C.js.map → capture-write-lock-backoff.js.map} +0 -0
  428. /package/dist/{graph-edge-decay-CZ3SYLM4.js.map → capture-write-lock.js.map} +0 -0
  429. /package/dist/{chunk-RNPJ4GQA.js.map → chunk-22W2XWGH.js.map} +0 -0
  430. /package/dist/{chunk-AV2OQF2O.js.map → chunk-3F3HA3R2.js.map} +0 -0
  431. /package/dist/{chunk-QZZPUREO.js.map → chunk-3GYSZHMT.js.map} +0 -0
  432. /package/dist/{chunk-XYOT5GQU.js.map → chunk-3NF4QUNZ.js.map} +0 -0
  433. /package/dist/{chunk-AL6EHLB5.js.map → chunk-3X3PNU3T.js.map} +0 -0
  434. /package/dist/{chunk-BTJ6CAIA.js.map → chunk-4IYIGN53.js.map} +0 -0
  435. /package/dist/{chunk-OM3RWZQK.js.map → chunk-4KY5GSMB.js.map} +0 -0
  436. /package/dist/{chunk-4N2MFNTG.js.map → chunk-4OSG5Y6M.js.map} +0 -0
  437. /package/dist/{chunk-EEDI3OXB.js.map → chunk-4Q26RNSR.js.map} +0 -0
  438. /package/dist/{chunk-EHRE7ZG3.js.map → chunk-5B5WYAHQ.js.map} +0 -0
  439. /package/dist/{chunk-WCGJK4NQ.js.map → chunk-5FNZ3G6X.js.map} +0 -0
  440. /package/dist/{chunk-Y6DZ33PA.js.map → chunk-5GX5457J.js.map} +0 -0
  441. /package/dist/{chunk-OFCHT2TN.js.map → chunk-5LRV557D.js.map} +0 -0
  442. /package/dist/{chunk-VAOC6GHN.js.map → chunk-5PHOU5QI.js.map} +0 -0
  443. /package/dist/{chunk-WL7N5VGG.js.map → chunk-5TJEOU6Y.js.map} +0 -0
  444. /package/dist/{chunk-A2L3P2IY.js.map → chunk-5WCJLQTM.js.map} +0 -0
  445. /package/dist/{chunk-MZBWIJJN.js.map → chunk-63B2IZYE.js.map} +0 -0
  446. /package/dist/{chunk-DGRMWDQY.js.map → chunk-66BCOVW2.js.map} +0 -0
  447. /package/dist/{chunk-P2S6P7X6.js.map → chunk-6LG7BWKW.js.map} +0 -0
  448. /package/dist/{chunk-4G2YCKLT.js.map → chunk-7G5NTS7F.js.map} +0 -0
  449. /package/dist/{chunk-IPLYGWQF.js.map → chunk-7LCGFUMB.js.map} +0 -0
  450. /package/dist/{chunk-KYY4EACB.js.map → chunk-7Z3DLNSD.js.map} +0 -0
  451. /package/dist/{chunk-7SUWY37K.js.map → chunk-B665A6BO.js.map} +0 -0
  452. /package/dist/{chunk-AEGNDL24.js.map → chunk-BVRZSI7Q.js.map} +0 -0
  453. /package/dist/{chunk-KJOGIRMF.js.map → chunk-CB6ANA2I.js.map} +0 -0
  454. /package/dist/{chunk-5JMI26Q7.js.map → chunk-CBH2Z4UA.js.map} +0 -0
  455. /package/dist/{chunk-W4RLOZOG.js.map → chunk-CJRENHVZ.js.map} +0 -0
  456. /package/dist/{chunk-LOFVW6JA.js.map → chunk-CLWBFR7Q.js.map} +0 -0
  457. /package/dist/{chunk-6VAHJ2F6.js.map → chunk-DMDWFQMR.js.map} +0 -0
  458. /package/dist/{chunk-MO25AN7J.js.map → chunk-DPR2WTN3.js.map} +0 -0
  459. /package/dist/{chunk-JXSYWTFK.js.map → chunk-DYJHGJZ4.js.map} +0 -0
  460. /package/dist/{chunk-5X4ZJESN.js.map → chunk-EH4BQ7LT.js.map} +0 -0
  461. /package/dist/{chunk-JXWTPOMJ.js.map → chunk-EPJDSQHF.js.map} +0 -0
  462. /package/dist/{chunk-OEIA4IHU.js.map → chunk-ESG6ITGP.js.map} +0 -0
  463. /package/dist/{chunk-7XI2UJHL.js.map → chunk-ETZUIRCI.js.map} +0 -0
  464. /package/dist/{chunk-PPIASWWR.js.map → chunk-EU534WGS.js.map} +0 -0
  465. /package/dist/{chunk-E6KXJSMA.js.map → chunk-EUCYTCFP.js.map} +0 -0
  466. /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
  467. /package/dist/{chunk-6OAXWYE3.js.map → chunk-FFOVKNQV.js.map} +0 -0
  468. /package/dist/{chunk-2KRNPFPK.js.map → chunk-FLI6DEIU.js.map} +0 -0
  469. /package/dist/{chunk-4G4B3Z2B.js.map → chunk-FP4JYE66.js.map} +0 -0
  470. /package/dist/{chunk-PDVWGGX4.js.map → chunk-FSIMZNBC.js.map} +0 -0
  471. /package/dist/{chunk-OAIWPB2I.js.map → chunk-FT4UQYOV.js.map} +0 -0
  472. /package/dist/{chunk-D5UPBXZM.js.map → chunk-FUFAXVBA.js.map} +0 -0
  473. /package/dist/{chunk-GKOML66M.js.map → chunk-G2OYFTUD.js.map} +0 -0
  474. /package/dist/{chunk-XTN54NML.js.map → chunk-G3T6YMBO.js.map} +0 -0
  475. /package/dist/{chunk-KWVI52ER.js.map → chunk-GELS5Z5Z.js.map} +0 -0
  476. /package/dist/{chunk-J6FFBORM.js.map → chunk-GH7AOMJD.js.map} +0 -0
  477. /package/dist/{chunk-TCYLCPC6.js.map → chunk-GKJJNO7C.js.map} +0 -0
  478. /package/dist/{chunk-N75Q5ZSP.js.map → chunk-GMXWTJNU.js.map} +0 -0
  479. /package/dist/{chunk-B657ZGDH.js.map → chunk-HQSK2INQ.js.map} +0 -0
  480. /package/dist/{chunk-SQA2MM2F.js.map → chunk-I7S55EOB.js.map} +0 -0
  481. /package/dist/{chunk-CAUNCRLQ.js.map → chunk-J7JWFZHI.js.map} +0 -0
  482. /package/dist/{chunk-NQMG2W5L.js.map → chunk-JDZFIR2S.js.map} +0 -0
  483. /package/dist/{chunk-O52WWLKU.js.map → chunk-JIHMUOOS.js.map} +0 -0
  484. /package/dist/{chunk-VUQDJ3JB.js.map → chunk-JPTPS4OB.js.map} +0 -0
  485. /package/dist/{chunk-WXFKXCOQ.js.map → chunk-JQ7XU625.js.map} +0 -0
  486. /package/dist/{chunk-3I3U6FFT.js.map → chunk-K7BN34IA.js.map} +0 -0
  487. /package/dist/{chunk-7OAIOE5P.js.map → chunk-KH2LKDX7.js.map} +0 -0
  488. /package/dist/{chunk-VDXTXVFZ.js.map → chunk-KR6ZKECI.js.map} +0 -0
  489. /package/dist/{chunk-MK552I5J.js.map → chunk-L5DAHSEZ.js.map} +0 -0
  490. /package/dist/{chunk-XQIHFXYP.js.map → chunk-LCKVXX5F.js.map} +0 -0
  491. /package/dist/{chunk-ZI7LMSNI.js.map → chunk-LLHZZOIB.js.map} +0 -0
  492. /package/dist/{chunk-E57LYSHI.js.map → chunk-LZACDIM2.js.map} +0 -0
  493. /package/dist/{chunk-QAIKLICT.js.map → chunk-M7KGIW5F.js.map} +0 -0
  494. /package/dist/{chunk-55ZVZBX4.js.map → chunk-MATDGSJ7.js.map} +0 -0
  495. /package/dist/{chunk-3NFN4Y4P.js.map → chunk-MGCKZWAE.js.map} +0 -0
  496. /package/dist/{chunk-YS7SA4HD.js.map → chunk-ML7ZJAKJ.js.map} +0 -0
  497. /package/dist/{chunk-YDH2FSDI.js.map → chunk-N45NEBOD.js.map} +0 -0
  498. /package/dist/{chunk-7UX44C4N.js.map → chunk-N4C7QKOG.js.map} +0 -0
  499. /package/dist/{chunk-YYNHJF3N.js.map → chunk-N7KYEVLK.js.map} +0 -0
  500. /package/dist/{chunk-HT2C4EXO.js.map → chunk-NIRQGDYC.js.map} +0 -0
  501. /package/dist/{chunk-DXHVD4DS.js.map → chunk-NW2E4CI2.js.map} +0 -0
  502. /package/dist/{chunk-BFIZXFUG.js.map → chunk-NWIT3U2N.js.map} +0 -0
  503. /package/dist/{chunk-4NDWE44P.js.map → chunk-NZFFGO5O.js.map} +0 -0
  504. /package/dist/{chunk-MB5EJ2CT.js.map → chunk-O2IPAX26.js.map} +0 -0
  505. /package/dist/{chunk-UOA2VQ7C.js.map → chunk-O4SGYW7H.js.map} +0 -0
  506. /package/dist/{chunk-SSAXGPXY.js.map → chunk-OP6N4H6A.js.map} +0 -0
  507. /package/dist/{chunk-ZSJGYC3C.js.map → chunk-OQJKY3Z5.js.map} +0 -0
  508. /package/dist/{chunk-OFEHITAZ.js.map → chunk-OXNTOHL6.js.map} +0 -0
  509. /package/dist/{chunk-CDWFWOSZ.js.map → chunk-P4JED3ZL.js.map} +0 -0
  510. /package/dist/{chunk-FQD2KPQH.js.map → chunk-P55FACBG.js.map} +0 -0
  511. /package/dist/{chunk-KX36OCGK.js.map → chunk-P5NQN4JE.js.map} +0 -0
  512. /package/dist/{chunk-3ZCRHW7U.js.map → chunk-P7TOIOT7.js.map} +0 -0
  513. /package/dist/{chunk-PBVNVKYN.js.map → chunk-PIN5OPBA.js.map} +0 -0
  514. /package/dist/{chunk-O6YDGTH4.js.map → chunk-PZHQWFR3.js.map} +0 -0
  515. /package/dist/{chunk-SVDU4OHO.js.map → chunk-Q35L7TYB.js.map} +0 -0
  516. /package/dist/{chunk-SOJ3IQD3.js.map → chunk-QODKDRSP.js.map} +0 -0
  517. /package/dist/{chunk-VJGDQA3D.js.map → chunk-QOZJCSFO.js.map} +0 -0
  518. /package/dist/{chunk-6T42L5FI.js.map → chunk-QS3OLP5I.js.map} +0 -0
  519. /package/dist/{chunk-PAAJWQH5.js.map → chunk-QUMKDRCF.js.map} +0 -0
  520. /package/dist/{chunk-4TP3MJ3D.js.map → chunk-QX6JN3O4.js.map} +0 -0
  521. /package/dist/{chunk-KZEMFD6E.js.map → chunk-R2H4ZFBJ.js.map} +0 -0
  522. /package/dist/{chunk-N6UMXWBA.js.map → chunk-RTKV5XHL.js.map} +0 -0
  523. /package/dist/{chunk-ZQ3WU6JO.js.map → chunk-RXFCU3CY.js.map} +0 -0
  524. /package/dist/{chunk-BOOFTFFE.js.map → chunk-S2I7DL5Q.js.map} +0 -0
  525. /package/dist/{chunk-2NCBDGND.js.map → chunk-SA6GMZJY.js.map} +0 -0
  526. /package/dist/{chunk-2AFHZTPI.js.map → chunk-SIIRTDJ4.js.map} +0 -0
  527. /package/dist/{chunk-WH4QXVKU.js.map → chunk-SS3IS2JR.js.map} +0 -0
  528. /package/dist/{chunk-VFTK5WKI.js.map → chunk-STBX5X6B.js.map} +0 -0
  529. /package/dist/{chunk-WVHRNAXL.js.map → chunk-SWWHIJUJ.js.map} +0 -0
  530. /package/dist/{chunk-WADSXS4K.js.map → chunk-SX4QDWXK.js.map} +0 -0
  531. /package/dist/{chunk-2U4BM3TW.js.map → chunk-TITG2NBS.js.map} +0 -0
  532. /package/dist/{chunk-A5ZYP4K5.js.map → chunk-TNRCDMQT.js.map} +0 -0
  533. /package/dist/{chunk-LZKOVXMX.js.map → chunk-TRMJ6BYC.js.map} +0 -0
  534. /package/dist/{chunk-VA2HNBGQ.js.map → chunk-TZNDKTX5.js.map} +0 -0
  535. /package/dist/{chunk-OFDIGTC2.js.map → chunk-UMTCNEVQ.js.map} +0 -0
  536. /package/dist/{chunk-AAM66QCP.js.map → chunk-UZRSI6NX.js.map} +0 -0
  537. /package/dist/{chunk-2CXQZXWM.js.map → chunk-V4MB5ONM.js.map} +0 -0
  538. /package/dist/{chunk-5BUCKFRE.js.map → chunk-VOKHZRHW.js.map} +0 -0
  539. /package/dist/{chunk-CYEK6Z3P.js.map → chunk-VW6VIJOS.js.map} +0 -0
  540. /package/dist/{chunk-I2M4ZVDD.js.map → chunk-W47S5TIH.js.map} +0 -0
  541. /package/dist/{chunk-CBP4HWCL.js.map → chunk-W5MCEVUS.js.map} +0 -0
  542. /package/dist/{chunk-E5H4TM4Y.js.map → chunk-WC3V7HHP.js.map} +0 -0
  543. /package/dist/{chunk-WCTL3PVM.js.map → chunk-WLMZ2L5P.js.map} +0 -0
  544. /package/dist/{chunk-SQ2O52SU.js.map → chunk-WSGPFRBH.js.map} +0 -0
  545. /package/dist/{chunk-BH44JOLA.js.map → chunk-WVADKFWV.js.map} +0 -0
  546. /package/dist/{chunk-JVNEXW6X.js.map → chunk-XISROV24.js.map} +0 -0
  547. /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
  548. /package/dist/{chunk-56GJLXBA.js.map → chunk-Y4NKEXQT.js.map} +0 -0
  549. /package/dist/{chunk-EKKAHJ4B.js.map → chunk-YE36AJL7.js.map} +0 -0
  550. /package/dist/{chunk-OGWEWJRH.js.map → chunk-YFMBHQRG.js.map} +0 -0
  551. /package/dist/{chunk-JLIGUFPF.js.map → chunk-YN2DQ2D6.js.map} +0 -0
  552. /package/dist/{chunk-RBJQYMMT.js.map → chunk-YRULQW5J.js.map} +0 -0
  553. /package/dist/{chunk-UCJINCZT.js.map → chunk-YUZRI3QU.js.map} +0 -0
  554. /package/dist/{chunk-QUNDYIYZ.js.map → chunk-YYEOR4XN.js.map} +0 -0
  555. /package/dist/{chunk-O5MW6CQL.js.map → chunk-ZJVMUBYF.js.map} +0 -0
  556. /package/dist/{chunk-VBJD4RSJ.js.map → chunk-ZSH2NRDV.js.map} +0 -0
  557. /package/dist/{chunk-BX4WDBTE.js.map → chunk-ZV65I6ME.js.map} +0 -0
  558. /package/dist/{resolution-E4GLHLY6.js.map → contradiction-scan-P7KXB5R4.js.map} +0 -0
  559. /package/dist/{first-start-migration-OM3PHMZO.js.map → first-start-migration-6A5BJPDW.js.map} +0 -0
  560. /package/dist/{tier-stats-M2FMMD2N.js.map → tier-stats-RQM76XYY.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { isoWeekId } from "./iso-week.js";
4
+ import { cadenceStaleWindowMs, isoWeekId } from "./iso-week.js";
5
5
  import { log } from "../logger.js";
6
6
  import { composeSalvagedEnvelope } from "../salvage-envelope.js";
7
7
  import { sanitizeMemoryContent } from "../sanitize.js";
@@ -11,6 +11,7 @@ import { migrateLegacyFeedbackInbox, resolveFeedbackInboxPath, type SharedFeedba
11
11
  import { parseContinuityImprovementLoops } from "../identity-continuity.js";
12
12
  import { resolveQmdCapabilities, type QmdConfigProjection, resolveConsolidationCapabilities } from "../capabilities.js";
13
13
  import { resolveConversationContextCapabilities } from "../capabilities.js";
14
+ import { writeFileAtomically } from "../maintenance/atomic-file.js";
14
15
  import {
15
16
  actionEventsVisibleInStore, capWeeklyPatternDetails,
16
17
  buildActionFailurePatterns,
@@ -24,6 +25,7 @@ import {
24
25
  type WeeklyActionEvent,
25
26
  type WeeklyCorrectionEvidence,
26
27
  } from "./weekly-evidence.js";
28
+ import { queueWeeklySynthesis } from "./weekly-synthesis-queue.js";
27
29
 
28
30
  type MistakesFile = {
29
31
  version?: number;
@@ -422,20 +424,18 @@ function monthIdFromIsoWeek(weekId: string): string {
422
424
  return isoMonthId(monday);
423
425
  }
424
426
 
425
- function cadenceStaleWindowMs(cadence: "daily" | "weekly" | "monthly" | "quarterly"): number {
426
- switch (cadence) {
427
- case "daily":
428
- return 2 * 24 * 60 * 60 * 1000;
429
- case "weekly":
430
- return 10 * 24 * 60 * 60 * 1000;
431
- case "monthly":
432
- return 45 * 24 * 60 * 60 * 1000;
433
- case "quarterly":
434
- return 120 * 24 * 60 * 60 * 1000;
435
- default:
436
- return 45 * 24 * 60 * 60 * 1000;
437
- }
438
- }
427
+ export type WeeklySynthesisOptions = { weekId?: string };
428
+
429
+ export type WeeklySynthesisResult = {
430
+ weekId: string;
431
+ reportPath: string;
432
+ reportJsonPath: string;
433
+ mistakesCount: number;
434
+ rubricsPath: string;
435
+ rubricsIndexPath: string;
436
+ promotionCandidateCount: number;
437
+ };
438
+
439
439
 
440
440
  export class CompoundingEngine {
441
441
  private readonly weeklyDir: string;
@@ -474,17 +474,12 @@ export class CompoundingEngine {
474
474
  await mkdir(this.rubricsWorkflowsDir, { recursive: true });
475
475
  }
476
476
 
477
- async synthesizeWeekly(opts?: {
478
- weekId?: string;
479
- }): Promise<{
480
- weekId: string;
481
- reportPath: string;
482
- reportJsonPath: string;
483
- mistakesCount: number;
484
- rubricsPath: string;
485
- rubricsIndexPath: string;
486
- promotionCandidateCount: number;
487
- }> {
477
+ /** Serialized per memory directory — see weekly-synthesis-queue.ts. */
478
+ async synthesizeWeekly(opts?: WeeklySynthesisOptions): Promise<WeeklySynthesisResult> {
479
+ return await queueWeeklySynthesis(this.config.memoryDir, () => this.synthesizeWeeklyExclusive(opts));
480
+ }
481
+
482
+ private async synthesizeWeeklyExclusive(opts?: WeeklySynthesisOptions): Promise<WeeklySynthesisResult> {
488
483
  await this.ensureDirs();
489
484
  const weekId = opts?.weekId ?? isoWeekId(new Date());
490
485
 
@@ -559,11 +554,16 @@ export class CompoundingEngine {
559
554
  log.warn(`[cmc] causal consolidation in synthesizeWeekly failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);
560
555
  }
561
556
  }
562
- // PEDC: Run calibration consolidation during weekly synthesis
563
- if (resolveConsolidationCapabilities(this.config).calibration) {
557
+ // PEDC: calibration consolidation, keyed by the week id so a retry does
558
+ // not reinforce the same rules. Only a completed week consolidates: a
559
+ // manual in-progress-week run must not double-count partial evidence.
560
+ if (resolveConsolidationCapabilities(this.config).calibration && weekId < isoWeekId(new Date())) {
564
561
  try {
565
562
  const { calibrationConsolidationInput, runCalibrationConsolidation } = await import("../calibration.js");
566
- const calRules = await runCalibrationConsolidation(calibrationConsolidationInput(this.config));
563
+ const calRules = await runCalibrationConsolidation({
564
+ ...calibrationConsolidationInput(this.config),
565
+ idempotencyKey: weekId,
566
+ });
567
567
  log.debug(`[calibration] weekly synthesis produced ${calRules.length} calibration rule(s)`);
568
568
  } catch (error) {
569
569
  log.warn(`[calibration] weekly consolidation failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);
@@ -573,10 +573,10 @@ export class CompoundingEngine {
573
573
  ? await this.readContinuityAuditReferences(weekId)
574
574
  : { monthId: monthIdFromIsoWeek(weekId), weeklyPath: null, monthlyPath: null };
575
575
 
576
- // Write weekly report (always, even if empty: "day-one outcomes").
576
+ // The markdown report is the completion marker, so it is written after the
577
+ // JSON, rubrics, and mistakes artifacts. A crash before that write retries.
577
578
  const reportPath = path.join(this.weeklyDir, `${weekId}.md`);
578
579
  const md = this.formatWeeklyReport(weekId, entries, mistakes.patterns, mistakes.details, continuity, outcomeSummary, promotionCandidates);
579
- await writeFile(reportPath, md, "utf-8");
580
580
 
581
581
  const reportJsonPath = path.join(this.weeklyDir, `${weekId}.json`);
582
582
  const weeklyArtifact: WeeklyCompoundingArtifact = {
@@ -633,6 +633,7 @@ export class CompoundingEngine {
633
633
  }, null, 2) + "\n",
634
634
  "utf-8",
635
635
  );
636
+ await writeFileAtomically(reportPath, md);
636
637
 
637
638
  log.info(
638
639
  `compounding: wrote weekly=${reportPath} weeklyJson=${reportJsonPath} rubrics=${this.rubricsPath} rubricsIndex=${this.rubricsIndexPath} mistakes=${this.mistakesPath}`,
@@ -58,3 +58,19 @@ export function isIsoWeekId(weekId: string): boolean {
58
58
  const weekNum = Number(week);
59
59
  return weekNum >= 1 && weekNum <= 53;
60
60
  }
61
+
62
+ /** How long a rubric cadence may go unreviewed before it counts as stale. */
63
+ export function cadenceStaleWindowMs(cadence: "daily" | "weekly" | "monthly" | "quarterly"): number {
64
+ switch (cadence) {
65
+ case "daily":
66
+ return 2 * 24 * 60 * 60 * 1000;
67
+ case "weekly":
68
+ return 10 * 24 * 60 * 60 * 1000;
69
+ case "monthly":
70
+ return 45 * 24 * 60 * 60 * 1000;
71
+ case "quarterly":
72
+ return 120 * 24 * 60 * 60 * 1000;
73
+ default:
74
+ return 45 * 24 * 60 * 60 * 1000;
75
+ }
76
+ }
@@ -0,0 +1,426 @@
1
+ /**
2
+ * Daemon weekly compounding run: once per completed ISO week, skip only when
3
+ * a scheduled run already completed that week, and catch up the missed week
4
+ * after a restart.
5
+ */
6
+
7
+ import assert from "node:assert/strict";
8
+ import { mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
9
+ import os from "node:os";
10
+ import path from "node:path";
11
+ import test from "node:test";
12
+
13
+ import { parseConfig } from "../config.js";
14
+ import { initLogger, resetLogger } from "../logger.js";
15
+ import type { NamespaceCatalog } from "../namespaces/catalog.js";
16
+ import type { NamespaceSearchRouter } from "../namespaces/search.js";
17
+ import { MaintenanceScheduler } from "../orchestration/maintenance.js";
18
+ import type { SearchBackend } from "../search/port.js";
19
+ import { CompoundingEngine } from "./engine.js";
20
+ import { queueWeeklySynthesis } from "./weekly-synthesis-queue.js";
21
+ import { isIsoWeekId, isoWeekId, msUntilNextIsoWeek, previousIsoWeekId } from "./iso-week.js";
22
+ import {
23
+ type CompoundingWeeklySchedulerOptions,
24
+ compoundingWeeklyDoneMarkerPath,
25
+ compoundingWeeklyReportPath,
26
+ startCompoundingWeeklyScheduler,
27
+ } from "./weekly-scheduler.js";
28
+
29
+ const QUIET = { info() {}, warn() {}, debug() {} };
30
+
31
+ function fixedClock(iso: string): () => Date {
32
+ const value = new Date(iso);
33
+ return () => new Date(value.getTime());
34
+ }
35
+
36
+ function fakeTimers() {
37
+ const armed: Array<{ fn: () => void; ms: number; unrefd: boolean }> = [];
38
+ const cleared: unknown[] = [];
39
+ return {
40
+ armed,
41
+ cleared,
42
+ setTimer: (fn: () => void, ms: number) => {
43
+ const handle = {
44
+ fn,
45
+ ms,
46
+ unrefd: false,
47
+ unref() {
48
+ this.unrefd = true;
49
+ },
50
+ };
51
+ armed.push(handle);
52
+ return handle;
53
+ },
54
+ clearTimer: (handle: unknown) => {
55
+ cleared.push(handle);
56
+ },
57
+ };
58
+ }
59
+
60
+ function startFor(memoryDir: string, overrides: Partial<CompoundingWeeklySchedulerOptions> & { now: () => Date }) {
61
+ const timers = fakeTimers();
62
+ const handle = startCompoundingWeeklyScheduler({
63
+ memoryDir,
64
+ synthesizeWeekly: async () => undefined,
65
+ log: QUIET,
66
+ setTimer: timers.setTimer,
67
+ clearTimer: timers.clearTimer,
68
+ ...overrides,
69
+ });
70
+ return { handle, timers };
71
+ }
72
+
73
+ test("iso week ids follow the Thursday rule across the year boundary", () => {
74
+ assert.equal(isoWeekId(new Date("2026-01-01T00:00:00.000Z")), "2026-W01");
75
+ assert.equal(previousIsoWeekId(new Date("2026-01-01T00:00:00.000Z")), "2025-W52");
76
+ assert.equal(isoWeekId(new Date("2026-01-05T00:00:00.000Z")), "2026-W02");
77
+ assert.equal(previousIsoWeekId(new Date("2026-01-05T12:00:00.000Z")), "2026-W01");
78
+ assert.equal(isIsoWeekId("2026-W01"), true);
79
+ assert.equal(isIsoWeekId("2026-W00"), false);
80
+ assert.equal(isIsoWeekId("2026-W54"), false);
81
+ assert.equal(isIsoWeekId("../W01"), false);
82
+ assert.equal(isIsoWeekId("2026-W1"), false);
83
+ });
84
+
85
+ test("next Monday delay is one week when already on the Monday boundary", () => {
86
+ const monday = new Date("2026-03-16T00:00:00.000Z");
87
+ assert.equal(monday.getUTCDay(), 1);
88
+ assert.equal(msUntilNextIsoWeek(monday), 7 * 86_400_000);
89
+ const sundayEvening = new Date("2026-03-15T23:00:00.000Z");
90
+ assert.equal(msUntilNextIsoWeek(sundayEvening), 60 * 60 * 1000);
91
+ });
92
+
93
+ test("startup synthesizes the completed ISO week and arms an unref'd boundary timer", async () => {
94
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
95
+ const now = fixedClock("2026-03-18T12:00:00.000Z");
96
+ const calls: string[] = [];
97
+ try {
98
+ const { handle, timers } = startFor(memoryDir, {
99
+ now,
100
+ synthesizeWeekly: async (weekId) => {
101
+ calls.push(weekId);
102
+ },
103
+ });
104
+ await handle.whenIdle();
105
+ assert.deepEqual(calls, [previousIsoWeekId(now())]);
106
+ assert.notEqual(calls[0], isoWeekId(now()));
107
+ assert.equal(timers.armed.length, 1);
108
+ assert.equal(timers.armed[0]?.unrefd, true);
109
+ assert.equal(timers.armed[0]?.ms, msUntilNextIsoWeek(now()));
110
+ await handle.stop();
111
+ assert.equal(timers.cleared.length, 1);
112
+ } finally {
113
+ await rm(memoryDir, { recursive: true, force: true });
114
+ }
115
+ });
116
+
117
+ test("a week a scheduled run completed is skipped, including after a restart", async () => {
118
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
119
+ const now = fixedClock("2026-03-18T12:00:00.000Z");
120
+ const weekId = previousIsoWeekId(now());
121
+ const calls: string[] = [];
122
+ const synthesizeWeekly = async (id: string) => {
123
+ calls.push(id);
124
+ const report = compoundingWeeklyReportPath(memoryDir, id);
125
+ await mkdir(path.dirname(report), { recursive: true });
126
+ await writeFile(report, `# ${id}\n`, "utf8");
127
+ };
128
+ try {
129
+ const first = startFor(memoryDir, { now, synthesizeWeekly });
130
+ await first.handle.whenIdle();
131
+ await first.handle.stop();
132
+ assert.deepEqual(calls, [weekId]);
133
+
134
+ const restarted = startFor(memoryDir, { now, synthesizeWeekly });
135
+ await restarted.handle.whenIdle();
136
+ await restarted.handle.stop();
137
+ assert.deepEqual(calls, [weekId], "restart must not re-run a week the scheduler completed");
138
+ assert.equal(await readFile(compoundingWeeklyReportPath(memoryDir, weekId), "utf8"), `# ${weekId}\n`);
139
+ await stat(compoundingWeeklyDoneMarkerPath(memoryDir, weekId));
140
+ } finally {
141
+ await rm(memoryDir, { recursive: true, force: true });
142
+ }
143
+ });
144
+
145
+ test("a manual access-surface report does not suppress the scheduled run", async () => {
146
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
147
+ const now = fixedClock("2026-03-18T12:00:00.000Z");
148
+ const weekId = previousIsoWeekId(now());
149
+ const calls: string[] = [];
150
+ try {
151
+ // A manual compounding_weekly_synthesize call wrote the week's report
152
+ // while that week was still in progress; no scheduler marker exists.
153
+ const report = compoundingWeeklyReportPath(memoryDir, weekId);
154
+ await mkdir(path.dirname(report), { recursive: true });
155
+ await writeFile(report, `# ${weekId}\n`, "utf8");
156
+
157
+ const { handle } = startFor(memoryDir, {
158
+ now,
159
+ synthesizeWeekly: async (id) => {
160
+ calls.push(id);
161
+ },
162
+ });
163
+ await handle.whenIdle();
164
+ await handle.stop();
165
+ assert.deepEqual(calls, [weekId], "the report file alone must not satisfy the due check");
166
+ await stat(compoundingWeeklyDoneMarkerPath(memoryDir, weekId));
167
+ } finally {
168
+ await rm(memoryDir, { recursive: true, force: true });
169
+ }
170
+ });
171
+
172
+ test("a missed week is caught up once and older gaps are not backfilled", async () => {
173
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
174
+ let now = new Date("2026-04-08T12:00:00.000Z");
175
+ const calls: string[] = [];
176
+ const synthesizeWeekly = async (id: string) => {
177
+ calls.push(id);
178
+ const report = compoundingWeeklyReportPath(memoryDir, id);
179
+ await mkdir(path.dirname(report), { recursive: true });
180
+ await writeFile(report, `# ${id}\n`, "utf8");
181
+ };
182
+ try {
183
+ const first = startFor(memoryDir, { now: () => now, synthesizeWeekly });
184
+ await first.handle.whenIdle();
185
+ await first.handle.stop();
186
+
187
+ const completed = previousIsoWeekId(now);
188
+ now = new Date(now.getTime() + 14 * 86_400_000);
189
+ const missed = previousIsoWeekId(new Date(now.getTime() - 7 * 86_400_000));
190
+ const due = previousIsoWeekId(now);
191
+ assert.notEqual(completed, missed);
192
+ assert.notEqual(missed, due);
193
+
194
+ const restarted = startFor(memoryDir, { now: () => now, synthesizeWeekly });
195
+ await restarted.handle.whenIdle();
196
+ await restarted.handle.stop();
197
+ assert.deepEqual(calls, [completed, due]);
198
+ assert.equal(calls.includes(missed), false);
199
+ } finally {
200
+ await rm(memoryDir, { recursive: true, force: true });
201
+ }
202
+ });
203
+
204
+ test("a failed tick retries on the next boundary and a stopped timer does not run", async () => {
205
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
206
+ const now = fixedClock("2026-03-18T12:00:00.000Z");
207
+ let fail = true;
208
+ const calls: string[] = [];
209
+ try {
210
+ const { handle, timers } = startFor(memoryDir, {
211
+ now,
212
+ synthesizeWeekly: async (weekId) => {
213
+ calls.push(weekId);
214
+ if (fail) throw new Error("synthesis unavailable");
215
+ },
216
+ });
217
+ await handle.whenIdle();
218
+ assert.equal(calls.length, 1);
219
+ fail = false;
220
+ timers.armed[0]?.fn();
221
+ await handle.whenIdle();
222
+ assert.equal(calls.length, 2);
223
+ await handle.stop();
224
+ const afterStop = calls.length;
225
+ timers.armed[0]?.fn();
226
+ await handle.whenIdle();
227
+ assert.equal(calls.length, afterStop);
228
+ } finally {
229
+ await rm(memoryDir, { recursive: true, force: true });
230
+ }
231
+ });
232
+
233
+ test("a failed week is retried after the ISO boundary, before the newly due week", async () => {
234
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
235
+ let now = new Date("2026-03-18T12:00:00.000Z");
236
+ let fail = true;
237
+ const calls: string[] = [];
238
+ try {
239
+ const { handle, timers } = startFor(memoryDir, {
240
+ now: () => now,
241
+ synthesizeWeekly: async (weekId) => {
242
+ calls.push(weekId);
243
+ if (fail) throw new Error("synthesis unavailable");
244
+ },
245
+ });
246
+ await handle.whenIdle();
247
+ const failed = previousIsoWeekId(now);
248
+ now = new Date(now.getTime() + 7 * 86_400_000);
249
+ const due = previousIsoWeekId(now);
250
+ assert.notEqual(failed, due);
251
+ fail = false;
252
+ timers.armed.at(-1)?.fn();
253
+ await handle.whenIdle();
254
+ assert.deepEqual(calls, [failed, failed, due]);
255
+ await handle.stop();
256
+ } finally {
257
+ await rm(memoryDir, { recursive: true, force: true });
258
+ }
259
+ });
260
+
261
+ test("a later artifact failure does not leave the weekly report marker", async () => {
262
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
263
+ const weekId = previousIsoWeekId(new Date("2026-03-18T12:00:00.000Z"));
264
+ try {
265
+ await mkdir(path.join(memoryDir, "compounding", "mistakes.json"), { recursive: true });
266
+ const engine = new CompoundingEngine(parseConfig({ memoryDir, qmdEnabled: false, compoundingEnabled: true }));
267
+ await assert.rejects(() => engine.synthesizeWeekly({ weekId }));
268
+ await assert.rejects(
269
+ () => stat(compoundingWeeklyReportPath(memoryDir, weekId)),
270
+ (error: unknown) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT"
271
+ );
272
+ } finally {
273
+ await rm(memoryDir, { recursive: true, force: true });
274
+ }
275
+ });
276
+
277
+ test("an overlapping tick coalesces into one follow-up run", async () => {
278
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
279
+ let release: (() => void) | undefined;
280
+ const gate = new Promise<void>((resolve) => {
281
+ release = resolve;
282
+ });
283
+ let calls = 0;
284
+ try {
285
+ const { handle } = startFor(memoryDir, {
286
+ now: fixedClock("2026-03-18T12:00:00.000Z"),
287
+ // Every tick reports the week as not yet done, so the follow-up run
288
+ // the coalescing produces is observable as a second synthesis.
289
+ weekDone: async () => false,
290
+ synthesizeWeekly: async () => {
291
+ calls += 1;
292
+ if (calls === 1) await gate;
293
+ },
294
+ });
295
+ const extra = handle.tick();
296
+ release?.();
297
+ await extra;
298
+ await handle.whenIdle();
299
+ assert.equal(calls, 2);
300
+ await handle.stop();
301
+ } finally {
302
+ await rm(memoryDir, { recursive: true, force: true });
303
+ }
304
+ });
305
+
306
+ function maintenanceScheduler(
307
+ memoryDir: string,
308
+ flags: { compounding: boolean; weekly: boolean }
309
+ ): MaintenanceScheduler {
310
+ const config = parseConfig({
311
+ memoryDir,
312
+ qmdEnabled: false,
313
+ compoundingEnabled: flags.compounding,
314
+ compoundingWeeklyCronEnabled: flags.weekly,
315
+ calibrationEnabled: true,
316
+ });
317
+ return new MaintenanceScheduler({
318
+ config,
319
+ getQmd: () => ({ isAvailable: () => false }) as unknown as SearchBackend,
320
+ namespaceSearchRouter: {} as unknown as NamespaceSearchRouter,
321
+ namespaceCatalog: {} as unknown as NamespaceCatalog,
322
+ });
323
+ }
324
+
325
+ test("compoundingWeeklyCronEnabled defaults off and the daemon does not arm the run", async () => {
326
+ assert.equal(parseConfig({}).compoundingWeeklyCronEnabled, false);
327
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
328
+ try {
329
+ for (const flags of [
330
+ { compounding: false, weekly: false },
331
+ { compounding: true, weekly: false },
332
+ { compounding: false, weekly: true },
333
+ ]) {
334
+ const scheduler = maintenanceScheduler(memoryDir, flags);
335
+ try {
336
+ assert.equal(scheduler.armCompoundingWeeklyCron(), false);
337
+ } finally {
338
+ await scheduler.dispose();
339
+ }
340
+ }
341
+ } finally {
342
+ await rm(memoryDir, { recursive: true, force: true });
343
+ }
344
+ });
345
+
346
+ test("the daemon arms synthesizeWeekly, including its calibration pass, for the completed week", async () => {
347
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-weekly-cron-"));
348
+ const weekId = previousIsoWeekId(new Date());
349
+ const original = CompoundingEngine.prototype.synthesizeWeekly;
350
+ const calls: Array<string | undefined> = [];
351
+ const logs: string[] = [];
352
+ CompoundingEngine.prototype.synthesizeWeekly = async function (opts) {
353
+ calls.push(opts?.weekId);
354
+ return original.call(this, opts);
355
+ };
356
+ initLogger(
357
+ {
358
+ info(msg) {
359
+ logs.push(String(msg));
360
+ },
361
+ warn(msg) {
362
+ logs.push(String(msg));
363
+ },
364
+ error(msg) {
365
+ logs.push(String(msg));
366
+ },
367
+ debug(msg) {
368
+ logs.push(String(msg));
369
+ },
370
+ },
371
+ true,
372
+ { timestamps: false }
373
+ );
374
+ const scheduler = maintenanceScheduler(memoryDir, { compounding: true, weekly: true });
375
+ try {
376
+ assert.equal(scheduler.armCompoundingWeeklyCron(), true);
377
+ assert.equal(scheduler.armCompoundingWeeklyCron(), true, "arming twice must not start a second runner");
378
+ await scheduler.dispose();
379
+ assert.deepEqual(calls, [weekId]);
380
+ const reportPath = compoundingWeeklyReportPath(memoryDir, weekId);
381
+ const report = await readFile(reportPath, "utf8");
382
+ assert.equal(report.includes(weekId), true);
383
+ const weeklyNames = await readdir(path.dirname(reportPath));
384
+ assert.equal(weeklyNames.includes(`${weekId}.md`), true);
385
+ assert.equal(
386
+ weeklyNames.some((name) => name.endsWith(".tmp")),
387
+ false,
388
+ "the completion marker is renamed into place, not left as a partial temp file"
389
+ );
390
+ assert.equal(
391
+ logs.some((line) => line.includes("weekly synthesis produced")),
392
+ true,
393
+ "synthesizeWeekly must run the calibration pass"
394
+ );
395
+ } finally {
396
+ CompoundingEngine.prototype.synthesizeWeekly = original;
397
+ resetLogger();
398
+ await scheduler.dispose();
399
+ await rm(memoryDir, { recursive: true, force: true });
400
+ }
401
+ });
402
+
403
+ test("weekly synthesis serializes per memory directory across engines", async () => {
404
+ const order: string[] = [];
405
+ let releaseFirst: (() => void) | undefined;
406
+ const firstGate = new Promise<void>((resolve) => {
407
+ releaseFirst = resolve;
408
+ });
409
+ const first = queueWeeklySynthesis("dir-a", async () => {
410
+ order.push("first-start");
411
+ await firstGate;
412
+ order.push("first-end");
413
+ });
414
+ const second = queueWeeklySynthesis("dir-a", async () => {
415
+ order.push("second-start");
416
+ });
417
+ const otherDir = queueWeeklySynthesis("dir-b", async () => {
418
+ order.push("other-dir-start");
419
+ });
420
+
421
+ await new Promise((resolve) => setImmediate(resolve));
422
+ assert.deepEqual(order, ["first-start", "other-dir-start"], "same-dir run waits; other dir does not");
423
+ releaseFirst?.();
424
+ await Promise.all([first, second, otherDir]);
425
+ assert.deepEqual(order, ["first-start", "other-dir-start", "first-end", "second-start"]);
426
+ });