@remnic/core 10.0.167 → 10.0.169

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 (390) hide show
  1. package/dist/access-admin-ops-surface.js +139 -138
  2. package/dist/access-cli.js +139 -138
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-coding-context-resolution.js +11 -11
  5. package/dist/access-extraction-force-flush-preempt.js +139 -138
  6. package/dist/access-extraction-force-flush.js +139 -138
  7. package/dist/access-http-briefing.js +139 -138
  8. package/dist/access-http-query.js +139 -138
  9. package/dist/access-http.js +139 -138
  10. package/dist/access-identity-continuity-surface.js +139 -138
  11. package/dist/access-lcm-surface.js +139 -138
  12. package/dist/access-mcp.js +139 -138
  13. package/dist/access-observe-write-category.js +11 -11
  14. package/dist/access-observe-write-surface.js +139 -138
  15. package/dist/access-offline-manifest.js +9 -9
  16. package/dist/access-operations-batch.js +139 -138
  17. package/dist/access-operations.js +139 -138
  18. package/dist/access-recall-concurrency.js +139 -138
  19. package/dist/access-recall-excerpt-attribution.d.ts +19 -0
  20. package/dist/access-recall-excerpt-attribution.d.ts.map +1 -0
  21. package/dist/access-recall-excerpt-attribution.js +8 -0
  22. package/dist/access-recall-response.js +139 -138
  23. package/dist/access-recall-surface.d.ts.map +1 -1
  24. package/dist/access-recall-surface.js +139 -138
  25. package/dist/access-schema.js +10 -10
  26. package/dist/access-service.js +139 -138
  27. package/dist/active-recall.js +24 -24
  28. package/dist/adapters/index.js +4 -4
  29. package/dist/adapters/registry.js +2 -2
  30. package/dist/{auto-sync-L3M4RKJD.js → auto-sync-ACP5U5A3.js} +3 -3
  31. package/dist/binary-lifecycle/scanner.d.ts +2 -4
  32. package/dist/binary-lifecycle/scanner.d.ts.map +1 -1
  33. package/dist/briefing.js +13 -13
  34. package/dist/buffer-add-turns-bounded.d.ts +11 -1
  35. package/dist/buffer-add-turns-bounded.d.ts.map +1 -1
  36. package/dist/buffer-add-turns-bounded.js +3 -3
  37. package/dist/buffer-session-cap.d.ts +2 -2
  38. package/dist/buffer-session-cap.d.ts.map +1 -1
  39. package/dist/buffer-session-cap.js +1 -1
  40. package/dist/buffer.d.ts +3 -2
  41. package/dist/buffer.d.ts.map +1 -1
  42. package/dist/buffer.js +12 -12
  43. package/dist/bulk-import/index.d.ts +1 -1
  44. package/dist/bulk-import/index.d.ts.map +1 -1
  45. package/dist/bulk-import/index.js +3 -1
  46. package/dist/bulk-import/pipeline.d.ts +8 -0
  47. package/dist/bulk-import/pipeline.d.ts.map +1 -1
  48. package/dist/calibration.d.ts +19 -2
  49. package/dist/calibration.d.ts.map +1 -1
  50. package/dist/calibration.js +28 -5
  51. package/dist/calibration.js.map +1 -1
  52. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  53. package/dist/{capsule-merge-VHBRF65A.js → capsule-merge-BADOICNP.js} +2 -2
  54. package/dist/causal-behavior.js +2 -2
  55. package/dist/causal-chain.js +2 -2
  56. package/dist/causal-consolidation.js +17 -17
  57. package/dist/causal-retrieval.js +2 -2
  58. package/dist/causal-trajectory-graph.js +3 -3
  59. package/dist/causal-trajectory.js +1 -1
  60. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  61. package/dist/{chunk-IE2ZLO3R.js → chunk-32OTLNAU.js} +274 -248
  62. package/dist/chunk-32OTLNAU.js.map +1 -0
  63. package/dist/{chunk-L7SEYUHS.js → chunk-3I3NXB6X.js} +3 -3
  64. package/dist/{chunk-4NBUHYUV.js → chunk-3LADDLAF.js} +5 -5
  65. package/dist/{chunk-2DL3OFLD.js → chunk-45GEJRIG.js} +2 -2
  66. package/dist/{chunk-HSSERO3E.js → chunk-4P4GF76E.js} +8 -1
  67. package/dist/chunk-4P4GF76E.js.map +1 -0
  68. package/dist/{chunk-5BE3FLKL.js → chunk-5KDDAQ6K.js} +8 -8
  69. package/dist/{chunk-BPCR5DZP.js → chunk-62YZOQFR.js} +5 -5
  70. package/dist/chunk-62YZOQFR.js.map +1 -0
  71. package/dist/{chunk-HLWXCDUQ.js → chunk-63A2BU2B.js} +5 -5
  72. package/dist/{chunk-C5QYWM6F.js → chunk-7FPI5MFB.js} +5 -5
  73. package/dist/{chunk-ZX546Y3Y.js → chunk-7OYDFIL4.js} +2 -2
  74. package/dist/{chunk-CKZWLAHN.js → chunk-ACPFBVUD.js} +2 -2
  75. package/dist/{chunk-BKTCVXMK.js → chunk-AHOYKJ5X.js} +3 -3
  76. package/dist/{chunk-WEHSQBFR.js → chunk-AIF6V2OX.js} +9 -4
  77. package/dist/chunk-AIF6V2OX.js.map +1 -0
  78. package/dist/{chunk-FGT7CUYZ.js → chunk-ALTLOHO7.js} +2 -2
  79. package/dist/{chunk-FMFCQRDM.js → chunk-AUFPPBC3.js} +3 -3
  80. package/dist/{chunk-OAQRZ4SV.js → chunk-B5KTTWC7.js} +2 -2
  81. package/dist/{chunk-73TPOGS4.js → chunk-BFBS7OFQ.js} +9 -9
  82. package/dist/{chunk-QFTK6EDM.js → chunk-BFZFNXOC.js} +13 -13
  83. package/dist/{chunk-ZQUOUPP3.js → chunk-BHRPZBAH.js} +4 -4
  84. package/dist/{chunk-4L25GAYL.js → chunk-CX24SVLK.js} +2 -2
  85. package/dist/{chunk-YY57TRKN.js → chunk-D5ZLTLHF.js} +2 -2
  86. package/dist/{chunk-WEFFO2MJ.js → chunk-D6YCETHG.js} +2 -2
  87. package/dist/{chunk-ZDZJNXL6.js → chunk-DK2VBJ6Q.js} +4 -4
  88. package/dist/{chunk-VRHY7Y5A.js → chunk-DPL5VO5V.js} +3 -3
  89. package/dist/{chunk-LVGTH6IQ.js → chunk-E7ATID4Z.js} +11 -11
  90. package/dist/{chunk-CKELO7Q6.js → chunk-FHWX2REL.js} +2 -2
  91. package/dist/{chunk-CUPILBIP.js → chunk-FMIM36I4.js} +2 -2
  92. package/dist/{chunk-OWM2VWNX.js → chunk-FSXYBIEZ.js} +25 -24
  93. package/dist/chunk-FSXYBIEZ.js.map +1 -0
  94. package/dist/{chunk-A5UOREWD.js → chunk-FWTGO4NE.js} +2 -2
  95. package/dist/{chunk-3SL52JKD.js → chunk-FZVROZKC.js} +5 -5
  96. package/dist/{chunk-U3BCW7GX.js → chunk-G3RLCVJC.js} +3 -3
  97. package/dist/{chunk-UYIBNDQE.js → chunk-GF5NN3LE.js} +2 -2
  98. package/dist/{chunk-7OCKK5M5.js → chunk-GWY5ZFHP.js} +6 -6
  99. package/dist/{chunk-AL3TCNSJ.js → chunk-H3MLOQ7F.js} +24 -53
  100. package/dist/chunk-H3MLOQ7F.js.map +1 -0
  101. package/dist/{chunk-TNRGWJYT.js → chunk-H4IU24V5.js} +2 -2
  102. package/dist/{chunk-T4BT4FQN.js → chunk-HH6PXQ2B.js} +3 -3
  103. package/dist/{chunk-FEUWI5QH.js → chunk-HHPY5SSE.js} +2 -2
  104. package/dist/{chunk-OM5ESBES.js → chunk-HQPFACXO.js} +2 -2
  105. package/dist/{chunk-QLQUAVVP.js → chunk-I7WPLMUX.js} +16 -16
  106. package/dist/chunk-I7WPLMUX.js.map +1 -0
  107. package/dist/{chunk-IMULTENA.js → chunk-ID65XTF3.js} +2 -2
  108. package/dist/{chunk-WWQMZBDI.js → chunk-IJVU4ILJ.js} +4 -4
  109. package/dist/{chunk-GBSXTTLP.js → chunk-ITGAGNX5.js} +2 -2
  110. package/dist/chunk-IUGOGDCP.js +39 -0
  111. package/dist/chunk-IUGOGDCP.js.map +1 -0
  112. package/dist/{chunk-3PNJZTDV.js → chunk-JGGNUEVD.js} +2 -2
  113. package/dist/{chunk-YYXYZM2I.js → chunk-JN7OSQJR.js} +2 -2
  114. package/dist/{chunk-4D2EY4WM.js → chunk-K2DTHNDY.js} +6 -6
  115. package/dist/{chunk-TH6OYP6I.js → chunk-K36RMINQ.js} +3 -3
  116. package/dist/{chunk-OZKVVUJB.js → chunk-KIM5VNZN.js} +2 -2
  117. package/dist/{chunk-BFPQJNFZ.js → chunk-LXSDEPEK.js} +60 -11
  118. package/dist/{chunk-BFPQJNFZ.js.map → chunk-LXSDEPEK.js.map} +1 -1
  119. package/dist/{chunk-ZWDDY4WF.js → chunk-M7CFCRWJ.js} +2 -2
  120. package/dist/{chunk-QPFM6DHY.js → chunk-MTJFK42O.js} +2 -2
  121. package/dist/{chunk-RO5EGRAI.js → chunk-N3FRR6II.js} +2 -2
  122. package/dist/{chunk-UMEUU66X.js → chunk-O3OEVYUR.js} +2 -2
  123. package/dist/{chunk-J74YOBB3.js → chunk-PFR6ZKQI.js} +8 -8
  124. package/dist/{chunk-TAD6QMMD.js → chunk-PRC7SZYM.js} +2 -2
  125. package/dist/{chunk-LWZNSQN3.js → chunk-PUQQPLVV.js} +3 -3
  126. package/dist/{chunk-LWZNSQN3.js.map → chunk-PUQQPLVV.js.map} +1 -1
  127. package/dist/{chunk-GMO3BGOF.js → chunk-QC2MHZDD.js} +1 -1
  128. package/dist/{chunk-FOTFLHBN.js → chunk-QPLI7LUU.js} +3 -2
  129. package/dist/chunk-QPLI7LUU.js.map +1 -0
  130. package/dist/{chunk-2MWKUVHT.js → chunk-RK7SE3BL.js} +5 -5
  131. package/dist/{chunk-HDWISXFH.js → chunk-RVAPK2S7.js} +2 -2
  132. package/dist/{chunk-5PUZV73Z.js → chunk-SEIGLG62.js} +11 -11
  133. package/dist/{chunk-AVWOULJH.js → chunk-SH3GOZWK.js} +2 -2
  134. package/dist/{chunk-PFLN6TTW.js → chunk-T3MCVSUC.js} +2 -2
  135. package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
  136. package/dist/{chunk-CLVILSBR.js → chunk-TGQW3AMK.js} +22 -22
  137. package/dist/{chunk-YZYAYUJQ.js → chunk-TLRIRISJ.js} +4 -4
  138. package/dist/{chunk-7VIJUZYW.js → chunk-TQ4CELUR.js} +3 -3
  139. package/dist/{chunk-5QDTZIGH.js → chunk-U7KP6QFU.js} +2 -2
  140. package/dist/{chunk-BUKK5SWA.js → chunk-UPD5XDJX.js} +5 -5
  141. package/dist/{chunk-BUKK5SWA.js.map → chunk-UPD5XDJX.js.map} +1 -1
  142. package/dist/{chunk-QVXEXGIM.js → chunk-VF6SC4OD.js} +2 -2
  143. package/dist/{chunk-EZG54YDS.js → chunk-VKXJQF5C.js} +2 -2
  144. package/dist/{chunk-RFLC6PKQ.js → chunk-VMRPLHEU.js} +2 -2
  145. package/dist/{chunk-U2PSE7MB.js → chunk-VPEIWMUT.js} +2 -2
  146. package/dist/{chunk-X67XNZ64.js → chunk-W4EJMMPP.js} +10 -10
  147. package/dist/{chunk-RB7NXZ2E.js → chunk-W4Q65VJL.js} +2 -2
  148. package/dist/{chunk-HDDRVXX4.js → chunk-W5LJ3SJ7.js} +2 -2
  149. package/dist/{chunk-W7N7NWG5.js → chunk-WCJQ3OUP.js} +2 -2
  150. package/dist/{chunk-JIF22AXI.js → chunk-WGKIXNLY.js} +5 -2
  151. package/dist/{chunk-JIF22AXI.js.map → chunk-WGKIXNLY.js.map} +1 -1
  152. package/dist/{chunk-FFWFFAP3.js → chunk-WI2WTIMY.js} +14 -8
  153. package/dist/chunk-WI2WTIMY.js.map +1 -0
  154. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  155. package/dist/{chunk-22V3CMIW.js → chunk-XJTRIHTH.js} +8 -8
  156. package/dist/{chunk-SIONKXLU.js → chunk-XTRC6SSS.js} +14 -14
  157. package/dist/{chunk-SBRUTD5O.js → chunk-YSATDEBY.js} +5 -5
  158. package/dist/{chunk-3YOX2BQD.js → chunk-YWMCV5HL.js} +3 -3
  159. package/dist/{chunk-L272A5QW.js → chunk-YYDUBGUF.js} +30 -22
  160. package/dist/chunk-YYDUBGUF.js.map +1 -0
  161. package/dist/{chunk-6QWFZ3X5.js → chunk-ZA6CYFAK.js} +2 -2
  162. package/dist/cli.d.ts +1 -6
  163. package/dist/cli.d.ts.map +1 -1
  164. package/dist/cli.js +139 -138
  165. package/dist/coding/export-okf-codegraph.js +24 -24
  166. package/dist/coding/pre-action-gate.js +2 -2
  167. package/dist/compounding/engine.js +14 -14
  168. package/dist/config.js +24 -24
  169. package/dist/connectors/codex-marketplace.d.ts.map +1 -1
  170. package/dist/connectors/codex-materialize-runner.js +14 -14
  171. package/dist/connectors/codex-materialize.d.ts.map +1 -1
  172. package/dist/connectors/codex-materialize.js +1 -1
  173. package/dist/connectors/index.js +15 -15
  174. package/dist/consolidation-provenance-check.js +2 -2
  175. package/dist/convergence-refresh.js +15 -15
  176. package/dist/conversation-index/backend.js +2 -2
  177. package/dist/corpus-watermark.js +15 -15
  178. package/dist/deep-recall-http-glue.js +11 -11
  179. package/dist/embedding-fallback.js +2 -2
  180. package/dist/entity-retrieval.js +14 -14
  181. package/dist/event-order-recall.js +3 -3
  182. package/dist/explicit-capture.js +139 -138
  183. package/dist/extraction-judge.js +1 -1
  184. package/dist/extraction-normalization.js +1 -1
  185. package/dist/extraction-span-materialize.js +2 -2
  186. package/dist/extraction.js +27 -27
  187. package/dist/{graph-edge-decay-BC3IO2J4.js → graph-edge-decay-CXTNJ7IQ.js} +6 -6
  188. package/dist/graph-edge-decay-CXTNJ7IQ.js.map +1 -0
  189. package/dist/graph-jsonl.js +4 -4
  190. package/dist/graph-snapshot.js +4 -4
  191. package/dist/graph.js +5 -5
  192. package/dist/harmonic-retrieval.js +13 -13
  193. package/dist/index.js +198 -197
  194. package/dist/lcm/index.js +3 -3
  195. package/dist/local-llm.js +2 -2
  196. package/dist/location/index.js +14 -14
  197. package/dist/maintenance/memory-governance.js +13 -13
  198. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +13 -13
  199. package/dist/maintenance/rebuild-memory-projection-runner.js +15 -15
  200. package/dist/maintenance/rebuild-memory-projection.js +14 -14
  201. package/dist/memory-browse.js +5 -5
  202. package/dist/memory-controller.d.ts.map +1 -1
  203. package/dist/memory-controller.js +1 -1
  204. package/dist/namespaces/migrate.js +14 -14
  205. package/dist/namespaces/search.js +7 -7
  206. package/dist/namespaces/storage.d.ts.map +1 -1
  207. package/dist/namespaces/storage.js +13 -13
  208. package/dist/offline-sync-changeset-generations.js +4 -4
  209. package/dist/offline-sync-embedding-generation.js +3 -3
  210. package/dist/offline-sync-snapshot-stream.js +7 -7
  211. package/dist/offline-sync.js +6 -6
  212. package/dist/operator-doctor-corpus.js +16 -16
  213. package/dist/operator-toolkit.js +35 -35
  214. package/dist/orchestration/backlog-scheduler.d.ts +4 -0
  215. package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
  216. package/dist/orchestration/backlog-scheduler.js +150 -143
  217. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  218. package/dist/orchestration/buffer-drain-runner.js +140 -139
  219. package/dist/orchestration/extraction-persist-citation.d.ts +2 -2
  220. package/dist/orchestration/extraction-persist-citation.d.ts.map +1 -1
  221. package/dist/orchestration/extraction-persist.d.ts.map +1 -1
  222. package/dist/orchestration/maintenance.js +23 -23
  223. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  224. package/dist/orchestration/turn-ingestion-buffered.d.ts.map +1 -1
  225. package/dist/orchestrator.d.ts.map +1 -1
  226. package/dist/orchestrator.js +141 -140
  227. package/dist/qmd.js +4 -4
  228. package/dist/recall-navigation.js +139 -138
  229. package/dist/recall-state-view-admission.js +5 -5
  230. package/dist/recall-state-view-packet.d.ts.map +1 -1
  231. package/dist/recall-state-view-packet.js +30 -8
  232. package/dist/recall-state-view-packet.js.map +1 -1
  233. package/dist/recall-why-service.js +5 -5
  234. package/dist/reconcile/manifest.js +2 -2
  235. package/dist/resume-bundles.js +25 -25
  236. package/dist/search/factory.js +6 -6
  237. package/dist/search/index.js +8 -8
  238. package/dist/semantic-consolidation.js +18 -18
  239. package/dist/semantic-rule-promotion.js +13 -13
  240. package/dist/semantic-rule-verifier.js +13 -13
  241. package/dist/source-agent-qualifier.js +18 -18
  242. package/dist/source-attribution.d.ts +3 -3
  243. package/dist/source-attribution.d.ts.map +1 -1
  244. package/dist/source-attribution.js +1 -1
  245. package/dist/standup/build.js +13 -13
  246. package/dist/storage.d.ts +1 -0
  247. package/dist/storage.d.ts.map +1 -1
  248. package/dist/storage.js +12 -12
  249. package/dist/summarizer.d.ts +7 -1
  250. package/dist/summarizer.d.ts.map +1 -1
  251. package/dist/summarizer.js +3 -3
  252. package/dist/support-passport/index.js +16 -16
  253. package/dist/transfer/autodetect.js +3 -3
  254. package/dist/transfer/backup.js +2 -2
  255. package/dist/transfer/capsule-export.js +3 -3
  256. package/dist/transfer/capsule-import.js +3 -3
  257. package/dist/transfer/export-okf.js +13 -13
  258. package/dist/transfer/import-json.js +2 -2
  259. package/dist/transfer/import-md.js +2 -2
  260. package/dist/transfer/types.d.ts +15 -3
  261. package/dist/transfer/types.d.ts.map +1 -1
  262. package/dist/transfer/types.js +3 -1
  263. package/dist/verified-recall.js +13 -13
  264. package/dist/who-knows-cli.js +14 -14
  265. package/dist/who-knows.js +13 -13
  266. package/package.json +2 -2
  267. package/src/access-cli.test.ts +9 -9
  268. package/src/access-recall-excerpt-attribution.ts +69 -0
  269. package/src/access-recall-surface.ts +26 -31
  270. package/src/access-service-raw-excerpt-read-gate.test.ts +192 -11
  271. package/src/backlog-scheduler.test.ts +31 -0
  272. package/src/binary-lifecycle/scanner.ts +35 -14
  273. package/src/buffer-add-turns-bounded.ts +16 -2
  274. package/src/buffer-session-cap.ts +4 -4
  275. package/src/buffer.ts +5 -5
  276. package/src/bulk-import/index.ts +1 -0
  277. package/src/bulk-import/pipeline.test.ts +31 -0
  278. package/src/bulk-import/pipeline.ts +14 -0
  279. package/src/calibration.ts +56 -4
  280. package/src/cli.ts +3 -23
  281. package/src/connectors/codex-marketplace-git.test.ts +267 -0
  282. package/src/connectors/codex-marketplace.ts +76 -13
  283. package/src/connectors/codex-materialize.ts +29 -55
  284. package/src/memory-controller.test.ts +11 -0
  285. package/src/memory-controller.ts +5 -1
  286. package/src/namespaces/storage.ts +1 -0
  287. package/src/orchestration/backlog-scheduler.ts +12 -3
  288. package/src/orchestration/extraction-persist-citation.ts +5 -3
  289. package/src/orchestration/extraction-persist.ts +15 -14
  290. package/src/orchestration/recall-internal.ts +2 -3
  291. package/src/orchestration/turn-ingestion-buffered.test.ts +52 -1
  292. package/src/orchestration/turn-ingestion-buffered.ts +26 -8
  293. package/src/orchestrator.ts +1 -0
  294. package/src/recall-state-view-packet.test.ts +40 -0
  295. package/src/recall-state-view-packet.ts +46 -9
  296. package/src/source-attribution.test.ts +57 -0
  297. package/src/source-attribution.ts +46 -43
  298. package/src/storage.ts +4 -3
  299. package/src/summarizer-shutdown.test.ts +49 -16
  300. package/src/summarizer.ts +13 -5
  301. package/src/testing/subjects/memory-maintenance.test.ts +293 -0
  302. package/src/transfer/capsule-export.ts +2 -1
  303. package/src/transfer/capsule-taxonomy-version.test.ts +70 -0
  304. package/src/transfer/types.ts +13 -3
  305. package/dist/chunk-AL3TCNSJ.js.map +0 -1
  306. package/dist/chunk-BPCR5DZP.js.map +0 -1
  307. package/dist/chunk-FFWFFAP3.js.map +0 -1
  308. package/dist/chunk-FOTFLHBN.js.map +0 -1
  309. package/dist/chunk-HSSERO3E.js.map +0 -1
  310. package/dist/chunk-IE2ZLO3R.js.map +0 -1
  311. package/dist/chunk-L272A5QW.js.map +0 -1
  312. package/dist/chunk-OWM2VWNX.js.map +0 -1
  313. package/dist/chunk-QLQUAVVP.js.map +0 -1
  314. package/dist/chunk-WEHSQBFR.js.map +0 -1
  315. /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-recall-excerpt-attribution.js.map} +0 -0
  316. /package/dist/{auto-sync-L3M4RKJD.js.map → auto-sync-ACP5U5A3.js.map} +0 -0
  317. /package/dist/{graph-edge-decay-BC3IO2J4.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  318. /package/dist/{capsule-merge-VHBRF65A.js.map → capsule-merge-BADOICNP.js.map} +0 -0
  319. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  320. /package/dist/{chunk-L7SEYUHS.js.map → chunk-3I3NXB6X.js.map} +0 -0
  321. /package/dist/{chunk-4NBUHYUV.js.map → chunk-3LADDLAF.js.map} +0 -0
  322. /package/dist/{chunk-2DL3OFLD.js.map → chunk-45GEJRIG.js.map} +0 -0
  323. /package/dist/{chunk-5BE3FLKL.js.map → chunk-5KDDAQ6K.js.map} +0 -0
  324. /package/dist/{chunk-HLWXCDUQ.js.map → chunk-63A2BU2B.js.map} +0 -0
  325. /package/dist/{chunk-C5QYWM6F.js.map → chunk-7FPI5MFB.js.map} +0 -0
  326. /package/dist/{chunk-ZX546Y3Y.js.map → chunk-7OYDFIL4.js.map} +0 -0
  327. /package/dist/{chunk-CKZWLAHN.js.map → chunk-ACPFBVUD.js.map} +0 -0
  328. /package/dist/{chunk-BKTCVXMK.js.map → chunk-AHOYKJ5X.js.map} +0 -0
  329. /package/dist/{chunk-FGT7CUYZ.js.map → chunk-ALTLOHO7.js.map} +0 -0
  330. /package/dist/{chunk-FMFCQRDM.js.map → chunk-AUFPPBC3.js.map} +0 -0
  331. /package/dist/{chunk-OAQRZ4SV.js.map → chunk-B5KTTWC7.js.map} +0 -0
  332. /package/dist/{chunk-73TPOGS4.js.map → chunk-BFBS7OFQ.js.map} +0 -0
  333. /package/dist/{chunk-QFTK6EDM.js.map → chunk-BFZFNXOC.js.map} +0 -0
  334. /package/dist/{chunk-ZQUOUPP3.js.map → chunk-BHRPZBAH.js.map} +0 -0
  335. /package/dist/{chunk-4L25GAYL.js.map → chunk-CX24SVLK.js.map} +0 -0
  336. /package/dist/{chunk-YY57TRKN.js.map → chunk-D5ZLTLHF.js.map} +0 -0
  337. /package/dist/{chunk-WEFFO2MJ.js.map → chunk-D6YCETHG.js.map} +0 -0
  338. /package/dist/{chunk-ZDZJNXL6.js.map → chunk-DK2VBJ6Q.js.map} +0 -0
  339. /package/dist/{chunk-VRHY7Y5A.js.map → chunk-DPL5VO5V.js.map} +0 -0
  340. /package/dist/{chunk-LVGTH6IQ.js.map → chunk-E7ATID4Z.js.map} +0 -0
  341. /package/dist/{chunk-CKELO7Q6.js.map → chunk-FHWX2REL.js.map} +0 -0
  342. /package/dist/{chunk-CUPILBIP.js.map → chunk-FMIM36I4.js.map} +0 -0
  343. /package/dist/{chunk-A5UOREWD.js.map → chunk-FWTGO4NE.js.map} +0 -0
  344. /package/dist/{chunk-3SL52JKD.js.map → chunk-FZVROZKC.js.map} +0 -0
  345. /package/dist/{chunk-U3BCW7GX.js.map → chunk-G3RLCVJC.js.map} +0 -0
  346. /package/dist/{chunk-UYIBNDQE.js.map → chunk-GF5NN3LE.js.map} +0 -0
  347. /package/dist/{chunk-7OCKK5M5.js.map → chunk-GWY5ZFHP.js.map} +0 -0
  348. /package/dist/{chunk-TNRGWJYT.js.map → chunk-H4IU24V5.js.map} +0 -0
  349. /package/dist/{chunk-T4BT4FQN.js.map → chunk-HH6PXQ2B.js.map} +0 -0
  350. /package/dist/{chunk-FEUWI5QH.js.map → chunk-HHPY5SSE.js.map} +0 -0
  351. /package/dist/{chunk-OM5ESBES.js.map → chunk-HQPFACXO.js.map} +0 -0
  352. /package/dist/{chunk-IMULTENA.js.map → chunk-ID65XTF3.js.map} +0 -0
  353. /package/dist/{chunk-WWQMZBDI.js.map → chunk-IJVU4ILJ.js.map} +0 -0
  354. /package/dist/{chunk-GBSXTTLP.js.map → chunk-ITGAGNX5.js.map} +0 -0
  355. /package/dist/{chunk-3PNJZTDV.js.map → chunk-JGGNUEVD.js.map} +0 -0
  356. /package/dist/{chunk-YYXYZM2I.js.map → chunk-JN7OSQJR.js.map} +0 -0
  357. /package/dist/{chunk-4D2EY4WM.js.map → chunk-K2DTHNDY.js.map} +0 -0
  358. /package/dist/{chunk-TH6OYP6I.js.map → chunk-K36RMINQ.js.map} +0 -0
  359. /package/dist/{chunk-OZKVVUJB.js.map → chunk-KIM5VNZN.js.map} +0 -0
  360. /package/dist/{chunk-ZWDDY4WF.js.map → chunk-M7CFCRWJ.js.map} +0 -0
  361. /package/dist/{chunk-QPFM6DHY.js.map → chunk-MTJFK42O.js.map} +0 -0
  362. /package/dist/{chunk-RO5EGRAI.js.map → chunk-N3FRR6II.js.map} +0 -0
  363. /package/dist/{chunk-UMEUU66X.js.map → chunk-O3OEVYUR.js.map} +0 -0
  364. /package/dist/{chunk-J74YOBB3.js.map → chunk-PFR6ZKQI.js.map} +0 -0
  365. /package/dist/{chunk-TAD6QMMD.js.map → chunk-PRC7SZYM.js.map} +0 -0
  366. /package/dist/{chunk-GMO3BGOF.js.map → chunk-QC2MHZDD.js.map} +0 -0
  367. /package/dist/{chunk-2MWKUVHT.js.map → chunk-RK7SE3BL.js.map} +0 -0
  368. /package/dist/{chunk-HDWISXFH.js.map → chunk-RVAPK2S7.js.map} +0 -0
  369. /package/dist/{chunk-5PUZV73Z.js.map → chunk-SEIGLG62.js.map} +0 -0
  370. /package/dist/{chunk-AVWOULJH.js.map → chunk-SH3GOZWK.js.map} +0 -0
  371. /package/dist/{chunk-PFLN6TTW.js.map → chunk-T3MCVSUC.js.map} +0 -0
  372. /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
  373. /package/dist/{chunk-CLVILSBR.js.map → chunk-TGQW3AMK.js.map} +0 -0
  374. /package/dist/{chunk-YZYAYUJQ.js.map → chunk-TLRIRISJ.js.map} +0 -0
  375. /package/dist/{chunk-7VIJUZYW.js.map → chunk-TQ4CELUR.js.map} +0 -0
  376. /package/dist/{chunk-5QDTZIGH.js.map → chunk-U7KP6QFU.js.map} +0 -0
  377. /package/dist/{chunk-QVXEXGIM.js.map → chunk-VF6SC4OD.js.map} +0 -0
  378. /package/dist/{chunk-EZG54YDS.js.map → chunk-VKXJQF5C.js.map} +0 -0
  379. /package/dist/{chunk-RFLC6PKQ.js.map → chunk-VMRPLHEU.js.map} +0 -0
  380. /package/dist/{chunk-U2PSE7MB.js.map → chunk-VPEIWMUT.js.map} +0 -0
  381. /package/dist/{chunk-X67XNZ64.js.map → chunk-W4EJMMPP.js.map} +0 -0
  382. /package/dist/{chunk-RB7NXZ2E.js.map → chunk-W4Q65VJL.js.map} +0 -0
  383. /package/dist/{chunk-HDDRVXX4.js.map → chunk-W5LJ3SJ7.js.map} +0 -0
  384. /package/dist/{chunk-W7N7NWG5.js.map → chunk-WCJQ3OUP.js.map} +0 -0
  385. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  386. /package/dist/{chunk-22V3CMIW.js.map → chunk-XJTRIHTH.js.map} +0 -0
  387. /package/dist/{chunk-SIONKXLU.js.map → chunk-XTRC6SSS.js.map} +0 -0
  388. /package/dist/{chunk-SBRUTD5O.js.map → chunk-YSATDEBY.js.map} +0 -0
  389. /package/dist/{chunk-3YOX2BQD.js.map → chunk-YWMCV5HL.js.map} +0 -0
  390. /package/dist/{chunk-6QWFZ3X5.js.map → chunk-ZA6CYFAK.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TBBDFYXW.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-OWM2VWNX.js";
6
+ } from "./chunk-FSXYBIEZ.js";
7
7
  import {
8
8
  requestEntityCanonicalIdReconcile
9
9
  } from "./chunk-KM4QO4LN.js";
@@ -769,4 +769,4 @@ export {
769
769
  listMemoryGovernanceRuns,
770
770
  readMemoryGovernanceRunArtifact
771
771
  };
772
- //# sourceMappingURL=chunk-ZWDDY4WF.js.map
772
+ //# sourceMappingURL=chunk-M7CFCRWJ.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DBB5JPSL.js";
4
4
  import {
5
5
  isGenericRecallExcludedPath
6
- } from "./chunk-YY57TRKN.js";
6
+ } from "./chunk-D5ZLTLHF.js";
7
7
  import {
8
8
  isChangeOrientedQuery
9
9
  } from "./chunk-EH3HNCAM.js";
