@remnic/core 10.0.165 → 10.0.167

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 (430) hide show
  1. package/dist/access-admin-ops-surface.js +129 -128
  2. package/dist/access-authorization-probe.js +4 -4
  3. package/dist/access-boundary.js +3 -3
  4. package/dist/access-cli.d.ts.map +1 -1
  5. package/dist/access-cli.js +145 -138
  6. package/dist/access-cli.js.map +1 -1
  7. package/dist/access-coding-context-resolution.d.ts +37 -0
  8. package/dist/access-coding-context-resolution.d.ts.map +1 -1
  9. package/dist/access-coding-context-resolution.js +48 -4
  10. package/dist/access-errors.d.ts +5 -0
  11. package/dist/access-errors.d.ts.map +1 -1
  12. package/dist/access-errors.js +3 -1
  13. package/dist/access-extraction-force-flush-preempt.js +129 -128
  14. package/dist/access-extraction-force-flush.js +129 -128
  15. package/dist/access-http-briefing.js +129 -128
  16. package/dist/access-http-query.js +129 -128
  17. package/dist/access-http.d.ts.map +1 -1
  18. package/dist/access-http.js +129 -128
  19. package/dist/access-identity-continuity-surface.js +129 -128
  20. package/dist/access-lcm-surface.js +129 -128
  21. package/dist/access-mcp.js +129 -128
  22. package/dist/access-memory-search-fanout.js +2 -2
  23. package/dist/access-namespace-preflight.js +4 -4
  24. package/dist/access-observe-transcript.js +3 -2
  25. package/dist/access-observe-write-category.js +9 -9
  26. package/dist/access-observe-write-surface.d.ts +1 -0
  27. package/dist/access-observe-write-surface.d.ts.map +1 -1
  28. package/dist/access-observe-write-surface.js +129 -128
  29. package/dist/access-offline-manifest.js +9 -8
  30. package/dist/access-operations-batch.js +129 -128
  31. package/dist/access-operations.d.ts +1 -1
  32. package/dist/access-operations.js +129 -128
  33. package/dist/access-recall-concurrency.d.ts +3 -16
  34. package/dist/access-recall-concurrency.d.ts.map +1 -1
  35. package/dist/access-recall-concurrency.js +129 -128
  36. package/dist/access-recall-corpus-versions.d.ts +4 -1
  37. package/dist/access-recall-corpus-versions.d.ts.map +1 -1
  38. package/dist/access-recall-corpus-versions.js +4 -1
  39. package/dist/access-recall-diagnostics.js +3 -3
  40. package/dist/access-recall-response.d.ts.map +1 -1
  41. package/dist/access-recall-response.js +129 -128
  42. package/dist/access-recall-surface.d.ts +1 -0
  43. package/dist/access-recall-surface.d.ts.map +1 -1
  44. package/dist/access-recall-surface.js +129 -128
  45. package/dist/access-schema.d.ts +1 -0
  46. package/dist/access-schema.d.ts.map +1 -1
  47. package/dist/access-schema.js +2 -2
  48. package/dist/access-service.d.ts +3 -15
  49. package/dist/access-service.d.ts.map +1 -1
  50. package/dist/access-service.js +131 -128
  51. package/dist/access-surface-catalog.js +5 -5
  52. package/dist/access-token-capabilities.js +2 -2
  53. package/dist/active-recall.js +21 -21
  54. package/dist/artifact-search.js +2 -2
  55. package/dist/auto-sync-L3M4RKJD.js +1 -1
  56. package/dist/briefing.js +19 -19
  57. package/dist/buffer-add-turns-bounded.js +2 -2
  58. package/dist/buffer-turn-helpers.d.ts.map +1 -1
  59. package/dist/buffer-turn-helpers.js +1 -1
  60. package/dist/buffer.js +11 -10
  61. package/dist/calibration.js +2 -2
  62. package/dist/capsule-import-gate.js +2 -2
  63. package/dist/causal-consolidation.js +20 -20
  64. package/dist/{chunk-5V3IBSVB.js → chunk-22V3CMIW.js} +4 -4
  65. package/dist/{chunk-7IWRLYFJ.js → chunk-2TJSGIKT.js} +2 -2
  66. package/dist/{chunk-V6M6N3EE.js → chunk-333SBFXB.js} +2 -2
  67. package/dist/{chunk-XBW7U7GM.js → chunk-3PNJZTDV.js} +5 -2
  68. package/dist/chunk-3PNJZTDV.js.map +1 -0
  69. package/dist/{chunk-XE4UYWW3.js → chunk-3YOX2BQD.js} +3 -3
  70. package/dist/{chunk-XEBNSY7N.js → chunk-4D2EY4WM.js} +2 -2
  71. package/dist/{chunk-5HFCXTGY.js → chunk-4D77BI3J.js} +29 -189
  72. package/dist/chunk-4D77BI3J.js.map +1 -0
  73. package/dist/{chunk-LPV72KRQ.js → chunk-4IMOGAFF.js} +3 -3
  74. package/dist/{chunk-QBREZ4QL.js → chunk-4L25GAYL.js} +2 -2
  75. package/dist/{chunk-HADD45AR.js → chunk-4WCLZBM2.js} +2 -2
  76. package/dist/{chunk-B3GKQ6DU.js → chunk-5MA6ZQ4Z.js} +2 -2
  77. package/dist/{chunk-V4ASAWRP.js → chunk-5PUZV73Z.js} +3 -3
  78. package/dist/{chunk-3QLAOYBL.js → chunk-5QDTZIGH.js} +3 -3
  79. package/dist/{chunk-WXDTOE6F.js → chunk-5VMRM2X3.js} +2 -2
  80. package/dist/{chunk-VE23DIBH.js → chunk-6QWFZ3X5.js} +2 -2
  81. package/dist/{chunk-SDGD6MYV.js → chunk-7F7HRJI2.js} +2 -2
  82. package/dist/{chunk-QFPNWSVH.js → chunk-7OCKK5M5.js} +6 -6
  83. package/dist/{chunk-WAJL65KW.js → chunk-7VIJUZYW.js} +3 -3
  84. package/dist/{chunk-EI2M2CFJ.js → chunk-A5UOREWD.js} +3 -3
  85. package/dist/{chunk-32CA7B6L.js → chunk-AQZL7JBZ.js} +2 -2
  86. package/dist/{chunk-EDA6CDBT.js → chunk-AVWOULJH.js} +2 -2
  87. package/dist/{chunk-4HKK5HUI.js → chunk-B3M56D2A.js} +2 -2
  88. package/dist/{chunk-YAVIBVCU.js → chunk-BFPQJNFZ.js} +5 -5
  89. package/dist/{chunk-YAVIBVCU.js.map → chunk-BFPQJNFZ.js.map} +1 -1
  90. package/dist/{chunk-SRN5M4LQ.js → chunk-BKTCVXMK.js} +4 -4
  91. package/dist/{chunk-TXVTNDQT.js → chunk-BPCR5DZP.js} +2 -2
  92. package/dist/{chunk-6S4DM53Y.js → chunk-C5QYWM6F.js} +6 -6
  93. package/dist/chunk-CKELO7Q6.js +113 -0
  94. package/dist/chunk-CKELO7Q6.js.map +1 -0
  95. package/dist/{chunk-IEB6XYW6.js → chunk-CKZWLAHN.js} +2 -2
  96. package/dist/{chunk-JVIWVJ2A.js → chunk-CUPILBIP.js} +3 -3
  97. package/dist/{chunk-274UY54Z.js → chunk-DFZYZOLH.js} +3 -3
  98. package/dist/{chunk-FSI45NUK.js → chunk-EZG54YDS.js} +2 -2
  99. package/dist/{chunk-7ZFB4VZS.js → chunk-FFWFFAP3.js} +2 -2
  100. package/dist/{chunk-22VXXA67.js → chunk-FGT7CUYZ.js} +2 -2
  101. package/dist/{chunk-Z3SXC3MP.js → chunk-FOTFLHBN.js} +2 -2
  102. package/dist/{chunk-RH6XWXMA.js → chunk-FRYCXXTB.js} +3 -3
  103. package/dist/{chunk-B377OKUP.js → chunk-G64WYD2S.js} +4 -4
  104. package/dist/{chunk-JJEQRSYU.js → chunk-GBSXTTLP.js} +2 -2
  105. package/dist/{chunk-2YODOG2O.js → chunk-GIL2M2OI.js} +3 -3
  106. package/dist/{chunk-YVRQ5JRA.js → chunk-GYOKVJPB.js} +14 -8
  107. package/dist/chunk-GYOKVJPB.js.map +1 -0
  108. package/dist/{chunk-ARJ3KCX4.js → chunk-HDLNSDLK.js} +2 -2
  109. package/dist/{chunk-VXUO5JZC.js → chunk-HDWISXFH.js} +6 -6
  110. package/dist/{chunk-RNFMFC37.js → chunk-IDYYGOOQ.js} +28 -1
  111. package/dist/chunk-IDYYGOOQ.js.map +1 -0
  112. package/dist/{chunk-IHOKB3L3.js → chunk-IE2ZLO3R.js} +785 -515
  113. package/dist/chunk-IE2ZLO3R.js.map +1 -0
  114. package/dist/{chunk-EZ47HOJ6.js → chunk-IXI6S2VJ.js} +4 -4
  115. package/dist/{chunk-VXMWTRQX.js → chunk-J74YOBB3.js} +4 -4
  116. package/dist/{chunk-AMW3IDCO.js → chunk-JFMMEHVG.js} +2 -2
  117. package/dist/{chunk-XKZBZOKV.js → chunk-JIF22AXI.js} +18 -1
  118. package/dist/chunk-JIF22AXI.js.map +1 -0
  119. package/dist/{chunk-JTSSSR4L.js → chunk-KIUFT2WZ.js} +3 -3
  120. package/dist/{chunk-L6BLTV4D.js → chunk-L7SEYUHS.js} +2 -2
  121. package/dist/{chunk-WRAK5LLB.js → chunk-LPUEBFX2.js} +3 -3
  122. package/dist/{chunk-DBVSU3HE.js → chunk-LVGTH6IQ.js} +9 -9
  123. package/dist/{chunk-33VVVP57.js → chunk-MEVBSF6T.js} +4 -1
  124. package/dist/chunk-MEVBSF6T.js.map +1 -0
  125. package/dist/{chunk-CJCTKL6Y.js → chunk-MGKCKY7X.js} +4 -1
  126. package/dist/chunk-MGKCKY7X.js.map +1 -0
  127. package/dist/{chunk-SOGOHLWN.js → chunk-N7AIFTSH.js} +1 -1
  128. package/dist/chunk-N7AIFTSH.js.map +1 -0
  129. package/dist/chunk-O3XGASU5.js +197 -0
  130. package/dist/chunk-O3XGASU5.js.map +1 -0
  131. package/dist/{chunk-OGBQMY46.js → chunk-O544TUJO.js} +2 -2
  132. package/dist/{chunk-TFNZXOXK.js → chunk-OAQRZ4SV.js} +2 -2
  133. package/dist/{chunk-IEEV27BC.js → chunk-OO2HEUZ4.js} +2 -2
  134. package/dist/{chunk-YMC4AYJK.js → chunk-OWM2VWNX.js} +10 -10
  135. package/dist/{chunk-4LPTSB5V.js → chunk-PFLN6TTW.js} +2 -2
  136. package/dist/{chunk-YOR5QBEU.js → chunk-QFTK6EDM.js} +4 -4
  137. package/dist/{chunk-A2WFUMUN.js → chunk-QKDXO4FD.js} +4 -4
  138. package/dist/{chunk-Y7HLGKKU.js → chunk-QLQUAVVP.js} +4 -4
  139. package/dist/{chunk-MUMQWCE2.js → chunk-QPFM6DHY.js} +2 -2
  140. package/dist/{chunk-YWPCDR3I.js → chunk-QVXEXGIM.js} +3 -3
  141. package/dist/{chunk-UPE7TJWN.js → chunk-QWWHYBPT.js} +2 -2
  142. package/dist/{chunk-NZHZQGLB.js → chunk-QXTKN25V.js} +2 -2
  143. package/dist/{chunk-OAGTKS73.js → chunk-RFLC6PKQ.js} +2 -2
  144. package/dist/{chunk-ZRLTQ2Y7.js → chunk-RO5EGRAI.js} +2 -2
  145. package/dist/{chunk-5D4NBANY.js → chunk-SIONKXLU.js} +2 -2
  146. package/dist/{chunk-6XTUZKCZ.js → chunk-SMDZTJ2D.js} +2 -2
  147. package/dist/{chunk-OFSAKEZB.js → chunk-T4BT4FQN.js} +2 -2
  148. package/dist/{chunk-IC35ZYLM.js → chunk-TAD6QMMD.js} +4 -4
  149. package/dist/{chunk-EAHNSQ7H.js → chunk-TB6VFEHQ.js} +2 -2
  150. package/dist/{chunk-6ARSFTLD.js → chunk-TNRGWJYT.js} +2 -2
  151. package/dist/{chunk-6TPWIPE3.js → chunk-U3BCW7GX.js} +3 -3
  152. package/dist/{chunk-JCAMHTS2.js → chunk-UBG65KEY.js} +7 -5
  153. package/dist/{chunk-JCAMHTS2.js.map → chunk-UBG65KEY.js.map} +1 -1
  154. package/dist/{chunk-CGOPDXLK.js → chunk-UMEUU66X.js} +2 -2
  155. package/dist/{chunk-5LTXYM7D.js → chunk-UYIBNDQE.js} +2 -2
  156. package/dist/{chunk-UGQEJWR3.js → chunk-VHXRLD6S.js} +2 -2
  157. package/dist/{chunk-WJ6S54ES.js → chunk-VOLTQNAP.js} +2 -2
  158. package/dist/{chunk-SBU5GDOT.js → chunk-VRHY7Y5A.js} +7 -7
  159. package/dist/{chunk-E5RJPLNL.js → chunk-W7N7NWG5.js} +3 -3
  160. package/dist/{chunk-UPWOMMVU.js → chunk-WECKZ3KT.js} +7 -7
  161. package/dist/{chunk-PCUDFWX5.js → chunk-WEFFO2MJ.js} +2 -2
  162. package/dist/{chunk-QCP75JGO.js → chunk-WQUGCOKF.js} +5 -5
  163. package/dist/{chunk-FKBGK3NC.js → chunk-WWUQ6CP3.js} +2 -2
  164. package/dist/{chunk-KR6PEAM4.js → chunk-X67XNZ64.js} +8 -8
  165. package/dist/{chunk-UYHDMCY2.js → chunk-XUVCQ4YZ.js} +2 -2
  166. package/dist/{chunk-7IJ2H43M.js → chunk-YY57TRKN.js} +2 -2
  167. package/dist/{chunk-AU6AEUFD.js → chunk-YYXYZM2I.js} +2 -2
  168. package/dist/{chunk-3FBAEPCU.js → chunk-ZDUE44CC.js} +2 -2
  169. package/dist/{chunk-PRE7R3RQ.js → chunk-ZQUOUPP3.js} +12 -3
  170. package/dist/chunk-ZQUOUPP3.js.map +1 -0
  171. package/dist/{chunk-RDO6AMDL.js → chunk-ZWDDY4WF.js} +2 -2
  172. package/dist/{chunk-QASTQVGK.js → chunk-ZX546Y3Y.js} +2 -2
  173. package/dist/chunk-ZX546Y3Y.js.map +1 -0
  174. package/dist/cli.js +129 -128
  175. package/dist/coding/architecture-surfaces.d.ts +0 -24
  176. package/dist/coding/architecture-surfaces.d.ts.map +1 -1
  177. package/dist/coding/codegraph-surfaces.d.ts.map +1 -1
  178. package/dist/coding/export-okf-codegraph.js +51 -24
  179. package/dist/coding/export-okf-codegraph.js.map +1 -1
  180. package/dist/coding/git-context.d.ts +23 -0
  181. package/dist/coding/git-context.d.ts.map +1 -1
  182. package/dist/coding/git-context.js +31 -0
  183. package/dist/coding/git-context.js.map +1 -0
  184. package/dist/coding/session-delta-surfaces.d.ts +0 -23
  185. package/dist/coding/session-delta-surfaces.d.ts.map +1 -1
  186. package/dist/compounding/engine.js +20 -20
  187. package/dist/config.js +21 -21
  188. package/dist/connectors/codex-materialize-runner.js +19 -19
  189. package/dist/connectors/droid-mcp.d.ts +4 -3
  190. package/dist/connectors/droid-mcp.d.ts.map +1 -1
  191. package/dist/connectors/index.js +23 -23
  192. package/dist/convergence-refresh.js +21 -21
  193. package/dist/conversation-index/backend.js +2 -2
  194. package/dist/corpus-watermark.js +23 -23
  195. package/dist/deep-recall-config.js +2 -2
  196. package/dist/deep-recall-http-glue.js +4 -4
  197. package/dist/entity-recall-cancellation.js +2 -2
  198. package/dist/entity-recall-reads.js +3 -3
  199. package/dist/entity-retrieval.js +21 -21
  200. package/dist/explicit-capture.js +129 -128
  201. package/dist/external-wiki-access.js +4 -4
  202. package/dist/extraction-judge.js +1 -1
  203. package/dist/extraction.js +31 -30
  204. package/dist/harmonic-retrieval.js +19 -19
  205. package/dist/index.js +208 -206
  206. package/dist/local-llm.js +2 -2
  207. package/dist/location/index.js +21 -21
  208. package/dist/maintenance/memory-governance.js +19 -19
  209. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +19 -19
  210. package/dist/maintenance/rebuild-memory-projection-runner.js +21 -21
  211. package/dist/maintenance/rebuild-memory-projection.js +20 -20
  212. package/dist/memory-browse-http-glue.js +2 -2
  213. package/dist/memory-browse-operations.js +4 -4
  214. package/dist/memory-browse.js +6 -6
  215. package/dist/memory-controller.d.ts +8 -0
  216. package/dist/memory-controller.d.ts.map +1 -1
  217. package/dist/memory-controller.js +1 -1
  218. package/dist/namespaces/migrate.js +20 -20
  219. package/dist/namespaces/search.js +8 -8
  220. package/dist/namespaces/storage.js +19 -19
  221. package/dist/offline-sync-impression-drain.js +8 -7
  222. package/dist/operator-doctor-corpus.js +26 -26
  223. package/dist/operator-doctor-replica.js +4 -4
  224. package/dist/operator-toolkit.js +35 -34
  225. package/dist/orchestration/backlog-scheduler.js +130 -129
  226. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  227. package/dist/orchestration/buffer-drain-runner.js +130 -129
  228. package/dist/orchestration/episodic-context-section.d.ts +3 -2
  229. package/dist/orchestration/episodic-context-section.d.ts.map +1 -1
  230. package/dist/orchestration/maintenance.js +34 -33
  231. package/dist/orchestration/orchestrator-helpers.d.ts +10 -0
  232. package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -1
  233. package/dist/orchestration/orchestrator-init.d.ts +12 -13
  234. package/dist/orchestration/orchestrator-init.d.ts.map +1 -1
  235. package/dist/orchestration/recall-entry.d.ts.map +1 -1
  236. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  237. package/dist/orchestration/session-context.d.ts +5 -1
  238. package/dist/orchestration/session-context.d.ts.map +1 -1
  239. package/dist/orchestration/startup-search-sync.d.ts +73 -0
  240. package/dist/orchestration/startup-search-sync.d.ts.map +1 -0
  241. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  242. package/dist/orchestrator.d.ts +4 -1
  243. package/dist/orchestrator.d.ts.map +1 -1
  244. package/dist/orchestrator.js +129 -128
  245. package/dist/qmd-daemon-session.js +2 -2
  246. package/dist/qmd.js +3 -3
  247. package/dist/recall-explain-renderer.js +3 -3
  248. package/dist/recall-navigate-access.js +2 -2
  249. package/dist/recall-navigate-disclosure.js +2 -2
  250. package/dist/recall-navigate.js +2 -2
  251. package/dist/recall-navigation-http-glue.js +2 -2
  252. package/dist/recall-navigation-operations.js +4 -4
  253. package/dist/recall-navigation.js +129 -128
  254. package/dist/recall-qos.d.ts +26 -0
  255. package/dist/recall-qos.d.ts.map +1 -1
  256. package/dist/recall-qos.js +9 -1
  257. package/dist/recall-state-view-admission.js +6 -6
  258. package/dist/recall-why-service.js +6 -6
  259. package/dist/recall-xray-cli.js +4 -4
  260. package/dist/recall-xray-renderer.js +3 -3
  261. package/dist/recall-xray.js +2 -2
  262. package/dist/relay/mission.d.ts +3 -3
  263. package/dist/replica-divergence.js +3 -3
  264. package/dist/resume-bundles.js +23 -23
  265. package/dist/search/factory.js +7 -7
  266. package/dist/search/index.js +9 -9
  267. package/dist/semantic-consolidation.js +20 -20
  268. package/dist/semantic-rule-promotion.js +19 -19
  269. package/dist/semantic-rule-verifier.js +19 -19
  270. package/dist/source-agent-qualifier.js +29 -28
  271. package/dist/standup/build.js +20 -20
  272. package/dist/storage/buffer-drain-claims.js +2 -2
  273. package/dist/storage/buffer-session-files.js +2 -2
  274. package/dist/storage.js +18 -18
  275. package/dist/summarizer.js +3 -3
  276. package/dist/support-passport/index.js +7 -7
  277. package/dist/tokens.js +3 -3
  278. package/dist/transfer/export-okf.js +19 -19
  279. package/dist/types.d.ts +1 -0
  280. package/dist/types.d.ts.map +1 -1
  281. package/dist/types.js +1 -1
  282. package/dist/verified-recall.js +19 -19
  283. package/dist/who-knows-cli.js +21 -21
  284. package/dist/who-knows.js +20 -20
  285. package/package.json +12 -2
  286. package/src/access-cli.ts +18 -9
  287. package/src/access-coding-context-resolution.ts +138 -0
  288. package/src/access-errors.ts +5 -0
  289. package/src/access-http-admission.test.ts +76 -0
  290. package/src/access-http.test.ts +2 -0
  291. package/src/access-http.ts +4 -0
  292. package/src/access-observe-write-surface.ts +2 -1
  293. package/src/access-operations-batch.ts +2 -2
  294. package/src/access-recall-concurrency.ts +179 -22
  295. package/src/access-recall-corpus-versions.ts +12 -7
  296. package/src/access-recall-response.ts +25 -2
  297. package/src/access-recall-surface.ts +6 -4
  298. package/src/access-schema.ts +9 -0
  299. package/src/access-service-raw-excerpt-read-gate.test.ts +7 -2
  300. package/src/access-service-recall-concurrency.test.ts +242 -0
  301. package/src/access-service-set-coding-context.test.ts +210 -0
  302. package/src/access-service.ts +43 -58
  303. package/src/buffer-turn-helpers.ts +3 -0
  304. package/src/capsule-import-gate.test.ts +106 -0
  305. package/src/coding/access-coding-context.test.ts +3 -0
  306. package/src/coding/architecture-surfaces.ts +2 -1
  307. package/src/coding/codegraph-surfaces.test.ts +34 -0
  308. package/src/coding/codegraph-surfaces.ts +3 -2
  309. package/src/coding/git-context.test.ts +29 -0
  310. package/src/coding/git-context.ts +63 -2
  311. package/src/coding/session-delta-surfaces.ts +2 -1
  312. package/src/connectors/droid-mcp.test.ts +46 -0
  313. package/src/connectors/droid-mcp.ts +5 -5
  314. package/src/harmonic-graph-version.test.ts +63 -0
  315. package/src/memory-controller.test.ts +38 -0
  316. package/src/memory-controller.ts +25 -2
  317. package/src/orchestration/episodic-context-section.ts +6 -7
  318. package/src/orchestration/orchestrator-helpers.ts +10 -0
  319. package/src/orchestration/orchestrator-init.ts +57 -303
  320. package/src/orchestration/recall-entry.ts +59 -4
  321. package/src/orchestration/recall-internal.ts +10 -10
  322. package/src/orchestration/session-context.ts +11 -1
  323. package/src/orchestration/startup-search-sync.ts +492 -0
  324. package/src/orchestration/task-exit.test.ts +45 -0
  325. package/src/orchestration/turn-ingestion-buffered.test.ts +224 -0
  326. package/src/orchestration/turn-ingestion.ts +28 -35
  327. package/src/orchestrator-flush.test.ts +7 -7
  328. package/src/orchestrator-init.test.ts +364 -12
  329. package/src/orchestrator-source-attribution.test.ts +100 -0
  330. package/src/orchestrator-startup-ready-path.test.ts +133 -10
  331. package/src/orchestrator.ts +16 -1
  332. package/src/recall-qos.test.ts +62 -0
  333. package/src/recall-qos.ts +75 -0
  334. package/src/recall-retrieval-failure.test.ts +282 -18
  335. package/src/recall-search-options.test.ts +13 -1
  336. package/src/storage/buffer-drain-handin-memo.test.ts +140 -0
  337. package/src/types.ts +1 -1
  338. package/dist/chunk-33VVVP57.js.map +0 -1
  339. package/dist/chunk-3QNFHI6T.js +0 -38
  340. package/dist/chunk-3QNFHI6T.js.map +0 -1
  341. package/dist/chunk-5HFCXTGY.js.map +0 -1
  342. package/dist/chunk-CJCTKL6Y.js.map +0 -1
  343. package/dist/chunk-IHOKB3L3.js.map +0 -1
  344. package/dist/chunk-PRE7R3RQ.js.map +0 -1
  345. package/dist/chunk-QASTQVGK.js.map +0 -1
  346. package/dist/chunk-RNFMFC37.js.map +0 -1
  347. package/dist/chunk-SOGOHLWN.js.map +0 -1
  348. package/dist/chunk-XBW7U7GM.js.map +0 -1
  349. package/dist/chunk-XKZBZOKV.js.map +0 -1
  350. package/dist/chunk-YVRQ5JRA.js.map +0 -1
  351. /package/dist/{chunk-5V3IBSVB.js.map → chunk-22V3CMIW.js.map} +0 -0
  352. /package/dist/{chunk-7IWRLYFJ.js.map → chunk-2TJSGIKT.js.map} +0 -0
  353. /package/dist/{chunk-V6M6N3EE.js.map → chunk-333SBFXB.js.map} +0 -0
  354. /package/dist/{chunk-XE4UYWW3.js.map → chunk-3YOX2BQD.js.map} +0 -0
  355. /package/dist/{chunk-XEBNSY7N.js.map → chunk-4D2EY4WM.js.map} +0 -0
  356. /package/dist/{chunk-LPV72KRQ.js.map → chunk-4IMOGAFF.js.map} +0 -0
  357. /package/dist/{chunk-QBREZ4QL.js.map → chunk-4L25GAYL.js.map} +0 -0
  358. /package/dist/{chunk-HADD45AR.js.map → chunk-4WCLZBM2.js.map} +0 -0
  359. /package/dist/{chunk-B3GKQ6DU.js.map → chunk-5MA6ZQ4Z.js.map} +0 -0
  360. /package/dist/{chunk-V4ASAWRP.js.map → chunk-5PUZV73Z.js.map} +0 -0
  361. /package/dist/{chunk-3QLAOYBL.js.map → chunk-5QDTZIGH.js.map} +0 -0
  362. /package/dist/{chunk-WXDTOE6F.js.map → chunk-5VMRM2X3.js.map} +0 -0
  363. /package/dist/{chunk-VE23DIBH.js.map → chunk-6QWFZ3X5.js.map} +0 -0
  364. /package/dist/{chunk-SDGD6MYV.js.map → chunk-7F7HRJI2.js.map} +0 -0
  365. /package/dist/{chunk-QFPNWSVH.js.map → chunk-7OCKK5M5.js.map} +0 -0
  366. /package/dist/{chunk-WAJL65KW.js.map → chunk-7VIJUZYW.js.map} +0 -0
  367. /package/dist/{chunk-EI2M2CFJ.js.map → chunk-A5UOREWD.js.map} +0 -0
  368. /package/dist/{chunk-32CA7B6L.js.map → chunk-AQZL7JBZ.js.map} +0 -0
  369. /package/dist/{chunk-EDA6CDBT.js.map → chunk-AVWOULJH.js.map} +0 -0
  370. /package/dist/{chunk-4HKK5HUI.js.map → chunk-B3M56D2A.js.map} +0 -0
  371. /package/dist/{chunk-SRN5M4LQ.js.map → chunk-BKTCVXMK.js.map} +0 -0
  372. /package/dist/{chunk-TXVTNDQT.js.map → chunk-BPCR5DZP.js.map} +0 -0
  373. /package/dist/{chunk-6S4DM53Y.js.map → chunk-C5QYWM6F.js.map} +0 -0
  374. /package/dist/{chunk-IEB6XYW6.js.map → chunk-CKZWLAHN.js.map} +0 -0
  375. /package/dist/{chunk-JVIWVJ2A.js.map → chunk-CUPILBIP.js.map} +0 -0
  376. /package/dist/{chunk-274UY54Z.js.map → chunk-DFZYZOLH.js.map} +0 -0
  377. /package/dist/{chunk-FSI45NUK.js.map → chunk-EZG54YDS.js.map} +0 -0
  378. /package/dist/{chunk-7ZFB4VZS.js.map → chunk-FFWFFAP3.js.map} +0 -0
  379. /package/dist/{chunk-22VXXA67.js.map → chunk-FGT7CUYZ.js.map} +0 -0
  380. /package/dist/{chunk-Z3SXC3MP.js.map → chunk-FOTFLHBN.js.map} +0 -0
  381. /package/dist/{chunk-RH6XWXMA.js.map → chunk-FRYCXXTB.js.map} +0 -0
  382. /package/dist/{chunk-B377OKUP.js.map → chunk-G64WYD2S.js.map} +0 -0
  383. /package/dist/{chunk-JJEQRSYU.js.map → chunk-GBSXTTLP.js.map} +0 -0
  384. /package/dist/{chunk-2YODOG2O.js.map → chunk-GIL2M2OI.js.map} +0 -0
  385. /package/dist/{chunk-ARJ3KCX4.js.map → chunk-HDLNSDLK.js.map} +0 -0
  386. /package/dist/{chunk-VXUO5JZC.js.map → chunk-HDWISXFH.js.map} +0 -0
  387. /package/dist/{chunk-EZ47HOJ6.js.map → chunk-IXI6S2VJ.js.map} +0 -0
  388. /package/dist/{chunk-VXMWTRQX.js.map → chunk-J74YOBB3.js.map} +0 -0
  389. /package/dist/{chunk-AMW3IDCO.js.map → chunk-JFMMEHVG.js.map} +0 -0
  390. /package/dist/{chunk-JTSSSR4L.js.map → chunk-KIUFT2WZ.js.map} +0 -0
  391. /package/dist/{chunk-L6BLTV4D.js.map → chunk-L7SEYUHS.js.map} +0 -0
  392. /package/dist/{chunk-WRAK5LLB.js.map → chunk-LPUEBFX2.js.map} +0 -0
  393. /package/dist/{chunk-DBVSU3HE.js.map → chunk-LVGTH6IQ.js.map} +0 -0
  394. /package/dist/{chunk-OGBQMY46.js.map → chunk-O544TUJO.js.map} +0 -0
  395. /package/dist/{chunk-TFNZXOXK.js.map → chunk-OAQRZ4SV.js.map} +0 -0
  396. /package/dist/{chunk-IEEV27BC.js.map → chunk-OO2HEUZ4.js.map} +0 -0
  397. /package/dist/{chunk-YMC4AYJK.js.map → chunk-OWM2VWNX.js.map} +0 -0
  398. /package/dist/{chunk-4LPTSB5V.js.map → chunk-PFLN6TTW.js.map} +0 -0
  399. /package/dist/{chunk-YOR5QBEU.js.map → chunk-QFTK6EDM.js.map} +0 -0
  400. /package/dist/{chunk-A2WFUMUN.js.map → chunk-QKDXO4FD.js.map} +0 -0
  401. /package/dist/{chunk-Y7HLGKKU.js.map → chunk-QLQUAVVP.js.map} +0 -0
  402. /package/dist/{chunk-MUMQWCE2.js.map → chunk-QPFM6DHY.js.map} +0 -0
  403. /package/dist/{chunk-YWPCDR3I.js.map → chunk-QVXEXGIM.js.map} +0 -0
  404. /package/dist/{chunk-UPE7TJWN.js.map → chunk-QWWHYBPT.js.map} +0 -0
  405. /package/dist/{chunk-NZHZQGLB.js.map → chunk-QXTKN25V.js.map} +0 -0
  406. /package/dist/{chunk-OAGTKS73.js.map → chunk-RFLC6PKQ.js.map} +0 -0
  407. /package/dist/{chunk-ZRLTQ2Y7.js.map → chunk-RO5EGRAI.js.map} +0 -0
  408. /package/dist/{chunk-5D4NBANY.js.map → chunk-SIONKXLU.js.map} +0 -0
  409. /package/dist/{chunk-6XTUZKCZ.js.map → chunk-SMDZTJ2D.js.map} +0 -0
  410. /package/dist/{chunk-OFSAKEZB.js.map → chunk-T4BT4FQN.js.map} +0 -0
  411. /package/dist/{chunk-IC35ZYLM.js.map → chunk-TAD6QMMD.js.map} +0 -0
  412. /package/dist/{chunk-EAHNSQ7H.js.map → chunk-TB6VFEHQ.js.map} +0 -0
  413. /package/dist/{chunk-6ARSFTLD.js.map → chunk-TNRGWJYT.js.map} +0 -0
  414. /package/dist/{chunk-6TPWIPE3.js.map → chunk-U3BCW7GX.js.map} +0 -0
  415. /package/dist/{chunk-CGOPDXLK.js.map → chunk-UMEUU66X.js.map} +0 -0
  416. /package/dist/{chunk-5LTXYM7D.js.map → chunk-UYIBNDQE.js.map} +0 -0
  417. /package/dist/{chunk-UGQEJWR3.js.map → chunk-VHXRLD6S.js.map} +0 -0
  418. /package/dist/{chunk-WJ6S54ES.js.map → chunk-VOLTQNAP.js.map} +0 -0
  419. /package/dist/{chunk-SBU5GDOT.js.map → chunk-VRHY7Y5A.js.map} +0 -0
  420. /package/dist/{chunk-E5RJPLNL.js.map → chunk-W7N7NWG5.js.map} +0 -0
  421. /package/dist/{chunk-UPWOMMVU.js.map → chunk-WECKZ3KT.js.map} +0 -0
  422. /package/dist/{chunk-PCUDFWX5.js.map → chunk-WEFFO2MJ.js.map} +0 -0
  423. /package/dist/{chunk-QCP75JGO.js.map → chunk-WQUGCOKF.js.map} +0 -0
  424. /package/dist/{chunk-FKBGK3NC.js.map → chunk-WWUQ6CP3.js.map} +0 -0
  425. /package/dist/{chunk-KR6PEAM4.js.map → chunk-X67XNZ64.js.map} +0 -0
  426. /package/dist/{chunk-UYHDMCY2.js.map → chunk-XUVCQ4YZ.js.map} +0 -0
  427. /package/dist/{chunk-7IJ2H43M.js.map → chunk-YY57TRKN.js.map} +0 -0
  428. /package/dist/{chunk-AU6AEUFD.js.map → chunk-YYXYZM2I.js.map} +0 -0
  429. /package/dist/{chunk-3FBAEPCU.js.map → chunk-ZDUE44CC.js.map} +0 -0
  430. /package/dist/{chunk-RDO6AMDL.js.map → chunk-ZWDDY4WF.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot
3
- } from "./chunk-Z3SXC3MP.js";
3
+ } from "./chunk-FOTFLHBN.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-YMC4AYJK.js";
6
+ } from "./chunk-OWM2VWNX.js";
7
7
  import {
8
8
  composeLocationDayBody,
9
9
  composeLocationDayMeta,
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-P2QRMMVQ.js";
33
33
  import {
34
34
  EngramAccessInputError
35
- } from "./chunk-CJCTKL6Y.js";
35
+ } from "./chunk-MGKCKY7X.js";
36
36
  import {
37
37
  log
38
38
  } from "./chunk-3WCASNQZ.js";
