@remnic/core 1.0.3 → 1.1.1

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 (323) hide show
  1. package/dist/abort-error.d.ts +32 -0
  2. package/dist/abort-error.js +11 -0
  3. package/dist/access-audit.d.ts +56 -0
  4. package/dist/access-audit.js +9 -0
  5. package/dist/access-audit.js.map +1 -0
  6. package/dist/access-cli.js +72 -54
  7. package/dist/access-cli.js.map +1 -1
  8. package/dist/access-http.d.ts +16 -8
  9. package/dist/access-http.js +25 -17
  10. package/dist/access-mcp.d.ts +16 -8
  11. package/dist/access-mcp.js +28 -6
  12. package/dist/access-schema.d.ts +130 -39
  13. package/dist/access-schema.js +5 -1
  14. package/dist/access-service-Br8ZydTK.d.ts +827 -0
  15. package/dist/access-service.d.ts +20 -660
  16. package/dist/access-service.js +22 -14
  17. package/dist/bootstrap.d.ts +6 -3
  18. package/dist/briefing.d.ts +1 -0
  19. package/dist/briefing.js +6 -5
  20. package/dist/buffer-surprise-report.d.ts +70 -0
  21. package/dist/buffer-surprise-report.js +7 -0
  22. package/dist/buffer-surprise-report.js.map +1 -0
  23. package/dist/buffer-surprise.d.ts +98 -0
  24. package/dist/buffer-surprise.js +11 -0
  25. package/dist/buffer-surprise.js.map +1 -0
  26. package/dist/buffer.d.ts +100 -2
  27. package/dist/buffer.js +1 -1
  28. package/dist/calibration.js +5 -5
  29. package/dist/causal-behavior.js +4 -4
  30. package/dist/causal-chain.js +2 -2
  31. package/dist/causal-consolidation.js +17 -16
  32. package/dist/causal-consolidation.js.map +1 -1
  33. package/dist/causal-retrieval.js +4 -4
  34. package/dist/causal-trajectory.js +1 -1
  35. package/dist/{chunk-QNJMBKFK.js → chunk-2LGMW3DJ.js} +3 -2
  36. package/dist/chunk-2LGMW3DJ.js.map +1 -0
  37. package/dist/{chunk-QDYXG4CS.js → chunk-3FPTCC3Z.js} +4 -3
  38. package/dist/chunk-3FPTCC3Z.js.map +1 -0
  39. package/dist/chunk-3GPTTA4J.js +57 -0
  40. package/dist/chunk-3GPTTA4J.js.map +1 -0
  41. package/dist/{chunk-QKAH5B6E.js → chunk-3GXCSUXR.js} +94 -6
  42. package/dist/chunk-3GXCSUXR.js.map +1 -0
  43. package/dist/{chunk-POBPGDWI.js → chunk-3OGMS3PE.js} +2 -2
  44. package/dist/chunk-54V4BZWP.js +139 -0
  45. package/dist/chunk-54V4BZWP.js.map +1 -0
  46. package/dist/chunk-5JRF2PZA.js +67 -0
  47. package/dist/chunk-5JRF2PZA.js.map +1 -0
  48. package/dist/chunk-64NJRYU2.js +332 -0
  49. package/dist/chunk-64NJRYU2.js.map +1 -0
  50. package/dist/chunk-6AUUAZEX.js +150 -0
  51. package/dist/chunk-6AUUAZEX.js.map +1 -0
  52. package/dist/{chunk-HITJFT7E.js → chunk-7I7FKFZH.js} +28 -21
  53. package/dist/chunk-7I7FKFZH.js.map +1 -0
  54. package/dist/chunk-AJU4PJGY.js +126 -0
  55. package/dist/chunk-AJU4PJGY.js.map +1 -0
  56. package/dist/chunk-ASAITVLA.js +64 -0
  57. package/dist/chunk-ASAITVLA.js.map +1 -0
  58. package/dist/{chunk-X4WESCKA.js → chunk-B5WXLVDY.js} +187 -6
  59. package/dist/chunk-B5WXLVDY.js.map +1 -0
  60. package/dist/{chunk-RCICHSHL.js → chunk-BGJGXLZ7.js} +111 -2
  61. package/dist/{chunk-RCICHSHL.js.map → chunk-BGJGXLZ7.js.map} +1 -1
  62. package/dist/{chunk-OJFGVJS6.js → chunk-BK2EFTE2.js} +319 -18
  63. package/dist/chunk-BK2EFTE2.js.map +1 -0
  64. package/dist/chunk-C4SQJZAF.js +486 -0
  65. package/dist/chunk-C4SQJZAF.js.map +1 -0
  66. package/dist/{chunk-GJQPH5G3.js → chunk-CUPFXL3J.js} +2 -2
  67. package/dist/chunk-DF3RVK3X.js +119 -0
  68. package/dist/chunk-DF3RVK3X.js.map +1 -0
  69. package/dist/{chunk-PMB3WGDL.js → chunk-DFTTJYSO.js} +167 -7
  70. package/dist/chunk-DFTTJYSO.js.map +1 -0
  71. package/dist/chunk-DGVM5SFL.js +69 -0
  72. package/dist/chunk-DGVM5SFL.js.map +1 -0
  73. package/dist/chunk-EIR5VLIH.js +90 -0
  74. package/dist/chunk-EIR5VLIH.js.map +1 -0
  75. package/dist/{chunk-PAORGQRI.js → chunk-EPQJM2GC.js} +37 -23
  76. package/dist/chunk-EPQJM2GC.js.map +1 -0
  77. package/dist/{chunk-POMSFKTB.js → chunk-F5VP6YCB.js} +368 -10
  78. package/dist/chunk-F5VP6YCB.js.map +1 -0
  79. package/dist/{chunk-6ZH4TU6I.js → chunk-FAAFWE4G.js} +2 -1
  80. package/dist/chunk-FAAFWE4G.js.map +1 -0
  81. package/dist/{chunk-74JR4N5J.js → chunk-FVA6TGI3.js} +2 -2
  82. package/dist/chunk-GDFS42HT.js +206 -0
  83. package/dist/chunk-GDFS42HT.js.map +1 -0
  84. package/dist/{chunk-BKQJBXXX.js → chunk-GGD5W7TB.js} +2 -2
  85. package/dist/chunk-GGD5W7TB.js.map +1 -0
  86. package/dist/{chunk-V7XCAHIB.js → chunk-GKFXUTJ2.js} +508 -26
  87. package/dist/chunk-GKFXUTJ2.js.map +1 -0
  88. package/dist/{chunk-NSB3WSYS.js → chunk-HK3FGIEW.js} +278 -3
  89. package/dist/chunk-HK3FGIEW.js.map +1 -0
  90. package/dist/{chunk-AAI7JARD.js → chunk-HMDCOMYU.js} +8 -11
  91. package/dist/chunk-HMDCOMYU.js.map +1 -0
  92. package/dist/chunk-IISBCCWR.js +52 -0
  93. package/dist/chunk-IISBCCWR.js.map +1 -0
  94. package/dist/{chunk-YFYL2SIJ.js → chunk-INXV5JBT.js} +290 -46
  95. package/dist/chunk-INXV5JBT.js.map +1 -0
  96. package/dist/chunk-JBMSGZEQ.js +441 -0
  97. package/dist/chunk-JBMSGZEQ.js.map +1 -0
  98. package/dist/{chunk-UPMD5XND.js → chunk-JL2PU6AI.js} +16 -5
  99. package/dist/chunk-JL2PU6AI.js.map +1 -0
  100. package/dist/{chunk-J4IYOZZ5.js → chunk-JXS5PDQ7.js} +3 -1
  101. package/dist/chunk-JXS5PDQ7.js.map +1 -0
  102. package/dist/{chunk-AYPYCLR7.js → chunk-KUB6JU6H.js} +4 -4
  103. package/dist/chunk-KVBLZUKV.js +173 -0
  104. package/dist/chunk-KVBLZUKV.js.map +1 -0
  105. package/dist/chunk-LBLXEFWK.js +51 -0
  106. package/dist/chunk-LBLXEFWK.js.map +1 -0
  107. package/dist/{chunk-U2IQTSBY.js → chunk-LTCGGW2D.js} +1 -1
  108. package/dist/chunk-LTCGGW2D.js.map +1 -0
  109. package/dist/{chunk-UEYA6UC7.js → chunk-NZLQTHS5.js} +25 -2
  110. package/dist/chunk-NZLQTHS5.js.map +1 -0
  111. package/dist/chunk-PVGDJXVK.js +21 -0
  112. package/dist/chunk-PVGDJXVK.js.map +1 -0
  113. package/dist/chunk-PVPWZSSI.js +37 -0
  114. package/dist/chunk-PVPWZSSI.js.map +1 -0
  115. package/dist/{chunk-4NRAJUDS.js → chunk-RBBWYEFJ.js} +1 -1
  116. package/dist/chunk-RFYAYKTD.js +146 -0
  117. package/dist/chunk-RFYAYKTD.js.map +1 -0
  118. package/dist/{chunk-JROGC36Y.js → chunk-RGLL5SPU.js} +2 -2
  119. package/dist/{chunk-2VFW5K5U.js → chunk-S3EEFKNY.js} +103 -65
  120. package/dist/chunk-S3EEFKNY.js.map +1 -0
  121. package/dist/chunk-SOBJ6NEY.js +18 -0
  122. package/dist/chunk-SOBJ6NEY.js.map +1 -0
  123. package/dist/{chunk-MYQWXITD.js → chunk-SPI27QT6.js} +2 -2
  124. package/dist/chunk-TVVEYCNW.js +65 -0
  125. package/dist/chunk-TVVEYCNW.js.map +1 -0
  126. package/dist/chunk-ULYOGL6R.js +322 -0
  127. package/dist/chunk-ULYOGL6R.js.map +1 -0
  128. package/dist/{chunk-S4LX5EBI.js → chunk-VBVG2M5G.js} +64 -10
  129. package/dist/chunk-VBVG2M5G.js.map +1 -0
  130. package/dist/{chunk-KWP7T3DP.js → chunk-VDX363PS.js} +2 -2
  131. package/dist/{chunk-XMGSSBFX.js → chunk-VYM3VWOF.js} +1560 -244
  132. package/dist/chunk-VYM3VWOF.js.map +1 -0
  133. package/dist/{chunk-MTLYEMJB.js → chunk-WCLICCGB.js} +18 -3
  134. package/dist/chunk-WCLICCGB.js.map +1 -0
  135. package/dist/{chunk-ECKDIK5F.js → chunk-WVVA7F5A.js} +2 -2
  136. package/dist/chunk-X6GF3FX2.js +26 -0
  137. package/dist/chunk-X6GF3FX2.js.map +1 -0
  138. package/dist/{chunk-3QFQGRHO.js → chunk-XMHBH5H6.js} +4 -4
  139. package/dist/{chunk-KEG4GNGI.js → chunk-XZ2TIKGC.js} +38 -8
  140. package/dist/chunk-XZ2TIKGC.js.map +1 -0
  141. package/dist/chunk-Y4FHOFJ2.js +140 -0
  142. package/dist/chunk-Y4FHOFJ2.js.map +1 -0
  143. package/dist/chunk-YNB73F22.js +137 -0
  144. package/dist/chunk-YNB73F22.js.map +1 -0
  145. package/dist/{chunk-7PA4OZEU.js → chunk-YNQKWQT4.js} +55 -30
  146. package/dist/chunk-YNQKWQT4.js.map +1 -0
  147. package/dist/chunk-ZAIM4TUE.js +488 -0
  148. package/dist/chunk-ZAIM4TUE.js.map +1 -0
  149. package/dist/{chunk-BTY5RRRF.js → chunk-ZEM3OK2K.js} +5 -5
  150. package/dist/chunk-ZZTOURJI.js +91 -0
  151. package/dist/chunk-ZZTOURJI.js.map +1 -0
  152. package/dist/{cli-DwIBnp2g.d.ts → cli-BkeRaYfk.d.ts} +2 -2
  153. package/dist/cli.d.ts +13 -5
  154. package/dist/cli.js +45 -33
  155. package/dist/config.js +1 -1
  156. package/dist/consolidation-operator.d.ts +41 -0
  157. package/dist/consolidation-operator.js +11 -0
  158. package/dist/consolidation-operator.js.map +1 -0
  159. package/dist/consolidation-provenance-check.d.ts +68 -0
  160. package/dist/consolidation-provenance-check.js +9 -0
  161. package/dist/consolidation-provenance-check.js.map +1 -0
  162. package/dist/consolidation-undo.d.ts +123 -0
  163. package/dist/consolidation-undo.js +426 -0
  164. package/dist/consolidation-undo.js.map +1 -0
  165. package/dist/contradiction-review-WIUBAR52.js +21 -0
  166. package/dist/contradiction-review-WIUBAR52.js.map +1 -0
  167. package/dist/contradiction-scan-E3GJTI4F.js +412 -0
  168. package/dist/contradiction-scan-E3GJTI4F.js.map +1 -0
  169. package/dist/cross-namespace-budget.d.ts +133 -0
  170. package/dist/cross-namespace-budget.js +9 -0
  171. package/dist/cross-namespace-budget.js.map +1 -0
  172. package/dist/direct-answer-wiring.d.ts +77 -0
  173. package/dist/direct-answer-wiring.js +10 -0
  174. package/dist/direct-answer-wiring.js.map +1 -0
  175. package/dist/direct-answer.d.ts +106 -0
  176. package/dist/direct-answer.js +10 -0
  177. package/dist/direct-answer.js.map +1 -0
  178. package/dist/{engine-X7X3AAG3.js → engine-F3GOXGE5.js} +7 -6
  179. package/dist/engine-F3GOXGE5.js.map +1 -0
  180. package/dist/entity-retrieval.d.ts +1 -0
  181. package/dist/entity-retrieval.js +6 -5
  182. package/dist/explicit-capture.d.ts +6 -3
  183. package/dist/explicit-capture.js +2 -2
  184. package/dist/extraction-judge-telemetry.d.ts +113 -0
  185. package/dist/extraction-judge-telemetry.js +14 -0
  186. package/dist/extraction-judge-telemetry.js.map +1 -0
  187. package/dist/extraction-judge-training.d.ts +85 -0
  188. package/dist/extraction-judge-training.js +16 -0
  189. package/dist/extraction-judge-training.js.map +1 -0
  190. package/dist/extraction-judge.d.ts +124 -2
  191. package/dist/extraction-judge.js +11 -1
  192. package/dist/extraction.js +7 -6
  193. package/dist/fallback-llm.d.ts +11 -2
  194. package/dist/fallback-llm.js +2 -2
  195. package/dist/graph-recall.d.ts +100 -0
  196. package/dist/graph-recall.js +8 -0
  197. package/dist/graph-recall.js.map +1 -0
  198. package/dist/graph-retrieval.d.ts +271 -0
  199. package/dist/graph-retrieval.js +21 -0
  200. package/dist/graph-retrieval.js.map +1 -0
  201. package/dist/harmonic-retrieval.js +2 -1
  202. package/dist/importance.js +1 -1
  203. package/dist/index.d.ts +589 -138
  204. package/dist/index.js +531 -403
  205. package/dist/index.js.map +1 -1
  206. package/dist/intent.js +1 -1
  207. package/dist/local-llm.d.ts +10 -3
  208. package/dist/local-llm.js +1 -1
  209. package/dist/memory-worth-bench.d.ts +51 -0
  210. package/dist/memory-worth-bench.js +131 -0
  211. package/dist/memory-worth-bench.js.map +1 -0
  212. package/dist/memory-worth-filter.d.ts +128 -0
  213. package/dist/memory-worth-filter.js +10 -0
  214. package/dist/memory-worth-filter.js.map +1 -0
  215. package/dist/memory-worth-outcomes.d.ts +118 -0
  216. package/dist/memory-worth-outcomes.js +9 -0
  217. package/dist/memory-worth-outcomes.js.map +1 -0
  218. package/dist/memory-worth.d.ts +102 -0
  219. package/dist/memory-worth.js +7 -0
  220. package/dist/memory-worth.js.map +1 -0
  221. package/dist/operator-toolkit.d.ts +40 -1
  222. package/dist/operator-toolkit.js +24 -14
  223. package/dist/{orchestrator-B9kwlCep.d.ts → orchestrator-CmJ-NTdJ.d.ts} +254 -10
  224. package/dist/orchestrator.d.ts +6 -3
  225. package/dist/orchestrator.js +59 -48
  226. package/dist/page-versioning.d.ts +12 -1
  227. package/dist/page-versioning.js +5 -3
  228. package/dist/{port-C1GZFv8h.d.ts → port-BADbLZU5.d.ts} +2 -2
  229. package/dist/qmd-recall-cache.d.ts +1 -1
  230. package/dist/qmd.d.ts +5 -3
  231. package/dist/qmd.js +2 -1
  232. package/dist/reasoning-trace-recall.d.ts +90 -0
  233. package/dist/reasoning-trace-recall.js +13 -0
  234. package/dist/reasoning-trace-recall.js.map +1 -0
  235. package/dist/reasoning-trace-types.d.ts +54 -0
  236. package/dist/reasoning-trace-types.js +17 -0
  237. package/dist/reasoning-trace-types.js.map +1 -0
  238. package/dist/recall-audit-anomaly.d.ts +112 -0
  239. package/dist/recall-audit-anomaly.js +11 -0
  240. package/dist/recall-audit-anomaly.js.map +1 -0
  241. package/dist/recall-audit.js +5 -44
  242. package/dist/recall-audit.js.map +1 -1
  243. package/dist/recall-explain-renderer.d.ts +49 -0
  244. package/dist/recall-explain-renderer.js +18 -0
  245. package/dist/recall-explain-renderer.js.map +1 -0
  246. package/dist/recall-state.d.ts +39 -1
  247. package/dist/recall-state.js +1 -1
  248. package/dist/recall-xray-cli.d.ts +40 -0
  249. package/dist/recall-xray-cli.js +11 -0
  250. package/dist/recall-xray-cli.js.map +1 -0
  251. package/dist/recall-xray-renderer.d.ts +44 -0
  252. package/dist/recall-xray-renderer.js +18 -0
  253. package/dist/recall-xray-renderer.js.map +1 -0
  254. package/dist/recall-xray.d.ts +179 -0
  255. package/dist/recall-xray.js +13 -0
  256. package/dist/recall-xray.js.map +1 -0
  257. package/dist/resolution-QBTDHTG7.js +100 -0
  258. package/dist/resolution-QBTDHTG7.js.map +1 -0
  259. package/dist/resolve-provider-secret.d.ts +24 -1
  260. package/dist/resolve-provider-secret.js +3 -1
  261. package/dist/resume-bundles.js +6 -6
  262. package/dist/retrieval-agents.d.ts +1 -1
  263. package/dist/retrieval-tiers.d.ts +17 -0
  264. package/dist/retrieval-tiers.js +9 -0
  265. package/dist/retrieval-tiers.js.map +1 -0
  266. package/dist/schemas.d.ts +301 -45
  267. package/dist/schemas.js +1 -1
  268. package/dist/{semantic-consolidation-DrvSYRdB.d.ts → semantic-consolidation-CxJU6MJk.d.ts} +62 -1
  269. package/dist/semantic-consolidation.d.ts +2 -1
  270. package/dist/semantic-consolidation.js +20 -6
  271. package/dist/semantic-rule-promotion.js +6 -5
  272. package/dist/semantic-rule-verifier.js +6 -5
  273. package/dist/storage.d.ts +82 -1
  274. package/dist/storage.js +5 -4
  275. package/dist/summarizer.js +4 -4
  276. package/dist/temporal-supersession.d.ts +1 -0
  277. package/dist/tier-migration.d.ts +2 -1
  278. package/dist/types-DJhqDJUV.d.ts +50 -0
  279. package/dist/types.d.ts +309 -3
  280. package/dist/types.js +1 -1
  281. package/dist/verified-recall.js +6 -5
  282. package/package.json +1 -1
  283. package/dist/chunk-2VFW5K5U.js.map +0 -1
  284. package/dist/chunk-6ZH4TU6I.js.map +0 -1
  285. package/dist/chunk-7PA4OZEU.js.map +0 -1
  286. package/dist/chunk-AAI7JARD.js.map +0 -1
  287. package/dist/chunk-BKQJBXXX.js.map +0 -1
  288. package/dist/chunk-HITJFT7E.js.map +0 -1
  289. package/dist/chunk-J4IYOZZ5.js.map +0 -1
  290. package/dist/chunk-KEG4GNGI.js.map +0 -1
  291. package/dist/chunk-LAYN4LDC.js +0 -267
  292. package/dist/chunk-LAYN4LDC.js.map +0 -1
  293. package/dist/chunk-MTLYEMJB.js.map +0 -1
  294. package/dist/chunk-NSB3WSYS.js.map +0 -1
  295. package/dist/chunk-OJFGVJS6.js.map +0 -1
  296. package/dist/chunk-PAORGQRI.js.map +0 -1
  297. package/dist/chunk-PMB3WGDL.js.map +0 -1
  298. package/dist/chunk-POMSFKTB.js.map +0 -1
  299. package/dist/chunk-QDYXG4CS.js.map +0 -1
  300. package/dist/chunk-QKAH5B6E.js.map +0 -1
  301. package/dist/chunk-QNJMBKFK.js.map +0 -1
  302. package/dist/chunk-S4LX5EBI.js.map +0 -1
  303. package/dist/chunk-U2IQTSBY.js.map +0 -1
  304. package/dist/chunk-UEYA6UC7.js.map +0 -1
  305. package/dist/chunk-UPMD5XND.js.map +0 -1
  306. package/dist/chunk-UVJFDP7P.js +0 -202
  307. package/dist/chunk-UVJFDP7P.js.map +0 -1
  308. package/dist/chunk-V7XCAHIB.js.map +0 -1
  309. package/dist/chunk-X4WESCKA.js.map +0 -1
  310. package/dist/chunk-XMGSSBFX.js.map +0 -1
  311. package/dist/chunk-YFYL2SIJ.js.map +0 -1
  312. /package/dist/{engine-X7X3AAG3.js.map → abort-error.js.map} +0 -0
  313. /package/dist/{chunk-POBPGDWI.js.map → chunk-3OGMS3PE.js.map} +0 -0
  314. /package/dist/{chunk-GJQPH5G3.js.map → chunk-CUPFXL3J.js.map} +0 -0
  315. /package/dist/{chunk-74JR4N5J.js.map → chunk-FVA6TGI3.js.map} +0 -0
  316. /package/dist/{chunk-AYPYCLR7.js.map → chunk-KUB6JU6H.js.map} +0 -0
  317. /package/dist/{chunk-4NRAJUDS.js.map → chunk-RBBWYEFJ.js.map} +0 -0
  318. /package/dist/{chunk-JROGC36Y.js.map → chunk-RGLL5SPU.js.map} +0 -0
  319. /package/dist/{chunk-MYQWXITD.js.map → chunk-SPI27QT6.js.map} +0 -0
  320. /package/dist/{chunk-KWP7T3DP.js.map → chunk-VDX363PS.js.map} +0 -0
  321. /package/dist/{chunk-ECKDIK5F.js.map → chunk-WVVA7F5A.js.map} +0 -0
  322. /package/dist/{chunk-3QFQGRHO.js.map → chunk-XMHBH5H6.js.map} +0 -0
  323. /package/dist/{chunk-BTY5RRRF.js.map → chunk-ZEM3OK2K.js.map} +0 -0
