@remnic/core 9.3.684 → 9.3.686

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 (315) hide show
  1. package/dist/access-boundary.d.ts +4 -3
  2. package/dist/access-boundary.js +23 -23
  3. package/dist/access-cli.js +152 -71
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +3 -2
  6. package/dist/access-http.js +26 -26
  7. package/dist/access-mcp.d.ts +14 -3
  8. package/dist/access-mcp.js +25 -25
  9. package/dist/access-operations.d.ts +10 -4
  10. package/dist/access-operations.js +26 -24
  11. package/dist/access-schema.d.ts +4 -4
  12. package/dist/{access-service-D-siI-xJ.d.ts → access-service-DmCHJ4cH.d.ts} +106 -39
  13. package/dist/access-service.d.ts +3 -2
  14. package/dist/access-service.js +22 -22
  15. package/dist/access-surface-catalog.d.ts +3 -2
  16. package/dist/access-surface-catalog.js +2 -0
  17. package/dist/access-surface-catalog.js.map +1 -1
  18. package/dist/active-recall.js +2 -2
  19. package/dist/{auto-sync-5CJBJMPZ.js → auto-sync-NUQWSFQD.js} +7 -7
  20. package/dist/bootstrap.d.ts +2 -1
  21. package/dist/bootstrap.js +2 -2
  22. package/dist/boxes.js +2 -2
  23. package/dist/briefing.js +3 -3
  24. package/dist/buffer.js +2 -2
  25. package/dist/calibration.js +4 -4
  26. package/dist/catalog-COqWZlZ6.d.ts +456 -0
  27. package/dist/causal-behavior.js +4 -4
  28. package/dist/causal-chain.js +4 -4
  29. package/dist/causal-consolidation.js +11 -11
  30. package/dist/causal-retrieval.js +4 -4
  31. package/dist/causal-trajectory-graph.js +1 -1
  32. package/dist/causal-trajectory.js +1 -1
  33. package/dist/{chunk-ROHLEUTH.js → chunk-2KAYTPPT.js} +10 -10
  34. package/dist/{chunk-NHQGDVJF.js → chunk-2SJCWLQD.js} +3 -3
  35. package/dist/{chunk-YTWNKQ2G.js → chunk-3FC6LW6T.js} +2 -2
  36. package/dist/{chunk-5OE4PYY5.js → chunk-473JIN2U.js} +61 -11
  37. package/dist/chunk-473JIN2U.js.map +1 -0
  38. package/dist/{chunk-XEA4Z7JU.js → chunk-4FE2K57M.js} +3 -3
  39. package/dist/{chunk-WI7JKV2T.js → chunk-4N3TFFPH.js} +2 -2
  40. package/dist/{chunk-BTVX7ZXZ.js → chunk-4NFVPDIL.js} +4 -4
  41. package/dist/{chunk-OUWAQVDJ.js → chunk-5CEJH5ZN.js} +2 -2
  42. package/dist/{chunk-6QM24CP7.js → chunk-6GJS4BFH.js} +2 -2
  43. package/dist/{chunk-J2FBJ63F.js → chunk-6O6A6YUO.js} +4 -4
  44. package/dist/{chunk-HQ6NIBL6.js → chunk-7FL4CNPV.js} +2 -2
  45. package/dist/{chunk-5VDJMYTF.js → chunk-7WWURLG6.js} +3 -3
  46. package/dist/{chunk-QWRC7GIO.js → chunk-A4HH2EWA.js} +5 -5
  47. package/dist/{chunk-4SKKVWLQ.js → chunk-AGJH5ISO.js} +2 -2
  48. package/dist/{chunk-2L3KLWOV.js → chunk-B43NZNMG.js} +54 -92
  49. package/dist/chunk-B43NZNMG.js.map +1 -0
  50. package/dist/{chunk-WRE3JPAW.js → chunk-B4XVLHJA.js} +3 -3
  51. package/dist/{chunk-53FDU4CE.js → chunk-BLIWOONZ.js} +39 -36
  52. package/dist/chunk-BLIWOONZ.js.map +1 -0
  53. package/dist/{chunk-AJU4PJGY.js → chunk-BVKCV2ZY.js} +2 -2
  54. package/dist/{chunk-DQY7NJ5L.js → chunk-CTOQEZSN.js} +2 -2
  55. package/dist/{chunk-7OGJQP7T.js → chunk-DCWIQFNA.js} +4 -4
  56. package/dist/{chunk-MHQC2WU2.js → chunk-DKTSR7EK.js} +2 -2
  57. package/dist/{chunk-RN7MUWON.js → chunk-EHISUJFN.js} +2 -2
  58. package/dist/{chunk-WLEB7WCG.js → chunk-EO5QWINU.js} +2 -2
  59. package/dist/{chunk-XKXKSQU7.js → chunk-EXM3CQTZ.js} +2 -2
  60. package/dist/{chunk-M3FWYURP.js → chunk-FE6DQUNJ.js} +9 -9
  61. package/dist/{chunk-LCC5EZTT.js → chunk-FIVDN2SM.js} +4 -4
  62. package/dist/{chunk-3MY4W5V4.js → chunk-FUCUR2OZ.js} +550 -63
  63. package/dist/chunk-FUCUR2OZ.js.map +1 -0
  64. package/dist/{chunk-452WDNFO.js → chunk-GG6AJN7A.js} +2 -2
  65. package/dist/{chunk-2IBGHRIO.js → chunk-GS55WYRL.js} +3 -3
  66. package/dist/{chunk-IBTZEBUD.js → chunk-HYNHLBKA.js} +2 -2
  67. package/dist/{chunk-EVWIEEKZ.js → chunk-IQ7WCZRW.js} +2 -2
  68. package/dist/{chunk-B5XMS73R.js → chunk-IQVQJJL7.js} +2 -2
  69. package/dist/{chunk-6RHNCKHG.js → chunk-K43PI6DQ.js} +2 -2
  70. package/dist/{chunk-OIF36KGD.js → chunk-KCQA46NR.js} +2 -2
  71. package/dist/{chunk-2LDBXPLB.js → chunk-KF74X62T.js} +1 -1
  72. package/dist/{chunk-3EVIMVQU.js → chunk-KFBOZYME.js} +42 -3
  73. package/dist/chunk-KFBOZYME.js.map +1 -0
  74. package/dist/{chunk-MAV46GWQ.js → chunk-KYYL4U6X.js} +2 -2
  75. package/dist/{chunk-6GC5SGFE.js → chunk-L24JROPR.js} +2 -2
  76. package/dist/{chunk-Q5ZU3RNY.js → chunk-LQ6JI4VH.js} +2 -2
  77. package/dist/{chunk-GWKCEM3S.js → chunk-MCQDSY4G.js} +3 -3
  78. package/dist/{chunk-HP5FMB6L.js → chunk-MDJURR27.js} +2 -2
  79. package/dist/{chunk-FYEVFGJD.js → chunk-NN7QYW5W.js} +2 -2
  80. package/dist/chunk-NN7QYW5W.js.map +1 -0
  81. package/dist/{chunk-2ODBA7MQ.js → chunk-NU3CSQ4H.js} +5 -5
  82. package/dist/chunk-NU3CSQ4H.js.map +1 -0
  83. package/dist/{chunk-T2PO5MUF.js → chunk-O7GOFAM3.js} +2 -2
  84. package/dist/{chunk-Z2OXSMZK.js → chunk-OBXTMFZQ.js} +3 -3
  85. package/dist/{chunk-K6ZN34WC.js → chunk-OV4D5T7V.js} +3 -3
  86. package/dist/{chunk-OMLIFZ4I.js → chunk-PH3HOKYW.js} +2 -2
  87. package/dist/{chunk-C3IW2F5Z.js → chunk-PLBIPT6I.js} +2 -2
  88. package/dist/{chunk-QY7YA7OL.js → chunk-PNLCEFE4.js} +2 -2
  89. package/dist/{chunk-AGRPGAKR.js → chunk-PONNZ54D.js} +2 -2
  90. package/dist/{chunk-XZ4WBBB5.js → chunk-PWFWCGOO.js} +2 -2
  91. package/dist/{chunk-XWEXT4XU.js → chunk-QANVLERJ.js} +4 -4
  92. package/dist/{chunk-W4RVMTHR.js → chunk-QRDOSYOR.js} +2 -2
  93. package/dist/{chunk-OXNOINIP.js → chunk-QVMXQGT7.js} +24 -24
  94. package/dist/chunk-QVMXQGT7.js.map +1 -0
  95. package/dist/{chunk-6IMKOIZ6.js → chunk-R6OVFAX6.js} +2 -2
  96. package/dist/{chunk-5N5DXYDW.js → chunk-S2OU5DZY.js} +31 -10
  97. package/dist/chunk-S2OU5DZY.js.map +1 -0
  98. package/dist/{chunk-JOASJWQR.js → chunk-SANZHXY2.js} +2 -2
  99. package/dist/{chunk-7DTASS5T.js → chunk-SJHM6I4J.js} +2 -2
  100. package/dist/{chunk-M6BVYHBU.js → chunk-STOEE37X.js} +4 -4
  101. package/dist/{chunk-GKKAXVAJ.js → chunk-U33LWTQQ.js} +1 -7
  102. package/dist/chunk-U33LWTQQ.js.map +1 -0
  103. package/dist/{chunk-LXH3DIF2.js → chunk-U7D7NP4J.js} +2 -2
  104. package/dist/{chunk-DRD2Q7HQ.js → chunk-UFS7OXGL.js} +2 -2
  105. package/dist/{chunk-H3HDXD3U.js → chunk-UPTZYUYJ.js} +2 -2
  106. package/dist/{chunk-3Z7NPD5T.js → chunk-UTYBJR7M.js} +2 -2
  107. package/dist/{chunk-LN4YGHTM.js → chunk-UUH4YQOF.js} +2 -2
  108. package/dist/{chunk-6VF75M3X.js → chunk-VGUOEDTU.js} +2 -2
  109. package/dist/{chunk-44VFF3BB.js → chunk-VILEUJXC.js} +2 -2
  110. package/dist/{chunk-7SI52C65.js → chunk-VL7DP3OW.js} +2 -2
  111. package/dist/{chunk-7DHTMOND.js → chunk-VQ34TERH.js} +2 -2
  112. package/dist/{chunk-6VMIHVGO.js → chunk-VX6OBUDW.js} +2 -2
  113. package/dist/{chunk-EW5KFXHL.js → chunk-WDXCNJSF.js} +7 -7
  114. package/dist/{chunk-FMEKEF47.js → chunk-WIHPNY65.js} +79 -3
  115. package/dist/chunk-WIHPNY65.js.map +1 -0
  116. package/dist/{chunk-X6IRLNOO.js → chunk-WIWPSQYU.js} +2 -2
  117. package/dist/{chunk-DOCTITOP.js → chunk-WRFKZEO6.js} +2 -2
  118. package/dist/{chunk-E6ZDCOHM.js → chunk-XBZQRZ6G.js} +2 -2
  119. package/dist/{chunk-7YX23JBA.js → chunk-XHYGJVXL.js} +2 -2
  120. package/dist/{chunk-JD4SCARD.js → chunk-YN4ZT4CW.js} +1 -1
  121. package/dist/{chunk-YXWAILM4.js → chunk-YOI3ELXF.js} +2 -2
  122. package/dist/{chunk-XCAZF7KQ.js → chunk-ZA2S2VLL.js} +2 -2
  123. package/dist/{chunk-BEUDU7Y4.js → chunk-ZCWIH4LH.js} +2 -2
  124. package/dist/{chunk-V25ZAOSB.js → chunk-ZPTISBQU.js} +5 -5
  125. package/dist/{cli-ooj6JQBS.d.ts → cli-D8nZ2MPH.d.ts} +2 -2
  126. package/dist/cli.d.ts +4 -3
  127. package/dist/cli.js +44 -44
  128. package/dist/compounding/engine.js +4 -4
  129. package/dist/compounding/preference-consolidator.js +1 -1
  130. package/dist/config.js +2 -2
  131. package/dist/connectors/codex-materialize-runner.js +4 -4
  132. package/dist/connectors/codex-materialize.js +2 -2
  133. package/dist/connectors/index.js +5 -5
  134. package/dist/contradiction/index.js +3 -3
  135. package/dist/{contradiction-scan-AZTGFMPY.js → contradiction-scan-HWGEOUDS.js} +3 -3
  136. package/dist/conversation-index/backend.js +5 -5
  137. package/dist/conversation-index/cleanup.js +2 -2
  138. package/dist/conversation-index/faiss-adapter.js +2 -2
  139. package/dist/conversation-index/indexer.js +2 -2
  140. package/dist/conversation-index/search.js +2 -2
  141. package/dist/day-summary.js +2 -2
  142. package/dist/embedding-fallback.js +2 -2
  143. package/dist/entity-retrieval.js +4 -4
  144. package/dist/explicit-capture.d.ts +2 -1
  145. package/dist/explicit-capture.js +1 -1
  146. package/dist/extraction-judge-telemetry.js +2 -2
  147. package/dist/extraction-judge-training.js +2 -2
  148. package/dist/extraction-judge.js +5 -5
  149. package/dist/extraction.js +9 -9
  150. package/dist/fallback-llm.js +4 -4
  151. package/dist/{graph-edge-decay-KSVJGCZW.js → graph-edge-decay-D7OESCBR.js} +2 -2
  152. package/dist/graph-snapshot.js +2 -2
  153. package/dist/graph.js +1 -1
  154. package/dist/index.d.ts +5 -4
  155. package/dist/index.js +80 -80
  156. package/dist/lcm/archive.js +2 -2
  157. package/dist/lcm/engine.js +5 -5
  158. package/dist/lcm/index.js +5 -5
  159. package/dist/lcm/schema.js +2 -2
  160. package/dist/lcm/summarizer.js +3 -3
  161. package/dist/local-llm.js +2 -2
  162. package/dist/logger.js +1 -1
  163. package/dist/maintenance/memory-governance.js +3 -3
  164. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  165. package/dist/maintenance/rebuild-memory-projection.js +5 -5
  166. package/dist/mcp-memory-inspector-app.d.ts +3 -2
  167. package/dist/model-registry.js +2 -2
  168. package/dist/models-json.js +2 -2
  169. package/dist/namespaces/migrate.d.ts +1 -0
  170. package/dist/namespaces/migrate.js +16 -16
  171. package/dist/namespaces/search.js +13 -13
  172. package/dist/namespaces/storage.d.ts +42 -1
  173. package/dist/namespaces/storage.js +3 -3
  174. package/dist/native-knowledge.js +2 -2
  175. package/dist/negative.js +2 -2
  176. package/dist/operator-toolkit.js +22 -22
  177. package/dist/{orchestrator-DIDDvwDw.d.ts → orchestrator-CA6ouzBn.d.ts} +3 -464
  178. package/dist/orchestrator.d.ts +2 -1
  179. package/dist/orchestrator.js +61 -61
  180. package/dist/profiling.js +2 -2
  181. package/dist/qmd.js +2 -2
  182. package/dist/recall-planner-llm.js +4 -4
  183. package/dist/recall-qos.js +2 -2
  184. package/dist/recall-state.js +2 -2
  185. package/dist/relevance.js +2 -2
  186. package/dist/{resolution-IDTEBJFS.js → resolution-MN36NW5P.js} +3 -3
  187. package/dist/resolve-provider-secret.js +2 -2
  188. package/dist/resume-bundles.js +4 -4
  189. package/dist/retrieval-agents.js +2 -2
  190. package/dist/routing/store.js +2 -2
  191. package/dist/schemas.d.ts +38 -38
  192. package/dist/search/embed-helper.js +2 -2
  193. package/dist/search/factory.js +12 -12
  194. package/dist/search/index.js +12 -12
  195. package/dist/search/lancedb-backend.js +2 -2
  196. package/dist/search/meilisearch-backend.js +2 -2
  197. package/dist/search/orama-backend.js +2 -2
  198. package/dist/search/remote-backend.js +2 -2
  199. package/dist/semantic-consolidation.js +5 -5
  200. package/dist/semantic-rule-promotion.js +3 -3
  201. package/dist/semantic-rule-verifier.js +3 -3
  202. package/dist/session-observer-state.js +2 -2
  203. package/dist/session-transcript-migration.js +2 -2
  204. package/dist/shared-context/manager.js +2 -2
  205. package/dist/storage.d.ts +4 -0
  206. package/dist/storage.js +2 -2
  207. package/dist/summarizer.js +7 -7
  208. package/dist/temporal-supersession.js +2 -2
  209. package/dist/threading.js +2 -2
  210. package/dist/transcript.js +2 -2
  211. package/dist/transfer/types.d.ts +22 -22
  212. package/dist/verified-recall.js +4 -4
  213. package/package.json +2 -2
  214. package/src/access-boundary.ts +2 -1
  215. package/src/access-cli.ts +94 -4
  216. package/src/access-http.ts +40 -2
  217. package/src/access-mcp.ts +55 -2
  218. package/src/access-operations.ts +66 -0
  219. package/src/access-service.ts +148 -73
  220. package/src/access-surface-catalog.test.ts +1 -1
  221. package/src/access-surface-catalog.ts +2 -0
  222. package/src/cli.ts +2 -1
  223. package/src/coding/decision-surfaces.test.ts +279 -0
  224. package/src/coding/decision-surfaces.ts +475 -0
  225. package/src/explicit-capture.ts +3 -12
  226. package/src/logger.ts +13 -4
  227. package/src/namespaces/catalog.test.ts +2 -2
  228. package/src/namespaces/storage.ts +81 -0
  229. package/src/orchestrator.ts +22 -64
  230. package/src/storage.ts +36 -36
  231. package/dist/chunk-2L3KLWOV.js.map +0 -1
  232. package/dist/chunk-2ODBA7MQ.js.map +0 -1
  233. package/dist/chunk-3EVIMVQU.js.map +0 -1
  234. package/dist/chunk-3MY4W5V4.js.map +0 -1
  235. package/dist/chunk-53FDU4CE.js.map +0 -1
  236. package/dist/chunk-5N5DXYDW.js.map +0 -1
  237. package/dist/chunk-5OE4PYY5.js.map +0 -1
  238. package/dist/chunk-FMEKEF47.js.map +0 -1
  239. package/dist/chunk-FYEVFGJD.js.map +0 -1
  240. package/dist/chunk-GKKAXVAJ.js.map +0 -1
  241. package/dist/chunk-OXNOINIP.js.map +0 -1
  242. /package/dist/{auto-sync-5CJBJMPZ.js.map → auto-sync-NUQWSFQD.js.map} +0 -0
  243. /package/dist/{chunk-ROHLEUTH.js.map → chunk-2KAYTPPT.js.map} +0 -0
  244. /package/dist/{chunk-NHQGDVJF.js.map → chunk-2SJCWLQD.js.map} +0 -0
  245. /package/dist/{chunk-YTWNKQ2G.js.map → chunk-3FC6LW6T.js.map} +0 -0
  246. /package/dist/{chunk-XEA4Z7JU.js.map → chunk-4FE2K57M.js.map} +0 -0
  247. /package/dist/{chunk-WI7JKV2T.js.map → chunk-4N3TFFPH.js.map} +0 -0
  248. /package/dist/{chunk-BTVX7ZXZ.js.map → chunk-4NFVPDIL.js.map} +0 -0
  249. /package/dist/{chunk-OUWAQVDJ.js.map → chunk-5CEJH5ZN.js.map} +0 -0
  250. /package/dist/{chunk-6QM24CP7.js.map → chunk-6GJS4BFH.js.map} +0 -0
  251. /package/dist/{chunk-J2FBJ63F.js.map → chunk-6O6A6YUO.js.map} +0 -0
  252. /package/dist/{chunk-HQ6NIBL6.js.map → chunk-7FL4CNPV.js.map} +0 -0
  253. /package/dist/{chunk-5VDJMYTF.js.map → chunk-7WWURLG6.js.map} +0 -0
  254. /package/dist/{chunk-QWRC7GIO.js.map → chunk-A4HH2EWA.js.map} +0 -0
  255. /package/dist/{chunk-4SKKVWLQ.js.map → chunk-AGJH5ISO.js.map} +0 -0
  256. /package/dist/{chunk-WRE3JPAW.js.map → chunk-B4XVLHJA.js.map} +0 -0
  257. /package/dist/{chunk-AJU4PJGY.js.map → chunk-BVKCV2ZY.js.map} +0 -0
  258. /package/dist/{chunk-DQY7NJ5L.js.map → chunk-CTOQEZSN.js.map} +0 -0
  259. /package/dist/{chunk-7OGJQP7T.js.map → chunk-DCWIQFNA.js.map} +0 -0
  260. /package/dist/{chunk-MHQC2WU2.js.map → chunk-DKTSR7EK.js.map} +0 -0
  261. /package/dist/{chunk-RN7MUWON.js.map → chunk-EHISUJFN.js.map} +0 -0
  262. /package/dist/{chunk-WLEB7WCG.js.map → chunk-EO5QWINU.js.map} +0 -0
  263. /package/dist/{chunk-XKXKSQU7.js.map → chunk-EXM3CQTZ.js.map} +0 -0
  264. /package/dist/{chunk-M3FWYURP.js.map → chunk-FE6DQUNJ.js.map} +0 -0
  265. /package/dist/{chunk-LCC5EZTT.js.map → chunk-FIVDN2SM.js.map} +0 -0
  266. /package/dist/{chunk-452WDNFO.js.map → chunk-GG6AJN7A.js.map} +0 -0
  267. /package/dist/{chunk-2IBGHRIO.js.map → chunk-GS55WYRL.js.map} +0 -0
  268. /package/dist/{chunk-IBTZEBUD.js.map → chunk-HYNHLBKA.js.map} +0 -0
  269. /package/dist/{chunk-EVWIEEKZ.js.map → chunk-IQ7WCZRW.js.map} +0 -0
  270. /package/dist/{chunk-B5XMS73R.js.map → chunk-IQVQJJL7.js.map} +0 -0
  271. /package/dist/{chunk-6RHNCKHG.js.map → chunk-K43PI6DQ.js.map} +0 -0
  272. /package/dist/{chunk-OIF36KGD.js.map → chunk-KCQA46NR.js.map} +0 -0
  273. /package/dist/{chunk-2LDBXPLB.js.map → chunk-KF74X62T.js.map} +0 -0
  274. /package/dist/{chunk-MAV46GWQ.js.map → chunk-KYYL4U6X.js.map} +0 -0
  275. /package/dist/{chunk-6GC5SGFE.js.map → chunk-L24JROPR.js.map} +0 -0
  276. /package/dist/{chunk-Q5ZU3RNY.js.map → chunk-LQ6JI4VH.js.map} +0 -0
  277. /package/dist/{chunk-GWKCEM3S.js.map → chunk-MCQDSY4G.js.map} +0 -0
  278. /package/dist/{chunk-HP5FMB6L.js.map → chunk-MDJURR27.js.map} +0 -0
  279. /package/dist/{chunk-T2PO5MUF.js.map → chunk-O7GOFAM3.js.map} +0 -0
  280. /package/dist/{chunk-Z2OXSMZK.js.map → chunk-OBXTMFZQ.js.map} +0 -0
  281. /package/dist/{chunk-K6ZN34WC.js.map → chunk-OV4D5T7V.js.map} +0 -0
  282. /package/dist/{chunk-OMLIFZ4I.js.map → chunk-PH3HOKYW.js.map} +0 -0
  283. /package/dist/{chunk-C3IW2F5Z.js.map → chunk-PLBIPT6I.js.map} +0 -0
  284. /package/dist/{chunk-QY7YA7OL.js.map → chunk-PNLCEFE4.js.map} +0 -0
  285. /package/dist/{chunk-AGRPGAKR.js.map → chunk-PONNZ54D.js.map} +0 -0
  286. /package/dist/{chunk-XZ4WBBB5.js.map → chunk-PWFWCGOO.js.map} +0 -0
  287. /package/dist/{chunk-XWEXT4XU.js.map → chunk-QANVLERJ.js.map} +0 -0
  288. /package/dist/{chunk-W4RVMTHR.js.map → chunk-QRDOSYOR.js.map} +0 -0
  289. /package/dist/{chunk-6IMKOIZ6.js.map → chunk-R6OVFAX6.js.map} +0 -0
  290. /package/dist/{chunk-JOASJWQR.js.map → chunk-SANZHXY2.js.map} +0 -0
  291. /package/dist/{chunk-7DTASS5T.js.map → chunk-SJHM6I4J.js.map} +0 -0
  292. /package/dist/{chunk-M6BVYHBU.js.map → chunk-STOEE37X.js.map} +0 -0
  293. /package/dist/{chunk-LXH3DIF2.js.map → chunk-U7D7NP4J.js.map} +0 -0
  294. /package/dist/{chunk-DRD2Q7HQ.js.map → chunk-UFS7OXGL.js.map} +0 -0
  295. /package/dist/{chunk-H3HDXD3U.js.map → chunk-UPTZYUYJ.js.map} +0 -0
  296. /package/dist/{chunk-3Z7NPD5T.js.map → chunk-UTYBJR7M.js.map} +0 -0
  297. /package/dist/{chunk-LN4YGHTM.js.map → chunk-UUH4YQOF.js.map} +0 -0
  298. /package/dist/{chunk-6VF75M3X.js.map → chunk-VGUOEDTU.js.map} +0 -0
  299. /package/dist/{chunk-44VFF3BB.js.map → chunk-VILEUJXC.js.map} +0 -0
  300. /package/dist/{chunk-7SI52C65.js.map → chunk-VL7DP3OW.js.map} +0 -0
  301. /package/dist/{chunk-7DHTMOND.js.map → chunk-VQ34TERH.js.map} +0 -0
  302. /package/dist/{chunk-6VMIHVGO.js.map → chunk-VX6OBUDW.js.map} +0 -0
  303. /package/dist/{chunk-EW5KFXHL.js.map → chunk-WDXCNJSF.js.map} +0 -0
  304. /package/dist/{chunk-X6IRLNOO.js.map → chunk-WIWPSQYU.js.map} +0 -0
  305. /package/dist/{chunk-DOCTITOP.js.map → chunk-WRFKZEO6.js.map} +0 -0
  306. /package/dist/{chunk-E6ZDCOHM.js.map → chunk-XBZQRZ6G.js.map} +0 -0
  307. /package/dist/{chunk-7YX23JBA.js.map → chunk-XHYGJVXL.js.map} +0 -0
  308. /package/dist/{chunk-JD4SCARD.js.map → chunk-YN4ZT4CW.js.map} +0 -0
  309. /package/dist/{chunk-YXWAILM4.js.map → chunk-YOI3ELXF.js.map} +0 -0
  310. /package/dist/{chunk-XCAZF7KQ.js.map → chunk-ZA2S2VLL.js.map} +0 -0
  311. /package/dist/{chunk-BEUDU7Y4.js.map → chunk-ZCWIH4LH.js.map} +0 -0
  312. /package/dist/{chunk-V25ZAOSB.js.map → chunk-ZPTISBQU.js.map} +0 -0
  313. /package/dist/{contradiction-scan-AZTGFMPY.js.map → contradiction-scan-HWGEOUDS.js.map} +0 -0
  314. /package/dist/{graph-edge-decay-KSVJGCZW.js.map → graph-edge-decay-D7OESCBR.js.map} +0 -0
  315. /package/dist/{resolution-IDTEBJFS.js.map → resolution-MN36NW5P.js.map} +0 -0
