@remnic/core 10.0.141 → 10.0.143

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 (275) hide show
  1. package/dist/abstraction-nodes.js +4 -4
  2. package/dist/access-admin-ops-surface.js +107 -106
  3. package/dist/access-cli.js +107 -106
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-extraction-force-flush-preempt.js +107 -106
  6. package/dist/access-extraction-force-flush.js +107 -106
  7. package/dist/access-http-briefing.js +107 -106
  8. package/dist/access-http-query.js +107 -106
  9. package/dist/access-http.js +107 -106
  10. package/dist/access-identity-continuity-surface.js +107 -106
  11. package/dist/access-lcm-surface.js +107 -106
  12. package/dist/access-mcp.d.ts.map +1 -1
  13. package/dist/access-mcp.js +107 -106
  14. package/dist/access-observe-write-category.js +2 -2
  15. package/dist/access-observe-write-surface.js +107 -106
  16. package/dist/access-operations-batch.js +107 -106
  17. package/dist/access-operations.js +107 -106
  18. package/dist/access-recall-concurrency.js +107 -106
  19. package/dist/access-recall-mcp-search-options.d.ts +42 -0
  20. package/dist/access-recall-mcp-search-options.d.ts.map +1 -0
  21. package/dist/access-recall-mcp-search-options.js +8 -0
  22. package/dist/access-recall-response.js +107 -106
  23. package/dist/access-recall-surface.d.ts.map +1 -1
  24. package/dist/access-recall-surface.js +107 -106
  25. package/dist/access-schema.d.ts +36 -0
  26. package/dist/access-schema.d.ts.map +1 -1
  27. package/dist/access-schema.js +3 -1
  28. package/dist/access-service.js +107 -106
  29. package/dist/active-recall.js +22 -22
  30. package/dist/adapters/index.js +4 -4
  31. package/dist/adapters/registry.js +2 -2
  32. package/dist/briefing.js +23 -23
  33. package/dist/buffer.js +7 -7
  34. package/dist/{capsule-merge-ILR35DIB.js → capsule-merge-PCSDJOAO.js} +5 -5
  35. package/dist/causal-consolidation.js +23 -23
  36. package/dist/{chunk-6WV76JHC.js → chunk-22M7NYJK.js} +2 -2
  37. package/dist/{chunk-F476AJQJ.js → chunk-2642VLWP.js} +2 -2
  38. package/dist/{chunk-UF5RTFN3.js → chunk-2DXDHGLG.js} +5 -5
  39. package/dist/{chunk-LPDOCXHH.js → chunk-2M7F2I7I.js} +2 -2
  40. package/dist/{chunk-PFUXPTBT.js → chunk-4LF5E2LM.js} +5 -5
  41. package/dist/{chunk-KUQLUYIR.js → chunk-4QEDFEBY.js} +3 -3
  42. package/dist/{chunk-C64XATK7.js → chunk-4U5VHHVF.js} +39 -3
  43. package/dist/chunk-4U5VHHVF.js.map +1 -0
  44. package/dist/{chunk-WGM2KSWN.js → chunk-5XONJ5C4.js} +2 -2
  45. package/dist/{chunk-3RJU7QFE.js → chunk-72QMGTDF.js} +2 -2
  46. package/dist/{chunk-XOOYE37V.js → chunk-7SUAHTGH.js} +2 -2
  47. package/dist/{chunk-3PZDG5ZH.js → chunk-A7SU5ET7.js} +2 -2
  48. package/dist/{chunk-VH4UCI3R.js → chunk-AHUTHRTL.js} +3 -3
  49. package/dist/{chunk-O3JG4PD3.js → chunk-AW56K4SI.js} +2 -2
  50. package/dist/{chunk-G2CGIFRP.js → chunk-AXR472RS.js} +2 -2
  51. package/dist/{chunk-CFSCKCT5.js → chunk-B4I37XX6.js} +4 -4
  52. package/dist/{chunk-NWA6IXR3.js → chunk-B7HYXVME.js} +27 -1
  53. package/dist/chunk-B7HYXVME.js.map +1 -0
  54. package/dist/{chunk-JCBKGPFE.js → chunk-BFFKIME2.js} +3 -3
  55. package/dist/{chunk-GNIMBEOK.js → chunk-C7CP7OEG.js} +11 -11
  56. package/dist/{chunk-NM6UL4W5.js → chunk-CPWZGM4E.js} +9 -9
  57. package/dist/{chunk-BDIXKROL.js → chunk-CPYVH6LI.js} +8 -8
  58. package/dist/chunk-CQ3IG3GZ.js +30 -0
  59. package/dist/chunk-CQ3IG3GZ.js.map +1 -0
  60. package/dist/{chunk-H6VQ7L5D.js → chunk-CSZCLTIV.js} +5 -5
  61. package/dist/{chunk-UM22PKA3.js → chunk-DVC2OYLF.js} +2 -2
  62. package/dist/{chunk-4IMMF5W6.js → chunk-F3PTUQIK.js} +3 -3
  63. package/dist/{chunk-D6IGZYTN.js → chunk-FJEYZSJD.js} +3 -3
  64. package/dist/{chunk-ITAUMNQU.js → chunk-FPII4O7C.js} +2 -2
  65. package/dist/{chunk-FL3O34XF.js → chunk-FYJYQ65N.js} +3 -3
  66. package/dist/{chunk-HRMOKGQM.js → chunk-GCQIXPWZ.js} +4 -4
  67. package/dist/{chunk-UX7KPVAM.js → chunk-GOT6G3C6.js} +2 -2
  68. package/dist/{chunk-FONPAA43.js → chunk-HQJAQENN.js} +2 -2
  69. package/dist/{chunk-DGLNT6VO.js → chunk-HQV5GCMD.js} +3 -3
  70. package/dist/{chunk-USVA4XWY.js → chunk-IIVDGKMW.js} +3 -3
  71. package/dist/{chunk-K5CM4M65.js → chunk-ITT4SVVA.js} +7 -7
  72. package/dist/{chunk-2HI22OK7.js → chunk-JKYAKDBP.js} +2 -2
  73. package/dist/{chunk-MGN2RQRG.js → chunk-KAGLV5KH.js} +2 -2
  74. package/dist/{chunk-VRBGYSSQ.js → chunk-KETT3EZO.js} +2 -2
  75. package/dist/chunk-KETT3EZO.js.map +1 -0
  76. package/dist/{chunk-2NJ74RQU.js → chunk-LE27GU4M.js} +2 -2
  77. package/dist/{chunk-7NSGKXFD.js → chunk-LYPBQHAX.js} +4 -4
  78. package/dist/{chunk-EGDUG2ZX.js → chunk-MBBRU5LJ.js} +2 -2
  79. package/dist/{chunk-IUXTKLZY.js → chunk-MSVBNOFX.js} +22 -22
  80. package/dist/{chunk-DOJBV6WR.js → chunk-MX5VGD6C.js} +5 -5
  81. package/dist/{chunk-GAVFANAB.js → chunk-NFNH4ZPB.js} +2 -2
  82. package/dist/{chunk-NCS2NXSP.js → chunk-NIG54XKA.js} +3 -3
  83. package/dist/{chunk-EIZUL6JC.js → chunk-NKO4VZRO.js} +3 -3
  84. package/dist/{chunk-QZUT4VTV.js → chunk-O5OFHBAP.js} +2 -2
  85. package/dist/{chunk-SZ6QV3DY.js → chunk-OM2YWPFX.js} +2 -2
  86. package/dist/{chunk-7YD5XSJK.js → chunk-OOJMQV3L.js} +5 -5
  87. package/dist/{chunk-FJTRNFI4.js → chunk-P3COXHWB.js} +2 -2
  88. package/dist/{chunk-ZG4GNPRE.js → chunk-PBE7NFB5.js} +5 -5
  89. package/dist/{chunk-SZK2DX5U.js → chunk-PCMGMPQZ.js} +2 -2
  90. package/dist/{chunk-WIV37T4U.js → chunk-QBNZLS3U.js} +5 -5
  91. package/dist/{chunk-DLZGSZVC.js → chunk-RJ5L6LRD.js} +5 -5
  92. package/dist/{chunk-342VFB56.js → chunk-RVPISCKY.js} +3 -3
  93. package/dist/{chunk-BYWNF25B.js → chunk-SFHEIWIE.js} +2 -2
  94. package/dist/{chunk-YXFY4YOF.js → chunk-TD72RHHZ.js} +3 -3
  95. package/dist/{chunk-FREKFMCA.js → chunk-TJE4LIVD.js} +2 -2
  96. package/dist/{chunk-M5GVCJSJ.js → chunk-TVWLYSX4.js} +2 -2
  97. package/dist/{chunk-O3GZPLVY.js → chunk-UUSL22HE.js} +2 -2
  98. package/dist/{chunk-63JPXUFA.js → chunk-VKTZXJSR.js} +2 -2
  99. package/dist/{chunk-27N6SGEY.js → chunk-VNMJWFYR.js} +2 -2
  100. package/dist/{chunk-AA6G3W3B.js → chunk-W236BAJR.js} +2 -2
  101. package/dist/{chunk-GCHM5BYL.js → chunk-WWQMZBDI.js} +4 -4
  102. package/dist/{chunk-OVZIYLBZ.js → chunk-YCK26VSL.js} +2 -2
  103. package/dist/{chunk-3GHQCNNG.js → chunk-YJUZ465J.js} +5 -5
  104. package/dist/{chunk-DIBOWE53.js → chunk-YXPUQBHK.js} +17 -2
  105. package/dist/chunk-YXPUQBHK.js.map +1 -0
  106. package/dist/{chunk-QHDBKC5Z.js → chunk-ZFJOPBQD.js} +2 -2
  107. package/dist/{chunk-JLD44JR7.js → chunk-ZNYOY2MM.js} +354 -330
  108. package/dist/chunk-ZNYOY2MM.js.map +1 -0
  109. package/dist/cli.js +107 -106
  110. package/dist/coding/export-okf-codegraph.js +22 -22
  111. package/dist/compounding/engine.js +23 -23
  112. package/dist/config.js +22 -22
  113. package/dist/connectors/codex-materialize-runner.js +22 -22
  114. package/dist/connectors/index.js +22 -22
  115. package/dist/consolidation-provenance-check.js +5 -5
  116. package/dist/consolidation-undo.js +4 -4
  117. package/dist/contradiction/index.js +3 -3
  118. package/dist/convergence-refresh.js +24 -24
  119. package/dist/corpus-watermark.js +24 -24
  120. package/dist/cue-anchors.js +5 -5
  121. package/dist/deep-recall-http-glue.js +2 -2
  122. package/dist/{entity-canonical-id-migration-IG77BOGD.js → entity-canonical-id-migration-ZOWR44RK.js} +4 -4
  123. package/dist/entity-retrieval.js +23 -23
  124. package/dist/explicit-capture.js +107 -106
  125. package/dist/extraction.js +26 -26
  126. package/dist/harmonic-construction.js +6 -6
  127. package/dist/harmonic-graph-version.js +3 -3
  128. package/dist/harmonic-retrieval.js +25 -25
  129. package/dist/index.js +165 -162
  130. package/dist/lcm/engine.js +2 -2
  131. package/dist/lcm/index.js +5 -5
  132. package/dist/location/index.js +23 -23
  133. package/dist/maintenance/memory-governance.js +22 -22
  134. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +22 -22
  135. package/dist/maintenance/rebuild-memory-projection-runner.js +24 -24
  136. package/dist/maintenance/rebuild-memory-projection.js +23 -23
  137. package/dist/memory-browse.js +6 -6
  138. package/dist/memory-cache.d.ts +5 -0
  139. package/dist/memory-cache.d.ts.map +1 -1
  140. package/dist/memory-cache.js +9 -1
  141. package/dist/memory-corpus-version.js +2 -2
  142. package/dist/namespaces/migrate.js +23 -23
  143. package/dist/namespaces/search.js +11 -11
  144. package/dist/namespaces/storage.js +22 -22
  145. package/dist/operator-doctor-corpus.js +25 -25
  146. package/dist/operator-toolkit.js +30 -30
  147. package/dist/orchestration/backlog-scheduler.js +108 -107
  148. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  149. package/dist/orchestration/buffer-drain-runner.js +108 -107
  150. package/dist/orchestration/maintenance.js +30 -30
  151. package/dist/orchestration/orchestrator-helpers.d.ts +3 -15
  152. package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -1
  153. package/dist/orchestration/recall-internal-deps.d.ts +2 -1
  154. package/dist/orchestration/recall-internal-deps.d.ts.map +1 -1
  155. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  156. package/dist/orchestration/recall-search-pipeline.d.ts +3 -10
  157. package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -1
  158. package/dist/orchestrator.d.ts +2 -2
  159. package/dist/orchestrator.d.ts.map +1 -1
  160. package/dist/orchestrator.js +107 -106
  161. package/dist/page-versioning.js +4 -4
  162. package/dist/qmd.js +3 -3
  163. package/dist/recall-composition-decision.js +2 -2
  164. package/dist/recall-navigation.js +107 -106
  165. package/dist/recall-state-view-admission.js +6 -6
  166. package/dist/recall-why-service.js +6 -6
  167. package/dist/{resolution-7XBNQVKU.js → resolution-A3NAI3YE.js} +4 -4
  168. package/dist/resolution-A3NAI3YE.js.map +1 -0
  169. package/dist/resume-bundles.js +23 -23
  170. package/dist/search/factory.js +10 -10
  171. package/dist/search/index.js +14 -14
  172. package/dist/search/lancedb-backend.js +3 -3
  173. package/dist/search/meilisearch-backend.js +3 -3
  174. package/dist/search/orama-backend.js +3 -3
  175. package/dist/search/port.d.ts +2 -0
  176. package/dist/search/port.d.ts.map +1 -1
  177. package/dist/search/port.js +3 -1
  178. package/dist/search/remote-backend.js +2 -2
  179. package/dist/semantic-consolidation.js +23 -23
  180. package/dist/semantic-rule-promotion.js +22 -22
  181. package/dist/semantic-rule-verifier.js +22 -22
  182. package/dist/source-agent-qualifier.js +25 -25
  183. package/dist/standup/build.js +22 -22
  184. package/dist/storage.js +21 -21
  185. package/dist/transfer/capsule-import.js +5 -5
  186. package/dist/transfer/export-okf.js +23 -23
  187. package/dist/verified-recall.js +22 -22
  188. package/dist/who-knows-cli.js +23 -23
  189. package/dist/who-knows.js +22 -22
  190. package/package.json +2 -2
  191. package/src/access-mcp.test.ts +25 -0
  192. package/src/access-mcp.ts +2 -0
  193. package/src/access-recall-mcp-search-options.ts +26 -0
  194. package/src/access-recall-surface.ts +2 -3
  195. package/src/access-schema.ts +24 -0
  196. package/src/memory-cache.test.ts +27 -0
  197. package/src/memory-cache.ts +45 -2
  198. package/src/orchestration/orchestrator-helpers.ts +4 -16
  199. package/src/orchestration/recall-internal-deps.ts +2 -0
  200. package/src/orchestration/recall-internal.ts +9 -8
  201. package/src/orchestration/recall-search-pipeline.test.ts +65 -0
  202. package/src/orchestration/recall-search-pipeline.ts +17 -20
  203. package/src/orchestrator.ts +17 -54
  204. package/src/recall-navigation-surface.test.ts +3 -3
  205. package/src/recall-search-options.test.ts +64 -0
  206. package/src/search/port.ts +35 -0
  207. package/dist/chunk-C64XATK7.js.map +0 -1
  208. package/dist/chunk-DIBOWE53.js.map +0 -1
  209. package/dist/chunk-JLD44JR7.js.map +0 -1
  210. package/dist/chunk-NWA6IXR3.js.map +0 -1
  211. package/dist/chunk-VRBGYSSQ.js.map +0 -1
  212. /package/dist/{entity-canonical-id-migration-IG77BOGD.js.map → access-recall-mcp-search-options.js.map} +0 -0
  213. /package/dist/{capsule-merge-ILR35DIB.js.map → capsule-merge-PCSDJOAO.js.map} +0 -0
  214. /package/dist/{chunk-6WV76JHC.js.map → chunk-22M7NYJK.js.map} +0 -0
  215. /package/dist/{chunk-F476AJQJ.js.map → chunk-2642VLWP.js.map} +0 -0
  216. /package/dist/{chunk-UF5RTFN3.js.map → chunk-2DXDHGLG.js.map} +0 -0
  217. /package/dist/{chunk-LPDOCXHH.js.map → chunk-2M7F2I7I.js.map} +0 -0
  218. /package/dist/{chunk-PFUXPTBT.js.map → chunk-4LF5E2LM.js.map} +0 -0
  219. /package/dist/{chunk-KUQLUYIR.js.map → chunk-4QEDFEBY.js.map} +0 -0
  220. /package/dist/{chunk-WGM2KSWN.js.map → chunk-5XONJ5C4.js.map} +0 -0
  221. /package/dist/{chunk-3RJU7QFE.js.map → chunk-72QMGTDF.js.map} +0 -0
  222. /package/dist/{chunk-XOOYE37V.js.map → chunk-7SUAHTGH.js.map} +0 -0
  223. /package/dist/{chunk-3PZDG5ZH.js.map → chunk-A7SU5ET7.js.map} +0 -0
  224. /package/dist/{chunk-VH4UCI3R.js.map → chunk-AHUTHRTL.js.map} +0 -0
  225. /package/dist/{chunk-O3JG4PD3.js.map → chunk-AW56K4SI.js.map} +0 -0
  226. /package/dist/{chunk-G2CGIFRP.js.map → chunk-AXR472RS.js.map} +0 -0
  227. /package/dist/{chunk-CFSCKCT5.js.map → chunk-B4I37XX6.js.map} +0 -0
  228. /package/dist/{chunk-JCBKGPFE.js.map → chunk-BFFKIME2.js.map} +0 -0
  229. /package/dist/{chunk-GNIMBEOK.js.map → chunk-C7CP7OEG.js.map} +0 -0
  230. /package/dist/{chunk-NM6UL4W5.js.map → chunk-CPWZGM4E.js.map} +0 -0
  231. /package/dist/{chunk-BDIXKROL.js.map → chunk-CPYVH6LI.js.map} +0 -0
  232. /package/dist/{chunk-H6VQ7L5D.js.map → chunk-CSZCLTIV.js.map} +0 -0
  233. /package/dist/{chunk-UM22PKA3.js.map → chunk-DVC2OYLF.js.map} +0 -0
  234. /package/dist/{chunk-4IMMF5W6.js.map → chunk-F3PTUQIK.js.map} +0 -0
  235. /package/dist/{chunk-D6IGZYTN.js.map → chunk-FJEYZSJD.js.map} +0 -0
  236. /package/dist/{chunk-ITAUMNQU.js.map → chunk-FPII4O7C.js.map} +0 -0
  237. /package/dist/{chunk-FL3O34XF.js.map → chunk-FYJYQ65N.js.map} +0 -0
  238. /package/dist/{chunk-HRMOKGQM.js.map → chunk-GCQIXPWZ.js.map} +0 -0
  239. /package/dist/{chunk-UX7KPVAM.js.map → chunk-GOT6G3C6.js.map} +0 -0
  240. /package/dist/{chunk-FONPAA43.js.map → chunk-HQJAQENN.js.map} +0 -0
  241. /package/dist/{chunk-DGLNT6VO.js.map → chunk-HQV5GCMD.js.map} +0 -0
  242. /package/dist/{chunk-USVA4XWY.js.map → chunk-IIVDGKMW.js.map} +0 -0
  243. /package/dist/{chunk-K5CM4M65.js.map → chunk-ITT4SVVA.js.map} +0 -0
  244. /package/dist/{chunk-2HI22OK7.js.map → chunk-JKYAKDBP.js.map} +0 -0
  245. /package/dist/{chunk-MGN2RQRG.js.map → chunk-KAGLV5KH.js.map} +0 -0
  246. /package/dist/{chunk-2NJ74RQU.js.map → chunk-LE27GU4M.js.map} +0 -0
  247. /package/dist/{chunk-7NSGKXFD.js.map → chunk-LYPBQHAX.js.map} +0 -0
  248. /package/dist/{chunk-EGDUG2ZX.js.map → chunk-MBBRU5LJ.js.map} +0 -0
  249. /package/dist/{chunk-IUXTKLZY.js.map → chunk-MSVBNOFX.js.map} +0 -0
  250. /package/dist/{chunk-DOJBV6WR.js.map → chunk-MX5VGD6C.js.map} +0 -0
  251. /package/dist/{chunk-GAVFANAB.js.map → chunk-NFNH4ZPB.js.map} +0 -0
  252. /package/dist/{chunk-NCS2NXSP.js.map → chunk-NIG54XKA.js.map} +0 -0
  253. /package/dist/{chunk-EIZUL6JC.js.map → chunk-NKO4VZRO.js.map} +0 -0
  254. /package/dist/{chunk-QZUT4VTV.js.map → chunk-O5OFHBAP.js.map} +0 -0
  255. /package/dist/{chunk-SZ6QV3DY.js.map → chunk-OM2YWPFX.js.map} +0 -0
  256. /package/dist/{chunk-7YD5XSJK.js.map → chunk-OOJMQV3L.js.map} +0 -0
  257. /package/dist/{chunk-FJTRNFI4.js.map → chunk-P3COXHWB.js.map} +0 -0
  258. /package/dist/{chunk-ZG4GNPRE.js.map → chunk-PBE7NFB5.js.map} +0 -0
  259. /package/dist/{chunk-SZK2DX5U.js.map → chunk-PCMGMPQZ.js.map} +0 -0
  260. /package/dist/{chunk-WIV37T4U.js.map → chunk-QBNZLS3U.js.map} +0 -0
  261. /package/dist/{chunk-DLZGSZVC.js.map → chunk-RJ5L6LRD.js.map} +0 -0
  262. /package/dist/{chunk-342VFB56.js.map → chunk-RVPISCKY.js.map} +0 -0
  263. /package/dist/{chunk-BYWNF25B.js.map → chunk-SFHEIWIE.js.map} +0 -0
  264. /package/dist/{chunk-YXFY4YOF.js.map → chunk-TD72RHHZ.js.map} +0 -0
  265. /package/dist/{chunk-FREKFMCA.js.map → chunk-TJE4LIVD.js.map} +0 -0
  266. /package/dist/{chunk-M5GVCJSJ.js.map → chunk-TVWLYSX4.js.map} +0 -0
  267. /package/dist/{chunk-O3GZPLVY.js.map → chunk-UUSL22HE.js.map} +0 -0
  268. /package/dist/{chunk-63JPXUFA.js.map → chunk-VKTZXJSR.js.map} +0 -0
  269. /package/dist/{chunk-27N6SGEY.js.map → chunk-VNMJWFYR.js.map} +0 -0
  270. /package/dist/{chunk-AA6G3W3B.js.map → chunk-W236BAJR.js.map} +0 -0
  271. /package/dist/{chunk-GCHM5BYL.js.map → chunk-WWQMZBDI.js.map} +0 -0
  272. /package/dist/{chunk-OVZIYLBZ.js.map → chunk-YCK26VSL.js.map} +0 -0
  273. /package/dist/{chunk-3GHQCNNG.js.map → chunk-YJUZ465J.js.map} +0 -0
  274. /package/dist/{chunk-QHDBKC5Z.js.map → chunk-ZFJOPBQD.js.map} +0 -0
  275. /package/dist/{resolution-7XBNQVKU.js.map → entity-canonical-id-migration-ZOWR44RK.js.map} +0 -0
