@remnic/core 9.3.750 → 9.3.752

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 (318) hide show
  1. package/dist/access-boundary.d.ts +5 -5
  2. package/dist/access-boundary.js +29 -29
  3. package/dist/access-cli.js +88 -88
  4. package/dist/access-http.d.ts +5 -5
  5. package/dist/access-http.js +35 -35
  6. package/dist/access-mcp.d.ts +5 -5
  7. package/dist/access-mcp.js +34 -34
  8. package/dist/access-operations-batch.js +31 -31
  9. package/dist/access-operations.d.ts +5 -5
  10. package/dist/access-operations.js +33 -33
  11. package/dist/access-recall-surface.d.ts +363 -0
  12. package/dist/access-recall-surface.js +128 -0
  13. package/dist/access-schema.js +7 -7
  14. package/dist/{access-service-DmAEOJdJ.d.ts → access-service-C2cOHQvg.d.ts} +7 -26
  15. package/dist/access-service.d.ts +5 -5
  16. package/dist/access-service.js +28 -28
  17. package/dist/access-surface-catalog.d.ts +5 -5
  18. package/dist/action-confidence.d.ts +1 -1
  19. package/dist/active-memory-bridge.d.ts +1 -1
  20. package/dist/active-recall.d.ts +1 -1
  21. package/dist/active-recall.js +1 -1
  22. package/dist/behavior-learner.d.ts +1 -1
  23. package/dist/behavior-signals.d.ts +1 -1
  24. package/dist/bootstrap.d.ts +4 -4
  25. package/dist/briefing.d.ts +1 -1
  26. package/dist/briefing.js +4 -4
  27. package/dist/buffer-surprise-report.d.ts +1 -1
  28. package/dist/buffer.d.ts +1 -1
  29. package/dist/buffer.js +2 -2
  30. package/dist/calibration.d.ts +1 -1
  31. package/dist/capabilities.d.ts +1 -1
  32. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-CZJSLEFG.js} +3 -3
  33. package/dist/{catalog-BpOcwHdE.d.ts → catalog-D_FvzTM0.d.ts} +1 -1
  34. package/dist/causal-behavior.d.ts +1 -1
  35. package/dist/causal-behavior.js +2 -2
  36. package/dist/causal-chain.js +2 -2
  37. package/dist/causal-consolidation.d.ts +1 -1
  38. package/dist/causal-consolidation.js +9 -9
  39. package/dist/causal-retrieval.js +2 -2
  40. package/dist/causal-trajectory-graph.d.ts +1 -1
  41. package/dist/causal-trajectory.js +1 -1
  42. package/dist/{chunk-2NLLXCJG.js → chunk-2BFLDH5F.js} +2 -2
  43. package/dist/{chunk-UU32EAIY.js → chunk-2DPCAW2T.js} +5 -5
  44. package/dist/{chunk-5PZCDUJ6.js → chunk-2U4E34Y3.js} +4 -4
  45. package/dist/{chunk-JRZV3767.js → chunk-33NX5BLR.js} +4 -4
  46. package/dist/{chunk-X7Y7WX73.js → chunk-437S3G37.js} +2 -2
  47. package/dist/{chunk-HAZVVOYT.js → chunk-5DXUE7GB.js} +2 -2
  48. package/dist/{chunk-4DLFJJOQ.js → chunk-5JAT4ZJD.js} +4 -4
  49. package/dist/{chunk-RS25QOKZ.js → chunk-64SE4X5G.js} +2 -2
  50. package/dist/{chunk-QRRBXD24.js → chunk-67JRXV6Z.js} +7 -7
  51. package/dist/{chunk-WA7FECSG.js → chunk-6ROCH5JV.js} +7 -7
  52. package/dist/{chunk-5QANTTY2.js → chunk-BIAMJUUJ.js} +4 -4
  53. package/dist/{chunk-IKHKHADN.js → chunk-C4LNKQ3M.js} +5 -5
  54. package/dist/{chunk-B35L45HZ.js → chunk-DC5OBZS3.js} +2 -2
  55. package/dist/{chunk-ORAK3LNZ.js → chunk-ER3CCWK2.js} +2 -2
  56. package/dist/{chunk-SD34EK4Z.js → chunk-FEELYTRT.js} +5 -5
  57. package/dist/{chunk-KQAFEZQX.js → chunk-FLVL4L3L.js} +2 -2
  58. package/dist/{chunk-WIWPSQYU.js → chunk-FXRFFYWD.js} +4 -4
  59. package/dist/{chunk-W3M34XT4.js → chunk-GECEETQ3.js} +4 -4
  60. package/dist/{chunk-WWSXVOGY.js → chunk-GFGYHLON.js} +2 -2
  61. package/dist/{chunk-BJMBJZ2Y.js → chunk-GWTFLF2P.js} +59 -59
  62. package/dist/chunk-GWTFLF2P.js.map +1 -0
  63. package/dist/{chunk-WOX2UW4K.js → chunk-IBPEVGP5.js} +2 -2
  64. package/dist/{chunk-JZ7P26GF.js → chunk-IQWFWSCP.js} +4 -4
  65. package/dist/{chunk-6SXNQFHB.js → chunk-J2JB6BHT.js} +8 -8
  66. package/dist/{chunk-K2JM4DZZ.js → chunk-JHZ3LEM7.js} +2 -2
  67. package/dist/{chunk-YGGXUNS4.js → chunk-JNKSFIAY.js} +45 -45
  68. package/dist/{chunk-CGZWGVQF.js → chunk-K5CWCJKJ.js} +6 -6
  69. package/dist/{chunk-TPLE6SNY.js → chunk-KFNG72W7.js} +7 -7
  70. package/dist/{chunk-4NWIGAIC.js → chunk-KT2VQLP7.js} +8 -8
  71. package/dist/{chunk-6FNZ3NMS.js → chunk-L3VSTJ2V.js} +2 -2
  72. package/dist/{chunk-ARV3AUOM.js → chunk-M5QKGHCR.js} +2 -2
  73. package/dist/{chunk-E4PFDD3N.js → chunk-MEPWWSTD.js} +4 -4
  74. package/dist/{chunk-V5RVMULT.js → chunk-MLDAD27I.js} +7 -7
  75. package/dist/{chunk-K2R3DEEH.js → chunk-MTN2G4DT.js} +2 -2
  76. package/dist/{chunk-DBSMLRTO.js → chunk-MW7UUXTA.js} +5 -5
  77. package/dist/{chunk-OSMBC3JU.js → chunk-OKOF7ITI.js} +6 -6
  78. package/dist/{chunk-DBRVU5PR.js → chunk-OVMLS7TN.js} +3 -3
  79. package/dist/{chunk-NNL4LJAD.js → chunk-QMMCMV2L.js} +5 -5
  80. package/dist/{chunk-RNWWAS5V.js → chunk-QRM3K3XT.js} +5 -5
  81. package/dist/{chunk-HM6UJPPO.js → chunk-R7TGDLV3.js} +4 -4
  82. package/dist/{chunk-EEKDRAWX.js → chunk-RBYV3WSB.js} +4 -4
  83. package/dist/{chunk-LOPZ2DWR.js → chunk-RRRZ3CLN.js} +4 -4
  84. package/dist/{chunk-7TWA7DKP.js → chunk-S5UYWK3O.js} +6 -6
  85. package/dist/{chunk-QOGXUNWL.js → chunk-SC5AEZLU.js} +9 -9
  86. package/dist/{chunk-SNEXVX3U.js → chunk-UFNQKZV7.js} +15 -15
  87. package/dist/{chunk-W3BFT5OJ.js → chunk-V4ZPLQLC.js} +2 -2
  88. package/dist/{chunk-SQNED75R.js → chunk-V5UV7BOA.js} +1 -1
  89. package/dist/{chunk-CKLCFBA3.js → chunk-VQL22SHO.js} +921 -1472
  90. package/dist/chunk-VQL22SHO.js.map +1 -0
  91. package/dist/{chunk-UETBEHBA.js → chunk-VX2RYM2K.js} +2232 -1942
  92. package/dist/chunk-VX2RYM2K.js.map +1 -0
  93. package/dist/{chunk-K5LLP4CY.js → chunk-XKAOT4ZB.js} +4 -4
  94. package/dist/{chunk-ZBVQ4ZM4.js → chunk-YGNQG4Q6.js} +8 -8
  95. package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
  96. package/dist/{chunk-HYI2GP3F.js → chunk-ZGGI3COG.js} +9 -9
  97. package/dist/{cli-lmf5RGyQ.d.ts → cli-DFUU9WYu.d.ts} +3 -3
  98. package/dist/cli.d.ts +6 -6
  99. package/dist/cli.js +60 -60
  100. package/dist/compounding/engine.d.ts +1 -1
  101. package/dist/compounding/engine.js +6 -6
  102. package/dist/compounding/preference-consolidator.d.ts +1 -1
  103. package/dist/compression-optimizer.d.ts +1 -1
  104. package/dist/config.d.ts +1 -1
  105. package/dist/config.js +1 -1
  106. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  107. package/dist/connectors/codex-materialize-runner.js +5 -5
  108. package/dist/connectors/codex-materialize.d.ts +1 -1
  109. package/dist/connectors/index.d.ts +1 -1
  110. package/dist/connectors/index.js +7 -7
  111. package/dist/consolidation-provenance-check.d.ts +1 -1
  112. package/dist/consolidation-undo.d.ts +1 -1
  113. package/dist/contradiction/index.d.ts +1 -1
  114. package/dist/contradiction/index.js +2 -2
  115. package/dist/{contradiction-scan-3FJYWS3G.js → contradiction-scan-KO4WWCS4.js} +3 -3
  116. package/dist/contradiction-scan-KO4WWCS4.js.map +1 -0
  117. package/dist/conversation-index/backend.d.ts +1 -1
  118. package/dist/conversation-index/chunker.d.ts +1 -1
  119. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  120. package/dist/conversation-index/indexer.d.ts +1 -1
  121. package/dist/conversation-index/search.d.ts +1 -1
  122. package/dist/dashboard-runtime.js +2 -2
  123. package/dist/day-summary.d.ts +1 -1
  124. package/dist/day-summary.js +2 -2
  125. package/dist/delinearize.d.ts +1 -1
  126. package/dist/direct-answer-wiring.d.ts +1 -1
  127. package/dist/direct-answer.d.ts +1 -1
  128. package/dist/embedding-fallback.d.ts +1 -1
  129. package/dist/embedding-fallback.js +2 -2
  130. package/dist/enrichment/index.d.ts +1 -1
  131. package/dist/entity-retrieval.d.ts +1 -1
  132. package/dist/entity-retrieval.js +5 -5
  133. package/dist/entity-schema.d.ts +1 -1
  134. package/dist/explicit-capture.d.ts +4 -4
  135. package/dist/explicit-capture.js +2 -2
  136. package/dist/extraction-faithfulness.d.ts +1 -1
  137. package/dist/extraction-judge-telemetry.d.ts +1 -1
  138. package/dist/extraction-judge-training.d.ts +1 -1
  139. package/dist/extraction-judge.d.ts +1 -1
  140. package/dist/extraction.d.ts +1 -1
  141. package/dist/extraction.js +4 -4
  142. package/dist/fallback-llm.d.ts +1 -1
  143. package/dist/graph-dashboard-diff.d.ts +1 -1
  144. package/dist/graph-dashboard-key.d.ts +1 -1
  145. package/dist/graph-dashboard-parser.d.ts +1 -1
  146. package/dist/graph-edge-reinforcement.d.ts +1 -1
  147. package/dist/graph-snapshot.d.ts +1 -1
  148. package/dist/graph.d.ts +1 -1
  149. package/dist/identity-continuity.d.ts +1 -1
  150. package/dist/importance.d.ts +1 -1
  151. package/dist/index.d.ts +9 -9
  152. package/dist/index.js +142 -142
  153. package/dist/intent.d.ts +1 -1
  154. package/dist/lcm/engine.d.ts +1 -1
  155. package/dist/lcm/engine.js +3 -3
  156. package/dist/lcm/index.d.ts +1 -1
  157. package/dist/lcm/index.js +8 -8
  158. package/dist/lcm/tools.d.ts +1 -1
  159. package/dist/lifecycle.d.ts +1 -1
  160. package/dist/live-connectors-runner.d.ts +1 -1
  161. package/dist/local-llm.d.ts +1 -1
  162. package/dist/local-llm.js +2 -2
  163. package/dist/local-model-endpoint.d.ts +1 -1
  164. package/dist/maintenance/memory-governance.d.ts +1 -1
  165. package/dist/maintenance/memory-governance.js +4 -4
  166. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -4
  167. package/dist/maintenance/rebuild-memory-projection.js +5 -5
  168. package/dist/mcp-memory-inspector-app.d.ts +5 -5
  169. package/dist/memory-action-policy.d.ts +1 -1
  170. package/dist/memory-cache.d.ts +1 -1
  171. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  172. package/dist/memory-projection-store.d.ts +1 -1
  173. package/dist/memory-provenance.d.ts +1 -1
  174. package/dist/memory-worth-outcomes.d.ts +1 -1
  175. package/dist/models-json.d.ts +1 -1
  176. package/dist/namespaces/migrate.d.ts +2 -2
  177. package/dist/namespaces/migrate.js +10 -10
  178. package/dist/namespaces/principal.d.ts +1 -1
  179. package/dist/namespaces/search.d.ts +1 -1
  180. package/dist/namespaces/search.js +4 -4
  181. package/dist/namespaces/storage.d.ts +2 -2
  182. package/dist/namespaces/storage.js +6 -6
  183. package/dist/native-knowledge.d.ts +1 -1
  184. package/dist/operator-toolkit.d.ts +1 -1
  185. package/dist/operator-toolkit.js +17 -17
  186. package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
  187. package/dist/orchestration/compression-guideline-coordinator.js +2 -2
  188. package/dist/orchestration/maintenance.d.ts +2 -2
  189. package/dist/orchestration/maintenance.js +10 -10
  190. package/dist/{orchestrator-D7bb8ZGp.d.ts → orchestrator-BhxMxtQJ.d.ts} +27 -106
  191. package/dist/orchestrator.d.ts +4 -4
  192. package/dist/orchestrator.js +86 -86
  193. package/dist/patterns-cli.d.ts +1 -1
  194. package/dist/policy-runtime.d.ts +1 -1
  195. package/dist/provenance.d.ts +1 -1
  196. package/dist/qmd-recall-cache.d.ts +1 -1
  197. package/dist/qmd.d.ts +1 -1
  198. package/dist/recall-disclosure-escalation.d.ts +1 -1
  199. package/dist/recall-explain-renderer.d.ts +1 -1
  200. package/dist/recall-planner-llm.d.ts +1 -1
  201. package/dist/recall-state.d.ts +1 -1
  202. package/dist/recall-tag-filter.d.ts +1 -1
  203. package/dist/recall-xray-cli.d.ts +1 -1
  204. package/dist/recall-xray-renderer.d.ts +1 -1
  205. package/dist/recall-xray.d.ts +1 -1
  206. package/dist/resolve-auth-token.d.ts +1 -1
  207. package/dist/resume-bundles.js +1 -1
  208. package/dist/retrieval-agents.d.ts +1 -1
  209. package/dist/retrieval-tiers.d.ts +1 -1
  210. package/dist/routing/engine.d.ts +1 -1
  211. package/dist/routing/store.d.ts +1 -1
  212. package/dist/routing/store.js +2 -2
  213. package/dist/search/embed-helper.d.ts +1 -1
  214. package/dist/search/embed-helper.js +2 -2
  215. package/dist/search/factory.d.ts +1 -1
  216. package/dist/search/factory.js +3 -3
  217. package/dist/search/index.d.ts +1 -1
  218. package/dist/search/index.js +3 -3
  219. package/dist/search/lancedb-backend.d.ts +1 -1
  220. package/dist/search/meilisearch-backend.d.ts +1 -1
  221. package/dist/search/noop-backend.d.ts +1 -1
  222. package/dist/search/orama-backend.d.ts +1 -1
  223. package/dist/search/port.d.ts +1 -1
  224. package/dist/search/remote-backend.d.ts +1 -1
  225. package/dist/secure-store/index.js +2 -2
  226. package/dist/{semantic-consolidation-CTfbVwCA.d.ts → semantic-consolidation-BrsoFeMP.d.ts} +1 -1
  227. package/dist/semantic-consolidation.d.ts +2 -2
  228. package/dist/semantic-consolidation.js +7 -7
  229. package/dist/semantic-rule-promotion.js +4 -4
  230. package/dist/semantic-rule-verifier.d.ts +1 -1
  231. package/dist/semantic-rule-verifier.js +4 -4
  232. package/dist/session-observer-bands.d.ts +1 -1
  233. package/dist/session-observer-state.d.ts +1 -1
  234. package/dist/shared-context/manager.d.ts +1 -1
  235. package/dist/shared-context/manager.js +2 -2
  236. package/dist/signal.d.ts +1 -1
  237. package/dist/storage.d.ts +1 -1
  238. package/dist/storage.js +3 -3
  239. package/dist/summarizer.d.ts +1 -1
  240. package/dist/summarizer.js +3 -3
  241. package/dist/summary-snapshot.d.ts +1 -1
  242. package/dist/temporal-supersession.d.ts +1 -1
  243. package/dist/temporal-validity.d.ts +1 -1
  244. package/dist/threading.d.ts +1 -1
  245. package/dist/tier-migration.d.ts +1 -1
  246. package/dist/tier-routing.d.ts +1 -1
  247. package/dist/topics.d.ts +1 -1
  248. package/dist/transcript.d.ts +1 -1
  249. package/dist/transfer/backup.js +3 -3
  250. package/dist/transfer/capsule-export.js +3 -3
  251. package/dist/transfer/capsule-import.js +3 -3
  252. package/dist/trust-score-stage.d.ts +1 -1
  253. package/dist/trust-score.d.ts +1 -1
  254. package/dist/{types-D4NYDtXI.d.ts → types-BfI4uJeb.d.ts} +1 -1
  255. package/dist/types.d.ts +1 -1
  256. package/dist/utility-runtime.d.ts +1 -1
  257. package/dist/verified-recall.js +4 -4
  258. package/package.json +2 -2
  259. package/src/access-recall-surface.ts +1552 -0
  260. package/src/access-service.ts +29 -1219
  261. package/src/orchestration/recall-entry.ts +290 -0
  262. package/src/orchestration/self-deps.ts +50 -0
  263. package/src/orchestration/session-context.ts +407 -0
  264. package/src/orchestrator.ts +150 -725
  265. package/dist/chunk-BJMBJZ2Y.js.map +0 -1
  266. package/dist/chunk-CKLCFBA3.js.map +0 -1
  267. package/dist/chunk-UETBEHBA.js.map +0 -1
  268. /package/dist/{capsule-crypto-7FJQINUR.js.map → access-recall-surface.js.map} +0 -0
  269. /package/dist/{contradiction-scan-3FJYWS3G.js.map → capsule-crypto-CZJSLEFG.js.map} +0 -0
  270. /package/dist/{chunk-2NLLXCJG.js.map → chunk-2BFLDH5F.js.map} +0 -0
  271. /package/dist/{chunk-UU32EAIY.js.map → chunk-2DPCAW2T.js.map} +0 -0
  272. /package/dist/{chunk-5PZCDUJ6.js.map → chunk-2U4E34Y3.js.map} +0 -0
  273. /package/dist/{chunk-JRZV3767.js.map → chunk-33NX5BLR.js.map} +0 -0
  274. /package/dist/{chunk-X7Y7WX73.js.map → chunk-437S3G37.js.map} +0 -0
  275. /package/dist/{chunk-HAZVVOYT.js.map → chunk-5DXUE7GB.js.map} +0 -0
  276. /package/dist/{chunk-4DLFJJOQ.js.map → chunk-5JAT4ZJD.js.map} +0 -0
  277. /package/dist/{chunk-RS25QOKZ.js.map → chunk-64SE4X5G.js.map} +0 -0
  278. /package/dist/{chunk-QRRBXD24.js.map → chunk-67JRXV6Z.js.map} +0 -0
  279. /package/dist/{chunk-WA7FECSG.js.map → chunk-6ROCH5JV.js.map} +0 -0
  280. /package/dist/{chunk-5QANTTY2.js.map → chunk-BIAMJUUJ.js.map} +0 -0
  281. /package/dist/{chunk-IKHKHADN.js.map → chunk-C4LNKQ3M.js.map} +0 -0
  282. /package/dist/{chunk-B35L45HZ.js.map → chunk-DC5OBZS3.js.map} +0 -0
  283. /package/dist/{chunk-ORAK3LNZ.js.map → chunk-ER3CCWK2.js.map} +0 -0
  284. /package/dist/{chunk-SD34EK4Z.js.map → chunk-FEELYTRT.js.map} +0 -0
  285. /package/dist/{chunk-KQAFEZQX.js.map → chunk-FLVL4L3L.js.map} +0 -0
  286. /package/dist/{chunk-WIWPSQYU.js.map → chunk-FXRFFYWD.js.map} +0 -0
  287. /package/dist/{chunk-W3M34XT4.js.map → chunk-GECEETQ3.js.map} +0 -0
  288. /package/dist/{chunk-WWSXVOGY.js.map → chunk-GFGYHLON.js.map} +0 -0
  289. /package/dist/{chunk-WOX2UW4K.js.map → chunk-IBPEVGP5.js.map} +0 -0
  290. /package/dist/{chunk-JZ7P26GF.js.map → chunk-IQWFWSCP.js.map} +0 -0
  291. /package/dist/{chunk-6SXNQFHB.js.map → chunk-J2JB6BHT.js.map} +0 -0
  292. /package/dist/{chunk-K2JM4DZZ.js.map → chunk-JHZ3LEM7.js.map} +0 -0
  293. /package/dist/{chunk-YGGXUNS4.js.map → chunk-JNKSFIAY.js.map} +0 -0
  294. /package/dist/{chunk-CGZWGVQF.js.map → chunk-K5CWCJKJ.js.map} +0 -0
  295. /package/dist/{chunk-TPLE6SNY.js.map → chunk-KFNG72W7.js.map} +0 -0
  296. /package/dist/{chunk-4NWIGAIC.js.map → chunk-KT2VQLP7.js.map} +0 -0
  297. /package/dist/{chunk-6FNZ3NMS.js.map → chunk-L3VSTJ2V.js.map} +0 -0
  298. /package/dist/{chunk-ARV3AUOM.js.map → chunk-M5QKGHCR.js.map} +0 -0
  299. /package/dist/{chunk-E4PFDD3N.js.map → chunk-MEPWWSTD.js.map} +0 -0
  300. /package/dist/{chunk-V5RVMULT.js.map → chunk-MLDAD27I.js.map} +0 -0
  301. /package/dist/{chunk-K2R3DEEH.js.map → chunk-MTN2G4DT.js.map} +0 -0
  302. /package/dist/{chunk-DBSMLRTO.js.map → chunk-MW7UUXTA.js.map} +0 -0
  303. /package/dist/{chunk-OSMBC3JU.js.map → chunk-OKOF7ITI.js.map} +0 -0
  304. /package/dist/{chunk-DBRVU5PR.js.map → chunk-OVMLS7TN.js.map} +0 -0
  305. /package/dist/{chunk-NNL4LJAD.js.map → chunk-QMMCMV2L.js.map} +0 -0
  306. /package/dist/{chunk-RNWWAS5V.js.map → chunk-QRM3K3XT.js.map} +0 -0
  307. /package/dist/{chunk-HM6UJPPO.js.map → chunk-R7TGDLV3.js.map} +0 -0
  308. /package/dist/{chunk-EEKDRAWX.js.map → chunk-RBYV3WSB.js.map} +0 -0
  309. /package/dist/{chunk-LOPZ2DWR.js.map → chunk-RRRZ3CLN.js.map} +0 -0
  310. /package/dist/{chunk-7TWA7DKP.js.map → chunk-S5UYWK3O.js.map} +0 -0
  311. /package/dist/{chunk-QOGXUNWL.js.map → chunk-SC5AEZLU.js.map} +0 -0
  312. /package/dist/{chunk-SNEXVX3U.js.map → chunk-UFNQKZV7.js.map} +0 -0
  313. /package/dist/{chunk-W3BFT5OJ.js.map → chunk-V4ZPLQLC.js.map} +0 -0
  314. /package/dist/{chunk-SQNED75R.js.map → chunk-V5UV7BOA.js.map} +0 -0
  315. /package/dist/{chunk-K5LLP4CY.js.map → chunk-XKAOT4ZB.js.map} +0 -0
  316. /package/dist/{chunk-ZBVQ4ZM4.js.map → chunk-YGNQG4Q6.js.map} +0 -0
  317. /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
  318. /package/dist/{chunk-HYI2GP3F.js.map → chunk-ZGGI3COG.js.map} +0 -0