@@ -1,7 +1,12 @@
1
+ import { StorageManager } from './storage.js';
1
2
  import { EvalHarnessStatus, validateEvalBenchmarkPack, EvalBaselineDeltaReport, EvalCiGateReport } from './evals.js';
2
3
  import { GraphHealthReport } from './graph.js';
3
4
  import { SessionIntegrityReport, SessionRepairPlan, SessionRepairApplyResult } from './session-integrity.js';
4
5
  import { PluginConfig } from './types.js';
6
+ import './page-versioning.js';
7
+ import './consolidation-operator.js';
8
+ import './memory-projection-store-DeSXPh1j.js';
9
+ import 'better-sqlite3';
5
10
 
6
11
  interface QmdRuntimeLike {
7
12
  probe(): Promise<boolean>;
@@ -297,8 +302,42 @@ interface OperatorRepairOptions {
297
302
  declare function runOperatorSetup(options: OperatorSetupOptions): Promise<OperatorSetupReport>;
298
303
  declare function runOperatorConfigReview(options: OperatorConfigReviewOptions): Promise<OperatorConfigReviewReport>;
299
304
  declare function runOperatorDoctor(options: OperatorDoctorOptions): Promise<OperatorDoctorReport>;
305
+ /**
306
+ * Count memories that pre-date the Memory Worth counters introduced in issue
307
+ * #560 — i.e., neither `mw_success` nor `mw_fail` is set on the frontmatter.
308
+ *
309
+ * Only memories whose category is eligible for Memory Worth (see
310
+ * `MEMORY_WORTH_ELIGIBLE_CATEGORIES`) are considered. Procedures, corrections,
311
+ * and other kinds that are not instrumented are excluded entirely — they're
312
+ * neither "legacy" nor "instrumented" for the purposes of this audit. The
313
+ * total in the returned details reflects only eligible memories.
314
+ *
315
+ * Returned as an `ok` check regardless of count, since legacy memories are
316
+ * fully functional (readers treat missing counters as zero observations). The
317
+ * numbers are informational for operators following the #560 rollout.
318
+ *
319
+ * Exported so unit tests can exercise the classification logic without
320
+ * booting a full orchestrator.
321
+ */
322
+ declare function summarizeMemoryWorthLegacyCounters(storage: StorageManager): Promise<OperatorDoctorCheck>;
323
+ /**
324
+ * Summarize the recent buffer-surprise telemetry distribution for the
325
+ * Doctor report (issue #563 PR 3).
326
+ *
327
+ * Reports mean/median/p90 surprise scores and the triggered-flush rate
328
+ * over the most recent window of ledger rows. An empty ledger is the
329
+ * expected state until `bufferSurpriseTriggerEnabled` is turned on — the
330
+ * check never escalates beyond `ok` / `warn` (ledger unreadable).
331
+ *
332
+ * Exported so tests can exercise the formatting without booting a real
333
+ * orchestrator.
334
+ */
335
+ declare function summarizeBufferSurpriseDistribution(storage: StorageManager, config: PluginConfig): Promise<OperatorDoctorCheck>;
336
+ declare function summarizeConsolidationProvenance(storage: StorageManager, config: Pick<PluginConfig, "memoryDir"> & {
337
+ versioningSidecarDir?: string;
338
+ }): Promise<OperatorDoctorCheck>;
300
339
  declare function runOperatorInventory(options: OperatorInventoryOptions): Promise<OperatorInventoryReport>;
301
340
  declare function runBenchmarkRecall(options: BenchmarkRecallOptions): Promise<BenchmarkRecallReport>;
302
341
  declare function runOperatorRepair(options: OperatorRepairOptions): Promise<OperatorRepairReport>;
303
342
 
304
- export { type BenchmarkRecallOptions, type BenchmarkRecallReport, type OperatorConfigLoadResult, type OperatorConfigReviewFinding, type OperatorConfigReviewOptions, type OperatorConfigReviewReport, type OperatorDoctorCheck, type OperatorDoctorOptions, type OperatorDoctorReport, type OperatorInventoryNamespaceSummary, type OperatorInventoryOptions, type OperatorInventoryReport, type OperatorRepairOptions, type OperatorRepairReport, type OperatorSetupOptions, type OperatorSetupReport, type OperatorToolkitOrchestrator, runBenchmarkRecall, runOperatorConfigReview, runOperatorDoctor, runOperatorInventory, runOperatorRepair, runOperatorSetup };
343
+ export { type BenchmarkRecallOptions, type BenchmarkRecallReport, type OperatorConfigLoadResult, type OperatorConfigReviewFinding, type OperatorConfigReviewOptions, type OperatorConfigReviewReport, type OperatorDoctorCheck, type OperatorDoctorOptions, type OperatorDoctorReport, type OperatorInventoryNamespaceSummary, type OperatorInventoryOptions, type OperatorInventoryReport, type OperatorRepairOptions, type OperatorRepairReport, type OperatorSetupOptions, type OperatorSetupReport, type OperatorToolkitOrchestrator, runBenchmarkRecall, runOperatorConfigReview, runOperatorDoctor, runOperatorInventory, runOperatorRepair, runOperatorSetup, summarizeBufferSurpriseDistribution, summarizeConsolidationProvenance, summarizeMemoryWorthLegacyCounters };
@@ -4,42 +4,52 @@ import {
4
4
  runOperatorDoctor,
5
5
  runOperatorInventory,
6
6
  runOperatorRepair,
7
- runOperatorSetup
8
- } from "./chunk-X4WESCKA.js";
9
- import "./chunk-HITJFT7E.js";
7
+ runOperatorSetup,
8
+ summarizeBufferSurpriseDistribution,
9
+ summarizeConsolidationProvenance,
10
+ summarizeMemoryWorthLegacyCounters
11
+ } from "./chunk-B5WXLVDY.js";
12
+ import "./chunk-ULYOGL6R.js";
13
+ import "./chunk-ASAITVLA.js";
14
+ import "./chunk-7I7FKFZH.js";
10
15
  import "./chunk-YRMVARQP.js";
16
+ import "./chunk-YNQKWQT4.js";
11
17
  import "./chunk-U66YHYC7.js";
12
- import "./chunk-7PA4OZEU.js";
18
+ import "./chunk-LK6SGL53.js";
13
19
  import "./chunk-7SEAZFFB.js";
14
20
  import "./chunk-K6WK37A6.js";
15
- import "./chunk-LK6SGL53.js";
16
- import "./chunk-OJFGVJS6.js";
21
+ import "./chunk-BK2EFTE2.js";
17
22
  import "./chunk-Z5LAYHGJ.js";
18
23
  import "./chunk-C2EFFULQ.js";
24
+ import "./chunk-PVGDJXVK.js";
19
25
  import "./chunk-MARWOCVP.js";
20
- import "./chunk-POBPGDWI.js";
21
- import "./chunk-QNJMBKFK.js";
26
+ import "./chunk-3OGMS3PE.js";
27
+ import "./chunk-2LGMW3DJ.js";
22
28
  import "./chunk-TBBDFYXW.js";
23
- import "./chunk-LPSF4OQH.js";
24
- import "./chunk-POMSFKTB.js";
25
- import "./chunk-U2IQTSBY.js";
29
+ import "./chunk-F5VP6YCB.js";
30
+ import "./chunk-LTCGGW2D.js";
26
31
  import "./chunk-4KAN3GZ3.js";
27
- import "./chunk-6ZH4TU6I.js";
28
32
  import "./chunk-6PFRXT4K.js";
29
33
  import "./chunk-TP4FZJIZ.js";
30
34
  import "./chunk-SCU65EZI.js";
31
35
  import "./chunk-BOUYNNYD.js";
32
- import "./chunk-QSVPYQPG.js";
33
36
  import "./chunk-DM2T26WE.js";
37
+ import "./chunk-QSVPYQPG.js";
34
38
  import "./chunk-M62O4P4T.js";
35
39
  import "./chunk-4DJQYKMN.js";
40
+ import "./chunk-X6GF3FX2.js";
41
+ import "./chunk-FAAFWE4G.js";
36
42
  import "./chunk-2ODBA7MQ.js";
43
+ import "./chunk-LPSF4OQH.js";
37
44
  export {
38
45
  runBenchmarkRecall,
39
46
  runOperatorConfigReview,
40
47
  runOperatorDoctor,
41
48
  runOperatorInventory,
42
49
  runOperatorRepair,
43
- runOperatorSetup
50
+ runOperatorSetup,
51
+ summarizeBufferSurpriseDistribution,
52
+ summarizeConsolidationProvenance,
53
+ summarizeMemoryWorthLegacyCounters
44
54
  };
45
55
  //# sourceMappingURL=operator-toolkit.js.map
@@ -1,21 +1,91 @@
1
1
  import { SmartBuffer } from './buffer.js';
2
- import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions } from './port-C1GZFv8h.js';
2
+ import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions } from './port-BADbLZU5.js';
3
3
  import { StorageManager } from './storage.js';
