@remnic/core 9.69.39 → 9.69.40

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 (639) hide show
  1. package/dist/access-admin-ops-surface.d.ts +16 -14
  2. package/dist/access-admin-ops-surface.js +37 -37
  3. package/dist/access-authorization-probe.d.ts +16 -14
  4. package/dist/access-authorization-probe.js +38 -38
  5. package/dist/access-boundary.d.ts +16 -14
  6. package/dist/access-boundary.js +37 -37
  7. package/dist/access-cli.js +98 -97
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +16 -14
  11. package/dist/access-extraction-force-flush.js +37 -37
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-briefing.d.ts +16 -14
  14. package/dist/access-http-briefing.js +38 -38
  15. package/dist/access-http-lcm-compaction.d.ts +16 -14
  16. package/dist/access-http-lifecycle-flush.d.ts +16 -14
  17. package/dist/access-http-offline-stream.d.ts +16 -14
  18. package/dist/access-http-query.d.ts +2 -2
  19. package/dist/access-http-query.js +39 -39
  20. package/dist/access-http.d.ts +17 -15
  21. package/dist/access-http.js +53 -53
  22. package/dist/access-identity-continuity-surface.d.ts +13 -12
  23. package/dist/access-identity-continuity-surface.js +37 -37
  24. package/dist/access-lcm-surface.d.ts +16 -14
  25. package/dist/access-lcm-surface.js +37 -37
  26. package/dist/access-mcp.d.ts +16 -14
  27. package/dist/access-mcp.js +45 -45
  28. package/dist/access-memory-search-fanout.d.ts +2 -2
  29. package/dist/{access-namespace-preflight-DY4z6L5X.d.ts → access-namespace-preflight-CKBumJ8W.d.ts} +1 -1
  30. package/dist/access-namespace-preflight.d.ts +3 -3
  31. package/dist/access-namespace-preflight.js +37 -37
  32. package/dist/access-observe-transcript.d.ts +13 -12
  33. package/dist/access-observe-write-category.d.ts +1 -1
  34. package/dist/access-observe-write-category.js +2 -2
  35. package/dist/access-observe-write-surface.d.ts +16 -14
  36. package/dist/access-observe-write-surface.js +37 -37
  37. package/dist/access-offline-manifest.d.ts +37 -13
  38. package/dist/access-offline-manifest.js +7 -3
  39. package/dist/access-operations-batch.js +39 -39
  40. package/dist/access-operations.d.ts +16 -14
  41. package/dist/access-operations.js +44 -44
  42. package/dist/access-recall-concurrency.d.ts +16 -14
  43. package/dist/access-recall-concurrency.js +37 -37
  44. package/dist/access-recall-response.d.ts +16 -14
  45. package/dist/access-recall-response.js +37 -37
  46. package/dist/access-recall-surface.d.ts +16 -14
  47. package/dist/access-recall-surface.js +37 -37
  48. package/dist/access-schema.d.ts +5 -3
  49. package/dist/access-schema.js +1 -1
  50. package/dist/{access-service-MY4bsr_Q.d.ts → access-service-DJ3qogNt.d.ts} +8 -8
  51. package/dist/access-service-helpers.d.ts +16 -14
  52. package/dist/access-service.d.ts +16 -14
  53. package/dist/access-service.js +37 -37
  54. package/dist/access-surface-catalog.d.ts +16 -14
  55. package/dist/access-surface-catalog.js +39 -39
  56. package/dist/access-wearables-meetings-surface.d.ts +6 -5
  57. package/dist/action-confidence.d.ts +1 -1
  58. package/dist/active-memory-bridge.d.ts +1 -1
  59. package/dist/active-recall.d.ts +1 -1
  60. package/dist/active-recall.js +6 -5
  61. package/dist/active-recall.js.map +1 -1
  62. package/dist/activity/digest.d.ts +1 -1
  63. package/dist/ambient-provenance.d.ts +1 -1
  64. package/dist/artifact-search.d.ts +1 -1
  65. package/dist/{auto-sync-RP4C6ZPF.js → auto-sync-D6BAPIJV.js} +5 -5
  66. package/dist/background-generation-config.d.ts +1 -1
  67. package/dist/background-generation-config.js +3 -1
  68. package/dist/background-generation.d.ts +1 -1
  69. package/dist/behavior-learner.d.ts +1 -1
  70. package/dist/behavior-signals.d.ts +1 -1
  71. package/dist/bootstrap.d.ts +13 -12
  72. package/dist/briefing-window.d.ts +2 -2
  73. package/dist/briefing.d.ts +2 -2
  74. package/dist/briefing.js +15 -15
  75. package/dist/buffer-surprise-report.d.ts +1 -1
  76. package/dist/buffer-turn-helpers.d.ts +1 -1
  77. package/dist/buffer.d.ts +2 -2
  78. package/dist/buffer.js +5 -5
  79. package/dist/bulk-import/index.d.ts +3 -3
  80. package/dist/calibration.d.ts +3 -2
  81. package/dist/calibration.js +2 -2
  82. package/dist/capabilities.d.ts +1 -1
  83. package/dist/{catalog-CW87xGx8.d.ts → catalog-BHXkBVhg.d.ts} +1 -1
  84. package/dist/causal-behavior.d.ts +1 -1
  85. package/dist/causal-consolidation.d.ts +1 -1
  86. package/dist/causal-consolidation.js +19 -18
  87. package/dist/causal-consolidation.js.map +1 -1
  88. package/dist/causal-trajectory-graph.d.ts +1 -1
  89. package/dist/{chunk-B36GUU6T.js → chunk-23HFXQ5J.js} +36 -3
  90. package/dist/chunk-23HFXQ5J.js.map +1 -0
  91. package/dist/{chunk-YFTNZMGR.js → chunk-27NO2KVB.js} +31 -8
  92. package/dist/chunk-27NO2KVB.js.map +1 -0
  93. package/dist/{chunk-JTQR6L2N.js → chunk-2SKMZUOW.js} +2 -2
  94. package/dist/{chunk-GG5FHZJJ.js → chunk-2SNCQHJZ.js} +2 -2
  95. package/dist/{chunk-O76F5QPP.js → chunk-3QEVOQF5.js} +2 -2
  96. package/dist/{chunk-3N3PBBEH.js → chunk-3XPN7AVY.js} +2 -2
  97. package/dist/{chunk-X4TD4O2F.js → chunk-46Z3VGWF.js} +2 -2
  98. package/dist/{chunk-2ZTDRNCS.js → chunk-4CMXI55L.js} +2 -2
  99. package/dist/{chunk-FWWWUPOE.js → chunk-5LYSEZOF.js} +18 -9
  100. package/dist/chunk-5LYSEZOF.js.map +1 -0
  101. package/dist/{chunk-IQEJIOEU.js → chunk-62HFZNCJ.js} +17 -10
  102. package/dist/chunk-62HFZNCJ.js.map +1 -0
  103. package/dist/{chunk-YKREX63Z.js → chunk-6L2II3KS.js} +5 -3
  104. package/dist/chunk-6L2II3KS.js.map +1 -0
  105. package/dist/{chunk-MUTVRKKY.js → chunk-7D6SER6A.js} +8 -8
  106. package/dist/{chunk-WBM2MVBK.js → chunk-7Z54NXVS.js} +2 -2
  107. package/dist/{chunk-ACY4ZPF7.js → chunk-AEOOGXMQ.js} +10 -5
  108. package/dist/chunk-AEOOGXMQ.js.map +1 -0
  109. package/dist/{chunk-UHRZ324M.js → chunk-BGRTZOJB.js} +3 -3
  110. package/dist/{chunk-ZEGL7YCC.js → chunk-BXIJSPCL.js} +2 -2
  111. package/dist/{chunk-JKKII6GX.js → chunk-BYQX4IOG.js} +2 -2
  112. package/dist/{chunk-WIWLX65T.js → chunk-C5R73BON.js} +2 -2
  113. package/dist/{chunk-BD7JTBYP.js → chunk-D7MAYFQP.js} +2 -2
  114. package/dist/{chunk-TNZNSMVJ.js → chunk-DAZANIYU.js} +249 -295
  115. package/dist/chunk-DAZANIYU.js.map +1 -0
  116. package/dist/{chunk-LMLGBG6H.js → chunk-DFVSJFHK.js} +2 -2
  117. package/dist/{chunk-3NPNBVFR.js → chunk-ES5BUPYB.js} +2 -2
  118. package/dist/{chunk-MVAQ2WM3.js → chunk-G2XZFGYN.js} +6 -2
  119. package/dist/chunk-G2XZFGYN.js.map +1 -0
  120. package/dist/{chunk-TNSCIPBQ.js → chunk-G6NQ3L4T.js} +2 -2
  121. package/dist/{chunk-5N4MZLEH.js → chunk-GO5LOHCD.js} +2 -2
  122. package/dist/{chunk-AECJY3GJ.js → chunk-GSSDHAYH.js} +2 -2
  123. package/dist/{chunk-TSP5WH72.js → chunk-HJUP3K6L.js} +2 -2
  124. package/dist/{chunk-AAZEKXUP.js → chunk-ICNJ6J46.js} +2 -2
  125. package/dist/{chunk-6EHM2AV7.js → chunk-IMBQFHRV.js} +2 -2
  126. package/dist/{chunk-4RZLTZVM.js → chunk-IOPIGX7Y.js} +1 -1
  127. package/dist/{chunk-EYKIDK33.js → chunk-IS2IDFJP.js} +13 -13
  128. package/dist/{chunk-VJIE4D2I.js → chunk-J4WGTN2N.js} +2 -2
  129. package/dist/{chunk-NXGSONWM.js → chunk-J7FVMLBR.js} +2 -2
  130. package/dist/{chunk-VSL63CFJ.js → chunk-JAJIMTFB.js} +6 -6
  131. package/dist/{chunk-4JVQRFZD.js → chunk-JOP7W24J.js} +9 -9
  132. package/dist/{chunk-YUW66UAH.js → chunk-JUDT33RX.js} +2 -2
  133. package/dist/{chunk-QHT7MOUF.js → chunk-K4A6UVPB.js} +22 -11
  134. package/dist/chunk-K4A6UVPB.js.map +1 -0
  135. package/dist/{chunk-D545Z7UH.js → chunk-K4JKAXMO.js} +2 -2
  136. package/dist/{chunk-BV4ZKIZH.js → chunk-K75A5XWU.js} +3 -2
  137. package/dist/{chunk-3CBI2ZSA.js → chunk-KG2OOAFF.js} +20 -12
  138. package/dist/chunk-KG2OOAFF.js.map +1 -0
  139. package/dist/{chunk-M6HBPLBA.js → chunk-KOTG3RXE.js} +2 -2
  140. package/dist/{chunk-CWTCMZGE.js → chunk-KTOXQMW3.js} +119 -3
  141. package/dist/chunk-KTOXQMW3.js.map +1 -0
  142. package/dist/{chunk-OB3XMWX5.js → chunk-KVO2BTA4.js} +2 -2
  143. package/dist/{chunk-GI4ZBWPQ.js → chunk-KY236SP5.js} +3 -3
  144. package/dist/{chunk-4BCHFSC7.js → chunk-LFVZD5EC.js} +3 -3
  145. package/dist/{chunk-O4M4BDIJ.js → chunk-LKFVVN7R.js} +2 -2
  146. package/dist/{chunk-IYKZJVL5.js → chunk-MDIEES23.js} +1 -1
  147. package/dist/chunk-MDIEES23.js.map +1 -0
  148. package/dist/{chunk-4RX5O34R.js → chunk-MJC7UKH7.js} +2 -2
  149. package/dist/{chunk-CZTPU65V.js → chunk-MVG3KXON.js} +63 -16
  150. package/dist/chunk-MVG3KXON.js.map +1 -0
  151. package/dist/{chunk-YDVAM7S4.js → chunk-NETQXOPY.js} +2 -2
  152. package/dist/chunk-NETQXOPY.js.map +1 -0
  153. package/dist/{chunk-UZZ7SQT3.js → chunk-NVVZPBKI.js} +2 -2
  154. package/dist/{chunk-BLDBT6HZ.js → chunk-PJRKLB4Z.js} +18 -2
  155. package/dist/chunk-PJRKLB4Z.js.map +1 -0
  156. package/dist/{chunk-VBSNUH4J.js → chunk-PKUJNICO.js} +2 -2
  157. package/dist/{chunk-OPBFP4TF.js → chunk-QE6YVNP5.js} +7 -7
  158. package/dist/{chunk-WKDFJXW5.js → chunk-QM2SPLKQ.js} +1 -1
  159. package/dist/chunk-QM2SPLKQ.js.map +1 -0
  160. package/dist/{chunk-ENBPQEVU.js → chunk-QPVNK2VE.js} +2 -2
  161. package/dist/{chunk-RLJHJQUY.js → chunk-QS5Q5RBV.js} +2 -2
  162. package/dist/{chunk-3EKVN2OP.js → chunk-RDLPFM7I.js} +2 -2
  163. package/dist/{chunk-F4EHXVP7.js → chunk-RJQAP333.js} +2 -2
  164. package/dist/{chunk-QTQ6XKGT.js → chunk-RLU2Y5GV.js} +4 -4
  165. package/dist/chunk-RLU2Y5GV.js.map +1 -0
  166. package/dist/{chunk-5SPCMAUC.js → chunk-ROEFLU37.js} +4 -4
  167. package/dist/{chunk-UZEHHXYC.js → chunk-SFHLQPBF.js} +22 -22
  168. package/dist/chunk-SK7D34OL.js +68 -0
  169. package/dist/chunk-SK7D34OL.js.map +1 -0
  170. package/dist/{chunk-ZBW7A667.js → chunk-SUEOG2S4.js} +2 -2
  171. package/dist/{chunk-Q7CLGFA7.js → chunk-TEMKBSV6.js} +2 -2
  172. package/dist/{chunk-LQNRVPTV.js → chunk-THTF2W7M.js} +151 -118
  173. package/dist/chunk-THTF2W7M.js.map +1 -0
  174. package/dist/{chunk-GMIQV6DD.js → chunk-TO36VPZI.js} +2 -2
  175. package/dist/{chunk-6YAIN5XJ.js → chunk-TZ44E732.js} +44 -6
  176. package/dist/chunk-TZ44E732.js.map +1 -0
  177. package/dist/{chunk-JXN77SGO.js → chunk-U2VDCFXW.js} +1 -1
  178. package/dist/chunk-U2VDCFXW.js.map +1 -0
  179. package/dist/{chunk-LPYYY4AP.js → chunk-UZ6JYPJ6.js} +500 -218
  180. package/dist/chunk-UZ6JYPJ6.js.map +1 -0
  181. package/dist/{chunk-FXHOZGSE.js → chunk-V2ZA4YWE.js} +2 -2
  182. package/dist/{chunk-XH3HGI2N.js → chunk-VHKXRYQN.js} +2 -2
  183. package/dist/{chunk-GAS7KYC7.js → chunk-VKWFNPBH.js} +2 -2
  184. package/dist/{chunk-6H2G7RFT.js → chunk-VNQRRUNS.js} +11 -10
  185. package/dist/chunk-VNQRRUNS.js.map +1 -0
  186. package/dist/{chunk-IL6ODG6M.js → chunk-VQWBUPSJ.js} +2 -2
  187. package/dist/{chunk-5YCNDC3C.js → chunk-VQYWKCDR.js} +2 -2
  188. package/dist/{chunk-54NX5EG4.js → chunk-W23JARAQ.js} +2 -2
  189. package/dist/{chunk-YQNNHLCG.js → chunk-WPGR3RW4.js} +2 -2
  190. package/dist/{chunk-FNHLI2RE.js → chunk-WZYHPAG5.js} +3 -3
  191. package/dist/{chunk-5HYUUFMQ.js → chunk-XCPNH2MG.js} +259 -10
  192. package/dist/chunk-XCPNH2MG.js.map +1 -0
  193. package/dist/{chunk-TA4C3XB7.js → chunk-XM46Y66S.js} +2 -2
  194. package/dist/{chunk-PCOVEDPK.js → chunk-YRIFXXMI.js} +3 -3
  195. package/dist/{chunk-TRLOFIQC.js → chunk-YTK5MVNF.js} +2 -2
  196. package/dist/{chunk-Q432REND.js → chunk-YTZN2UZO.js} +2 -2
  197. package/dist/{chunk-6AGWBKQU.js → chunk-Z4GUX2M6.js} +2 -2
  198. package/dist/{chunk-AENM6GKU.js → chunk-ZAEPD4C2.js} +2 -2
  199. package/dist/{chunk-KQW3YGEN.js → chunk-ZRMMXWYI.js} +2 -2
  200. package/dist/{chunk-P4ZAEYKG.js → chunk-ZX3AYNNV.js} +6 -3
  201. package/dist/chunk-ZX3AYNNV.js.map +1 -0
  202. package/dist/{chunk-MCRVQ5YQ.js → chunk-ZZCR2QYL.js} +2 -2
  203. package/dist/{cli-DGq0MNpO.d.ts → cli-BWri5-am.d.ts} +5 -5
  204. package/dist/cli.d.ts +18 -16
  205. package/dist/cli.js +75 -74
  206. package/dist/coding/export-okf-codegraph.d.ts +1 -1
  207. package/dist/coding/export-okf-codegraph.js +14 -14
  208. package/dist/coding/pre-action-gate.d.ts +1 -1
  209. package/dist/compounding/engine.d.ts +2 -2
  210. package/dist/compounding/engine.js +15 -15
  211. package/dist/compounding/preference-consolidator.d.ts +1 -1
  212. package/dist/compression-optimizer.d.ts +1 -1
  213. package/dist/config.d.ts +1 -1
  214. package/dist/config.js +6 -5
  215. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  216. package/dist/connectors/codex-materialize-runner.js +15 -15
  217. package/dist/connectors/codex-materialize.d.ts +1 -1
  218. package/dist/connectors/index.d.ts +1 -1
  219. package/dist/connectors/index.js +15 -15
  220. package/dist/consolidation-provenance-check.d.ts +2 -2
  221. package/dist/consolidation-undo.d.ts +2 -2
  222. package/dist/contradiction/index.d.ts +6 -5
  223. package/dist/converge-config.d.ts +1 -1
  224. package/dist/convergence-refresh.d.ts +2 -2
  225. package/dist/convergence-refresh.js +17 -17
  226. package/dist/conversation-index/backend.d.ts +1 -1
  227. package/dist/conversation-index/chunker.d.ts +1 -1
  228. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  229. package/dist/conversation-index/indexer.d.ts +1 -1
  230. package/dist/conversation-index/search.d.ts +1 -1
  231. package/dist/corpus-watermark.d.ts +1 -1
  232. package/dist/corpus-watermark.js +17 -17
  233. package/dist/cross-lingual-recall.d.ts +1 -1
  234. package/dist/day-summary.d.ts +1 -1
  235. package/dist/deep-recall-http-glue.d.ts +16 -14
  236. package/dist/deep-recall-http-glue.js +2 -2
  237. package/dist/deep-recall-mcp-tools.d.ts +16 -14
  238. package/dist/deep-recall-policy-llm.d.ts +4 -3
  239. package/dist/deep-recall-policy-llm.js +3 -3
  240. package/dist/deep-recall-seeds.d.ts +1 -1
  241. package/dist/delinearize.d.ts +1 -1
  242. package/dist/dependency-propagation-config.d.ts +1 -1
  243. package/dist/{dependency-propagation-delivery-Cq1ekOwV.d.ts → dependency-propagation-delivery-ueZlKTQB.d.ts} +1 -1
  244. package/dist/direct-answer-wiring.d.ts +1 -1
  245. package/dist/direct-answer.d.ts +1 -1
  246. package/dist/embedding-fallback.d.ts +1 -1
  247. package/dist/enrichment/index.d.ts +1 -1
  248. package/dist/entity-origin-fields.d.ts +1 -1
  249. package/dist/entity-retrieval.d.ts +2 -2
  250. package/dist/entity-retrieval.js +15 -15
  251. package/dist/entity-schema.d.ts +1 -1
  252. package/dist/episodic-context.d.ts +1 -1
  253. package/dist/eval-trajectory-contracts.d.ts +1 -1
  254. package/dist/eval-trajectory-store.d.ts +1 -1
  255. package/dist/eval-trajectory.d.ts +1 -1
  256. package/dist/explicit-capture.d.ts +13 -12
  257. package/dist/external-wiki-access.d.ts +16 -14
  258. package/dist/external-wiki-access.js +38 -38
  259. package/dist/external-wiki-collection-registration.d.ts +1 -1
  260. package/dist/external-wiki-collection.d.ts +1 -1
  261. package/dist/external-wiki-mcp-tools.d.ts +16 -14
  262. package/dist/extraction-error-classification.d.ts +14 -3
  263. package/dist/extraction-error-classification.js +5 -3
  264. package/dist/extraction-faithfulness.d.ts +4 -3
  265. package/dist/extraction-faithfulness.js +3 -3
  266. package/dist/extraction-judge-telemetry.d.ts +4 -3
  267. package/dist/extraction-judge-training.d.ts +4 -3
  268. package/dist/extraction-judge.d.ts +4 -3
  269. package/dist/extraction-judge.js +3 -3
  270. package/dist/extraction-liveness.d.ts +1 -1
  271. package/dist/extraction-normalization.d.ts +1 -1
  272. package/dist/extraction-prompt.d.ts +1 -1
  273. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  274. package/dist/extraction-source-grounding.d.ts +1 -1
  275. package/dist/extraction-span-config.d.ts +1 -1
  276. package/dist/extraction-span-materialize.d.ts +1 -1
  277. package/dist/extraction.d.ts +4 -4
  278. package/dist/extraction.js +25 -23
  279. package/dist/fallback-llm-codex-subscription.d.ts +52 -7
  280. package/dist/fallback-llm-codex-subscription.js +17 -1
  281. package/dist/fallback-llm.d.ts +25 -28
  282. package/dist/fallback-llm.js +4 -3
  283. package/dist/{generic-recall-paths-BcySh_f9.d.ts → generic-recall-paths-CpyVmA88.d.ts} +1 -1
  284. package/dist/graph-append-error.d.ts +1 -1
  285. package/dist/graph-dashboard-diff.d.ts +1 -1
  286. package/dist/graph-dashboard-key.d.ts +1 -1
  287. package/dist/graph-dashboard-parser.d.ts +1 -1
  288. package/dist/graph-edge-reinforcement.d.ts +1 -1
  289. package/dist/graph-jsonl.d.ts +1 -1
  290. package/dist/graph-path-reconstruction.d.ts +1 -1
  291. package/dist/graph-path-scoring.d.ts +1 -1
  292. package/dist/graph-snapshot.d.ts +1 -1
  293. package/dist/graph.d.ts +1 -1
  294. package/dist/harmonic-retrieval.js +1 -1
  295. package/dist/importance.d.ts +1 -1
  296. package/dist/importers/index.d.ts +1 -1
  297. package/dist/importers/test-utils.d.ts +1 -1
  298. package/dist/in-flight-reads.d.ts +1 -1
  299. package/dist/{index-DWOb4wz9.d.ts → index-BvUA4S7M.d.ts} +3 -3
  300. package/dist/index.d.ts +79 -39
  301. package/dist/index.js +119 -103
  302. package/dist/intent.d.ts +1 -1
  303. package/dist/lcm/engine.d.ts +1 -1
  304. package/dist/lcm/index.d.ts +1 -1
  305. package/dist/lcm/index.js +3 -3
  306. package/dist/lcm/tools.d.ts +1 -1
  307. package/dist/lifecycle.d.ts +1 -1
  308. package/dist/live-connectors-runner.d.ts +1 -1
  309. package/dist/local-llm-BsJGulur.d.ts +247 -0
  310. package/dist/local-llm-config.d.ts +4 -1
  311. package/dist/local-llm-config.js +4 -2
  312. package/dist/local-llm-helpers.d.ts +18 -69
  313. package/dist/local-llm-helpers.js +1 -1
  314. package/dist/local-llm.d.ts +3 -170
  315. package/dist/local-llm.js +2 -2
  316. package/dist/local-model-endpoint.d.ts +1 -1
  317. package/dist/location/index.d.ts +3 -3
  318. package/dist/location/index.js +17 -17
  319. package/dist/maintenance/memory-governance.d.ts +1 -1
  320. package/dist/maintenance/memory-governance.js +15 -15
  321. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  322. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +15 -15
  323. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  324. package/dist/maintenance/rebuild-memory-projection.js +16 -16
  325. package/dist/{maintenance-CW9wCzMP.d.ts → maintenance-CYubtIRr.d.ts} +9 -3
  326. package/dist/mcp-memory-inspector-app.d.ts +16 -14
  327. package/dist/memory-action-policy.d.ts +1 -1
  328. package/dist/memory-cache.d.ts +1 -1
  329. package/dist/memory-controller.d.ts +1 -1
  330. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  331. package/dist/memory-projection-store.d.ts +1 -1
  332. package/dist/memory-provenance.d.ts +1 -1
  333. package/dist/memory-snapshot.d.ts +1 -1
  334. package/dist/memory-subject-cli.d.ts +16 -14
  335. package/dist/memory-subject.d.ts +16 -14
  336. package/dist/memory-worth-outcomes.d.ts +2 -2
  337. package/dist/models-json.d.ts +1 -1
  338. package/dist/namespaces/migrate.d.ts +3 -3
  339. package/dist/namespaces/migrate.js +16 -16
  340. package/dist/namespaces/principal.d.ts +1 -1
  341. package/dist/namespaces/search.d.ts +12 -1
  342. package/dist/namespaces/search.js +9 -9
  343. package/dist/namespaces/storage.d.ts +3 -3
  344. package/dist/namespaces/storage.js +15 -15
  345. package/dist/native-knowledge.d.ts +1 -1
  346. package/dist/offline-sync-impression-drain.d.ts +1 -1
  347. package/dist/operator-doctor-corpus.d.ts +1 -1
  348. package/dist/operator-doctor-corpus.js +18 -18
  349. package/dist/operator-doctor-replica.d.ts +1 -1
  350. package/dist/operator-toolkit.d.ts +3 -3
  351. package/dist/operator-toolkit.js +29 -28
  352. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  353. package/dist/orchestration/maintenance.d.ts +4 -4
  354. package/dist/orchestration/maintenance.js +26 -26
  355. package/dist/{orchestrator-ComHLm49.d.ts → orchestrator-BWDRJ_0d.d.ts} +24 -11
  356. package/dist/orchestrator.d.ts +13 -12
  357. package/dist/orchestrator.js +101 -98
  358. package/dist/patterns-cli.d.ts +1 -1
  359. package/dist/{pipeline-CiYcqqhl.d.ts → pipeline-7JMn2yMH.d.ts} +1 -1
  360. package/dist/policy-runtime.d.ts +1 -1
  361. package/dist/proactive-contention.d.ts +2 -2
  362. package/dist/provenance.d.ts +1 -1
  363. package/dist/{public-http-CuK4_Cb1.d.ts → public-http-CJWs3mo9.d.ts} +1 -1
  364. package/dist/{qmd-qXD4vatU.d.ts → qmd-CxCH9G9m.d.ts} +2 -2
  365. package/dist/qmd-preflight.d.ts +2 -2
  366. package/dist/qmd-recall-cache.d.ts +1 -1
  367. package/dist/qmd.d.ts +2 -2
  368. package/dist/qmd.js +2 -2
  369. package/dist/recall-concurrency-config.d.ts +1 -1
  370. package/dist/recall-disclosure-escalation.d.ts +1 -1
  371. package/dist/recall-explain-renderer.d.ts +1 -1
  372. package/dist/recall-explain-renderer.js +3 -3
  373. package/dist/recall-memory-map.d.ts +1 -1
  374. package/dist/recall-navigate-access.d.ts +1 -1
  375. package/dist/recall-navigate-access.js +2 -2
  376. package/dist/recall-navigate-disclosure.d.ts +1 -1
  377. package/dist/recall-navigate-disclosure.js +1 -1
  378. package/dist/recall-navigate.d.ts +1 -1
  379. package/dist/recall-navigate.js +2 -2
  380. package/dist/recall-planner-llm.d.ts +3 -2
  381. package/dist/recall-planner-llm.js +4 -3
  382. package/dist/recall-planner-llm.js.map +1 -1
  383. package/dist/recall-state-view-admission.d.ts +13 -3
  384. package/dist/recall-state-view-admission.js +8 -8
  385. package/dist/recall-state-view-anchors.d.ts +1 -1
  386. package/dist/recall-state-view-anchors.js +2 -2
  387. package/dist/recall-state-view-inject.js +2 -2
  388. package/dist/recall-state-view-render.js +2 -2
  389. package/dist/recall-state-view-widen.js +2 -2
  390. package/dist/recall-state-view-wire.js +3 -3
  391. package/dist/recall-state-view.d.ts +1 -0
  392. package/dist/recall-state-view.js +1 -1
  393. package/dist/recall-state.d.ts +1 -1
  394. package/dist/recall-tag-filter.d.ts +1 -1
  395. package/dist/recall-timings.d.ts +1 -1
  396. package/dist/recall-xray-cli.d.ts +1 -1
  397. package/dist/recall-xray-cli.js +4 -4
  398. package/dist/recall-xray-renderer.d.ts +1 -1
  399. package/dist/recall-xray-renderer.js +3 -3
  400. package/dist/recall-xray.d.ts +1 -1
  401. package/dist/recall-xray.js +2 -2
  402. package/dist/reconcile/cursor.d.ts +1 -1
  403. package/dist/reconcile/manifest.d.ts +1 -1
  404. package/dist/reconcile/plan.d.ts +1 -1
  405. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  406. package/dist/replay/normalizers/claude.d.ts +1 -1
  407. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  408. package/dist/replay/normalizers/shared.d.ts +1 -1
  409. package/dist/replay/runner.d.ts +1 -1
  410. package/dist/replay/types.d.ts +1 -1
  411. package/dist/replica-divergence.d.ts +1 -1
  412. package/dist/replica-peers-config.d.ts +1 -1
  413. package/dist/resolve-auth-token.d.ts +1 -1
  414. package/dist/resume-bundles.js +7 -6
  415. package/dist/retrieval-agents.d.ts +2 -2
  416. package/dist/retrieval-tiers.d.ts +1 -1
  417. package/dist/routing/engine.d.ts +1 -1
  418. package/dist/routing/store.d.ts +1 -1
  419. package/dist/salvage-envelope.d.ts +1 -1
  420. package/dist/{scope-profiles-BT9rqC3w.d.ts → scope-profiles-BGAUqhBR.d.ts} +1 -1
  421. package/dist/search/embed-helper.d.ts +1 -1
  422. package/dist/search/factory.d.ts +1 -1
  423. package/dist/search/factory.js +8 -8
  424. package/dist/search/index.d.ts +1 -1
  425. package/dist/search/index.js +10 -10
  426. package/dist/search/lancedb-backend.d.ts +1 -1
  427. package/dist/search/lancedb-backend.js +2 -2
  428. package/dist/search/meilisearch-backend.d.ts +1 -1
  429. package/dist/search/meilisearch-backend.js +2 -2
  430. package/dist/search/noop-backend.d.ts +1 -1
  431. package/dist/search/orama-backend.d.ts +1 -1
  432. package/dist/search/orama-backend.js +2 -2
  433. package/dist/search/port.d.ts +2 -2
  434. package/dist/search/port.js +1 -1
  435. package/dist/search/remote-backend.d.ts +1 -1
  436. package/dist/search/remote-backend.js +2 -2
  437. package/dist/{semantic-consolidation-CmZi7thY.d.ts → semantic-consolidation-CCeRD9pV.d.ts} +1 -1
  438. package/dist/semantic-consolidation.d.ts +2 -2
  439. package/dist/semantic-consolidation.js +16 -16
  440. package/dist/semantic-rule-promotion.js +15 -15
  441. package/dist/semantic-rule-verifier.d.ts +1 -1
  442. package/dist/semantic-rule-verifier.js +15 -15
  443. package/dist/{service-CLkA7AQB.d.ts → service-BwpzRduk.d.ts} +2 -2
  444. package/dist/session-observer-bands.d.ts +1 -1
  445. package/dist/session-observer-state.d.ts +1 -1
  446. package/dist/shared-context/manager.d.ts +1 -1
  447. package/dist/signal.d.ts +1 -1
  448. package/dist/source-agent-qualifier.d.ts +1 -1
  449. package/dist/source-agent-qualifier.js +18 -18
  450. package/dist/standup/build.js +15 -15
  451. package/dist/{storage-wvX01lht.d.ts → storage-BprAGBG0.d.ts} +2 -1
  452. package/dist/storage.d.ts +2 -2
  453. package/dist/storage.js +14 -14
  454. package/dist/subject-config.d.ts +1 -1
  455. package/dist/summarizer.d.ts +1 -1
  456. package/dist/summarizer.js +5 -5
  457. package/dist/summary-snapshot.d.ts +1 -1
  458. package/dist/support-passport/index.d.ts +18 -17
  459. package/dist/support-passport/index.js +40 -40
  460. package/dist/task-llm-config.d.ts +16 -0
  461. package/dist/task-llm-config.js +12 -0
  462. package/dist/task-llm-config.js.map +1 -0
  463. package/dist/temporal-supersession.d.ts +2 -2
  464. package/dist/temporal-timeline-recall.d.ts +1 -1
  465. package/dist/temporal-validity.d.ts +1 -1
  466. package/dist/threading.d.ts +1 -1
  467. package/dist/tier-migration.d.ts +2 -2
  468. package/dist/tier-routing.d.ts +1 -1
  469. package/dist/topics.d.ts +1 -1
  470. package/dist/transcript.d.ts +1 -1
  471. package/dist/transfer/export-okf.d.ts +1 -1
  472. package/dist/transfer/export-okf.js +15 -15
  473. package/dist/trust-score-stage.d.ts +1 -1
  474. package/dist/trust-score.d.ts +1 -1
  475. package/dist/{types-Cyr32ABj.d.ts → types-nJV23pa3.d.ts} +1 -1
  476. package/dist/types.d.ts +1 -1
  477. package/dist/types.js +1 -1
  478. package/dist/utility-runtime.d.ts +1 -1
  479. package/dist/verified-recall.js +15 -15
  480. package/dist/who-knows-cli.d.ts +16 -14
  481. package/dist/who-knows-cli.js +16 -16
  482. package/dist/who-knows.d.ts +16 -14
  483. package/dist/who-knows.js +15 -15
  484. package/dist/write-envelope.d.ts +1 -1
  485. package/package.json +2 -2
  486. package/src/access-category-alias.test.ts +93 -0
  487. package/src/access-offline-manifest.ts +52 -2
  488. package/src/access-schema.ts +9 -4
  489. package/src/activity/config.test.ts +61 -0
  490. package/src/activity/config.ts +40 -1
  491. package/src/activity/timeline/analysis-provider.ts +8 -2
  492. package/src/activity/timeline/analysis-run.test.ts +82 -0
  493. package/src/activity/timeline/publish-cli.test.ts +30 -0
  494. package/src/activity/timeline/publish-cli.ts +7 -0
  495. package/src/activity/timeline/query.ts +8 -1
  496. package/src/activity/timeline/regenerate.test.ts +82 -2
  497. package/src/activity/timeline/regenerate.ts +7 -1
  498. package/src/activity/vault-frontmatter.test.ts +99 -1
  499. package/src/activity/vault-frontmatter.ts +131 -0
  500. package/src/activity/vault-publish.ts +6 -0
  501. package/src/activity/vault-publisher.test.ts +172 -0
  502. package/src/activity/vault-publisher.ts +69 -15
  503. package/src/activity/vault-region.test.ts +7 -2
  504. package/src/activity/vault-region.ts +7 -3
  505. package/src/background-generation-config.ts +32 -6
  506. package/src/background-generation.test.ts +10 -1
  507. package/src/cli/timeline-publish-commands.ts +9 -0
  508. package/src/config.test.ts +170 -43
  509. package/src/config.ts +17 -5
  510. package/src/extraction-error-classification.ts +36 -1
  511. package/src/extraction-timeout.test.ts +110 -1
  512. package/src/extraction.test.ts +19 -1
  513. package/src/extraction.ts +23 -21
  514. package/src/fallback-llm-codex-subscription.ts +193 -7
  515. package/src/fallback-llm-parse-failure.test.ts +156 -0
  516. package/src/fallback-llm.test.ts +58 -0
  517. package/src/fallback-llm.ts +187 -186
  518. package/src/index.ts +1 -0
  519. package/src/local-llm-config.ts +11 -10
  520. package/src/local-llm-headers-timeout.test.ts +30 -0
  521. package/src/local-llm-helpers.ts +28 -0
  522. package/src/local-llm.ts +8 -19
  523. package/src/namespaces/search.test.ts +51 -1
  524. package/src/namespaces/search.ts +48 -3
  525. package/src/orchestration/extraction-persist-promotion.test.ts +228 -2
  526. package/src/orchestration/extraction-persist-promotion.ts +17 -14
  527. package/src/orchestration/orchestrator-helpers.test.ts +104 -0
  528. package/src/orchestration/orchestrator-init.ts +366 -106
  529. package/src/orchestration/recall-internal.ts +5 -11
  530. package/src/orchestration/semantic-merge-promotion-payload.ts +62 -6
  531. package/src/orchestration/startup-collection-checks.ts +85 -0
  532. package/src/orchestrator-flush.test.ts +7 -0
  533. package/src/orchestrator-init.test.ts +1539 -0
  534. package/src/orchestrator.ts +7 -0
  535. package/src/qmd.ts +21 -10
  536. package/src/recall-state-view-admission.ts +11 -1
  537. package/src/recall-state-view-cron-intent.test.ts +268 -0
  538. package/src/recall-state-view-widen.test.ts +14 -5
  539. package/src/recall-state-view-widen.ts +8 -1
  540. package/src/recall-state-view.ts +5 -2
  541. package/src/reconcile-identity-cache.test.ts +82 -1
  542. package/src/search/port.ts +1 -1
  543. package/src/storage/cas-revision-store.test.ts +4 -0
  544. package/src/storage/cas-revision-store.ts +104 -12
  545. package/src/storage-frontmatter-cas.test.ts +19 -17
  546. package/src/summarizer.ts +5 -1
  547. package/src/task-llm-config.test.ts +124 -0
  548. package/src/task-llm-config.ts +88 -0
  549. package/src/testing/subjects/startup-discovery-lifecycle.test.ts +273 -0
  550. package/src/types.ts +1 -0
  551. package/dist/chunk-3CBI2ZSA.js.map +0 -1
  552. package/dist/chunk-5HYUUFMQ.js.map +0 -1
  553. package/dist/chunk-6H2G7RFT.js.map +0 -1
  554. package/dist/chunk-6YAIN5XJ.js.map +0 -1
  555. package/dist/chunk-ACY4ZPF7.js.map +0 -1
  556. package/dist/chunk-B36GUU6T.js.map +0 -1
  557. package/dist/chunk-BLDBT6HZ.js.map +0 -1
  558. package/dist/chunk-CWTCMZGE.js.map +0 -1
  559. package/dist/chunk-CZTPU65V.js.map +0 -1
  560. package/dist/chunk-FWWWUPOE.js.map +0 -1
  561. package/dist/chunk-IQEJIOEU.js.map +0 -1
  562. package/dist/chunk-IYKZJVL5.js.map +0 -1
  563. package/dist/chunk-JXN77SGO.js.map +0 -1
  564. package/dist/chunk-LPYYY4AP.js.map +0 -1
  565. package/dist/chunk-LQNRVPTV.js.map +0 -1
  566. package/dist/chunk-MVAQ2WM3.js.map +0 -1
  567. package/dist/chunk-P4ZAEYKG.js.map +0 -1
  568. package/dist/chunk-QHT7MOUF.js.map +0 -1
  569. package/dist/chunk-QTQ6XKGT.js.map +0 -1
  570. package/dist/chunk-TNZNSMVJ.js.map +0 -1
  571. package/dist/chunk-WKDFJXW5.js.map +0 -1
  572. package/dist/chunk-YDVAM7S4.js.map +0 -1
  573. package/dist/chunk-YFTNZMGR.js.map +0 -1
  574. package/dist/chunk-YKREX63Z.js.map +0 -1
  575. /package/dist/{auto-sync-RP4C6ZPF.js.map → auto-sync-D6BAPIJV.js.map} +0 -0
  576. /package/dist/{chunk-JTQR6L2N.js.map → chunk-2SKMZUOW.js.map} +0 -0
  577. /package/dist/{chunk-GG5FHZJJ.js.map → chunk-2SNCQHJZ.js.map} +0 -0
  578. /package/dist/{chunk-O76F5QPP.js.map → chunk-3QEVOQF5.js.map} +0 -0
  579. /package/dist/{chunk-3N3PBBEH.js.map → chunk-3XPN7AVY.js.map} +0 -0
  580. /package/dist/{chunk-X4TD4O2F.js.map → chunk-46Z3VGWF.js.map} +0 -0
  581. /package/dist/{chunk-2ZTDRNCS.js.map → chunk-4CMXI55L.js.map} +0 -0
  582. /package/dist/{chunk-MUTVRKKY.js.map → chunk-7D6SER6A.js.map} +0 -0
  583. /package/dist/{chunk-WBM2MVBK.js.map → chunk-7Z54NXVS.js.map} +0 -0
  584. /package/dist/{chunk-UHRZ324M.js.map → chunk-BGRTZOJB.js.map} +0 -0
  585. /package/dist/{chunk-ZEGL7YCC.js.map → chunk-BXIJSPCL.js.map} +0 -0
  586. /package/dist/{chunk-JKKII6GX.js.map → chunk-BYQX4IOG.js.map} +0 -0
  587. /package/dist/{chunk-WIWLX65T.js.map → chunk-C5R73BON.js.map} +0 -0
  588. /package/dist/{chunk-BD7JTBYP.js.map → chunk-D7MAYFQP.js.map} +0 -0
  589. /package/dist/{chunk-LMLGBG6H.js.map → chunk-DFVSJFHK.js.map} +0 -0
  590. /package/dist/{chunk-3NPNBVFR.js.map → chunk-ES5BUPYB.js.map} +0 -0
  591. /package/dist/{chunk-TNSCIPBQ.js.map → chunk-G6NQ3L4T.js.map} +0 -0
  592. /package/dist/{chunk-5N4MZLEH.js.map → chunk-GO5LOHCD.js.map} +0 -0
  593. /package/dist/{chunk-AECJY3GJ.js.map → chunk-GSSDHAYH.js.map} +0 -0
  594. /package/dist/{chunk-TSP5WH72.js.map → chunk-HJUP3K6L.js.map} +0 -0
  595. /package/dist/{chunk-AAZEKXUP.js.map → chunk-ICNJ6J46.js.map} +0 -0
  596. /package/dist/{chunk-6EHM2AV7.js.map → chunk-IMBQFHRV.js.map} +0 -0
  597. /package/dist/{chunk-4RZLTZVM.js.map → chunk-IOPIGX7Y.js.map} +0 -0
  598. /package/dist/{chunk-EYKIDK33.js.map → chunk-IS2IDFJP.js.map} +0 -0
  599. /package/dist/{chunk-VJIE4D2I.js.map → chunk-J4WGTN2N.js.map} +0 -0
  600. /package/dist/{chunk-NXGSONWM.js.map → chunk-J7FVMLBR.js.map} +0 -0
  601. /package/dist/{chunk-VSL63CFJ.js.map → chunk-JAJIMTFB.js.map} +0 -0
  602. /package/dist/{chunk-4JVQRFZD.js.map → chunk-JOP7W24J.js.map} +0 -0
  603. /package/dist/{chunk-YUW66UAH.js.map → chunk-JUDT33RX.js.map} +0 -0
  604. /package/dist/{chunk-D545Z7UH.js.map → chunk-K4JKAXMO.js.map} +0 -0
  605. /package/dist/{chunk-BV4ZKIZH.js.map → chunk-K75A5XWU.js.map} +0 -0
  606. /package/dist/{chunk-M6HBPLBA.js.map → chunk-KOTG3RXE.js.map} +0 -0
  607. /package/dist/{chunk-OB3XMWX5.js.map → chunk-KVO2BTA4.js.map} +0 -0
  608. /package/dist/{chunk-GI4ZBWPQ.js.map → chunk-KY236SP5.js.map} +0 -0
  609. /package/dist/{chunk-4BCHFSC7.js.map → chunk-LFVZD5EC.js.map} +0 -0
  610. /package/dist/{chunk-O4M4BDIJ.js.map → chunk-LKFVVN7R.js.map} +0 -0
  611. /package/dist/{chunk-4RX5O34R.js.map → chunk-MJC7UKH7.js.map} +0 -0
  612. /package/dist/{chunk-UZZ7SQT3.js.map → chunk-NVVZPBKI.js.map} +0 -0
  613. /package/dist/{chunk-VBSNUH4J.js.map → chunk-PKUJNICO.js.map} +0 -0
  614. /package/dist/{chunk-OPBFP4TF.js.map → chunk-QE6YVNP5.js.map} +0 -0
  615. /package/dist/{chunk-ENBPQEVU.js.map → chunk-QPVNK2VE.js.map} +0 -0
  616. /package/dist/{chunk-RLJHJQUY.js.map → chunk-QS5Q5RBV.js.map} +0 -0
  617. /package/dist/{chunk-3EKVN2OP.js.map → chunk-RDLPFM7I.js.map} +0 -0
  618. /package/dist/{chunk-F4EHXVP7.js.map → chunk-RJQAP333.js.map} +0 -0
  619. /package/dist/{chunk-5SPCMAUC.js.map → chunk-ROEFLU37.js.map} +0 -0
  620. /package/dist/{chunk-UZEHHXYC.js.map → chunk-SFHLQPBF.js.map} +0 -0
  621. /package/dist/{chunk-ZBW7A667.js.map → chunk-SUEOG2S4.js.map} +0 -0
  622. /package/dist/{chunk-Q7CLGFA7.js.map → chunk-TEMKBSV6.js.map} +0 -0
  623. /package/dist/{chunk-GMIQV6DD.js.map → chunk-TO36VPZI.js.map} +0 -0
  624. /package/dist/{chunk-FXHOZGSE.js.map → chunk-V2ZA4YWE.js.map} +0 -0
  625. /package/dist/{chunk-XH3HGI2N.js.map → chunk-VHKXRYQN.js.map} +0 -0
  626. /package/dist/{chunk-GAS7KYC7.js.map → chunk-VKWFNPBH.js.map} +0 -0
  627. /package/dist/{chunk-IL6ODG6M.js.map → chunk-VQWBUPSJ.js.map} +0 -0
  628. /package/dist/{chunk-5YCNDC3C.js.map → chunk-VQYWKCDR.js.map} +0 -0
  629. /package/dist/{chunk-54NX5EG4.js.map → chunk-W23JARAQ.js.map} +0 -0
  630. /package/dist/{chunk-YQNNHLCG.js.map → chunk-WPGR3RW4.js.map} +0 -0
  631. /package/dist/{chunk-FNHLI2RE.js.map → chunk-WZYHPAG5.js.map} +0 -0
  632. /package/dist/{chunk-TA4C3XB7.js.map → chunk-XM46Y66S.js.map} +0 -0
  633. /package/dist/{chunk-PCOVEDPK.js.map → chunk-YRIFXXMI.js.map} +0 -0
  634. /package/dist/{chunk-TRLOFIQC.js.map → chunk-YTK5MVNF.js.map} +0 -0
  635. /package/dist/{chunk-Q432REND.js.map → chunk-YTZN2UZO.js.map} +0 -0
  636. /package/dist/{chunk-6AGWBKQU.js.map → chunk-Z4GUX2M6.js.map} +0 -0
  637. /package/dist/{chunk-AENM6GKU.js.map → chunk-ZAEPD4C2.js.map} +0 -0
  638. /package/dist/{chunk-KQW3YGEN.js.map → chunk-ZRMMXWYI.js.map} +0 -0
  639. /package/dist/{chunk-MCRVQ5YQ.js.map → chunk-ZZCR2QYL.js.map} +0 -0