@@ -779,4 +779,4 @@ export {
779
779
  LOCATION_SYNC_DEFAULT_INTERVAL_MS,
780
780
  startLocationAutoSync
781
781
  };
782
- //# sourceMappingURL=chunk-SRN5M4LQ.js.map
782
+ //# sourceMappingURL=chunk-BKTCVXMK.js.map
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-QNUNAXBE.js";
12
12
  import {
13
13
  LocalLlmClient
14
- } from "./chunk-YOR5QBEU.js";
14
+ } from "./chunk-QFTK6EDM.js";
15
15
  import {
16
16
  completeBackgroundGeneration,
17
17
  parseBackgroundGenerationJson
@@ -808,4 +808,4 @@ export {
808
808
  summarizeHourlyStatus,
809
809
  HourlySummarizer
810
810
  };
811
- //# sourceMappingURL=chunk-TXVTNDQT.js.map
811
+ //# sourceMappingURL=chunk-BPCR5DZP.js.map
@@ -2,22 +2,22 @@ import {
2
2
  ExtractionDrain,
3
3
  TurnIngestionCoordinator,
4
4
  shouldSkipImplicitExtraction
5
- } from "./chunk-IHOKB3L3.js";
5
+ } from "./chunk-IE2ZLO3R.js";
6
6
  import {
7
7
  headerConnector,
8
8
  renderExtractionConversation,
9
9
  resolveSourceConnector
10
- } from "./chunk-6TPWIPE3.js";
10
+ } from "./chunk-U3BCW7GX.js";
11
11
  import {
12
12
  SmartBuffer
13
- } from "./chunk-Y7HLGKKU.js";
13
+ } from "./chunk-QLQUAVVP.js";
14
14
  import {
15
15
  selfDeps
16
- } from "./chunk-YMC4AYJK.js";
16
+ } from "./chunk-OWM2VWNX.js";
17
17
  import {
18
18
  describeError,
19
19
  groupTurnsByExtractionScope
20
- } from "./chunk-33VVVP57.js";
20
+ } from "./chunk-MEVBSF6T.js";
21
21
  import {
22
22
  resolveMemoryLifecycleCapabilities
23
23
  } from "./chunk-C5LWPYS3.js";