package/dist/who-knows.js CHANGED
@@ -9,23 +9,23 @@ import {
9
9
  loadWhoKnowsEntities,
10
10
  tokenizeTopic,
11
11
  validateWhoKnowsInput
12
- } from "./chunk-FJTRNFI4.js";
13
- import "./chunk-IUXTKLZY.js";
12
+ } from "./chunk-P3COXHWB.js";
13
+ import "./chunk-MSVBNOFX.js";
14
14
  import "./chunk-QGVCFVX6.js";
15
15
  import "./chunk-UHVXE24Y.js";
16
- import "./chunk-O3JG4PD3.js";
16
+ import "./chunk-AW56K4SI.js";
17
17
  import "./chunk-G6OFEGUR.js";
18
18
  import "./chunk-YCNSMVWG.js";
19
- import "./chunk-USVA4XWY.js";
20
- import "./chunk-GNIMBEOK.js";
21
- import "./chunk-DOJBV6WR.js";
22
- import "./chunk-PFUXPTBT.js";
23
- import "./chunk-CYEPCZN5.js";
24
- import "./chunk-DLZGSZVC.js";
25
- import "./chunk-OVZIYLBZ.js";
26
- import "./chunk-WNEVEMJ3.js";
19
+ import "./chunk-IIVDGKMW.js";
20
+ import "./chunk-C7CP7OEG.js";
21
+ import "./chunk-YCK26VSL.js";
27
22
  import "./chunk-EXYT52NR.js";
