@remnic/core 9.69.33 → 9.69.34

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 (759) hide show
  1. package/dist/access-admin-ops-surface.d.ts +13 -11
  2. package/dist/access-admin-ops-surface.js +61 -56
  3. package/dist/access-authorization-probe.d.ts +13 -11
  4. package/dist/access-authorization-probe.js +62 -57
  5. package/dist/access-boundary.d.ts +13 -11
  6. package/dist/access-boundary.js +61 -56
  7. package/dist/access-cli.js +129 -125
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +2 -1
  10. package/dist/access-coding-context-resolution.js +3 -3
  11. package/dist/access-extraction-force-flush.d.ts +13 -11
  12. package/dist/access-extraction-force-flush.js +61 -56
  13. package/dist/access-health-types.d.ts +2 -1
  14. package/dist/access-http-briefing.d.ts +13 -11
  15. package/dist/access-http-briefing.js +62 -57
  16. package/dist/access-http-lcm-compaction.d.ts +13 -11
  17. package/dist/access-http-lifecycle-flush.d.ts +13 -11
  18. package/dist/access-http-offline-stream.d.ts +13 -11
  19. package/dist/access-http-query.d.ts +3 -2
  20. package/dist/access-http-query.js +63 -58
  21. package/dist/access-http.d.ts +14 -12
  22. package/dist/access-http.js +82 -78
  23. package/dist/access-identity-continuity-surface.d.ts +11 -9
  24. package/dist/access-identity-continuity-surface.js +61 -56
  25. package/dist/access-lcm-surface.d.ts +13 -11
  26. package/dist/access-lcm-surface.js +61 -56
  27. package/dist/access-mcp.d.ts +13 -11
  28. package/dist/access-mcp.js +70 -66
  29. package/dist/access-memory-search-fanout.d.ts +3 -2
  30. package/dist/{access-namespace-preflight-DMR-jOMS.d.ts → access-namespace-preflight-kXG8MvYx.d.ts} +1 -1
  31. package/dist/access-namespace-preflight.d.ts +4 -3
  32. package/dist/access-namespace-preflight.js +61 -56
  33. package/dist/access-observe-transcript.d.ts +11 -9
  34. package/dist/access-observe-transcript.js +3 -3
  35. package/dist/access-observe-write-surface.d.ts +15 -13
  36. package/dist/access-observe-write-surface.js +61 -56
  37. package/dist/access-offline-manifest.d.ts +47 -11
  38. package/dist/access-offline-manifest.js +18 -16
  39. package/dist/access-operations-batch.js +64 -60
  40. package/dist/access-operations.d.ts +14 -12
  41. package/dist/access-operations.js +69 -65
  42. package/dist/access-recall-concurrency.d.ts +13 -11
  43. package/dist/access-recall-concurrency.js +61 -56
  44. package/dist/access-recall-response.d.ts +13 -11
  45. package/dist/access-recall-response.js +61 -56
  46. package/dist/access-recall-surface.d.ts +13 -11
  47. package/dist/access-recall-surface.js +61 -56
  48. package/dist/access-schema.d.ts +55 -13
  49. package/dist/access-schema.js +15 -1
  50. package/dist/{access-service-CJQoQvRa.d.ts → access-service-WUm2LnXZ.d.ts} +52 -50
  51. package/dist/access-service-helpers.d.ts +13 -11
  52. package/dist/access-service.d.ts +13 -11
  53. package/dist/access-service.js +61 -56
  54. package/dist/access-surface-catalog.d.ts +13 -11
  55. package/dist/access-surface-catalog.js +63 -58
  56. package/dist/access-surface-catalog.js.map +1 -1
  57. package/dist/access-wearables-meetings-surface.d.ts +4 -3
  58. package/dist/action-confidence.d.ts +2 -1
  59. package/dist/active-memory-bridge.d.ts +2 -1
  60. package/dist/active-memory-bridge.js +2 -2
  61. package/dist/active-recall.d.ts +2 -1
  62. package/dist/active-recall.js +12 -10
  63. package/dist/active-recall.js.map +1 -1
  64. package/dist/activity/digest.d.ts +2 -1
  65. package/dist/adapters/index.d.ts +46 -1
  66. package/dist/adapters/index.js +10 -6
  67. package/dist/adapters/registry.js +2 -2
  68. package/dist/ambient-provenance.d.ts +2 -1
  69. package/dist/artifact-search.d.ts +2 -1
  70. package/dist/{auto-sync-NSHLUAQI.js → auto-sync-4YFATLFQ.js} +10 -9
  71. package/dist/{auto-sync-NSHLUAQI.js.map → auto-sync-4YFATLFQ.js.map} +1 -1
  72. package/dist/behavior-learner.d.ts +2 -1
  73. package/dist/behavior-signals.d.ts +2 -1
  74. package/dist/bootstrap.d.ts +11 -9
  75. package/dist/briefing-window.d.ts +3 -2
  76. package/dist/briefing.d.ts +3 -2
  77. package/dist/briefing.js +25 -24
  78. package/dist/buffer-surprise-report.d.ts +2 -1
  79. package/dist/buffer-turn-helpers.d.ts +2 -1
  80. package/dist/buffer.d.ts +3 -2
  81. package/dist/buffer.js +11 -10
  82. package/dist/bulk-import/index.d.ts +4 -3
  83. package/dist/calibration.d.ts +2 -1
  84. package/dist/calibration.js +3 -2
  85. package/dist/calibration.js.map +1 -1
  86. package/dist/capabilities.d.ts +2 -1
  87. package/dist/{capsule-merge-IPG4IOFP.js → capsule-merge-ZCXUPLNJ.js} +2 -2
  88. package/dist/{catalog-8O9KY9eA.d.ts → catalog-BaCx29iv.d.ts} +1 -1
  89. package/dist/causal-behavior.d.ts +2 -1
  90. package/dist/causal-consolidation.d.ts +2 -1
  91. package/dist/causal-consolidation.js +26 -25
  92. package/dist/causal-consolidation.js.map +1 -1
  93. package/dist/causal-trajectory-graph.d.ts +2 -1
  94. package/dist/{chunk-CDKHKZL5.js → chunk-2524MOWK.js} +2 -2
  95. package/dist/{chunk-HVAEXYPL.js → chunk-255PC37A.js} +47 -25
  96. package/dist/chunk-255PC37A.js.map +1 -0
  97. package/dist/{chunk-7BMXZCOT.js → chunk-2AU4D4HQ.js} +3 -3
  98. package/dist/{chunk-LTIZHLV7.js → chunk-2JCA2PQT.js} +2 -2
  99. package/dist/{chunk-XXIHX75O.js → chunk-2UZ5ZH6W.js} +3 -3
  100. package/dist/{chunk-QOIOACIE.js → chunk-326KUXIR.js} +15 -648
  101. package/dist/chunk-326KUXIR.js.map +1 -0
  102. package/dist/{chunk-P3SB5BNT.js → chunk-34QW2LK2.js} +2 -2
  103. package/dist/{chunk-EONF76DT.js → chunk-36UBSLFN.js} +2 -2
  104. package/dist/{chunk-DBQWVT2H.js → chunk-3CBI2ZSA.js} +2 -2
  105. package/dist/{chunk-NZXEK3UF.js → chunk-3Q3N35W7.js} +2 -2
  106. package/dist/{chunk-YYGZJPOK.js → chunk-42DJ235G.js} +2 -2
  107. package/dist/{chunk-TCUKRAMK.js → chunk-4JVQRFZD.js} +7 -7
  108. package/dist/{chunk-22FVR2KE.js → chunk-4MIS4CQW.js} +6 -2
  109. package/dist/chunk-4MIS4CQW.js.map +1 -0
  110. package/dist/{chunk-PYLL63BF.js → chunk-4PB2MBY6.js} +9 -9
  111. package/dist/{chunk-UUQG7HAD.js → chunk-4WCNPQQ5.js} +4 -4
  112. package/dist/{chunk-UGPUYIET.js → chunk-5A7ZUOBA.js} +220 -399
  113. package/dist/chunk-5A7ZUOBA.js.map +1 -0
  114. package/dist/chunk-5HYUUFMQ.js +1280 -0
  115. package/dist/chunk-5HYUUFMQ.js.map +1 -0
  116. package/dist/{chunk-H4VH5VIB.js → chunk-5QBDLMGG.js} +2 -2
  117. package/dist/{chunk-RKBLRTNT.js → chunk-5SDSVX7N.js} +2 -2
  118. package/dist/{chunk-DGGB65KC.js → chunk-5THU7NFP.js} +3 -3
  119. package/dist/{chunk-N7RWREIQ.js → chunk-65RENJGB.js} +6 -1
  120. package/dist/chunk-65RENJGB.js.map +1 -0
  121. package/dist/{chunk-BPJNF7J2.js → chunk-6CCRSQWT.js} +2 -2
  122. package/dist/{chunk-XXE5P6HJ.js → chunk-6XYC7NM4.js} +2 -2
  123. package/dist/{chunk-J7HFPA6O.js → chunk-6YAIN5XJ.js} +2 -2
  124. package/dist/{chunk-I5DZ3WGR.js → chunk-757NP436.js} +3 -3
  125. package/dist/{chunk-2C3S7J2S.js → chunk-7CAY3YKP.js} +741 -28
  126. package/dist/chunk-7CAY3YKP.js.map +1 -0
  127. package/dist/{chunk-E6TDQRF6.js → chunk-7J2CGXG3.js} +2 -2
  128. package/dist/{chunk-BUTCAMJM.js → chunk-A2YQL2FF.js} +5 -5
  129. package/dist/chunk-A5UQ52YQ.js +211 -0
  130. package/dist/chunk-A5UQ52YQ.js.map +1 -0
  131. package/dist/{chunk-X2NFFBTO.js → chunk-A7GQBJP5.js} +4 -4
  132. package/dist/{chunk-R3HKWWUB.js → chunk-A7WOWDZK.js} +2 -2
  133. package/dist/{chunk-6N3TQFZU.js → chunk-AIKTQVV3.js} +3 -3
  134. package/dist/{chunk-CGC5UQCF.js → chunk-AKE4GGQ3.js} +2 -2
  135. package/dist/{chunk-W27OW7AB.js → chunk-APFKZVJS.js} +2 -2
  136. package/dist/{chunk-B325AGLK.js → chunk-AQIRQUCP.js} +2 -2
  137. package/dist/{chunk-S7T2TY65.js → chunk-AXFR2NQ5.js} +3 -3
  138. package/dist/{chunk-FCSZ4K2X.js → chunk-BJJWRWER.js} +3 -3
  139. package/dist/{chunk-JT3EB7ZL.js → chunk-BNGHPYZU.js} +5 -5
  140. package/dist/chunk-BRZWWUCJ.js +13 -0
  141. package/dist/{chunk-FYDW33ZB.js.map → chunk-BRZWWUCJ.js.map} +1 -1
  142. package/dist/{chunk-N57A4KPV.js → chunk-C2BFTYD7.js} +2 -2
  143. package/dist/{chunk-3JVLGJCY.js → chunk-C6KRO3SU.js} +2 -2
  144. package/dist/{chunk-Q726HSJO.js → chunk-CRUFVJOX.js} +16 -15
  145. package/dist/chunk-CRUFVJOX.js.map +1 -0
  146. package/dist/{chunk-X35W4S3L.js → chunk-D3IZCN5P.js} +4 -4
  147. package/dist/{chunk-44T3Y7SZ.js → chunk-EJIEQOPB.js} +5 -5
  148. package/dist/{chunk-ET356KSB.js → chunk-F4TWWUMP.js} +2 -2
  149. package/dist/{chunk-CLLPJ6QT.js → chunk-FQXJAC3T.js} +2 -2
  150. package/dist/{chunk-DD5JFCWM.js → chunk-GCBIXUPT.js} +2 -2
  151. package/dist/{chunk-N2ZNPHA3.js → chunk-IFFLUCCU.js} +2 -2
  152. package/dist/{chunk-RHQMKJFG.js → chunk-ISYZ5DUI.js} +51 -47
  153. package/dist/{chunk-RHQMKJFG.js.map → chunk-ISYZ5DUI.js.map} +1 -1
  154. package/dist/{chunk-PFFZWDPE.js → chunk-JZDH2ZZK.js} +3 -3
  155. package/dist/{chunk-TX2UTLXC.js → chunk-K6IPSW5B.js} +2 -2
  156. package/dist/{chunk-4MHYKEOM.js → chunk-KDJHLOZP.js} +10 -10
  157. package/dist/{chunk-KCB7F4J7.js → chunk-KYGOQV37.js} +2 -2
  158. package/dist/{chunk-JEIXTYVG.js → chunk-L2QLDZJC.js} +46 -17
  159. package/dist/chunk-L2QLDZJC.js.map +1 -0
  160. package/dist/{chunk-A7XEPMQ6.js → chunk-LAVJC57X.js} +3 -3
  161. package/dist/chunk-LAVJC57X.js.map +1 -0
  162. package/dist/{chunk-VZWXFXLX.js → chunk-LMCD5W5B.js} +2 -2
  163. package/dist/{chunk-3QQTXYZ6.js → chunk-LSLCFCCQ.js} +2 -1
  164. package/dist/chunk-LSLCFCCQ.js.map +1 -0
  165. package/dist/{chunk-MKD3OMPS.js → chunk-M3MYMWXG.js} +2 -2
  166. package/dist/{chunk-PL7FYKHT.js → chunk-MMG5K6XJ.js} +2 -2
  167. package/dist/{chunk-VGXM5B4H.js → chunk-MNIPH6LD.js} +2 -2
  168. package/dist/{chunk-E6JA6XWY.js → chunk-ND2O2PVN.js} +1013 -1317
  169. package/dist/chunk-ND2O2PVN.js.map +1 -0
  170. package/dist/chunk-NPNSKE76.js +220 -0
  171. package/dist/chunk-NPNSKE76.js.map +1 -0
  172. package/dist/{chunk-XU6OEECT.js → chunk-OQQXGYMX.js} +3 -3
  173. package/dist/{chunk-DB5TGMLZ.js → chunk-OZUXKUPD.js} +6 -4
  174. package/dist/{chunk-DB5TGMLZ.js.map → chunk-OZUXKUPD.js.map} +1 -1
  175. package/dist/chunk-PCEYGOSL.js +66 -0
  176. package/dist/chunk-PCEYGOSL.js.map +1 -0
  177. package/dist/{chunk-LSYDG6MJ.js → chunk-PEXW2JCK.js} +2 -2
  178. package/dist/{chunk-EEOUMG3J.js → chunk-PWPIERBM.js} +38 -6
  179. package/dist/chunk-PWPIERBM.js.map +1 -0
  180. package/dist/chunk-Q4AUIFUA.js +111 -0
  181. package/dist/chunk-Q4AUIFUA.js.map +1 -0
  182. package/dist/{chunk-SO7SV523.js → chunk-Q6LCCIZN.js} +1 -1
  183. package/dist/chunk-Q6LCCIZN.js.map +1 -0
  184. package/dist/{chunk-MOZXTRC2.js → chunk-QF4J3KMV.js} +19 -19
  185. package/dist/{chunk-JGHXXQ2G.js → chunk-QLJ6762U.js} +2 -2
  186. package/dist/{chunk-XOVKXJEP.js → chunk-R3TLVTWW.js} +3 -3
  187. package/dist/{chunk-CETXNLEX.js → chunk-RQO3J4MR.js} +2 -2
  188. package/dist/{chunk-5NANRSCD.js → chunk-RR7G2X7C.js} +5 -5
  189. package/dist/{chunk-DCJ3YFIC.js → chunk-S2ULTQZR.js} +2 -2
  190. package/dist/{chunk-EQHDH4C2.js → chunk-S76KRJDG.js} +3 -3
  191. package/dist/{chunk-H272ZPQ3.js → chunk-SHEHQBCG.js} +124 -23
  192. package/dist/chunk-SHEHQBCG.js.map +1 -0
  193. package/dist/{chunk-EEC4PCG5.js → chunk-SZDLX763.js} +2 -2
  194. package/dist/{chunk-MFDTVQJX.js → chunk-SZWEDG3H.js} +12 -6
  195. package/dist/chunk-SZWEDG3H.js.map +1 -0
  196. package/dist/{chunk-E2ZHGBAK.js → chunk-T2JSUEH6.js} +2 -2
  197. package/dist/{chunk-JSN44KIB.js → chunk-T2YFZ27G.js} +9 -9
  198. package/dist/{chunk-227UFSEQ.js → chunk-TFA6HPOA.js} +2 -2
  199. package/dist/{chunk-BA6WOZOT.js → chunk-TK4FHQRN.js} +4 -4
  200. package/dist/chunk-TLHNF6GA.js +647 -0
  201. package/dist/chunk-TLHNF6GA.js.map +1 -0
  202. package/dist/{chunk-NB5BCFUY.js → chunk-TWYTGIBR.js} +4 -4
  203. package/dist/{chunk-FDLDOEO6.js → chunk-UBG4GAEP.js} +51 -6
  204. package/dist/chunk-UBG4GAEP.js.map +1 -0
  205. package/dist/{chunk-MWFGUESQ.js → chunk-UEZKN6VR.js} +2 -2
  206. package/dist/{chunk-H5AFCNGA.js → chunk-UJX4I26O.js} +2 -2
  207. package/dist/{chunk-BLUYQFRH.js → chunk-VELCIWJZ.js} +15 -11
  208. package/dist/chunk-VELCIWJZ.js.map +1 -0
  209. package/dist/{chunk-PBGVVDLY.js → chunk-VIZR45AN.js} +2 -2
  210. package/dist/{chunk-ZG74PWRW.js → chunk-VZAKYDMJ.js} +2 -2
  211. package/dist/{chunk-JTH2SE6B.js → chunk-W5BLTZZJ.js} +8 -8
  212. package/dist/chunk-W6IJMWTZ.js +72 -0
  213. package/dist/chunk-W6IJMWTZ.js.map +1 -0
  214. package/dist/{chunk-H3TKENU4.js → chunk-WIKO4SCR.js} +5 -5
  215. package/dist/{chunk-YFLLGRXO.js → chunk-X2QPKLPL.js} +2 -2
  216. package/dist/{chunk-MN3LK3KN.js → chunk-X424T5JQ.js} +2 -2
  217. package/dist/{chunk-5BCNEBEN.js → chunk-XPJNT6PI.js} +4 -4
  218. package/dist/{chunk-2JVJ7UHC.js → chunk-XQU3CPF2.js} +4 -2
  219. package/dist/chunk-XQU3CPF2.js.map +1 -0
  220. package/dist/chunk-XW2T4QAW.js +1 -0
  221. package/dist/{chunk-D223ZDQV.js → chunk-YEDVOYL2.js} +2 -2
  222. package/dist/{chunk-TLPZ6MKZ.js → chunk-YEN4TREG.js} +541 -5
  223. package/dist/chunk-YEN4TREG.js.map +1 -0
  224. package/dist/{chunk-RC5DXXWC.js → chunk-YM7YN37H.js} +2 -2
  225. package/dist/{chunk-VLXBE57O.js → chunk-YVGXH72Y.js} +2 -2
  226. package/dist/{chunk-YQAXP5AC.js → chunk-YXLUTALO.js} +5 -5
  227. package/dist/{chunk-OQDPBRQ6.js → chunk-Z7YDVHDI.js} +2 -2
  228. package/dist/{chunk-O75CRYGF.js → chunk-ZEFVK7XC.js} +1 -1
  229. package/dist/chunk-ZEFVK7XC.js.map +1 -0
  230. package/dist/{chunk-XUE46UYW.js → chunk-ZLN7AROH.js} +6 -6
  231. package/dist/{chunk-HV7OY4DM.js → chunk-ZMKYCFJ7.js} +640 -199
  232. package/dist/chunk-ZMKYCFJ7.js.map +1 -0
  233. package/dist/{chunk-HK32G473.js → chunk-ZWEZXVYH.js} +2 -2
  234. package/dist/{cli-D57e2Mqt.d.ts → cli-5mTYh1Tn.d.ts} +5 -5
  235. package/dist/cli-fallback.d.ts +11 -4
  236. package/dist/cli-fallback.js +5 -1
  237. package/dist/cli.d.ts +15 -13
  238. package/dist/cli.js +102 -98
  239. package/dist/coding/export-okf-codegraph.d.ts +2 -1
  240. package/dist/coding/export-okf-codegraph.js +31 -29
  241. package/dist/coding/export-okf-codegraph.js.map +1 -1
  242. package/dist/coding/pre-action-gate.d.ts +2 -1
  243. package/dist/compat/checks.js +2 -2
  244. package/dist/compat/codex-cli-fallback.d.ts +1 -1
  245. package/dist/compat/codex-cli-fallback.js +5 -1
  246. package/dist/compat/codex-cli-fallback.js.map +1 -1
  247. package/dist/compounding/engine.d.ts +3 -2
  248. package/dist/compounding/engine.js +26 -25
  249. package/dist/compounding/preference-consolidator.d.ts +2 -1
  250. package/dist/compression-optimizer.d.ts +2 -1
  251. package/dist/config.d.ts +2 -1
  252. package/dist/config.js +12 -10
  253. package/dist/connectors/codex-materialize-runner.d.ts +2 -1
  254. package/dist/connectors/codex-materialize-runner.js +25 -24
  255. package/dist/connectors/codex-materialize.d.ts +2 -1
  256. package/dist/connectors/index.d.ts +2 -1
  257. package/dist/connectors/index.js +27 -26
  258. package/dist/consolidation-provenance-check.d.ts +3 -2
  259. package/dist/consolidation-undo.d.ts +3 -2
  260. package/dist/contradiction/index.d.ts +4 -3
  261. package/dist/contradiction/index.js +5 -5
  262. package/dist/{contradiction-scan-NOYMFG66.js → contradiction-scan-GVD4JJ7B.js} +3 -3
  263. package/dist/converge-config.d.ts +2 -1
  264. package/dist/convergence-refresh.d.ts +3 -2
  265. package/dist/convergence-refresh.js +27 -26
  266. package/dist/conversation-index/backend.d.ts +2 -1
  267. package/dist/conversation-index/backend.js +3 -3
  268. package/dist/conversation-index/chunker.d.ts +2 -1
  269. package/dist/conversation-index/faiss-adapter.d.ts +2 -1
  270. package/dist/conversation-index/faiss-adapter.js +2 -2
  271. package/dist/conversation-index/indexer.d.ts +2 -1
  272. package/dist/conversation-index/search.d.ts +2 -1
  273. package/dist/corpus-watermark.d.ts +2 -1
  274. package/dist/corpus-watermark.js +28 -27
  275. package/dist/cross-lingual-recall.d.ts +2 -1
  276. package/dist/day-summary.d.ts +2 -1
  277. package/dist/deep-recall-http-glue.d.ts +13 -11
  278. package/dist/deep-recall-http-glue.js +12 -2
  279. package/dist/deep-recall-mcp-tools.d.ts +13 -11
  280. package/dist/deep-recall-policy-llm.d.ts +2 -1
  281. package/dist/deep-recall-policy-llm.js +4 -3
  282. package/dist/deep-recall-seeds.d.ts +2 -1
  283. package/dist/delinearize.d.ts +2 -1
  284. package/dist/dependency-propagation-config.d.ts +2 -1
  285. package/dist/{dependency-propagation-delivery-CmniEsUK.d.ts → dependency-propagation-delivery-CDQCxNll.d.ts} +1 -1
  286. package/dist/direct-answer-wiring.d.ts +2 -1
  287. package/dist/direct-answer.d.ts +2 -1
  288. package/dist/embedding-fallback.d.ts +2 -1
  289. package/dist/enrichment/index.d.ts +2 -1
  290. package/dist/entity-origin-fields.d.ts +2 -1
  291. package/dist/entity-retrieval.d.ts +3 -2
  292. package/dist/entity-retrieval.js +25 -24
  293. package/dist/entity-schema.d.ts +2 -1
  294. package/dist/episodic-context.d.ts +2 -1
  295. package/dist/eval-trajectory-contracts.d.ts +2 -1
  296. package/dist/eval-trajectory-store.d.ts +2 -1
  297. package/dist/eval-trajectory.d.ts +2 -1
  298. package/dist/explicit-capture.d.ts +11 -9
  299. package/dist/explicit-capture.js +6 -6
  300. package/dist/external-wiki-access.d.ts +13 -11
  301. package/dist/external-wiki-access.js +62 -57
  302. package/dist/external-wiki-collection-registration.d.ts +2 -1
  303. package/dist/external-wiki-collection.d.ts +2 -1
  304. package/dist/external-wiki-mcp-tools.d.ts +13 -11
  305. package/dist/extraction-error-classification.d.ts +2 -1
  306. package/dist/extraction-faithfulness.d.ts +2 -1
  307. package/dist/extraction-faithfulness.js +4 -3
  308. package/dist/extraction-judge-telemetry.d.ts +2 -1
  309. package/dist/extraction-judge-training.d.ts +2 -1
  310. package/dist/extraction-judge.d.ts +2 -1
  311. package/dist/extraction-judge.js +5 -4
  312. package/dist/extraction-liveness.d.ts +2 -1
  313. package/dist/extraction-normalization.d.ts +2 -1
  314. package/dist/extraction-prompt.d.ts +2 -1
  315. package/dist/extraction-source-grounding-rules.d.ts +2 -1
  316. package/dist/extraction-source-grounding.d.ts +2 -1
  317. package/dist/extraction.d.ts +2 -1
  318. package/dist/extraction.js +36 -34
  319. package/dist/fallback-llm.d.ts +2 -1
  320. package/dist/fallback-llm.js +3 -2
  321. package/dist/{first-start-migration-RC345GPL.js → first-start-migration-L3UFX5CU.js} +3 -3
  322. package/dist/generic-recall-paths-CqAZyXKX.d.ts +23 -0
  323. package/dist/graph-append-error.d.ts +2 -1
  324. package/dist/graph-dashboard-diff.d.ts +2 -1
  325. package/dist/graph-dashboard-key.d.ts +2 -1
  326. package/dist/graph-dashboard-parser.d.ts +2 -1
  327. package/dist/graph-edge-reinforcement.d.ts +2 -1
  328. package/dist/graph-jsonl.d.ts +2 -1
  329. package/dist/graph-path-reconstruction.d.ts +2 -1
  330. package/dist/graph-path-scoring.d.ts +2 -1
  331. package/dist/graph-snapshot.d.ts +2 -1
  332. package/dist/graph.d.ts +2 -1
  333. package/dist/harmonic-retrieval.js +2 -2
  334. package/dist/importance.d.ts +2 -1
  335. package/dist/importers/index.d.ts +2 -1
  336. package/dist/importers/test-utils.d.ts +2 -1
  337. package/dist/in-flight-reads.d.ts +2 -1
  338. package/dist/{index-BTAsSkPG.d.ts → index-BNluTxBp.d.ts} +2 -2
  339. package/dist/index.d.ts +302 -245
  340. package/dist/index.js +307 -205
  341. package/dist/intent.d.ts +2 -1
  342. package/dist/lcm/engine.d.ts +2 -1
  343. package/dist/lcm/engine.js +2 -2
  344. package/dist/lcm/index.d.ts +2 -1
  345. package/dist/lcm/index.js +4 -4
  346. package/dist/lcm/tools.d.ts +2 -1
  347. package/dist/lifecycle.d.ts +2 -1
  348. package/dist/live-connectors-runner.d.ts +2 -1
  349. package/dist/local-llm.d.ts +4 -1
  350. package/dist/local-llm.js +2 -2
  351. package/dist/local-model-endpoint.d.ts +2 -1
  352. package/dist/location/index.d.ts +4 -3
  353. package/dist/location/index.js +28 -27
  354. package/dist/maintenance/memory-governance.d.ts +2 -1
  355. package/dist/maintenance/memory-governance.js +25 -24
  356. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
  357. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +25 -24
  358. package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
  359. package/dist/maintenance/rebuild-memory-projection.js +26 -25
  360. package/dist/{maintenance-DCvQGTzL.d.ts → maintenance-8hmWOMY_.d.ts} +378 -4
  361. package/dist/mcp-memory-inspector-app.d.ts +13 -11
  362. package/dist/memory-action-policy.d.ts +2 -1
  363. package/dist/memory-cache.d.ts +2 -1
  364. package/dist/memory-controller.d.ts +2 -1
  365. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  366. package/dist/memory-projection-store.d.ts +2 -1
  367. package/dist/memory-provenance.d.ts +2 -1
  368. package/dist/memory-snapshot.d.ts +2 -1
  369. package/dist/memory-subject-cli.d.ts +13 -11
  370. package/dist/memory-subject.d.ts +13 -11
  371. package/dist/memory-worth-outcomes.d.ts +3 -2
  372. package/dist/migrate/from-engram.js +2 -2
  373. package/dist/models-json.d.ts +2 -1
  374. package/dist/namespaces/migrate.d.ts +4 -3
  375. package/dist/namespaces/migrate.js +26 -25
  376. package/dist/namespaces/principal.d.ts +2 -1
  377. package/dist/namespaces/search.d.ts +2 -1
  378. package/dist/namespaces/search.js +8 -8
  379. package/dist/namespaces/storage.d.ts +4 -3
  380. package/dist/namespaces/storage.js +25 -24
  381. package/dist/native-knowledge.d.ts +2 -1
  382. package/dist/network/tailscale.js +2 -2
  383. package/dist/offline-sync-impression-drain.d.ts +2 -1
  384. package/dist/offline-sync-impression-drain.js +6 -6
  385. package/dist/operator-doctor-corpus.d.ts +2 -1
  386. package/dist/operator-doctor-corpus.js +29 -28
  387. package/dist/operator-doctor-replica.d.ts +2 -1
  388. package/dist/operator-toolkit.d.ts +4 -3
  389. package/dist/operator-toolkit.js +43 -41
  390. package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
  391. package/dist/orchestration/maintenance.d.ts +5 -4
  392. package/dist/orchestration/maintenance.js +43 -38
  393. package/dist/{orchestrator-CvCsp1tz.d.ts → orchestrator-BUd_3Q86.d.ts} +17 -29
  394. package/dist/orchestrator.d.ts +11 -9
  395. package/dist/orchestrator.js +133 -127
  396. package/dist/patterns-cli.d.ts +2 -1
  397. package/dist/{pipeline-JAdwKBS7.d.ts → pipeline-Dv1Bv0ma.d.ts} +1 -1
  398. package/dist/policy-runtime.d.ts +2 -1
  399. package/dist/proactive-contention.d.ts +2 -1
  400. package/dist/provenance.d.ts +2 -1
  401. package/dist/{public-http-h-yWu9rj.d.ts → public-http-L-IymRBN.d.ts} +1 -1
  402. package/dist/{qmd-Cvw9RWKr.d.ts → qmd-Mj508lHA.d.ts} +1 -1
  403. package/dist/qmd-preflight.d.ts +3 -2
  404. package/dist/qmd-recall-cache.d.ts +2 -1
  405. package/dist/qmd.d.ts +3 -2
  406. package/dist/qmd.js +2 -2
  407. package/dist/recall-concurrency-config.d.ts +2 -1
  408. package/dist/recall-disclosure-escalation.d.ts +2 -1
  409. package/dist/recall-explain-renderer.d.ts +2 -1
  410. package/dist/recall-explain-renderer.js +3 -3
  411. package/dist/recall-memory-map.d.ts +2 -1
  412. package/dist/recall-navigate-access.d.ts +2 -1
  413. package/dist/recall-navigate-access.js +2 -2
  414. package/dist/recall-navigate-disclosure.d.ts +2 -1
  415. package/dist/recall-navigate-disclosure.js +1 -1
  416. package/dist/recall-navigate.d.ts +2 -1
  417. package/dist/recall-navigate.js +2 -2
  418. package/dist/recall-planner-llm.d.ts +2 -1
  419. package/dist/recall-planner-llm.js +3 -2
  420. package/dist/recall-planner-llm.js.map +1 -1
  421. package/dist/recall-state-view-admission.d.ts +56 -0
  422. package/dist/recall-state-view-admission.js +39 -0
  423. package/dist/recall-state-view-inject.js +2 -2
  424. package/dist/recall-state-view-render.js +2 -2
  425. package/dist/recall-state-view-widen.d.ts +18 -1
  426. package/dist/recall-state-view-widen.js +2 -2
  427. package/dist/recall-state-view-wire.d.ts +1 -1
  428. package/dist/recall-state-view-wire.js +3 -3
  429. package/dist/recall-state-view.d.ts +1 -0
  430. package/dist/recall-state-view.js +1 -1
  431. package/dist/recall-state.d.ts +2 -1
  432. package/dist/recall-tag-filter.d.ts +2 -1
  433. package/dist/recall-timings.d.ts +2 -1
  434. package/dist/recall-xray-cli.d.ts +2 -1
  435. package/dist/recall-xray-cli.js +4 -4
  436. package/dist/recall-xray-renderer.d.ts +2 -1
  437. package/dist/recall-xray-renderer.js +3 -3
  438. package/dist/recall-xray.d.ts +9 -1
  439. package/dist/recall-xray.js +2 -2
  440. package/dist/reconcile/cursor.d.ts +11 -2
  441. package/dist/reconcile/cursor.js +6 -4
  442. package/dist/reconcile/cursor.js.map +1 -1
  443. package/dist/reconcile/manifest.d.ts +37 -2
  444. package/dist/reconcile/manifest.js +15 -5
  445. package/dist/reconcile/plan.d.ts +2 -1
  446. package/dist/replay/normalizers/chatgpt.d.ts +2 -1
  447. package/dist/replay/normalizers/claude.d.ts +2 -1
  448. package/dist/replay/normalizers/openclaw.d.ts +2 -1
  449. package/dist/replay/normalizers/shared.d.ts +2 -1
  450. package/dist/replay/runner.d.ts +2 -1
  451. package/dist/replay/types.d.ts +2 -1
  452. package/dist/replica-divergence.d.ts +2 -1
  453. package/dist/replica-peers-config.d.ts +2 -1
  454. package/dist/{resolution-VKATP2HT.js → resolution-OHJZG45O.js} +6 -6
  455. package/dist/resolution-OHJZG45O.js.map +1 -0
  456. package/dist/resolve-auth-token.d.ts +2 -1
  457. package/dist/resume-bundles.js +13 -11
  458. package/dist/retrieval-agents.d.ts +3 -2
  459. package/dist/retrieval-tiers.d.ts +2 -1
  460. package/dist/routing/engine.d.ts +2 -1
  461. package/dist/routing/store.d.ts +2 -1
  462. package/dist/runtime/child-process.d.ts +1 -1
  463. package/dist/runtime/child-process.js +1 -1
  464. package/dist/salvage-envelope.d.ts +2 -1
  465. package/dist/salvage-envelope.js +2 -2
  466. package/dist/{scope-profiles-BShpTPeV.d.ts → scope-profiles-B6BGVbxm.d.ts} +1 -1
  467. package/dist/search/embed-helper.d.ts +2 -1
  468. package/dist/search/factory.d.ts +2 -1
  469. package/dist/search/factory.js +7 -7
  470. package/dist/search/index.d.ts +2 -1
  471. package/dist/search/index.js +11 -11
  472. package/dist/search/lancedb-backend.d.ts +2 -1
  473. package/dist/search/meilisearch-backend.d.ts +2 -1
  474. package/dist/search/noop-backend.d.ts +2 -1
  475. package/dist/search/orama-backend.d.ts +2 -1
  476. package/dist/search/port.d.ts +2 -1
  477. package/dist/search/remote-backend.d.ts +2 -1
  478. package/dist/{semantic-consolidation-CusOpe9F.d.ts → semantic-consolidation-J-598F5M.d.ts} +1 -1
  479. package/dist/semantic-consolidation.d.ts +3 -2
  480. package/dist/semantic-consolidation.js +26 -25
  481. package/dist/semantic-rule-promotion.js +25 -24
  482. package/dist/semantic-rule-verifier.d.ts +2 -1
  483. package/dist/semantic-rule-verifier.js +25 -24
  484. package/dist/{service-BbuVh1eS.d.ts → service-ZQkJ52cz.d.ts} +2 -2
  485. package/dist/session-observer-bands.d.ts +2 -1
  486. package/dist/session-observer-state.d.ts +2 -1
  487. package/dist/shared-context/manager.d.ts +2 -1
  488. package/dist/signal.d.ts +2 -1
  489. package/dist/source-agent-qualifier.d.ts +2 -1
  490. package/dist/source-agent-qualifier.js +34 -32
  491. package/dist/standup/build.js +25 -24
  492. package/dist/{storage-BBLLuVTF.d.ts → storage-CU_hZUgP.d.ts} +67 -6
  493. package/dist/storage.d.ts +4 -3
  494. package/dist/storage.js +24 -23
  495. package/dist/subject-config.d.ts +2 -1
  496. package/dist/subject-config.js +2 -2
  497. package/dist/summarizer.d.ts +2 -1
  498. package/dist/summarizer.js +5 -5
  499. package/dist/summary-snapshot.d.ts +2 -1
  500. package/dist/support-passport/index.d.ts +49 -15
  501. package/dist/support-passport/index.js +69 -60
  502. package/dist/temporal-supersession.d.ts +3 -2
  503. package/dist/temporal-timeline-recall.d.ts +2 -1
  504. package/dist/temporal-validity.d.ts +2 -1
  505. package/dist/threading.d.ts +2 -1
  506. package/dist/tier-migration.d.ts +3 -2
  507. package/dist/tier-routing.d.ts +2 -1
  508. package/dist/tier-routing.js +2 -2
  509. package/dist/{tier-stats-KA6OZX2C.js → tier-stats-VK5PCO2L.js} +3 -3
  510. package/dist/topics.d.ts +2 -1
  511. package/dist/transcript.d.ts +2 -1
  512. package/dist/transfer/capsule-import.js +1 -1
  513. package/dist/transfer/export-okf.d.ts +2 -1
  514. package/dist/transfer/export-okf.js +26 -25
  515. package/dist/transfer/types.d.ts +24 -24
  516. package/dist/trust-score-stage.d.ts +2 -1
  517. package/dist/trust-score.d.ts +2 -1
  518. package/dist/{types-igV4-sbB.d.ts → types-BGxTvLBO.d.ts} +58 -13
  519. package/dist/types.d.ts +2 -1
  520. package/dist/types.js +1 -1
  521. package/dist/utility-runtime.d.ts +2 -1
  522. package/dist/verified-recall.js +25 -24
  523. package/dist/who-knows-cli.d.ts +13 -11
  524. package/dist/who-knows-cli.js +26 -25
  525. package/dist/who-knows.d.ts +13 -11
  526. package/dist/who-knows.js +25 -24
  527. package/dist/write-envelope.d.ts +4 -2
  528. package/dist/write-envelope.js +3 -1
  529. package/package.json +2 -2
  530. package/src/access-category-alias.test.ts +216 -0
  531. package/src/access-mcp.test.ts +73 -0
  532. package/src/access-mcp.ts +6 -6
  533. package/src/access-observe-write-surface.ts +19 -4
  534. package/src/access-offline-manifest.ts +297 -16
  535. package/src/access-recall-surface.ts +5 -5
  536. package/src/access-schema.ts +76 -7
  537. package/src/access-service.ts +11 -2
  538. package/src/activity/config.test.ts +124 -1
  539. package/src/activity/config.ts +150 -18
  540. package/src/activity/index.ts +3 -0
  541. package/src/activity/journal-extract-storage.test.ts +129 -0
  542. package/src/activity/journal-extract.test.ts +314 -0
  543. package/src/activity/journal-extract.ts +247 -0
  544. package/src/activity/journal-heading.test.ts +24 -1
  545. package/src/activity/journal-heading.ts +36 -0
  546. package/src/activity/journal-read.test.ts +242 -0
  547. package/src/activity/journal-read.ts +183 -0
  548. package/src/activity/journal-source.test.ts +15 -15
  549. package/src/activity/journal-source.ts +21 -14
  550. package/src/activity/journal-state.lock-worker.ts +30 -0
  551. package/src/activity/journal-state.test.ts +144 -0
  552. package/src/activity/journal-state.ts +107 -0
  553. package/src/activity/journal-strip.test.ts +106 -52
  554. package/src/activity/journal-strip.ts +35 -10
  555. package/src/activity/journal-vault-integration.test.ts +230 -0
  556. package/src/activity/journal-vault-provenance.test.ts +9 -7
  557. package/src/activity/journal-vault-provenance.ts +4 -10
  558. package/src/activity/journal-vault-read.test.ts +3 -2
  559. package/src/activity/journal-vault-read.ts +9 -139
  560. package/src/activity/journal.test.ts +74 -23
  561. package/src/activity/runner.test.ts +116 -1
  562. package/src/activity/runner.ts +25 -0
  563. package/src/activity/scheduler.ts +4 -0
  564. package/src/activity/store.test.ts +18 -0
  565. package/src/activity/store.ts +14 -0
  566. package/src/activity/sync-registration.ts +4 -0
  567. package/src/activity/timeline/analysis-metadata.ts +2 -0
  568. package/src/activity/timeline/analysis-provider.ts +140 -0
  569. package/src/activity/timeline/analysis-run.test.ts +419 -0
  570. package/src/activity/timeline/analysis-run.ts +106 -0
  571. package/src/activity/timeline/analysis.ts +66 -37
  572. package/src/activity/timeline/corrections.ts +9 -0
  573. package/src/activity/timeline/index.ts +3 -0
  574. package/src/activity/timeline/query.test.ts +71 -0
  575. package/src/activity/timeline/query.ts +57 -8
  576. package/src/activity/timeline/regenerate.test.ts +505 -0
  577. package/src/activity/timeline/regenerate.ts +373 -0
  578. package/src/activity/types.ts +40 -5
  579. package/src/adapters/grok-opencode.test.ts +146 -0
  580. package/src/adapters/grok.ts +53 -0
  581. package/src/adapters/index.ts +2 -0
  582. package/src/adapters/opencode.ts +52 -0
  583. package/src/adapters/registry.ts +4 -0
  584. package/src/cli-fallback.ts +13 -4
  585. package/src/config.test.ts +3 -1
  586. package/src/config.ts +4 -0
  587. package/src/dedup/merge.test.ts +732 -25
  588. package/src/fallback-llm.test.ts +53 -0
  589. package/src/fallback-llm.ts +12 -0
  590. package/src/index.ts +2 -0
  591. package/src/local-llm.ts +3 -1
  592. package/src/orchestration/dependency-propagation-recovery-replay.ts +1 -1
  593. package/src/orchestration/extraction-persist-deps.ts +9 -0
  594. package/src/orchestration/extraction-persist-promotion.test.ts +265 -6
  595. package/src/orchestration/extraction-persist-promotion.ts +42 -3
  596. package/src/orchestration/extraction-persist.ts +3 -3
  597. package/src/orchestration/harmonic-construction-persist.test.ts +115 -4
  598. package/src/orchestration/harmonic-construction-persist.ts +34 -6
  599. package/src/orchestration/maintenance.ts +1 -0
  600. package/src/orchestration/orchestrator-helpers.ts +6 -0
  601. package/src/orchestration/recall-entry.ts +16 -0
  602. package/src/orchestration/recall-internal-deps.ts +14 -0
  603. package/src/orchestration/recall-internal.ts +41 -58
  604. package/src/orchestration/recall-result-formatter.ts +11 -1
  605. package/src/orchestration/recall-search-pipeline.ts +121 -11
  606. package/src/orchestration/recall-state-view-pipeline.test.ts +211 -0
  607. package/src/orchestration/semantic-merge-commit-effects.ts +76 -17
  608. package/src/orchestration/semantic-merge-persist.ts +121 -16
  609. package/src/orchestration/semantic-merge-promotion-payload.ts +133 -54
  610. package/src/orchestrator.ts +7 -35
  611. package/src/providers/codex-subscription.test.ts +666 -0
  612. package/src/providers/codex-subscription.ts +743 -0
  613. package/src/recall-disclosure.test.ts +20 -0
  614. package/src/recall-state-view-admission.ts +114 -0
  615. package/src/recall-state-view-asof.test.ts +176 -0
  616. package/src/recall-state-view-call.test.ts +175 -0
  617. package/src/recall-state-view-config.test.ts +16 -0
  618. package/src/recall-state-view-widen.test.ts +70 -0
  619. package/src/recall-state-view-widen.ts +28 -7
  620. package/src/recall-state-view-wire.ts +3 -1
  621. package/src/recall-state-view-zero-diff.test.ts +20 -11
  622. package/src/recall-state-view.test.ts +142 -0
  623. package/src/recall-state-view.ts +72 -24
  624. package/src/recall-xray-renderer.test.ts +27 -0
  625. package/src/recall-xray-renderer.ts +4 -0
  626. package/src/recall-xray.ts +13 -0
  627. package/src/reconcile/cursor.ts +23 -33
  628. package/src/reconcile/manifest.ts +96 -11
  629. package/src/reconcile-identity-cache.test.ts +378 -0
  630. package/src/runtime/child-process.ts +1 -1
  631. package/src/storage/cas-revision-host.ts +75 -0
  632. package/src/storage/cas-revision-store.test.ts +459 -0
  633. package/src/storage/cas-revision-store.ts +661 -0
  634. package/src/storage/deletion-revision-store.ts +80 -6
  635. package/src/storage/tombstone-blocked-capture-index.ts +15 -0
  636. package/src/storage/tombstone-blocked-capture-mutation.ts +67 -7
  637. package/src/storage/tombstone-blocked-capture-sync.ts +55 -20
  638. package/src/storage-contract/failure-semantics.test.ts +1 -1
  639. package/src/storage-frontmatter-cas.test.ts +698 -1
  640. package/src/storage-replay.test.ts +166 -3
  641. package/src/storage.ts +41 -41
  642. package/src/support-passport/card-projection.ts +82 -33
  643. package/src/temporal-supersession.test.ts +10 -10
  644. package/src/types.ts +7 -7
  645. package/src/write-envelope.ts +1 -1
  646. package/dist/chunk-22FVR2KE.js.map +0 -1
  647. package/dist/chunk-2C3S7J2S.js.map +0 -1
  648. package/dist/chunk-2JVJ7UHC.js.map +0 -1
  649. package/dist/chunk-2QSZNTDO.js +0 -56
  650. package/dist/chunk-2QSZNTDO.js.map +0 -1
  651. package/dist/chunk-3QQTXYZ6.js.map +0 -1
  652. package/dist/chunk-5VCDKQWQ.js +0 -560
  653. package/dist/chunk-5VCDKQWQ.js.map +0 -1
  654. package/dist/chunk-A7XEPMQ6.js.map +0 -1
  655. package/dist/chunk-BLUYQFRH.js.map +0 -1
  656. package/dist/chunk-E6JA6XWY.js.map +0 -1
  657. package/dist/chunk-EEOUMG3J.js.map +0 -1
  658. package/dist/chunk-FDLDOEO6.js.map +0 -1
  659. package/dist/chunk-FYDW33ZB.js +0 -13
  660. package/dist/chunk-H272ZPQ3.js.map +0 -1
  661. package/dist/chunk-HV7OY4DM.js.map +0 -1
  662. package/dist/chunk-HVAEXYPL.js.map +0 -1
  663. package/dist/chunk-JEIXTYVG.js.map +0 -1
  664. package/dist/chunk-LRICZIGN.js +0 -52
  665. package/dist/chunk-LRICZIGN.js.map +0 -1
  666. package/dist/chunk-MFDTVQJX.js.map +0 -1
  667. package/dist/chunk-N7RWREIQ.js.map +0 -1
  668. package/dist/chunk-O75CRYGF.js.map +0 -1
  669. package/dist/chunk-Q726HSJO.js.map +0 -1
  670. package/dist/chunk-QOIOACIE.js.map +0 -1
  671. package/dist/chunk-SEDEKFYQ.js +0 -1
  672. package/dist/chunk-SO7SV523.js.map +0 -1
  673. package/dist/chunk-TLPZ6MKZ.js.map +0 -1
  674. package/dist/chunk-UGPUYIET.js.map +0 -1
  675. package/src/activity/journal-mode.test.ts +0 -32
  676. package/src/activity/journal-mode.ts +0 -20
  677. /package/dist/{capsule-merge-IPG4IOFP.js.map → capsule-merge-ZCXUPLNJ.js.map} +0 -0
  678. /package/dist/{chunk-CDKHKZL5.js.map → chunk-2524MOWK.js.map} +0 -0
  679. /package/dist/{chunk-7BMXZCOT.js.map → chunk-2AU4D4HQ.js.map} +0 -0
  680. /package/dist/{chunk-LTIZHLV7.js.map → chunk-2JCA2PQT.js.map} +0 -0
  681. /package/dist/{chunk-XXIHX75O.js.map → chunk-2UZ5ZH6W.js.map} +0 -0
  682. /package/dist/{chunk-P3SB5BNT.js.map → chunk-34QW2LK2.js.map} +0 -0
  683. /package/dist/{chunk-EONF76DT.js.map → chunk-36UBSLFN.js.map} +0 -0
  684. /package/dist/{chunk-DBQWVT2H.js.map → chunk-3CBI2ZSA.js.map} +0 -0
  685. /package/dist/{chunk-NZXEK3UF.js.map → chunk-3Q3N35W7.js.map} +0 -0
  686. /package/dist/{chunk-YYGZJPOK.js.map → chunk-42DJ235G.js.map} +0 -0
  687. /package/dist/{chunk-TCUKRAMK.js.map → chunk-4JVQRFZD.js.map} +0 -0
  688. /package/dist/{chunk-PYLL63BF.js.map → chunk-4PB2MBY6.js.map} +0 -0
  689. /package/dist/{chunk-UUQG7HAD.js.map → chunk-4WCNPQQ5.js.map} +0 -0
  690. /package/dist/{chunk-H4VH5VIB.js.map → chunk-5QBDLMGG.js.map} +0 -0
  691. /package/dist/{chunk-RKBLRTNT.js.map → chunk-5SDSVX7N.js.map} +0 -0
  692. /package/dist/{chunk-DGGB65KC.js.map → chunk-5THU7NFP.js.map} +0 -0
  693. /package/dist/{chunk-BPJNF7J2.js.map → chunk-6CCRSQWT.js.map} +0 -0
  694. /package/dist/{chunk-XXE5P6HJ.js.map → chunk-6XYC7NM4.js.map} +0 -0
  695. /package/dist/{chunk-J7HFPA6O.js.map → chunk-6YAIN5XJ.js.map} +0 -0
  696. /package/dist/{chunk-I5DZ3WGR.js.map → chunk-757NP436.js.map} +0 -0
  697. /package/dist/{chunk-E6TDQRF6.js.map → chunk-7J2CGXG3.js.map} +0 -0
  698. /package/dist/{chunk-BUTCAMJM.js.map → chunk-A2YQL2FF.js.map} +0 -0
  699. /package/dist/{chunk-X2NFFBTO.js.map → chunk-A7GQBJP5.js.map} +0 -0
  700. /package/dist/{chunk-R3HKWWUB.js.map → chunk-A7WOWDZK.js.map} +0 -0
  701. /package/dist/{chunk-6N3TQFZU.js.map → chunk-AIKTQVV3.js.map} +0 -0
  702. /package/dist/{chunk-CGC5UQCF.js.map → chunk-AKE4GGQ3.js.map} +0 -0
  703. /package/dist/{chunk-W27OW7AB.js.map → chunk-APFKZVJS.js.map} +0 -0
  704. /package/dist/{chunk-B325AGLK.js.map → chunk-AQIRQUCP.js.map} +0 -0
  705. /package/dist/{chunk-S7T2TY65.js.map → chunk-AXFR2NQ5.js.map} +0 -0
  706. /package/dist/{chunk-FCSZ4K2X.js.map → chunk-BJJWRWER.js.map} +0 -0
  707. /package/dist/{chunk-JT3EB7ZL.js.map → chunk-BNGHPYZU.js.map} +0 -0
  708. /package/dist/{chunk-N57A4KPV.js.map → chunk-C2BFTYD7.js.map} +0 -0
  709. /package/dist/{chunk-3JVLGJCY.js.map → chunk-C6KRO3SU.js.map} +0 -0
  710. /package/dist/{chunk-X35W4S3L.js.map → chunk-D3IZCN5P.js.map} +0 -0
  711. /package/dist/{chunk-44T3Y7SZ.js.map → chunk-EJIEQOPB.js.map} +0 -0
  712. /package/dist/{chunk-ET356KSB.js.map → chunk-F4TWWUMP.js.map} +0 -0
  713. /package/dist/{chunk-CLLPJ6QT.js.map → chunk-FQXJAC3T.js.map} +0 -0
  714. /package/dist/{chunk-DD5JFCWM.js.map → chunk-GCBIXUPT.js.map} +0 -0
  715. /package/dist/{chunk-N2ZNPHA3.js.map → chunk-IFFLUCCU.js.map} +0 -0
  716. /package/dist/{chunk-PFFZWDPE.js.map → chunk-JZDH2ZZK.js.map} +0 -0
  717. /package/dist/{chunk-TX2UTLXC.js.map → chunk-K6IPSW5B.js.map} +0 -0
  718. /package/dist/{chunk-4MHYKEOM.js.map → chunk-KDJHLOZP.js.map} +0 -0
  719. /package/dist/{chunk-KCB7F4J7.js.map → chunk-KYGOQV37.js.map} +0 -0
  720. /package/dist/{chunk-VZWXFXLX.js.map → chunk-LMCD5W5B.js.map} +0 -0
  721. /package/dist/{chunk-MKD3OMPS.js.map → chunk-M3MYMWXG.js.map} +0 -0
  722. /package/dist/{chunk-PL7FYKHT.js.map → chunk-MMG5K6XJ.js.map} +0 -0
  723. /package/dist/{chunk-VGXM5B4H.js.map → chunk-MNIPH6LD.js.map} +0 -0
  724. /package/dist/{chunk-XU6OEECT.js.map → chunk-OQQXGYMX.js.map} +0 -0
  725. /package/dist/{chunk-LSYDG6MJ.js.map → chunk-PEXW2JCK.js.map} +0 -0
  726. /package/dist/{chunk-MOZXTRC2.js.map → chunk-QF4J3KMV.js.map} +0 -0
  727. /package/dist/{chunk-JGHXXQ2G.js.map → chunk-QLJ6762U.js.map} +0 -0
  728. /package/dist/{chunk-XOVKXJEP.js.map → chunk-R3TLVTWW.js.map} +0 -0
  729. /package/dist/{chunk-CETXNLEX.js.map → chunk-RQO3J4MR.js.map} +0 -0
  730. /package/dist/{chunk-5NANRSCD.js.map → chunk-RR7G2X7C.js.map} +0 -0
  731. /package/dist/{chunk-DCJ3YFIC.js.map → chunk-S2ULTQZR.js.map} +0 -0
  732. /package/dist/{chunk-EQHDH4C2.js.map → chunk-S76KRJDG.js.map} +0 -0
  733. /package/dist/{chunk-EEC4PCG5.js.map → chunk-SZDLX763.js.map} +0 -0
  734. /package/dist/{chunk-E2ZHGBAK.js.map → chunk-T2JSUEH6.js.map} +0 -0
  735. /package/dist/{chunk-JSN44KIB.js.map → chunk-T2YFZ27G.js.map} +0 -0
  736. /package/dist/{chunk-227UFSEQ.js.map → chunk-TFA6HPOA.js.map} +0 -0
  737. /package/dist/{chunk-BA6WOZOT.js.map → chunk-TK4FHQRN.js.map} +0 -0
  738. /package/dist/{chunk-NB5BCFUY.js.map → chunk-TWYTGIBR.js.map} +0 -0
  739. /package/dist/{chunk-MWFGUESQ.js.map → chunk-UEZKN6VR.js.map} +0 -0
  740. /package/dist/{chunk-H5AFCNGA.js.map → chunk-UJX4I26O.js.map} +0 -0
  741. /package/dist/{chunk-PBGVVDLY.js.map → chunk-VIZR45AN.js.map} +0 -0
  742. /package/dist/{chunk-ZG74PWRW.js.map → chunk-VZAKYDMJ.js.map} +0 -0
  743. /package/dist/{chunk-JTH2SE6B.js.map → chunk-W5BLTZZJ.js.map} +0 -0
  744. /package/dist/{chunk-H3TKENU4.js.map → chunk-WIKO4SCR.js.map} +0 -0
  745. /package/dist/{chunk-YFLLGRXO.js.map → chunk-X2QPKLPL.js.map} +0 -0
  746. /package/dist/{chunk-MN3LK3KN.js.map → chunk-X424T5JQ.js.map} +0 -0
  747. /package/dist/{chunk-5BCNEBEN.js.map → chunk-XPJNT6PI.js.map} +0 -0
  748. /package/dist/{chunk-SEDEKFYQ.js.map → chunk-XW2T4QAW.js.map} +0 -0
  749. /package/dist/{chunk-D223ZDQV.js.map → chunk-YEDVOYL2.js.map} +0 -0
  750. /package/dist/{chunk-RC5DXXWC.js.map → chunk-YM7YN37H.js.map} +0 -0
  751. /package/dist/{chunk-VLXBE57O.js.map → chunk-YVGXH72Y.js.map} +0 -0
  752. /package/dist/{chunk-YQAXP5AC.js.map → chunk-YXLUTALO.js.map} +0 -0
  753. /package/dist/{chunk-OQDPBRQ6.js.map → chunk-Z7YDVHDI.js.map} +0 -0
  754. /package/dist/{chunk-XUE46UYW.js.map → chunk-ZLN7AROH.js.map} +0 -0
  755. /package/dist/{chunk-HK32G473.js.map → chunk-ZWEZXVYH.js.map} +0 -0
  756. /package/dist/{contradiction-scan-NOYMFG66.js.map → contradiction-scan-GVD4JJ7B.js.map} +0 -0
  757. /package/dist/{first-start-migration-RC345GPL.js.map → first-start-migration-L3UFX5CU.js.map} +0 -0
  758. /package/dist/{resolution-VKATP2HT.js.map → recall-state-view-admission.js.map} +0 -0
  759. /package/dist/{tier-stats-KA6OZX2C.js.map → tier-stats-VK5PCO2L.js.map} +0 -0