@@ -23,6 +23,7 @@ import { Z as BufferTurn, af as ExtractionResult, M as MemoryCategory, I as Impo
23
23
  import { LcmEngine } from './lcm/engine.js';
24
24
  import { S as SemanticConsolidationResult } from './semantic-consolidation-CWch5uM7.js';
25
25
  import { ConversationIndexBackendInspection } from './conversation-index/backend.js';
26
+ import { N as NamespaceCatalog } from './catalog-COqWZlZ6.js';
26
27
  import { NamespaceSearchHealth } from './namespaces/search.js';
27
28
  import { SharedContextManager } from './shared-context/manager.js';
28
29
  import { CompoundingEngine } from './compounding/engine.js';
@@ -528,459 +529,6 @@ declare function locateTranscriptPath(hitPath: string): {
528
529
  date: string;
529
530
  } | null;
530
531
 
531
- /**
532
- * Rebuildable namespace catalog (issue #1499).
533
- *
534
- * Purpose: a downstream, rebuildable metadata index that lets Remnic ENUMERATE
535
- * the configured and dynamically-created namespaces that exist or should be
536
- * maintained. Filesystem memory remains the single source of truth; the catalog
537
- * is derived metadata and can always be reconstructed from disk.
538
- *
539
- * Storage format: `<memoryDir>/state/namespaces.jsonl` — an append-and-compact
540
- * JSON-lines log. We chose this over per-namespace sidecar files because:
541
- * - touches (markRead/markWrite/markMaintenance) are cheap single appends;
542
- * - it is naturally audit-friendly (the raw log preserves touch history);
543
- * - a single file makes enumeration trivial (no directory walk per call);
544
- * - last-record-wins compaction folds the log into the current state on read,
545
- * and `rebuildFromDisk` rewrites it atomically (temp file + rename).
546
- *
547
- * SECURITY:
548
- * - The catalog stores ONLY metadata (namespace names, kinds, timestamps,
549
- * resolved storage dirs). It NEVER holds raw memory content or secrets.
550
- * - Catalog presence grants NO authorization. Read/write access still flows
551
- * through the namespace policies in `principal.ts`; this module never makes
552
- * an access decision.
553
- * - All namespace tokens are validated with `isSafeRouteNamespace` (except the
554
- * configured default namespace, which is exempt at the routing layer) and
555
- * every storage dir is contained under `<memoryDir>/namespaces`.
556
- * - `rebuildFromDisk` rejects/reports symlinked roots that escape the memory
557
- * root rather than trusting them.
558
- *
559
- * LIFECYCLE: catalog write failures must NEVER crash a primary memory op.
560
- * Callers should wrap touch calls in try/catch (or rely on the internal
561
- * failure-tolerant append). The internal serialized write chain recovers from
562
- * rejection so one failed append cannot poison subsequent writes.
563
- */
564
- type NamespaceKind = "default" | "self" | "shared" | "project" | "branch" | "team-project" | "explicit" | "legacy";
565
- type NamespaceDiscoverySource = "config" | "write" | "read" | "scan" | "migration";
566
- interface NamespaceRecord {
567
- namespace: string;
568
- identityToken: string;
569
- kind: NamespaceKind;
570
- principal?: string;
571
- projectId?: string;
572
- branch?: string;
573
- parentNamespace?: string;
574
- createdAt: string;
575
- lastReadAt?: string;
576
- lastWriteAt?: string;
577
- lastMaintenanceAt?: Record<string, string>;
578
- storageDir: string;
579
- discoveredBy: NamespaceDiscoverySource;
580
- }
581
- interface NamespaceCatalogFilter {
582
- kind?: NamespaceKind;
583
- discoveredBy?: NamespaceDiscoverySource;
584
- /** Only include namespaces written since this instant (inclusive lower bound). */
585
- writtenSince?: Date;
586
- }
587
- interface NamespaceTouchMetadata {
588
- discoveredBy?: NamespaceDiscoverySource;
589
- kind?: NamespaceKind;
590
- principal?: string;
591
- projectId?: string;
592
- branch?: string;
593
- parentNamespace?: string;
594
- /** Explicit storage dir (when the caller already resolved it). */
595
- storageDir?: string;
596
- /** Override the touch timestamp (mainly for tests / migration replay). */
597
- at?: Date;
598
- }
599
- interface NamespaceCatalogSkippedRoot {
600
- token: string;
601
- reason: "symlink" | "escape" | "unsafe" | "error";
602
- detail?: string;
603
- }
604
- interface NamespaceCatalogRebuildResult {
605
- dryRun: boolean;
606
- records: NamespaceRecord[];
607
- /** Roots reported as ambiguous/unsafe rather than silently misclassified. */
608
- skipped: NamespaceCatalogSkippedRoot[];
609
- /**
610
- * Whether the rebuild actually rewrote the on-disk catalog (round 6, codex P2
611
- * / cursor Medium — NBn3n/NBsGG). `false` for a dry-run, AND for an `--apply`
612
- * that could NOT acquire the cross-process rebuild lock within the bounded wait
613
- * (it ran compute-only to avoid clobbering a concurrent lock holder). Callers
614
- * (CLI) must NOT report unqualified success when `applied` is false for a
615
- * non-dry-run — the catalog was left unchanged and a retry is needed.
616
- */
617
- applied: boolean;
618
- }
619
- declare class NamespaceCatalog {
620
- private readonly config;
621
- private readonly memoryDir;
622
- private readonly stateDir;
623
- private readonly catalogPath;
624
- private readonly rebuildLockPath;
625
- private readonly lockOwnerId;
626
- private writeChain;
627
- protected onTouchCriticalSectionForTest?: () => Promise<void>;
628
- protected onRebuildBeforeRenameForTest?: () => Promise<void>;
629
- protected onRebuildAfterScanForTest?: () => Promise<void>;
630
- protected onBeforeBreakStaleUnlinkForTest?: () => Promise<void>;
631
- private readonly defaultNamespaceIdentity;
632
- constructor(config: PluginConfig);
633
- /** Whether the catalog is active (namespaces enabled and catalog not opted out). */
634
- get enabled(): boolean;
635
- /**
636
- * Sanitize a record at the enumeration boundary (round 5, cursor Medium + codex
637
- * P2; round 6 — NDXHe). Reads return whatever is in `namespaces.jsonl` after
638
- * schema checks only, so a tampered or pre-fix row could surface unsafe data to
639
- * maintenance/QMD until a rewrite occurs. Two distinct defenses:
640
- *
641
- * 1. UNSAFE NAMESPACE NAME (NGZqr, codex P2): an unsafe non-default namespace
642
- * (e.g. `../evil`, a name with separators, or >64 chars) is REJECTED outright
643
- * — return `null` so the caller drops it. The disk SCAN and the hot touch
644
- * path both reject such names with the SAME default-exempt `isSafeRouteNamespace`
645
- * gate, so the read boundary MUST agree, or `listNamespaces()`/`getNamespaceRecord()`
646
- * would expose a namespace those paths reject (note `isStorageDirForNamespace`
647
- * can still build a tokenized root even for `../evil`, so storageDir sanitation
648
- * alone does not catch it). The default namespace is exempt (it may be a
649
- * non-route literal), matching every other validation site.
650
- *
651
- * 2. UNSAFE storageDir: for an otherwise-valid namespace, apply the SAME contract
652
- * as the write path — full containment (`isContainedStorageDir`: lexical +
653
- * symlink/realpath) AND namespace ownership (`isStorageDirForNamespace`). When
654
- * a record fails EITHER check we substitute the trusted resolved-and-safe root
655
- * for that namespace (rule 42: read and write stay symmetric).
656
- */
657
- private sanitizeRecordForRead;
658
- private storageRootOwnershipRank;
659
- private configuredNamespaceIdentities;
660
- private preferStorageRootOwner;
661
- private dropDuplicateStorageRootAliases;
662
- private loadSanitizedRecords;
663
- listNamespaces(filter?: NamespaceCatalogFilter): Promise<NamespaceRecord[]>;
664
- getNamespaceRecord(namespace: string): Promise<NamespaceRecord | null>;
665
- markRead(namespace: string, metadata?: NamespaceTouchMetadata): Promise<void>;
666
- markWrite(namespace: string, metadata?: NamespaceTouchMetadata): Promise<void>;
667
- markMaintenance(namespace: string, jobName: string, at?: Date): Promise<void>;
668
- /**
669
- * Register namespaces known purely from config (default, shared, explicit
670
- * policies). Source `config`. Cheap and idempotent.
671
- */
672
- registerConfiguredNamespaces(): Promise<void>;
673
- /**
674
- * Register a namespace whose storage was just resolved by the router. Used as
675
- * the router's integration hook (`discoveredBy: config`). Storage dir is
676
- * provided so we do not re-resolve it. Failure-tolerant. Returns whether the
677
- * registration actually APPENDED (round 6, codex P2 — NEFoX), so the router's
678
- * resolve-hook dedup only marks a namespace notified when it truly persisted —
679
- * a dropped append (disabled catalog or rebuild-lock-timeout drop) returns
680
- * `false` and is retried on the next resolve.
681
- */
682
- registerResolved(namespace: string, storageDir: string): Promise<boolean>;
683
- /**
684
- * Generic register/touch without changing read/write timestamps unless the
685
- * source implies it. Validates the namespace and resolves a storage dir.
686
- * Returns whether the touch actually appended.
687
- */
688
- private register;
689
- private validateNamespace;
690
- /**
691
- * Resolve the on-disk storage dir for a namespace WITHOUT trusting caller
692
- * input. The default namespace may use the legacy memoryDir root; everything
693
- * else lives under `<memoryDir>/namespaces/<token>`. Containment is enforced
694
- * by rejecting separators/parent-refs in the token.
695
- */
696
- private resolveStorageDir;
697
- private namespaceTokenDir;
698
- /**
699
- * Whether a candidate storage dir is LEXICALLY contained: it is either the
700
- * legacy default root (`memoryDir`) or a strict descendant of
701
- * `<memoryDir>/namespaces/`. The router legitimately resolves a namespace to
702
- * EITHER the tokenized dir or a legacy raw-name dir under `namespaces/`, so we
703
- * accept any contained child rather than a single exact token path. This is a
704
- * pure string check — symlink escape is checked separately via realpath.
705
- */
706
- private isLexicallyContained;
707
- /**
708
- * Whether a candidate storage dir satisfies the catalog containment contract,
709
- * including SYMLINK-escape rejection (round 5, codex P2). A lexically-contained
710
- * path that is actually a symlink to an outside directory would let maintenance
711
- * or QMD follow it outside `memoryDir`. We mirror `rebuildFromDisk`'s posture:
712
- * the path must be lexically contained AND, if it exists on disk, neither the
713
- * path itself a symlink nor its realpath escaping the memory root. Non-existent
714
- * paths pass the realpath stage (nothing to follow yet) but still must be
715
- * lexically contained.
716
- */
717
- private isContainedStorageDir;
718
- /**
719
- * Reject a candidate whose path crosses a SYMLINKED ancestor strictly between
720
- * memoryDir and the leaf (codex NVuq5). `realpath`-based containment accepts a
721
- * symlinked `<memoryDir>/namespaces` that currently resolves back inside
722
- * memoryDir, but the disk scanner rejects such a root and a later retarget would
723
- * escape the memory tree — so refuse it here too. The leaf itself is
724
- * symlink-checked by the caller; this walks only the intermediate ancestors.
725
- */
726
- private hasSymlinkedAncestor;
727
- /**
728
- * Walk up from a not-yet-existing candidate to the nearest ancestor that exists
729
- * on disk and verify its realpath stays inside `memoryReal` (round 6, codex P2
730
- * — NDo79). Rejects a non-existent leaf whose existing parent chain escapes
731
- * memoryDir via a symlink. Stops at memoryDir's resolved root.
732
- *
733
- * The nearest existing ancestor must also be a DIRECTORY (NHIdt, codex P2): if
734
- * an existing parent such as `<memoryDir>/namespaces` is a regular FILE (or
735
- * socket/fifo), `realpath(parent)` still succeeds and resolves inside memoryDir,
736
- * so a containment-only check would ACCEPT a leaf that can never be created — you
737
- * cannot mkdir a child under a file. We `lstat` the nearest existing ancestor and
738
- * reject when it is not a directory, mirroring the leaf non-directory rejection
739
- * (NF21i) and the disk scan, so every containment consumer agrees.
740
- */
741
- private isNearestExistingAncestorContained;
742
- /**
743
- * Resolve the storage dir to persist for a touch, validating any caller-
744
- * provided `metadata.storageDir` against the catalog containment contract
745
- * (round 4 + round 5, codex P2). `markWrite`/`registerResolved` accept an
746
- * explicit storageDir, but persisting it verbatim would let a bad hook or
747
- * external consumer write an arbitrary path — including one outside `memoryDir`
748
- * or a symlink that escapes it — into the catalog, handing maintenance/QMD an
749
- * unsafe root. We accept an explicit (or previously-stored) dir ONLY when it
750
- * stays contained under memoryDir (lexically AND via realpath); otherwise we
751
- * drop it and fall back to the trusted resolved dir.
752
- */
753
- private resolveTouchStorageDir;
754
- /**
755
- * Whether `candidate` is a legitimate storage root FOR `namespace` (round 6,
756
- * codex P2 — NDATT). Accepts the namespace's router-resolved root, its canonical
757
- * lexical tokenized dir, and (for the default namespace only) memoryDir. This
758
- * prevents a contained-but-CROSS-NAMESPACE path — another namespace's tree, or
759
- * memoryDir for a non-default namespace — from being persisted as this
760
- * namespace's root. Compared on resolved (absolute) paths.
761
- */
762
- private isStorageDirForNamespace;
763
- /**
764
- * Resolve the canonical storage dir for a namespace as the LIVE ROUTER would,
765
- * but NEVER return a path that escapes the memory root.
766
- *
767
- * Router alignment (round 4, cursor Medium): a read/register touch with no
768
- * explicit storageDir previously used the lexical `resolveStorageDir`, which
769
- * always picks `<memoryDir>/namespaces/<token>` (or `memoryDir` for the
770
- * default). That diverges from `NamespaceStorageRouter`, which can route to a
771
- * legacy raw-name dir or a migrated default root — so a recall touch could
772
- * record a contained-but-WRONG root that maintenance/rebuild then targets. We
773
- * now delegate to the shared `resolveNamespaceStorageRoot` (the very helper the
774
- * router uses) so the catalog records the same on-disk root the router serves.
775
- *
776
- * Containment (round 5, codex P2): the resolved path can still be a symlink
777
- * escaping memoryDir, so we run the full (lexical + realpath) containment
778
- * contract. When it FAILS we fall back to a NAMESPACE-SPECIFIC safe root, NOT
779
- * a blanket `memoryDir`. Recording `memoryDir` for a non-default namespace
780
- * would point enumeration/maintenance at the DEFAULT namespace's tree (round 5,
781
- * cursor/codex Medium/P2) — a cross-namespace fanout error. The correct safe
782
- * root is the namespace's own lexical tokenized dir
783
- * (`<memoryDir>/namespaces/<token>`), which is always contained and is that
784
- * namespace's canonical location (we record the lexical PATH as metadata; we do
785
- * not follow the escaping symlink). Only the default namespace — or a token so
786
- * unsafe even the lexical dir cannot be built — falls back to `memoryDir`.
787
- */
788
- private resolveSafeStorageDir;
789
- /**
790
- * The namespace-specific contained fallback root, used when the router-resolved
791
- * root fails containment (round 5, cursor/codex Medium/P2).
792
- *
793
- * Preference order:
794
- * 1. The namespace's OWN lexical tokenized dir (`namespaces/<token>`) — so a
795
- * non-default namespace is NOT pointed at the DEFAULT namespace's `memoryDir`
796
- * tree (which would misdirect maintenance fanout). Returned only when the
797
- * token dir itself stays CONTAINED (it is not a symlink, and its realpath
798
- * does not escape memoryDir — e.g. via a symlinked `namespaces/` parent).
799
- * 2. `memoryDir` as a LAST resort — for the default namespace, an unsafe token
800
- * that cannot build a contained path, OR the irreparable case where the
801
- * token dir's realpath escapes the root (so even its lexical path resolves
802
- * outside). NF21m note (codex P2): we deliberately do NOT record the lexical
803
- * token dir in that irreparable case — its realpath escapes memoryDir, and
804
- * the NDo79 contract REQUIRES that an escaping path is never persisted (a
805
- * later mkdir/maintenance/QMD op would follow it outside the root). Since no
806
- * contained namespace-specific path exists, containment wins: `memoryDir` is
807
- * the only safe root left. A namespace whose token dir's realpath escapes is
808
- * an irreparable on-disk state; recording the contained default root is
809
- * strictly safer than persisting an escaping one. The common case where the
810
- * token dir IS contained is handled by branch 1, so a healthy non-default
811
- * namespace never reaches `memoryDir`.
812
- */
813
- private safeFallbackStorageDir;
814
- /**
815
- * Re-check, NOW, whether a namespace's storage root currently EXISTS on disk
816
- * with the SAME safety the directory scan uses (NFJV8, codex P2).
817
- *
818
- * The rebuild's final re-merge runs under the held lock and folds the freshly
819
- * re-read log (`latest`) into the scanned `rebuilt` set. A namespace present in
820
- * `latest` (a live touch row) but ABSENT from `rebuilt` is normally PURGED as
821
- * deleted (the NATqU "disk scan is authoritative" rule). But there is a TOCTOU
822
- * window: a dynamic namespace can be CREATED on disk AFTER `rebuildFromDisk()`
823
- * already enumerated `namespaces/` but BEFORE this re-merge. The scan snapshot
824
- * missed its new root, yet a gateway `markWrite` already appended a row for it.
825
- * Blindly purging that row would rewrite the catalog WITHOUT a live namespace
826
- * that now has data on disk, so `writtenSince`/maintenance/QMD consumers miss
827
- * it until another touch or rebuild.
828
- *
829
- * So before purging, we re-resolve the namespace's safe storage root (the same
830
- * router-aligned, containment-checked path the scan would have catalogued) and
831
- * confirm it is a real, contained, non-symlink directory that actually holds
832
- * memory data RIGHT NOW. If so the namespace was created-after-scan and is LIVE
833
- * — KEEP its row. This is the precise inverse of NATqU and does NOT reintroduce
834
- * it: a touch on a REMOVED root re-checks as ABSENT (no data on disk) and is
835
- * still purged; only a root that EXISTS on a fresh re-check is kept.
836
- *
837
- * Mirrors the per-entry scan checks (symlink rejection + realpath containment +
838
- * `hasMemoryData`) so a symlinked/escaping root is never resurrected.
839
- */
840
- private liveStorageRootExistsForRebuild;
841
- /**
842
- * Record a namespace touch. Returns whether the touch actually APPENDED to the
843
- * log (round 6, codex P2 — NEFoX): a disabled catalog or a dropped append (the
844
- * NAUf7 rebuild-lock-timeout drop) returns `false`, so callers (e.g. the router
845
- * resolve-hook dedup) can avoid marking a dropped registration as completed and
846
- * suppressing its retry.
847
- */
848
- private touch;
849
- rebuildFromDisk(options?: {
850
- dryRun?: boolean;
851
- }): Promise<NamespaceCatalogRebuildResult>;
852
- /**
853
- * Body of `rebuildFromDisk`, run inside a single `queueCritical` turn. MUST
854
- * only be invoked from within the serialized chain so the load and the
855
- * rewrite are atomic with respect to concurrent touches (in-process).
856
- *
857
- * `wantMutate` is true for an `--apply` (the caller intends to rewrite). The
858
- * cross-process file lock is acquired LATE — only around the final
859
- * load→merge→rename window (NFgCT, codex P2) — never across the disk scan, so a
860
- * long scan does not force concurrent gateway touches to wait (and drop their
861
- * append). Whether the rewrite actually happened is reported via the result's
862
- * `applied`: true only when `wantMutate` AND the lock was acquired.
863
- */
864
- private rebuildInsideChain;
865
- /**
866
- * Final load→merge→rename window of a rebuild, factored out so the caller can
867
- * run it WITHIN the cross-process file lock (NFgCT, codex P2) without holding
868
- * that lock across the preceding disk scan. Re-reads the latest on-disk state,
869
- * folds concurrent touches, then (when `canMutate`) atomically rewrites the log.
870
- *
871
- * `canMutate` records that the cross-process lock was actually held. The
872
- * re-merge + rewrite run only when it is true — a dry-run, or an unlocked apply
873
- * (lock-acquisition timeout), computes records but does NOT rename, so it can
874
- * never clobber a concurrent lock holder's window. `applied` mirrors `canMutate`.
875
- */
876
- private finishRebuild;
877
- /**
878
- * Run `fn` while HOLDING the shared cross-process advisory lock (round 5, codex
879
- * P2; generalized round 7 — NEZkA). This is the SINGLE mutex shared by BOTH the
880
- * touch read→merge→append window AND the rebuild final load→merge→rename window,
881
- * so a touch and a rebuild in different processes are mutually exclusive over
882
- * their respective critical sections — closing the check-then-append gap where a
883
- * polled-only touch could append into a rebuild's load→rename window.
884
- *
885
- * Acquisition is atomic via `open(..., "wx")`. A lock older than
886
- * `REBUILD_LOCK_STALE_MS` is treated as a crashed holder and broken. After
887
- * `REBUILD_LOCK_MAX_WAIT_MS` of contention we proceed best-effort WITHOUT the
888
- * lock rather than block forever. The lock is always released in `finally`.
889
- *
890
- * IN-PROCESS SAFETY: every caller invokes this from inside (or wrapping) the
891
- * per-process `queueCritical` chain, which serializes all catalog mutations in
892
- * THIS process. So within one process only one logical holder attempts OS-lock
893
- * acquisition at a time — the file lock is never self-contended in-process, and
894
- * the lock is acquired and released within a single in-process turn. The file
895
- * lock adds only the missing CROSS-process exclusion.
896
- *
897
- * HEARTBEAT (round 5, cursor/codex Medium/P2): while WE hold the lock a timer
898
- * refreshes its mtime every `REBUILD_LOCK_HEARTBEAT_MS`, so a legitimately long
899
- * holder (> `REBUILD_LOCK_STALE_MS`) is not treated as a crashed holder and
900
- * unlinked by another process — which would let overlapping windows lose
901
- * appends. Heartbeat failures are swallowed; the timer is always cleared in
902
- * `finally`.
903
- *
904
- * ACQUISITION RESULT (round 6, codex P2 — NBPmY): `fn` receives whether WE
905
- * actually hold the lock. When acquisition TIMED OUT (another holder is active),
906
- * a MUTATING rebuild must NOT perform its load/rename window unlocked, and a
907
- * touch must NOT append unlocked — both would recreate the lost-append race. The
908
- * caller uses `acquired` to run compute-only (rebuild) or DROP the append
909
- * (touch) when unlocked.
910
- */
911
- private withHeldCatalogLock;
912
- /** Try to acquire the rebuild lock; returns true if WE created it. */
913
- private acquireRebuildLock;
914
- /**
915
- * Remove the lock file if its mtime is older than the stale threshold.
916
- *
917
- * REPLACEMENT-SAFE (NG7Bg, codex P2): a plain `stat` → `unlink` has a TOCTOU
918
- * window — two processes can both observe the SAME stale lock; one removes it and
919
- * creates a FRESH lock, and the other's later `unlink` then deletes that fresh
920
- * holder's ACTIVE lock based on the stale identity it read earlier, leaving the
921
- * fresh holder running its critical section with no visible lock and reopening the
922
- * lost-update race the mutex prevents. We therefore capture the lock's IDENTITY
923
- * (its full content line: `<pid> <owner-uuid> <iso>`) when we judge it stale, then
924
- * RE-READ immediately before unlinking and only remove it when the content is
925
- * byte-identical AND still stale. A replacement lock has a different owner id /
926
- * timestamp, so its content differs and we leave it untouched. We never unlink a
927
- * lock whose mtime is now fresh (a heartbeat refreshed it) or whose identity
928
- * changed (a replacement was created). This is best-effort: any mismatch/vanish
929
- * simply skips the break and the caller polls again.
930
- */
931
- private breakStaleRebuildLock;
932
- /**
933
- * Whether the rebuild lock file was written by THIS instance (round 6, codex
934
- * P2 — NBsGP). Matches the per-instance owner id, NOT just `process.pid`: two
935
- * NamespaceCatalog instances in the same process share a PID, so a PID-only
936
- * check would wrongly treat instance A's lock as self-held by instance B and
937
- * let B's touch skip the wait and append into A's rebuild window. Falls back to
938
- * the legacy PID-only form for lock files written before owner ids existed.
939
- */
940
- private rebuildLockHeldBySelf;
941
- /**
942
- * Merge a prior record's preserved metadata (timestamps, principal hints)
943
- * onto a freshly-discovered record. Disk-derived fields (storageDir, kind)
944
- * take precedence from the new record.
945
- *
946
- * PROVENANCE (round 3, cursor Low): `discoveredBy` and `createdAt` are
947
- * CREATION-ONLY — identical to the touch path's invariant. A rebuild must NOT
948
- * reset a namespace first seen via a `write`/`read` touch back to `config`
949
- * just because it is also listed in policies. So when a prior record exists we
950
- * carry its `discoveredBy` forward; only brand-new records keep the fresh
951
- * (config/scan) provenance.
952
- */
953
- private mergeForRebuild;
954
- /** Load the JSONL log and fold it into current state (last-record-wins). */
955
- private loadCompacted;
956
- /**
957
- * Serialize an arbitrary read-modify-write critical section through the single
958
- * write chain. Every catalog mutation (touch read+merge+append, full rewrite)
959
- * runs through this so they are mutually exclusive: a touch always reads the
960
- * latest persisted state before appending, and a rebuild rewrite cannot
961
- * interleave with a touch's append. The chain recovers from rejection
962
- * (CLAUDE.md rule #40) — one failed section never poisons subsequent ones —
963
- * while still surfacing the error to that section's awaited promise.
964
- */
965
- private queueCritical;
966
- /**
967
- * Append a single record to the JSONL log WITHOUT re-serializing through the
968
- * write chain. MUST only be called from inside a `queueCritical(...)` section
969
- * (which already holds the serialized turn); calling it directly would bypass
970
- * the read-before-append ordering that prevents lost-field races.
971
- */
972
- private appendUnchained;
973
- /**
974
- * Atomic temp-file + rename rewrite (CLAUDE.md rule #54: write temp, then
975
- * rename — never delete-before-write) WITHOUT re-entering the write chain.
976
- * MUST only be called from inside a `queueCritical(...)` turn (e.g. the
977
- * rebuild critical section, which already holds the serialized turn so its
978
- * load and rewrite are atomic against concurrent touches). Re-entering the
979
- * chain from within a held turn would deadlock.
980
- */
981
- private rewriteUnchained;
982
- }
983
-
984
532
  interface BulkImportBatchIngestResult {
985
533
  attemptedTurnCount: number;
986
534
  extractionCount: number;
@@ -2257,17 +1805,11 @@ declare class Orchestrator {
2257
1805
  private graphSeedPathsWithinDeadline;
2258
1806
  private namespaceFromPath;
2259
1807
  private namespaceFromStorageDir;
2260
- /**
2261
- * Record a namespace write in the catalog (issue #1499). Best-effort and
2262
- * failure-tolerant: a catalog write error MUST NOT crash the primary memory
2263
- * write (CLAUDE.md gotcha #13, rule #40). Fire-and-forget by design.
2264
- */
2265
- private markCatalogWrite;
2266
1808
  /**
2267
1809
  * Public best-effort catalog write touch (issue #1499). User-facing explicit
2268
1810
  * captures (`memory_store`) and review-queue approvals persist via
2269
1811
  * `persistExplicitCapture()` → `storage.writeMemory()`, which bypasses the
2270
- * extraction write path that calls `markCatalogWrite`. Without this their
1812
+ * extraction write path that owns the catalog touch. Without this their
2271
1813
  * namespaces never record `lastWriteAt`, so the catalog under-reports write
2272
1814
  * recency (round 5, codex P2). Fire-and-forget and failure-tolerant — a
2273
1815
  * catalog error must never affect the explicit write (gotcha #13, rule #40).
@@ -2277,11 +1819,8 @@ declare class Orchestrator {
2277
1819
  * default rather than skipping it (round 6, codex P2 — default `memory_store`
2278
1820
  * and inline-note writes were missing from `writtenSince`/maintenance).
2279
1821
  */
2280
- recordCatalogWrite(namespace?: string, storageDir?: string): void;
2281
- /** Record a namespace read in the catalog. Best-effort, failure-tolerant. */
2282
- private markCatalogRead;
2283
1822
  private readAllMemoriesForNamespaces;
2284
1823
  private readArchivedMemoriesForNamespaces;
2285
1824
  }
2286
1825
 
2287
- export { type GraphRecallShadowComparison as $, generateWearableMemories as A, importNativeMemories as B, loadSpeakerRegistry as C, DEFAULT_SELF_NAME as D, locateTranscriptPath as E, memoryStatusForMode as F, type GraphRecallSnapshot as G, resolveSpeaker as H, type IntentDebugSnapshot as I, resolveSyncDates as J, sanitizeSessionKeyForFilename as K, saveSpeakerRegistry as L, speakerRegistryKey as M, NamespaceCatalog as N, Orchestrator as O, type PatternReinforcementResult as P, speakersFilePath as Q, type ResolvedSpeaker as R, type SpeakerRegistry as S, syncWearableSource as T, wearableDayTag as U, wearableSourceLabel as V, WearablesService as W, writeDailyDigestMemory as X, type BulkImportBatchIngestResult as Y, BulkImportBatchPartialFailureError as Z, type GraphRecallRankedResult as _, type NamespaceCatalogFilter as a, type QmdRecallSnapshot as a0, type RecallInvocationOptions as a1, type RecallModeDecision as a2, appendMemoryToGraphContext as a3, blendGraphExpandedRecallScore as a4, buildCompressionGuidelinesMarkdown as a5, buildMemoryPathById as a6, computeArtifactCandidateFetchLimit as a7, computeArtifactRecallLimit as a8, computeQmdHybridFetchLimit as a9, dedupeEntitySynthesisEvidenceEntries as aa, deriveTopicsFromExtraction as ab, filterRecallCandidates as ac, formatCompressionGuidelinesForRecall as ad, graphPathRelativeToStorage as ae, hasIdentityRecoveryIntent as af, isArtifactMemoryPath as ag, lifecycleRecallScoreAdjustment as ah, mergeArtifactRecallCandidates as ai, mergeGraphExpandedResults as aj, resolveEffectiveIdentityInjectionMode as ak, resolveEffectiveRecallMode as al, resolvePersistedMemoryRelativePath as am, resolveRecallModeDecision as an, resolveRecallModeDecisionAsync as ao, resolveRecentThreadMemoryPaths as ap, shouldFilterLifecycleRecallCandidate as aq, summarizeGraphShadowComparison as ar, type NamespaceCatalogRebuildResult as b, type NamespaceCatalogSkippedRoot as c, type NamespaceDiscoverySource as d, type NamespaceKind as e, type NamespaceRecord as f, type NamespaceTouchMetadata as g, type SpeakerOverride as h, WEARABLE_SOURCE_PREFIX as i, type WearableDayTranscriptView as j, type WearableMemoryGenDeps as k, type WearableMemoryGenResult as l, type WearableMemorySearchResult as m, type WearableMemoryWriter as n, type WearableSearchBackend as o, type WearableStorageIo as p, type WearableSyncDeps as q, type WearableSyncOptions as r, type WearableTranscriptSearchResult as s, type WearablesServiceDeps as t, buildExtractionTurns as u, dateInTimezone as v, defaultTimezone as w, defaultWorkspaceDir as x, distinctSpeakerLabels as y, emptySpeakerRegistry as z };
1826
+ export { computeArtifactCandidateFetchLimit as $, sanitizeSessionKeyForFilename as A, saveSpeakerRegistry as B, speakerRegistryKey as C, DEFAULT_SELF_NAME as D, speakersFilePath as E, syncWearableSource as F, type GraphRecallSnapshot as G, wearableDayTag as H, type IntentDebugSnapshot as I, wearableSourceLabel as J, writeDailyDigestMemory as K, type BulkImportBatchIngestResult as L, BulkImportBatchPartialFailureError as M, type GraphRecallRankedResult as N, Orchestrator as O, type PatternReinforcementResult as P, type GraphRecallShadowComparison as Q, type ResolvedSpeaker as R, type SpeakerRegistry as S, type QmdRecallSnapshot as T, type RecallInvocationOptions as U, type RecallModeDecision as V, WearablesService as W, appendMemoryToGraphContext as X, blendGraphExpandedRecallScore as Y, buildCompressionGuidelinesMarkdown as Z, buildMemoryPathById as _, type SpeakerOverride as a, computeArtifactRecallLimit as a0, computeQmdHybridFetchLimit as a1, dedupeEntitySynthesisEvidenceEntries as a2, deriveTopicsFromExtraction as a3, filterRecallCandidates as a4, formatCompressionGuidelinesForRecall as a5, graphPathRelativeToStorage as a6, hasIdentityRecoveryIntent as a7, isArtifactMemoryPath as a8, lifecycleRecallScoreAdjustment as a9, mergeArtifactRecallCandidates as aa, mergeGraphExpandedResults as ab, resolveEffectiveIdentityInjectionMode as ac, resolveEffectiveRecallMode as ad, resolvePersistedMemoryRelativePath as ae, resolveRecallModeDecision as af, resolveRecallModeDecisionAsync as ag, resolveRecentThreadMemoryPaths as ah, shouldFilterLifecycleRecallCandidate as ai, summarizeGraphShadowComparison as aj, WEARABLE_SOURCE_PREFIX as b, type WearableDayTranscriptView as c, type WearableMemoryGenDeps as d, type WearableMemoryGenResult as e, type WearableMemorySearchResult as f, type WearableMemoryWriter as g, type WearableSearchBackend as h, type WearableStorageIo as i, type WearableSyncDeps as j, type WearableSyncOptions as k, type WearableTranscriptSearchResult as l, type WearablesServiceDeps as m, buildExtractionTurns as n, dateInTimezone as o, defaultTimezone as p, defaultWorkspaceDir as q, distinctSpeakerLabels as r, emptySpeakerRegistry as s, generateWearableMemories as t, importNativeMemories as u, loadSpeakerRegistry as v, locateTranscriptPath as w, memoryStatusForMode as x, resolveSpeaker as y, resolveSyncDates as z };
@@ -7,7 +7,7 @@ import './summarizer.js';
7
7
  import './local-llm.js';
8
8
  import './fallback-llm.js';
9
9
  import './live-connectors-runner.js';
10
- export { Y as BulkImportBatchIngestResult, Z as BulkImportBatchPartialFailureError, _ as GraphRecallRankedResult, $ as GraphRecallShadowComparison, G as GraphRecallSnapshot, I as IntentDebugSnapshot, O as Orchestrator, a0 as QmdRecallSnapshot, a1 as RecallInvocationOptions, a2 as RecallModeDecision, a3 as appendMemoryToGraphContext, a4 as blendGraphExpandedRecallScore, a5 as buildCompressionGuidelinesMarkdown, a6 as buildMemoryPathById, a7 as computeArtifactCandidateFetchLimit, a8 as computeArtifactRecallLimit, a9 as computeQmdHybridFetchLimit, aa as dedupeEntitySynthesisEvidenceEntries, x as defaultWorkspaceDir, ab as deriveTopicsFromExtraction, ac as filterRecallCandidates, ad as formatCompressionGuidelinesForRecall, ae as graphPathRelativeToStorage, af as hasIdentityRecoveryIntent, ag as isArtifactMemoryPath, ah as lifecycleRecallScoreAdjustment, ai as mergeArtifactRecallCandidates, aj as mergeGraphExpandedResults, ak as resolveEffectiveIdentityInjectionMode, al as resolveEffectiveRecallMode, am as resolvePersistedMemoryRelativePath, an as resolveRecallModeDecision, ao as resolveRecallModeDecisionAsync, ap as resolveRecentThreadMemoryPaths, K as sanitizeSessionKeyForFilename, aq as shouldFilterLifecycleRecallCandidate, ar as summarizeGraphShadowComparison } from './orchestrator-DIDDvwDw.js';
10
+ export { L as BulkImportBatchIngestResult, M as BulkImportBatchPartialFailureError, N as GraphRecallRankedResult, Q as GraphRecallShadowComparison, G as GraphRecallSnapshot, I as IntentDebugSnapshot, O as Orchestrator, T as QmdRecallSnapshot, U as RecallInvocationOptions, V as RecallModeDecision, X as appendMemoryToGraphContext, Y as blendGraphExpandedRecallScore, Z as buildCompressionGuidelinesMarkdown, _ as buildMemoryPathById, $ as computeArtifactCandidateFetchLimit, a0 as computeArtifactRecallLimit, a1 as computeQmdHybridFetchLimit, a2 as dedupeEntitySynthesisEvidenceEntries, q as defaultWorkspaceDir, a3 as deriveTopicsFromExtraction, a4 as filterRecallCandidates, a5 as formatCompressionGuidelinesForRecall, a6 as graphPathRelativeToStorage, a7 as hasIdentityRecoveryIntent, a8 as isArtifactMemoryPath, a9 as lifecycleRecallScoreAdjustment, aa as mergeArtifactRecallCandidates, ab as mergeGraphExpandedResults, ac as resolveEffectiveIdentityInjectionMode, ad as resolveEffectiveRecallMode, ae as resolvePersistedMemoryRelativePath, af as resolveRecallModeDecision, ag as resolveRecallModeDecisionAsync, ah as resolveRecentThreadMemoryPaths, A as sanitizeSessionKeyForFilename, ai as shouldFilterLifecycleRecallCandidate, aj as summarizeGraphShadowComparison } from './orchestrator-CA6ouzBn.js';
11
11
  import './model-registry.js';
12
12
  import './relevance.js';
13
13
  import './negative.js';
@@ -23,6 +23,7 @@ import './types-Dm5xxVrr.js';
23
23
  import './lcm/engine.js';
24
24
  import './semantic-consolidation-CWch5uM7.js';
25
25
  import './conversation-index/backend.js';
26
+ import './catalog-COqWZlZ6.js';
26
27
  import './namespaces/search.js';
27
28
  import './shared-context/manager.js';
28
29
  import './compounding/engine.js';