@@ -6,14 +6,14 @@ import {
6
6
  loadSyncState,
7
7
  syncWearableSource,
8
8
  wearableSourceLabel
9
- } from "./chunk-GAS7KYC7.js";
9
+ } from "./chunk-VKWFNPBH.js";
10
10
  import {
11
11
  CompressionGuidelineCoordinator
12
12
  } from "./chunk-UXREWVW4.js";
13
13
  import {
14
14
  ActivityStore,
15
15
  MaintenanceScheduler
16
- } from "./chunk-IQEJIOEU.js";
16
+ } from "./chunk-62HFZNCJ.js";
17
17
  import {
18
18
  runPeerProfileReasoner
19
19
  } from "./chunk-I74SUMNI.js";
@@ -23,19 +23,19 @@ import {
23
23
  import {
24
24
  LcmEngine
25
25
  } from "./chunk-A7GQBJP5.js";
26
+ import {
27
+ chunkTranscriptEntries
28
+ } from "./chunk-TECVW3JP.js";
26
29
  import {
27
30
  cleanupConversationChunks
28
31
  } from "./chunk-C5JF6EZ7.js";
29
32
  import {
30
33
  CompoundingEngine,
31
34
  defaultTierMigrationCycleBudget
32
- } from "./chunk-X4TD4O2F.js";
35
+ } from "./chunk-46Z3VGWF.js";
33
36
  import {
34
37
  SharedContextManager
35
38
  } from "./chunk-CARRTDKC.js";