23
+ import "./chunk-MX5VGD6C.js";
24
+ import "./chunk-4LF5E2LM.js";
25
+ import "./chunk-CYEPCZN5.js";
26
+ import "./chunk-RJ5L6LRD.js";
28
27
  import "./chunk-Y5NLBXPV.js";
28
+ import "./chunk-WNEVEMJ3.js";
29
29
  import "./chunk-TFA6HPOA.js";
30
30
  import "./chunk-F4TWWUMP.js";
31
31
  import "./chunk-72A4L5JJ.js";
@@ -33,32 +33,32 @@ import "./chunk-A7Q43EUZ.js";
33
33
  import "./chunk-S2V7RUCL.js";
34
34
  import "./chunk-PPUNC7UX.js";
35
35
  import "./chunk-X3724WL4.js";
36
- import "./chunk-L76BQSWB.js";
37
36
  import "./chunk-MRPOZBJC.js";
37
+ import "./chunk-L76BQSWB.js";
38
38
  import "./chunk-DM2T26WE.js";
39
39
  import "./chunk-LDXUBPMO.js";
40
40
  import "./chunk-FF6N7BXC.js";
41
41
  import "./chunk-JNDMIAJ4.js";
42
42
  import "./chunk-AAD2ZS6P.js";
43
+ import "./chunk-3OUGSOJP.js";
44
+ import "./chunk-SCU65EZI.js";
43
45
  import "./chunk-3ONXXHQO.js";