@@ -69,4 +69,4 @@ export {
69
69
  filterRecentScanMemoriesForStateView,
70
70
  indexStateViewAnnotatedResults
71
71
  };
72
- //# sourceMappingURL=chunk-QPFM6DHY.js.map
72
+ //# sourceMappingURL=chunk-MTJFK42O.js.map
@@ -2,7 +2,7 @@ import {
2
2
  WHO_KNOWS_DEFAULT_LIMIT,
3
3
  WHO_KNOWS_MAX_LIMIT,
4
4
  validateWhoKnowsInput
5
- } from "./chunk-A5UOREWD.js";
5
+ } from "./chunk-FWTGO4NE.js";
6
6
 
7
7
  // src/who-knows-cli.ts
8
8
  function extractWhoKnowsRawArgs(rest) {
@@ -74,4 +74,4 @@ export {
74
74
  renderWhoKnowsText,
75
75
  renderWhoKnows
76
76
  };
77
- //# sourceMappingURL=chunk-RO5EGRAI.js.map
77
+ //# sourceMappingURL=chunk-N3FRR6II.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCategoryForAlias,
3
3
  categoryAliasCoercion
4
- } from "./chunk-ZQUOUPP3.js";
4
+ } from "./chunk-BHRPZBAH.js";
5
5
 