36
- import {
37
- chunkTranscriptEntries
38
- } from "./chunk-TECVW3JP.js";
39
39
  import {
40
40
  cleanArchivedUserMessage
41
41
  } from "./chunk-47DU4SGJ.js";
@@ -109,17 +109,17 @@ import {
109
109
  rerankLocalOrNoop
110
110
  } from "./chunk-LUDXM7MD.js";
111
111
  import {
112
- indexStateViewAnnotatedResults
113
- } from "./chunk-QTQ6XKGT.js";
112
+ indexStateViewAnnotatedResults,
113
+ resolveRecallStateViewActive
114
+ } from "./chunk-RLU2Y5GV.js";
114
115
  import {
115
116
  applyRecallStateViews
116
- } from "./chunk-LMLGBG6H.js";
117
+ } from "./chunk-DFVSJFHK.js";
117
118
  import {
118
119
  StateViewAnchorTracker,
119
120
  filterRecentScanMemories,
120
- resolveRecallStateViewFlags,
121
121
  stateViewPacketActive
122
- } from "./chunk-6AGWBKQU.js";
122
+ } from "./chunk-Z4GUX2M6.js";
123
123
  import {
124
124
  dedupeResultsByNamespace,
125
125
  hasMemoryForResult,
@@ -166,7 +166,7 @@ import {
166
166
  } from "./chunk-OH7QLI6W.js";
167
167
  import {
168
168
  ExtractionEngine
169
- } from "./chunk-QHT7MOUF.js";
169
+ } from "./chunk-K4A6UVPB.js";
170
170
  import {
171
171
  parseMemoryActionEligibilityContext
172
172
  } from "./chunk-JHU4EYDV.js";
