@remnic/core 9.69.89 → 9.69.91

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 (405) hide show
  1. package/dist/access-admin-ops-surface.js +68 -67
  2. package/dist/access-authorization-probe.js +69 -68
  3. package/dist/access-boundary.js +68 -67
  4. package/dist/access-cli.js +160 -158
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-extraction-force-flush.js +68 -67
  7. package/dist/access-http-briefing.js +69 -68
  8. package/dist/access-http-query.js +70 -69
  9. package/dist/access-http.js +91 -90
  10. package/dist/access-identity-continuity-surface.js +68 -67
  11. package/dist/access-lcm-surface.js +68 -67
  12. package/dist/access-mcp-output-schemas.d.ts.map +1 -1
  13. package/dist/access-mcp-output-schemas.js +1 -1
  14. package/dist/access-mcp.js +80 -79
  15. package/dist/access-memory-search-fanout.js +3 -3
  16. package/dist/access-namespace-preflight.js +68 -67
  17. package/dist/access-observe-write-category.js +7 -7
  18. package/dist/access-observe-write-surface.js +68 -67
  19. package/dist/access-offline-manifest.js +6 -6
  20. package/dist/access-operations-batch.js +70 -69
  21. package/dist/access-operations.js +77 -76
  22. package/dist/access-recall-concurrency.js +68 -67
  23. package/dist/access-recall-corpus-versions.d.ts +12 -0
  24. package/dist/access-recall-corpus-versions.d.ts.map +1 -0
  25. package/dist/access-recall-corpus-versions.js +10 -0
  26. package/dist/access-recall-diagnostics.js +5 -5
  27. package/dist/access-recall-response.d.ts +4 -0
  28. package/dist/access-recall-response.d.ts.map +1 -1
  29. package/dist/access-recall-response.js +68 -67
  30. package/dist/access-recall-surface.d.ts +8 -0
  31. package/dist/access-recall-surface.d.ts.map +1 -1
  32. package/dist/access-recall-surface.js +68 -67
  33. package/dist/access-schema.js +6 -6
  34. package/dist/access-service.d.ts +5 -0
  35. package/dist/access-service.d.ts.map +1 -1
  36. package/dist/access-service.js +68 -67
  37. package/dist/access-surface-catalog.js +70 -69
  38. package/dist/access-surface-catalog.js.map +1 -1
  39. package/dist/active-memory-bridge.js +3 -3
  40. package/dist/active-recall.js +23 -21
  41. package/dist/active-recall.js.map +1 -1
  42. package/dist/adapters/index.js +4 -4
  43. package/dist/adapters/registry.js +2 -2
  44. package/dist/{auto-sync-U5N3CB5Y.js → auto-sync-PAWBFQWL.js} +5 -5
  45. package/dist/briefing.js +19 -19
  46. package/dist/buffer.js +8 -8
  47. package/dist/calibration.js +2 -2
  48. package/dist/capabilities.d.ts +2 -1
  49. package/dist/capabilities.d.ts.map +1 -1
  50. package/dist/capabilities.js +1 -1
  51. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  52. package/dist/causal-consolidation.js +19 -19
  53. package/dist/{chunk-BMXEBWBT.js → chunk-2EMROIXS.js} +2 -1
  54. package/dist/{chunk-BMXEBWBT.js.map → chunk-2EMROIXS.js.map} +1 -1
  55. package/dist/{chunk-MCTM4YPL.js → chunk-2FLFJTCI.js} +4 -2
  56. package/dist/chunk-2FLFJTCI.js.map +1 -0
  57. package/dist/{chunk-RDJ6C7NZ.js → chunk-2IWBHZ3H.js} +5 -5
  58. package/dist/{chunk-UP75KL3L.js → chunk-2JRB3Z5N.js} +2 -2
  59. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  60. package/dist/{chunk-KN6CIN7I.js → chunk-32HO62I4.js} +2 -2
  61. package/dist/{chunk-JLPNONPH.js → chunk-35A7GCHG.js} +2 -2
  62. package/dist/{chunk-EAQQ2FD3.js → chunk-37ZQYFX4.js} +6 -6
  63. package/dist/{chunk-3QKO4QN7.js → chunk-3BTHXB7Z.js} +2 -2
  64. package/dist/{chunk-C7V3KPKJ.js → chunk-47LTKAGL.js} +2 -2
  65. package/dist/{chunk-3O5BB45T.js → chunk-4DXNOVNW.js} +10 -10
  66. package/dist/{chunk-65I2LZEK.js → chunk-4G2YCKLT.js} +2 -2
  67. package/dist/{chunk-JBH26P62.js → chunk-4GEBLO7S.js} +10 -10
  68. package/dist/{chunk-6MNKDTDI.js → chunk-4I6PEEFA.js} +3 -3
  69. package/dist/{chunk-Z4TXB4K7.js → chunk-5BUCKFRE.js} +2 -2
  70. package/dist/{chunk-7D7OUO5W.js → chunk-5S7SNRSJ.js} +2 -2
  71. package/dist/{chunk-NOL7SEWN.js → chunk-5YR4UGF2.js} +5 -5
  72. package/dist/{chunk-PMNLL2TL.js → chunk-6BG364RN.js} +2 -2
  73. package/dist/{chunk-AEJ3TE5H.js → chunk-76LNUSS5.js} +2 -2
  74. package/dist/{chunk-7CRUDH7G.js → chunk-77HNHT6S.js} +2 -2
  75. package/dist/{chunk-OWYHHW67.js → chunk-7XI2UJHL.js} +4 -4
  76. package/dist/{chunk-BJVO4H5C.js → chunk-7Z2UKRNJ.js} +4 -4
  77. package/dist/{chunk-2WLMWP2T.js → chunk-A3K2KKSG.js} +2 -2
  78. package/dist/chunk-A5ZYP4K5.js +130 -0
  79. package/dist/chunk-A5ZYP4K5.js.map +1 -0
  80. package/dist/{chunk-NMZVDRVP.js → chunk-ACCOC6UM.js} +2 -2
  81. package/dist/{chunk-3JDA3XF5.js → chunk-AEGNDL24.js} +2 -2
  82. package/dist/{chunk-IYIBGSHJ.js → chunk-AEUMONCD.js} +2 -2
  83. package/dist/{chunk-RMDGAAZF.js → chunk-AF5PW35O.js} +2 -2
  84. package/dist/{chunk-JUT3OR2L.js → chunk-ANGZWYL2.js} +6 -6
  85. package/dist/{chunk-6LYAEM54.js → chunk-AXHU56C3.js} +2 -2
  86. package/dist/{chunk-YPI4RQWV.js → chunk-BCGMG2RD.js} +2 -2
  87. package/dist/{chunk-HXCJF4XU.js → chunk-BFIZXFUG.js} +2 -2
  88. package/dist/{chunk-DBYAY6UW.js → chunk-BTOHGPHC.js} +3 -3
  89. package/dist/{chunk-YSWJXOOL.js → chunk-CAKHZAXH.js} +2 -2
  90. package/dist/{chunk-YSBL7VPO.js → chunk-CDWFWOSZ.js} +2 -2
  91. package/dist/{chunk-VA4O3U7U.js → chunk-CZ44FH45.js} +4 -4
  92. package/dist/{chunk-T3FMRLWQ.js → chunk-D5HQ3VEX.js} +4 -4
  93. package/dist/{chunk-S7LWX2PQ.js → chunk-DPG5HQLE.js} +4 -4
  94. package/dist/{chunk-7WBSMXGC.js → chunk-DVSAMW5T.js} +3 -3
  95. package/dist/{chunk-WBYQA3VN.js → chunk-E5H4TM4Y.js} +3 -3
  96. package/dist/{chunk-4RL3JOB3.js → chunk-EEDI3OXB.js} +2 -2
  97. package/dist/{chunk-3TB2XQ3C.js → chunk-EUL3S3LE.js} +4 -4
  98. package/dist/{chunk-XAITGGX5.js → chunk-F23U5YE7.js} +4 -4
  99. package/dist/{chunk-IIARQTZ2.js → chunk-GDVORIFM.js} +2 -2
  100. package/dist/{chunk-CALBQ2NG.js → chunk-GXETU7AE.js} +79 -62
  101. package/dist/chunk-GXETU7AE.js.map +1 -0
  102. package/dist/{chunk-TPEZ2SHV.js → chunk-HCPUVB7S.js} +3 -3
  103. package/dist/{chunk-R3X2T2LP.js → chunk-HFOY2SBG.js} +2 -2
  104. package/dist/{chunk-JYM4Y6SO.js → chunk-HQCUUVG2.js} +19 -19
  105. package/dist/{chunk-ST2RQUXC.js → chunk-I6B3S62A.js} +2 -2
  106. package/dist/{chunk-RBITPCMK.js → chunk-IDSSDL4W.js} +9 -9
  107. package/dist/{chunk-B3OFQP5Y.js → chunk-IY47KPML.js} +6 -6
  108. package/dist/{chunk-AXC4WSF3.js → chunk-JDOBIFBK.js} +2 -2
  109. package/dist/{chunk-3AGHSQPM.js → chunk-JGXHQV5N.js} +3 -3
  110. package/dist/{chunk-7LNHRQKR.js → chunk-JLIGUFPF.js} +2 -2
  111. package/dist/{chunk-EDIH6X2P.js → chunk-JZ66PN72.js} +2 -2
  112. package/dist/{chunk-KTKHO3UI.js → chunk-KICEAGKM.js} +2 -2
  113. package/dist/{chunk-22LMCQ5B.js → chunk-KNI4SGQE.js} +118 -105
  114. package/dist/chunk-KNI4SGQE.js.map +1 -0
  115. package/dist/{chunk-BUKK5SWA.js → chunk-KQAFEZQX.js} +2 -2
  116. package/dist/{chunk-UQDC3W77.js → chunk-KTG23JDX.js} +2 -2
  117. package/dist/{chunk-3YD44CH2.js → chunk-KYOZ5E6V.js} +2 -2
  118. package/dist/{chunk-2FX374UI.js → chunk-L3TZXELN.js} +4 -4
  119. package/dist/{chunk-IKDRGVVJ.js → chunk-M3N2TUZ7.js} +2 -2
  120. package/dist/{chunk-76M5OK7V.js → chunk-M7T2NKET.js} +5 -5
  121. package/dist/{chunk-JZ4TJHR2.js → chunk-MZAH3CBT.js} +2 -2
  122. package/dist/{chunk-ZG5DWWKK.js → chunk-NJW2ZG64.js} +2 -2
  123. package/dist/{chunk-5STPRPE7.js → chunk-NSKXRTVZ.js} +2 -2
  124. package/dist/{chunk-4O4XCBOS.js → chunk-NUSQ3YEL.js} +2 -2
  125. package/dist/{chunk-SLEAJ67D.js → chunk-O57FCN42.js} +13 -13
  126. package/dist/{chunk-PULDSMCJ.js → chunk-OEBUAC3O.js} +10 -10
  127. package/dist/{chunk-Y23L4YJV.js → chunk-OEIA4IHU.js} +2 -2
  128. package/dist/{chunk-66DKTOBY.js → chunk-OGZC2WUX.js} +2 -2
  129. package/dist/{chunk-VHDKPGMG.js → chunk-P62DSJUK.js} +6 -6
  130. package/dist/{chunk-64ZUALXK.js → chunk-PH2V7EXZ.js} +2 -2
  131. package/dist/{chunk-KKNZ7PUZ.js → chunk-QAIKLICT.js} +2 -2
  132. package/dist/{chunk-SSUDD72S.js → chunk-QPWUG2S3.js} +2 -2
  133. package/dist/{chunk-QI2E6ISQ.js → chunk-R2TVWQLR.js} +2 -2
  134. package/dist/chunk-R2TVWQLR.js.map +1 -0
  135. package/dist/{chunk-AZIOEOK4.js → chunk-R36IBI2M.js} +3 -3
  136. package/dist/{chunk-MGZMC6WN.js → chunk-R5B3OWI4.js} +59 -59
  137. package/dist/{chunk-VL4X7ZHC.js → chunk-RFIJRZ4K.js} +2 -2
  138. package/dist/{chunk-PWF4JXKD.js → chunk-RKDSELA3.js} +1 -1
  139. package/dist/chunk-RKDSELA3.js.map +1 -0
  140. package/dist/{chunk-QZLCVO2V.js → chunk-RPVHRZ5C.js} +2 -2
  141. package/dist/{chunk-A6RVIHHK.js → chunk-RVBLCU5C.js} +4 -4
  142. package/dist/{chunk-BUQKSQXL.js → chunk-S533KGX6.js} +5 -5
  143. package/dist/{chunk-4HUCP4R4.js → chunk-SCPHU3RW.js} +7 -7
  144. package/dist/{chunk-RJLV4BKR.js → chunk-SFSD5Q6O.js} +3 -3
  145. package/dist/{chunk-QOXNTKXB.js → chunk-SMLKHXPF.js} +2 -2
  146. package/dist/{chunk-7QE46QXI.js → chunk-T7R5HI6A.js} +1 -1
  147. package/dist/{chunk-NJVR724O.js → chunk-TVQZAQPE.js} +2 -2
  148. package/dist/{chunk-H56VY4BY.js → chunk-U36GYZ2P.js} +10 -5
  149. package/dist/chunk-U36GYZ2P.js.map +1 -0
  150. package/dist/{chunk-XOV7NRY5.js → chunk-U46P4UAR.js} +3 -3
  151. package/dist/{chunk-DZ42MDZE.js → chunk-UCJINCZT.js} +2 -2
  152. package/dist/{chunk-WNRTXEWW.js → chunk-UG5V3Z3R.js} +7 -7
  153. package/dist/{chunk-IW3RMBPB.js → chunk-VAOC6GHN.js} +2 -2
  154. package/dist/{chunk-SZG4WFAG.js → chunk-VBNA2JEN.js} +2 -2
  155. package/dist/{chunk-J27JML5O.js → chunk-VOZNBQNL.js} +2 -2
  156. package/dist/{chunk-JB56XYHP.js → chunk-WHIGRW7T.js} +2 -2
  157. package/dist/{chunk-AZSGSRIM.js → chunk-WHTMVTU4.js} +3 -3
  158. package/dist/{chunk-AERXJCOG.js → chunk-WL7N5VGG.js} +5 -5
  159. package/dist/{chunk-TFA6HPOA.js → chunk-WQUGCOKF.js} +4 -4
  160. package/dist/{chunk-VDO32NLK.js → chunk-WTZQM74L.js} +5 -5
  161. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  162. package/dist/{chunk-T2YX56QI.js → chunk-XWSUK5GL.js} +4 -4
  163. package/dist/{chunk-ACX55QDO.js → chunk-XYOT5GQU.js} +3 -3
  164. package/dist/{chunk-5FNZ3G6X.js → chunk-Y7427SL7.js} +7 -7
  165. package/dist/{chunk-FC52YWAO.js → chunk-YHZWVDP7.js} +2 -2
  166. package/dist/chunk-YVRQ5JRA.js +49 -0
  167. package/dist/chunk-YVRQ5JRA.js.map +1 -0
  168. package/dist/{chunk-DO4C4AXD.js → chunk-ZFTODDTX.js} +2 -2
  169. package/dist/{chunk-H36X4NRH.js → chunk-ZHXSOMYH.js} +2 -2
  170. package/dist/{chunk-FEIXG5FA.js → chunk-ZQTYWSO3.js} +2 -2
  171. package/dist/cli.js +119 -116
  172. package/dist/coding/export-okf-codegraph.js +17 -17
  173. package/dist/compounding/engine.js +19 -19
  174. package/dist/config.d.ts.map +1 -1
  175. package/dist/config.js +23 -21
  176. package/dist/connectors/codex-materialize-runner.js +18 -18
  177. package/dist/connectors/index.js +20 -20
  178. package/dist/contradiction/index.js +3 -3
  179. package/dist/{contradiction-scan-TAGMOUQ2.js → contradiction-scan-GGRTVB7C.js} +3 -3
  180. package/dist/convergence-refresh.js +20 -20
  181. package/dist/conversation-index/backend.js +2 -2
  182. package/dist/corpus-watermark.js +20 -20
  183. package/dist/day-summary.js +2 -2
  184. package/dist/deep-recall-http-glue.js +7 -7
  185. package/dist/embedding-fallback.js +2 -2
  186. package/dist/entity-retrieval.js +19 -19
  187. package/dist/explicit-capture.js +2 -2
  188. package/dist/external-wiki-access.js +69 -68
  189. package/dist/extraction-judge.js +3 -3
  190. package/dist/extraction-normalization.js +3 -3
  191. package/dist/extraction-prompt.js +2 -2
  192. package/dist/extraction.js +32 -32
  193. package/dist/{first-start-migration-GAT7G733.js → first-start-migration-OM3PHMZO.js} +5 -5
  194. package/dist/harmonic-retrieval.js +1 -1
  195. package/dist/index.d.ts +1 -1
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +196 -194
  198. package/dist/lcm/engine.js +3 -3
  199. package/dist/lcm/index.js +6 -6
  200. package/dist/local-llm-config.js +1 -1
  201. package/dist/local-llm.js +3 -3
  202. package/dist/location/index.js +20 -20
  203. package/dist/maintenance/memory-governance.js +18 -18
  204. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +18 -18
  205. package/dist/maintenance/rebuild-memory-projection.js +19 -19
  206. package/dist/memory-browse-operations.js +69 -68
  207. package/dist/memory-browse.js +5 -5
  208. package/dist/namespaces/migrate.js +19 -19
  209. package/dist/namespaces/principal.js +2 -2
  210. package/dist/namespaces/search.js +13 -13
  211. package/dist/namespaces/storage.js +18 -18
  212. package/dist/offline-sync-impression-drain.js +5 -5
  213. package/dist/operator-doctor-corpus.js +21 -21
  214. package/dist/operator-toolkit.js +35 -33
  215. package/dist/orchestration/compression-guideline-coordinator.js +2 -2
  216. package/dist/orchestration/maintenance.js +33 -33
  217. package/dist/orchestration/orchestrator-helpers.d.ts +1 -0
  218. package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -1
  219. package/dist/orchestration/recall-entry.d.ts.map +1 -1
  220. package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -1
  221. package/dist/orchestrator.js +162 -160
  222. package/dist/outcome-boost-config.d.ts +17 -0
  223. package/dist/outcome-boost-config.d.ts.map +1 -0
  224. package/dist/outcome-boost-config.js +1 -0
  225. package/dist/outcome-boost-config.js.map +1 -0
  226. package/dist/qmd.js +4 -4
  227. package/dist/recall-explain-renderer.js +3 -3
  228. package/dist/recall-navigate-access.js +2 -2
  229. package/dist/recall-navigate-disclosure.js +2 -2
  230. package/dist/recall-navigate.js +2 -2
  231. package/dist/recall-navigation-operations.js +69 -68
  232. package/dist/recall-navigation.js +68 -67
  233. package/dist/recall-state-view-admission.js +5 -5
  234. package/dist/recall-why-service.js +9 -9
  235. package/dist/recall-why.js +3 -3
  236. package/dist/recall-xray-cli.js +4 -4
  237. package/dist/recall-xray-renderer.js +3 -3
  238. package/dist/recall-xray.js +2 -2
  239. package/dist/rerank-outcome.d.ts +73 -0
  240. package/dist/rerank-outcome.d.ts.map +1 -0
  241. package/dist/rerank-outcome.js +28 -0
  242. package/dist/rerank-outcome.js.map +1 -0
  243. package/dist/{resolution-K4A3VPKZ.js → resolution-BROE3TRO.js} +4 -4
  244. package/dist/resolution-BROE3TRO.js.map +1 -0
  245. package/dist/resume-bundles.js +24 -22
  246. package/dist/search/embed-helper.js +2 -2
  247. package/dist/search/factory.js +12 -12
  248. package/dist/search/index.js +16 -16
  249. package/dist/search/lancedb-backend.js +2 -2
  250. package/dist/search/meilisearch-backend.js +2 -2
  251. package/dist/search/orama-backend.js +2 -2
  252. package/dist/semantic-consolidation.js +19 -19
  253. package/dist/semantic-rule-promotion.js +18 -18
  254. package/dist/semantic-rule-verifier.js +18 -18
  255. package/dist/shared-context/manager.js +2 -2
  256. package/dist/source-agent-qualifier.js +26 -26
  257. package/dist/standup/build.js +18 -18
  258. package/dist/storage.js +17 -17
  259. package/dist/summarizer.js +4 -4
  260. package/dist/support-passport/index.js +71 -70
  261. package/dist/{tier-stats-VF6DS52E.js → tier-stats-M2FMMD2N.js} +2 -2
  262. package/dist/transfer/backup.js +2 -2
  263. package/dist/transfer/capsule-export.js +2 -2
  264. package/dist/transfer/capsule-import.js +2 -2
  265. package/dist/transfer/export-okf.js +18 -18
  266. package/dist/types.d.ts +4 -2
  267. package/dist/types.d.ts.map +1 -1
  268. package/dist/types.js +1 -1
  269. package/dist/verified-recall.js +18 -18
  270. package/dist/who-knows-cli.js +19 -19
  271. package/dist/who-knows.js +18 -18
  272. package/package.json +13 -3
  273. package/src/access-mcp-output-schemas.ts +2 -0
  274. package/src/access-recall-corpus-versions.ts +59 -0
  275. package/src/access-recall-response.ts +3 -0
  276. package/src/access-recall-surface.ts +22 -23
  277. package/src/access-service-observe-lcm-parity.test.ts +54 -21
  278. package/src/access-service-raw-excerpt-read-gate.test.ts +1 -1
  279. package/src/access-service.ts +3 -0
  280. package/src/capabilities.test.ts +1 -0
  281. package/src/capabilities.ts +6 -8
  282. package/src/config.ts +3 -0
  283. package/src/index.ts +1 -1
  284. package/src/orchestration/orchestrator-helpers.ts +1 -1
  285. package/src/orchestration/recall-entry.ts +32 -16
  286. package/src/orchestration/recall-internal.ts +2 -2
  287. package/src/orchestration/recall-search-pipeline.ts +3 -0
  288. package/src/orchestrator-init.test.ts +11 -1
  289. package/src/outcome-boost-config.ts +16 -0
  290. package/src/recall-retrieval-failure.test.ts +456 -4
  291. package/src/rerank-outcome.test.ts +218 -0
  292. package/src/rerank-outcome.ts +219 -0
  293. package/src/types.ts +3 -3
  294. package/dist/chunk-22LMCQ5B.js.map +0 -1
  295. package/dist/chunk-CALBQ2NG.js.map +0 -1
  296. package/dist/chunk-H56VY4BY.js.map +0 -1
  297. package/dist/chunk-MCTM4YPL.js.map +0 -1
  298. package/dist/chunk-PWF4JXKD.js.map +0 -1
  299. package/dist/chunk-QI2E6ISQ.js.map +0 -1
  300. /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-recall-corpus-versions.js.map} +0 -0
  301. /package/dist/{auto-sync-U5N3CB5Y.js.map → auto-sync-PAWBFQWL.js.map} +0 -0
  302. /package/dist/{contradiction-scan-TAGMOUQ2.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  303. /package/dist/{chunk-RDJ6C7NZ.js.map → chunk-2IWBHZ3H.js.map} +0 -0
  304. /package/dist/{chunk-UP75KL3L.js.map → chunk-2JRB3Z5N.js.map} +0 -0
  305. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  306. /package/dist/{chunk-KN6CIN7I.js.map → chunk-32HO62I4.js.map} +0 -0
  307. /package/dist/{chunk-JLPNONPH.js.map → chunk-35A7GCHG.js.map} +0 -0
  308. /package/dist/{chunk-EAQQ2FD3.js.map → chunk-37ZQYFX4.js.map} +0 -0
  309. /package/dist/{chunk-3QKO4QN7.js.map → chunk-3BTHXB7Z.js.map} +0 -0
  310. /package/dist/{chunk-C7V3KPKJ.js.map → chunk-47LTKAGL.js.map} +0 -0
  311. /package/dist/{chunk-3O5BB45T.js.map → chunk-4DXNOVNW.js.map} +0 -0
  312. /package/dist/{chunk-65I2LZEK.js.map → chunk-4G2YCKLT.js.map} +0 -0
  313. /package/dist/{chunk-JBH26P62.js.map → chunk-4GEBLO7S.js.map} +0 -0
  314. /package/dist/{chunk-6MNKDTDI.js.map → chunk-4I6PEEFA.js.map} +0 -0
  315. /package/dist/{chunk-Z4TXB4K7.js.map → chunk-5BUCKFRE.js.map} +0 -0
  316. /package/dist/{chunk-7D7OUO5W.js.map → chunk-5S7SNRSJ.js.map} +0 -0
  317. /package/dist/{chunk-NOL7SEWN.js.map → chunk-5YR4UGF2.js.map} +0 -0
  318. /package/dist/{chunk-PMNLL2TL.js.map → chunk-6BG364RN.js.map} +0 -0
  319. /package/dist/{chunk-AEJ3TE5H.js.map → chunk-76LNUSS5.js.map} +0 -0
  320. /package/dist/{chunk-7CRUDH7G.js.map → chunk-77HNHT6S.js.map} +0 -0
  321. /package/dist/{chunk-OWYHHW67.js.map → chunk-7XI2UJHL.js.map} +0 -0
  322. /package/dist/{chunk-BJVO4H5C.js.map → chunk-7Z2UKRNJ.js.map} +0 -0
  323. /package/dist/{chunk-2WLMWP2T.js.map → chunk-A3K2KKSG.js.map} +0 -0
  324. /package/dist/{chunk-NMZVDRVP.js.map → chunk-ACCOC6UM.js.map} +0 -0
  325. /package/dist/{chunk-3JDA3XF5.js.map → chunk-AEGNDL24.js.map} +0 -0
  326. /package/dist/{chunk-IYIBGSHJ.js.map → chunk-AEUMONCD.js.map} +0 -0
  327. /package/dist/{chunk-RMDGAAZF.js.map → chunk-AF5PW35O.js.map} +0 -0
  328. /package/dist/{chunk-JUT3OR2L.js.map → chunk-ANGZWYL2.js.map} +0 -0
  329. /package/dist/{chunk-6LYAEM54.js.map → chunk-AXHU56C3.js.map} +0 -0
  330. /package/dist/{chunk-YPI4RQWV.js.map → chunk-BCGMG2RD.js.map} +0 -0
  331. /package/dist/{chunk-HXCJF4XU.js.map → chunk-BFIZXFUG.js.map} +0 -0
  332. /package/dist/{chunk-DBYAY6UW.js.map → chunk-BTOHGPHC.js.map} +0 -0
  333. /package/dist/{chunk-YSWJXOOL.js.map → chunk-CAKHZAXH.js.map} +0 -0
  334. /package/dist/{chunk-YSBL7VPO.js.map → chunk-CDWFWOSZ.js.map} +0 -0
  335. /package/dist/{chunk-VA4O3U7U.js.map → chunk-CZ44FH45.js.map} +0 -0
  336. /package/dist/{chunk-T3FMRLWQ.js.map → chunk-D5HQ3VEX.js.map} +0 -0
  337. /package/dist/{chunk-S7LWX2PQ.js.map → chunk-DPG5HQLE.js.map} +0 -0
  338. /package/dist/{chunk-7WBSMXGC.js.map → chunk-DVSAMW5T.js.map} +0 -0
  339. /package/dist/{chunk-WBYQA3VN.js.map → chunk-E5H4TM4Y.js.map} +0 -0
  340. /package/dist/{chunk-4RL3JOB3.js.map → chunk-EEDI3OXB.js.map} +0 -0
  341. /package/dist/{chunk-3TB2XQ3C.js.map → chunk-EUL3S3LE.js.map} +0 -0
  342. /package/dist/{chunk-XAITGGX5.js.map → chunk-F23U5YE7.js.map} +0 -0
  343. /package/dist/{chunk-IIARQTZ2.js.map → chunk-GDVORIFM.js.map} +0 -0
  344. /package/dist/{chunk-TPEZ2SHV.js.map → chunk-HCPUVB7S.js.map} +0 -0
  345. /package/dist/{chunk-R3X2T2LP.js.map → chunk-HFOY2SBG.js.map} +0 -0
  346. /package/dist/{chunk-JYM4Y6SO.js.map → chunk-HQCUUVG2.js.map} +0 -0
  347. /package/dist/{chunk-ST2RQUXC.js.map → chunk-I6B3S62A.js.map} +0 -0
  348. /package/dist/{chunk-RBITPCMK.js.map → chunk-IDSSDL4W.js.map} +0 -0
  349. /package/dist/{chunk-B3OFQP5Y.js.map → chunk-IY47KPML.js.map} +0 -0
  350. /package/dist/{chunk-AXC4WSF3.js.map → chunk-JDOBIFBK.js.map} +0 -0
  351. /package/dist/{chunk-3AGHSQPM.js.map → chunk-JGXHQV5N.js.map} +0 -0
  352. /package/dist/{chunk-7LNHRQKR.js.map → chunk-JLIGUFPF.js.map} +0 -0
  353. /package/dist/{chunk-EDIH6X2P.js.map → chunk-JZ66PN72.js.map} +0 -0
  354. /package/dist/{chunk-KTKHO3UI.js.map → chunk-KICEAGKM.js.map} +0 -0
  355. /package/dist/{chunk-BUKK5SWA.js.map → chunk-KQAFEZQX.js.map} +0 -0
  356. /package/dist/{chunk-UQDC3W77.js.map → chunk-KTG23JDX.js.map} +0 -0
  357. /package/dist/{chunk-3YD44CH2.js.map → chunk-KYOZ5E6V.js.map} +0 -0
  358. /package/dist/{chunk-2FX374UI.js.map → chunk-L3TZXELN.js.map} +0 -0
  359. /package/dist/{chunk-IKDRGVVJ.js.map → chunk-M3N2TUZ7.js.map} +0 -0
  360. /package/dist/{chunk-76M5OK7V.js.map → chunk-M7T2NKET.js.map} +0 -0
  361. /package/dist/{chunk-JZ4TJHR2.js.map → chunk-MZAH3CBT.js.map} +0 -0
  362. /package/dist/{chunk-ZG5DWWKK.js.map → chunk-NJW2ZG64.js.map} +0 -0
  363. /package/dist/{chunk-5STPRPE7.js.map → chunk-NSKXRTVZ.js.map} +0 -0
  364. /package/dist/{chunk-4O4XCBOS.js.map → chunk-NUSQ3YEL.js.map} +0 -0
  365. /package/dist/{chunk-SLEAJ67D.js.map → chunk-O57FCN42.js.map} +0 -0
  366. /package/dist/{chunk-PULDSMCJ.js.map → chunk-OEBUAC3O.js.map} +0 -0
  367. /package/dist/{chunk-Y23L4YJV.js.map → chunk-OEIA4IHU.js.map} +0 -0
  368. /package/dist/{chunk-66DKTOBY.js.map → chunk-OGZC2WUX.js.map} +0 -0
  369. /package/dist/{chunk-VHDKPGMG.js.map → chunk-P62DSJUK.js.map} +0 -0
  370. /package/dist/{chunk-64ZUALXK.js.map → chunk-PH2V7EXZ.js.map} +0 -0
  371. /package/dist/{chunk-KKNZ7PUZ.js.map → chunk-QAIKLICT.js.map} +0 -0
  372. /package/dist/{chunk-SSUDD72S.js.map → chunk-QPWUG2S3.js.map} +0 -0
  373. /package/dist/{chunk-AZIOEOK4.js.map → chunk-R36IBI2M.js.map} +0 -0
  374. /package/dist/{chunk-MGZMC6WN.js.map → chunk-R5B3OWI4.js.map} +0 -0
  375. /package/dist/{chunk-VL4X7ZHC.js.map → chunk-RFIJRZ4K.js.map} +0 -0
  376. /package/dist/{chunk-QZLCVO2V.js.map → chunk-RPVHRZ5C.js.map} +0 -0
  377. /package/dist/{chunk-A6RVIHHK.js.map → chunk-RVBLCU5C.js.map} +0 -0
  378. /package/dist/{chunk-BUQKSQXL.js.map → chunk-S533KGX6.js.map} +0 -0
  379. /package/dist/{chunk-4HUCP4R4.js.map → chunk-SCPHU3RW.js.map} +0 -0
  380. /package/dist/{chunk-RJLV4BKR.js.map → chunk-SFSD5Q6O.js.map} +0 -0
  381. /package/dist/{chunk-QOXNTKXB.js.map → chunk-SMLKHXPF.js.map} +0 -0
  382. /package/dist/{chunk-7QE46QXI.js.map → chunk-T7R5HI6A.js.map} +0 -0
  383. /package/dist/{chunk-NJVR724O.js.map → chunk-TVQZAQPE.js.map} +0 -0
  384. /package/dist/{chunk-XOV7NRY5.js.map → chunk-U46P4UAR.js.map} +0 -0
  385. /package/dist/{chunk-DZ42MDZE.js.map → chunk-UCJINCZT.js.map} +0 -0
  386. /package/dist/{chunk-WNRTXEWW.js.map → chunk-UG5V3Z3R.js.map} +0 -0
  387. /package/dist/{chunk-IW3RMBPB.js.map → chunk-VAOC6GHN.js.map} +0 -0
  388. /package/dist/{chunk-SZG4WFAG.js.map → chunk-VBNA2JEN.js.map} +0 -0
  389. /package/dist/{chunk-J27JML5O.js.map → chunk-VOZNBQNL.js.map} +0 -0
  390. /package/dist/{chunk-JB56XYHP.js.map → chunk-WHIGRW7T.js.map} +0 -0
  391. /package/dist/{chunk-AZSGSRIM.js.map → chunk-WHTMVTU4.js.map} +0 -0
  392. /package/dist/{chunk-AERXJCOG.js.map → chunk-WL7N5VGG.js.map} +0 -0
  393. /package/dist/{chunk-TFA6HPOA.js.map → chunk-WQUGCOKF.js.map} +0 -0
  394. /package/dist/{chunk-VDO32NLK.js.map → chunk-WTZQM74L.js.map} +0 -0
  395. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  396. /package/dist/{chunk-T2YX56QI.js.map → chunk-XWSUK5GL.js.map} +0 -0
  397. /package/dist/{chunk-ACX55QDO.js.map → chunk-XYOT5GQU.js.map} +0 -0
  398. /package/dist/{chunk-5FNZ3G6X.js.map → chunk-Y7427SL7.js.map} +0 -0
  399. /package/dist/{chunk-FC52YWAO.js.map → chunk-YHZWVDP7.js.map} +0 -0
  400. /package/dist/{chunk-DO4C4AXD.js.map → chunk-ZFTODDTX.js.map} +0 -0
  401. /package/dist/{chunk-H36X4NRH.js.map → chunk-ZHXSOMYH.js.map} +0 -0
  402. /package/dist/{chunk-FEIXG5FA.js.map → chunk-ZQTYWSO3.js.map} +0 -0
  403. /package/dist/{resolution-K4A3VPKZ.js.map → contradiction-scan-GGRTVB7C.js.map} +0 -0
  404. /package/dist/{first-start-migration-GAT7G733.js.map → first-start-migration-OM3PHMZO.js.map} +0 -0
  405. /package/dist/{tier-stats-VF6DS52E.js.map → tier-stats-M2FMMD2N.js.map} +0 -0
@@ -0,0 +1,59 @@
1
+ import type { RecallInvocationOptions } from "./orchestration/orchestrator-helpers.js";
2
+
3
+ export type RecallCorpusVersion = { namespace: string; version: number | null };
4
+
5
+ const DEFAULT_CAPTURE_TIMEOUT_MS = 250;
6
+
7
+ export function mergeRecallCorpusVersions(
8
+ current: RecallCorpusVersion[],
9
+ captured: RecallCorpusVersion[],
10
+ ): RecallCorpusVersion[] {
11
+ const versions = new Map(current.map((entry) => [entry.namespace, entry]));
12
+ for (const entry of captured) {
13
+ if (!versions.has(entry.namespace)) versions.set(entry.namespace, entry);
14
+ }
15
+ return [...versions.values()];
16
+ }
17
+
18
+ export function createRecallCorpusVersionCapture(
19
+ orchestrator: { getStorage(namespace: string): Promise<{ getMemoryCorpusVersion(): number }> },
20
+ signal: AbortSignal | undefined,
21
+ setVersions: (versions: RecallCorpusVersion[]) => void,
22
+ includeNoRecall = false,
23
+ timeoutMs = DEFAULT_CAPTURE_TIMEOUT_MS,
24
+ ): NonNullable<RecallInvocationOptions["onRecallPlanResolved"]> {
25
+ return async (mode, namespaces) => {
26
+ if ((mode === "no_recall" && !includeNoRecall) || signal?.aborted) return;
27
+ const captured = await Promise.all(namespaces.map(async (namespace) => {
28
+ let timer: ReturnType<typeof setTimeout> | undefined;
29
+ let abortCapture: (() => void) | undefined;
30
+ try {
31
+ const timeout = new Promise<null>((resolve) => {
32
+ timer = setTimeout(() => resolve(null), timeoutMs);
33
+ });
34
+ const aborted = signal
35
+ ? new Promise<null>((resolve) => {
36
+ if (signal.aborted) {
37
+ resolve(null);
38
+ } else {
39
+ abortCapture = () => resolve(null);
40
+ signal.addEventListener("abort", abortCapture, { once: true });
41
+ }
42
+ })
43
+ : undefined;
44
+ const version = await Promise.race([
45
+ orchestrator.getStorage(namespace).then((storage) => storage.getMemoryCorpusVersion()),
46
+ timeout,
47
+ ...(aborted ? [aborted] : []),
48
+ ]);
49
+ return { namespace, version };
50
+ } catch {
51
+ return { namespace, version: null };
52
+ } finally {
53
+ if (timer !== undefined) clearTimeout(timer);
54
+ if (abortCapture) signal?.removeEventListener("abort", abortCapture);
55
+ }
56
+ }));
57
+ if (!signal?.aborted) setVersions(captured);
58
+ };
59
+ }
@@ -36,6 +36,7 @@ export async function assembleRecallResponse(
36
36
  request: EngramAccessRecallRequest;
37
37
  context: string;
38
38
  contextComposition?: RecallContextComposition;
39
+ storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }>;
39
40
  query: string;
40
41
  mode: RecallPlanMode | undefined;
41
42
  namespace: string;
@@ -55,6 +56,7 @@ export async function assembleRecallResponse(
55
56
  request,
56
57
  context,
57
58
  contextComposition,
59
+ storageCorpusVersionsAtRecallStart,
58
60
  query,
59
61
  mode,
60
62
  namespace,
@@ -321,6 +323,7 @@ export async function assembleRecallResponse(
321
323
  namespace: effectiveNamespace,
322
324
  context: effectiveContext,
323
325
  contextComposition: effectiveComposition,
326
+ storageCorpusVersionsAtRecallStart,
324
327
  ...(retrievalFailure ? { retrievalFailure } : {}),
325
328
  count: filterTags && filterTags.length > 0
326
329
  ? results.length
@@ -21,9 +21,11 @@ import { type BudgetDecision, type BudgetReservation, CrossNamespaceBudget, toBu
21
21
  import { lcmEvidenceIdentity } from "./lcm/evidence-identity.js";
22
22
  import { normalizeProjectionTags } from "./memory-projection-format.js";
23
23
  import { namespaceIdentityFromToken } from "./namespaces/identity.js";
24
- import { canReadNamespace, defaultNamespaceForPrincipal, recallNamespacesForPrincipal, resolvePrincipal } from "./namespaces/principal.js";
25
- import { expandScopeProfileReadNamespaces, resolveScopeProfilePlan } from "./namespaces/scope-profiles.js";
24
+ import { canReadNamespace, defaultNamespaceForPrincipal, resolvePrincipal } from "./namespaces/principal.js";
25
+ import { resolveScopeProfilePlan } from "./namespaces/scope-profiles.js";
26
+ import { resolveScopePlan } from "./scopes/scope-plan.js";
26
27
  import type { Orchestrator, RecallInvocationOptions } from "./orchestrator.js";
28
+ import { createRecallCorpusVersionCapture, mergeRecallCorpusVersions } from "./access-recall-corpus-versions.js";
27
29
  import { decideDisclosureEscalation } from "./recall-disclosure-escalation.js";
28
30
  import { assembleRecallResponse } from "./access-recall-response.js";
29
31
  import { coerceIncludedMemories, type LastRecallSnapshot } from "./recall-state.js";
@@ -57,6 +59,7 @@ export interface AccessRecallSurfaceDeps {
57
59
  query: string;
58
60
  sessionKey?: string;
59
61
  snapshot: RecallXraySnapshot;
62
+ storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }>;
60
63
  disclosure: RecallDisclosure;
61
64
  startedAt: number;
62
65
  requestedMode?: RecallPlanMode | "auto";
@@ -187,6 +190,7 @@ export class AccessRecallSurface {
187
190
  query: string;
188
191
  sessionKey?: string;
189
192
  snapshot: RecallXraySnapshot;
193
+ storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }>;
190
194
  disclosure: RecallDisclosure;
191
195
  startedAt: number;
192
196
  requestedMode?: RecallPlanMode | "auto";
@@ -290,6 +294,7 @@ export class AccessRecallSurface {
290
294
  sourcesUsed,
291
295
  disclosure: options.disclosure,
292
296
  budgetsApplied: snapshotForSerialization.budgetsApplied,
297
+ storageCorpusVersionsAtRecallStart: options.storageCorpusVersionsAtRecallStart,
293
298
  latencyMs: snapshotForSerialization.latencyMs,
294
299
  };
295
300
  }
@@ -732,29 +737,17 @@ export class AccessRecallSurface {
732
737
  codingContext: profileCodingContext,
733
738
  codingOverlay: profileCodingOverlay,
734
739
  });
740
+ const recallScopePlan = resolveScopePlan({
741
+ config: this.deps.orchestrator.config,
742
+ sessionKey: request.sessionKey,
743
+ namespace: namespaceOverride,
744
+ principalOverride: authenticatedPrincipal,
745
+ codingContext: profileCodingContext,
746
+ namespacesEnabled: resolveNamespaceCapabilities(this.deps.orchestrator.config).namespaces,
747
+ });
735
748
  // Skip budget checks for modes that never perform a cross-namespace read.
736
749
  const modeSkipsBudget = mode === "no_recall";
737
- // Derive the full set of namespaces the orchestrator will actually search.
738
- // When no explicit override is provided, `recallNamespacesForPrincipal()` may
739
- // expand to shared / policy-default namespaces. Budget must be checked
740
- // against every cross-namespace entry in the effective set so that omitting
741
- // `namespace` cannot bypass the limiter (Cursor/Codex review feedback).
742
- //
743
- const legacyRecallNamespaces = Array.isArray(this.deps.orchestrator.config.defaultRecallNamespaces)
744
- ? recallNamespacesForPrincipal(principal, this.deps.orchestrator.config)
745
- : [];
746
- const effectiveNamespaces = namespaceOverride
747
- ? [namespaceOverride]
748
- : profilePlan
749
- ? expandScopeProfileReadNamespaces({
750
- profilePlan,
751
- principalSelfNamespace: profilePlan.baseNamespace,
752
- config: this.deps.orchestrator.config,
753
- principal,
754
- codingOverlay: profileCodingOverlay,
755
- legacyRecallNamespaces,
756
- })
757
- : legacyRecallNamespaces;
750
+ const effectiveNamespaces = recallScopePlan.readNamespaces;
758
751
  const budgetPrincipalNamespace = profilePlan?.baseNamespace ?? principalNamespace;
759
752
  let budgetDecision: BudgetDecision;
760
753
  let willReserveBudget = false;
@@ -860,6 +853,7 @@ export class AccessRecallSurface {
860
853
  onContextComposition: (composition) => {
861
854
  contextComposition = composition;
862
855
  },
856
+ onRecallPlanResolved: createRecallCorpusVersionCapture(this.deps.orchestrator, request.abortSignal, (versions) => { storageCorpusVersionsAtRecallStart = mergeRecallCorpusVersions(storageCorpusVersionsAtRecallStart, versions); }, true),
863
857
  ...(authenticatedPrincipal ? { principalOverride: authenticatedPrincipal } : {}),
864
858
  ...(request.sourceConnector ? { sourceConnector: request.sourceConnector } : {}),
865
859
  ...(request.stateView !== undefined ? { stateView: request.stateView } : {}),
@@ -897,6 +891,7 @@ export class AccessRecallSurface {
897
891
  // operation — orchestrator.recall AND serialization / debug / response
898
892
  // construction — so ANY failure after the reserve releases the exact
899
893
  // budget entry (by token, review #4) instead of leaking it.
894
+ let storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }> = [];
900
895
  try {
901
896
  const context = await this.deps.orchestrator.recall(
902
897
  query,
@@ -907,6 +902,7 @@ export class AccessRecallSurface {
907
902
  request,
908
903
  context,
909
904
  contextComposition,
905
+ storageCorpusVersionsAtRecallStart,
910
906
  query,
911
907
  mode,
912
908
  namespace,
@@ -1063,6 +1059,7 @@ export class AccessRecallSurface {
1063
1059
  let recallStartedAt = Date.now();
1064
1060
 
1065
1061
  const recallSessionKey = request.sessionKey?.trim() || undefined;
1062
+ let storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }> = [];
1066
1063
  let xrayResponse: {
1067
1064
  snapshotFound: boolean;
1068
1065
  snapshot?: RecallXraySnapshot;
@@ -1084,6 +1081,7 @@ export class AccessRecallSurface {
1084
1081
  ? { budgetCharsOverride: budgetOverride }
1085
1082
  : {}),
1086
1083
  ...(mode !== undefined ? { mode } : {}),
1084
+ onRecallPlanResolved: createRecallCorpusVersionCapture(this.deps.orchestrator, request.abortSignal, (versions) => { storageCorpusVersionsAtRecallStart = mergeRecallCorpusVersions(storageCorpusVersionsAtRecallStart, versions); }, true),
1087
1085
  // When the caller supplies an authenticated principal, forward
1088
1086
  // it via the dedicated override channel so orchestrator-side
1089
1087
  // ACL decisions use the SAME principal the access-surface
@@ -1395,6 +1393,7 @@ export class AccessRecallSurface {
1395
1393
  startedAt: recallStartedAt,
1396
1394
  requestedMode: request.mode,
1397
1395
  normalizedMode: mode,
1396
+ storageCorpusVersionsAtRecallStart,
1398
1397
  ...(xrayRawExcerptNamespace
1399
1398
  ? { rawExcerptNamespace: xrayRawExcerptNamespace }
1400
1399
  : {}),
@@ -989,11 +989,19 @@ test("#2128: post-flush retained cleanup stops on abort or deadline", async (t)
989
989
  /replay extraction deadline exceeded \(retained_turn_cleanup\)/,
990
990
  );
991
991
  });
992
- test("#3140: a duration deadline reaches scope resolution and aborts it when it elapses", async () => {
992
+ test("#3140: a duration deadline reaches scope resolution and aborts it when it elapses", async (t) => {
993
993
  // Regression for issue #3140: `deadlineMs` is a BUDGET from now. The old
994
994
  // absolute-epoch reading compared a relative value (e.g. 30000) against
995
995
  // Date.now(), so a live-session force flush was rejected INSTANTLY with
996
996
  // `replay extraction deadline exceeded (scope_resolution)` before any work.
997
+ // The flush deadline is a real, unref'd timer in production
998
+ // (session-context.ts), so racing a 30ms wall-clock budget lets the event
999
+ // loop drain first under CI load: the flush promise then never settles and
1000
+ // the runner cancels the rest of the file. Mocked timers make the ordering
1001
+ // deterministic — the budget elapses only when ticked. The clock starts at
1002
+ // an epoch-scale `now` so a duration budget (30) is genuinely distinguished
1003
+ // from the old absolute-epoch reading the test guards against.
1004
+ t.mock.timers.enable({ apis: ["setTimeout", "Date"], now: 1_700_000_000_000 });
997
1005
  const probe = makeParityProbe({ namespacesEnabled: false } as Partial<PluginConfig>);
998
1006
  const service = new EngramAccessService(probe.orch);
999
1007
  let scopeResolutionStarted = false;
@@ -1005,19 +1013,25 @@ test("#3140: a duration deadline reaches scope resolution and aborts it when it
1005
1013
  return new Promise<never>(() => {});
1006
1014
  };
1007
1015
 
1008
- const started = Date.now();
1009
- await assert.rejects(
1010
- service.extractionForceFlush({
1011
- sessionKey: "duration-deadline-scope-resolution",
1012
- deadlineMs: 30,
1013
- }),
1014
- /scope_resolution/,
1015
- );
1016
+ const flush = service.extractionForceFlush({
1017
+ sessionKey: "duration-deadline-scope-resolution",
1018
+ deadlineMs: 30,
1019
+ });
1020
+ // Yield once so the stub is entered before the budget is spent; the mocked
1021
+ // clock does not move on its own.
1022
+ await new Promise<void>((resolve) => setImmediate(resolve));
1016
1023
  assert.equal(scopeResolutionStarted, true, "the budget lets scope resolution start");
1017
- assert.ok(
1018
- Date.now() - started >= 25,
1019
- "the flush waits out the budget instead of failing instantly",
1020
- );
1024
+ // Under mocked timers the budget cannot have elapsed yet, so the flush
1025
+ // must still be pending — proves the deadline does not fire before its
1026
+ // budget (#3140 regression: an absolute-epoch reading would reject
1027
+ // instantly with `scope_resolution` before the stub ran).
1028
+ const stillPending = Promise.race([
1029
+ flush.then(() => "rejected", () => "rejected"),
1030
+ new Promise<string>((resolve) => setImmediate(() => resolve("pending"))),
1031
+ ]);
1032
+ assert.equal(await stillPending, "pending");
1033
+ t.mock.timers.tick(30);
1034
+ await assert.rejects(flush, /scope_resolution/);
1021
1035
  assert.equal(probe.extractionForceFlushCalls.length, 0);
1022
1036
  });
1023
1037
 
@@ -1076,7 +1090,14 @@ test("#2206: abort during scope resolution cancels pre-resolution observe prepar
1076
1090
  assert.equal(probe.extractionCalls.length, 0);
1077
1091
  });
1078
1092
 
1079
- test("#2206: scope-resolution deadline cancels preparations by raw projectTag and cwd hints", async () => {
1093
+ test("#2206: scope-resolution deadline cancels preparations by raw projectTag and cwd hints", async (t) => {
1094
+ // The deadline budget is a real, unref'd timer in production
1095
+ // (session-context.ts), so a 1ms wall-clock budget can elapse BEFORE the
1096
+ // flush enters the blocked scope stub on a loaded runner (assertion then
1097
+ // sees flushScopeStarted === false), and a drained event loop can leave
1098
+ // the flush pending forever. Mocked timers pin the order: the stub is
1099
+ // entered first, the budget elapses only when ticked, and the observe tail
1100
+ // runs after timers are restored.
1080
1101
  const rawHintCases = [
1081
1102
  { projectTag: "Acme/Webshop" },
1082
1103
  { cwd: "/workspace/acme/webshop" },
@@ -1119,17 +1140,29 @@ test("#2206: scope-resolution deadline cancels preparations by raw projectTag an
1119
1140
  ...rawHintCase,
1120
1141
  }));
1121
1142
  await observeScopeStarted;
1122
- await assert.rejects(
1123
- service.extractionForceFlush({
1143
+ // Mock the clock only for the flush: the observe is already parked on
1144
+ // the gate, and its tail below needs the real clock back. A try/finally
1145
+ // makes sure a failing assertion cannot leak the mocked window or the
1146
+ // parked observe, which would otherwise reproduce the same
1147
+ // event-loop-drain cascade this PR fixes.
1148
+ t.mock.timers.enable({ apis: ["setTimeout", "Date"] });
1149
+ try {
1150
+ const flush = service.extractionForceFlush({
1124
1151
  sessionKey: "pi-geek:raw-hint-deadline",
1125
1152
  authenticatedPrincipal: "pi-geek",
1126
1153
  deadlineMs: 1,
1127
1154
  ...rawHintCase,
1128
- }),
1129
- /scope_resolution/,
1130
- );
1131
- assert.equal(flushScopeStarted, true);
1132
- releaseObserveScope();
1155
+ });
1156
+ // Yield once so the stub is entered before the budget is spent; the
1157
+ // mocked clock does not move on its own.
1158
+ await new Promise<void>((resolve) => setImmediate(resolve));
1159
+ assert.equal(flushScopeStarted, true);
1160
+ t.mock.timers.tick(1);
1161
+ await assert.rejects(flush, /scope_resolution/);
1162
+ } finally {
1163
+ t.mock.timers.reset();
1164
+ releaseObserveScope();
1165
+ }
1133
1166
  const response = await observe;
1134
1167
  assert.equal(response.extractionQueued, false);
1135
1168
  assert.equal(probe.extractionCalls.length, 0);
@@ -124,7 +124,7 @@ function makeRawExcerptProbe(options: {
124
124
  resolveSelfNamespace: (sk?: string) =>
125
125
  Orchestrator.prototype.resolveSelfNamespace.call(orch, sk),
126
126
  async getStorage() {
127
- return storage;
127
+ return { ...storage, getMemoryCorpusVersion: () => 0 };
128
128
  },
129
129
  lastRecall: new Map<string, LastRecallSnapshot>([
130
130
  [options.sessionKey, snapshot],
@@ -446,6 +446,8 @@ export interface EngramAccessRecallResponse {
446
446
  /** Request-local split used by adapters that must re-render a tighter prompt budget. */
447
447
  contextComposition?: RecallContextComposition;
448
448
  retrievalFailure?: { reason: "backend_unavailable"; detail: string };
449
+ /** Storage corpus sentinel values read immediately before retrieval; they do not attest to QMD index application. */
450
+ storageCorpusVersionsAtRecallStart?: Array<{ namespace: string; version: number | null }>;
449
451
  count: number;
450
452
  memoryIds: string[];
451
453
  results: EngramAccessMemorySummary[];
@@ -2034,6 +2036,7 @@ export class EngramAccessService extends SupportPassportAccessServiceBase {
2034
2036
  private async buildRecallResponseFromXraySnapshot(options: {
2035
2037
  query: string;
2036
2038
  sessionKey?: string;
2039
+ storageCorpusVersionsAtRecallStart: Array<{ namespace: string; version: number | null }>;
2037
2040
  snapshot: RecallXraySnapshot;
2038
2041
  disclosure: RecallDisclosure;
2039
2042
  startedAt: number;
@@ -1184,6 +1184,7 @@ const RECALL_ENH_FIELD_TO_FLAG: Record<keyof RecallEnhancementCapabilitySet, str
1184
1184
  responseGuidanceRecall: "responseGuidanceRecallEnabled",
1185
1185
  eventOrderRecall: "eventOrderRecallEnabled",
1186
1186
  reinforcementRecallBoost: "reinforcementRecallBoostEnabled",
1187
+ outcomeBoost: "outcomeBoostEnabled",
1187
1188
  recallPlannerTelemetry: "recallPlannerTelemetryEnabled",
1188
1189
  peerProfileRecall: "peerProfileRecallEnabled",
1189
1190
  graphAssistShadowEval: "graphAssistShadowEvalEnabled",
@@ -1031,14 +1031,9 @@ export function resolveRecallAuxiliaryCapabilities(config: RecallAuxiliaryConfig
1031
1031
  }
1032
1032
 
1033
1033
  // ---------------------------------------------------------------------------
1034
- // RecallEnhancement capability set (issue #1523 batch 9).
1035
- //
1036
- // These 24 flags gate recall enrichment, memory reconstruction, entity
1037
- // relationships, causal trajectory recall, CMC retrieval, and related
1038
- // enhancement paths. Read sites span orchestrator, access-service, graph-recall,
1039
- // and CLI research-status commands. All flags are non-optional booleans on
1040
- // PluginConfig (defaults resolved at the parse boundary), so the projection
1041
- // is a pure pass-through.
1034
+ // RecallEnhancement capability set (issue #1523 batch 9, outcome prior #1958).
1035
+ // Gates recall enrichment and related paths. Flags are booleans on PluginConfig
1036
+ // (defaults resolved at parse), so the projection is a pure pass-through.
1042
1037
  // ---------------------------------------------------------------------------
1043
1038
 
1044
1039
  /**
@@ -1051,6 +1046,7 @@ export interface RecallEnhancementCapabilitySet {
1051
1046
  readonly responseGuidanceRecall: boolean;
1052
1047
  readonly eventOrderRecall: boolean;
1053
1048
  readonly reinforcementRecallBoost: boolean;
1049
+ readonly outcomeBoost: boolean;
1054
1050
  readonly recallPlannerTelemetry: boolean;
1055
1051
  readonly peerProfileRecall: boolean;
1056
1052
  readonly graphAssistShadowEval: boolean;
@@ -1081,6 +1077,7 @@ export type RecallEnhancementConfigProjection = Pick<
1081
1077
  | "responseGuidanceRecallEnabled"
1082
1078
  | "eventOrderRecallEnabled"
1083
1079
  | "reinforcementRecallBoostEnabled"
1080
+ | "outcomeBoostEnabled"
1084
1081
  | "recallPlannerTelemetryEnabled"
1085
1082
  | "peerProfileRecallEnabled"
1086
1083
  | "graphAssistShadowEvalEnabled"
@@ -1111,6 +1108,7 @@ export function resolveRecallEnhancementCapabilities(config: RecallEnhancementCo
1111
1108
  responseGuidanceRecall: config.responseGuidanceRecallEnabled,
1112
1109
  eventOrderRecall: config.eventOrderRecallEnabled,
1113
1110
  reinforcementRecallBoost: config.reinforcementRecallBoostEnabled,
1111
+ outcomeBoost: config.outcomeBoostEnabled,
1114
1112
  recallPlannerTelemetry: config.recallPlannerTelemetryEnabled,
1115
1113
  peerProfileRecall: config.peerProfileRecallEnabled,
1116
1114
  graphAssistShadowEval: config.graphAssistShadowEvalEnabled === true,
package/src/config.ts CHANGED
@@ -44,6 +44,7 @@ import {
44
44
  parseStandingBlockMaxChars,
45
45
  } from "./standing-memory-block.js";
46
46
  import { parseDirectorySidecarsEnabled } from "./directory-sidecars.js";
47
+ import { parseOutcomeBoostWeight } from "./rerank-outcome.js";
47
48
  import { parseRecognitionIndexMaxEntries, parseRecallRecognitionTier } from "./recall-recognition-tier.js";
48
49
  import { parseRecallConcurrencyConfig } from "./recall-concurrency-config.js";
49
50
  import { parseExtractionFields } from "./extraction-span-config.js";
@@ -2622,6 +2623,8 @@ export function parseConfig(
2622
2623
  }
2623
2624
  return n;
2624
2625
  })(),
2626
+ outcomeBoostEnabled: coerceBool(cfg.outcomeBoostEnabled) ?? false,
2627
+ outcomeBoostWeight: parseOutcomeBoostWeight(cfg.outcomeBoostWeight),
2625
2628
  // Async peer profile reasoner (issue #679 PR 2/5). Defaults to
2626
2629
  // `false` (opt-in) per Gotchas #30/#48 — least-privileged default.
2627
2630
  // `coerceBool` handles "true"/"1"/"yes"/"on" CLI strings (Gotcha
package/src/index.ts CHANGED
@@ -393,7 +393,7 @@ export { auditMemoryStore, auditScreenProfile, formatAuditMemoryReport, type Aud
393
393
  // Access layer (HTTP + MCP + schema validation)
394
394
  // ---------------------------------------------------------------------------
395
395
 
396
- export { EngramAccessService, EngramAccessInputError } from "./access-service.js";
396
+ export { EngramAccessService, EngramAccessInputError, type EngramAccessRecallResponse } from "./access-service.js";
397
397
  export {
398
398
  EngramAccessHttpServer,
399
399
  type RemnicAdminConfigPatch,
@@ -199,6 +199,7 @@ export interface RecallInvocationOptions {
199
199
  namespace?: string;
200
200
  topK?: number;
201
201
  mode?: RecallPlanMode;
202
+ onRecallPlanResolved?: (mode: RecallPlanMode, readNamespaces: readonly string[]) => void | Promise<void>;
202
203
  abortSignal?: AbortSignal;
203
204
  /** Server-resolved identity of the connector performing this recall. */
204
205
  sourceConnector?: string;
@@ -689,7 +690,6 @@ export function buildCompressionGuidelinesMarkdown(
689
690
  return buildCompressionGuidelinesMarkdownV2(events, generatedAtIso);
690
691
  }
691
692
 
692
-
693
693
  export function applyQueryAwareCandidateFilter(
694
694
  candidates: QmdSearchResult[],
695
695
  candidatePaths: Set<string> | null,
@@ -19,7 +19,7 @@ import { type RecallInvocationOptions, abortRecallError } from "./orchestrator-h
19
19
  import { ProfilingCollector } from "../profiling.js";
20
20
  import { trustResultFor, type TrustStageResultItem } from "../trust-score-stage.js";
21
21
  import type { RecallResultFormatter } from "./recall-result-formatter.js";
22
- import type { IdentityInjectionMode, PluginConfig, QmdSearchResult } from "../types.js";
22
+ import type { IdentityInjectionMode, PluginConfig, QmdSearchResult, RecallPlanMode } from "../types.js";
23
23
  import { stateViewPacketActive } from "../recall-state-view-anchors.js";
24
24
  import { resultStateViewKey, stateViewPacketKeys } from "../recall-state-view.js";
25
25
  import { applyRecallStateViews } from "../recall-state-view-wire.js";
@@ -163,11 +163,16 @@ export class RecallEntryCoordinator {
163
163
  options.budgetCharsOverride >= 0
164
164
  ? options.budgetCharsOverride
165
165
  : this.deps.config.recallBudgetChars;
166
- if (this.deps.config.recallStandingBlock && !namespacesEnabled && standingBudget !== 0 && !options.asOf) {
166
+ const shouldReadStandingBlock =
167
+ this.deps.config.recallStandingBlock && !namespacesEnabled && standingBudget !== 0 && !options.asOf;
168
+ if (shouldReadStandingBlock) {
167
169
  try {
168
- const memories = await this.deps.storage.readAllMemories({
169
- abortSignal: abortController.signal,
170
- });
170
+ await options.onRecallPlanResolved?.("no_recall", [this.deps.config.defaultNamespace]);
171
+ } catch (err) {
172
+ log.warn(`standing-memory plan callback failed: ${err}`);
173
+ }
174
+ try {
175
+ const memories = await this.deps.storage.readAllMemories({ abortSignal: abortController.signal });
171
176
  standingText = renderStandingMemoryBlock(
172
177
  this.deps.config,
173
178
  memoriesToStandingEntries(memories, { requestingConnector: options.sourceConnector }),
@@ -176,25 +181,36 @@ export class RecallEntryCoordinator {
176
181
  log.warn(`standing memory block skipped: ${err}`);
177
182
  }
178
183
  }
184
+ let innerBudget = options.budgetCharsOverride;
179
185
  const innerObserver = options.onContextComposition;
180
- const innerBudget =
181
- standingText.length > 0 && standingBudget && standingBudget > 0
182
- ? Math.max(0, standingBudget - standingText.length - 2)
183
- : options.budgetCharsOverride;
184
- const recallOptions = {
186
+ let recallOptions: RecallInvocationOptions;
187
+ recallOptions = {
185
188
  ...options,
186
189
  abortSignal: abortController.signal,
187
190
  budgetCharsOverride: innerBudget,
191
+ onRecallPlanResolved: options.onRecallPlanResolved || shouldReadStandingBlock
192
+ ? async (mode: RecallPlanMode, readNamespaces: readonly string[]) => {
193
+ const versionNamespaces =
194
+ mode === "no_recall" && !shouldReadStandingBlock
195
+ ? []
196
+ : shouldReadStandingBlock && !readNamespaces.includes(this.deps.config.defaultNamespace)
197
+ ? [...readNamespaces, this.deps.config.defaultNamespace]
198
+ : readNamespaces;
199
+ await options.onRecallPlanResolved?.(mode, versionNamespaces);
200
+ innerBudget = standingText.length > 0 && standingBudget > 0
201
+ ? Math.max(0, standingBudget - standingText.length - 2)
202
+ : options.budgetCharsOverride;
203
+ recallOptions.budgetCharsOverride = innerBudget;
204
+ }
205
+ : undefined,
188
206
  onContextComposition:
189
- standingText.length > 0
207
+ shouldReadStandingBlock
190
208
  ? (composition: RecallContextComposition) =>
191
209
  innerObserver?.({
192
210
  ...composition,
193
- context: prefixStandingMemoryBlock(
194
- composition.context ?? "",
195
- standingText,
196
- standingBudget,
197
- ),
211
+ context: standingText.length > 0
212
+ ? prefixStandingMemoryBlock(composition.context ?? "", standingText, standingBudget)
213
+ : composition.context,
198
214
  })
199
215
  : innerObserver,
200
216
  };
@@ -344,8 +344,7 @@ export class RecallInternalCoordinator {
344
344
  );
345
345
  }
346
346
  this.deps.profiler.endSpan("planning", profileTraceId);
347
- const recallMode: RecallPlanMode =
348
- requestedMode ?? recallDecision.effectiveMode;
347
+ const recallMode: RecallPlanMode = requestedMode ?? recallDecision.effectiveMode;
349
348
  const queryIntent = inferIntentFromText(retrievalQuery);
350
349
  const qmdSearchOptions =
351
350
  this.deps.buildConfiguredQmdSearchOptions(retrievalQuery);
@@ -467,6 +466,7 @@ export class RecallInternalCoordinator {
467
466
  scopeProfilePlan,
468
467
  lcmReadSessionIds,
469
468
  } = scopePlan;
469
+ await options.onRecallPlanResolved?.(recallMode, recallNamespaces);
470
470
  // `firstNonEmptyLcmRead`: query the ordered LCM read key set, return the
471
471
  // FIRST non-empty result (#1505). The query-SCORED sections no longer use
472
472
  // it — they MERGE candidates across every authorized key (a weak primary
@@ -58,6 +58,7 @@ import {
58
58
  memoryMapKey,
59
59
  resultHasKey,
60
60
  } from "../recall-memory-map.js";
61
+ import { applyOutcomePriorScores, outcomePriorBoostActive } from "../rerank-outcome.js";
61
62
  import { type UtilityRuntimeValues, applyUtilityRankingRuntimeDelta } from "../utility-runtime.js";
62
63
  import {
63
64
  lifecycleRecallScoreAdjustment,
@@ -1710,6 +1711,8 @@ export class RecallSearchPipelineCoordinator {
1710
1711
  boosted.push({ ...r, score });
1711
1712
  }
1712
1713
 
1714
+ if (outcomePriorBoostActive(this.deps.config)) applyOutcomePriorScores(boosted, memoryByPath, this.deps.config);
1715
+
1713
1716
  // Re-sort by boosted score
1714
1717
  return boosted.sort((a, b) => b.score - a.score);
1715
1718
  }
@@ -8,9 +8,19 @@ import { parseConfig } from "./config.js";
8
8
  import { Orchestrator } from "./orchestrator.js";
9
9
  import { NoopSearchBackend } from "./search/noop-backend.js";
10
10
 
11
+ /**
12
+ * Watchdog for startup lifecycle awaits. This is a HANG guard, not a speed
13
+ * budget: a real Orchestrator.initialize() does real fs/sqlite discovery and
14
+ * can take well over a second on a loaded CI runner (a merge to main failed
15
+ * its shard when initialize settled ~40ms after the old 1250ms deadline had
16
+ * already resolved), and the discovery paths can block the loop so even
17
+ * in-file timers stall meanwhile. The deadline only needs to fire when the
18
+ * awaited lifecycle genuinely never settles, so keep it far above any
19
+ * legitimate startup cost.
20
+ */
11
21
  async function withTestDeadline<T>(
12
22
  promise: Promise<T>,
13
- timeoutMs = 1_250,
23
+ timeoutMs = 10_000,
14
24
  ): Promise<T | "deadline"> {
15
25
  let timer: NodeJS.Timeout | undefined;
16
26
  const deadline = new Promise<"deadline">((resolve) => {
@@ -0,0 +1,16 @@
1
+ /**
2
+ * H1 outcome-prior recall blend (issue #1958).
3
+ *
4
+ * Both fields default off/zero. Recall ranking stays on the existing
5
+ * boost path unless `outcomeBoostEnabled` is true and `outcomeBoostWeight`
6
+ * is greater than 0.
7
+ */
8
+ export interface OutcomeBoostConfig {
9
+ /** Opt-in gate. Default false. */
10
+ outcomeBoostEnabled: boolean;
11
+ /**
12
+ * Blend weight in [0, 1]. Absent config parses as 0, which does not
13
+ * change scores. Invalid values throw.
14
+ */
15
+ outcomeBoostWeight: number;
16
+ }