@@ -447,4 +447,4 @@ export {
447
447
  ClaimBufferStorage,
448
448
  BufferDrainRunner
449
449
  };
450
- //# sourceMappingURL=chunk-6S4DM53Y.js.map
450
+ //# sourceMappingURL=chunk-C5QYWM6F.js.map
@@ -0,0 +1,113 @@
1
+ import {
2
+ codingContextSchema
3
+ } from "./chunk-ZQUOUPP3.js";
4
+ import {
5
+ projectTagProjectId
6
+ } from "./chunk-O3XGASU5.js";
7
+ import {
8
+ resolveGitContext,
9
+ sharedGitContextCache
10
+ } from "./chunk-4D77BI3J.js";
11
+ import {
12
+ resolvePrincipal
13
+ } from "./chunk-ESG6ITGP.js";
14
+ import {
15
+ resolveNamespaceCapabilities
16
+ } from "./chunk-C5LWPYS3.js";
17
+ import {
18
+ EngramAccessInputError
19
+ } from "./chunk-MGKCKY7X.js";
20
+
21
+ // src/access-coding-context-resolution.ts
22
+ import { existsSync, statSync } from "fs";
23
+ import { join } from "path";
24
+ import { z } from "zod";
25
+ async function resolveCodingContextFromOptions(options) {
26
+ if (typeof options.projectTag === "string" && options.projectTag.trim().length > 0) {
27
+ const projectId = projectTagProjectId(options.projectTag);
28
+ return { projectId, branch: null, rootPath: projectId, defaultBranch: null };
29
+ }
30
+ if (typeof options.cwd !== "string" || options.cwd.trim().length === 0) return null;
31
+ try {
32
+ const gitContext = await resolveGitContext(options.cwd, {
33
+ abortSignal: options.abortSignal,
34
+ deadlineMs: options.deadlineMs,
35
+ cache: sharedGitContextCache
36
+ });
37
+ if (!gitContext) return null;
38
+ return {
39
+ projectId: gitContext.projectId,
40
+ branch: gitContext.branch,
41
+ rootPath: gitContext.rootPath,
42
+ defaultBranch: gitContext.defaultBranch
43
+ };
44
+ } catch (error) {
45
+ if (options.abortSignal?.aborted || options.deadlineMs !== void 0 && Date.now() >= options.deadlineMs) {
46
+ throw error;
47
+ }
48
+ return null;
49
+ }
50
+ }
51
+ function codingContextLocalRoot(codingContext) {
52
+ if (codingContext.remote !== true) return codingContext.rootPath;
53
+ const projectId = codingContext.projectId;
54
+ return projectId.startsWith("tag:") ? projectId : `tag:${projectId}`;
55
+ }
56
+ var setCodingContextRequestSchema = z.object({
57
+ sessionKey: z.string().trim().min(1, "sessionKey is required for setCodingContext"),
58
+ codingContext: codingContextSchema,
59
+ authenticatedPrincipal: z.string().optional(),
60
+ remote: z.boolean().optional()
61
+ });
62
+ function isDaemonRepoRoot(rootPath) {
63
+ try {
64
+ return statSync(rootPath).isDirectory() && existsSync(join(rootPath, ".git"));
65
+ } catch {
66
+ return false;
67
+ }
68
+ }
69
+ function setSessionCodingContext(orchestrator, request) {
70
+ const parsed = setCodingContextRequestSchema.safeParse(request);
71
+ if (!parsed.success) {
72
+ const detail = parsed.error.issues.map((issue) => issue.path.length > 0 ? `${issue.path.join(".")}: ${issue.message}` : issue.message).join("; ");
73
+ throw new EngramAccessInputError(detail || "invalid setCodingContext request");
74
+ }
75
+ const sessionKey = parsed.data.sessionKey;
76
+ let claimOwner;
77
+ if (resolveNamespaceCapabilities(orchestrator.config).namespaces === true) {
78
+ const authenticatedPrincipal = parsed.data.authenticatedPrincipal?.trim() || void 0;
79
+ const claimedOwner = orchestrator.getCodingContextOwnerForSession?.(sessionKey);
80
+ const sessionPrincipal = claimedOwner ?? resolvePrincipal(sessionKey, orchestrator.config);
81
+ if (authenticatedPrincipal === void 0) {
82
+ if (sessionPrincipal !== void 0 && sessionPrincipal !== "default") {
83
+ throw new EngramAccessInputError("sessionKey is not owned by authenticated principal");
84
+ }
85
+ } else if (sessionPrincipal !== void 0 && sessionPrincipal !== "default" && sessionPrincipal !== authenticatedPrincipal) {
86
+ throw new EngramAccessInputError("sessionKey is not owned by authenticated principal");
87
+ } else if (authenticatedPrincipal !== "default" && claimedOwner === void 0 && (sessionPrincipal === void 0 || sessionPrincipal === "default")) {
88
+ claimOwner = authenticatedPrincipal;
89
+ }
90
+ }
91
+ const ctx = parsed.data.codingContext;
92
+ if (ctx === null) {
93
+ orchestrator.setCodingContextForSession(sessionKey, null);
94
+ return;
95
+ }
96
+ const stored = {
97
+ projectId: ctx.projectId,
98
+ branch: ctx.branch,
99
+ rootPath: ctx.rootPath,
100
+ defaultBranch: ctx.defaultBranch
101
+ };
102
+ if (parsed.data.remote === true && !isDaemonRepoRoot(ctx.rootPath)) {
103
+ stored.remote = true;
104
+ }
105
+ orchestrator.setCodingContextForSession(sessionKey, stored, claimOwner);
106
+ }
107
+
108
+ export {
109
+ resolveCodingContextFromOptions,
110
+ codingContextLocalRoot,
111
+ setSessionCodingContext
112
+ };
113
+ //# sourceMappingURL=chunk-CKELO7Q6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-coding-context-resolution.ts"],"sourcesContent":["import { existsSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { z } from \"zod\";\n\nimport { EngramAccessInputError } from \"./access-errors.js\";\nimport { codingContextSchema } from \"./access-schema.js\";\nimport { resolveNamespaceCapabilities } from \"./capabilities.js\";\nimport { projectTagProjectId } from \"./coding/coding-namespace.js\";\nimport { resolveGitContext, sharedGitContextCache } from \"./coding/git-context.js\";\nimport { resolvePrincipal } from \"./namespaces/principal.js\";\nimport type { Orchestrator } from \"./orchestrator.js\";\nimport type { CodingContext } from \"./types.js\";\n\nexport interface InterruptibleCodingScopeInput {\n cwd?: string;\n projectTag?: string;\n abortSignal?: AbortSignal;\n deadlineMs?: number;\n}\n\nexport async function resolveCodingContextFromOptions(\n options: InterruptibleCodingScopeInput,\n): Promise<CodingContext | null> {\n if (typeof options.projectTag === \"string\" && options.projectTag.trim().length > 0) {\n const projectId = projectTagProjectId(options.projectTag);\n return { projectId, branch: null, rootPath: projectId, defaultBranch: null };\n }\n if (typeof options.cwd !== \"string\" || options.cwd.trim().length === 0) return null;\n\n try {\n const gitContext = await resolveGitContext(options.cwd, {\n abortSignal: options.abortSignal,\n deadlineMs: options.deadlineMs,\n cache: sharedGitContextCache,\n });\n if (!gitContext) return null;\n return {\n projectId: gitContext.projectId,\n branch: gitContext.branch,\n rootPath: gitContext.rootPath,\n defaultBranch: gitContext.defaultBranch,\n };\n } catch (error) {\n if (\n options.abortSignal?.aborted ||\n (options.deadlineMs !== undefined && Date.now() >= options.deadlineMs)\n ) {\n throw error;\n }\n return null;\n }\n}\n\n/**\n * Attach a coding context to a session (issue #569). Used by the Claude\n * Code / Codex connectors at session start, and by the\n * `remnic.set_coding_context` MCP tool (PR 7).\n */\nexport interface EngramAccessSetCodingContextRequest {\n sessionKey: string;\n codingContext: {\n projectId: string;\n branch: string | null;\n rootPath: string;\n defaultBranch: string | null;\n } | null;\n /**\n * Transport-bound caller principal — set by the boundary from the resolved\n * request identity, never from the payload. With namespaces enabled the\n * session's derived principal must match (or resolve to `default`), the\n * same binding the extraction force-flush enforces (#3515 review).\n */\n authenticatedPrincipal?: string;\n /**\n * Set by the boundary for caller-supplied roots (#3515 review): marks the\n * stored context's rootPath as remote so daemon surfaces never open it as\n * a local path. Internal resolutions (cwd/projectTag on this host, CLI)\n * leave it unset.\n */\n remote?: boolean;\n}\n\n/**\n * The coding-context root as a daemon-local path. A client-resolved (remote)\n * root degrades to the projectId — exactly what a projectTag-derived context\n * already carries — so surfaces behave like today's non-repo contexts instead\n * of scanning a foreign host's path.\n */\nexport function codingContextLocalRoot(codingContext: CodingContext): string {\n if (codingContext.remote !== true) return codingContext.rootPath;\n // projectId is caller-chosen and may be shaped like a path (\"/srv/x\"), so a\n // remote root degrades to the tag form — the same non-path label a\n // projectTag-derived context carries — never a daemon-openable location.\n const projectId = codingContext.projectId;\n return projectId.startsWith(\"tag:\") ? projectId : `tag:${projectId}`;\n}\n\n/**\n * Validates the input shape and rejects malformed payloads rather than\n * silently accepting them (CLAUDE.md #51). Pass `codingContext: null` to\n * clear. With namespaces enabled, set and clear are bound to the caller's\n * principal so one client cannot rewrite another session's context.\n */\nconst setCodingContextRequestSchema = z.object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required for setCodingContext\"),\n codingContext: codingContextSchema,\n authenticatedPrincipal: z.string().optional(),\n remote: z.boolean().optional(),\n});\n\n/**\n * True when a caller-supplied root is a git worktree top on THIS host —\n * a directory containing a `.git` entry (dir for a checkout, file for a\n * linked worktree). A same-host pane's client-resolved root verifies and\n * keeps its local path; a genuinely remote or forged path fails closed to\n * the remote marker so surfaces never open it.\n */\nfunction isDaemonRepoRoot(rootPath: string): boolean {\n try {\n return statSync(rootPath).isDirectory() && existsSync(join(rootPath, \".git\"));\n } catch {\n return false;\n }\n}\n\nexport function setSessionCodingContext(\n orchestrator: Orchestrator,\n request: EngramAccessSetCodingContextRequest,\n): void {\n const parsed = setCodingContextRequestSchema.safeParse(request);\n if (!parsed.success) {\n const detail = parsed.error.issues\n .map((issue) => (issue.path.length > 0 ? `${issue.path.join(\".\")}: ${issue.message}` : issue.message))\n .join(\"; \");\n throw new EngramAccessInputError(detail || \"invalid setCodingContext request\");\n }\n const sessionKey = parsed.data.sessionKey;\n // Bind set AND clear to the caller (#3515 review): with namespaces on,\n // the session's derived principal must be the caller (or `default`,\n // i.e. unclaimed — first caller binds), mirroring the extraction\n // force-flush ownership check.\n let claimOwner: string | undefined;\n if (resolveNamespaceCapabilities(orchestrator.config).namespaces === true) {\n const authenticatedPrincipal = parsed.data.authenticatedPrincipal?.trim() || undefined;\n // A live claim outranks the config mapping: the first authenticated\n // writer to an unclaimed session owns it until the context is cleared\n // or the session ends, so another principal cannot take it over later.\n const claimedOwner = orchestrator.getCodingContextOwnerForSession?.(sessionKey);\n const sessionPrincipal = claimedOwner ?? resolvePrincipal(sessionKey, orchestrator.config);\n if (authenticatedPrincipal === undefined) {\n // No transport principal — internal callers (daemon attach, CLI) may\n // write an unclaimed session but never overwrite a claimed one.\n if (sessionPrincipal !== undefined && sessionPrincipal !== \"default\") {\n throw new EngramAccessInputError(\"sessionKey is not owned by authenticated principal\");\n }\n } else if (sessionPrincipal !== undefined && sessionPrincipal !== \"default\" && sessionPrincipal !== authenticatedPrincipal) {\n throw new EngramAccessInputError(\"sessionKey is not owned by authenticated principal\");\n } else if (\n authenticatedPrincipal !== \"default\" && claimedOwner === undefined\n && (sessionPrincipal === undefined || sessionPrincipal === \"default\")\n ) {\n claimOwner = authenticatedPrincipal;\n }\n }\n const ctx = parsed.data.codingContext;\n if (ctx === null) {\n orchestrator.setCodingContextForSession(sessionKey, null);\n return;\n }\n const stored: CodingContext = {\n projectId: ctx.projectId,\n branch: ctx.branch,\n rootPath: ctx.rootPath,\n defaultBranch: ctx.defaultBranch,\n };\n if (parsed.data.remote === true && !isDaemonRepoRoot(ctx.rootPath)) {\n stored.remote = true;\n }\n orchestrator.setCodingContextForSession(sessionKey, stored, claimOwner);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,gBAAgB;AACrC,SAAS,YAAY;AAErB,SAAS,SAAS;AAkBlB,eAAsB,gCACpB,SAC+B;AAC/B,MAAI,OAAO,QAAQ,eAAe,YAAY,QAAQ,WAAW,KAAK,EAAE,SAAS,GAAG;AAClF,UAAM,YAAY,oBAAoB,QAAQ,UAAU;AACxD,WAAO,EAAE,WAAW,QAAQ,MAAM,UAAU,WAAW,eAAe,KAAK;AAAA,EAC7E;AACA,MAAI,OAAO,QAAQ,QAAQ,YAAY,QAAQ,IAAI,KAAK,EAAE,WAAW,EAAG,QAAO;AAE/E,MAAI;AACF,UAAM,aAAa,MAAM,kBAAkB,QAAQ,KAAK;AAAA,MACtD,aAAa,QAAQ;AAAA,MACrB,YAAY,QAAQ;AAAA,MACpB,OAAO;AAAA,IACT,CAAC;AACD,QAAI,CAAC,WAAY,QAAO;AACxB,WAAO;AAAA,MACL,WAAW,WAAW;AAAA,MACtB,QAAQ,WAAW;AAAA,MACnB,UAAU,WAAW;AAAA,MACrB,eAAe,WAAW;AAAA,IAC5B;AAAA,EACF,SAAS,OAAO;AACd,QACE,QAAQ,aAAa,WACpB,QAAQ,eAAe,UAAa,KAAK,IAAI,KAAK,QAAQ,YAC3D;AACA,YAAM;AAAA,IACR;AACA,WAAO;AAAA,EACT;AACF;AAqCO,SAAS,uBAAuB,eAAsC;AAC3E,MAAI,cAAc,WAAW,KAAM,QAAO,cAAc;AAIxD,QAAM,YAAY,cAAc;AAChC,SAAO,UAAU,WAAW,MAAM,IAAI,YAAY,OAAO,SAAS;AACpE;AAQA,IAAM,gCAAgC,EAAE,OAAO;AAAA,EAC7C,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,6CAA6C;AAAA,EAClF,eAAe;AAA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xD;AAAA,EACF;AACA,QAAM,SAAwB;AAAA,IAC5B,WAAW,IAAI;AAAA,IACf,QAAQ,IAAI;AAAA,IACZ,UAAU,IAAI;AAAA,IACd,eAAe,IAAI;AAAA,EACrB;AACA,MAAI,OAAO,KAAK,WAAW,QAAQ,CAAC,iBAAiB,IAAI,QAAQ,GAAG;AAClE,WAAO,SAAS;AAAA,EAClB;AACA,eAAa,2BAA2B,YAAY,QAAQ,UAAU;AACxE;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isGenericRecallExcludedPath
3
- } from "./chunk-7IJ2H43M.js";
3
+ } from "./chunk-YY57TRKN.js";
4
4
  import {
5
5
  normalizeProjectionPreview
6
6
  } from "./chunk-SCU65EZI.js";