@@ -179,7 +179,7 @@ import {
179
179
  getVerdictKind,
180
180
  judgeFactDurability,
181
181
  validateProcedureExtraction
182
- } from "./chunk-YUW66UAH.js";
182
+ } from "./chunk-JUDT33RX.js";
183
183
  import {
184
184
  buildEventOrderRecallSection
185
185
  } from "./chunk-645WOU5I.js";
@@ -197,7 +197,7 @@ import {
197
197
  buildEntityRecallSection,
198
198
  entityRecentTranscriptLookbackHours,
199
199
  readRecentEntityTranscriptEntries
200
- } from "./chunk-RLJHJQUY.js";
200
+ } from "./chunk-QS5Q5RBV.js";
201
201
  import {
202
202
  planEpisodeWindowsWithFallback
203
203
  } from "./chunk-T3GIETKV.js";
@@ -212,7 +212,7 @@ import {
212
212
  } from "./chunk-LVXBC6YB.js";
213
213
  import {
214
214
  refreshConvergedNamespaces
215
- } from "./chunk-2ZTDRNCS.js";
215
+ } from "./chunk-4CMXI55L.js";
216
216
  import {
217
217
  builtInConnectorPackageSpecifier,
218
218
  ensureBuiltInWearableConnectors,
@@ -221,7 +221,7 @@ import {
221
221
  runTimelinePublishCli,
222
222
  screenCandidateFact,
223
223
  summarizeVaultPublish
224
- } from "./chunk-TNZNSMVJ.js";
224
+ } from "./chunk-DAZANIYU.js";
225
225
  import {
226
226
  normalizeReplaySessionKey
227
227
  } from "./chunk-AJVLDJU6.js";
@@ -231,14 +231,14 @@ import {
231
231
  import {
232
232
  compareVerifiedEpisodeResults,
233
233
  searchVerifiedEpisodes
234
- } from "./chunk-AAZEKXUP.js";
234
+ } from "./chunk-ICNJ6J46.js";
235
235
  import {
236
236
  ThreadingManager
237
237
  } from "./chunk-OJP3N7UK.js";
238
238
  import {
239
239
  compareVerifiedSemanticRuleResults,
240
240
  searchVerifiedSemanticRules
241
- } from "./chunk-AENM6GKU.js";
241
+ } from "./chunk-ZAEPD4C2.js";
242
242
  import {
243
243
  searchWorkProductLedgerEntries
244
244
  } from "./chunk-G7NYVKD6.js";
@@ -251,10 +251,10 @@ import {
251
251
  import {
252
252
  runNamespaceMaintenanceFanout,
253
253
  summarizeNamespaceMaintenanceHealth
254
- } from "./chunk-MUTVRKKY.js";
254
+ } from "./chunk-7D6SER6A.js";
255
255
  import {
256
256
  planNamespaceMaintenance
257
- } from "./chunk-FNHLI2RE.js";
257
+ } from "./chunk-WZYHPAG5.js";
258
258
  import {
259
259
  isAboveImportanceThreshold,
260
260
  scoreImportance
@@ -276,7 +276,7 @@ import {
276
276
  } from "./chunk-NHLLKEKK.js";
277
277
  import {
278
278
  SmartBuffer
279
- } from "./chunk-4RX5O34R.js";
279
+ } from "./chunk-MJC7UKH7.js";
280
280
  import {
281
281
  buildConsolidationPrompt,
282
282
  buildExtensionsBlockForConsolidation,
@@ -286,7 +286,7 @@ import {
286
286
  materializeAfterSemanticConsolidation,
287
287
  parseConsolidationResponse,
288
288
  parseOperatorAwareConsolidationResponse
289
- } from "./chunk-Q432REND.js";
289
+ } from "./chunk-YTZN2UZO.js";
290
290
  import {
291
291
  buildBehaviorSignalsForMemory,
292
292
  dedupeBehaviorSignalsByMemoryAndHash
@@ -314,7 +314,7 @@ import {
314
314
  detectMeetings,
315
315
  embeddingsFromCosineHits,
316
316
  normalizeConnectorScope
317
- } from "./chunk-FWWWUPOE.js";
317
+ } from "./chunk-5LYSEZOF.js";
318
318
  import {
319
319
  compileCorrectionRule,
320
320
  correctionsFilePath,
@@ -325,7 +325,7 @@ import {
325
325
  isAnalysisFailureKind,
326
326
  resolveJournalSource,
327
327
  resolveVaultNotePath
328
- } from "./chunk-5HYUUFMQ.js";
328
+ } from "./chunk-XCPNH2MG.js";
329
329
  import {
330
330
  AMBIENT_CAPTURE_PROMPT_RULE,
331
331
  isHighImpactPersonalFact
@@ -338,7 +338,7 @@ import {
338
338
  } from "./chunk-MI2OTWV5.js";
339
339
  import {
340
340
  MeetingsInputError
341
- } from "./chunk-EYKIDK33.js";
341
+ } from "./chunk-IS2IDFJP.js";
342
342
  import {
343
343
  WearablesInputError,
344
344
  describeErrorForOperator
@@ -356,14 +356,14 @@ import {
356
356
  } from "./chunk-DGS34QSY.js";
357
357
  import {
358
358
  NamespaceCatalog
359
- } from "./chunk-54NX5EG4.js";
359
+ } from "./chunk-W23JARAQ.js";
360
360
  import {
361
361
  RecallResultFormatter,
362
362
  SessionContextCoordinator,
363
363
  capturePassiveCorrections,
364
364
  clusterByKey,
365
365
  detectPassiveCorrections
366
- } from "./chunk-UZEHHXYC.js";
366
+ } from "./chunk-SFHLQPBF.js";
367
367
  import {
368
368
  importCapsule
369
369
  } from "./chunk-ZHXSOMYH.js";
@@ -383,7 +383,7 @@ import {
383
383
  } from "./chunk-ROBHL3GL.js";
384
384
  import {
385
385
  HourlySummarizer
386
- } from "./chunk-ACY4ZPF7.js";
386
+ } from "./chunk-AEOOGXMQ.js";
387
387
  import {
388
388
  LastRecallStore,
389
389
  RecallHandleHistoryStore,
@@ -396,17 +396,17 @@ import {
396
396
  isTopLevelArchivePath,
397
397
  journalPath,
398
398
  writeJournalFile
399
- } from "./chunk-UZZ7SQT3.js";
399
+ } from "./chunk-NVVZPBKI.js";
400
400
  import {
401
401
  buildXraySnapshot
402
- } from "./chunk-ZEGL7YCC.js";
402
+ } from "./chunk-BXIJSPCL.js";
403
403
  import {
404
404
  objectiveStateStoreOverrideForNamespace,
405
405
  searchObjectiveStateSnapshots
406
406
  } from "./chunk-HM7RHKS4.js";
407
407
  import {
408
408
  searchHarmonicRetrieval
409
- } from "./chunk-4RZLTZVM.js";
409
+ } from "./chunk-IOPIGX7Y.js";
410
410
  import {
411
411
  ProfilingCollector
412
412
  } from "./chunk-NLE6TSLG.js";
@@ -415,7 +415,7 @@ import {
415
415
  } from "./chunk-WLZYGLJ4.js";
416
416
  import {
417
417
  LocalLlmClient
418
- } from "./chunk-MVAQ2WM3.js";
418
+ } from "./chunk-G2XZFGYN.js";
419
419
  import {
420
420
  contentMatchesRedactionRules,
421
421
  loadRedactionRules
@@ -433,7 +433,7 @@ import {
433
433
  } from "./chunk-7ZNJN5WZ.js";
434
434
  import {
435
435
  NamespaceStorageRouter
436
- } from "./chunk-GG5FHZJJ.js";
436
+ } from "./chunk-2SNCQHJZ.js";
437
437
  import {
438
438
  pruneOrphanCueAnchors
439
439
  } from "./chunk-BMWN7B3Y.js";
@@ -447,7 +447,7 @@ import {
447
447
  ExtractionDeadlineError,
448
448
  ExtractionRunCoordinator,
449
449
  classifyExtractionOrigin
450
- } from "./chunk-6EHM2AV7.js";
450
+ } from "./chunk-IMBQFHRV.js";
451
451
  import {
452
452
  ARTIFACT_STATUS_CACHE_TTL_MS,
453
453
  BulkImportBatchPartialFailureError,
@@ -472,6 +472,7 @@ import {
472
472
  parseGraphRecallRankedResults,
473
473
  parseMemoryIntentSnapshot,
474
474
  parseQmdRecallResults,
475
+ qmdStartupCollectionCheckTimeoutMs,
475
476
  qmdStartupCollectionCheckWithTimeout,
476
477
  raceRecallAbort,
477
478
  resolvePersistedMemoryRelativePath,
@@ -486,7 +487,7 @@ import {
486
487
  throwIfRecallAborted,
487
488
  tokenizeRecallQuery,
488
489
  utcDateKeysForLocalDay
489
- } from "./chunk-BV4ZKIZH.js";
490
+ } from "./chunk-K75A5XWU.js";
490
491
  import {
491
492
  inferIntentFromText,
492
493
  intentCompatibilityScore,
@@ -495,10 +496,11 @@ import {
495
496
  } from "./chunk-CSAKJVXW.js";
496
497
  import {
497
498
  buildChainFollowupGenerator
498
- } from "./chunk-5YCNDC3C.js";
499
+ } from "./chunk-VQYWKCDR.js";
499
500
  import {
500
501
  QmdResultResolver,
501
502
  StorageManager,
503
+ canonicalSemanticFileText,
502
504
  compareEntityTimestamps,
503
505
  composeFusionDayMeta,
504
506
  composeMeetingRecord,
@@ -514,7 +516,7 @@ import {
514
516
  reconstructFusionInputs,
515
517
  selfDeps,
516
518
  serializeFusionDay
517
- } from "./chunk-CZTPU65V.js";
519
+ } from "./chunk-MVG3KXON.js";
518
520
  import {
519
521
  buildRetiredFactTombstoneInputs
520
522
  } from "./chunk-46WM6JX2.js";
@@ -531,12 +533,12 @@ import {
531
533
  import {
532
534
  NamespaceSearchRouter,
533
535
  namespaceCollectionName
534
- } from "./chunk-6YAIN5XJ.js";
536
+ } from "./chunk-TZ44E732.js";
535
537
  import {
536
538
  createConversationIndexRuntime,
537
539
  createSearchBackend,
538
540
  isSearchBackendEnabled
539
- } from "./chunk-4JVQRFZD.js";
541
+ } from "./chunk-JOP7W24J.js";
540
542
  import {
541
543
  NoopSearchBackend
542
544
  } from "./chunk-CYEPCZN5.js";
@@ -550,7 +552,7 @@ import {
550
552
  } from "./chunk-S2V7RUCL.js";
551
553
  import {
552
554
  confidenceTier
553
- } from "./chunk-IYKZJVL5.js";
555
+ } from "./chunk-MDIEES23.js";
554
556
  import {
555
557
  lintWorkspaceFiles,
556
558
  rotateMarkdownFileToArchive
@@ -559,7 +561,7 @@ import {
559
561
  applyFaithfulnessVerdict,
560
562
  createFaithfulnessCounters,
561
563
  runFaithfulnessGateBatch
562
- } from "./chunk-3N3PBBEH.js";
564
+ } from "./chunk-3XPN7AVY.js";
563
565
  import {
564
566
  casCommittedRevisionOf
565
567
  } from "./chunk-SHEHQBCG.js";
@@ -618,13 +620,15 @@ import {
618
620
  } from "./chunk-42JKGUFJ.js";
619
621
  import {
620
622
  FallbackLlmClient,
621
- fallbackLlmRuntimeContextFromConfig,
622
623
  gatewayTaskChainOptions
623
- } from "./chunk-LQNRVPTV.js";
624
+ } from "./chunk-THTF2W7M.js";
625
+ import {
626
+ fallbackLlmRuntimeContextFromConfig
627
+ } from "./chunk-KTOXQMW3.js";
624
628
  import {
625
629
  capStateViewPackets,
626
630
  reconcileStateViewPairs
627
- } from "./chunk-YDVAM7S4.js";
631
+ } from "./chunk-NETQXOPY.js";
628
632
  import {
629
633
  assertExternalWikiRootOutsideMemoryDirCanonical
630
634
  } from "./chunk-JV3C2MNQ.js";