4
4
  import { TranscriptManager } from './transcript.js';
5
5
  import { HourlySummarizer } from './summarizer.js';
6
6
  import { LocalLlmClient } from './local-llm.js';
7
+ import { FallbackLlmClient } from './fallback-llm.js';
7
8
  import { ModelRegistry } from './model-registry.js';
8
9
  import { RelevanceStore } from './relevance.js';
9
10
  import { NegativeExampleStore } from './negative.js';
10
11
  import { LastRecallStore, TierMigrationStatusStore, GraphRecallExpandedEntry, TierMigrationStatusSnapshot, TierMigrationCycleSummary, LastRecallSnapshot } from './recall-state.js';
12
+ import { RecallXraySnapshot } from './recall-xray.js';
11
13
  import { SessionObserverState } from './session-observer-state.js';
12
14
  import { EmbeddingFallback } from './embedding-fallback.js';
13
- import { PluginConfig, QmdSearchResult, BehaviorLoopPolicyState, BootstrapOptions, BootstrapResult, ConsolidationObservation, MemoryFile, DaySummaryResult, MemoryActionEvent, RecallPlanMode, MemoryIntent, EntityTimelineEntry, ExtractionResult, MemoryFrontmatter, IdentityInjectionMode } from './types.js';
14
- import { S as SemanticConsolidationResult } from './semantic-consolidation-DrvSYRdB.js';
15
+ import { PluginConfig, CodingContext, QmdSearchResult, BehaviorLoopPolicyState, BootstrapOptions, BootstrapResult, ConsolidationObservation, MemoryFile, DaySummaryResult, MemoryActionEvent, RecallPlanMode, MemoryIntent, EntityTimelineEntry, ExtractionResult, MemoryFrontmatter, IdentityInjectionMode } from './types.js';
16
+ import { S as SemanticConsolidationResult } from './semantic-consolidation-CxJU6MJk.js';
15
17
  import { z } from 'zod';