@@ -209,4 +209,4 @@ export {
209
209
  browsePatternMatches,
210
210
  runMemoryBrowse
211
211
  };
212
- //# sourceMappingURL=chunk-IEB6XYW6.js.map
212
+ //# sourceMappingURL=chunk-CKZWLAHN.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  parseFrontmatter
3
- } from "./chunk-YMC4AYJK.js";
3
+ } from "./chunk-OWM2VWNX.js";
4
4
  import {
5
5
  activityDigestPath,
6
6
  isValidActivityDate
7
7
  } from "./chunk-353C5UNV.js";
8
8
  import {
9
9
  EngramAccessInputError
10
- } from "./chunk-CJCTKL6Y.js";
10
+ } from "./chunk-MGKCKY7X.js";
11
11
 
12
12
  // src/standup/build.ts
13
13
  import { readdirSync, readFileSync } from "fs";
@@ -199,4 +199,4 @@ export {
199
199
  buildStandup,
200
200
  standupHelp
201
201
  };
202
- //# sourceMappingURL=chunk-JVIWVJ2A.js.map
202
+ //# sourceMappingURL=chunk-CUPILBIP.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SupportPassportError,
3
3
  SupportPassportOwnerCreateGrantRequestSchema
4
- } from "./chunk-UPE7TJWN.js";
4
+ } from "./chunk-QWWHYBPT.js";
5
5
  import {
6
6
  getOperation
7
- } from "./chunk-JTSSSR4L.js";
7
+ } from "./chunk-KIUFT2WZ.js";
8
8
 