@@ -820,7 +824,7 @@ import {
820
824
 
821
825
  // src/orchestrator.ts
822
826
  import path21 from "path";
823
- import { createHash as createHash8 } from "crypto";
827
+ import { createHash as createHash9 } from "crypto";
824
828
 
825
829
  // src/orchestration/tier-migration-coordinator.ts
826
830
  import path from "path";
@@ -4948,6 +4952,8 @@ async function decideSemanticDedup(content, lookup, options) {
4948
4952
  }
4949
4953
 
4950
4954
  // src/orchestration/semantic-merge-promotion-payload.ts
4955
+ import { createHash as createHash3 } from "crypto";
4956
+ import { readFile as readFile2 } from "fs/promises";
4951
4957
  async function buildMergedTargetPromotionPayload(storage, merge) {
4952
4958
  if (!merge.provenancePatched) {
4953
4959
  log.warn(
@@ -4972,6 +4978,7 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
4972
4978
  }
4973
4979
  const fm = committed.frontmatter;
4974
4980
  const snapshotDigest = typeof storage.readDurableFileDigest === "function" ? await storage.readDurableFileDigest(committed.path).catch(() => null) : null;
4981
+ const snapshotSemanticFingerprint = await readDurableSemanticFingerprint(committed.path);
4975
4982
  const receipt = await readPromotionReceiptStatus(storage, committed.path);
4976
4983
  if (!receipt.available) {
4977
4984
  log.warn(
@@ -4979,7 +4986,13 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
4979
4986
  );
4980
4987
  return { payload: null, readFailed: true };
4981
4988
  }
4982
- if (receipt.committedDigest !== void 0 && snapshotDigest !== receipt.committedDigest) {
4989
+ if (receipt.committedSemanticFingerprint !== void 0 && snapshotSemanticFingerprint !== receipt.committedSemanticFingerprint) {
4990
+ log.warn(
4991
+ snapshotSemanticFingerprint == null ? `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 the semantic snapshot fingerprint is unavailable while the CAS receipt carries ${receipt.committedSemanticFingerprint}; promotion and reconciliation retry on the next merge` : `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 record semantic fingerprint (${snapshotSemanticFingerprint}) does not match committed receipt fingerprint (${receipt.committedSemanticFingerprint}); record metadata was mutated concurrently`
4992
+ );
4993
+ return { payload: null, readFailed: true };
4994
+ }
4995
+ if (receipt.committedSemanticFingerprint === void 0 && receipt.committedDigest !== void 0 && snapshotDigest !== receipt.committedDigest) {
4983
4996
  log.warn(
4984
4997
  snapshotDigest == null ? `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 the record snapshot digest is unavailable while the CAS receipt carries committed digest ${receipt.committedDigest}; promotion and reconciliation retry on the next merge` : `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 record snapshot digest (${snapshotDigest}) does not match committed receipt digest (${receipt.committedDigest}); record metadata was mutated concurrently`
4985
4998
  );
@@ -5011,11 +5024,19 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
5011
5024
  ...fm.toolScoped === true ? { toolScoped: true } : {},
5012
5025
  ...fm.sourceConnector !== void 0 ? { sourceConnector: fm.sourceConnector } : {},
5013
5026
  ...receipt.revision !== void 0 ? { committedRevision: receipt.revision } : {},
5014
- ...receipt.committedDigest !== void 0 ? { committedDigest: receipt.committedDigest } : snapshotDigest !== null ? { committedDigest: snapshotDigest } : {}
5027
+ ...receipt.committedDigest !== void 0 ? { committedDigest: receipt.committedDigest } : snapshotDigest !== null ? { committedDigest: snapshotDigest } : {},
5028
+ ...receipt.committedSemanticFingerprint !== void 0 ? { committedSemanticFingerprint: receipt.committedSemanticFingerprint } : snapshotSemanticFingerprint !== null ? { committedSemanticFingerprint: snapshotSemanticFingerprint } : {}
5015
5029
  },
5016
5030
  readFailed: false
5017
5031
  };
5018
5032
  }
5033
+ async function readDurableSemanticFingerprint(filePath) {
5034
+ try {
5035
+ return createHash3("sha256").update(canonicalSemanticFileText(await readFile2(filePath, "utf8"))).digest("hex");
5036
+ } catch {
5037
+ return null;
5038
+ }
5039
+ }
5019
5040
  async function readPromotionReceiptStatus(storage, filePath) {
5020
5041
  try {
5021
5042
  const status = await storage.readCasRevisionStatus(filePath);
@@ -5023,7 +5044,8 @@ async function readPromotionReceiptStatus(storage, filePath) {
5023
5044
  return {
5024
5045
  available: true,
5025
5046
  revision: status.status === "present" ? status.revision : void 0,
5026
- committedDigest: status.status === "present" ? status.committedDigest : void 0
5047
+ committedDigest: status.status === "present" ? status.committedDigest : void 0,
5048
+ committedSemanticFingerprint: status.status === "present" ? status.committedSemanticFingerprint : void 0
5027
5049
  };
5028
5050
  } catch (err) {
5029
5051
  return { available: false, reason: err instanceof Error ? err.message : String(err) };
@@ -5183,10 +5205,10 @@ async function promoteAndReconcileMergedTarget(args) {
5183
5205
  return;
5184
5206
  }
5185
5207
  const standingReceipt = await readPromotionReceiptStatus(args.sourceStorage, current.path);
5186
- const standingDigest = typeof args.sourceStorage.readDurableFileDigest === "function" ? await args.sourceStorage.readDurableFileDigest(current.path).catch(() => null) : null;
5187
- if (!standingReceipt.available || (standingReceipt.revision ?? void 0) !== (payload.committedRevision ?? void 0) || payload.committedDigest !== void 0 && standingReceipt.committedDigest !== void 0 && standingReceipt.committedDigest !== payload.committedDigest || payload.committedDigest !== void 0 && standingDigest !== null && standingDigest !== payload.committedDigest) {
5208
+ const standingSemanticFingerprint = await readDurableSemanticFingerprint(current.path);
5209
+ if (!standingReceipt.available || (standingReceipt.revision ?? void 0) !== (payload.committedRevision ?? void 0) || payload.committedDigest !== void 0 && standingReceipt.committedDigest !== void 0 && standingReceipt.committedDigest !== payload.committedDigest || payload.committedSemanticFingerprint !== void 0 && standingSemanticFingerprint !== null && standingSemanticFingerprint !== payload.committedSemanticFingerprint) {
5188
5210
  log.warn(
5189
- `persistExtraction: merged-target promotion abandoned for ${args.sourceMemoryId} \u2014 the committed record's CAS receipt or digest ${standingReceipt.available ? "does not match the cached payload's" : "is unreadable"}, so the cached body is not confirmed`
5211
+ `persistExtraction: merged-target promotion abandoned for ${args.sourceMemoryId} \u2014 the committed record's CAS receipt or semantic fingerprint ${standingReceipt.available ? "does not match the cached payload's" : "is unreadable"}, so the cached body is not confirmed`
5190
5212
  );
5191
5213
  return;
5192
5214
  }
@@ -5347,9 +5369,9 @@ async function persistConstructedHarmonicRecords(options) {
5347
5369
  import path5 from "path";
5348
5370
 
5349
5371
  // src/orchestration/semantic-merge-commit-effects.ts
5350
- import { readFile as readFile2 } from "fs/promises";
5372
+ import { readFile as readFile3 } from "fs/promises";
5351
5373
  async function stageMergedTargetSnapshot(target, versioning, memoryDir) {
5352
- const currentFile = await readFile2(target.path, "utf8");
5374
+ const currentFile = await readFile3(target.path, "utf8");
5353
5375
  const version = await createVersion(
5354
5376
  target.path,
5355
5377
  currentFile,
@@ -8079,14 +8101,14 @@ async function drainExtractionAndShutdownDependencyPropagation(extractionQueue,
8079
8101
 
8080
8102
  // src/orchestration/dependency-propagation-delivery.ts
8081
8103
  import { randomUUID } from "crypto";
8082
- import { readFile as readFile3, unlink } from "fs/promises";
8104
+ import { readFile as readFile4, unlink } from "fs/promises";
8083
8105
  import path7 from "path";
8084
8106
 
8085
8107
  // src/orchestration/dependency-propagation-recovery-replay.ts
8086
- import { createHash as createHash3 } from "crypto";
8108
+ import { createHash as createHash4 } from "crypto";
8087
8109
  function memoryFingerprint(memory) {
8088
8110
  const { accessCount: _accessCount, lastAccessed: _lastAccessed, ...frontmatter } = memory.frontmatter;
8089
- return createHash3("sha256").update(JSON.stringify(canonicalize({ content: memory.content, frontmatter }))).digest("hex");
8111
+ return createHash4("sha256").update(JSON.stringify(canonicalize({ content: memory.content, frontmatter }))).digest("hex");
8090
8112
  }
8091
8113
  async function findRecoverySource(storage, sourceId) {
8092
8114
  const hot = await storage.getMemoryById(sourceId);
@@ -8256,7 +8278,7 @@ var DependencyPropagationDelivery = class {
8256
8278
  }, delayMs);
8257
8279
  timer.unref();
8258
8280
  });
8259
- this.readQueueFile = options.readQueueFile ?? ((filePath) => readFile3(filePath, "utf8"));
8281
+ this.readQueueFile = options.readQueueFile ?? ((filePath) => readFile4(filePath, "utf8"));
8260
8282
  this.writeQueueFile = options.writeQueueFile ?? ((filePath, content) => writeJsonFileAtomic(filePath, JSON.parse(content)));
8261
8283
  this.replayReconciliation = options.replayReconciliation;
8262
8284
  }
@@ -9103,8 +9125,8 @@ function createDependencyPropagationReplayReconciliation(host) {
9103
9125
  }
9104
9126
 
9105
9127
  // src/orchestration/recall-internal.ts
9106
- import { createHash as createHash5 } from "crypto";
9107
- import { readFile as readFile4, stat, unlink as unlink2 } from "fs/promises";
9128
+ import { createHash as createHash6 } from "crypto";
9129
+ import { readFile as readFile5, stat, unlink as unlink2 } from "fs/promises";
9108
9130
  import path11 from "path";
9109
9131
 
9110
9132
  // src/orchestration/graph-path-state-loader.ts
@@ -9352,7 +9374,7 @@ var GraphPathStateLoader = class {
9352
9374
  };
9353
9375
 
9354
9376
  // src/orchestration/graph-recall-coordinator.ts
9355
- import { createHash as createHash4 } from "crypto";
9377
+ import { createHash as createHash5 } from "crypto";
9356
9378
  import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
9357
9379
  import path9 from "path";
9358
9380
  function mergeGraphExpandedResults(primary, expanded) {
@@ -9740,7 +9762,7 @@ var GraphRecallCoordinator = class {
9740
9762
  const payload = {
9741
9763
  recordedAt: now,
9742
9764
  mode: options.recallMode,
9743
- queryHash: createHash4("sha256").update(options.prompt).digest("hex"),
9765
+ queryHash: createHash5("sha256").update(options.prompt).digest("hex"),
9744
9766
  queryLength: options.prompt.length,
9745
9767
  namespaces: options.recallNamespaces,
9746
9768
  seedCount: totalSeedCount,
@@ -10255,8 +10277,8 @@ var RecallInternalCoordinator = class {
10255
10277
  record: recordRecallSectionMetric,
10256
10278
  logger: log
10257
10279
  });
10258
- const promptHash = createHash5("sha256").update(prompt).digest("hex");
10259
- const traceId = createHash5("sha256").update(`${sessionKey ?? "default"}:${recallStart}:${promptHash}`).digest("hex").slice(0, 16);
10280
+ const promptHash = createHash6("sha256").update(prompt).digest("hex");
10281
+ const traceId = createHash6("sha256").update(`${sessionKey ?? "default"}:${recallStart}:${promptHash}`).digest("hex").slice(0, 16);
10260
10282
  const sectionBuckets = /* @__PURE__ */ new Map();
10261
10283
  const queryPolicy = buildRecallQueryPolicy(prompt, sessionKey, {
10262
10284
  cronRecallPolicyEnabled: resolveRecallAuxiliaryCapabilities(this.deps.config).cronRecallPolicy,
@@ -10265,13 +10287,9 @@ var RecallInternalCoordinator = class {
10265
10287
  cronConversationRecallMode: this.deps.config.cronConversationRecallMode
10266
10288
  });
10267
10289
  const retrievalQuery = queryPolicy.retrievalQuery || prompt;
10268
- const { stateViewActive, stateViewPacketActive: stateViewPacketActive2 } = resolveRecallStateViewFlags(
10269
- options.stateView,
10270
- this.deps.config.recallStateViews,
10271
- retrievalQuery,
10272
- asOfMs
10273
- );
10274
- const retrievalQueryHash = createHash5("sha256").update(retrievalQuery).digest("hex");
10290
+ const stateViewActive = resolveRecallStateViewActive(options, this.deps.config, prompt);
10291
+ const stateViewPacketActive2 = stateViewActive === true && !(typeof asOfMs === "number" && Number.isFinite(asOfMs));
10292
+ const retrievalQueryHash = createHash6("sha256").update(retrievalQuery).digest("hex");
10275
10293
  const policyVersion = this.deps.currentPolicyVersion();
10276
10294
  let recallSource = "none";
10277
10295
  let recalledMemoryCount = 0;
@@ -11957,7 +11975,7 @@ ${formatted}`;
11957
11975
  const signalStat = await stat(signalPath).catch(() => null);
11958
11976
  if (!signalStat) return null;
11959
11977
  const signalAge = Date.now() - signalStat.mtimeMs;
11960
- const signalData = JSON.parse(await readFile4(signalPath, "utf-8"));
11978
+ const signalData = JSON.parse(await readFile5(signalPath, "utf-8"));
11961
11979
  if (signalData.sessionKey !== effectiveSessionKey) {
11962
11980
  log.debug(
11963
11981
  `recall: compaction signal is for ${signalData.sessionKey}, not ${effectiveSessionKey} \u2014 skipping`
@@ -11977,7 +11995,7 @@ ${formatted}`;
11977
11995
 
11978
11996
  `;
11979
11997
  try {
11980
- const bootContent = await readFile4(bootPath, "utf-8");
11998
+ const bootContent = await readFile5(bootPath, "utf-8");
11981
11999
  section += "### BOOT.md (working state before compaction)\n\n";
11982
12000
  section += bootContent + "\n";
11983
12001
  } catch {
@@ -14237,7 +14255,7 @@ ${tmtNode.summary}`
14237
14255
  };
14238
14256
 
14239
14257
  // src/orchestration/recall-search-pipeline.ts
14240
- import { createHash as createHash6 } from "crypto";
14258
+ import { createHash as createHash7 } from "crypto";
14241
14259
  import path13 from "path";
14242
14260
 
14243
14261
  // src/orchestration/recall-search-prefilter.ts
@@ -14460,7 +14478,7 @@ var RecallSearchPipelineCoordinator = class {
14460
14478
  if (!options.onDebugSnapshot) return;
14461
14479
  await options.onDebugSnapshot({
14462
14480
  recordedAt: (/* @__PURE__ */ new Date()).toISOString(),
14463
- queryHash: createHash6("sha256").update(prompt).digest("hex"),
14481
+ queryHash: createHash7("sha256").update(prompt).digest("hex"),
14464
14482
  queryLength: prompt.length,
14465
14483
  collection: options.collection,
14466
14484
  namespaces: options.recallNamespaces,
@@ -15430,7 +15448,7 @@ var RecallSearchPipelineCoordinator = class {
15430
15448
  };
15431
15449
 
15432
15450
  // src/orchestration/turn-ingestion.ts
15433
- import { createHash as createHash7, randomBytes } from "crypto";
15451
+ import { createHash as createHash8, randomBytes } from "crypto";
15434
15452
  function isFlushPlanRecoveryTurn(turn) {
15435
15453
  const provenance = turn.importProvenance;
15436
15454
  if (provenance?.sourceLabel === "OpenClaw flush plan") return true;
@@ -15621,7 +15639,7 @@ var TurnIngestionCoordinator = class {
15621
15639
  const shouldUseStableBatchKey = turns.some(
15622
15640
  (turn) => turn.persistProcessedFingerprint === true || typeof turn.turnFingerprint === "string" && turn.turnFingerprint.length > 0
15623
15641
  );
15624
- const stableBatchFingerprint = shouldUseStableBatchKey ? createHash7("sha256").update(
15642
+ const stableBatchFingerprint = shouldUseStableBatchKey ? createHash8("sha256").update(
15625
15643
  turns.map(
15626
15644
  (turn) => [
15627
15645
  turn.role,
@@ -15967,7 +15985,7 @@ var TurnIngestionCoordinator = class {
15967
15985
  };
15968
15986
 
15969
15987
  // src/orchestration/recall-introspection.ts
15970
- import { mkdir as mkdir5, readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
15988
+ import { mkdir as mkdir5, readFile as readFile7, writeFile as writeFile5 } from "fs/promises";
15971
15989
  import path15 from "path";
15972
15990
 
15973
15991
  // src/taxonomy/default-taxonomy.ts
@@ -16090,7 +16108,7 @@ function generateResolverDocument(taxonomy) {
16090
16108
  }
16091
16109
 
16092
16110
  // src/taxonomy/taxonomy-loader.ts
16093
- import { readFile as readFile5, mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
16111
+ import { readFile as readFile6, mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
16094
16112
  import path14 from "path";
16095
16113
  var TAXONOMY_DIR = ".taxonomy";
16096
16114
  var TAXONOMY_FILE = "taxonomy.json";
@@ -16192,7 +16210,7 @@ async function loadTaxonomy(memoryDir) {
16192
16210
  const taxonomyPath = path14.join(memoryDir, TAXONOMY_DIR, TAXONOMY_FILE);
16193
16211
  let raw;
16194
16212
  try {
16195
- raw = await readFile5(taxonomyPath, "utf-8");
16213
+ raw = await readFile6(taxonomyPath, "utf-8");
16196
16214
  } catch (err) {
16197
16215
  if (err instanceof Error && err.code === "ENOENT") {
16198
16216
  return structuredClone(DEFAULT_TAXONOMY);
@@ -16278,7 +16296,7 @@ var RecallIntrospectionCoordinator = class {
16278
16296
  "last_graph_recall.json"
16279
16297
  );
16280
16298
  try {
16281
- const raw = await readFile6(snapshotPath, "utf-8");
16299
+ const raw = await readFile7(snapshotPath, "utf-8");
16282
16300
  const parsed = JSON.parse(raw);
16283
16301
  if (!parsed || typeof parsed !== "object") return null;
16284
16302
  return {
@@ -16313,7 +16331,7 @@ var RecallIntrospectionCoordinator = class {
16313
16331
  const storage = await this.deps.getStorage(namespace);
16314
16332
  const snapshotPath = path15.join(storage.dir, "state", "last_intent.json");
16315
16333
  try {
16316
- const raw = await readFile6(snapshotPath, "utf-8");
16334
+ const raw = await readFile7(snapshotPath, "utf-8");
16317
16335
  const parsed = JSON.parse(raw);
16318
16336
  if (!parsed || typeof parsed !== "object") return null;
16319
16337
  const graphDecision = parsed.graphDecision && typeof parsed.graphDecision === "object" ? parsed.graphDecision : void 0;
@@ -16350,7 +16368,7 @@ var RecallIntrospectionCoordinator = class {
16350
16368
  "last_qmd_recall.json"
16351
16369
  );
16352
16370
  try {
16353
- const raw = await readFile6(snapshotPath, "utf-8");
16371
+ const raw = await readFile7(snapshotPath, "utf-8");
16354
16372
  const parsed = JSON.parse(raw);
16355
16373
  if (!parsed || typeof parsed !== "object") return null;
16356
16374
  return {
@@ -16689,15 +16707,214 @@ var RecallIntrospectionCoordinator = class {
16689
16707
  // src/orchestration/orchestrator-init.ts
16690
16708
  import { readdir as readdir2, stat as stat2, unlink as unlink3 } from "fs/promises";
16691
16709
  import path16 from "path";
16710
+
16711
+ // src/orchestration/startup-collection-checks.ts
16712
+ async function startupDiscoveryWithTimeout(discover, configuredFallback, timeoutMs = qmdStartupCollectionCheckTimeoutMs()) {
16713
+ let timer;
16714
+ const fallback = {
16715
+ value: configuredFallback,
16716
+ complete: false
16717
+ };
16718
+ const timeoutPromise = new Promise((resolve) => {
16719
+ timer = setTimeout(() => {
16720
+ log.warn(
16721
+ `startup discovery timed out after ${timeoutMs}ms; using configured fallback fail-open`
16722
+ );
16723
+ resolve(fallback);
16724
+ }, timeoutMs);
16725
+ });
16726
+ try {
16727
+ return await Promise.race([
16728
+ Promise.resolve().then(discover).then((value) => ({ value, complete: true })),
16729
+ timeoutPromise
16730
+ ]);
16731
+ } finally {
16732
+ if (timer) clearTimeout(timer);
16733
+ }
16734
+ }
16735
+ async function qmdStartupCollectionChecksWithTimeout(checks, namespaces, timeoutMs = qmdStartupCollectionCheckTimeoutMs() + 1e3) {
16736
+ if (checks.length === 0) return [];
16737
+ const settled = /* @__PURE__ */ new Map();
16738
+ const trackedChecks = checks.map((check) => check.then((result) => {
16739
+ settled.set(result.namespace, result);
16740
+ return result;
16741
+ }));
16742
+ let timer;
16743
+ const timeoutPromise = new Promise((resolve) => {
16744
+ timer = setTimeout(() => {
16745
+ log.warn(
16746
+ `QMD startup collection check batch timed out after ${timeoutMs}ms; keeping search enabled fail-open`
16747
+ );
16748
+ resolve(namespaces.map(
16749
+ (namespace) => settled.get(namespace) ?? { namespace, state: "unknown" }
16750
+ ));
16751
+ }, timeoutMs);
16752
+ });
16753
+ try {
16754
+ return await Promise.race([Promise.all(trackedChecks), timeoutPromise]);
16755
+ } finally {
16756
+ if (timer) clearTimeout(timer);
16757
+ }
16758
+ }
16759
+
16760
+ // src/orchestration/orchestrator-init.ts
16692
16761
  var OrchestratorInitCoordinator = class {
16693
16762
  constructor(deps) {
16694
16763
  this.deps = deps;
16695
16764
  }
16696
16765
  deps;
16766
+ nextStartupEpoch = 0;
16767
+ activeStartupEpoch = null;
16768
+ startupClosed = false;
16769
+ maintenanceNamespacesFlight;
16770
+ correctionCatalogFlight;
16771
+ recoveredCorrectionNamespaces = /* @__PURE__ */ new Set();
16772
+ correctionRecoveryChain = Promise.resolve();
16773
+ startupEpochAbort;
16774
+ /** Retire the current lifecycle without constructing a lazy coordinator. */
16775
+ retireStartupEpoch() {
16776
+ this.startupEpochAbort?.controller.abort();
16777
+ this.startupEpochAbort = void 0;
16778
+ this.startupClosed = true;
16779
+ this.activeStartupEpoch = null;
16780
+ }
16781
+ beginStartupEpoch() {
16782
+ this.startupEpochAbort?.controller.abort();
16783
+ this.startupEpochAbort = void 0;
16784
+ this.deps.deferredInitAbort?.abort();
16785
+ this.deps.deferredInitAbort = null;
16786
+ this.deps.deferredSyncSucceeded = false;
16787
+ const epoch = ++this.nextStartupEpoch;
16788
+ this.startupEpochAbort = { epoch, controller: new AbortController() };
16789
+ this.activeStartupEpoch = epoch;
16790
+ this.startupClosed = false;
16791
+ this.maintenanceNamespacesFlight = void 0;
16792
+ this.correctionCatalogFlight = void 0;
16793
+ this.recoveredCorrectionNamespaces = /* @__PURE__ */ new Set();
16794
+ this.correctionRecoveryChain = Promise.resolve();
16795
+ return epoch;
16796
+ }
16797
+ currentOrNewStartupEpoch() {
16798
+ if (this.startupClosed) return null;
16799
+ return this.activeStartupEpoch ?? this.beginStartupEpoch();
16800
+ }
16801
+ isCurrentStartupEpoch(epoch) {
16802
+ return !this.startupClosed && this.activeStartupEpoch === epoch;
16803
+ }
16804
+ startupEpochSignal(epoch) {
16805
+ return this.startupEpochAbort?.epoch === epoch ? this.startupEpochAbort.controller.signal : void 0;
16806
+ }
16807
+ linkedEpochAbortController(epoch, externalSignal) {
16808
+ const controller = new AbortController();
16809
+ const signals = [this.startupEpochSignal(epoch), externalSignal].filter((signal) => signal !== void 0);
16810
+ const abort = () => controller.abort();
16811
+ for (const signal of signals) {
16812
+ if (signal.aborted) abort();
16813
+ else signal.addEventListener("abort", abort, { once: true });
16814
+ }
16815
+ return {
16816
+ controller,
16817
+ dispose: () => {
16818
+ for (const signal of signals) signal.removeEventListener("abort", abort);
16819
+ }
16820
+ };
16821
+ }
16822
+ async probeForStartupEpoch(epoch, externalSignal) {
16823
+ const abort = this.linkedEpochAbortController(epoch, externalSignal);
16824
+ try {
16825
+ if (!this.isCurrentStartupEpoch(epoch) || abort.controller.signal.aborted) return false;
16826
+ return await this.deps.qmd.probe({ signal: abort.controller.signal });
16827
+ } finally {
16828
+ abort.dispose();
16829
+ }
16830
+ }
16831
+ maintenanceNamespacesFlightFor(epoch) {
16832
+ if (this.maintenanceNamespacesFlight?.epoch === epoch) {
16833
+ return this.maintenanceNamespacesFlight.promise;
16834
+ }
16835
+ const promise = Promise.resolve().then(() => {
16836
+ if (!this.isCurrentStartupEpoch(epoch)) return [];
16837
+ return this.deps.maintenanceNamespaces();
16838
+ });
16839
+ this.maintenanceNamespacesFlight = { epoch, promise };
16840
+ void promise.catch(() => {
16841
+ if (this.isCurrentStartupEpoch(epoch) && this.maintenanceNamespacesFlight?.epoch === epoch && this.maintenanceNamespacesFlight.promise === promise) {
16842
+ this.maintenanceNamespacesFlight = void 0;
16843
+ }
16844
+ });
16845
+ return promise;
16846
+ }
16847
+ correctionCatalogFlightFor(epoch) {
16848
+ if (!this.isCurrentStartupEpoch(epoch)) {
16849
+ return Promise.resolve([]);
16850
+ }
16851
+ if (this.correctionCatalogFlight?.epoch === epoch) {
16852
+ return this.correctionCatalogFlight.promise;
16853
+ }
16854
+ const promise = Promise.resolve().then(() => {
16855
+ if (!this.isCurrentStartupEpoch(epoch)) return [];
16856
+ return this.deps.namespaceCatalog.listNamespaces();
16857
+ });
16858
+ this.correctionCatalogFlight = { epoch, promise };
16859
+ return promise;
16860
+ }
16861
+ enqueueCorrectionRecovery(epoch, namespaces) {
16862
+ if (!this.isCurrentStartupEpoch(epoch)) return Promise.resolve();
16863
+ const unrecovered = [...new Set(namespaces)].filter(
16864
+ (namespace) => !this.recoveredCorrectionNamespaces.has(namespace)
16865
+ );
16866
+ if (unrecovered.length === 0) return this.correctionRecoveryChain;
16867
+ for (const namespace of unrecovered) this.recoveredCorrectionNamespaces.add(namespace);
16868
+ this.correctionRecoveryChain = this.correctionRecoveryChain.then(async () => {
16869
+ if (!this.isCurrentStartupEpoch(epoch)) return;
16870
+ try {
16871
+ const recovered = await this.deps.passiveCorrectionService().recoverStaleApplyingPlans(
16872
+ unrecovered
16873
+ );
16874
+ if (recovered > 0) {
16875
+ log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
16876
+ }
16877
+ } catch (staleErr) {
16878
+ log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
16879
+ }
16880
+ });
16881
+ return this.correctionRecoveryChain;
16882
+ }
16883
+ async startupNamespaces(epoch) {
16884
+ if (!this.isCurrentStartupEpoch(epoch)) {
16885
+ return { namespaces: this.deps.configuredNamespaceList(), complete: false };
16886
+ }
16887
+ if (!resolveNamespaceCapabilities(this.deps.config).namespaces) {
16888
+ return { namespaces: [this.deps.config.defaultNamespace], complete: true };
16889
+ }
16890
+ const discovery = await startupDiscoveryWithTimeout(
16891
+ () => this.maintenanceNamespacesFlightFor(epoch),
16892
+ this.deps.configuredNamespaceList()
16893
+ );
16894
+ return { namespaces: discovery.value, complete: discovery.complete };
16895
+ }
16697
16896
  async initialize() {
16897
+ const epoch = this.beginStartupEpoch();
16898
+ let resolveDeferred;
16698
16899
  this.deps.deferredReady = new Promise((resolve) => {
16699
- this.deps.resolveDeferredReady = resolve;
16900
+ resolveDeferred = () => resolve();
16901
+ this.deps.resolveDeferredReady = resolveDeferred;
16700
16902
  });
16903
+ const settleOwnDeferredReady = () => {
16904
+ if (this.deps.resolveDeferredReady === resolveDeferred) {
16905
+ this.deps.resolveDeferredReady = null;
16906
+ }
16907
+ resolveDeferred?.();
16908
+ };
16909
+ const exitIfStale = () => {
16910
+ if (this.isCurrentStartupEpoch(epoch)) return false;
16911
+ if (this.startupClosed && this.deps.resolveInit) {
16912
+ this.deps.resolveInit();
16913
+ this.deps.resolveInit = null;
16914
+ }
16915
+ settleOwnDeferredReady();
16916
+ return true;
16917
+ };
16701
16918
  try {
16702
16919
  await migrateFromEngram({
16703
16920
  quiet: true,
@@ -16730,21 +16947,34 @@ var OrchestratorInitCoordinator = class {
16730
16947
  const correctionNamespaces = new Set(this.deps.configuredNamespaceList());
16731
16948
  if (this.deps.namespaceCatalog.enabled) {
16732
16949
  try {
16733
- for (const rec of await this.deps.namespaceCatalog.listNamespaces()) {
16950
+ const catalogFlight = this.correctionCatalogFlightFor(epoch);
16951
+ const catalogDiscovery = await startupDiscoveryWithTimeout(
16952
+ () => catalogFlight,
16953
+ []
16954
+ );
16955
+ for (const rec of catalogDiscovery.value) {
16734
16956
  correctionNamespaces.add(rec.namespace);
16735
16957
  }
16958
+ if (!catalogDiscovery.complete) {
16959
+ void catalogFlight.then(
16960
+ (records) => {
16961
+ if (!this.isCurrentStartupEpoch(epoch)) return;
16962
+ void this.enqueueCorrectionRecovery(
16963
+ epoch,
16964
+ records.map((record) => record.namespace)
16965
+ );
16966
+ },
16967
+ () => void 0
16968
+ );
16969
+ }
16736
16970
  } catch {
16737
16971
  }
16738
16972
  }
16739
- const recovered = await this.deps.passiveCorrectionService().recoverStaleApplyingPlans(
16740
- [...correctionNamespaces]
16741
- );
16742
- if (recovered > 0) {
16743
- log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
16744
- }
16973
+ await this.enqueueCorrectionRecovery(epoch, correctionNamespaces);
16745
16974
  } catch (staleErr) {
16746
16975
  log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
16747
16976
  }
16977
+ if (exitIfStale()) return;
16748
16978
  await this.deps.relevance.load();
16749
16979
  await this.deps.negatives.load();
16750
16980
  await this.deps.lastRecall.load();
@@ -16805,52 +17035,68 @@ var OrchestratorInitCoordinator = class {
16805
17035
  }
16806
17036
  }
16807
17037
  try {
16808
- const available = await this.deps.qmd.probe();
17038
+ const available = await this.probeForStartupEpoch(epoch);
16809
17039
  if (available) {
16810
17040
  log.info(`Search backend: available ${this.deps.qmd.debugStatus()}`);
16811
- const namespaces = resolveNamespaceCapabilities(this.deps.config).namespaces ? await this.deps.maintenanceNamespaces() : [this.deps.config.defaultNamespace];
16812
- const states = await Promise.all(
16813
- namespaces.map(async (namespace) => {
16814
- const collectionCheckAbort = new AbortController();
16815
- const state = await qmdStartupCollectionCheckWithTimeout(
16816
- resolveNamespaceCapabilities(this.deps.config).namespaces ? this.deps.namespaceSearchRouter.ensureNamespaceCollection(
16817
- namespace,
16818
- { signal: collectionCheckAbort.signal }
16819
- ) : this.deps.qmd.ensureCollection(
16820
- this.deps.config.memoryDir,
16821
- this.deps.config.qmdCollection,
16822
- { signal: collectionCheckAbort.signal }
16823
- ),
16824
- collectionCheckAbort,
16825
- namespace
16826
- );
16827
- return { namespace, state };
16828
- })
16829
- );
16830
- const defaultState = states.find(
16831
- (entry) => entry.namespace === this.deps.config.defaultNamespace
16832
- )?.state ?? "unknown";
16833
- if (defaultState === "missing") {
16834
- await this.deps.disposeSearchBackendIfNeeded();
16835
- this.deps.qmd = new NoopSearchBackend();
16836
- log.warn(
16837
- "Search collection missing for Remnic memory store; disabling search retrieval for this runtime (fallback retrieval remains enabled)"
16838
- );
16839
- } else if (defaultState === "unknown") {
16840
- log.warn(
16841
- "Search collection check unavailable; keeping search retrieval enabled for fail-open behavior"
16842
- );
16843
- } else if (defaultState === "skipped") {
16844
- log.debug(
16845
- "Search collection check skipped (remote or daemon-only mode)"
16846
- );
16847
- }
16848
- for (const entry of states) {
16849
- if (entry.namespace === this.deps.config.defaultNamespace) continue;
16850
- if (entry.state === "missing") {
16851
- log.warn(
16852
- `Search collection missing for namespace '${entry.namespace}'; namespace retrieval will fail open to non-search paths`
16853
- );
17041
+ const namespaceCapabilities = resolveNamespaceCapabilities(this.deps.config).namespaces;
17042
+ const discovery = await this.startupNamespaces(epoch);
17043
+ if (!this.isCurrentStartupEpoch(epoch)) {
17044
+ log.debug("startup collection check skipped for a retired startup epoch");
17045
+ } else {
17046
+ const checks = discovery.namespaces.map(async (namespace) => {
17047
+ const epochAbort = this.linkedEpochAbortController(epoch);
17048
+ try {
17049
+ const state = await qmdStartupCollectionCheckWithTimeout(
17050
+ namespaceCapabilities ? this.deps.namespaceSearchRouter.ensureNamespaceCollection(
17051
+ namespace,
17052
+ { signal: epochAbort.controller.signal }
17053
+ ) : this.deps.qmd.ensureCollection(
17054
+ this.deps.config.memoryDir,
17055
+ this.deps.config.qmdCollection,
17056
+ { signal: epochAbort.controller.signal }
17057
+ ),
17058
+ epochAbort.controller,
17059
+ namespace
17060
+ );
17061
+ return { namespace, state };
17062
+ } finally {
17063
+ epochAbort.dispose();
17064
+ }
17065
+ });
17066
+ const states = await qmdStartupCollectionChecksWithTimeout(checks, discovery.namespaces);
17067
+ if (!this.isCurrentStartupEpoch(epoch)) {
17068
+ log.debug("startup collection-check batch completed for a retired startup epoch");
17069
+ } else {
17070
+ const defaultState = states.find(
17071
+ (entry) => entry.namespace === this.deps.config.defaultNamespace
17072
+ )?.state ?? "unknown";
17073
+ if (defaultState === "missing") {
17074
+ await this.deps.disposeSearchBackendIfNeeded();
17075
+ if (!this.isCurrentStartupEpoch(epoch)) {
17076
+ log.debug("startup collection-check disposal completed for a retired startup epoch");
17077
+ } else {
17078
+ this.deps.qmd = new NoopSearchBackend();
17079
+ log.warn(
17080
+ "Search collection missing for Remnic memory store; disabling search retrieval for this runtime (fallback retrieval remains enabled)"
17081
+ );
17082
+ }
17083
+ } else if (defaultState === "unknown") {
17084
+ log.warn(
17085
+ "Search collection check unavailable; keeping search retrieval enabled for fail-open behavior"
17086
+ );
17087
+ } else if (defaultState === "skipped") {
17088
+ log.debug(
17089
+ "Search collection check skipped (remote or daemon-only mode)"
17090
+ );
17091
+ }
17092
+ for (const entry of states) {
17093
+ if (entry.namespace === this.deps.config.defaultNamespace) continue;
17094
+ if (entry.state === "missing") {
17095
+ log.warn(
17096
+ `Search collection missing for namespace '${entry.namespace}'; namespace retrieval will fail open to non-search paths`
17097
+ );
17098
+ }
17099
+ }
16854
17100
  }
16855
17101
  }
16856
17102
  } else if (this.deps.qmd instanceof NoopSearchBackend) {
@@ -16861,46 +17107,55 @@ var OrchestratorInitCoordinator = class {
16861
17107
  } catch (err) {
16862
17108
  log.error(`QMD probe/collection check failed (non-fatal): ${err}`);
16863
17109
  }
17110
+ if (exitIfStale()) return;
16864
17111
  if (this.deps.resolveInit) {
16865
17112
  this.deps.resolveInit();
16866
17113
  this.deps.resolveInit = null;
16867
17114
  log.info("init gate opened (essential state + QMD state loaded)");
16868
17115
  }
16869
- const resolveDeferred = this.deps.resolveDeferredReady;
16870
- this.deps.resolveDeferredReady = null;
17116
+ if (this.deps.resolveDeferredReady === resolveDeferred) {
17117
+ this.deps.resolveDeferredReady = null;
17118
+ }
16871
17119
  this.deps.deferredInitAbort = new AbortController();
16872
17120
  this.deps.deferredInitialize(this.deps.deferredInitAbort.signal).catch((err) => {
16873
17121
  log.error(`deferred initialization failed (non-fatal): ${err}`);
16874
17122
  }).finally(() => {
16875
- resolveDeferred?.();
17123
+ settleOwnDeferredReady();
16876
17124
  });
16877
17125
  } catch (err) {
16878
- if (this.deps.resolveInit) {
17126
+ if ((this.isCurrentStartupEpoch(epoch) || this.startupClosed) && this.deps.resolveInit) {
16879
17127
  this.deps.resolveInit();
16880
17128
  this.deps.resolveInit = null;
16881
17129
  }
16882
- if (this.deps.resolveDeferredReady) {
16883
- this.deps.resolveDeferredReady();
16884
- this.deps.resolveDeferredReady = null;
16885
- }
17130
+ settleOwnDeferredReady();
16886
17131
  throw err;
16887
17132
  }
16888
17133
  }
16889
17134
  async deferredInitialize(signal) {
17135
+ const epoch = this.currentOrNewStartupEpoch();
17136
+ if (epoch === null) return;
16890
17137
  const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.deps.config);
16891
17138
  if (this.deps.qmd.isAvailable() && resolveQmdCapabilities(this.deps.config).qmdMaintenance) {
16892
17139
  try {
16893
17140
  log.info("QMD startup sync: updating index to match current disk state");
17141
+ const discovery = await this.startupNamespaces(epoch);
17142
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16894
17143
  if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
16895
17144
  await this.deps.namespaceSearchRouter.updateNamespaces(
16896
- await this.deps.maintenanceNamespaces(),
17145
+ discovery.namespaces,
16897
17146
  { signal }
16898
17147
  );
16899
17148
  } else {
16900
17149
  await this.deps.qmd.update({ signal });
16901
17150
  }
17151
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16902
17152
  log.info("QMD startup sync: complete");
16903
- this.deps.deferredSyncSucceeded = true;
17153
+ if (discovery.complete) {
17154
+ this.deps.deferredSyncSucceeded = true;
17155
+ } else {
17156
+ this.deps.deferredSyncSucceeded = false;
17157
+ log.warn("QMD startup sync used configured namespace fallback; retry remains armed");
17158
+ }
16904
17159
  } catch (err) {
16905
17160
  log.warn(`QMD startup sync failed (non-fatal): ${err}`);
16906
17161
  }
@@ -16908,7 +17163,7 @@ var OrchestratorInitCoordinator = class {
16908
17163
  } else {
16909
17164
  this.deps.deferredSyncSucceeded = true;
16910
17165
  }
16911
- if (signal.aborted) return;
17166
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16912
17167
  const warmupPromises = [];
16913
17168
  if (this.deps.qmd.isAvailable()) {
16914
17169
  const warmupNs = this.deps.config.defaultNamespace;
@@ -16933,7 +17188,7 @@ var OrchestratorInitCoordinator = class {
16933
17188
  );
16934
17189
  }
16935
17190
  await Promise.all(warmupPromises);
16936
- if (signal.aborted) return;
17191
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16937
17192
  const cacheWarmups = [];
16938
17193
  if (resolveRecallAuxiliaryCapabilities(this.deps.config).knowledgeIndex) {
16939
17194
  cacheWarmups.push(
@@ -16955,10 +17210,11 @@ var OrchestratorInitCoordinator = class {
16955
17210
  }).catch(() => {
16956
17211
  }));
16957
17212
  await Promise.all(cacheWarmups);
16958
- if (signal.aborted) return;
17213
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16959
17214
  if (resolveIndexingCapabilities(this.deps.config).conversationIndex && this.deps.conversationIndexBackend) {
16960
17215
  try {
16961
17216
  const init = await this.deps.conversationIndexBackend.initialize();
17217
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16962
17218
  if (!init.enabled) {
16963
17219
  this.deps.config.conversationIndexEnabled = false;
16964
17220
  }
@@ -16970,11 +17226,12 @@ var OrchestratorInitCoordinator = class {
16970
17226
  log.debug(init.message);
16971
17227
  }
16972
17228
  } catch (err) {
17229
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16973
17230
  log.error(`Conversation index initialization failed (non-fatal): ${err}`);
16974
17231
  this.deps.config.conversationIndexEnabled = false;
16975
17232
  }
16976
17233
  }
16977
- if (signal.aborted) return;
17234
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16978
17235
  if (resolveLocalLlmCapabilities(this.deps.config).localLlm) {
16979
17236
  try {
16980
17237
  await this.deps.validateLocalLlmModel();
@@ -16982,12 +17239,13 @@ var OrchestratorInitCoordinator = class {
16982
17239
  log.error(`Local LLM validation failed (non-fatal): ${err}`);
16983
17240
  }
16984
17241
  }
16985
- if (signal.aborted) return;
17242
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16986
17243
  await this.deps.maintenanceScheduler.autoRegisterCrons(signal);
16987
- if (signal.aborted) return;
17244
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16988
17245
  if (lifecycleCaps.lifecyclePolicy && resolveQmdCapabilities(this.deps.config).qmdTierMigration) {
16989
17246
  try {
16990
17247
  const { runFirstStartMigration } = await import("./first-start-migration-ZWMV5CX4.js");
17248
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
16991
17249
  const result = await runFirstStartMigration({
16992
17250
  storage: this.deps.storage,
16993
17251
  config: this.deps.config,
@@ -17007,11 +17265,11 @@ var OrchestratorInitCoordinator = class {
17007
17265
  log.warn(`first-start lifecycle migration failed (non-fatal): ${err}`);
17008
17266
  }
17009
17267
  }
17010
- if (signal.aborted) return;
17268
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
17011
17269
  if (!this.deps.wearablesAutoSyncHandle && this.deps.config.wearables.enabled && this.deps.config.wearables.autoSyncEnabled && Object.values(this.deps.config.wearables.sources).some((source) => source.enabled)) {
17012
17270
  try {
17013
- const { startWearablesAutoSync } = await import("./auto-sync-RP4C6ZPF.js");
17014
- if (signal.aborted) return;
17271
+ const { startWearablesAutoSync } = await import("./auto-sync-D6BAPIJV.js");
17272
+ if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
17015
17273
  this.deps.wearablesAutoSyncHandle = startWearablesAutoSync(
17016
17274
  {
17017
17275
  intervalMinutes: this.deps.config.wearables.autoSyncIntervalMinutes,
@@ -17057,33 +17315,58 @@ var OrchestratorInitCoordinator = class {
17057
17315
  */
17058
17316
  async startupSearchSync(signal) {
17059
17317
  if (signal?.aborted) return false;
17060
- const available = await this.deps.qmd.probe();
17318
+ const epoch = this.currentOrNewStartupEpoch();
17319
+ if (epoch === null) return false;
17320
+ const available = await this.probeForStartupEpoch(epoch, signal);
17061
17321
  if (!available) return false;
17062
- if (signal?.aborted) {
17063
- log.debug("startupSearchSync: aborted after probe");
17322
+ if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
17323
+ log.debug("startupSearchSync: aborted or retired after probe");
17064
17324
  return false;
17065
17325
  }
17066
17326
  log.info(`startupSearchSync: backend now available ${this.deps.qmd.debugStatus()}`);
17067
17327
  if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
17068
17328
  this.deps.namespaceSearchRouter.clearCache();
17069
17329
  }
17070
- const namespaces = resolveNamespaceCapabilities(this.deps.config).namespaces ? await this.deps.maintenanceNamespaces() : [this.deps.config.defaultNamespace];
17330
+ const discovery = await this.startupNamespaces(epoch);
17331
+ if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
17332
+ log.debug("startupSearchSync: aborted or retired after namespace discovery");
17333
+ return false;
17334
+ }
17335
+ const namespaces = discovery.namespaces;
17071
17336
  const states = await Promise.all(
17072
- namespaces.map(async (namespace) => ({
17073
- namespace,
17074
- state: resolveNamespaceCapabilities(this.deps.config).namespaces ? await this.deps.namespaceSearchRouter.ensureNamespaceCollection(namespace, { signal }) : await this.deps.qmd.ensureCollection(this.deps.config.memoryDir, this.deps.config.qmdCollection, { signal })
17075
- }))
17337
+ namespaces.map(async (namespace) => {
17338
+ const epochAbort = this.linkedEpochAbortController(epoch, signal);
17339
+ try {
17340
+ return {
17341
+ namespace,
17342
+ state: resolveNamespaceCapabilities(this.deps.config).namespaces ? await this.deps.namespaceSearchRouter.ensureNamespaceCollection(
17343
+ namespace,
17344
+ { signal: epochAbort.controller.signal }
17345
+ ) : await this.deps.qmd.ensureCollection(
17346
+ this.deps.config.memoryDir,
17347
+ this.deps.config.qmdCollection,
17348
+ { signal: epochAbort.controller.signal }
17349
+ )
17350
+ };
17351
+ } finally {
17352
+ epochAbort.dispose();
17353
+ }
17354
+ })
17076
17355
  );
17077
- if (signal?.aborted) {
17078
- log.debug("startupSearchSync: aborted after ensureCollection");
17356
+ if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
17357
+ log.debug("startupSearchSync: aborted or retired after ensureCollection");
17079
17358
  return false;
17080
17359
  }
17081
17360
  const defaultState = states.find((e) => e.namespace === this.deps.config.defaultNamespace)?.state ?? "unknown";
17082
17361
  if (defaultState === "missing") {
17362
+ await this.deps.disposeSearchBackendIfNeeded();
17363
+ if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
17364
+ log.debug("startupSearchSync: aborted or retired while disposing a missing backend");
17365
+ return false;
17366
+ }
17083
17367
  if ("available" in this.deps.qmd) {
17084
17368
  this.deps.qmd.available = false;
17085
17369
  }
17086
- await this.deps.disposeSearchBackendIfNeeded();
17087
17370
  this.deps.qmd = new NoopSearchBackend();
17088
17371
  log.warn("startupSearchSync: search collection missing; disabling search (fallback retrieval remains enabled)");
17089
17372
  return false;
@@ -17096,17 +17379,22 @@ var OrchestratorInitCoordinator = class {
17096
17379
  this.deps.qmd.resetUpdateThrottles();
17097
17380
  }
17098
17381
  log.info("startupSearchSync: updating index to match current disk state");
17382
+ const updateAbort = this.linkedEpochAbortController(epoch, signal);
17099
17383
  let namespacesUpdated = 0;
17100
- if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
17101
- namespacesUpdated = await this.deps.namespaceSearchRouter.updateNamespaces(
17102
- namespaces,
17103
- { signal }
17104
- );
17105
- } else {
17106
- await this.deps.qmd.update({ signal });
17384
+ try {
17385
+ if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
17386
+ namespacesUpdated = await this.deps.namespaceSearchRouter.updateNamespaces(
17387
+ namespaces,
17388
+ { signal: updateAbort.controller.signal }
17389
+ );
17390
+ } else {
17391
+ await this.deps.qmd.update({ signal: updateAbort.controller.signal });
17392
+ }
17393
+ } finally {
17394
+ updateAbort.dispose();
17107
17395
  }
17108
- if (signal?.aborted) {
17109
- log.debug("startupSearchSync: aborted after update");
17396
+ if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
17397
+ log.debug("startupSearchSync: aborted or retired after update");
17110
17398
  return false;
17111
17399
  }
17112
17400
  const failTsAfter = "lastUpdateFailedAtMs" in this.deps.qmd ? this.deps.qmd.lastUpdateFailedAtMs : null;
@@ -17131,15 +17419,24 @@ var OrchestratorInitCoordinator = class {
17131
17419
  return false;
17132
17420
  }
17133
17421
  }
17134
- if (!signal?.aborted) {
17422
+ if (!signal?.aborted && this.isCurrentStartupEpoch(epoch)) {
17423
+ const warmupAbort = this.linkedEpochAbortController(epoch, signal);
17135
17424
  try {
17136
- await this.deps.qmd.search("warmup", this.deps.config.defaultNamespace, 1, void 0, { signal });
17425
+ await this.deps.qmd.search(
17426
+ "warmup",
17427
+ this.deps.config.defaultNamespace,
17428
+ 1,
17429
+ void 0,
17430
+ { signal: warmupAbort.controller.signal }
17431
+ );
17137
17432
  log.info("startupSearchSync: warmup complete");
17138
17433
  } catch (err) {
17139
17434
  log.debug(`startupSearchSync: warmup search failed (non-fatal): ${err}`);
17435
+ } finally {
17436
+ warmupAbort.dispose();
17140
17437
  }
17141
17438
  }
17142
- return true;
17439
+ return discovery.complete;
17143
17440
  }
17144
17441
  };
17145
17442
 
@@ -17490,7 +17787,7 @@ var PersistenceIndexCoordinator = class {
17490
17787
  };
17491
17788
 
17492
17789
  // src/orchestration/workspace-ops.ts
17493
- import { lstat as lstat2, mkdir as mkdir6, readFile as readFile7, readdir as readdir3, realpath as realpath2, writeFile as writeFile6 } from "fs/promises";
17790
+ import { lstat as lstat2, mkdir as mkdir6, readFile as readFile8, readdir as readdir3, realpath as realpath2, writeFile as writeFile6 } from "fs/promises";
17494
17791
  import path18 from "path";
17495
17792
 
17496
17793
  // src/maintenance/pattern-reinforcement.ts
@@ -19492,7 +19789,7 @@ var WorkspaceOpsCoordinator = class {
19492
19789
  for (const rel of hygiene.rotatePaths) {
19493
19790
  const abs = path18.isAbsolute(rel) ? rel : path18.join(this.deps.config.workspaceDir, rel);
19494
19791
  try {
19495
- const raw = await readFile7(abs, "utf-8");
19792
+ const raw = await readFile8(abs, "utf-8");
19496
19793
  if (raw.length > hygiene.rotateMaxBytes) {
19497
19794
  const archiveDir = path18.join(
19498
19795
  this.deps.config.workspaceDir,
@@ -19533,7 +19830,7 @@ var WorkspaceOpsCoordinator = class {
19533
19830
  ` + warnings.map((w) => `- ${w.message}`).join("\n") + "\n";
19534
19831
  let existing = "";
19535
19832
  try {
19536
- existing = await readFile7(fp, "utf-8");
19833
+ existing = await readFile8(fp, "utf-8");
19537
19834
  } catch {
19538
19835
  existing = "# Engram File Hygiene Warnings\n";
19539
19836
  }
@@ -19603,7 +19900,7 @@ var WorkspaceOpsCoordinator = class {
19603
19900
  for (const date of datesToScan) {
19604
19901
  const summaryFile = path18.join(hourlyBaseDir, sk.name, `${date}.md`);
19605
19902
  try {
19606
- const raw = await readFile7(summaryFile, "utf-8");
19903
+ const raw = await readFile8(summaryFile, "utf-8");
19607
19904
  const filtered = filterHourlySummaryMarkdownForLocalDay(
19608
19905
  raw,
19609
19906
  date,
@@ -21001,6 +21298,10 @@ var Orchestrator = class {
21001
21298
  this.deferredInitAbort = null;
21002
21299
  }
21003
21300
  }
21301
+ async disposeSearchBackendIfNeeded() {
21302
+ await this.namespaceSearchRouter.disableSearchBackends();
21303
+ await this.qmd.dispose?.();
21304
+ }
21004
21305
  /** Track a recall-side write so destroy() can wait for it before teardown. @internal */
21005
21306
  trackRecallBackgroundWrite(promise, label) {
21006
21307
  trackRecallWrite(this, promise, label);
@@ -21011,6 +21312,7 @@ var Orchestrator = class {
21011
21312
  * commands should call it before returning to let Node exit naturally.
21012
21313
  */
21013
21314
  async destroy() {
21315
+ this._orchestratorInitCoordinator?.retireStartupEpoch();
21014
21316
  this.abortDeferredInit();
21015
21317
  this.extractionQueueCoordinator.stopAccepting();
21016
21318
  if (this.wearablesAutoSyncHandle) {
@@ -21649,7 +21951,7 @@ var Orchestrator = class {
21649
21951
  utilityPromoteThresholdDelta: this.utilityRuntimeValues?.promoteThresholdDelta ?? 0,
21650
21952
  utilityDemoteThresholdDelta: this.utilityRuntimeValues?.demoteThresholdDelta ?? 0
21651
21953
  };
21652
- return createHash8("sha256").update(JSON.stringify(payload)).digest("hex").slice(0, 12);
21954
+ return createHash9("sha256").update(JSON.stringify(payload)).digest("hex").slice(0, 12);
21653
21955
  }
21654
21956
  effectiveLifecycleThresholds() {
21655
21957
  const archiveDecayThreshold = this.config.lifecycleArchiveDecayThreshold;
@@ -27403,7 +27705,12 @@ async function runTimelineCliCommand(deps, args, io) {
27403
27705
  io.stderr.write("timeline publish requires the Remnic config \u2014 run `remnic doctor`\n");
27404
27706
  return 1;
27405
27707
  }
27406
- const publishFlags = parseFlags(rest, PUBLISH_FLAGS).flags;
27708
+ const { flags: publishFlags, positional } = parseFlags(rest, PUBLISH_FLAGS);
27709
+ if (positional.length > 0) {
27710
+ throw new TypeError(
27711
+ `timeline publish takes no positional arguments (got ${JSON.stringify(positional.join(" "))})`
27712
+ );
27713
+ }
27407
27714
  return runTimelinePublishCli(
27408
27715
  deps.config,
27409
27716
  {
@@ -28481,7 +28788,7 @@ function readVerifiedDailyNote(root, filePath) {
28481
28788
  }
28482
28789
 
28483
28790
  // src/activity/journal-state.ts
28484
- import { createHash as createHash9, randomBytes as randomBytes4 } from "crypto";
28791
+ import { createHash as createHash10, randomBytes as randomBytes4 } from "crypto";
28485
28792
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "fs";
28486
28793
  import path35 from "path";
28487
28794
  var STATE_DIR_NAME = "state";
@@ -28490,7 +28797,7 @@ function timelineStatePath(memoryDir) {
28490
28797
  return path35.join(memoryDir, STATE_DIR_NAME, STATE_FILE_NAME);
28491
28798
  }
28492
28799
  function hashJournalText(text) {
28493
- return createHash9("sha256").update(text, "utf8").digest("hex");
28800
+ return createHash10("sha256").update(text, "utf8").digest("hex");
28494
28801
  }
28495
28802
  function readTimelineState(memoryDir) {
28496
28803
  const filePath = timelineStatePath(memoryDir);
@@ -29211,31 +29518,6 @@ function filterPrivacyWindow(items, options) {
29211
29518
  });
29212
29519
  }
29213
29520
 
29214
- // src/activity/vault-frontmatter.ts
29215
- function assertNoNewlineKey(key) {
29216
- if (key.includes("\n") || key.includes("\r")) {
29217
- throw new RangeError("Vault frontmatter keys must not contain newlines.");
29218
- }
29219
- }
29220
- function applyVaultFrontmatter(existingYaml, updates) {
29221
- const entries = Object.entries(updates);
29222
- if (entries.length === 0) return existingYaml;
29223
- const merged = /* @__PURE__ */ new Map();
29224
- for (const line of existingYaml.split("\n")) {
29225
- const idx = line.indexOf(":");
29226
- if (idx === -1) continue;
29227
- const key = line.slice(0, idx).trim();
29228
- if (key.length === 0) continue;
29229
- assertNoNewlineKey(key);
29230
- merged.set(key, line.slice(idx + 1).trim());
29231
- }
29232
- for (const [key, value] of entries) {
29233
- assertNoNewlineKey(key);
29234
- merged.set(key, value);
29235
- }
29236
- return [...merged.keys()].sort((a, b) => a < b ? -1 : a > b ? 1 : 0).map((key) => `${key}: ${merged.get(key)}`).join("\n");
29237
- }
29238
-
29239
29521
  // src/activity/vault-wikilink.ts
29240
29522
  import path36 from "path";
29241
29523
  function formatVaultWikilink(notePath) {
@@ -29335,8 +29617,8 @@ function planVaultDryRun(inputs) {
29335
29617
  }
29336
29618
 
29337
29619
  // src/session-summaries/index.ts
29338
- import { createHash as createHash10 } from "crypto";
29339
- import { lstat as lstat3, mkdir as mkdir7, readFile as readFile8, readdir as readdir4, rename, rm, stat as stat4, writeFile as writeFile7 } from "fs/promises";
29620
+ import { createHash as createHash11 } from "crypto";
29621
+ import { lstat as lstat3, mkdir as mkdir7, readFile as readFile9, readdir as readdir4, rename, rm, stat as stat4, writeFile as writeFile7 } from "fs/promises";
29340
29622
  import path38 from "path";
29341
29623
 
29342
29624
  // src/session-summaries/adapters.ts
@@ -29837,7 +30119,7 @@ var DEFAULT_MAX_FILES = 5e3;
29837
30119
  var DEFAULT_MAX_SESSIONS = 500;
29838
30120
  var SUPPORTED_EXTENSIONS = /* @__PURE__ */ new Set([".json", ".jsonl"]);
29839
30121
  function shortHash(value, length = 16) {
29840
- return createHash10("sha256").update(value).digest("hex").slice(0, length);
30122
+ return createHash11("sha256").update(value).digest("hex").slice(0, length);
29841
30123
  }
29842
30124
  async function listTranscriptFiles(root, maxFiles) {
29843
30125
  const out = [];
@@ -30031,7 +30313,7 @@ async function collectLocalSessionSummaries(options) {
30031
30313
  });
30032
30314
  }
30033
30315
  for (const filePath of files) {
30034
- const content = await readFile8(filePath, "utf-8");
30316
+ const content = await readFile9(filePath, "utf-8");
30035
30317
  const fileHash = shortHash(content, 24);
30036
30318
  if (seenFileHashes.has(fileHash)) {
30037
30319
  warnings.push({
@@ -30102,7 +30384,7 @@ async function collectLocalSessionSummaries(options) {
30102
30384
  }
30103
30385
  async function readRedactionConfig(pathLike) {
30104
30386
  if (!pathLike) return void 0;
30105
- const raw = await readFile8(path38.resolve(expandTildePath(pathLike)), "utf-8");
30387
+ const raw = await readFile9(path38.resolve(expandTildePath(pathLike)), "utf-8");
30106
30388
  const parsed = JSON.parse(raw);
30107
30389
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
30108
30390
  throw new Error("redaction config must be a JSON object");
@@ -30175,7 +30457,7 @@ async function runLocalSessionSummaryCliCommand(options) {
30175
30457
  }
30176
30458
 
30177
30459
  // src/transfer/capsule-fork.ts
30178
- import { lstat as lstat4, mkdir as mkdir8, readFile as readFile9, realpath as realpath3, writeFile as writeFile8 } from "fs/promises";
30460
+ import { lstat as lstat4, mkdir as mkdir8, readFile as readFile10, realpath as realpath3, writeFile as writeFile8 } from "fs/promises";
30179
30461
  import path39 from "path";
30180
30462
  async function forkCapsule(opts) {
30181
30463
  validateForkId(opts.forkId);
@@ -30237,7 +30519,7 @@ async function readForkLineage(targetRoot, forkId) {
30237
30519
  if (!await isLineagePathContained(rootReal, lineagePath)) {
30238
30520
  return null;
30239
30521
  }
30240
- const raw = await readFile9(lineagePath, "utf-8").catch(() => null);
30522
+ const raw = await readFile10(lineagePath, "utf-8").catch(() => null);
30241
30523
  if (raw === null) return null;
30242
30524
  try {
30243
30525
  const parsed = JSON.parse(raw);
@@ -30431,7 +30713,6 @@ export {
30431
30713
  ACTIVITY_FEATURE_GATES,
30432
30714
  resolveActivityGates,
30433
30715
  filterPrivacyWindow,
30434
- applyVaultFrontmatter,
30435
30716
  formatVaultWikilink,
30436
30717
  stripVaultMdSuffix,
30437
30718
  joinVaultSegments,
@@ -30467,6 +30748,7 @@ export {
30467
30748
  mergeGraphExpandedResults,
30468
30749
  graphPathRelativeToStorage,
30469
30750
  blendGraphExpandedRecallScore,
30751
+ qmdStartupCollectionChecksWithTimeout,
30470
30752
  Orchestrator
30471
30753
  };
30472
- //# sourceMappingURL=chunk-LPYYY4AP.js.map
30754
+ //# sourceMappingURL=chunk-UZ6JYPJ6.js.map