6
6
  // src/access-observe-write-category.ts
7
7
  function splitCanonicalWriteRequest(request) {
@@ -22,4 +22,4 @@ function splitCanonicalWriteRequest(request) {
22
22
  export {
23
23
  splitCanonicalWriteRequest
24
24
  };
25
- //# sourceMappingURL=chunk-UMEUU66X.js.map
25
+ //# sourceMappingURL=chunk-O3OEVYUR.js.map
@@ -5,6 +5,12 @@ import {
5
5
  readEntityIndexStateText,
6
6
  readNativeChunks
7
7
  } from "./chunk-JFMMEHVG.js";
8
+ import {
9
+ checkEntityRecallAbort,
10
+ entityRecallSectionAbsent,
11
+ yieldEntityRecallScan,
12
+ yieldEntityRecallScanEvery
13
+ } from "./chunk-VOLTQNAP.js";
8
14
  import {
9
15
  detectEntityQueryMode,
10
16
  isStructuralEntityFollowUpQuery
@@ -29,15 +35,9 @@ import {
29
35
  buildOriginStructuredSections,
30
36
  sanitizeOriginatedFacts
31
37
  } from "./chunk-GKUA4MGB.js";
32
- import {
33
- checkEntityRecallAbort,
34
- entityRecallSectionAbsent,
35
- yieldEntityRecallScan,
36
- yieldEntityRecallScanEvery
37
- } from "./chunk-VOLTQNAP.js";
38
38
  import {
39
39
  compareEntityTimestamps
40
- } from "./chunk-OWM2VWNX.js";
40
+ } from "./chunk-FSXYBIEZ.js";
41
41
  import {
42
42
  normalizeEntityText,
43
43
  resolveRequestedEntitySectionKeys
@@ -869,4 +869,4 @@ export {
869
869
  entityIndexVersion,
870
870
  entityRecentTranscriptLookbackHours
871
871
  };
872
- //# sourceMappingURL=chunk-J74YOBB3.js.map
872
+ //# sourceMappingURL=chunk-PFR6ZKQI.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OO2HEUZ4.js";
4
4
  import {
5
5
  deepRecallRequestSchema
6
- } from "./chunk-ZQUOUPP3.js";
6
+ } from "./chunk-BHRPZBAH.js";
7
7
  import {
8
8
  EngramAccessInputError
9
9
  } from "./chunk-MGKCKY7X.js";
@@ -40,4 +40,4 @@ async function respondDeepRecall(req, res, respondJson, readJsonBody, service, s
40
40
  export {
41
41
  respondDeepRecall
42
42
  };
43
- //# sourceMappingURL=chunk-TAD6QMMD.js.map
43
+ //# sourceMappingURL=chunk-PRC7SZYM.js.map
@@ -27,10 +27,10 @@ function refuseOverCapBatch(peekEntry, batches, maxTurns) {
27
27
  for (const [bufferKey, incoming] of incomingByKey) {
28
28
  if (heldTurnCount(peekEntry(bufferKey)) + incoming > maxTurns) {
29
29
  warnTurnCapRefused(bufferKey, maxTurns);
30
- return true;
30
+ return bufferKey;
31
31
  }
32
32
  }
33
- return false;
33
+ return null;
34
34
  }
35
35
 
36
36
  export {
@@ -41,4 +41,4 @@ export {
41
41
  refuseOverCapSingle,
42
42
  refuseOverCapBatch
43
43
  };
44
- //# sourceMappingURL=chunk-LWZNSQN3.js.map
44
+ //# sourceMappingURL=chunk-PUQQPLVV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/buffer-session-cap.ts"],"sourcesContent":["/** Per-session retained-turn cap (#3415 bound). Split from buffer.ts (1200-line ratchet). */\nimport { log } from \"./logger.js\";\nimport type { BufferEntryState, BufferTurn } from \"./types.js\";\n\n// Far above the extraction trigger (bufferMaxTurns, default 5), so healthy\n// sessions never touch it. Covers direct constructions predating the knob.\nexport const FALLBACK_MAX_TURNS_PER_SESSION = 200;\n\nexport function resolveMaxTurnsPerSession(configured: number | undefined): number {\n return configured ?? FALLBACK_MAX_TURNS_PER_SESSION;\n}\n\n/** Live turns plus deferred retention copies: one session, one count. */\nexport function heldTurnCount(entry: BufferEntryState | null): number {\n return entry === null ? 0 : (entry.retainedTurns?.length ?? 0) + entry.turns.length;\n}\n\n/** True when held plus incoming exceeds the cap. New keys hold 0. */\nexport function sessionTurnCapReached(entry: BufferEntryState | null, incoming: number, maxTurns: number): boolean {\n return heldTurnCount(entry) + incoming > maxTurns;\n}\n\nfunction warnTurnCapRefused(bufferKey: string, maxTurns: number): void {\n log.warn(`buffer[${bufferKey}]: durable capture refused at the per-session turn cap (${maxTurns})`);\n}\n\n/** Single-turn paths: true means refuse (live path throws, bounded paths return null). */\nexport function refuseOverCapSingle(entry: BufferEntryState | null, maxTurns: number, bufferKey: string): boolean {\n if (!sessionTurnCapReached(entry, 1, maxTurns)) return false;\n warnTurnCapRefused(bufferKey, maxTurns);\n return true;\n}\n\n/** Batch path: sums incoming turns per key across all batches, new keys included. */\nexport function refuseOverCapBatch(\n peekEntry: (key: string) => BufferEntryState | null,\n batches: readonly { bufferKey: string; turns: readonly BufferTurn[] }[],\n maxTurns: number,\n): boolean {\n const incomingByKey = new Map<string, number>();\n for (const batch of batches) incomingByKey.set(batch.bufferKey, (incomingByKey.get(batch.bufferKey) ?? 0) + batch.turns.length);\n for (const [bufferKey, incoming] of incomingByKey) {\n if (heldTurnCount(peekEntry(bufferKey)) + incoming > maxTurns) {\n warnTurnCapRefused(bufferKey, maxTurns);\n return true;\n }\n }\n return false;\n}\n"],"mappings":";;;;;AAMO,IAAM,iCAAiC;AAEvC,SAAS,0BAA0B,YAAwC;AAChF,SAAO,cAAc;AACvB;AAGO,SAAS,cAAc,OAAwC;AACpE,SAAO,UAAU,OAAO,KAAK,MAAM,eAAe,UAAU,KAAK,MAAM,MAAM;AAC/E;AAGO,SAAS,sBAAsB,OAAgC,UAAkB,UAA2B;AACjH,SAAO,cAAc,KAAK,IAAI,WAAW;AAC3C;AAEA,SAAS,mBAAmB,WAAmB,UAAwB;AACrE,MAAI,KAAK,UAAU,SAAS,2DAA2D,QAAQ,GAAG;AACpG;AAGO,SAAS,oBAAoB,OAAgC,UAAkB,WAA4B;AAChH,MAAI,CAAC,sBAAsB,OAAO,GAAG,QAAQ,EAAG,QAAO;AACvD,qBAAmB,WAAW,QAAQ;AACtC,SAAO;AACT;AAGO,SAAS,mBACd,WACA,SACA,UACS;AACT,QAAM,gBAAgB,oBAAI,IAAoB;AAC9C,aAAW,SAAS,QAAS,eAAc,IAAI,MAAM,YAAY,cAAc,IAAI,MAAM,SAAS,KAAK,KAAK,MAAM,MAAM,MAAM;AAC9H,aAAW,CAAC,WAAW,QAAQ,KAAK,eAAe;AACjD,QAAI,cAAc,UAAU,SAAS,CAAC,IAAI,WAAW,UAAU;AAC7D,yBAAmB,WAAW,QAAQ;AACtC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/buffer-session-cap.ts"],"sourcesContent":["/** Per-session retained-turn cap (#3415 bound). Split from buffer.ts (1200-line ratchet). */\nimport { log } from \"./logger.js\";\nimport type { BufferEntryState, BufferTurn } from \"./types.js\";\n\n// Far above the extraction trigger (bufferMaxTurns, default 5), so healthy\n// sessions never touch it. Covers direct constructions predating the knob.\nexport const FALLBACK_MAX_TURNS_PER_SESSION = 200;\n\nexport function resolveMaxTurnsPerSession(configured: number | undefined): number {\n return configured ?? FALLBACK_MAX_TURNS_PER_SESSION;\n}\n\n/** Live turns plus deferred retention copies: one session, one count. */\nexport function heldTurnCount(entry: BufferEntryState | null): number {\n return entry === null ? 0 : (entry.retainedTurns?.length ?? 0) + entry.turns.length;\n}\n\n/** True when held plus incoming exceeds the cap. New keys hold 0. */\nexport function sessionTurnCapReached(entry: BufferEntryState | null, incoming: number, maxTurns: number): boolean {\n return heldTurnCount(entry) + incoming > maxTurns;\n}\n\nfunction warnTurnCapRefused(bufferKey: string, maxTurns: number): void {\n log.warn(`buffer[${bufferKey}]: durable capture refused at the per-session turn cap (${maxTurns})`);\n}\n\n/** Single-turn paths: true means refuse (live path throws, bounded paths return null). */\nexport function refuseOverCapSingle(entry: BufferEntryState | null, maxTurns: number, bufferKey: string): boolean {\n if (!sessionTurnCapReached(entry, 1, maxTurns)) return false;\n warnTurnCapRefused(bufferKey, maxTurns);\n return true;\n}\n\n/** Batch path: sums incoming turns per key across all batches, new keys included. Returns the first over-cap key. */\nexport function refuseOverCapBatch(\n peekEntry: (key: string) => BufferEntryState | null,\n batches: readonly { bufferKey: string; turns: readonly BufferTurn[] }[],\n maxTurns: number,\n): string | null {\n const incomingByKey = new Map<string, number>();\n for (const batch of batches) incomingByKey.set(batch.bufferKey, (incomingByKey.get(batch.bufferKey) ?? 0) + batch.turns.length);\n for (const [bufferKey, incoming] of incomingByKey) {\n if (heldTurnCount(peekEntry(bufferKey)) + incoming > maxTurns) {\n warnTurnCapRefused(bufferKey, maxTurns);\n return bufferKey;\n }\n }\n return null;\n}\n"],"mappings":";;;;;AAMO,IAAM,iCAAiC;AAEvC,SAAS,0BAA0B,YAAwC;AAChF,SAAO,cAAc;AACvB;AAGO,SAAS,cAAc,OAAwC;AACpE,SAAO,UAAU,OAAO,KAAK,MAAM,eAAe,UAAU,KAAK,MAAM,MAAM;AAC/E;AAGO,SAAS,sBAAsB,OAAgC,UAAkB,UAA2B;AACjH,SAAO,cAAc,KAAK,IAAI,WAAW;AAC3C;AAEA,SAAS,mBAAmB,WAAmB,UAAwB;AACrE,MAAI,KAAK,UAAU,SAAS,2DAA2D,QAAQ,GAAG;AACpG;AAGO,SAAS,oBAAoB,OAAgC,UAAkB,WAA4B;AAChH,MAAI,CAAC,sBAAsB,OAAO,GAAG,QAAQ,EAAG,QAAO;AACvD,qBAAmB,WAAW,QAAQ;AACtC,SAAO;AACT;AAGO,SAAS,mBACd,WACA,SACA,UACe;AACf,QAAM,gBAAgB,oBAAI,IAAoB;AAC9C,aAAW,SAAS,QAAS,eAAc,IAAI,MAAM,YAAY,cAAc,IAAI,MAAM,SAAS,KAAK,KAAK,MAAM,MAAM,MAAM;AAC9H,aAAW,CAAC,WAAW,QAAQ,KAAK,eAAe;AACjD,QAAI,cAAc,UAAU,SAAS,CAAC,IAAI,WAAW,UAAU;AAC7D,yBAAmB,WAAW,QAAQ;AACtC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -400,4 +400,4 @@ export {
400
400
  getCausalTrajectoryStoreStatus,
401
401
  searchCausalTrajectories
402
402
  };
403
- //# sourceMappingURL=chunk-GMO3BGOF.js.map
403
+ //# sourceMappingURL=chunk-QC2MHZDD.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-OWM2VWNX.js";
3
+ } from "./chunk-FSXYBIEZ.js";
4
4
  import {
5
5
  keyring_exports,
6
6
  secureStoreDir
@@ -230,6 +230,7 @@ var NamespaceStorageRouter = class {
230
230
  const { scopedCacheInvalidationEnabled } = this.config;
231
231
  StorageManager.setScopedCacheInvalidationDefault(root, scopedCacheInvalidationEnabled);
232
232
  sm.citationTemplate = this.config.inlineSourceAttributionFormat;
233
+ sm.citationTemplateHistory = this.config.inlineSourceAttributionFormatHistory;
233
234
  this.bindCatalogWriteHook(sm, ns);
234
235
  this.applyTombstonesConfig(sm, ns);
235
236
  await this.applySecureStoreConfig(sm);
@@ -416,4 +417,4 @@ export {
416
417
  resolveNamespaceStorageRoot,
417
418
  NamespaceStorageRouter
418
419
  };
419
- //# sourceMappingURL=chunk-FOTFLHBN.js.map
420
+ //# sourceMappingURL=chunk-QPLI7LUU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/namespaces/storage.ts"],"sourcesContent":["import { resolveNamespaceCapabilities, resolveRecallAuxiliaryCapabilities } from \"../capabilities.js\";\nimport path from \"node:path\";\nimport { access, lstat, readdir } from \"node:fs/promises\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport { StorageManager } from \"../storage.js\";\nimport { keyring, secureStoreDir } from \"../secure-store/index.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport { isMacOsReplicationJunkBasename } from \"../utils/macos-replication-junk.js\";\nimport {\n namespaceIdentityLegacyToken,\n namespaceIdentityToken,\n normalizeNamespaceIdentity,\n} from \"./identity.js\";\nimport type { NamespaceCatalog } from \"./catalog.js\";\nimport { MutationSerializer } from \"../utils/serialize-mutations.js\";\n\nasync function exists(p: string): Promise<boolean> {\n try {\n await access(p);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function hasStoredEntries(p: string): Promise<boolean> {\n try {\n const entry = await lstat(p);\n if (entry.isSymbolicLink()) return true;\n if (!entry.isDirectory()) return true;\n const children = await readdir(p, { withFileTypes: true });\n for (const child of children) {\n if (isMacOsReplicationJunkBasename(child.name)) continue;\n const childPath = path.join(p, child.name);\n if (child.isSymbolicLink() || child.isFile()) return true;\n if (child.isDirectory() && (await hasStoredEntries(childPath))) return true;\n }\n return false;\n } catch {\n return false;\n }\n}\n\n// Build a per-namespace directory under `<memoryDir>/namespaces` and assert the\n// resolved path stays inside that base. Namespace identifiers can originate from\n// operator config (config.defaultNamespace) and request-derived routing, so this\n// containment check prevents directory traversal (CodeQL js/path-injection).\n// For safe segments this returns exactly `path.join(base, segment)`, so there is\n// no behavioral change for valid namespaces.\nfunction resolveNamespaceDir(memoryDir: string, segment: string): string {\n // Mirror isSafeRouteNamespace's separator/parent-ref rejection (without its\n // 64-char cap, so identity tokens still pass). Rejecting separators and \"..\"\n // up front keeps the value a single contained child of <memoryDir>/namespaces.\n if (\n segment.length === 0 ||\n segment.includes(\"/\") ||\n segment.includes(\"\\\\\") ||\n segment.includes(\"..\") ||\n path.isAbsolute(segment)\n ) {\n throw new Error(`unsafe namespace path segment: ${segment}`);\n }\n return path.join(memoryDir, \"namespaces\", segment);\n}\n\nconst LEGACY_NAMESPACE_CONTENT_CHILDREN = [\n ...ALL_CATEGORY_DIRS,\n \"entities\",\n \"artifacts\",\n \"identity\",\n \"config\",\n \"summaries\",\n \"profile.md\",\n] as const;\n\nconst LEGACY_NAMESPACE_RUNTIME_CHILDREN = [\"state\"] as const;\n\nasync function hasAnyLegacyData(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await hasStoredEntries(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\nasync function hasAnyNamespaceStorageMarker(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await exists(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\n/**\n * Storage routing for namespaces.\n *\n * Compatibility note:\n * - When namespaces are enabled, existing raw namespace roots are preserved.\n * New namespace roots use tokenized names under `memoryDir/namespaces/<token>`.\n * - The default namespace continues to use the legacy `memoryDir` root unless the caller\n * has created `memoryDir/namespaces/<defaultNamespace>` (in which case we use that).\n *\n * This avoids surprising \"lost memories\" when an install flips namespaces on without\n * migrating existing data.\n */\n/**\n * Optional hooks for the storage router. `onResolve` fires whenever a namespace's\n * storage is resolved/created, so a downstream consumer (e.g. the namespace\n * catalog, issue #1499) can register the namespace. The hook MUST NOT throw into\n * the router; the router invokes it defensively and a hook failure never affects\n * storage resolution.\n *\n * The hook MAY return (or resolve to) a boolean indicating whether the\n * registration actually PERSISTED (round 6, codex P2 — NEFoX). When it resolves\n * to `false` (a dropped/no-op registration), the router does NOT mark the\n * (namespace, storageDir) pair as notified, so the next resolve RETRIES it\n * instead of suppressing it forever. A `void`/`undefined` result is treated as\n * success (legacy hooks).\n */\nexport interface NamespaceStorageRouterHooks {\n onResolve?: (\n namespace: string,\n storageDir: string,\n ) => void | boolean | Promise<void | boolean>;\n}\n\n/**\n * Resolve the runtime storage root for the configured DEFAULT namespace.\n *\n * Shared between the live router (`NamespaceStorageRouter.defaultNamespaceRoot`)\n * and the rebuildable catalog (`NamespaceCatalog.rebuildFromDisk`) so the two\n * can never diverge (CLAUDE.md rule #22/#42 — read & write paths resolve through\n * the same logic). The contract is: while legacy memory data still lives\n * directly under `memoryDir`, the default root stays `memoryDir`; only once the\n * legacy root is empty and a `namespaces/<default|token>` dir holds data does\n * the default migrate into that tokenized/legacy-named dir.\n */\nexport async function resolveDefaultNamespaceRoot(config: PluginConfig): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) {\n return config.memoryDir;\n }\n\n // Build the legacy default root from the NORMALIZED (trimmed) name so a\n // whitespace-padded `defaultNamespace` still finds the live `namespaces/default`\n // root (NIabe). `storageFor()` classifies the trimmed value as the default, and\n // the on-disk legacy dir is created under the trimmed name; using the raw spaced\n // name here would look for `namespaces/<spaced>` and miss the real root, falling\n // back to memoryDir/tokenized. `namespaceIdentityToken` already normalizes\n // internally, so the tokenized path is unaffected.\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const defaultNfdIdentity = defaultIdentity.normalize(\"NFD\");\n const legacyNsDir = resolveNamespaceDir(config.memoryDir, defaultIdentity);\n const legacyNfdNsDir = resolveNamespaceDir(config.memoryDir, defaultNfdIdentity);\n const tokenizedNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityToken(defaultIdentity),\n );\n const legacyTokenNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityLegacyToken(defaultNfdIdentity),\n );\n const tokenizedHasData =\n (await exists(tokenizedNsDir)) &&\n (await hasAnyNamespaceStorageMarker(tokenizedNsDir, { includeRuntimeState: true }));\n const legacyTokenHasData =\n (await exists(legacyTokenNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyTokenNsDir, { includeRuntimeState: true }));\n const legacyHasData =\n (await exists(legacyNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNsDir, { includeRuntimeState: true }));\n const legacyNfdHasData =\n legacyNfdNsDir !== legacyNsDir &&\n (await exists(legacyNfdNsDir)) &&\n (await hasAnyNamespaceStorageMarker(legacyNfdNsDir, { includeRuntimeState: true }));\n const nsDir = tokenizedHasData\n ? tokenizedNsDir\n : legacyTokenHasData\n ? legacyTokenNsDir\n : legacyHasData\n ? legacyNsDir\n : legacyNfdHasData\n ? legacyNfdNsDir\n : (await exists(legacyNsDir))\n ? legacyNsDir\n : legacyNfdNsDir !== legacyNsDir && (await exists(legacyNfdNsDir))\n ? legacyNfdNsDir\n : tokenizedNsDir;\n return (await exists(nsDir)) && !(await hasAnyLegacyData(config.memoryDir))\n ? nsDir\n : config.memoryDir;\n}\n\n/**\n * Resolve the runtime storage root for ANY namespace exactly as the live router\n * would (`NamespaceStorageRouter.namespaceRoot`). Shared so the rebuildable\n * catalog records the SAME on-disk root the router routes to — a recall/read\n * touch must not guess `namespaces/<token>` when the router actually serves a\n * legacy raw-name dir or a migrated default root (CLAUDE.md rule #22/#42; round\n * 4, cursor Medium). The default namespace delegates to `resolveDefaultNamespaceRoot`;\n * every other namespace prefers the tokenized root when it has a storage marker,\n * else a legacy raw-name dir when present, else the tokenized root.\n */\nexport async function resolveNamespaceStorageRoot(\n config: PluginConfig,\n namespace: string,\n): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) return config.memoryDir;\n // Compare on NORMALIZED identity so a whitespace-padded configured default name\n // still routes to the default root rather than a tokenized non-default dir\n // (NH-FH). The catalog keys records by the same normalized identity.\n if (normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(config.defaultNamespace)) {\n return resolveDefaultNamespaceRoot(config);\n }\n const normalized = normalizeNamespaceIdentity(namespace);\n const legacyExactNamespace = namespace.trim();\n const legacyNfdNamespace = normalized.normalize(\"NFD\");\n const legacyRoot = resolveNamespaceDir(config.memoryDir, normalized);\n const legacyExactRoot =\n legacyExactNamespace !== normalized && isSafeRouteNamespace(legacyExactNamespace)\n ? resolveNamespaceDir(config.memoryDir, legacyExactNamespace)\n : null;\n const legacyNfdRoot =\n legacyNfdNamespace !== normalized\n ? resolveNamespaceDir(config.memoryDir, legacyNfdNamespace)\n : null;\n const tokenizedRoot = resolveNamespaceDir(config.memoryDir, namespaceIdentityToken(normalized));\n const legacyTokenRoots = [\n namespaceIdentityLegacyToken(legacyExactNamespace),\n namespaceIdentityLegacyToken(legacyNfdNamespace),\n ]\n .filter((token, index, tokens) => tokens.indexOf(token) === index)\n .map((token) => resolveNamespaceDir(config.memoryDir, token));\n for (const candidate of [tokenizedRoot, ...legacyTokenRoots]) {\n if (\n (await exists(candidate)) &&\n (await hasAnyNamespaceStorageMarker(candidate, { includeRuntimeState: true }))\n ) {\n return candidate;\n }\n }\n for (const candidate of [legacyRoot, legacyExactRoot, legacyNfdRoot]) {\n if (candidate && (await exists(candidate))) return candidate;\n }\n return tokenizedRoot;\n}\n\nexport class NamespaceStorageRouter {\n private readonly cache = new Map<string, StorageManager>();\n private defaultNsRootResolved: string | null = null;\n // Dedup the resolve hook (round 6, cursor Medium — NCNL2). Recall/extraction\n // call `storageFor` repeatedly; firing `onResolve` (→ catalog loadCompacted +\n // append) on every cache hit grows `namespaces.jsonl` without bound between\n // rebuilds. We fire the hook only when the (namespace, storageDir) pair is new\n // or its dir changed, so a steady-state cache hit is a no-op for the catalog.\n private readonly notifiedResolved = new Map<string, string>();\n // Instance-scoped serializer for the resolve hook (issue #1524 adoption).\n // Replaces the bespoke `inFlightResolved` marker-then-clear pattern: the\n // serializer's per-key chain strictly orders concurrent notifications for the\n // SAME namespace, and the task re-checks `notifiedResolved` once it runs, so a\n // burst of cache hits before the first hook settles collapses to a single\n // hook invocation (the once-per-namespace intent). Recovery is preserved —\n // one rejected hook never poisons subsequent notifications for that key.\n private readonly resolveSerializer = new MutationSerializer();\n // (namespace, storageDir) pairs whose resolve hook is currently pending. Set SYNCHRONOUSLY in\n // notifyResolved (before queueing) so a burst of concurrent storageFor()\n // cache hits collapses onto the one in-flight hook instead of each enqueuing\n // its own task. Cleared when the queued hook settles. Without this, a dropped\n // hook (returns false on a rebuild-lock timeout) leaves notifiedResolved\n // unset, so every queued sibling task would re-run the hook — N serial lock\n // waits (cursor Medium 06f58a7c, codex P2).\n private readonly inFlightResolveHooks = new Set<string>();\n // Tracks every in-flight resolve-hook promise so callers can deterministically\n // await the fire-and-forget registrations that `storageFor()` kicks off (see\n // `whenResolveHooksSettled`). Entries are removed as each hook settles, so the\n // set holds at most one promise per concurrently-resolving namespace.\n private readonly pendingResolveHooks = new Set<Promise<unknown>>();\n // Pending post-write catalog touch promises (#1522). Like pendingResolveHooks,\n // lets tests await fire-and-forget write touches deterministically.\n private readonly pendingWriteTouches = new Set<Promise<unknown>>();\n\n // Normalized (trimmed) default namespace identity (NH-FH). `storageFor`\n // normalizes its input, so default-namespace branches must compare against the\n // normalized config default too — otherwise a whitespace-padded configured\n // default name routes the default namespace to a tokenized non-default root.\n private readonly defaultNamespaceIdentity: string;\n\n /** #2019: hook fired when a new namespace storage is created via storageFor. */\n onStorageCreated?: (storage: StorageManager, namespace: string) => void;\n\n constructor(\n private readonly config: PluginConfig,\n private readonly hooks: NamespaceStorageRouterHooks = {},\n /** Catalog reference for post-write/read touches (issue #1522 chokepoint). */\n private readonly catalog?: NamespaceCatalog,\n ) {\n this.defaultNamespaceIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n }\n\n private async defaultNamespaceRoot(): Promise<string> {\n this.defaultNsRootResolved = await resolveDefaultNamespaceRoot(this.config);\n return this.defaultNsRootResolved;\n }\n\n private async namespaceRoot(namespace: string): Promise<string> {\n // NOTE: only used after defaultNamespaceRoot() resolution.\n if (!resolveNamespaceCapabilities(this.config).namespaces) return this.config.memoryDir;\n if (normalizeNamespaceIdentity(namespace) === this.defaultNamespaceIdentity) {\n return this.defaultNsRootResolved ?? this.config.memoryDir;\n }\n return resolveNamespaceStorageRoot(this.config, namespace);\n }\n\n async storageFor(namespace: string): Promise<StorageManager> {\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n if (ns !== this.defaultNamespaceIdentity && !isSafeRouteNamespace(ns)) {\n throw new Error(`unsafe namespace: ${ns}`);\n }\n // Even when the default namespace is exempt from the check above, every\n // on-disk path is built through resolveNamespaceDir(), which rejects\n // traversal segments — so an unsafe configured default still cannot escape\n // <memoryDir>/namespaces (CodeQL js/path-injection).\n\n let root: string;\n if (ns === this.defaultNamespaceIdentity) {\n root = await this.defaultNamespaceRoot();\n const cached = this.cache.get(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n } else {\n const cached = this.cache.get(ns);\n root = await this.namespaceRoot(ns);\n if (cached && cached.dir === root) {\n await this.applySecureStoreConfig(cached);\n this.notifyResolved(ns, root);\n return cached;\n }\n }\n\n // Pass the hot-memories cache gate explicitly (issue #1902, Codex P2): a\n // per-namespace child root is never registered in the per-dir default map,\n // so without this it would fall back to the process-wide default and ignore\n // THIS daemon's hotMemoriesCacheEnabled config. Threading it from config\n // keeps every namespace storage aligned with its owning orchestrator.\n const sm = new StorageManager(\n root,\n this.config.entitySchemas,\n this.config.hotMemoriesCacheEnabled,\n );\n // Register this child root's gate AND TTL in the per-dir maps (issue #1902,\n // Codex P2). The constructor override above fixes the child's own gate, but\n // its TTL is resolved via the per-dir map (hotCacheTtlMs); an unregistered\n // child root would fall back to the last process-wide TTL and could inherit\n // another daemon's value. Registering keyed by root keeps both per-dir.\n StorageManager.setHotMemoriesCacheDefault(\n root,\n this.config.hotMemoriesCacheEnabled,\n this.config.hotMemoriesCacheTtlMs,\n );\n const { scopedCacheInvalidationEnabled } = this.config;\n StorageManager.setScopedCacheInvalidationDefault(root, scopedCacheInvalidationEnabled);\n // Propagate the inline-attribution template so that router-created storages\n // (used by extraction and shared-promotion paths) strip citations consistently,\n // matching the behaviour of the primary this.storage instance in the orchestrator.\n sm.citationTemplate = this.config.inlineSourceAttributionFormat;\n sm.citationTemplateHistory = this.config.inlineSourceAttributionFormatHistory;\n // #1522: install the post-write catalog touch at the chokepoint — every\n // successful write on this StorageManager records the namespace touch.\n this.bindCatalogWriteHook(sm, ns);\n // #1579: apply the tombstone non-resurrection config so every namespace\n // storage enforces the invariant at its own writeMemory chokepoint.\n this.applyTombstonesConfig(sm, ns);\n // #2033: install the secure-store context on router-created stores. The\n // orchestrator keys ONLY its primary default-namespace storage; without\n // this, a store resolved through the router reads isSecureStoreUnlocked()\n // === false even after the operator unlocked the keyring, so secure-store\n // recovery paths (e.g. the CLI lifecycle-ledger rebuild) refuse an encrypted\n // ledger they could actually rewrite, and namespace writes could silently\n // fall back to plaintext. Mirror the orchestrator's setup exactly.\n await this.applySecureStoreConfig(sm);\n this.cache.set(ns, sm);\n // #2019: let the orchestrator wire write-triggered prioritized embedding on\n // every router-created namespace storage, not just the primary default store.\n this.onStorageCreated?.(sm, ns);\n this.notifyResolved(ns, root);\n return sm;\n }\n\n /**\n * Fire the resolve hook defensively. A hook failure (e.g. a catalog write\n * error) MUST NOT crash storage resolution — see CLAUDE.md gotcha #13.\n *\n * Issue #1524 adoption: hook invocations for the SAME namespace are now\n * strictly ordered through the shared `MutationSerializer` rather than the\n * bespoke `inFlightResolved` marker-then-clear pattern. The serializer\n * guarantees one in-flight hook per namespace; a concurrent burst of\n * `storageFor()` cache hits collapses to a single hook invocation because\n * each queued task re-checks `notifiedResolved` before invoking the hook. A\n * dropped (`false`) or rejected hook leaves `notifiedResolved` unset so the\n * next `storageFor()` retries — the serializer recovers from the rejection,\n * so a failed hook never poisons later notifications.\n */\n private notifyResolved(namespace: string, storageDir: string): void {\n const hook = this.hooks.onResolve;\n if (!hook) return;\n // Permanent dedup: skip once we've SUCCESSFULLY notified this exact\n // (namespace, storageDir). A changed dir (rare: migration/realignment)\n // still re-fires once. The mark is set ONLY AFTER the hook succeeds, so a\n // dropped registration (e.g. rebuild-lock timeout) is RETRIED on the next\n // cache hit instead of being suppressed forever (round 6, cursor Medium —\n // ND3EJ).\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n // In-flight dedup (cursor Medium 06f58a7c, codex P2): if a hook for THIS\n // namespace is already pending, collapse this call onto it instead of\n // enqueueing another task. The serializer strictly orders queued tasks, but\n // ordering alone is not enough — when the first hook returns `false`\n // (dropped touch, e.g. rebuild-lock timeout), `notifiedResolved` stays\n // unset, so each queued sibling task would pass its re-check and re-run the\n // hook. With the real catalog hook each retry can spend the full lock wait,\n // so N cache hits during a rebuild leave N serial background lock attempts.\n // Collapsing here means at most ONE hook runs per in-flight registration;\n // its result (set `notifiedResolved` on success, leave unset on drop)\n // decides whether a LATER `storageFor()` retries — collapsing loses\n // nothing because the drop is already retried on the next cache hit.\n // Keyed by the composite (namespace, storageDir) so a CHANGED dir\n // (migration/realignment) for the same namespace still gets its own hook —\n // it is NOT collapsed onto the old dir's pending registration (cursor\n // Medium, codex P2).\n const inFlightKey = namespace + \"\\u0000\" + storageDir;\n if (this.inFlightResolveHooks.has(inFlightKey)) return;\n this.inFlightResolveHooks.add(inFlightKey);\n // Queue through the serializer. Concurrent calls for the same namespace\n // strictly order here; the 2nd call's task runs only after the 1st's hook\n // settles, by which point `notifiedResolved` is either set (no-op) or still\n // unset (retry). The returned promise is tracked for\n // `whenResolveHooksSettled()`. Rejections from the task body are caught so\n // they never reach the caller (best-effort hook contract); the serializer's\n // recovered tail still lets subsequent notifications run.\n const task = async (): Promise<void> => {\n // Re-check after queueing: a prior task in this same chain may have just\n // marked the pair as notified.\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n try {\n // Hook may be sync or async; Promise.resolve normalizes both. A result\n // of `false` means the registration was dropped/no-op (e.g. rebuild-lock\n // timeout) — leave notifiedResolved UNSET so the next storageFor retries\n // (round 6, codex P2 — NEFoX). `void`/`undefined` is success for legacy\n // hooks. A rejection leaves notifiedResolved unset for the same reason.\n const persisted = await Promise.resolve(hook(namespace, storageDir));\n if (persisted !== false) {\n this.notifiedResolved.set(namespace, storageDir);\n }\n } catch {\n // Best-effort: a hook failure MUST NOT crash storage resolution. Leave\n // notifiedResolved unset so a later storageFor retries the registration.\n }\n };\n const queued = this.resolveSerializer.serialize(namespace, task);\n this.pendingResolveHooks.add(queued);\n // Clear the in-flight marker when the hook settles so a subsequent\n // storageFor() can retry after a drop, or short-circuit via notifiedResolved\n // after a success.\n const cleanup = (): void => {\n this.inFlightResolveHooks.delete(inFlightKey);\n this.pendingResolveHooks.delete(queued);\n };\n void queued.then(cleanup, cleanup);\n }\n\n /**\n * Install the post-write catalog touch hook on an externally-constructed\n * StorageManager (issue #1522). Used by the orchestrator for the legacy\n * default-namespace storage (`this.storage`) that bypasses the router.\n */\n bindCatalogWriteHook(sm: StorageManager, namespace: string): void {\n // Issue #1903: pure state-file writes only touch the catalog when explicitly\n // opted in. Router-created storages (storageFor) and the legacy default\n // storage both flow through here, so this is the single wiring point.\n sm.touchStateWrites = this.config.namespacesCatalogTouchStateWrites === true;\n sm.onCatalogWrite = () => this.touchCatalogWrite(namespace, sm.dir);\n }\n\n /**\n * Install the tombstone config on an externally-constructed StorageManager\n * (issue #1579). Mirrors `bindCatalogWriteHook` — used for the legacy\n * default-namespace storage that bypasses the router. Router-created\n * storages are wired inline in `storageFor()` via `applyTombstonesConfig`.\n */\n bindTombstonesConfig(\n sm: StorageManager,\n namespace: string,\n config: { enabled: boolean; semanticMatch: boolean; semanticThreshold: number },\n ): void {\n this.tombstonesGlobalConfig = { ...config };\n sm.setTombstonesConfig({ ...config, namespace });\n }\n\n private tombstonesGlobalConfig: {\n enabled: boolean;\n semanticMatch: boolean;\n semanticThreshold: number;\n } = { enabled: false, semanticMatch: false, semanticThreshold: 0.9 };\n\n /**\n * Apply the tombstone config to a router-created StorageManager. Called\n * inline in `storageFor()` so every namespace storage enforces the\n * non-resurrection invariant, namespace-scoped (rule 42).\n */\n private applyTombstonesConfig(sm: StorageManager, namespace: string): void {\n sm.setTombstonesConfig({ ...this.tombstonesGlobalConfig, namespace });\n }\n\n /**\n * Install the at-rest secure-store context on a router-created StorageManager\n * (#2033). Mirrors the orchestrator's primary-storage setup: mark the store\n * required so a locked store throws instead of silently writing plaintext, and\n * install the master key when the process-local keyring already holds it (the\n * operator unlocked). The secure store is one key per memory ROOT (single\n * header + per-file path-bound AAD), so every namespace store keys off the\n * root keyring id — exactly the id the orchestrator and `secure-store unlock`\n * register under. No-op when secure-store is disabled.\n */\n private async applySecureStoreConfig(sm: StorageManager): Promise<void> {\n if (!resolveRecallAuxiliaryCapabilities(this.config).secureStore) return;\n sm.setSecureStoreRequired(true);\n const existingKey = keyring.getKey(secureStoreDir(this.config.memoryDir));\n if (existingKey) {\n await sm.setSecureStoreKeyAndWait(existingKey, this.config.secureStoreEncryptOnWrite);\n }\n }\n\n /**\n * Post-write catalog touch (issue #1522 chokepoint). Called by every\n * StorageManager's post-write hook AFTER a successful write. Best-effort\n * and failure-tolerant — a catalog error MUST NOT affect the primary write\n * (gotcha #13, rule #40). Fire-and-forget by design.\n */\n private touchCatalogWrite(namespace: string, storageDir: string): void {\n if (!this.catalog) return;\n const touch = this.catalog\n .markWrite(namespace, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Record a namespace read in the catalog (issue #1522 chokepoint move).\n * Best-effort and failure-tolerant. Used by recall paths so the read touch\n * lives in the storage layer, not at the caller.\n */\n recordRead(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n void this.catalog\n .markRead(ns, { discoveredBy: \"read\", storageDir })\n .catch(() => undefined);\n }\n /**\n * Record a namespace write touch in the catalog (issue #1522). Best-effort\n * and failure-tolerant. Used by consolidation/cleanup passes that may mutate\n * the store via delete-only paths (e.g. entity-file merges, TTL cleanup) so\n * the namespace's lastWriteAt stays fresh even when no explicit write went\n * through the storage chokepoint. This is NOT a substitute for the chokepoint\n * — it's a belt-and-suspenders for paths the chokepoint doesn't cover.\n */\n recordWrite(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n const touch = this.catalog\n .markWrite(ns, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Resolve once every in-flight post-write catalog touch has settled (#1522).\n * Mirrors `whenResolveHooksSettled()`: the StorageManager's post-write hook\n * fires the catalog touch fire-and-forget, so tests asserting lastWriteAt\n * moved should await this instead of racing a timer.\n */\n async whenWriteTouchesSettled(): Promise<void> {\n // Flush any coalesced (buffered) touches first so their appends join the\n // pending set below — otherwise this could resolve while a buffered touch's\n // lastWriteAt is still unwritten on disk (#1903, Cursor). No-op when\n // coalescing is disabled (window 0) or the catalog is inert.\n await this.catalog?.flushPendingTouches().catch(() => undefined);\n while (this.pendingWriteTouches.size > 0) {\n await Promise.allSettled([...this.pendingWriteTouches]);\n }\n }\n\n /**\n * Resolve once every in-flight `onResolve` registration has settled.\n *\n * `storageFor()` fires the resolve hook fire-and-forget, so its catalog side\n * effect (e.g. `registerResolved(...)`) is not observable the moment\n * `storageFor()` returns. Callers that must act on that side effect — notably\n * tests asserting the catalog was updated — should await this instead of\n * racing a timer. Resolves immediately when no hook is registered or nothing\n * is in flight. The loop re-checks because a settling hook could, in\n * principle, trigger a follow-on resolution.\n */\n async whenResolveHooksSettled(): Promise<void> {\n while (this.pendingResolveHooks.size > 0) {\n await Promise.allSettled([...this.pendingResolveHooks]);\n }\n }\n\n /**\n * #2019: iterate the currently cached router storages with their namespace so\n * callers can wire hooks on stores resolved before the hook was installed.\n */\n forEachCachedStorage(fn: (storage: StorageManager, namespace: string) => void): void {\n for (const [namespace, storage] of this.cache) fn(storage, namespace);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,QAAQ,OAAO,eAAe;AAevC,eAAe,OAAO,GAA6B;AACjD,MAAI;AACF,UAAM,OAAO,CAAC;AACd,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,iBAAiB,GAA6B;AAC3D,MAAI;AACF,UAAM,QAAQ,MAAM,MAAM,CAAC;AAC3B,QAAI,MAAM,eAAe,EAAG,QAAO;AACnC,QAAI,CAAC,MAAM,YAAY,EAAG,QAAO;AACjC,UAAM,WAAW,MAAM,QAAQ,GAAG,EAAE,eAAe,KAAK,CAAC;AACzD,eAAW,SAAS,UAAU;AAC5B,UAAI,+BAA+B,MAAM,IAAI,EAAG;AAChD,YAAM,YAAY,KAAK,KAAK,GAAG,MAAM,IAAI;AACzC,UAAI,MAAM,eAAe,KAAK,MAAM,OAAO,EAAG,QAAO;AACrD,UAAI,MAAM,YAAY,KAAM,MAAM,iBAAiB,SAAS,EAAI,QAAO;AAAA,IACzE;AACA,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAQA,SAAS,oBAAoB,WAAmB,SAAyB;AAIvE,MACE,QAAQ,WAAW,KACnB,QAAQ,SAAS,GAAG,KACpB,QAAQ,SAAS,IAAI,KACrB,QAAQ,SAAS,IAAI,KACrB,KAAK,WAAW,OAAO,GACvB;AACA,UAAM,IAAI,MAAM,kCAAkC,OAAO,EAAE;AAAA,EAC7D;AACA,SAAO,KAAK,KAAK,WAAW,cAAc,OAAO;AACnD;AAEA,IAAM,oCAAoC;AAAA,EACxC,GAAG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K,QAAS;AACnB,UAAM,KAAK,2BAA2B,aAAa,KAAK,OAAO,gBAAgB;AAC/E,UAAM,QAAQ,KAAK,QAChB,UAAU,IAAI,EAAE,cAAc,SAAS,WAAW,CAAC,EACnD,MAAM,MAAM,MAAS;AACxB,SAAK,oBAAoB,IAAI,KAAK;AAClC,SAAK,MAAM;AAAA,MACT,MAAM;AAAE,aAAK,oBAAoB,OAAO,KAAK;AAAA,MAAG;AAAA,MAChD,MAAM;AAAE,aAAK,oBAAoB,OAAO,KAAK;AAAA,MAAG;AAAA,IAClD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,0BAAyC;AAK7C,UAAM,KAAK,SAAS,oBAAoB,EAAE,MAAM,MAAM,MAAS;AAC/D,WAAO,KAAK,oBAAoB,OAAO,GAAG;AACxC,YAAM,QAAQ,WAAW,CAAC,GAAG,KAAK,mBAAmB,CAAC;AAAA,IACxD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,0BAAyC;AAC7C,WAAO,KAAK,oBAAoB,OAAO,GAAG;AACxC,YAAM,QAAQ,WAAW,CAAC,GAAG,KAAK,mBAAmB,CAAC;AAAA,IACxD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,qBAAqB,IAAgE;AACnF,eAAW,CAAC,WAAW,OAAO,KAAK,KAAK,MAAO,IAAG,SAAS,SAAS;AAAA,EACtE;AACF;","names":[]}
@@ -4,6 +4,10 @@ import {
4
4
  import {
5
5
  getVerdictKind
6
6
  } from "./chunk-LMJVP5CM.js";
7
+ import {
8
+ collectPersonEntityRefs,
9
+ isHighImpactPersonalFact
10
+ } from "./chunk-QW27DOHG.js";
7
11
  import {
8
12
  applyCorrections,
9
13
  applyOffTheRecord,
@@ -27,10 +31,6 @@ import {
27
31
  countRecallTokenOverlap,
28
32
  normalizeRecallTokens
29
33
  } from "./chunk-YCVB7X56.js";
30
- import {
31
- collectPersonEntityRefs,
32
- isHighImpactPersonalFact
33
- } from "./chunk-QW27DOHG.js";
34
34
  import {
35
35
  fillWearableConversationLocations
36
36
  } from "./chunk-DF4BC5MK.js";
@@ -1344,4 +1344,4 @@ export {
1344
1344
  syncWearableSource,
1345
1345
  defaultTimezone
1346
1346
  };
1347
- //# sourceMappingURL=chunk-2MWKUVHT.js.map
1347
+ //# sourceMappingURL=chunk-RK7SE3BL.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raceRecallAbort,
3
3
  throwIfRecallAborted
4
- } from "./chunk-ZX546Y3Y.js";
4
+ } from "./chunk-7OYDFIL4.js";
5
5
  import {
6
6
  emitExtractionLlmFailureError,
7
7
  recordExtractionLlmFailure,
@@ -1183,4 +1183,4 @@ export {
1183
1183
  ExtractionDeadlineError,
1184
1184
  ExtractionRunCoordinator
1185
1185
  };
1186
- //# sourceMappingURL=chunk-HDWISXFH.js.map
1186
+ //# sourceMappingURL=chunk-RVAPK2S7.js.map
@@ -6,16 +6,16 @@ import {
6
6
  headerConnector,
7
7
  renderExtractionConversation,
8
8
  resolveSourceConnector
9
- } from "./chunk-U3BCW7GX.js";
9
+ } from "./chunk-G3RLCVJC.js";
10
10
  import {
11
11
  normalizeReasoningTrace
12
12
  } from "./chunk-54V4BZWP.js";
13
- import {
14
- ProfilingCollector
15
- } from "./chunk-DOWACHYO.js";
16
13
  import {
17
14
  shouldRunProactivePass
18
15
  } from "./chunk-2CGLBUW3.js";
16
+ import {
17
+ ProfilingCollector
18
+ } from "./chunk-DOWACHYO.js";
19
19
  import {
20
20
  ModelRegistry
21
21
  } from "./chunk-QNUNAXBE.js";
@@ -38,7 +38,7 @@ import {
38
38
  buildSpanMaterializeTurns,
39
39
  stripUntrustedFactSpans,
40
40
  truncateLocalExtractionConversation
41
- } from "./chunk-3SL52JKD.js";
41
+ } from "./chunk-FZVROZKC.js";
42
42
  import {
43
43
  attachExtractionProvenance
44
44
  } from "./chunk-ULLGI6XR.js";
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-7G5NTS7F.js";
76
76
  import {
77
77
  LocalLlmClient
78
- } from "./chunk-QFTK6EDM.js";
78
+ } from "./chunk-BFZFNXOC.js";
79
79
  import {
80
80
  CONSOLIDATION_RESPONSE_SCHEMA,
81
81
  CUE_ANCHOR_PROMPT_INSTRUCTION,
@@ -88,6 +88,10 @@ import {
88
88
  extractionResponseShape,
89
89
  spanModePromptSection
90
90
  } from "./chunk-YN2DQ2D6.js";
91
+ import {
92
+ AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT,
93
+ clampAmbientCaptureConfidence
94
+ } from "./chunk-QW27DOHG.js";
91
95
  import {
92
96
  looksLikeMechanicalTelemetryTranscript
93
97
  } from "./chunk-4RA3C3EV.js";
@@ -105,10 +109,6 @@ import {
105
109
  import {
106
110
  fallbackLlmRuntimeContextFromConfig
107
111
  } from "./chunk-QSF5SJAM.js";
108
- import {
109
- AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT,
110
- clampAmbientCaptureConfidence
111
- } from "./chunk-QW27DOHG.js";
112
112
  import {
113
113
  extractJsonCandidates
114
114
  } from "./chunk-YBA52OKG.js";
@@ -2458,4 +2458,4 @@ export {
2458
2458
  shouldEnableLocalExtractionThinking,
2459
2459
  ExtractionEngine
2460
2460
  };
2461
- //# sourceMappingURL=chunk-5PUZV73Z.js.map
2461
+ //# sourceMappingURL=chunk-SEIGLG62.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSearchBackend
3
- } from "./chunk-7OCKK5M5.js";
3
+ } from "./chunk-GWY5ZFHP.js";
4
4
  import {
5
5
  reportSearchDegradation
6
6
  } from "./chunk-B7HYXVME.js";
@@ -572,4 +572,4 @@ export {
572
572
  normalizeQmdResultPath,
573
573
  resolveNamespaceResultPath
574
574
  };
575
- //# sourceMappingURL=chunk-AVWOULJH.js.map
575
+ //# sourceMappingURL=chunk-SH3GOZWK.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-B7RWBZXW.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-OWM2VWNX.js";
6
+ } from "./chunk-FSXYBIEZ.js";
7
7
  import {
8
8
  countRecallTokenOverlap,
9
9
  normalizeRecallTokens
@@ -109,4 +109,4 @@ export {
109
109
  compareVerifiedEpisodeResults,
110
110
  searchVerifiedEpisodes
111
111
  };
112
- //# sourceMappingURL=chunk-PFLN6TTW.js.map
112
+ //# sourceMappingURL=chunk-T3MCVSUC.js.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ failOpenFaissHealth
3
+ } from "./chunk-F4TWWUMP.js";
1
4
  import {
2
5
  rebuildConversationChunksFailOpen,
3
6
  upsertConversationChunksFailOpen
@@ -6,9 +9,6 @@ import {
6
9
  searchConversationIndex,
7
10
  searchConversationIndexFaissFailOpen
8
11
  } from "./chunk-A7Q43EUZ.js";
9
- import {
10
- failOpenFaissHealth
11
- } from "./chunk-F4TWWUMP.js";
12
12
 
13
13
  // src/conversation-index/backend.ts
14
14
  function createConversationIndexBackend(options) {
@@ -235,4 +235,4 @@ function createFaissBackend(getFaiss) {
235
235
  export {
236
236
  createConversationIndexBackend
237
237
  };
238
- //# sourceMappingURL=chunk-WQUGCOKF.js.map
238
+ //# sourceMappingURL=chunk-TFA6HPOA.js.map
@@ -9,25 +9,10 @@ import {
9
9
  writeOfflineUploadChunk,
10
10
  writeSafeFileFromUpload
11
11
  } from "./chunk-XXR4A33N.js";
12
- import {
13
- OFFLINE_SYNC_FAST_BASE_MTIME_TOLERANCE_MS,
14
- OfflineSyncCensusRaceError,
15
- SYNC_INTERNAL_DIR,
16
- assertOfflineSyncMtimeMs,
17
- censusRaceAsChangedWhileBuilding,
18
- changedWhileBuildingChangesetError,
19
- isEncryptedOfflineSyncFile,
20
- offlineSyncRegularFilePresent,
21
- plainFileDigest,
22
- readPlainOfflineSyncFileChunk,
23
- setSafeFileMtime,
24
- sha256OfflineSyncFile,
25
- shouldExcludeOfflineSyncFile
26
- } from "./chunk-UWMZT2TY.js";
27
12
  import {
28
13
  applyChangesetEmbeddingGenerations,
29
14
  normalizeChangesetGenerations
30
- } from "./chunk-HLWXCDUQ.js";
15
+ } from "./chunk-63A2BU2B.js";
31
16
  import {
32
17
  advanceEmbeddingGenerationMarker,
33
18
  applyIncomingEmbeddingGenerations,
@@ -37,22 +22,37 @@ import {
37
22
  embeddingGenerationMembership,
38
23
  isEmbeddingGenerationDirPath,
39
24
  isPathInOmittedEmbeddingGeneration
40
- } from "./chunk-5BE3FLKL.js";
25
+ } from "./chunk-5KDDAQ6K.js";
41
26
  import {
42
27
  isEmbeddingGenerationMarkerPath,
43
28
  matchesOfflineSyncDefaultExclude
44
29
  } from "./chunk-63LFM77Z.js";
45
30
  import {
46
- isCanonicalRuntimeStatePath,
47
- shouldDeleteAbsentIncomingOfflineRuntimeFile,
48
- shouldPreferIncomingOfflineRuntimeFile
49
- } from "./chunk-LDWE7OZS.js";
31
+ OFFLINE_SYNC_FAST_BASE_MTIME_TOLERANCE_MS,
32
+ OfflineSyncCensusRaceError,
33
+ SYNC_INTERNAL_DIR,
34
+ assertOfflineSyncMtimeMs,
35
+ censusRaceAsChangedWhileBuilding,
36
+ changedWhileBuildingChangesetError,
37
+ isEncryptedOfflineSyncFile,
38
+ offlineSyncRegularFilePresent,
39
+ plainFileDigest,
40
+ readPlainOfflineSyncFileChunk,
41
+ setSafeFileMtime,
42
+ sha256OfflineSyncFile,
43
+ shouldExcludeOfflineSyncFile
44
+ } from "./chunk-UWMZT2TY.js";
50
45
  import {
51
46
  prepareSafeArchiveRoot,
52
47
  resolveSafeArchiveTarget,
53
48
  sha256Bytes,
54
49
  validateArchiveRelativePath
55
50
  } from "./chunk-GCGJW34D.js";
51
+ import {
52
+ isCanonicalRuntimeStatePath,
53
+ shouldDeleteAbsentIncomingOfflineRuntimeFile,
54
+ shouldPreferIncomingOfflineRuntimeFile
55
+ } from "./chunk-LDWE7OZS.js";
56
56
  import {
57
57
  withEmbeddingGenerationLock,
58
58
  withEmbeddingGenerationLockIter
@@ -1847,4 +1847,4 @@ export {
1847
1847
  normalizeOfflineSyncState,
1848
1848
  fileStatesFromSnapshot
1849
1849
  };
1850
- //# sourceMappingURL=chunk-CLVILSBR.js.map
1850
+ //# sourceMappingURL=chunk-TGQW3AMK.js.map
@@ -1,10 +1,10 @@
1
+ import {
2
+ sidecarKey
3
+ } from "./chunk-E5QI6C6C.js";
1
4
  import {
2
5
  DERIVED_FROM_MEMORY_ID_RE,
3
6
  isConsolidationOperator
4
7
  } from "./chunk-G7D6GZ5J.js";
5
- import {
6
- sidecarKey
7
- } from "./chunk-E5QI6C6C.js";
8
8
  import {
9
9
  isMacOsReplicationJunkBasename
10
10
  } from "./chunk-QUIRIG2P.js";
@@ -346,4 +346,4 @@ function isPathWithin(candidate, root) {
346
346
  export {
347
347
  runConsolidationProvenanceCheck
348
348
  };
349
- //# sourceMappingURL=chunk-YZYAYUJQ.js.map
349
+ //# sourceMappingURL=chunk-TLRIRISJ.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  listMemoryGovernanceRuns,
6
6
  readMemoryGovernanceRunArtifact
7
- } from "./chunk-ZWDDY4WF.js";
7
+ } from "./chunk-M7CFCRWJ.js";
8
8
  import {
9
9
  loadPersistedNativeKnowledgeChunks
10
10
  } from "./chunk-2DQ2XREU.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-OWM2VWNX.js";
13
+ } from "./chunk-FSXYBIEZ.js";
14
14
  import {
15
15
  normalizeProjectionPreview,
16
16
  normalizeProjectionTags
@@ -1156,4 +1156,4 @@ export {
1156
1156
  verifyMemoryProjection,
1157
1157
  repairMemoryProjection
1158
1158
  };
1159
- //# sourceMappingURL=chunk-7VIJUZYW.js.map
1159
+ //# sourceMappingURL=chunk-TQ4CELUR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listNamespaces
3
- } from "./chunk-3YOX2BQD.js";
3
+ } from "./chunk-YWMCV5HL.js";
4
4
  import {
5
5
  corpusScanWorker
6
6
  } from "./chunk-4LZ7SVKM.js";