16
18
  import { RuntimePolicyValues } from './policy-runtime.js';
17
19
  import { ProfilingCollector } from './profiling.js';
18
20
 
21
+ /**
22
+ * @remnic/core — Write-time semantic dedup guard
23
+ *
24
+ * Complements the exact content-hash check in the orchestrator's write path
25
+ * by detecting near-duplicate candidate facts via embedding cosine similarity.
26
+ *
27
+ * The module intentionally has no dependency on the EmbeddingFallback or QMD
28
+ * classes directly — callers pass in a `lookup` function that returns the
29
+ * top-K nearest neighbors with their cosine scores. This keeps the decision
30
+ * logic pure and trivially testable with synthetic fixtures, and lets the
31
+ * orchestrator reuse whichever backend it already has wired up.
32
+ *
33
+ * Related issue: joshuaswarren/remnic#373
34
+ */
35
+ /** A single nearest-neighbor hit from the embedding backend. */
36
+ interface SemanticDedupHit {
37
+ /** Memory id of the existing neighbor. */
38
+ id: string;
39
+ /** Cosine similarity score in [0, 1]. */
40
+ score: number;
41
+ /** Optional source path, purely informational. */
42
+ path?: string;
43
+ }
44
+ /**
45
+ * Lookup function passed by the caller. Must return an array of hits sorted
46
+ * descending by score. Implementations should return an empty array (never
47
+ * throw) when the embedding backend is unavailable — the decision function
48
+ * treats that as "no near duplicate" (fail-open).
49
+ */
50
+ type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
51
+ interface SemanticDedupOptions {
52
+ /** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
53
+ enabled: boolean;
54
+ /** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
55
+ threshold: number;
56
+ /** How many nearest neighbors to compare against. */
57
+ candidates: number;
58
+ }
59
+ type SemanticDedupDecision = {
60
+ action: "keep";
61
+ reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
62
+ topScore?: number;
63
+ topId?: string;
64
+ } | {
65
+ action: "skip";
66
+ reason: "near_duplicate";
67
+ topScore: number;
68
+ topId: string;
69
+ topPath?: string;
70
+ };
71
+ /**
72
+ * Pure decision function: given a lookup callback and options, decide whether
73
+ * the candidate content should be written or skipped as a near-duplicate.
74
+ *
75
+ * Contract:
76
+ * - When `options.enabled` is false → always keep, reason="disabled".
77
+ * - When the lookup throws (provider down / network error) → keep,
78
+ * reason="backend_unavailable". Fail-open: a lookup failure must not block
79
+ * writes.
80
+ * - When the lookup succeeds but returns 0 hits (empty index or no
81
+ * neighbors above the score floor) → keep, reason="no_candidates".
82
+ * This is distinct from backend_unavailable so telemetry dashboards can
83
+ * correctly distinguish "provider is down" from "index is empty".
84
+ * - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
85
+ * - Otherwise → keep with reason="no_near_duplicate".
86
+ */
87
+ declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
88
+
19
89
  type ReplaySource = "openclaw" | "claude" | "chatgpt";