44
46
  import "./chunk-ZIKENA2C.js";
45
47
  import "./chunk-YXZG5TVN.js";
46
- import "./chunk-3OUGSOJP.js";
47
- import "./chunk-SCU65EZI.js";
48
48
  import "./chunk-P4GUQSK3.js";
49
49
  import "./chunk-4LZ7SVKM.js";
50
50
  import "./chunk-YHTG64XV.js";
51
51
  import "./chunk-3WU7XOFN.js";
52
52
  import "./chunk-G7D6GZ5J.js";
53
- import "./chunk-KUQLUYIR.js";
54
- import "./chunk-O3GZPLVY.js";
53
+ import "./chunk-4QEDFEBY.js";
54
+ import "./chunk-UUSL22HE.js";
55
55
  import "./chunk-5WITETWU.js";
56
56
  import "./chunk-6CIAGZ6X.js";
57
57
  import "./chunk-7VLBZKNB.js";
58
58
  import "./chunk-Y33KJ556.js";
59
- import "./chunk-VH4UCI3R.js";
59
+ import "./chunk-AHUTHRTL.js";
60
60
  import "./chunk-IUM3VSHI.js";
61
- import "./chunk-NWA6IXR3.js";
61
+ import "./chunk-B7HYXVME.js";
62
62
  import "./chunk-EZ47HOJ6.js";
63
63
  import "./chunk-AF2XMJKD.js";
64
64
  import "./chunk-OR42ZI54.js";
@@ -70,12 +70,12 @@ import "./chunk-L2EXJQJP.js";
70
70
  import "./chunk-45GF7Y3V.js";
71
71
  import "./chunk-QSF5SJAM.js";
72
72
  import "./chunk-E2AWJ7KQ.js";
73
+ import "./chunk-HADD45AR.js";
74
+ import "./chunk-RNFMFC37.js";
73
75
  import "./chunk-YCVB7X56.js";
74
76
  import "./chunk-PQVCH2AE.js";
75
77
  import "./chunk-PJKTFXE2.js";
76
78
  import "./chunk-W5BIQOAJ.js";
77
- import "./chunk-HADD45AR.js";
78
- import "./chunk-RNFMFC37.js";
79
79
  import "./chunk-X26YOFGS.js";
80
80
  import "./chunk-BT7NVCML.js";
81
81
  import "./chunk-TOSPNM4T.js";
@@ -106,10 +106,10 @@ import "./chunk-C5LWPYS3.js";
106
106
  import "./chunk-X4OZMANG.js";
107
107
  import "./chunk-ZEFVK7XC.js";
108
108
  import "./chunk-R2MBW2S4.js";
109
- import "./chunk-M5GVCJSJ.js";
109
+ import "./chunk-TVWLYSX4.js";
110
110
  import "./chunk-RBOJCG4T.js";
111
111
  import "./chunk-7CT3AI52.js";
112
- import "./chunk-C64XATK7.js";
112
+ import "./chunk-4U5VHHVF.js";
113
113
  import "./chunk-42JKGUFJ.js";
114
114
  import "./chunk-QUIRIG2P.js";