9
9
  // src/support-passport/access-http.ts
10
10
  var OWNER_ROOT = "/engram/v1/support-passport";
@@ -139,4 +139,4 @@ export {
139
139
  SUPPORT_PASSPORT_OWNER_HTTP_ROUTES,
140
140
  handleSupportPassportOwnerHttp
141
141
  };
142
- //# sourceMappingURL=chunk-274UY54Z.js.map
142
+ //# sourceMappingURL=chunk-DFZYZOLH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rebuildMemoryProjection,
3
3
  watchProjectionRebuildParent
4
- } from "./chunk-WAJL65KW.js";
4
+ } from "./chunk-7VIJUZYW.js";
5
5
  import {
6
6
  initLogger,
7
7
  log
@@ -77,4 +77,4 @@ if (invokedAsRunner) {
77
77
  export {
78
78
  PROJECTION_REBUILD_RUNNER_FLAG
79
79
  };
80
- //# sourceMappingURL=chunk-FSI45NUK.js.map
80
+ //# sourceMappingURL=chunk-EZG54YDS.js.map
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-6ZELOK6O.js";
12
12
  import {
13
13
  EVICTION_HOOKS
14
- } from "./chunk-33VVVP57.js";
14
+ } from "./chunk-MEVBSF6T.js";
15
15
 
16
16
  // src/buffer-add-turns-bounded.ts
17
17
  async function addTurnsBoundedWithAdmissionKey(host, batches, admissionKey) {
@@ -70,4 +70,4 @@ async function addTurnsBoundedWithAdmissionKey(host, batches, admissionKey) {
70
70
  export {
71
71
  addTurnsBoundedWithAdmissionKey
72
72
  };
73
- //# sourceMappingURL=chunk-7ZFB4VZS.js.map
73
+ //# sourceMappingURL=chunk-FFWFFAP3.js.map
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-ZAJLJ35W.js";
12
12
  import {
13
13
  parseConfig
14
- } from "./chunk-5D4NBANY.js";
14
+ } from "./chunk-SIONKXLU.js";
15
15
  import {
16
16
  resolveObjectiveStateStoreDir,
17
17
  validateObjectiveStateSnapshot
@@ -268,4 +268,4 @@ export {
268
268
  recordResumeBundle,
269
269
  getResumeBundleStatus
270
270
  };
271
- //# sourceMappingURL=chunk-22VXXA67.js.map
271
+ //# sourceMappingURL=chunk-FGT7CUYZ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-YMC4AYJK.js";
3
+ } from "./chunk-OWM2VWNX.js";
4
4
  import {
5
5
  keyring_exports,
6
6
  secureStoreDir
@@ -416,4 +416,4 @@ export {
416
416
  resolveNamespaceStorageRoot,
417
417
  NamespaceStorageRouter
418
418
  };
419
- //# sourceMappingURL=chunk-Z3SXC3MP.js.map
419
+ //# sourceMappingURL=chunk-FOTFLHBN.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  parseXrayFormat
3
- } from "./chunk-V6M6N3EE.js";
3
+ } from "./chunk-333SBFXB.js";
4
4
  import {
5
5
  RECALL_DISCLOSURE_LEVELS,
6
6
  isRecallDisclosure
7
- } from "./chunk-SOGOHLWN.js";
7
+ } from "./chunk-N7AIFTSH.js";
8
8
 