20
90
  type ReplayRole = "user" | "assistant";
21
91
  interface ReplayTurn {
@@ -239,12 +309,12 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
239
309
  agent: string;
240
310
  date: string;
241
311
  reason: string;
242
- confidence?: number | undefined;
312
+ workflow?: string | undefined;
243
313
  tags?: string[] | undefined;
314
+ confidence?: number | undefined;
244
315
  severity?: "low" | "medium" | "high" | undefined;
245
316
  outcome?: string | undefined;
246
317
  refs?: string[] | undefined;
247
- workflow?: string | undefined;
248
318
  learning?: string | undefined;
249
319
  evidenceWindowStart?: string | undefined;
250
320
  evidenceWindowEnd?: string | undefined;
@@ -253,12 +323,12 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
253
323
  agent: string;
254
324
  date: string;
255
325
  reason: string;
256
- confidence?: number | undefined;
326
+ workflow?: string | undefined;
257
327
  tags?: string[] | undefined;
328
+ confidence?: number | undefined;
258
329
  severity?: "low" | "medium" | "high" | undefined;
259
330
  outcome?: string | undefined;
260
331
  refs?: string[] | undefined;
261
- workflow?: string | undefined;
262
332
  learning?: string | undefined;
263
333
  evidenceWindowStart?: string | undefined;
264
334
  evidenceWindowEnd?: string | undefined;
@@ -635,6 +705,35 @@ interface RecallInvocationOptions {
635
705
  topK?: number;
636
706
  mode?: RecallPlanMode;
637
707
  abortSignal?: AbortSignal;
708
+ /**
709
+ * Capture a `RecallXraySnapshot` for this recall (issue #570). When
710
+ * `true`, the orchestrator builds a snapshot from the data it has
711
+ * already gathered and stashes it in memory, accessible via
712
+ * `getLastXraySnapshot()`. When `false` or absent, nothing is
713
+ * captured and recall behavior is unchanged (schema-only slice).
714
+ */
715
+ xrayCapture?: boolean;
716
+ /**
717
+ * Per-invocation override for `recallBudgetChars` (issue #570 PR 3/4).
718
+ * Flows through `getRecallBudgetChars()` for this recall only — no
719
+ * shared config mutation, so concurrent recalls on the same
720
+ * orchestrator are not affected (CLAUDE.md rule 47: no shared
721
+ * mutable state across async boundaries). Must be a non-negative
722
+ * finite integer; non-conforming values are ignored and the
723
+ * configured budget is used.
724
+ */
725
+ budgetCharsOverride?: number;
726
+ /**
727
+ * Per-invocation principal override (issue #570 PR 4). When set,
728
+ * the orchestrator uses this principal for ACL / namespace checks
729
+ * instead of `resolvePrincipal(sessionKey, config)`. This is the
730
+ * escape hatch for access surfaces (HTTP / MCP) that have already
731
+ * authenticated the caller upstream — threading an unmapped
732
+ * principal through the session-key-based resolver would otherwise
733
+ * collapse it to `"default"` and produce false denials in
734
+ * namespace-enabled deployments (CLAUDE.md rule 42).
735
+ */
736
+ principalOverride?: string;
638
737
  }
639
738
  /** Default workspace directory when no per-agent or config workspace is available. */
640
739
  declare function defaultWorkspaceDir(): string;
@@ -751,12 +850,37 @@ declare class Orchestrator {
751
850
  readonly localLlm: LocalLlmClient;
752
851
  readonly fastLlm: LocalLlmClient;
753
852
  private readonly judgeVerdictCache;
754
- private readonly fastGatewayLlm;
853
+ /**
854
+ * Per-orchestrator defer-counter map (issue #562, PR 2). Tracks how many
855
+ * times the judge has returned `"defer"` for a given candidate content
856
+ * hash so the defer cap can be enforced.
857
+ */
858
+ private readonly judgeDeferCounts;
859
+ /**
860
+ * Side-channel: number of facts deferred in the most recent
861
+ * `persistExtraction` call (issue #562, PR 2). The caller reads this after
862
+ * `persistExtraction` returns to decide whether to retain buffer turns for
863
+ * the next extraction pass. Not part of the return signature because many
864
+ * callers already destructure `persistedIds` by position.
865
+ */
866
+ private lastPersistExtractionDeferredCount;
867
+ private readonly _fastGatewayLlm;
868
+ get fastGatewayLlm(): FallbackLlmClient | null;
755
869
  readonly modelRegistry: ModelRegistry;
756
870
  readonly relevance: RelevanceStore;
757
871
  readonly negatives: NegativeExampleStore;
758
872
  readonly lastRecall: LastRecallStore;
759
873
  readonly tierMigrationStatus: TierMigrationStatusStore;
874
+ /**
875
+ * In-memory X-ray snapshot from the most recent `recall()` call that
876
+ * was invoked with `xrayCapture: true` (issue #570 PR 1). Scope is
877
+ * per-process; later slices add CLI/HTTP/MCP surfaces that consume
878
+ * this via the shared renderer. `null` until the first capture, and
879
+ * NEVER overwritten by a recall that did not request capture —
880
+ * requests without the flag leave prior captures intact so the
881
+ * capturing caller can still read their snapshot back.
882
+ */
883
+ private lastXraySnapshot;
760
884
  readonly embeddingFallback: EmbeddingFallback;
761
885
  private readonly conversationIndexDir;
762
886
  private readonly extraction;
@@ -772,6 +896,16 @@ declare class Orchestrator {
772
896
  /** Lossless Context Management engine — proactive session archive + DAG summarization. */
773
897
  readonly lcmEngine: LcmEngine | null;
774
898
  private readonly rerankCache;
899
+ /**
900
+ * Short-TTL cache for Memory Worth counter lookups so interactive recall
901
+ * doesn't trigger a full `readAllMemories` scan per query. Keyed by
902
+ * namespace; the filter unions across namespaces at query time. The TTL
903
+ * is intentionally short (seconds, not minutes) because counters are
904
+ * mutated by `recordMemoryOutcome` asynchronously and we'd rather serve
905
+ * a 30-second-stale worth score than a stable-but-wrong one.
906
+ */
907
+ private readonly memoryWorthCounterCache;
908
+ private static readonly MEMORY_WORTH_CACHE_TTL_MS;
775
909
  /**
776
910
  * Per-session workspace overrides keyed by sessionKey.
777
911
  * Set by the before_agent_start hook so recall() uses the correct
@@ -779,6 +913,14 @@ declare class Orchestrator {
779
913
  * Using a Map prevents concurrent sessions from overwriting each other.
780
914
  */
781
915
  private _recallWorkspaceOverrides;
916
+ /**
917
+ * Per-session coding-agent context (issue #569). Populated by connectors at
918
+ * session-start (PRs 5/6/7) via `setCodingContextForSession`. Used by both
919
+ * the recall path and the write path so that memory routing respects the
920
+ * project/branch scope a session is operating in (rule 42 — read + write
921
+ * through the same namespace layer).
922
+ */
923
+ private readonly _codingContextBySession;
782
924
  private routingRulesStore;
783
925
  private contentHashIndex;
784
926
  private readonly artifactSourceStatusCache;
@@ -808,6 +950,7 @@ declare class Orchestrator {
808
950
  private runtimePolicyValues;
809
951
  private utilityRuntimeValues;
810
952
  private evalShadowWriteChain;
953
+ private directAnswerObservationChain;
811
954
  private initPromise;
812
955
  private resolveInit;
813
956
  /**
@@ -840,12 +983,76 @@ declare class Orchestrator {
840
983
  * promptly on shutdown. Safe to call multiple times or before init.
841
984
  */
842
985
  abortDeferredInit(): void;
986
+ private disposeSearchBackendIfNeeded;
843
987
  /** Set per-session workspace for the next recall() call (compaction reset). @internal */
844
988
  setRecallWorkspaceOverride(sessionKey: string, dir: string): void;
845
989
  /** Remove a per-session workspace override (cleanup on error or early return). @internal */
846
990
  clearRecallWorkspaceOverride(sessionKey: string): void;
847
991
  resolvePrincipal(sessionKey?: string): string;
848
992
  resolveSelfNamespace(sessionKey?: string): string;
993
+ /**
994
+ * Attach a coding-agent context to a session (issue #569). Called by the
995
+ * Claude Code / Codex / Cursor connectors at session start after
996
+ * `resolveGitContext(cwd)`. The context is consulted by the recall path
997
+ * and the write path so that memories route to a project- (and optionally
998
+ * branch-) scoped namespace.
999
+ *
1000
+ * Pass `null` to clear.
1001
+ */
1002
+ setCodingContextForSession(sessionKey: string, codingContext: CodingContext | null): void;
1003
+ /**
1004
+ * Read-only accessor for the coding context attached to a session. Returns
1005
+ * `null` when none is set. Used by `remnic doctor` and by tests.
1006
+ *
1007
+ * Defensive `_codingContextBySession` lookup — legacy orchestrator-flush
1008
+ * tests use `Object.create(Orchestrator.prototype)` which does not run
1009
+ * class-field initializers, so the Map may be undefined on stubs.
1010
+ */
1011
+ getCodingContextForSession(sessionKey: string | undefined): CodingContext | null;
1012
+ /**
1013
+ * Shared helper used by both the recall path and the write path (rule 42).
1014
+ *
1015
+ * Given a base namespace computed from the principal, returns the overlaid
1016
+ * coding namespace when the session has a coding context AND
1017
+ * `codingMode.projectScope` is true AND `namespacesEnabled` is true.
1018
+ * Otherwise returns `baseNamespace` unchanged — CLAUDE.md #30 escape hatch.
1019
+ *
1020
+ * Principal isolation (CLAUDE.md rule 42): the overlay is COMBINED with
1021
+ * the principal-derived `baseNamespace` rather than replacing it, so two
1022
+ * principals working in the same repository do not share memories through
1023
+ * a common `project-*` namespace.
1024
+ *
1025
+ * Namespaces-disabled gate: when `namespacesEnabled` is false, the
1026
+ * storage router maps every namespace to the same `memoryDir`. Returning
1027
+ * `project-*` in that mode would create apparent route separation with
1028
+ * no actual storage isolation — a false-isolation trap. In that mode we
1029
+ * return `baseNamespace` unchanged so coding mode degrades to the existing
1030
+ * unscoped behavior.
1031
+ *
1032
+ * @internal
1033
+ */
1034
+ applyCodingNamespaceOverlay(sessionKey: string | undefined, baseNamespace: string): string;
1035
+ /**
1036
+ * Read-side overlay: returns the list of namespaces a session should read
1037
+ * from, including any read fallbacks (branch → project asymmetry lands in
1038
+ * PR 3; PR 2 returns an empty fallbacks list).
1039
+ *
1040
+ * Returns `null` when:
1041
+ * - `namespacesEnabled` is false (overlay would create false isolation)
1042
+ * - no context attached to the session
1043
+ * - `codingMode.projectScope` is false (CLAUDE.md #30 escape hatch)
1044
+ *
1045
+ * The returned `namespace` / `readFallbacks` are RAW overlay fragments
1046
+ * (e.g. `project-origin-ab12`). Callers MUST combine them with the
1047
+ * principal-derived base through `combineNamespaces()` before passing to
1048
+ * storage, so principal isolation is preserved (rule 42).
1049
+ *
1050
+ * @internal
1051
+ */
1052
+ applyCodingRecallOverlay(sessionKey: string | undefined): {
1053
+ namespace: string;
1054
+ readFallbacks: string[];
1055
+ } | null;
849
1056
  getStorageForNamespace(namespace?: string): Promise<StorageManager>;
850
1057
  private configuredNamespaces;
851
1058
  private buildConfiguredQmdSearchOptions;
@@ -917,6 +1124,7 @@ declare class Orchestrator {
917
1124
  private autoRegisterDaySummaryCron;
918
1125
  private autoRegisterNightlyGovernanceCron;
919
1126
  private autoRegisterProceduralMiningCron;
1127
+ private autoRegisterContradictionScanCron;
920
1128
  applyBehaviorRuntimePolicy(state: BehaviorLoopPolicyState): Promise<{
921
1129
  applied: boolean;
922
1130
  rolledBack: boolean;
@@ -1041,6 +1249,23 @@ declare class Orchestrator {
1041
1249
  */
1042
1250
  private validateLocalLlmModel;
1043
1251
  recall(prompt: string, sessionKey?: string, options?: RecallInvocationOptions): Promise<string>;
1252
+ /**
1253
+ * Return the most recent X-ray snapshot captured during a
1254
+ * `recall()` call that passed `xrayCapture: true` (issue #570 PR 1).
1255
+ * Returns `null` when no such capture has occurred on this
1256
+ * orchestrator instance. Returned snapshot is a deep copy so
1257
+ * caller mutation cannot tear the stored value.
1258
+ */
1259
+ getLastXraySnapshot(): RecallXraySnapshot | null;
1260
+ /** Clear the captured X-ray snapshot. Exposed for tests / explicit reset. */
1261
+ clearLastXraySnapshot(): void;
1262
+ /**
1263
+ * Await the in-flight observation-mode direct-answer annotation chain.
1264
+ * Resolves to true when settled, false on timeout.
1265
+ */
1266
+ waitForDirectAnswerObservationIdle(timeoutMs?: number): Promise<boolean>;
1267
+ private enqueueDirectAnswerObservation;
1268
+ private annotateDirectAnswerTier;
1044
1269
  private logRecallFailure;
1045
1270
  private artifactTypeForCategory;
1046
1271
  private truncateArtifactForRecall;
@@ -1153,6 +1378,24 @@ declare class Orchestrator {
1153
1378
  * Called automatically when items are queued.
1154
1379
  */
1155
1380
  private processQueue;
1381
+ /**
1382
+ * Classify + log a failure from either the per-task catch inside
1383
+ * `processQueue()` or the outer `processQueue().catch(...)` in
1384
+ * `queueBufferedExtraction()`. Issue #549: `throwIfRecallAborted`
1385
+ * (used throughout `runExtraction`) raises an Error whose `name` is
1386
+ * `"AbortError"`. That path fires when `before_reset` aborts a
1387
+ * queued task to avoid duplicate extraction — it is intentional
1388
+ * cancellation, not a failure. Downgrading the log to debug
1389
+ * prevents spurious `error`-level lines that routinely appear
1390
+ * right next to a successful `persisted: N facts, M entities` log
1391
+ * and that confuse operators into thinking extraction is broken.
1392
+ * Genuine extraction failures (network, parse, I/O) still log at
1393
+ * `error`.
1394
+ *
1395
+ * Source differentiates the two call sites so the log message
1396
+ * names the right layer (`task` vs `processor`).
1397
+ */
1398
+ private logExtractionQueueFailure;
1156
1399
  private runExtraction;
1157
1400
  private recordProcessedExtractionFingerprint;
1158
1401
  private runTierMigrationCycle;
@@ -1259,6 +1502,7 @@ declare class Orchestrator {
1259
1502
  *
1260
1503
  * Callers must pass the full candidate pool (post-rerank, pre-slice).
1261
1504
  */
1505
+ private applyMemoryWorthRerank;
1262
1506
  private diversifyAndLimitRecallResults;
1263
1507
  /**
1264
1508
  * Apply Maximal Marginal Relevance to a section's ordered candidate list.
@@ -1286,7 +1530,7 @@ declare class Orchestrator {
1286
1530
  * path prefix (and, for the legacy default-namespace layout at
1287
1531
  * `memoryDir` root, an exclusion list for `namespaces/*`).
1288
1532
  */
1289
- private semanticDedupLookup;
1533
+ semanticDedupLookup(content: string, limit: number, targetStorage: StorageManager): Promise<SemanticDedupHit[]>;
1290
1534
  /**
1291
1535
  * Resolve the namespace-scoped filter to pass into
1292
1536
  * `EmbeddingFallback.search()` for semantic dedup. Returns an empty
@@ -1346,4 +1590,4 @@ declare class Orchestrator {
1346
1590
  private readArchivedMemoriesForNamespaces;
1347
1591
  }
1348
1592
 
1349
- export { deriveTopicsFromExtraction as A, type BulkImportSource as B, type CompoundingPromotionReport as C, filterRecallCandidates as D, formatCompressionGuidelinesForRecall as E, graphPathRelativeToStorage as F, type GraphRecallSnapshot as G, hasIdentityRecoveryIntent as H, type IntentDebugSnapshot as I, isArtifactMemoryPath as J, lifecycleRecallScoreAdjustment as K, mergeArtifactRecallCandidates as L, mergeGraphExpandedResults as M, resolveEffectiveIdentityInjectionMode as N, Orchestrator as O, resolveEffectiveRecallMode as P, type QmdRecallSnapshot as Q, type ReplaySource as R, resolvePersistedMemoryRelativePath as S, resolveRecallModeDecision as T, resolveRecentThreadMemoryPaths as U, shouldFilterLifecycleRecallCandidate as V, summarizeGraphShadowComparison as W, type ReplayWarning as a, type ImportTurn as b, type BulkImportOptions as c, type BulkImportResult as d, type ReplayTurn as e, type BulkImportSourceAdapter as f, type BulkImportError as g, type ImportSourceRole as h, type ImportTurnValidationIssue as i, defaultWorkspaceDir as j, isImportRole as k, type GraphRecallRankedResult as l, type GraphRecallShadowComparison as m, type RecallInvocationOptions as n, type RecallModeDecision as o, parseIsoTimestamp as p, appendMemoryToGraphContext as q, blendGraphExpandedRecallScore as r, sanitizeSessionKeyForFilename as s, buildCompressionGuidelinesMarkdown as t, buildMemoryPathById as u, validateImportTurn as v, computeArtifactCandidateFetchLimit as w, computeArtifactRecallLimit as x, computeQmdHybridFetchLimit as y, dedupeEntitySynthesisEvidenceEntries as z };
1593
+ export { summarizeGraphShadowComparison as $, computeArtifactCandidateFetchLimit as A, type BulkImportSource as B, type CompoundingPromotionReport as C, computeArtifactRecallLimit as D, computeQmdHybridFetchLimit as E, dedupeEntitySynthesisEvidenceEntries as F, type GraphRecallSnapshot as G, deriveTopicsFromExtraction as H, type IntentDebugSnapshot as I, filterRecallCandidates as J, formatCompressionGuidelinesForRecall as K, graphPathRelativeToStorage as L, hasIdentityRecoveryIntent as M, isArtifactMemoryPath as N, Orchestrator as O, lifecycleRecallScoreAdjustment as P, type QmdRecallSnapshot as Q, type ReplaySource as R, type SemanticDedupLookup as S, mergeArtifactRecallCandidates as T, mergeGraphExpandedResults as U, resolveEffectiveIdentityInjectionMode as V, resolveEffectiveRecallMode as W, resolvePersistedMemoryRelativePath as X, resolveRecallModeDecision as Y, resolveRecentThreadMemoryPaths as Z, shouldFilterLifecycleRecallCandidate as _, type ReplayWarning as a, type ImportTurn as b, type BulkImportOptions as c, type BulkImportResult as d, type ReplayTurn as e, type BulkImportSourceAdapter as f, type BulkImportError as g, type ImportSourceRole as h, type ImportTurnValidationIssue as i, type SemanticDedupDecision as j, type SemanticDedupHit as k, type SemanticDedupOptions as l, decideSemanticDedup as m, defaultWorkspaceDir as n, isImportRole as o, parseIsoTimestamp as p, type GraphRecallRankedResult as q, type GraphRecallShadowComparison as r, sanitizeSessionKeyForFilename as s, type RecallInvocationOptions as t, type RecallModeDecision as u, validateImportTurn as v, appendMemoryToGraphContext as w, blendGraphExpandedRecallScore as x, buildCompressionGuidelinesMarkdown as y, buildMemoryPathById as z };
@@ -1,21 +1,24 @@
1
1
  import './buffer.js';
2
- import './port-C1GZFv8h.js';
2
+ import './port-BADbLZU5.js';
3
3
  import './storage.js';
4
4
  import './transcript.js';
5
5
  import './summarizer.js';
6
6
  import './local-llm.js';
7
+ import './fallback-llm.js';
7
8
  import './model-registry.js';
8
9
  import './relevance.js';
9
10
  import './negative.js';
10
11
  import './recall-state.js';
12
+ import './recall-xray.js';
11
13
  import './session-observer-state.js';
12
14
  import './embedding-fallback.js';
13
- export { l as GraphRecallRankedResult, m as GraphRecallShadowComparison, G as GraphRecallSnapshot, I as IntentDebugSnapshot, O as Orchestrator, Q as QmdRecallSnapshot, n as RecallInvocationOptions, o as RecallModeDecision, q as appendMemoryToGraphContext, r as blendGraphExpandedRecallScore, t as buildCompressionGuidelinesMarkdown, u as buildMemoryPathById, w as computeArtifactCandidateFetchLimit, x as computeArtifactRecallLimit, y as computeQmdHybridFetchLimit, z as dedupeEntitySynthesisEvidenceEntries, j as defaultWorkspaceDir, A as deriveTopicsFromExtraction, D as filterRecallCandidates, E as formatCompressionGuidelinesForRecall, F as graphPathRelativeToStorage, H as hasIdentityRecoveryIntent, J as isArtifactMemoryPath, K as lifecycleRecallScoreAdjustment, L as mergeArtifactRecallCandidates, M as mergeGraphExpandedResults, N as resolveEffectiveIdentityInjectionMode, P as resolveEffectiveRecallMode, S as resolvePersistedMemoryRelativePath, T as resolveRecallModeDecision, U as resolveRecentThreadMemoryPaths, s as sanitizeSessionKeyForFilename, V as shouldFilterLifecycleRecallCandidate, W as summarizeGraphShadowComparison } from './orchestrator-B9kwlCep.js';
15
+ export { q as GraphRecallRankedResult, r as GraphRecallShadowComparison, G as GraphRecallSnapshot, I as IntentDebugSnapshot, O as Orchestrator, Q as QmdRecallSnapshot, t as RecallInvocationOptions, u as RecallModeDecision, w as appendMemoryToGraphContext, x as blendGraphExpandedRecallScore, y as buildCompressionGuidelinesMarkdown, z as buildMemoryPathById, A as computeArtifactCandidateFetchLimit, D as computeArtifactRecallLimit, E as computeQmdHybridFetchLimit, F as dedupeEntitySynthesisEvidenceEntries, n as defaultWorkspaceDir, H as deriveTopicsFromExtraction, J as filterRecallCandidates, K as formatCompressionGuidelinesForRecall, L as graphPathRelativeToStorage, M as hasIdentityRecoveryIntent, N as isArtifactMemoryPath, P as lifecycleRecallScoreAdjustment, T as mergeArtifactRecallCandidates, U as mergeGraphExpandedResults, V as resolveEffectiveIdentityInjectionMode, W as resolveEffectiveRecallMode, X as resolvePersistedMemoryRelativePath, Y as resolveRecallModeDecision, Z as resolveRecentThreadMemoryPaths, s as sanitizeSessionKeyForFilename, _ as shouldFilterLifecycleRecallCandidate, $ as summarizeGraphShadowComparison } from './orchestrator-CmJ-NTdJ.js';
14
16
  import './types.js';
15
- import './semantic-consolidation-DrvSYRdB.js';
17
+ import './semantic-consolidation-CxJU6MJk.js';
16
18
  import './policy-runtime.js';
17
19
  import './profiling.js';
18
20
  import './page-versioning.js';
21
+ import './consolidation-operator.js';
19
22
  import './memory-projection-store-DeSXPh1j.js';
20
23
  import 'better-sqlite3';
21
24
  import './session-integrity.js';