115
115
  import "./chunk-6KH5NLQS.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "10.0.141",
3
+ "version": "10.0.143",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3396,7 +3396,7 @@
3396
3396
  "core"
3397
3397
  ],
3398
3398
  "peerDependencies": {
3399
- "@remnic/coding-graph": "^10.0.141"
3399
+ "@remnic/coding-graph": "^10.0.143"
3400
3400
  },
3401
3401
  "peerDependenciesMeta": {
3402
3402
  "@remnic/coding-graph": {
@@ -1156,6 +1156,19 @@ function listToolNames(response: unknown): string[] {
1156
1156
 
1157
1157
  const TOOLS_LIST_REQUEST = { jsonrpc: "2.0", id: 1, method: "tools/list", params: {} };
1158
1158
 
1159
+ interface ToolsListSchemaProperties {
1160
+ searchOptions?: { properties?: { structuredSearches?: unknown } };
1161
+ }
1162
+
1163
+ interface ToolsListToolRow {
1164
+ name: string;
1165
+ inputSchema?: { properties?: ToolsListSchemaProperties };
1166
+ }
1167
+
1168
+ interface ToolsListEnvelope {
1169
+ result?: { tools?: ToolsListToolRow[] };
1170
+ }
1171
+
1159
1172
  test("tools/list advertises remnic_* and engram.* by default (back-compat)", async () => {
1160
1173
  const server = new EngramMcpServer(makeMockService());
1161
1174
  const names = listToolNames(await server.handleRequest(TOOLS_LIST_REQUEST));
@@ -1165,6 +1178,18 @@ test("tools/list advertises remnic_* and engram.* by default (back-compat)", asy
1165
1178
  assert.ok(legacyCount > 0, "legacy aliases advertised by default");
1166
1179
  });
1167
1180
 
1181
+ test("tools/list engram.recall searchOptions declares structuredSearches (HTTP parity)", async () => {
1182
+ const server = new EngramMcpServer(makeMockService());
1183
+ const res = await server.handleRequest(TOOLS_LIST_REQUEST);
1184
+ // SAFETY: tools/list JSON shape is owned by EngramMcpServer; test only reads engram.recall schema keys.
1185
+ const tools = (res as ToolsListEnvelope).result?.tools ?? [];
1186
+ const recall = tools.find((t) => t.name === "engram.recall");
1187
+ assert.ok(
1188
+ recall?.inputSchema?.properties?.searchOptions?.properties?.structuredSearches !== undefined,
1189
+ "MCP searchOptions must declare structuredSearches",
1190
+ );
1191
+ });
1192
+
1168
1193
  test("tools/list omits engram.* aliases when emitLegacyTools is false", async () => {
1169
1194
  const server = new EngramMcpServer(makeMockService(), { emitLegacyTools: false });
1170
1195
  const names = listToolNames(await server.handleRequest(TOOLS_LIST_REQUEST));
package/src/access-mcp.ts CHANGED
@@ -33,6 +33,7 @@ import { EngramAccessInputError, type EngramAccessRecallResponse, type EngramAcc
33
33
  import { EngramAccessForbiddenError, unknownToolError } from "./access-errors.js";
34
34
  import { log } from "./logger.js";
35
35
  import { McpFrameReader, type McpFrameForm } from "./access-mcp-frames.js";
36
+ import { engramRecallSearchOptionsMcpProperty } from "./access-recall-mcp-search-options.js";
36
37
  import "./access-operations.js";
37
38
  import { validateBriefingFormat } from "./briefing.js";
38
39
  import { processChatMessage } from "./chat/chat-factory.js";
@@ -636,6 +637,7 @@ export class EngramMcpServer {
636
637
  description:
637
638
  "Opt in to state-aware recall views (issue #1952); ORs with the recallStateViews config flag.",
638
639
  },
640
+ searchOptions: engramRecallSearchOptionsMcpProperty,
639
641
  },
640
642
  required: ["query"],
641
643
  additionalProperties: false,
@@ -0,0 +1,26 @@
1
+ /** MCP `engram.recall` inputSchema fragment for `searchOptions` (HTTP parity). */
2
+ export const engramRecallSearchOptionsMcpProperty = {
3
+ type: "object",
4
+ description:
5
+ "Per-recall QMD query options. Only rerank: false is honored on the wire (--no-rerank); rerank: true is a no-op when daemon rerank is on.",
6
+ properties: {
7
+ intent: { type: "string" },
8
+ explain: { type: "boolean" },
9
+ candidateLimit: { type: "number" },
10
+ rerank: { type: "boolean" },
11
+ chunkStrategy: { type: "string", enum: ["auto", "regex"] },
12
+ structuredSearches: {
13
+ type: "array",
14
+ items: {
15
+ type: "object",
16
+ properties: {
17
+ type: { type: "string", enum: ["lex", "vec", "hyde"] },
18
+ query: { type: "string" },
19
+ },
20
+ required: ["type", "query"],
21
+ additionalProperties: false,
22
+ },
23
+ },
24
+ },
25
+ additionalProperties: false,
26
+ } as const;
@@ -861,13 +861,12 @@ export class AccessRecallSurface {
861
861
  ...(asOf !== undefined ? { asOf } : {}),
862
862
  ...(request.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
863
863
  ...(request.abortSignal ? { abortSignal: request.abortSignal } : {}),
864
- // Only surface a real wait: an uncontended recall (queueWaitMs 0) omits
865
- // the field so recall-timings stays additive and byte-identical to the
866
- // pre-#1906 uncontended path (acceptance: "record queueWaitMs ~0 or omit").
864
+ // Omit queueWaitMs when 0 (#1906 uncontended path unchanged).
867
865
  ...(typeof request.queueWaitMs === "number" && request.queueWaitMs > 0
868
866
  ? { queueWaitMs: request.queueWaitMs }
869
867
  : {}),
870
868
  };
869
+ if (request.searchOptions) recallOptions.searchOptions = request.searchOptions;
871
870
  const startedAt = Date.now();
872
871
  // #1906 atomic budget admission: the peek loop above and this record are
873
872
  // one synchronous JS turn (no await between them), so record()'s own
@@ -108,6 +108,28 @@ export const recallDisclosureSchema = z.enum(["chunk", "section", "raw"]);
108
108
  */
109
109
  export const tagMatchSchema = z.enum(["any", "all"]);
110
110
 
111
+ /**
112
+ * Per-recall QMD `query` tool options (issue #3433 plumbing). Matches
113
+ * `SearchQueryOptions` in `search/port.ts`. QMD only honors `rerank: false`
114
+ * on the wire (`--no-rerank` / MCP `rerank: false`); `rerank: true` is a no-op
115
+ * when `qmdQueryRerankEnabled` is on.
116
+ */
117
+ const recallStructuredSearchSchema = z.object({
118
+ type: z.enum(["lex", "vec", "hyde"]),
119
+ query: z.string().trim().min(1),
120
+ });
121
+
122
+ export const recallQmdSearchOptionsSchema = z
123
+ .object({
124
+ intent: z.string().trim().max(512).optional(),
125
+ explain: z.boolean().optional(),
126
+ candidateLimit: z.number().int().min(1).max(200).optional(),
127
+ rerank: z.boolean().optional(),
128
+ chunkStrategy: z.enum(["auto", "regex"]).optional(),
129
+ structuredSearches: z.array(recallStructuredSearchSchema).max(10).optional(),
130
+ })
131
+ .strict();
132
+
111
133
  export const recallRequestSchema = z.object({
112
134
  query: z.string().min(1, "query is required"),
113
135
  sessionKey: sessionKeySchema,
@@ -155,6 +177,8 @@ export const recallRequestSchema = z.object({
155
177
  * effect, so this can never perturb ordinary recalls.
156
178
  */
157
179
  stateView: z.boolean().optional(),
180
+ /** QMD search options for this recall only (`query` tool path). */
181
+ searchOptions: recallQmdSearchOptionsSchema.optional(),
158
182
  });
159
183
 
160
184
  export const recallExplainRequestSchema = z.object({
@@ -6,6 +6,8 @@ import {
6
6
  clearMemoryCache,
7
7
  getCachedQmdSearch,
8
8
  invalidateAllForDir,
9
+ peekQmdSearchCacheRecallScopeDepth,
10
+ runInQmdSearchCacheRecallScope,
9
11
  setCachedQmdSearch,
10
12
  } from "./memory-cache.js";
11
13
  import {
@@ -47,3 +49,28 @@ test("ALL_CACHE_LAYERS registers the QMD recall layer alongside the QMD search l
47
49
  assert.ok(names.includes("qmd-search"));
48
50
  assert.ok(names.includes("qmd-recall"));
49
51
  });
52
+
53
+ test("runInQmdSearchCacheRecallScope refcounts nested positive TTL", async () => {
54
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 0);
55
+ await runInQmdSearchCacheRecallScope(60_000, async () => {
56
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 1);
57
+ await runInQmdSearchCacheRecallScope(90_000, async () => {
58
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 2);
59
+ });
60
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 1);
61
+ });
62
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 0);
63
+ });
64
+
65
+ test("non-positive TTL scope does not decrement an outer recall scope", async () => {
66
+ await runInQmdSearchCacheRecallScope(120_000, async () => {
67
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 1);
68
+ await runInQmdSearchCacheRecallScope(0, async () => {
69
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 1);
70
+ });
71
+ await runInQmdSearchCacheRecallScope(Number.NaN, async () => {
72
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 1);
73
+ });
74
+ });
75
+ assert.equal(peekQmdSearchCacheRecallScopeDepth(), 0);
76
+ });
@@ -261,10 +261,52 @@ interface QmdCacheEntry {
261
261
  const QMD_CACHE_TTL_MS = 60_000;
262
262
  const qmdSearchCache = new Map<string, QmdCacheEntry>();
263
263
 
264
+ /** While depth > 0, QMD search cache uses extended TTL (primary + top-up share one recall cycle, R4). */
265
+ let qmdSearchCacheRecallScopeDepth = 0;
266
+ let qmdSearchCacheRecallTtlMs: number | undefined;
267
+
268
+ export function beginQmdSearchCacheRecallScope(ttlMs: number): void {
269
+ if (!Number.isFinite(ttlMs) || ttlMs <= 0) return;
270
+ const next = Math.floor(ttlMs);
271
+ qmdSearchCacheRecallScopeDepth += 1;
272
+ qmdSearchCacheRecallTtlMs = Math.max(qmdSearchCacheRecallTtlMs ?? 0, next);
273
+ }
274
+
275
+ export function endQmdSearchCacheRecallScope(): void {
276
+ if (qmdSearchCacheRecallScopeDepth <= 0) return;
277
+ qmdSearchCacheRecallScopeDepth -= 1;
278
+ if (qmdSearchCacheRecallScopeDepth === 0) {
279
+ qmdSearchCacheRecallTtlMs = undefined;
280
+ }
281
+ }
282
+
283
+ export async function runInQmdSearchCacheRecallScope<T>(
284
+ ttlMs: number,
285
+ run: () => Promise<T>,
286
+ ): Promise<T> {
287
+ const acquired = Number.isFinite(ttlMs) && ttlMs > 0;
288
+ if (acquired) beginQmdSearchCacheRecallScope(ttlMs);
289
+ try {
290
+ return await run();
291
+ } finally {
292
+ if (acquired) endQmdSearchCacheRecallScope();
293
+ }
294
+ }
295
+
296
+ /** Observable refcount for unit tests (R4 scope guard). */
297
+ export function peekQmdSearchCacheRecallScopeDepth(): number {
298
+ return qmdSearchCacheRecallScopeDepth;
299
+ }
300
+
301
+ function effectiveQmdSearchCacheTtlMs(): number {
302
+ return Math.max(QMD_CACHE_TTL_MS, qmdSearchCacheRecallTtlMs ?? 0);
303
+ }
304
+
264
305
  export function getCachedQmdSearch(cacheKey: string): unknown[] | null {
265
306
  const entry = qmdSearchCache.get(cacheKey);
266
307
  if (!entry) return null;
267
- if (Date.now() - entry.cachedAt > QMD_CACHE_TTL_MS) {
308
+ const ttl = effectiveQmdSearchCacheTtlMs();
309
+ if (Date.now() - entry.cachedAt > ttl) {
268
310
  qmdSearchCache.delete(cacheKey);
269
311
  return null;
270
312
  }
@@ -276,8 +318,9 @@ export function setCachedQmdSearch(cacheKey: string, results: unknown[]): void {
276
318
  // Evict old entries to prevent unbounded growth
277
319
  if (qmdSearchCache.size > 200) {
278
320
  const now = Date.now();
321
+ const ttl = effectiveQmdSearchCacheTtlMs();
279
322
  for (const [key, entry] of qmdSearchCache) {
280
- if (now - entry.cachedAt > QMD_CACHE_TTL_MS) qmdSearchCache.delete(key);
323
+ if (now - entry.cachedAt > ttl) qmdSearchCache.delete(key);
281
324
  }
282
325
  }
283
326
  }
@@ -1,18 +1,4 @@
1
- /**
2
- * Orchestrator module-level helpers — relocated from orchestrator.ts
3
- * (issue #1526, seam 25).
4
- *
5
- * Pure functions, types, and constants that previously lived at module
6
- * level in orchestrator.ts: recall-mode planning, recall snapshots and
7
- * parsers, abort/race helpers, artifact recall limits, replay
8
- * source-time slicing, day-summary date utilities, and QMD startup
9
- * checks. orchestrator.ts re-exports the previously-public names so
10
- * every existing importer (coordinators, tests, root shims) keeps
11
- * working unchanged.
12
- *
13
- * Behavior-preserving move — no logic changes.
14
- */
15
-
1
+ /** Orchestrator module-level helpers relocated from orchestrator.ts (#1526); behavior-preserving move. */
16
2
  import { createHash } from "node:crypto";
17
3
  import os from "node:os";
18
4
  import path from "node:path";
@@ -26,7 +12,7 @@ import { log } from "../logger.js";
26
12
  import type { GraphRecallRankedResult, GraphRecallShadowComparison } from "./graph-recall-coordinator.js";
27
13
  import { parseQmdExplain } from "../qmd.js";
28
14
  import type { GraphRecallExpandedEntry } from "../recall-state.js";
29
- import type { SearchDegradation } from "../search/port.js";
15
+ import type { SearchDegradation, SearchQueryOptions } from "../search/port.js";
30
16
  import type { RecallXrayServedBy } from "../recall-xray.js";
31
17
  import type { RecallContextComposition } from "../recall-context-composition.js";
32
18
  import { type BufferTurn, type MemoryActionEvent, type MemoryFile, type MemoryFrontmatter, type MemoryIntent, type PluginConfig, type QmdSearchResult, type RecallPlanMode, confidenceTier } from "../types.js";
@@ -262,6 +248,8 @@ export interface RecallInvocationOptions {
262
248
  * config flag; a change-intent query is still required for any effect.
263
249
  */
264
250
  stateView?: boolean;
251
+ /** Per-call QMD options (HTTP/MCP `searchOptions`). */
252
+ searchOptions?: SearchQueryOptions;
265
253
  /**
266
254
  * User-aware context scopes active for this recall. Used by X-ray
267
255
  * provenance safety checks so boundary-scoped memories are evaluated
@@ -92,6 +92,7 @@ export interface RecallInternalDeps {
92
92
  deadlineAtMs?: number | null;
93
93
  /** Issue #681 — when true, bypass graphTraversalConfidenceFloor. */
94
94
  includeLowConfidence?: boolean;
95
+ searchOptions?: SearchQueryOptions;
95
96
  }): Promise<QmdSearchResult[]>;
96
97
  applyTrustScoreToBranch(
97
98
  results: QmdSearchResult[],
@@ -144,6 +145,7 @@ export interface RecallInternalDeps {
144
145
  buildCompressionGuidelineRecallSection(): Promise<string | null>;
145
146
  buildConfiguredQmdSearchOptions(
146
147
  queryText: string,
148
+ requestOverride?: SearchQueryOptions,
147
149
  ): SearchQueryOptions | undefined;
148
150
  buildGraphRecallRankedResults(
149
151
  results: QmdSearchResult[],
@@ -346,8 +346,7 @@ export class RecallInternalCoordinator {
346
346
  this.deps.profiler.endSpan("planning", profileTraceId);
347
347
  const recallMode: RecallPlanMode = requestedMode ?? recallDecision.effectiveMode;
348
348
  const queryIntent = inferIntentFromText(retrievalQuery);
349
- const qmdSearchOptions =
350
- this.deps.buildConfiguredQmdSearchOptions(retrievalQuery);
349
+ const qmdSearchOptions = this.deps.buildConfiguredQmdSearchOptions(retrievalQuery, options.searchOptions);
351
350
  timings.recallPlan = recallMode;
352
351
  const plannerRecallResultLimit =
353
352
  recallMode === "no_recall"
@@ -4224,11 +4223,10 @@ export class RecallInternalCoordinator {
4224
4223
  deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
4225
4224
  asOfMs,
4226
4225
  requestingConnector: options.sourceConnector,
4226
+ searchOptions: qmdSearchOptions,
4227
4227
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
4228
4228
  });
4229
- // Issue #1577 — read the cold pipeline's trust map back so cold
4230
- // results feed X-ray + epistemic rendering + publisher quarantine
4231
- // filtering (rule 41 parity; review: the sink was never read back).
4229
+ // #1577: read cold trust map back for X-ray/epistemic (rule 41).
4232
4230
  recallTrustByPath = trustByPathSink.trustByPath;
4233
4231
  if (longTerm.length > 0) {
4234
4232
  if (shouldPersistGraphSnapshot) {
@@ -4471,9 +4469,10 @@ export class RecallInternalCoordinator {
4471
4469
  deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
4472
4470
  asOfMs,
4473
4471
  requestingConnector: options.sourceConnector,
4472
+ searchOptions: qmdSearchOptions,
4474
4473
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
4475
4474
  });
4476
- // Issue #1577 — read the cold pipeline's trust map back (rule 41).
4475
+ // #1577: cold trust map back.
4477
4476
  recallTrustByPath = trustByPathSink.trustByPath;
4478
4477
  if (longTerm.length > 0) {
4479
4478
  recallSource = "cold_fallback";
@@ -4651,9 +4650,10 @@ export class RecallInternalCoordinator {
4651
4650
  deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
4652
4651
  asOfMs,
4653
4652
  requestingConnector: options.sourceConnector,
4653
+ searchOptions: qmdSearchOptions,
4654
4654
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
4655
4655
  });
4656
- // Issue #1577 — read the cold pipeline's trust map back (rule 41).
4656
+ // #1577: cold trust map back.
4657
4657
  recallTrustByPath = trustByPathSink.trustByPath;
4658
4658
  if (longTerm.length > 0) {
4659
4659
  if (shouldPersistGraphSnapshot) {
@@ -4710,9 +4710,10 @@ export class RecallInternalCoordinator {
4710
4710
  deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
4711
4711
  asOfMs,
4712
4712
  requestingConnector: options.sourceConnector,
4713
+ searchOptions: qmdSearchOptions,
4713
4714
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
4714
4715
  });
4715
- // Issue #1577 — read the cold pipeline's trust map back (rule 41).
4716
+ // #1577: cold trust map back.
4716
4717
  recallTrustByPath = trustByPathSink.trustByPath;
4717
4718
  if (longTerm.length > 0) {
4718
4719
  if (shouldPersistGraphSnapshot) {
@@ -15,6 +15,24 @@ function result(namespace: string, path: string): QmdSearchResult {
15
15
  return { docid: `${namespace}:${path}`, namespace, path, score: 1, snippet: path };
16
16
  }
17
17
 
18
+ /** Unit stub: only search/hybridSearch are exercised by hybrid top-up tests. */
19
+ function makeHybridTopUpStubCoordinator(
20
+ qmd: Pick<RecallSearchPipelineDeps["qmd"], "search" | "hybridSearch">,
21
+ namespaceFromPath: (p: string) => string,
22
+ ): RecallSearchPipelineCoordinator {
23
+ const partial = {
24
+ config: {
25
+ memoryDir: "/mem",
26
+ qmdSearchStrategy: "hybrid",
27
+ searchBackend: "qmd",
28
+ },
29
+ qmd,
30
+ namespaceFromPath,
31
+ };
32
+ // SAFETY: hybrid top-up tests call fetchQmdMemoryResultsWithArtifactTopUp only; other deps are never read.
33
+ return new RecallSearchPipelineCoordinator(partial as RecallSearchPipelineDeps);
34
+ }
35
+
18
36
  function memory(path: string, status: string): MemoryFile {
19
37
  return {
20
38
  path,
@@ -523,6 +541,53 @@ test("QMD hybrid top-up runs when primary results are archive-only", async () =>
523
541
  assert.deepEqual(out.map((candidate) => candidate.path), ["facts/hybrid-live.md"]);
524
542
  });
525
543
 
544
+ test("QMD skips hybrid top-up when namespace-deliverable page is already full", async () => {
545
+ const inScope = Array.from({ length: 4 }, (_, index) =>
546
+ resultScored("default", `facts/in-scope-${index}.md`, 1 - index * 0.01),
547
+ );
548
+ const outOfScope = Array.from({ length: 4 }, (_, index) =>
549
+ resultScored("other-ns", `facts/other-${index}.md`, 2),
550
+ );
551
+ let hybridCalls = 0;
552
+ const coordinator = makeHybridTopUpStubCoordinator(
553
+ {
554
+ search: async () => [...inScope, ...outOfScope],
555
+ hybridSearch: async () => {
556
+ hybridCalls += 1;
557
+ return [resultScored("default", "facts/hybrid-extra.md", 0.5)];
558
+ },
559
+ },
560
+ (p: string) => (p.includes("other") ? "other-ns" : "default"),
561
+ );
562
+
563
+ const out = await coordinator.fetchQmdMemoryResultsWithArtifactTopUp(
564
+ "namespace-saturated",
565
+ 4,
566
+ 4,
567
+ {
568
+ namespacesEnabled: true,
569
+ recallNamespaces: ["default"],
570
+ resolveNamespace: (p: string) =>
571
+ p.includes("other") ? "other-ns" : "default",
572
+ collection: "openclaw-engram",
573
+ queryAwarePrefilter: {
574
+ candidatePaths: null,
575
+ temporalFromDate: null,
576
+ matchedTags: [],
577
+ expandedTags: [],
578
+ combination: "none",
579
+ filteredToFullSearch: false,
580
+ },
581
+ },
582
+ );
583
+
584
+ assert.equal(hybridCalls, 0, "raw recallable count must not force hybrid when deliverable page is full");
585
+ assert.deepEqual(
586
+ out.map((candidate) => candidate.path),
587
+ inScope.map((r) => r.path),
588
+ );
589
+ });
590
+
526
591
  test("QMD stops after an underfilled archive-only page", async () => {
527
592
  const archived = [resultScored("default", "archive/2026-07-25/only.md", 2)];
528
593
  let searchCalls = 0;
@@ -70,6 +70,7 @@ import {
70
70
  type QueryAwarePrefilter,
71
71
  } from "../orchestrator.js";
72
72
  import { isActivityDigestPath } from "./orchestrator-helpers.js";
73
+ import { runInQmdSearchCacheRecallScope } from "../memory-cache.js";
73
74
  import { isGenericRecallExcludedPath, isTopLevelArchivePath } from "./generic-recall-paths.js";
74
75
  import { isSupportPassportPrivateMemory } from "../support-passport/card-projection.js";
75
76
 
@@ -108,9 +109,7 @@ export interface RecallSearchPipelineDeps {
108
109
  requestingConnector?: string;
109
110
  },
110
111
  ): Promise<QmdSearchResult[]>;
111
- buildConfiguredQmdSearchOptions(
112
- queryText: string,
113
- ): SearchQueryOptions | undefined;
112
+ buildConfiguredQmdSearchOptions(queryText: string, requestOverride?: SearchQueryOptions): SearchQueryOptions | undefined;
114
113
  buildQueryAwarePrefilter(
115
114
  prompt: string,
116
115
  recallNamespaces: string[],
@@ -275,7 +274,6 @@ export class RecallSearchPipelineCoordinator {
275
274
  return buildQueryAwarePrefilterHelper(this.deps, prompt, recallNamespaces);
276
275
  }
277
276
 
278
-
279
277
  async fetchQmdMemoryResultsWithArtifactTopUp(
280
278
  prompt: string,
281
279
  qmdFetchLimit: number,
@@ -319,6 +317,7 @@ export class RecallSearchPipelineCoordinator {
319
317
  const qmdRecallBudgetMs = this.deps.config.recallEnrichmentDeadlineMs ?? 60_000;
320
318
  const qmdRecallBudgetEnabled = qmdRecallBudgetMs > 0;
321
319
  const startedAtMs = Date.now();
320
+ return runInQmdSearchCacheRecallScope(qmdRecallBudgetMs, async () => {
322
321
  let lastPrimaryResultCount = 0;
323
322
  let lastHybridResultCount = 0;
324
323
  let lastHybridTopUpUsed = false;
@@ -432,14 +431,19 @@ export class RecallSearchPipelineCoordinator {
432
431
  lastHybridTopUpUsed = false;
433
432
  lastHybridTopUpSkippedReason = undefined;
434
433
  let mergedResults = primaryResults;
435
- const primaryRecallableCount = primaryResults.filter(recallable).length;
434
+ const primaryDeliverableCount = filterRecallCandidates(primaryResults, {
435
+ namespacesEnabled: options.namespacesEnabled,
436
+ recallNamespaces: options.recallNamespaces,
437
+ resolveNamespace: options.resolveNamespace,
438
+ limit: qmdFetchLimit,
439
+ pathPolicy: this.deps.config,
440
+ }).length;
436
441
  const primaryIncludesArchivePath = primaryResults.some((result) =>
437
442
  isTopLevelArchivePath(result.path, this.deps.config, "qmd"),
438
443
  );
439
-
440
- // Backfill with hybrid results when the recallable primary page underfills.
441
- if (
442
- primaryRecallableCount < qmdFetchLimit &&
444
+ if (primaryDeliverableCount >= qmdFetchLimit) {
445
+ lastHybridTopUpSkippedReason = "primary_deliverable_sufficient";
446
+ } else if (
443
447
  (primaryResults.length < qmdFetchLimit || primaryIncludesArchivePath) &&
444
448
  (!qmdRecallBudgetEnabled ||
445
449
  Date.now() - startedAtMs < qmdRecallBudgetMs)
@@ -540,6 +544,7 @@ export class RecallSearchPipelineCoordinator {
540
544
  const capped = bestFiltered.slice(0, qmdFetchLimit);
541
545
  await emitDebugSnapshot(capped, fetchLimit);
542
546
  return await applyDirectorySidecarDrillDown(this.deps.storage?.dir ?? "", prompt, capped, { enabled: Boolean(this.deps.storage?.dir) && isDirectorySidecarsEnabledForDir(this.deps.storage.dir), namespaces: options.namespacesEnabled ? options.recallNamespaces ?? [] : undefined });
547
+ });
543
548
  }
544
549
 
545
550
  async searchEmbeddingFallback(
@@ -562,7 +567,6 @@ export class RecallSearchPipelineCoordinator {
562
567
  return searchQueryAwareFallbackHelper(this.deps, prompt, limit, queryAwarePrefilter, abortSignal);
563
568
  }
564
569
 
565
-
566
570
  async applyColdFallbackPipeline(options: {
567
571
  prompt: string;
568
572
  recallNamespaces: string[];
@@ -594,19 +598,12 @@ export class RecallSearchPipelineCoordinator {
594
598
  */
595
599
  xrayPoolSizeSink?: { size: number };
596
600
  resultPartitionSink?: RecallResultPartitionSink;
597
- /**
598
- * Issue #1577 — out-parameter that receives the TrustScore stage's
599
- * per-path trust map (admitted + quarantined) when the cold path runs
600
- * trust scoring. Mirrors the xrayPoolSizeSink pattern so recallInternal
601
- can propagate trust data for epistemic rendering and X-ray visibility
602
- without changing the cold pipeline's return type.
603
- */
601
+ /** #1577 trust map out-param (xrayPoolSizeSink pattern). */
604
602
  trustByPathSink?: { trustByPath: Map<string, TrustStageResultItem> | null };
605
603
  deadlineAtMs?: number | null;
606
- /** Issue #681 — when true, bypass graphTraversalConfidenceFloor. */
607
604
  includeLowConfidence?: boolean;
608
- /** #1952 state-view admission — resolved by the caller from config/override + change intent. */
609
605
  stateViewActive?: boolean;
606
+ searchOptions?: SearchQueryOptions;
610
607
  }): Promise<QmdSearchResult[]> {
611
608
  // Prefer the threaded set; fall back to a config-derived set so direct
612
609
  // callers (unit tests) behave identically to the recall pipeline (#1523).
@@ -726,7 +723,7 @@ export class RecallSearchPipelineCoordinator {
726
723
  resolveNamespace: (p) => this.deps.namespaceFromPath(p),
727
724
  collection: coldCollection,
728
725
  queryAwarePrefilter: options.queryAwarePrefilter,
729
- searchOptions: this.deps.buildConfiguredQmdSearchOptions(options.prompt),
726
+ searchOptions: this.deps.buildConfiguredQmdSearchOptions(options.prompt, options.searchOptions),
730
727
  abortSignal: stepSignal,
731
728
  onDegradation: (degradation) => {
732
729
  if (coldQmdObserverActive) {