9
9
  // src/recall-xray-cli.ts
10
10
  function parseXrayDisclosureFlag(value) {
@@ -50,4 +50,4 @@ export {
50
50
  parseXrayBudgetFlag,
51
51
  parseXrayCliOptions
52
52
  };
53
- //# sourceMappingURL=chunk-RH6XWXMA.js.map
53
+ //# sourceMappingURL=chunk-FRYCXXTB.js.map
@@ -3,13 +3,13 @@ import {
3
3
  getOperation,
4
4
  operationRequiresAuthorizedNamespace,
5
5
  operationUsesPrincipalNamespace
6
- } from "./chunk-JTSSSR4L.js";
6
+ } from "./chunk-KIUFT2WZ.js";
7
7
  import {
8
8
  assertOperationAuthorizationAllowed
9
- } from "./chunk-OGBQMY46.js";
9
+ } from "./chunk-O544TUJO.js";
10
10
  import {
11
11
  EngramAccessInputError
12
- } from "./chunk-CJCTKL6Y.js";
12
+ } from "./chunk-MGKCKY7X.js";
13
13
 
14
14
  // src/access-authorization-probe.ts
15
15
  var UNRESOLVABLE_RESOURCE_OPERATIONS = /* @__PURE__ */ new Set([
@@ -60,4 +60,4 @@ export {
60
60
  authorizationProbeNamespaces,
61
61
  authorizationProbeRequiresPrincipalNamespace
62
62
  };
63
- //# sourceMappingURL=chunk-B377OKUP.js.map
63
+ //# sourceMappingURL=chunk-G64WYD2S.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runPostConsolidationMaterialize
3
- } from "./chunk-L6BLTV4D.js";
3
+ } from "./chunk-L7SEYUHS.js";
4
4
  import {
5
5
  discoverMemoryExtensions,
6
6
  renderExtensionsBlock,
@@ -220,4 +220,4 @@ export {
220
220
  buildExtensionsBlockForConsolidation,
221
221
  materializeAfterSemanticConsolidation
222
222
  };
223
- //# sourceMappingURL=chunk-JJEQRSYU.js.map
223
+ //# sourceMappingURL=chunk-GBSXTTLP.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  defineOperation
3
- } from "./chunk-JTSSSR4L.js";
3
+ } from "./chunk-KIUFT2WZ.js";
4
4
  import {
5
5
  EngramAccessInputError,
6
6
  rejectReservedArgumentKey
7
- } from "./chunk-CJCTKL6Y.js";
7
+ } from "./chunk-MGKCKY7X.js";
8
8
 
9
9
  // src/recall-navigation-operations.ts
10
10
  import { z } from "zod";
@@ -94,4 +94,4 @@ defineOperation({
94
94
  };
95
95
  }
96
96
  });
97
- //# sourceMappingURL=chunk-2YODOG2O.js.map
97
+ //# sourceMappingURL=chunk-GIL2M2OI.js.map
@@ -1,3 +1,7 @@
1
+ import {
2
+ recallDeadlineSignal
3
+ } from "./chunk-IDYYGOOQ.js";
4
+
1
5
  // src/access-recall-corpus-versions.ts
2
6
  var DEFAULT_CAPTURE_TIMEOUT_MS = 250;
3
7
  function mergeRecallCorpusVersions(current, captured) {
@@ -7,9 +11,11 @@ function mergeRecallCorpusVersions(current, captured) {
7
11
  }
8
12
  return [...versions.values()];
9
13
  }