@@ -292,4 +292,4 @@ export {
292
292
  computeServiceCorpusWatermarks,
293
293
  computeServiceCorpusCensus
294
294
  };
295
- //# sourceMappingURL=chunk-5QDTZIGH.js.map
295
+ //# sourceMappingURL=chunk-U7KP6QFU.js.map
@@ -1,12 +1,12 @@
1
+ import {
2
+ encryptCapsuleFile
3
+ } from "./chunk-X7Y7WX73.js";
1
4
  import {
2
5
  CAPSULE_ID_PATTERN,
3
6
  CapsuleBlockSchema,
4
7
  ExportBundleV2Schema,
5
8
  ExportManifestV2Schema
6
- } from "./chunk-WEHSQBFR.js";
7
- import {
8
- encryptCapsuleFile
9
- } from "./chunk-UVYI6VIX.js";
9
+ } from "./chunk-AIF6V2OX.js";
10
10
  import {
11
11
  CAPSULE_SCHEMA_VERSION,
12
12
  EXPORT_FORMAT
@@ -261,4 +261,4 @@ export {
261
261
  exportCapsule,
262
262
  isValidCapsuleSince
263
263
  };
264
- //# sourceMappingURL=chunk-BUKK5SWA.js.map
264
+ //# sourceMappingURL=chunk-UPD5XDJX.js.map