@@ -81,6 +81,7 @@ import type {
81
81
  } from "../types.js";
82
82
  import { normalizeConnectorScope } from "../dedup/connector-scope.js";
83
83
  import type { StorageManager } from "../index.js";
84
+ import { casCommittedRevisionOf } from "../storage/deletion-revision-store.js";
84
85
  import type { ExtractionPersistDeps } from "./extraction-persist-deps.js";
85
86
 
86
87
  export type SemanticMergeCreateReason =
@@ -714,9 +715,7 @@ export async function applySemanticMergeAtPersist(
714
715
  // win rather than be overwritten from a stale body. The active-target check
715
716
  // above makes a tombstone block structurally impossible here.
716
717
  const nowIso = (options.now ? options.now() : new Date()).toISOString();
717
- let contentCommitted = false;
718
- // Captured so the success return can describe the COMMITTED frontmatter
719
- // (the patch's appended sources) without widening the try's scope.
718
+ let casRevision: string | undefined; // #2813 (P1): OUR content CAS's receipt — feeds the patch stamp below and the catch's rollback comparison
720
719
  let mergePatch: MergeFrontmatterUpdate | undefined;
721
720
  try {
722
721
  mergePatch = buildMergeFrontmatterUpdate({
@@ -742,7 +741,7 @@ export async function applySemanticMergeAtPersist(
742
741
  );
743
742
  return { action: "created", reason: "target_changed" };
744
743
  }
745
- contentCommitted = true;
744
+ casRevision = updated; // fix A: a successful CAS returns the revision it landed; a later rollback compares against it
746
745
  // The provenance patch must land on OUR merged body. An id-keyed patch
747
746
  // re-reads and stamps whatever the latest row holds, so a writer landing
748
747
  // after the content commit would receive this merge's provenance while
@@ -790,6 +789,8 @@ export async function applySemanticMergeAtPersist(
790
789
  const patched = await options.storage.writeMemoryFrontmatterIfUnchanged(
791
790
  merged,
792
791
  {
792
+ // #2807: business/event time, exactly what an ordinary write would
793
+ // stamp — receipt identity is the sidecar token storage mints.
793
794
  updated: mergePatch.updated,
794
795
  derived_via: mergePatch.derived_via,
795
796
  reinforcement_count: mergePatch.reinforcement_count,
@@ -831,10 +832,100 @@ export async function applySemanticMergeAtPersist(
831
832
  // leave those claims without the incoming provenance, so `created` is
832
833
  // reachable only once storage has been re-read and confirms the target no
833
834
  // longer holds this merge's unprovenanced body.
834
- if (
835
- contentCommitted &&
836
- !(await revertMergedContent(options.storage, target, committedContent))
837
- ) {
835
+ //
836
+ // #2807 (finding 2): the flag alone cannot distinguish a CAS that threw
837
+ // BEFORE changing the target (lock acquisition, transient I/O) from one
838
+ // that threw AFTER the write committed — and both left the staged
839
+ // snapshot `pending` forever, which pruneExcessVersions deliberately
840
+ // excludes, so repeated contention grew history past
841
+ // maxVersionsPerPage with snapshots of bodies storage never (or no
842
+ // longer) holds. Reread the target instead of trusting the flag.
843
+ // #2813 (P1): ownership comes from the CAS's own commit identity —
844
+ // storage stamps the thrown error with the revision its write landed
845
+ // (markCasCommittedRevision) — NEVER from body equality: a concurrent
846
+ // writer's identical deterministic merge is byte-for-byte this writer's
847
+ // merged body, so content comparison would misattribute their commit,
848
+ // and the revert below would CAS-replace their valid merge with the
849
+ // pre-merge body while their patched provenance stood.
850
+ // - receipt present → OUR write landed (throw after commit) → revert,
851
+ // else degraded success — and the rollback verifies the standing
852
+ // record still carries the receipt's revision (#2813 P1, round 2);
853
+ // clean up OUR staged duplicate, leave theirs untouched, report the
854
+ // degraded merged outcome (never `created`: storage already holds
855
+ // these claims);
856
+ // - no receipt, pre-merge body → the write never landed → the snapshot
857
+ // is a duplicate and goes, `created` is honest;
858
+ // - no receipt, replaced by another writer or unreadable →
859
+ // unverifiable → keep-side, the snapshot stays.
860
+ const committedRevision = casCommittedRevisionOf(err) ?? casRevision; // fix A: patch-path failures carry no error receipt — fall back to the success receipt
861
+ const landed = committedRevision !== undefined;
862
+ if (!landed) {
863
+ let observed: MemoryFile | null = null;
864
+ try {
865
+ observed = await readTargetSnapshot(options.storage, target);
866
+ } catch {
867
+ /* unreadable → keep-side below */
868
+ }
869
+ if (observed?.content === committedContent) {
870
+ await discardMergedTargetSnapshot(
871
+ target.path,
872
+ versioning,
873
+ options.storage.dir,
874
+ decision.targetId,
875
+ versionId,
876
+ );
877
+ await repairIndexes(committedMergedFactHash(deps, options.category, committedContent));
878
+ log.warn(
879
+ `semantic-merge: update failed for ${decision.targetId} (the compare-and-swap threw before this writer's mutation; the standing merged body is another writer's identical commit — snapshot ${versionId} discarded, the concurrent commit left untouched): ${detail}`,
880
+ );
881
+ return {
882
+ action: "merged",
883
+ targetId: decision.targetId,
884
+ mergedContent: committedContent,
885
+ provenancePatched: false,
886
+ };
887
+ } else if (observed?.content === target.content) {
888
+ await discardMergedTargetSnapshot(
889
+ target.path,
890
+ versioning,
891
+ options.storage.dir,
892
+ decision.targetId,
893
+ versionId,
894
+ );
895
+ log.warn(
896
+ `semantic-merge: update failed for ${decision.targetId} (the compare-and-swap threw before changing the target; snapshot ${versionId} discarded — the reread holds the pre-merge body): ${detail}`,
897
+ );
898
+ return { action: "created", reason: "update_failed" };
899
+ }
900
+ }
901
+ // #2813 (P1, round 2): the receipt was used only as a boolean — never
902
+ // compared with the standing record — so writer B's identical commit
903
+ // after our lock released was reverted as ours. Equal revision → ours,
904
+ // safe to roll back; advanced → B's — the same handling as the no-receipt
905
+ // other-writer branch above; never revert theirs.
906
+ const revert = landed
907
+ ? await revertMergedContent(options.storage, target, committedContent, committedRevision)
908
+ : undefined;
909
+ if (revert === "superseded") {
910
+ await discardMergedTargetSnapshot(
911
+ target.path,
912
+ versioning,
913
+ options.storage.dir,
914
+ decision.targetId,
915
+ versionId,
916
+ );
917
+ await repairIndexes(committedMergedFactHash(deps, options.category, committedContent));
918
+ log.warn(
919
+ `semantic-merge: update failed for ${decision.targetId} (the standing merged body advanced past this writer's commit receipt — another writer's identical commit stands; snapshot ${versionId} discarded, the concurrent commit left untouched): ${detail}`,
920
+ );
921
+ return {
922
+ action: "merged",
923
+ targetId: decision.targetId,
924
+ mergedContent: committedContent,
925
+ provenancePatched: false,
926
+ };
927
+ }
928
+ if (landed && revert !== "reverted") {
838
929
  log.error(
839
930
  `semantic-merge: ${decision.targetId} holds merged content without provenance metadata and the rollback failed (${detail}); snapshot ${versionId} holds the pre-merge state — recover with revertToVersion. Not creating a duplicate fact.`,
840
931
  );
@@ -861,10 +952,9 @@ export async function applySemanticMergeAtPersist(
861
952
  // Round N+13 (B): with the content committed and the revert above
862
953
  // confirmed, storage holds the pre-merge body, so the staged snapshot of
863
954
  // that same body is a duplicate and goes. (The degraded-success branch
864
- // above keeps it as the recovery point. A throw BEFORE the content
865
- // commit leaves storage state unverifiable keep-side, the snapshot
866
- // stays.)
867
- if (contentCommitted) {
955
+ // above keeps it as the recovery point. An unverifiable throw target
956
+ // replaced or unreadable is keep-side, the snapshot stays.)
957
+ if (landed) {
868
958
  await discardMergedTargetSnapshot(
869
959
  target.path,
870
960
  versioning,
@@ -874,7 +964,7 @@ export async function applySemanticMergeAtPersist(
874
964
  );
875
965
  }
876
966
  log.warn(
877
- `semantic-merge: update failed for ${decision.targetId}${contentCommitted ? ` (content rolled back; snapshot ${versionId} rolled back out of history)` : ` (snapshot ${versionId} staged)`}: ${detail}`,
967
+ `semantic-merge: update failed for ${decision.targetId}${landed ? ` (content rolled back; snapshot ${versionId} rolled back out of history)` : ` (snapshot ${versionId} staged)`}: ${detail}`,
878
968
  );
879
969
  return { action: "created", reason: "update_failed" };
880
970
  }
@@ -1024,6 +1114,10 @@ export async function runMergedTargetPostEffects(
1024
1114
  episodes.push(merge.targetId);
1025
1115
  }
1026
1116
  if (!input.graphCaps.multiGraphMemory) return signals;
1117
+ // #2807 (finding 4): whether the remove-and-rebuild below finalized. A
1118
+ // false or thrown exit means a ROLLBACK ran (or nothing mutated), and the
1119
+ // owning index's edge cache must be invalidated after the catch.
1120
+ let rewriteInstalled = false;
1027
1121
  try {
1028
1122
  const committed = await storage.getMemoryByIdIncludingArchived(merge.targetId);
1029
1123
  if (!committed || committed.content !== merge.mergedContent) return signals;
@@ -1066,11 +1160,12 @@ export async function runMergedTargetPostEffects(
1066
1160
  // Round N+12 (C): the remove-and-rebuild is revision-guarded end to end
1067
1161
  // (see rewriteMergedTargetGraphEdges) — a writer committing a newer body
1068
1162
  // mid-rebuild aborts this install instead of clobbering its edges.
1069
- const installed = await rewriteMergedTargetGraphEdges(storage, {
1163
+ rewriteInstalled = await rewriteMergedTargetGraphEdges(storage, {
1070
1164
  targetId: merge.targetId,
1071
1165
  memoryRelPath,
1072
1166
  mergedContent: merge.mergedContent,
1073
- revisionChecked: committed.frontmatter.updated,
1167
+ // #2807: the dedicated CAS revision token, not public `updated`.
1168
+ revisionChecked: await storage.readCasRevision(committed.path),
1074
1169
  rewriteTypes,
1075
1170
  build: () =>
1076
1171
  deps.buildGraphEdge(
@@ -1087,9 +1182,19 @@ export async function runMergedTargetPostEffects(
1087
1182
  input.graphCaps,
1088
1183
  ),
1089
1184
  });
1090
- if (installed) input.graphContext.previousPersistedRelPath = memoryRelPath;
1185
+ if (rewriteInstalled) input.graphContext.previousPersistedRelPath = memoryRelPath;
1091
1186
  } catch {
1092
1187
  /* fail-open: the committed merge stands; the create path's graph block fails open too */
1093
1188
  }
1189
+ if (!rewriteInstalled) {
1190
+ // #2807 (finding 4): the rewrite rolled back — superseded revision, a
1191
+ // failed build, or a pre-rewrite read error — after the build's
1192
+ // onMemoryWritten had already pushed this writer's appended rows into
1193
+ // the owning GraphIndex's warm edge cache. The rollback repaired only
1194
+ // the JSONL files; without invalidating the cache, spreadingActivation
1195
+ // kept serving the rolled-back edges for the full five-minute TTL.
1196
+ // Invalidation is idempotent and cheap when nothing was cached.
1197
+ deps.invalidateGraphEdgeCache?.(storage);
1198
+ }
1094
1199
  return signals;
1095
1200
  }
@@ -65,37 +65,60 @@ export interface MergedTargetPromotionPayload {
65
65
  toolScoped?: true;
66
66
  sourceConnector?: string;
67
67
  /**
68
- * The committed record's `updated` revision at payload-build time (round
69
- * N+15 A). The payload is a CACHE: before promoting it, the caller re-reads
70
- * the record and confirms the revision AND body still match — a writer that
71
- * merged the same target again in between makes this payload stale, and a
72
- * stale body must never be promoted or become the reconciliation canon.
68
+ * The committed record's CAS revision token at payload-build time (round
69
+ * N+15 A, #2807) the dedicated sidecar identity, never public
70
+ * `frontmatter.updated`. The payload is a CACHE: before promoting it, the
71
+ * caller re-reads the record and confirms the token AND body still match
72
+ * a writer that merged the same target again in between makes this
73
+ * payload stale, and a stale body must never be promoted or become the
74
+ * reconciliation canon.
73
75
  */
74
76
  committedRevision?: string;
77
+ /** #2813 (P1 B): sha256 hex digest of the durable memory file when committed. */
78
+ committedDigest?: string;
79
+ }
80
+
81
+ /**
82
+ * #2807 (finding 1): the builder's null has two meanings the caller must
83
+ * not conflate. A REFUSED payload (degraded merge, target replaced
84
+ * mid-flight, retired record) means "no promotion is warranted" — the
85
+ * caller's destructive reconciliation may proceed on that conclusion. A
86
+ * payload that is UNKNOWN because the post-commit reread itself failed
87
+ * means no such conclusion was reached, so `readFailed` preserves the
88
+ * failure reason across the call boundary.
89
+ */
90
+ export interface MergedTargetPromotionResult {
91
+ payload: MergedTargetPromotionPayload | null;
92
+ /** True when `payload` is null because the reread threw OR the CAS receipt
93
+ * sidecar was unreadable (#2813 P1 A) — the payload is unknown, not refused. */
94
+ readFailed: boolean;
75
95
  }
76
96
 
77
97
  /**
78
98
  * Re-read the committed merge target (cold-aware id lookup — the same
79
99
  * resolver the merge itself used) and derive the promotion payload solely
80
- * from that record. Returns null when the record can no longer ground the
81
- * promotion (deleted, its body was replaced after the merge committed, or a
82
- * concurrent lifecycle operation archived/superseded it between the merge
83
- * commit and this reread — promoting from a retired record would resurrect
84
- * content that operation retired, final round B), and null for a degraded
85
- * merge whose provenance patch never landed (round N+7 A) — the gate every
86
- * trust-elevating consumer routes through; callers then skip the promotion
87
- * fail-open — the merge itself stands. Round N+18 (B): the reread itself is
88
- * isolated fail-open — a locked secure store or a corpus read I/O error
89
- * resolves to null with a logged warn rather than a rejection, because the
90
- * merge has already committed and the hash-index repair makes any retry
91
- * dedupe against the committed body; an uncaught throw here would strand
92
- * every remaining durable effect (thread episode, temporal/tag refresh,
93
- * harmonic construction, graph rebuild, behavior signals, artifact write).
100
+ * from that record. Returns a null payload when the record can no longer
101
+ * ground the promotion (deleted, its body was replaced after the merge
102
+ * committed, or a concurrent lifecycle operation archived/superseded it
103
+ * between the merge commit and this reread — promoting from a retired
104
+ * record would resurrect content that operation retired, final round B),
105
+ * and null for a degraded merge whose provenance patch never landed (round
106
+ * N+7 A) — the gate every trust-elevating consumer routes through; callers
107
+ * then skip the promotion fail-open — the merge itself stands. Round N+18
108
+ * (B): the reread itself is isolated fail-open — a locked secure store or
109
+ * a corpus read I/O error resolves to a null payload with `readFailed:
110
+ * true` and a logged warn rather than a rejection, because the merge has
111
+ * already committed and the hash-index repair makes any retry dedupe
112
+ * against the committed body; an uncaught throw here would strand every
113
+ * remaining durable effect (thread episode, temporal/tag refresh, harmonic
114
+ * construction, graph rebuild, behavior signals, artifact write). #2807:
115
+ * the failure reason rides out on the result so reconciliation can tell an
116
+ * unknown payload from a refused one.
94
117
  */
95
118
  export async function buildMergedTargetPromotionPayload(
96
119
  storage: StorageManager,
97
120
  merge: { targetId: string; mergedContent: string; provenancePatched: boolean },
98
- ): Promise<MergedTargetPromotionPayload | null> {
121
+ ): Promise<MergedTargetPromotionResult> {
99
122
  // Round N+7 (A): a degraded merge's record still holds its pre-merge
100
123
  // confidence, provenance, sources, and hash — a copy built off it would
101
124
  // publish incoming claims under that stronger metadata. No promotion may
@@ -104,7 +127,7 @@ export async function buildMergedTargetPromotionPayload(
104
127
  log.warn(
105
128
  `semantic-merge: skipping merged-target promotion for ${merge.targetId} — provenance patch did not land; the record still holds pre-merge trust metadata`,
106
129
  );
107
- return null;
130
+ return { payload: null, readFailed: false };
108
131
  }
109
132
  let committed: MemoryFile | null;
110
133
  try {
@@ -114,48 +137,104 @@ export async function buildMergedTargetPromotionPayload(
114
137
  log.warn(
115
138
  `semantic-merge: merged-target promotion reread failed for ${merge.targetId} (non-fatal; promotion skipped, the committed merge stands): ${err instanceof Error ? err.message : String(err)}`,
116
139
  );
117
- return null;
140
+ return { payload: null, readFailed: true };
141
+ }
142
+ if (!committed || committed.content !== merge.mergedContent) {
143
+ return { payload: null, readFailed: false };
118
144
  }
119
- if (!committed || committed.content !== merge.mergedContent) return null;
120
145
  // Final round (B): the including-archived lookup still returns a retired
121
146
  // record, and body equality alone cannot tell a concurrent archive or
122
147
  // supersede apart from a live target. Recompute the status from the
123
148
  // committed record itself and refuse to promote unless it is still
124
149
  // active.
125
150
  if (inferMemoryStatus(committed.frontmatter, committed.path) !== "active") {
126
- return null;
151
+ return { payload: null, readFailed: false };
127
152
  }
128
153
  const fm = committed.frontmatter;
154
+ // #2813 (P1 B): promotion reads record metadata and digest, then receipt.
155
+ // Compare record snapshot digest to receipt's committed digest to catch
156
+ // interleaving metadata writers with same body/new metadata.
157
+ const snapshotDigest =
158
+ typeof storage.readDurableFileDigest === "function"
159
+ ? await storage.readDurableFileDigest(committed.path).catch(() => null)
160
+ : null;
161
+ const receipt = await readPromotionReceiptStatus(storage, committed.path);
162
+ if (!receipt.available) {
163
+ log.warn(
164
+ `semantic-merge: merged-target promotion refused for ${merge.targetId} — the CAS revision receipt for ${committed.path} is unavailable (${receipt.reason}); promotion and reconciliation retry on the next merge`,
165
+ );
166
+ return { payload: null, readFailed: true };
167
+ }
168
+ if (receipt.committedDigest !== undefined && snapshotDigest !== receipt.committedDigest) {
169
+ log.warn(
170
+ snapshotDigest == null
171
+ ? `semantic-merge: merged-target promotion refused for ${merge.targetId} — the record snapshot digest is unavailable while the CAS receipt carries committed digest ${receipt.committedDigest}; promotion and reconciliation retry on the next merge`
172
+ : `semantic-merge: merged-target promotion refused for ${merge.targetId} — record snapshot digest (${snapshotDigest}) does not match committed receipt digest (${receipt.committedDigest}); record metadata was mutated concurrently`,
173
+ );
174
+ return { payload: null, readFailed: true };
175
+ }
129
176
  return {
130
- category: fm.category,
131
- content: committed.content,
132
- confidence: fm.confidence,
133
- tags: fm.tags ?? [],
134
- sourceMemoryId: fm.id,
135
- origin: parseOriginClass(fm.origin),
136
- source: fm.source,
137
- ...(fm.entityRef !== undefined ? { entityRef: fm.entityRef } : {}),
138
- ...(fm.structuredAttributes !== undefined
139
- ? { structuredAttributes: { ...fm.structuredAttributes } }
140
- : {}),
141
- ...(fm.importance !== undefined ? { importance: fm.importance } : {}),
142
- ...(fm.intentGoal !== undefined ? { intentGoal: fm.intentGoal } : {}),
143
- ...(fm.intentActionType !== undefined ? { intentActionType: fm.intentActionType } : {}),
144
- ...(fm.intentEntityTypes !== undefined
145
- ? { intentEntityTypes: [...fm.intentEntityTypes] }
146
- : {}),
147
- ...(fm.memoryKind !== undefined ? { memoryKind: fm.memoryKind } : {}),
148
- ...(fm.valid_at !== undefined ? { validAt: fm.valid_at } : {}),
149
- ...(fm.invalid_at !== undefined ? { invalidAt: fm.invalid_at } : {}),
150
- ...(fm.observedAt !== undefined ? { observedAt: fm.observedAt } : {}),
151
- ...(fm.eventTimeSource !== undefined ? { eventTimeSource: fm.eventTimeSource } : {}),
152
- ...(fm.sources && fm.sources.length > 0
153
- ? { sources: fm.sources.map((source) => ({ ...source })) }
154
- : {}),
155
- ...(fm.provenance !== undefined ? { provenance: fm.provenance } : {}),
156
- ...(fm.subject !== undefined ? { subject: fm.subject } : {}),
157
- ...(fm.toolScoped === true ? { toolScoped: true as const } : {}),
158
- ...(fm.sourceConnector !== undefined ? { sourceConnector: fm.sourceConnector } : {}),
159
- ...(fm.updated !== undefined ? { committedRevision: fm.updated } : {}),
177
+ payload: {
178
+ category: fm.category,
179
+ content: committed.content,
180
+ confidence: fm.confidence,
181
+ tags: fm.tags ?? [],
182
+ sourceMemoryId: fm.id,
183
+ origin: parseOriginClass(fm.origin),
184
+ source: fm.source,
185
+ ...(fm.entityRef !== undefined ? { entityRef: fm.entityRef } : {}),
186
+ ...(fm.structuredAttributes !== undefined
187
+ ? { structuredAttributes: { ...fm.structuredAttributes } }
188
+ : {}),
189
+ ...(fm.importance !== undefined ? { importance: fm.importance } : {}),
190
+ ...(fm.intentGoal !== undefined ? { intentGoal: fm.intentGoal } : {}),
191
+ ...(fm.intentActionType !== undefined ? { intentActionType: fm.intentActionType } : {}),
192
+ ...(fm.intentEntityTypes !== undefined
193
+ ? { intentEntityTypes: [...fm.intentEntityTypes] }
194
+ : {}),
195
+ ...(fm.memoryKind !== undefined ? { memoryKind: fm.memoryKind } : {}),
196
+ ...(fm.valid_at !== undefined ? { validAt: fm.valid_at } : {}),
197
+ ...(fm.invalid_at !== undefined ? { invalidAt: fm.invalid_at } : {}),
198
+ ...(fm.observedAt !== undefined ? { observedAt: fm.observedAt } : {}),
199
+ ...(fm.eventTimeSource !== undefined ? { eventTimeSource: fm.eventTimeSource } : {}),
200
+ ...(fm.sources && fm.sources.length > 0
201
+ ? { sources: fm.sources.map((source) => ({ ...source })) }
202
+ : {}),
203
+ ...(fm.provenance !== undefined ? { provenance: fm.provenance } : {}),
204
+ ...(fm.subject !== undefined ? { subject: fm.subject } : {}),
205
+ ...(fm.toolScoped === true ? { toolScoped: true as const } : {}),
206
+ ...(fm.sourceConnector !== undefined ? { sourceConnector: fm.sourceConnector } : {}),
207
+ ...(receipt.revision !== undefined ? { committedRevision: receipt.revision } : {}),
208
+ ...(receipt.committedDigest !== undefined
209
+ ? { committedDigest: receipt.committedDigest }
210
+ : snapshotDigest !== null
211
+ ? { committedDigest: snapshotDigest }
212
+ : {}),
213
+ },
214
+ readFailed: false,
160
215
  };
161
216
  }
217
+
218
+ /** #2813 (P1 A): read the standing receipt as a three-way truth for the
219
+ * promotion path. Present and absent are usable identities (absent = the
220
+ * target predates the sidecar); unavailable is not. A storage whose status
221
+ * probe itself throws reads as unavailable — never as absence. */
222
+ export async function readPromotionReceiptStatus(
223
+ storage: Pick<StorageManager, "readCasRevisionStatus">,
224
+ filePath: string,
225
+ ): Promise<
226
+ | { available: true; revision: string | undefined; committedDigest?: string }
227
+ | { available: false; reason: string }
228
+ > {
229
+ try {
230
+ const status = await storage.readCasRevisionStatus(filePath);
231
+ if (status.status === "unavailable") return { available: false, reason: status.reason };
232
+ return {
233
+ available: true,
234
+ revision: status.status === "present" ? status.revision : undefined,
235
+ committedDigest: status.status === "present" ? status.committedDigest : undefined,
236
+ };
237
+ } catch (err) {
238
+ return { available: false, reason: err instanceof Error ? err.message : String(err) };
239
+ }
240
+ }
@@ -857,6 +857,7 @@ export class Orchestrator {
857
857
  indexPersistedMemory: (storage, memoryId) => this.indexPersistedMemory(storage, memoryId),
858
858
  buildGraphEdge: (storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps) =>
859
859
  this.buildGraphEdge(storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps),
860
+ invalidateGraphEdgeCache: (storage) => this.graphIndexFor(storage).invalidateEdgeCache(),
860
861
  updateTemporalTagIndexes: (storage, persistedIds) =>
861
862
  this.updateTemporalTagIndexes(storage, persistedIds),
862
863
  });
@@ -3227,32 +3228,21 @@ export class Orchestrator {
3227
3228
  );
3228
3229
  }
3229
3230
 
3231
+ /** Delegation wrapper so the persist wiring and root-test stubs route through `this` (#2813 CI-0). */
3230
3232
  private async buildGraphEdge(
3231
3233
  storage: StorageManager,
3232
3234
  memoryRelPath: string,
3233
3235
  entityRef: string | undefined,
3234
3236
  memoryId: string,
3235
3237
  factContent: string,
3236
- allMemsForGraph: import("./types.js").MemoryFile[] | null | undefined,
3238
+ allMemsForGraph: MemoryFile[] | null | undefined,
3237
3239
  memoryPathById: Map<string, string>,
3238
3240
  threadIdForEdge: string | undefined,
3239
3241
  threadEpisodeIdsForGraph: string[] | undefined,
3240
3242
  fallbackCausalPredecessor: string | undefined,
3241
3243
  graphCaps: GraphConstructionCapabilitySet = resolveGraphConstructionCapabilities(this.config),
3242
3244
  ): Promise<GraphEdge[]> {
3243
- return this.persistenceIndexCoordinator.buildGraphEdge(
3244
- storage,
3245
- memoryRelPath,
3246
- entityRef,
3247
- memoryId,
3248
- factContent,
3249
- allMemsForGraph,
3250
- memoryPathById,
3251
- threadIdForEdge,
3252
- threadEpisodeIdsForGraph,
3253
- fallbackCausalPredecessor,
3254
- graphCaps,
3255
- );
3245
+ return this.persistenceIndexCoordinator.buildGraphEdge(storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps);
3256
3246
  }
3257
3247
 
3258
3248
  private graphIndexFor(storage: StorageManager): GraphIndex {
@@ -3423,27 +3413,9 @@ export class Orchestrator {
3423
3413
  );
3424
3414
  }
3425
3415
 
3426
- private publishRecallResults(options: {
3427
- title: string;
3428
- results: QmdSearchResult[];
3429
- sectionBuckets: RecallSectionBuckets;
3430
- retrievalQuery: string;
3431
- sessionKey: string | undefined;
3432
- identityInjection?: {
3433
- mode: IdentityInjectionMode | "none";
3434
- injectedChars: number;
3435
- truncated: boolean;
3436
- };
3437
- /**
3438
- * Issue #1577 — per-recall trust map. When present, quarantined items
3439
- * are filtered from injection on EVERY recall path (hot QMD, embedding
3440
- * fallback, cold archive, recent) so a faithfulness-contradicted memory
3441
- * cannot sneak in via a branch that bypasses trust scoring (review:
3442
- * fallback paths bypass trust). The map is also threaded to
3443
- * formatQmdResults for the epistemic hedge.
3444
- */
3445
- trustByPath?: Map<string, TrustStageResultItem> | null;
3446
- }): void {
3416
+ private publishRecallResults(
3417
+ options: Parameters<RecallEntryCoordinator["publishRecallResults"]>[0],
3418
+ ): void {
3447
3419
  return (this.recallEntryCoordinator ?? new RecallEntryCoordinator(
3448
3420
  selfDeps<ConstructorParameters<typeof RecallEntryCoordinator>[0]>(this),
3449
3421
  )).publishRecallResults(