10
- function createRecallCorpusVersionCapture(orchestrator, signal, setVersions, includeNoRecall = false, timeoutMs = DEFAULT_CAPTURE_TIMEOUT_MS) {
14
+ function createRecallCorpusVersionCapture(orchestrator, signal, setVersions, includeNoRecall = false, options = {}) {
15
+ const timeoutMs = options.timeoutMs ?? DEFAULT_CAPTURE_TIMEOUT_MS;
16
+ const captureSignal = recallDeadlineSignal(signal, options.deadlineMs);
11
17
  return async (mode, namespaces) => {
12
- if (mode === "no_recall" && !includeNoRecall || signal?.aborted) return;
18
+ if (mode === "no_recall" && !includeNoRecall || captureSignal?.aborted) return;
13
19
  const captured = await Promise.all(namespaces.map(async (namespace) => {
14
20
  let timer;
15
21
  let abortCapture;
@@ -17,12 +23,12 @@ function createRecallCorpusVersionCapture(orchestrator, signal, setVersions, inc
17
23
  const timeout = new Promise((resolve) => {
18
24
  timer = setTimeout(() => resolve(null), timeoutMs);
19
25
  });
20
- const aborted = signal ? new Promise((resolve) => {
21
- if (signal.aborted) {
26
+ const aborted = captureSignal ? new Promise((resolve) => {
27
+ if (captureSignal.aborted) {
22
28
  resolve(null);
23
29
  } else {
24
30
  abortCapture = () => resolve(null);
25
- signal.addEventListener("abort", abortCapture, { once: true });
31
+ captureSignal.addEventListener("abort", abortCapture, { once: true });
26
32
  }
27
33
  }) : void 0;
28
34
  const version = await Promise.race([
@@ -35,10 +41,10 @@ function createRecallCorpusVersionCapture(orchestrator, signal, setVersions, inc
35
41
  return { namespace, version: null };
36
42
  } finally {
37
43
  if (timer !== void 0) clearTimeout(timer);
38
- if (abortCapture) signal?.removeEventListener("abort", abortCapture);
44
+ if (abortCapture) captureSignal?.removeEventListener("abort", abortCapture);
39
45
  }
40
46
  }));
41
- if (!signal?.aborted) setVersions(captured);
47
+ if (!captureSignal?.aborted) setVersions(captured);
42
48
  };
43
49
  }
44
50
 
@@ -46,4 +52,4 @@ export {
46
52
  mergeRecallCorpusVersions,
47
53
  createRecallCorpusVersionCapture
48
54
  };
49
- //# sourceMappingURL=chunk-YVRQ5JRA.js.map
55
+ //# sourceMappingURL=chunk-GYOKVJPB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-recall-corpus-versions.ts"],"sourcesContent":["import type { RecallInvocationOptions } from \"./orchestration/orchestrator-helpers.js\";\nimport { recallDeadlineSignal } from \"./recall-qos.js\";\n\nexport type RecallCorpusVersion = { namespace: string; version: number | null };\n\nconst DEFAULT_CAPTURE_TIMEOUT_MS = 250;\n\nexport function mergeRecallCorpusVersions(\n current: RecallCorpusVersion[],\n captured: RecallCorpusVersion[],\n): RecallCorpusVersion[] {\n const versions = new Map(current.map((entry) => [entry.namespace, entry]));\n for (const entry of captured) {\n if (!versions.has(entry.namespace)) versions.set(entry.namespace, entry);\n }\n return [...versions.values()];\n}\n\nexport function createRecallCorpusVersionCapture(\n orchestrator: { getStorage(namespace: string): Promise<{ getMemoryCorpusVersion(): number }> },\n signal: AbortSignal | undefined,\n setVersions: (versions: RecallCorpusVersion[]) => void,\n includeNoRecall = false,\n options: { timeoutMs?: number; deadlineMs?: number } = {},\n): NonNullable<RecallInvocationOptions[\"onRecallPlanResolved\"]> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_CAPTURE_TIMEOUT_MS;\n // The client's own deadline bounds this capture too (issue #3499): the\n // request signal alone would let a stalled lookup run the full timeout.\n const captureSignal = recallDeadlineSignal(signal, options.deadlineMs);\n return async (mode, namespaces) => {\n if ((mode === \"no_recall\" && !includeNoRecall) || captureSignal?.aborted) return;\n const captured = await Promise.all(namespaces.map(async (namespace) => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let abortCapture: (() => void) | undefined;\n try {\n const timeout = new Promise<null>((resolve) => {\n timer = setTimeout(() => resolve(null), timeoutMs);\n });\n const aborted = captureSignal\n ? new Promise<null>((resolve) => {\n if (captureSignal.aborted) {\n resolve(null);\n } else {\n abortCapture = () => resolve(null);\n captureSignal.addEventListener(\"abort\", abortCapture, { once: true });\n }\n })\n : undefined;\n const version = await Promise.race([\n orchestrator.getStorage(namespace).then((storage) => storage.getMemoryCorpusVersion()),\n timeout,\n ...(aborted ? [aborted] : []),\n ]);\n return { namespace, version };\n } catch {\n return { namespace, version: null };\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n if (abortCapture) captureSignal?.removeEventListener(\"abort\", abortCapture);\n }\n }));\n if (!captureSignal?.aborted) setVersions(captured);\n };\n}"],"mappings":";;;;;AAKA,IAAM,6BAA6B;AAE5B,SAAS,0BACd,SACA,UACuB;AACvB,QAAM,WAAW,IAAI,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW,KAAK,CAAC,CAAC;AACzE,aAAW,SAAS,UAAU;AAC5B,QAAI,CAAC,SAAS,IAAI,MAAM,SAAS,EAAG,UAAS,IAAI,MAAM,WAAW,KAAK;AAAA,EACzE;AACA,SAAO,CAAC,GAAG,SAAS,OAAO,CAAC;AAC9B;AAEO,SAAS,iCACd,cACA,QACA,aACA,kBAAkB,OAClB,UAAuD,CAAC,GACM;AAC9D,QAAM,YAAY,QAAQ,aAAa;AAGvC,QAAM,gBAAgB,qBAAqB,QAAQ,QAAQ,UAAU;AACrE,SAAO,OAAO,MAAM,eAAe;AACjC,QAAK,SAAS,eAAe,CAAC,mBAAoB,eAAe,QAAS;AAC1E,UAAM,WAAW,MAAM,QAAQ,IAAI,WAAW,IAAI,OAAO,cAAc;AACrE,UAAI;AACJ,UAAI;AACJ,UAAI;AACF,cAAM,UAAU,IAAI,QAAc,CAAC,YAAY;AAC7C,kBAAQ,WAAW,MAAM,QAAQ,IAAI,GAAG,SAAS;AAAA,QACnD,CAAC;AACD,cAAM,UAAU,gBACZ,IAAI,QAAc,CAAC,YAAY;AAC7B,cAAI,cAAc,SAAS;AACzB,oBAAQ,IAAI;AAAA,UACd,OAAO;AACL,2BAAe,MAAM,QAAQ,IAAI;AACjC,0BAAc,iBAAiB,SAAS,cAAc,EAAE,MAAM,KAAK,CAAC;AAAA,UACtE;AAAA,QACF,CAAC,IACD;AACJ,cAAM,UAAU,MAAM,QAAQ,KAAK;AAAA,UACjC,aAAa,WAAW,SAAS,EAAE,KAAK,CAAC,YAAY,QAAQ,uBAAuB,CAAC;AAAA,UACrF;AAAA,UACA,GAAI,UAAU,CAAC,OAAO,IAAI,CAAC;AAAA,QAC7B,CAAC;AACD,eAAO,EAAE,WAAW,QAAQ;AAAA,MAC9B,QAAQ;AACN,eAAO,EAAE,WAAW,SAAS,KAAK;AAAA,MACpC,UAAE;AACA,YAAI,UAAU,OAAW,cAAa,KAAK;AAC3C,YAAI,aAAc,gBAAe,oBAAoB,SAAS,YAAY;AAAA,MAC5E;AAAA,IACF,CAAC,CAAC;AACF,QAAI,CAAC,eAAe,QAAS,aAAY,QAAQ;AAAA,EACnD;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RECALL_DISCLOSURE_LEVELS
3
- } from "./chunk-SOGOHLWN.js";
3
+ } from "./chunk-N7AIFTSH.js";
4
4
 
5
5
  // src/recall-navigate.ts
6
6
  var RECALL_NAV_LINK_TYPES = [
@@ -48,4 +48,4 @@ export {
48
48
  expandRecallNode,
49
49
  traverseRecallLink
50
50
  };
51
- //# sourceMappingURL=chunk-ARJ3KCX4.js.map
51
+ //# sourceMappingURL=chunk-HDLNSDLK.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raceRecallAbort,
3
3
  throwIfRecallAborted
4
- } from "./chunk-QASTQVGK.js";
4
+ } from "./chunk-ZX546Y3Y.js";
5
5
  import {
6
6
  emitExtractionLlmFailureError,
7
7
  recordExtractionLlmFailure,
@@ -15,7 +15,10 @@ import {
15
15
  } from "./chunk-DF4BC5MK.js";
16
16
  import {
17
17
  resolveScopeProfilePlan
18
- } from "./chunk-JCAMHTS2.js";
18
+ } from "./chunk-UBG65KEY.js";
19
+ import {
20
+ resolveCodingNamespaceOverlay
21
+ } from "./chunk-O3XGASU5.js";
19
22
  import {
20
23
  parseFlexibleIsoTimestamp
21
24
  } from "./chunk-P7FMDTKL.js";
@@ -28,9 +31,6 @@ import {
28
31
  resolvePresentationCapabilities,
29
32
  resolveRecallEnhancementCapabilities
30
33
  } from "./chunk-C5LWPYS3.js";
31
- import {
32
- resolveCodingNamespaceOverlay
33
- } from "./chunk-5HFCXTGY.js";
34
34
  import {
35
35
  log
36
36
  } from "./chunk-3WCASNQZ.js";
@@ -1183,4 +1183,4 @@ export {
1183
1183
  ExtractionDeadlineError,
1184
1184
  ExtractionRunCoordinator
1185
1185
  };
1186
- //# sourceMappingURL=chunk-VXUO5JZC.js.map
1186
+ //# sourceMappingURL=chunk-HDWISXFH.js.map
@@ -64,6 +64,29 @@ function createRecallSectionMetricRecorder(options = {}) {
64
64
  };
65
65
  }
66
66
  var CORE_SECTION_MAX_SHARE_OF_REQUEST = 0.8;
67
+ var CLIENT_DEADLINE_EPOCH_FLOOR_MS = 1e11;
68
+ function resolveClientDeadlineAtMs(deadlineMs, now) {
69
+ if (deadlineMs === void 0 || !Number.isFinite(deadlineMs) || deadlineMs < 0) {
70
+ return null;
71
+ }
72
+ return deadlineMs > CLIENT_DEADLINE_EPOCH_FLOOR_MS ? deadlineMs : now + deadlineMs;
73
+ }
74
+ var CLIENT_DEADLINE_TIMER_MAX_MS = 2147483647;
75
+ function clientDeadlineTimerMs(clientDeadlineAtMs, now) {
76
+ return Math.max(1, Math.min(Math.floor(clientDeadlineAtMs - now), CLIENT_DEADLINE_TIMER_MAX_MS));
77
+ }
78
+ function recallDeadlineSignal(baseSignal, deadlineMs, now = Date.now()) {
79
+ const deadlineAtMs = resolveClientDeadlineAtMs(deadlineMs, now);
80
+ if (deadlineAtMs === null) return baseSignal;
81
+ const deadlineSignal = deadlineAtMs <= now ? AbortSignal.abort() : AbortSignal.timeout(clientDeadlineTimerMs(deadlineAtMs, now));
82
+ return baseSignal === void 0 ? deadlineSignal : AbortSignal.any([baseSignal, deadlineSignal]);
83
+ }
84
+ function resolveRecallOuterDeadlineAtMs(options) {
85
+ const configured = options.recallOuterTimeoutMs > 0 ? options.recallStart + options.recallOuterTimeoutMs : null;
86
+ const client = resolveClientDeadlineAtMs(options.clientDeadlineMs, options.recallStart);
87
+ if (client === null) return configured;
88
+ return configured === null ? client : Math.min(configured, client);
89
+ }
67
90
  function resolveRecallCoreSectionDeadlineMs(options) {
68
91
  const configured = options.configuredCoreDeadlineMs;
69
92
  if (!Number.isFinite(configured) || configured <= 0) return configured;
@@ -164,8 +187,12 @@ export {
164
187
  yieldToEventLoop,
165
188
  formatRecallSectionMetric,
166
189
  createRecallSectionMetricRecorder,
190
+ resolveClientDeadlineAtMs,
191
+ clientDeadlineTimerMs,
192
+ recallDeadlineSignal,
193
+ resolveRecallOuterDeadlineAtMs,
167
194
  resolveRecallCoreSectionDeadlineMs,
168
195
  runRecallSectionWithinDeadline,
169
196
  createBoundedCoreSectionRunner
170
197
  };
171
- //# sourceMappingURL=chunk-RNFMFC37.js.map
198
+ //# sourceMappingURL=chunk-IDYYGOOQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-qos.ts"],"sourcesContent":["import { abortError, isAbortError } from \"./abort-error.js\";\nimport { log, type LoggerBackend } from \"./logger.js\";\n\n/**\n * Hand the event loop one macrotask.\n *\n * A recall section deadline is a timer, and a timer cannot fire while a\n * synchronous scan holds the loop — so a provider that iterates the whole corpus\n * must call this periodically or its budget is unenforceable (issue #2291).\n * `setImmediate` (check phase) is used rather than a `0ms` timer so the yield\n * cannot be starved by the timer queue it exists to let run.\n */\nexport function yieldToEventLoop(): Promise<void> {\n const { promise, resolve } = Promise.withResolvers<void>();\n setImmediate(resolve);\n return promise;\n}\n\nexport type RecallSectionPriority = \"core\" | \"enrichment\";\n/**\n * `timeout` records a section that started, exceeded its deadline, and was\n * degraded to its neutral value (issue #2291). It is distinct from `skip`\n * (never ran: disabled or zero-limit) so operators can tell a configuration\n * choice from a budget breach in the section metric log.\n */\nexport type RecallSectionSource = \"fresh\" | \"stale\" | \"skip\" | \"timeout\";\n\nexport interface RecallSectionMetric {\n section: string;\n priority: RecallSectionPriority;\n durationMs: number;\n deadlineMs: number;\n source: RecallSectionSource;\n success: boolean;\n timing?: string;\n}\n\nexport interface RecallSectionMetricLog {\n message: string;\n payload: {\n section: string;\n priority: RecallSectionPriority;\n durationMs: number;\n deadlineMs: number;\n source: RecallSectionSource;\n success: boolean;\n };\n level: \"info\" | \"debug\";\n timing: string;\n}\n\nfunction defaultTiming(metric: RecallSectionMetric): string {\n if (typeof metric.timing === \"string\" && metric.timing.length > 0) {\n return metric.timing;\n }\n if (metric.source === \"timeout\") {\n return `timeout(${Math.max(0, Math.round(metric.durationMs))}ms)`;\n }\n if (metric.source === \"skip\") {\n return \"skip\";\n }\n return `${Math.max(0, Math.round(metric.durationMs))}ms`;\n}\n\nexport function formatRecallSectionMetric(metric: RecallSectionMetric): RecallSectionMetricLog {\n const payload = {\n section: metric.section,\n priority: metric.priority,\n durationMs: metric.durationMs,\n deadlineMs: metric.deadlineMs,\n source: metric.source,\n success: metric.success,\n };\n return {\n message: \"recall section metric\",\n payload,\n level: metric.priority === \"core\" && metric.success && metric.source !== \"skip\" ? \"info\" : \"debug\",\n timing: defaultTiming(metric),\n };\n}\n\nexport function createRecallSectionMetricRecorder(options: {\n timings?: Record<string, string>;\n logger?: Pick<LoggerBackend, \"info\" | \"debug\">;\n} = {}) {\n const logger = options.logger ?? log;\n return (metric: RecallSectionMetric): RecallSectionMetricLog => {\n const entry = formatRecallSectionMetric(metric);\n if (options.timings) {\n options.timings[metric.section] = entry.timing;\n }\n if (entry.level === \"info\") {\n if (typeof logger.info === \"function\") {\n logger.info(entry.message, entry.payload);\n } else {\n log.info(entry.message, entry.payload);\n }\n } else {\n if (typeof logger.debug === \"function\") {\n logger.debug(entry.message, entry.payload);\n } else {\n log.debug(entry.message, entry.payload);\n }\n }\n return entry;\n };\n}\n\n/**\n * Fraction of the request's REMAINING budget that a single core section may\n * consume. The remainder is what makes degradation possible at all: time to\n * assemble and return the sections that did arrive before the outer timeout\n * kills the request outright.\n */\nconst CORE_SECTION_MAX_SHARE_OF_REQUEST = 0.8;\n\n/**\n * Epoch-ms floor separating the two `deadlineMs` readings: anything at or\n * above it is an absolute timestamp, anything below is a relative budget —\n * the convention force-flush established (issue #3140).\n */\nconst CLIENT_DEADLINE_EPOCH_FLOOR_MS = 1e11;\n\n/**\n * The client's own deadline for this request, as an absolute timestamp —\n * or null when the request carries no usable value (issue #3499).\n *\n * Garbage (NaN, infinite, negative) is ignored rather than rejected: a\n * malformed hint must never cost the caller its recall. Values under the\n * epoch floor are a relative budget from `now`, matching force-flush.\n */\nexport function resolveClientDeadlineAtMs(\n deadlineMs: number | undefined,\n now: number,\n): number | null {\n if (deadlineMs === undefined || !Number.isFinite(deadlineMs) || deadlineMs < 0) {\n return null;\n }\n return deadlineMs > CLIENT_DEADLINE_EPOCH_FLOOR_MS ? deadlineMs : now + deadlineMs;\n}\n\n// Node clamps timer delays to 2^31-1 ms (~24.8 days) and a larger delay\n// overflows to an immediate fire — every client-deadline timer must clamp\n// or a far-future budget aborts a healthy call at once (issue #3499).\nconst CLIENT_DEADLINE_TIMER_MAX_MS = 2_147_483_647;\n\nexport function clientDeadlineTimerMs(clientDeadlineAtMs: number, now: number): number {\n // Floor before clamping: a fractional deadlineMs produces a fractional\n // delay, which AbortSignal.timeout rejects with ERR_OUT_OF_RANGE — flooring\n // also keeps the abort at or before the deadline (#3514 review).\n return Math.max(1, Math.min(Math.floor(clientDeadlineAtMs - now), CLIENT_DEADLINE_TIMER_MAX_MS));\n}\n\nexport function recallDeadlineSignal(\n baseSignal: AbortSignal | undefined,\n deadlineMs: number | undefined,\n now = Date.now(),\n): AbortSignal | undefined {\n const deadlineAtMs = resolveClientDeadlineAtMs(deadlineMs, now);\n if (deadlineAtMs === null) return baseSignal;\n const deadlineSignal =\n deadlineAtMs <= now\n ? AbortSignal.abort()\n : AbortSignal.timeout(clientDeadlineTimerMs(deadlineAtMs, now));\n return baseSignal === undefined ? deadlineSignal : AbortSignal.any([baseSignal, deadlineSignal]);\n}\n\n/**\n * Effective outer deadline for a recall: the configured ceiling capped by\n * the client's own deadline when the request carries one (issue #3499).\n *\n * A client deadline that has already passed yields a deadline in the past —\n * sections then see a non-positive remainder and degrade immediately, which\n * is the fast-degraded-recall contract, never a request rejection. `null`\n * means the request is genuinely unbounded (no configured ceiling AND no\n * client deadline).\n */\nexport function resolveRecallOuterDeadlineAtMs(options: {\n recallStart: number;\n recallOuterTimeoutMs: number;\n clientDeadlineMs?: number;\n}): number | null {\n const configured =\n options.recallOuterTimeoutMs > 0\n ? options.recallStart + options.recallOuterTimeoutMs\n : null;\n const client = resolveClientDeadlineAtMs(options.clientDeadlineMs, options.recallStart);\n if (client === null) return configured;\n return configured === null ? client : Math.min(configured, client);\n}\n\n/**\n * Effective per-section deadline for optional core recall providers.\n *\n * Two things make the configured value unusable as-is (issue #2291):\n *\n * - `recallCoreDeadlineMs` and `recallOuterTimeoutMs` both default to 75s, so a\n * section budget taken at face value can never fire before the request ceiling\n * that cancels everything — the caller loses the whole recall rather than one\n * section.\n * - Sections start *after* planning, namespace resolution, and mode selection.\n * Capping against the original ceiling would let a section that starts 20s in\n * still be running when the request is aborted, which is the same failure.\n *\n * So the cap is taken against `remainingOuterMs` — the request budget left when\n * the section actually starts. An operator who lowers `recallCoreDeadlineMs`\n * below that still gets exactly what they asked for.\n *\n * `remainingOuterMs === null` means the request is unbounded and there is nothing\n * to reserve headroom against. A non-positive remainder means the request is\n * already over budget, so the section degrades immediately rather than starting\n * work that cannot be delivered.\n */\nexport function resolveRecallCoreSectionDeadlineMs(options: {\n configuredCoreDeadlineMs: number;\n remainingOuterMs: number | null;\n}): number {\n const configured = options.configuredCoreDeadlineMs;\n if (!Number.isFinite(configured) || configured <= 0) return configured;\n const remaining = options.remainingOuterMs;\n if (remaining === null || !Number.isFinite(remaining)) return configured;\n if (remaining <= 0) return 1;\n return Math.min(\n configured,\n Math.max(1, Math.floor(remaining * CORE_SECTION_MAX_SHARE_OF_REQUEST)),\n );\n}\n\nexport interface RecallSectionDeadlineOutcome<T> {\n /** The section's value, or `fallback` when the deadline was exceeded. */\n value: T;\n timedOut: boolean;\n durationMs: number;\n}\n\n/**\n * Run one recall section under a deadline, degrading to `fallback` instead of\n * blocking the phase it belongs to (issue #2291).\n *\n * Before this existed, `deadlineMs` was recorded in the section metric but\n * never enforced for core sections: a provider doing a multi-minute scan on a\n * slow filesystem blocked the whole phase-one `Promise.all`, and kept scanning\n * after the caller aborted. Two guarantees fix that:\n *\n * 1. The returned promise settles within `deadlineMs`, with `timedOut: true`\n * and the caller's neutral value, so one slow optional provider degrades\n * independently rather than holding the response.\n * 2. `run` receives a signal that fires on the deadline AND on the caller's\n * abort, so the section can stop its own work at its next checkpoint.\n *\n * `deadlineMs <= 0` (or non-finite) means unbounded, matching the config\n * contract that a zero budget disables the limit. The section signal is still\n * created and still tracks the parent, so cancellation propagates either way.\n */\nexport async function runRecallSectionWithinDeadline<T>(options: {\n deadlineMs: number;\n fallback: T;\n parentSignal?: AbortSignal;\n run: (sectionSignal: AbortSignal) => Promise<T>;\n now?: () => number;\n}): Promise<RecallSectionDeadlineOutcome<T>> {\n const now = options.now ?? Date.now;\n const startedAtMs = now();\n const controller = new AbortController();\n const parentSignal = options.parentSignal;\n const onParentAbort = () => controller.abort();\n if (parentSignal?.aborted) {\n controller.abort();\n } else if (parentSignal) {\n parentSignal.addEventListener(\"abort\", onParentAbort, { once: true });\n }\n\n const bounded = Number.isFinite(options.deadlineMs) && options.deadlineMs > 0;\n let timer: NodeJS.Timeout | undefined;\n\n try {\n // Wrap in a tagged result rather than racing raw values against a sentinel:\n // T is caller-chosen and must never be mistaken for the timeout marker.\n const work = options.run(controller.signal).then(\n (value) => ({ kind: \"value\" as const, value }),\n );\n if (!bounded) {\n const settled = await work;\n return { value: settled.value, timedOut: false, durationMs: now() - startedAtMs };\n }\n const deadline = Promise.withResolvers<{ kind: \"timeout\" }>();\n // Deliberately NOT unref'd: the caller is awaiting this bound, so the timer\n // must keep the loop alive until it fires or `finally` clears it.\n timer = setTimeout(() => deadline.resolve({ kind: \"timeout\" }), options.deadlineMs);\n const settled = await Promise.race([work, deadline.promise]);\n if (settled.kind === \"timeout\") {\n controller.abort(abortError(\"recall section deadline exceeded\"));\n // The abandoned work outlives this call; swallow its settlement so a\n // late rejection is not reported as unhandled.\n void work.catch(() => {});\n return { value: options.fallback, timedOut: true, durationMs: now() - startedAtMs };\n }\n return { value: settled.value, timedOut: false, durationMs: now() - startedAtMs };\n } finally {\n clearTimeout(timer);\n parentSignal?.removeEventListener(\"abort\", onParentAbort);\n }\n}\n\n/**\n * Runs one *optional* core recall section, bounded and accounted for.\n *\n * Binds a section's deadline, the caller's abort signal, and the QoS recorder\n * once so each provider is one call (issue #2291). A breach degrades the\n * section to `fallback`, warns with the section name and budget, and records the\n * section as `timeout` — so a slow provider costs its own section, not the\n * response.\n *\n * The budget is resolved when each section STARTS, against the request budget\n * still left at that moment (`outerDeadlineAtMs`), not against the original\n * configured ceiling: sections begin after planning and namespace resolution, and\n * a section sized to the full request would otherwise still be running when the\n * request itself is aborted.\n *\n * Cancellation degrades too, and must: the section signal fires on the caller's\n * abort, and the phase this section belongs to is awaited through a race that the\n * caller's abort also wins. A rejection here would therefore land on a promise\n * nobody is awaiting any more — an unhandled rejection rather than a signal. The\n * caller learns of its own abort from that race, not from a section result.\n *\n * Only sections whose absence leaves recall coherent belong here: the fallback\n * IS the degraded contract.\n */\nexport function createBoundedCoreSectionRunner(options: {\n configuredDeadlineMs: number;\n /** Absolute time the whole request is aborted, or null when unbounded. */\n outerDeadlineAtMs: number | null;\n parentSignal?: AbortSignal;\n record: (metric: RecallSectionMetric) => unknown;\n logger?: Pick<LoggerBackend, \"warn\">;\n now?: () => number;\n}): <T>(\n section: string,\n fallback: T,\n run: (sectionSignal: AbortSignal) => Promise<T>,\n) => Promise<T> {\n const logger = options.logger ?? log;\n const now = options.now ?? Date.now;\n return async <T>(\n section: string,\n fallback: T,\n run: (sectionSignal: AbortSignal) => Promise<T>,\n ): Promise<T> => {\n const startedAtMs = now();\n const deadlineMs = resolveRecallCoreSectionDeadlineMs({\n configuredCoreDeadlineMs: options.configuredDeadlineMs,\n remainingOuterMs:\n options.outerDeadlineAtMs === null ? null : options.outerDeadlineAtMs - startedAtMs,\n });\n let outcome: RecallSectionDeadlineOutcome<T>;\n try {\n outcome = await runRecallSectionWithinDeadline({\n deadlineMs,\n fallback,\n parentSignal: options.parentSignal,\n run,\n now,\n });\n } catch (err) {\n if (!isAbortError(err)) throw err;\n const durationMs = now() - startedAtMs;\n options.record({\n section,\n priority: \"core\",\n durationMs,\n deadlineMs,\n source: \"skip\",\n success: false,\n timing: `cancelled(${durationMs}ms)`,\n });\n return fallback;\n }\n if (outcome.timedOut) {\n logger.warn(\n `recall section [${section}] exceeded its ${deadlineMs}ms core deadline ` +\n `after ${outcome.durationMs}ms; recall continues without it`,\n );\n }\n options.record({\n section,\n priority: \"core\",\n durationMs: outcome.durationMs,\n deadlineMs,\n source: outcome.timedOut ? \"timeout\" : \"fresh\",\n success: !outcome.timedOut,\n });\n return outcome.value;\n };\n}"],"mappings":";;;;;;;;;AAYO,SAAS,mBAAkC;AAChD,QAAM,EAAE,SAAS,QAAQ,IAAI,QAAQ,cAAoB;AACzD,eAAa,OAAO;AACpB,SAAO;AACT;AAmCA,SAAS,cAAc,QAAqC;AAC1D,MAAI,OAAO,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS,GAAG;AACjE,WAAO,OAAO;AAAA,EAChB;AACA,MAAI,OAAO,WAAW,WAAW;AAC/B,WAAO,WAAW,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,UAAU,CAAC,CAAC;AAAA,EAC9D;AACA,MAAI,OAAO,WAAW,QAAQ;AAC5B,WAAO;AAAA,EACT;AACA,SAAO,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,UAAU,CAAC,CAAC;AACtD;AAEO,SAAS,0BAA0B,QAAqD;AAC7F,QAAM,UAAU;AAAA,IACd,SAAS,OAAO;AAAA,IAChB,UAAU,OAAO;AAAA,IACjB,YAAY,OAAO;AAAA,IACnB,YAAY,OAAO;AAAA,IACnB,QAAQ,OAAO;A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