@@ -0,0 +1,290 @@
1
+ /**
2
+ * Recall-entry coordinator — extracted from the orchestrator
3
+ * (issue #1526, seam 28).
4
+ *
5
+ * Owns the public recall() entry surface: the init gate + timeout
6
+ * fallback around recallInternal, recall failure logging/suppression,
7
+ * recall result publication, and eval shadow-recall queueing.
8
+ *
9
+ * Behavior-preserving move (late-binding selfDeps wiring, seams 18–27).
10
+ */
11
+
12
+ import { type CapabilitySet, type GraphConstructionCapabilitySet, type MemoryLifecycleCapabilitySet, resolveCapabilities, resolveEvalCapabilities, resolveGraphConstructionCapabilities, resolveNamespaceCapabilities, resolveRecallAuxiliaryCapabilities } from "../capabilities.js";
13
+ import { type EvalShadowRecallRecord, recordEvalShadowRecall } from "../evals.js";
14
+ import { StorageManager } from "../index.js";
15
+ import { log } from "../logger.js";
16
+ import { resolvePrincipal } from "../namespaces/principal.js";
17
+ import { type RecallInvocationOptions, abortRecallError } from "./orchestrator-helpers.js";
18
+ import { ProfilingCollector } from "../profiling.js";
19
+ import type { TrustStageResultItem } from "../trust-score-stage.js";
20
+ import type { IdentityInjectionMode, PluginConfig, QmdSearchResult } from "../types.js";
21
+
22
+ export interface RecallEntryDeps {
23
+ appendRecallSection(
24
+ sectionBuckets: Map<string, string[]>,
25
+ sectionId: string,
26
+ content: string,
27
+ ): boolean;
28
+ readonly config: PluginConfig;
29
+ enqueueDirectAnswerObservation(
30
+ prompt: string,
31
+ sessionKey: string,
32
+ namespaceOverride: string | undefined,
33
+ principalOverride: string | undefined,
34
+ caps: CapabilitySet,
35
+ namespacesEnabled: boolean,
36
+ ): void;
37
+ evalShadowWriteChain: Promise<void>;
38
+ extractMemoryIdsFromResults(results: QmdSearchResult[]): string[];
39
+ formatQmdResults(
40
+ title: string,
41
+ results: QmdSearchResult[],
42
+ sessionKey?: string,
43
+ trustByPath?: Map<string, TrustStageResultItem> | null,
44
+ ): string;
45
+ readonly initPromise: Promise<void> | null;
46
+ lastRecallFailureAtMs: number;
47
+ lastRecallFailureLogAtMs: number;
48
+ logRecallFailure(err: unknown): void;
49
+ readonly profiler: ProfilingCollector;
50
+ recallInternal(
51
+ prompt: string,
52
+ sessionKey?: string,
53
+ options?: RecallInvocationOptions,
54
+ caps?: CapabilitySet,
55
+ graphCaps?: GraphConstructionCapabilitySet,
56
+ lifecycleCaps?: MemoryLifecycleCapabilitySet,
57
+ ): Promise<string>;
58
+ readonly storage: StorageManager;
59
+ suppressedRecallFailures: number;
60
+ trackMemoryAccess(memoryIds: string[]): void;
61
+ }
62
+
63
+ export class RecallEntryCoordinator {
64
+ constructor(
65
+ private readonly deps: RecallEntryDeps,
66
+ ) {}
67
+
68
+ async recall(
69
+ prompt: string,
70
+ sessionKey?: string,
71
+ options: RecallInvocationOptions = {},
72
+ ): Promise<string> {
73
+ // Resolve the recall-operation capability gates ONCE, at the operation
74
+ // entry, and thread the frozen set down (issue #1523). Never re-read the
75
+ // migrated flags off `this.deps.config` mid-operation.
76
+ const caps = resolveCapabilities(this.deps.config);
77
+ const graphCaps = resolveGraphConstructionCapabilities(this.deps.config); // #1566 Cluster A
78
+ const abortController = new AbortController();
79
+ const onAbort = () => {
80
+ abortController.abort();
81
+ };
82
+ if (options.abortSignal?.aborted) {
83
+ abortController.abort();
84
+ } else {
85
+ options.abortSignal?.addEventListener("abort", onAbort, { once: true });
86
+ }
87
+
88
+ const principal =
89
+ typeof options.principalOverride === "string" &&
90
+ options.principalOverride.length > 0
91
+ ? options.principalOverride
92
+ : resolvePrincipal(sessionKey, this.deps.config);
93
+ const namespacesEnabled = resolveNamespaceCapabilities(this.deps.config).namespaces;
94
+ if (namespacesEnabled && !principal) {
95
+ throw new Error("authentication required: namespaces are enabled and no principal was supplied");
96
+ }
97
+
98
+ // Wait for initialization to complete before attempting recall. The timeout
99
+ // is configurable so OpenClaw's per-hook budget and Remnic's internal init
100
+ // gate can stay aligned during cold starts.
101
+ let initGateTimeoutHandle: NodeJS.Timeout | null = null;
102
+ let onInitGateAbort: (() => void) | null = null;
103
+ if (this.deps.initPromise) {
104
+ const gateResult = await Promise.race([
105
+ this.deps.initPromise.then(() => "ok" as const),
106
+ new Promise<"timeout">((resolve) => {
107
+ initGateTimeoutHandle = setTimeout(
108
+ () => resolve("timeout"),
109
+ this.deps.config.initGateTimeoutMs,
110
+ );
111
+ }),
112
+ abortController.signal.aborted
113
+ ? Promise.resolve("aborted" as const)
114
+ : new Promise<"aborted">((resolve) => {
115
+ onInitGateAbort = () => resolve("aborted");
116
+ abortController.signal.addEventListener(
117
+ "abort",
118
+ onInitGateAbort,
119
+ { once: true },
120
+ );
121
+ }),
122
+ ]);
123
+ if (initGateTimeoutHandle) clearTimeout(initGateTimeoutHandle);
124
+ if (onInitGateAbort)
125
+ abortController.signal.removeEventListener("abort", onInitGateAbort);
126
+ if (gateResult === "aborted") {
127
+ this.deps.logRecallFailure(abortRecallError("recall aborted before init"));
128
+ return "";
129
+ }
130
+ if (gateResult === "timeout") {
131
+ log.warn("recall: init gate timed out — proceeding without full init");
132
+ }
133
+ }
134
+
135
+ // Secure-store lock gate (issue #690 PR 3/4).
136
+ // If secure-store is enabled but the keyring holds no key for this
137
+ // memory directory, reject recall with a clear human-readable error
138
+ // rather than surfacing a cryptic SecureStoreLockedError from deep
139
+ // inside the storage layer.
140
+ if (resolveRecallAuxiliaryCapabilities(this.deps.config).secureStore && !this.deps.storage.isSecureStoreUnlocked()) {
141
+ const lockedMsg =
142
+ "[secure-store locked] Memory store is encrypted and locked. " +
143
+ "Unlock the secure-store inside this daemon process, or restart the daemon through a secure-store aware launcher that installs the key.";
144
+ log.warn("recall blocked: secure-store is locked");
145
+ return lockedMsg;
146
+ }
147
+
148
+ // Keep outer recall timeout above worst-case serialized hybrid search:
149
+ // QMD subprocess BM25 (30s) + vector (30s) can consume ~60s under contention.
150
+ try {
151
+ const recallPromise = this.deps.recallInternal(prompt, sessionKey, {
152
+ ...options,
153
+ abortSignal: abortController.signal,
154
+ }, caps, graphCaps);
155
+ const RECALL_TIMEOUT_MS = this.deps.config.recallOuterTimeoutMs ?? 75_000;
156
+ if (RECALL_TIMEOUT_MS <= 0) {
157
+ return await recallPromise;
158
+ }
159
+
160
+ let timeoutHandle: NodeJS.Timeout | null = null;
161
+ const timeoutPromise = new Promise<string>((_, reject) => {
162
+ timeoutHandle = setTimeout(() => {
163
+ abortController.abort();
164
+ reject(new Error("recall timeout"));
165
+ }, RECALL_TIMEOUT_MS);
166
+ });
167
+
168
+ let recallResult: string;
169
+ try {
170
+ recallResult = await Promise.race([recallPromise, timeoutPromise]);
171
+ } finally {
172
+ if (timeoutHandle) clearTimeout(timeoutHandle);
173
+ }
174
+
175
+ // Observation-mode direct-answer tier (issue #518 slice 3c).
176
+ // Runs after the user's recall already succeeded, fire-and-forget,
177
+ // so annotation latency can never delay the caller's response.
178
+ if (caps.recallDirectAnswer && sessionKey) {
179
+ try {
180
+ this.deps.enqueueDirectAnswerObservation(
181
+ prompt,
182
+ sessionKey,
183
+ options.namespace?.trim() || undefined,
184
+ options.principalOverride,
185
+ caps,
186
+ namespacesEnabled,
187
+ );
188
+ } catch (err) {
189
+ log.debug(`direct-answer observation setup failed: ${err}`);
190
+ }
191
+ }
192
+
193
+ return recallResult;
194
+ } catch (err) {
195
+ this.deps.logRecallFailure(err);
196
+ // endTrace() is safe here: if no trace is active (disabled or already
197
+ // closed by recallInternal's try/finally), it returns null immediately.
198
+ this.deps.profiler.endTrace();
199
+ return ""; // Return empty context on timeout/error
200
+ } finally {
201
+ options.abortSignal?.removeEventListener("abort", onAbort);
202
+ }
203
+ }
204
+
205
+ logRecallFailure(err: unknown): void {
206
+ const now = Date.now();
207
+ const errorMsg = err instanceof Error ? err.message : String(err);
208
+ const LOG_WINDOW_MS = 60_000;
209
+ const idleSinceLastFailureMs = now - this.deps.lastRecallFailureAtMs;
210
+ this.deps.lastRecallFailureAtMs = now;
211
+ if (idleSinceLastFailureMs >= LOG_WINDOW_MS) {
212
+ this.deps.suppressedRecallFailures = 0;
213
+ }
214
+
215
+ if (now - this.deps.lastRecallFailureLogAtMs >= LOG_WINDOW_MS) {
216
+ const suffix =
217
+ this.deps.suppressedRecallFailures > 0
218
+ ? ` (suppressed ${this.deps.suppressedRecallFailures} similar failures in last minute)`
219
+ : "";
220
+ log.warn(`recall timed out or failed: ${errorMsg}${suffix}`);
221
+ this.deps.lastRecallFailureLogAtMs = now;
222
+ this.deps.suppressedRecallFailures = 0;
223
+ return;
224
+ }
225
+
226
+ this.deps.suppressedRecallFailures += 1;
227
+ log.debug(`recall timed out or failed (suppressed): ${errorMsg}`);
228
+ }
229
+
230
+ queueEvalShadowRecall(
231
+ record: Omit<EvalShadowRecallRecord, "schemaVersion">,
232
+ ): void {
233
+ if (!resolveEvalCapabilities(this.deps.config).evalHarness || !resolveEvalCapabilities(this.deps.config).evalShadowMode)
234
+ return;
235
+ this.deps.evalShadowWriteChain = this.deps.evalShadowWriteChain
236
+ .catch(() => undefined)
237
+ .then(async () => {
238
+ try {
239
+ await recordEvalShadowRecall({
240
+ memoryDir: this.deps.config.memoryDir,
241
+ evalStoreDir: this.deps.config.evalStoreDir,
242
+ record: {
243
+ schemaVersion: 1,
244
+ ...record,
245
+ },
246
+ });
247
+ } catch (err) {
248
+ log.debug(`eval shadow recall write failed: ${err}`);
249
+ }
250
+ });
251
+ }
252
+
253
+ publishRecallResults(options: {
254
+ title: string;
255
+ results: QmdSearchResult[];
256
+ sectionBuckets: Map<string, string[]>;
257
+ retrievalQuery: string;
258
+ sessionKey: string | undefined;
259
+ identityInjection?: {
260
+ mode: IdentityInjectionMode | "none";
261
+ injectedChars: number;
262
+ truncated: boolean;
263
+ };
264
+ /**
265
+ * Issue #1577 — per-recall trust map. When present, quarantined items
266
+ * are filtered from injection on EVERY recall path (hot QMD, embedding
267
+ * fallback, cold archive, recent) so a faithfulness-contradicted memory
268
+ * cannot sneak in via a branch that bypasses trust scoring (review:
269
+ * fallback paths bypass trust). The map is also threaded to
270
+ * formatQmdResults for the epistemic hedge.
271
+ */
272
+ trustByPath?: Map<string, TrustStageResultItem> | null;
273
+ }): void {
274
+ const sectionId = "memories";
275
+ // Filter quarantined items from ALL recall paths so no branch can inject
276
+ // a hard-negative memory that trust scoring excluded on another path.
277
+ const trustByPath = options.trustByPath ?? null;
278
+ const injectable = trustByPath
279
+ ? options.results.filter((r) => !trustByPath.get(r.path)?.quarantined)
280
+ : options.results;
281
+ const memoryIds = this.deps.extractMemoryIdsFromResults(injectable);
282
+ this.deps.trackMemoryAccess(memoryIds);
283
+
284
+ this.deps.appendRecallSection(
285
+ options.sectionBuckets,
286
+ sectionId,
287
+ this.deps.formatQmdResults(options.title, injectable, options.sessionKey, trustByPath),
288
+ );
289
+ }
290
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Live self-deps factory (issue #1526 seam 27).
3
+ *
4
+ * Every coordinator extracted from the orchestrator (seams 4–26) takes a
5
+ * deps bundle whose property names MATCH the orchestrator's own member
6
+ * names, wired as live accessors / late-binding arrows so instance-level
7
+ * test stubs and subclass overrides keep taking effect. Those hand-written
8
+ * wiring blocks were ~100 lines each and pure repetition. This factory
9
+ * replaces them with a Proxy that preserves the exact semantics:
10
+ *
11
+ * - property GET reads `self[prop]` live on every access (late binding —
12
+ * an instance stub installed after coordinator creation is observed);
13
+ * - method properties are bound to `self` at access time, so `this`
14
+ * inside the orchestrator method stays the orchestrator;
15
+ * - property SET writes through to `self` (gate fields like
16
+ * `deferredReady` / `lastXraySnapshot` stay on the orchestrator);
17
+ * - getters on `self` (e.g. `fastLlmForRerank`) are invoked live.
18
+ *
19
+ * The `as unknown as T` cast is deliberate: the deps interfaces reference
20
+ * the orchestrator's PRIVATE members, which TypeScript cannot verify
21
+ * structurally from outside the class. The interfaces remain fully
22
+ * enforced on the coordinator side. Per-access `bind` costs nanoseconds
23
+ * and allocates one closure per property access — negligible against the
24
+ * I/O-bound work every coordinator method performs.
25
+ */
26
+ export function selfDeps<T extends object>(self: object): T {
27
+ const source = self as Record<PropertyKey, unknown>;
28
+ return new Proxy(Object.create(null) as object, {
29
+ get(_target, prop) {
30
+ const value = source[prop as string];
31
+ return typeof value === "function"
32
+ ? (value as (...args: unknown[]) => unknown).bind(self)
33
+ : value;
34
+ },
35
+ set(_target, prop, value) {
36
+ // Fail fast on writes to properties the orchestrator does not
37
+ // declare (Kilo review on PR #1801): returning false makes the
38
+ // assignment throw a TypeError in strict mode, matching the
39
+ // error-safety of the hand-written accessor blocks this factory
40
+ // replaced. Legitimate gate-field writes (deferredReady,
41
+ // lastXraySnapshot, …) all target existing members.
42
+ if (!((prop as string) in source)) return false;
43
+ source[prop as string] = value;
44
+ return true;
45
+ },
46
+ has(_target, prop) {
47
+ return (prop as string) in source;
48
+ },
49
+ }) as unknown as T;
50
+ }