@remnic/core 9.50.3 → 9.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (486) hide show
  1. package/dist/access-admin-ops-surface.d.ts +13 -11
  2. package/dist/access-admin-ops-surface.js +41 -39
  3. package/dist/access-authorization-probe.d.ts +13 -11
  4. package/dist/access-authorization-probe.js +42 -40
  5. package/dist/access-boundary.d.ts +13 -11
  6. package/dist/access-boundary.js +41 -39
  7. package/dist/access-cli.js +109 -104
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +3 -1
  10. package/dist/access-extraction-force-flush.d.ts +13 -11
  11. package/dist/access-extraction-force-flush.js +41 -39
  12. package/dist/access-health-types.d.ts +3 -1
  13. package/dist/access-http-lcm-compaction.d.ts +13 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +13 -11
  15. package/dist/access-http-offline-stream.d.ts +13 -11
  16. package/dist/access-http-query.js +41 -39
  17. package/dist/access-http.d.ts +13 -11
  18. package/dist/access-http.js +52 -50
  19. package/dist/access-identity-continuity-surface.d.ts +11 -9
  20. package/dist/access-identity-continuity-surface.js +41 -39
  21. package/dist/access-lcm-surface.d.ts +13 -11
  22. package/dist/access-lcm-surface.js +41 -39
  23. package/dist/access-mcp.d.ts +13 -11
  24. package/dist/access-mcp.js +47 -45
  25. package/dist/access-memory-search-fanout.d.ts +4 -2
  26. package/dist/{access-namespace-preflight-Dj2QolFE.d.ts → access-namespace-preflight-Ds6CGlCP.d.ts} +1 -1
  27. package/dist/access-namespace-preflight.d.ts +5 -3
  28. package/dist/access-namespace-preflight.js +41 -39
  29. package/dist/access-observe-write-surface.d.ts +13 -11
  30. package/dist/access-observe-write-surface.js +41 -39
  31. package/dist/access-offline-manifest.d.ts +11 -9
  32. package/dist/access-operations-batch.js +43 -41
  33. package/dist/access-operations.d.ts +16 -14
  34. package/dist/access-operations.js +46 -44
  35. package/dist/access-recall-concurrency.d.ts +13 -11
  36. package/dist/access-recall-concurrency.js +41 -39
  37. package/dist/access-recall-response.d.ts +13 -11
  38. package/dist/access-recall-response.js +41 -39
  39. package/dist/access-recall-surface.d.ts +13 -11
  40. package/dist/access-recall-surface.js +41 -39
  41. package/dist/access-schema.d.ts +88 -88
  42. package/dist/access-schema.js +3 -3
  43. package/dist/{access-service-DesbnTSa.d.ts → access-service-BY0KJ44c.d.ts} +7 -7
  44. package/dist/access-service-helpers.d.ts +13 -11
  45. package/dist/access-service.d.ts +13 -11
  46. package/dist/access-service.js +41 -39
  47. package/dist/access-surface-catalog.d.ts +13 -11
  48. package/dist/access-wearables-meetings-surface.d.ts +5 -3
  49. package/dist/action-confidence.d.ts +3 -1
  50. package/dist/active-memory-bridge.d.ts +3 -1
  51. package/dist/active-recall.d.ts +3 -1
  52. package/dist/active-recall.js +5 -3
  53. package/dist/active-recall.js.map +1 -1
  54. package/dist/adapters/index.js +4 -4
  55. package/dist/adapters/registry.js +2 -2
  56. package/dist/ambient-provenance.d.ts +3 -1
  57. package/dist/archive-mutation-version.d.ts +9 -0
  58. package/dist/archive-mutation-version.js +20 -0
  59. package/dist/artifact-search.d.ts +3 -1
  60. package/dist/behavior-learner.d.ts +3 -1
  61. package/dist/behavior-signals.d.ts +3 -1
  62. package/dist/bootstrap.d.ts +11 -9
  63. package/dist/briefing.d.ts +4 -2
  64. package/dist/briefing.js +10 -9
  65. package/dist/buffer-surprise-report.d.ts +3 -1
  66. package/dist/buffer-turn-helpers.d.ts +3 -1
  67. package/dist/buffer.d.ts +4 -2
  68. package/dist/buffer.js +5 -5
  69. package/dist/bulk-import/index.d.ts +5 -3
  70. package/dist/calibration.d.ts +3 -1
  71. package/dist/capabilities.d.ts +3 -1
  72. package/dist/{catalog-D-G7RgXR.d.ts → catalog-D3B4RDy1.d.ts} +1 -1
  73. package/dist/causal-behavior.d.ts +3 -1
  74. package/dist/causal-behavior.js +2 -2
  75. package/dist/causal-chain.js +2 -2
  76. package/dist/causal-consolidation.d.ts +3 -1
  77. package/dist/causal-consolidation.js +13 -12
  78. package/dist/causal-consolidation.js.map +1 -1
  79. package/dist/causal-retrieval.js +2 -2
  80. package/dist/causal-trajectory-graph.d.ts +4 -2
  81. package/dist/causal-trajectory-graph.js +2 -1
  82. package/dist/causal-trajectory-graph.js.map +1 -1
  83. package/dist/causal-trajectory.js +1 -1
  84. package/dist/{chunk-KDG2KTWW.js → chunk-33SV3E43.js} +4 -4
  85. package/dist/{chunk-2HGUDBRJ.js → chunk-37ZO6LLJ.js} +2 -2
  86. package/dist/{chunk-QW3WFHKU.js → chunk-45BRYON6.js} +2 -2
  87. package/dist/{chunk-GZICBRWK.js → chunk-4F6X3RXW.js} +2 -2
  88. package/dist/{chunk-7BAYBYY5.js → chunk-4PC4PRJE.js} +2 -2
  89. package/dist/{chunk-VJXY5ZCT.js → chunk-52UKFTUK.js} +2 -2
  90. package/dist/{chunk-ESG7Z255.js → chunk-5UDMFE3Q.js} +2 -2
  91. package/dist/{chunk-JPHEOE6Z.js → chunk-6MTSFX7A.js} +15 -15
  92. package/dist/chunk-6ZN34ISG.js +44 -0
  93. package/dist/chunk-6ZN34ISG.js.map +1 -0
  94. package/dist/{chunk-M4MP34AQ.js → chunk-AHZOMHWN.js} +1 -1
  95. package/dist/{chunk-Z3RHPGSY.js → chunk-AIUBBHSF.js} +3 -3
  96. package/dist/{chunk-S3AYIQCU.js → chunk-AXIDQG5A.js} +12 -12
  97. package/dist/{chunk-QN7NTKRC.js → chunk-AZ2QBGYB.js} +1 -1
  98. package/dist/{chunk-47J4EDGR.js → chunk-AZM4CCAC.js} +8 -8
  99. package/dist/{chunk-IXXABW5A.js → chunk-BHXYAVUM.js} +11 -5
  100. package/dist/chunk-BHXYAVUM.js.map +1 -0
  101. package/dist/{chunk-L2DPF4DF.js → chunk-BIJAWZYW.js} +54 -12
  102. package/dist/chunk-BIJAWZYW.js.map +1 -0
  103. package/dist/{chunk-LEJPSMKM.js → chunk-C5QLI33R.js} +3 -3
  104. package/dist/{chunk-SV3PSA7Y.js → chunk-CV6BBVYV.js} +5 -5
  105. package/dist/{chunk-V7X767RT.js → chunk-DCZBSE4F.js} +52 -52
  106. package/dist/chunk-FC67T4E6.js +70 -0
  107. package/dist/chunk-FC67T4E6.js.map +1 -0
  108. package/dist/{chunk-7PKFPLLZ.js → chunk-FXTYIA46.js} +2 -2
  109. package/dist/{chunk-64BHFFKZ.js → chunk-HLYR2TQL.js} +5 -5
  110. package/dist/{chunk-5C2HNJMO.js → chunk-J5LLX6IL.js} +32 -32
  111. package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
  112. package/dist/{chunk-PLKFO2HJ.js → chunk-JL43BVDE.js} +2 -2
  113. package/dist/{chunk-2S72LWKX.js → chunk-JYL3BVVZ.js} +2 -2
  114. package/dist/{chunk-IPLYGWQF.js → chunk-KQAFEZQX.js} +5 -5
  115. package/dist/chunk-LXY5VVGM.js +61 -0
  116. package/dist/chunk-LXY5VVGM.js.map +1 -0
  117. package/dist/{chunk-PYKKWQZ2.js → chunk-M7BXDKPR.js} +6 -6
  118. package/dist/{chunk-Z54EM5YZ.js → chunk-MAXVH44E.js} +7 -7
  119. package/dist/{chunk-LYMNZZIM.js → chunk-NIS256NW.js} +2 -2
  120. package/dist/{chunk-67QG75MJ.js → chunk-NLK2VZYZ.js} +2 -2
  121. package/dist/{chunk-A4QMKFFO.js → chunk-O5FFBO2M.js} +14 -28
  122. package/dist/chunk-O5FFBO2M.js.map +1 -0
  123. package/dist/{chunk-JYIFGGEM.js → chunk-OUKBMQ2O.js} +2 -2
  124. package/dist/{chunk-75XOWNRS.js → chunk-OYESWJ43.js} +4 -4
  125. package/dist/{chunk-TS4AJ2GI.js → chunk-PA45XCUD.js} +3 -3
  126. package/dist/{chunk-BJYET5TX.js → chunk-PRDJMOST.js} +7 -1
  127. package/dist/chunk-PRDJMOST.js.map +1 -0
  128. package/dist/{chunk-4MBPIL4V.js → chunk-PUSLMZBQ.js} +2 -2
  129. package/dist/{chunk-RVO6TCTU.js → chunk-QCECHYZL.js} +6 -6
  130. package/dist/{chunk-GFIKG4FR.js → chunk-QGR6OVGT.js} +2 -2
  131. package/dist/{chunk-NSGU76YO.js → chunk-QHFV6VNU.js} +6 -2
  132. package/dist/chunk-QHFV6VNU.js.map +1 -0
  133. package/dist/{chunk-PDEKQWDV.js → chunk-QT2FRYI4.js} +18 -2
  134. package/dist/chunk-QT2FRYI4.js.map +1 -0
  135. package/dist/{chunk-HNZKVLAN.js → chunk-S354QO4R.js} +2 -2
  136. package/dist/{chunk-NO37MR45.js → chunk-SOEN6KCF.js} +2 -2
  137. package/dist/{chunk-FXX6RQYC.js → chunk-TPTECFWR.js} +2 -2
  138. package/dist/{chunk-GDDGZVFI.js → chunk-UEVLYVNW.js} +2 -2
  139. package/dist/{chunk-YQ4IQ2GA.js → chunk-UT5BV5OG.js} +2 -2
  140. package/dist/{chunk-LAQ33B5D.js → chunk-UU3G6GUP.js} +1 -1
  141. package/dist/chunk-UU3G6GUP.js.map +1 -0
  142. package/dist/{chunk-LNTUXKBT.js → chunk-UYYW2KPU.js} +2 -2
  143. package/dist/{chunk-BOFVT6P3.js → chunk-VBHPOWBJ.js} +175 -98
  144. package/dist/chunk-VBHPOWBJ.js.map +1 -0
  145. package/dist/{chunk-QSYL5CXK.js → chunk-VKXWK44Q.js} +3 -3
  146. package/dist/{chunk-KMWYZTIE.js → chunk-VMMQDEN5.js} +2 -2
  147. package/dist/{chunk-JB6D7EFB.js → chunk-VVG2BOKA.js} +2 -2
  148. package/dist/chunk-W5BIQOAJ.js +69 -0
  149. package/dist/chunk-W5BIQOAJ.js.map +1 -0
  150. package/dist/{chunk-V5H6OJCR.js → chunk-W5XVQFLM.js} +2 -2
  151. package/dist/{chunk-OIOZ6MOP.js → chunk-W6FNX2LP.js} +2 -2
  152. package/dist/{chunk-6QPHF6RR.js → chunk-WQM326GS.js} +2 -2
  153. package/dist/{chunk-TQFHQPWD.js → chunk-XADV5IZ3.js} +8 -8
  154. package/dist/{chunk-DATDLJAO.js → chunk-XAPMEU3K.js} +2 -2
  155. package/dist/chunk-XXSOVESA.js +42 -0
  156. package/dist/chunk-XXSOVESA.js.map +1 -0
  157. package/dist/{chunk-IK6X5QPO.js → chunk-ZHY5TMJG.js} +1193 -443
  158. package/dist/chunk-ZHY5TMJG.js.map +1 -0
  159. package/dist/{chunk-N3LL5NEU.js → chunk-ZMYDYNI4.js} +2 -2
  160. package/dist/{cli-D4vvtxjY.d.ts → cli-CnOkH9hA.d.ts} +6 -6
  161. package/dist/cli.d.ts +15 -13
  162. package/dist/cli.js +74 -70
  163. package/dist/coding/pre-action-gate.d.ts +3 -1
  164. package/dist/coding/pre-action-gate.js +2 -2
  165. package/dist/compounding/engine.d.ts +4 -2
  166. package/dist/compounding/engine.js +10 -9
  167. package/dist/compounding/preference-consolidator.d.ts +3 -1
  168. package/dist/compression-optimizer.d.ts +3 -1
  169. package/dist/config.d.ts +3 -1
  170. package/dist/config.js +5 -3
  171. package/dist/connectors/codex-materialize-runner.d.ts +3 -1
  172. package/dist/connectors/codex-materialize-runner.js +10 -9
  173. package/dist/connectors/codex-materialize.d.ts +3 -1
  174. package/dist/connectors/index.d.ts +3 -1
  175. package/dist/connectors/index.js +10 -9
  176. package/dist/consolidation-provenance-check.d.ts +4 -2
  177. package/dist/consolidation-undo.d.ts +4 -2
  178. package/dist/contradiction/index.d.ts +4 -2
  179. package/dist/contradiction-config.d.ts +29 -0
  180. package/dist/contradiction-config.js +12 -0
  181. package/dist/contradiction-config.js.map +1 -0
  182. package/dist/converge-config.d.ts +3 -1
  183. package/dist/convergence-refresh.d.ts +4 -2
  184. package/dist/convergence-refresh.js +12 -11
  185. package/dist/conversation-index/backend.d.ts +3 -1
  186. package/dist/conversation-index/chunker.d.ts +3 -1
  187. package/dist/conversation-index/faiss-adapter.d.ts +3 -1
  188. package/dist/conversation-index/indexer.d.ts +3 -1
  189. package/dist/conversation-index/search.d.ts +3 -1
  190. package/dist/corpus-watermark.d.ts +3 -1
  191. package/dist/corpus-watermark.js +21 -20
  192. package/dist/day-summary.d.ts +3 -1
  193. package/dist/delinearize.d.ts +3 -1
  194. package/dist/dependency-propagation-config.d.ts +3 -1
  195. package/dist/direct-answer-wiring.d.ts +3 -1
  196. package/dist/direct-answer.d.ts +3 -1
  197. package/dist/embedding-fallback.d.ts +3 -1
  198. package/dist/enrichment/index.d.ts +3 -1
  199. package/dist/entity-retrieval.d.ts +4 -2
  200. package/dist/entity-retrieval.js +10 -9
  201. package/dist/entity-schema.d.ts +3 -1
  202. package/dist/explicit-capture.d.ts +11 -9
  203. package/dist/explicit-capture.js +3 -2
  204. package/dist/external-wiki-access.d.ts +13 -11
  205. package/dist/external-wiki-access.js +42 -40
  206. package/dist/external-wiki-collection-registration.d.ts +3 -1
  207. package/dist/external-wiki-collection.d.ts +3 -1
  208. package/dist/external-wiki-mcp-tools.d.ts +13 -11
  209. package/dist/extraction-error-classification.d.ts +3 -1
  210. package/dist/extraction-faithfulness.d.ts +3 -1
  211. package/dist/extraction-judge-telemetry.d.ts +3 -1
  212. package/dist/extraction-judge-training.d.ts +3 -1
  213. package/dist/extraction-judge.d.ts +3 -1
  214. package/dist/extraction-liveness.d.ts +3 -1
  215. package/dist/extraction-normalization.d.ts +3 -1
  216. package/dist/extraction-prompt.d.ts +3 -1
  217. package/dist/extraction-source-grounding-rules.d.ts +3 -1
  218. package/dist/extraction-source-grounding.d.ts +3 -1
  219. package/dist/extraction.d.ts +3 -1
  220. package/dist/extraction.js +22 -21
  221. package/dist/fallback-llm.d.ts +3 -1
  222. package/dist/graph-444E-DrF.d.ts +349 -0
  223. package/dist/graph-dashboard-diff.d.ts +4 -2
  224. package/dist/graph-dashboard-key.d.ts +4 -2
  225. package/dist/graph-dashboard-parser.d.ts +4 -2
  226. package/dist/{graph-edge-decay-Z6ENALU2.js → graph-edge-decay-65KMOJWY.js} +4 -3
  227. package/dist/graph-edge-decay-65KMOJWY.js.map +1 -0
  228. package/dist/graph-edge-reinforcement.d.ts +4 -2
  229. package/dist/graph-path-reconstruction.d.ts +10 -0
  230. package/dist/graph-path-reconstruction.js +12 -0
  231. package/dist/graph-path-reconstruction.js.map +1 -0
  232. package/dist/graph-path-scoring-config.d.ts +8 -0
  233. package/dist/graph-path-scoring-config.js +10 -0
  234. package/dist/graph-path-scoring-config.js.map +1 -0
  235. package/dist/graph-path-scoring.d.ts +36 -0
  236. package/dist/graph-path-scoring.js +11 -0
  237. package/dist/graph-path-scoring.js.map +1 -0
  238. package/dist/graph-snapshot.d.ts +4 -2
  239. package/dist/graph-snapshot.js +3 -2
  240. package/dist/graph.d.ts +5 -318
  241. package/dist/graph.js +5 -1
  242. package/dist/harmonic-retrieval.js +1 -1
  243. package/dist/importance.d.ts +3 -1
  244. package/dist/importers/index.d.ts +3 -1
  245. package/dist/in-flight-reads.d.ts +3 -1
  246. package/dist/index.d.ts +696 -694
  247. package/dist/index.js +149 -144
  248. package/dist/intent.d.ts +3 -1
  249. package/dist/lcm/engine.d.ts +3 -1
  250. package/dist/lcm/engine.js +3 -3
  251. package/dist/lcm/index.d.ts +3 -1
  252. package/dist/lcm/index.js +6 -6
  253. package/dist/lcm/tools.d.ts +3 -1
  254. package/dist/lifecycle.d.ts +3 -1
  255. package/dist/live-connectors-runner.d.ts +3 -1
  256. package/dist/local-llm.d.ts +3 -1
  257. package/dist/local-model-endpoint.d.ts +3 -1
  258. package/dist/maintenance/memory-governance.d.ts +3 -1
  259. package/dist/maintenance/memory-governance.js +10 -9
  260. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +4 -2
  261. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -9
  262. package/dist/maintenance/rebuild-memory-projection.d.ts +4 -2
  263. package/dist/maintenance/rebuild-memory-projection.js +11 -10
  264. package/dist/{maintenance-ClmUVpGI.d.ts → maintenance-CKwxpdRx.d.ts} +3 -3
  265. package/dist/mcp-memory-inspector-app.d.ts +13 -11
  266. package/dist/memory-action-policy.d.ts +3 -1
  267. package/dist/memory-cache.d.ts +3 -1
  268. package/dist/memory-lifecycle-ledger-utils.d.ts +3 -1
  269. package/dist/memory-projection-store.d.ts +3 -1
  270. package/dist/memory-provenance.d.ts +3 -1
  271. package/dist/memory-snapshot.d.ts +3 -1
  272. package/dist/memory-worth-outcomes.d.ts +4 -2
  273. package/dist/models-json.d.ts +3 -1
  274. package/dist/namespaces/migrate.d.ts +5 -3
  275. package/dist/namespaces/migrate.js +20 -19
  276. package/dist/namespaces/principal.d.ts +3 -1
  277. package/dist/namespaces/search.d.ts +3 -1
  278. package/dist/namespaces/search.js +7 -7
  279. package/dist/namespaces/storage.d.ts +5 -3
  280. package/dist/namespaces/storage.js +10 -9
  281. package/dist/native-knowledge.d.ts +3 -1
  282. package/dist/offline-sync-impression-drain.d.ts +3 -1
  283. package/dist/operator-doctor-corpus.d.ts +3 -1
  284. package/dist/operator-doctor-corpus.js +22 -21
  285. package/dist/operator-doctor-replica.d.ts +3 -1
  286. package/dist/operator-toolkit.d.ts +6 -4
  287. package/dist/operator-toolkit.js +33 -29
  288. package/dist/orchestration/compression-guideline-coordinator.d.ts +4 -2
  289. package/dist/orchestration/maintenance.d.ts +6 -4
  290. package/dist/orchestration/maintenance.js +15 -14
  291. package/dist/{orchestrator-qJ07zI8H.d.ts → orchestrator-BshGam-o.d.ts} +45 -19
  292. package/dist/orchestrator.d.ts +11 -9
  293. package/dist/orchestrator.js +109 -104
  294. package/dist/patterns-cli.d.ts +3 -1
  295. package/dist/{pipeline-WFCxhHOn.d.ts → pipeline-D21Rs6gW.d.ts} +1 -1
  296. package/dist/policy-runtime.d.ts +3 -1
  297. package/dist/proactive-contention.d.ts +3 -1
  298. package/dist/provenance.d.ts +3 -1
  299. package/dist/{qmd-5tzkQ44y.d.ts → qmd-Dhle1P4X.d.ts} +1 -1
  300. package/dist/qmd-preflight.d.ts +4 -2
  301. package/dist/qmd-recall-cache.d.ts +3 -1
  302. package/dist/qmd.d.ts +4 -2
  303. package/dist/qmd.js +4 -4
  304. package/dist/recall-concurrency-config.d.ts +3 -1
  305. package/dist/recall-disclosure-escalation.d.ts +3 -1
  306. package/dist/recall-explain-renderer.d.ts +3 -1
  307. package/dist/recall-explain-renderer.js +3 -3
  308. package/dist/recall-memory-map.d.ts +3 -1
  309. package/dist/recall-planner-llm.d.ts +3 -1
  310. package/dist/recall-planner-llm.js +3 -3
  311. package/dist/recall-state.d.ts +7 -1
  312. package/dist/recall-state.js +1 -1
  313. package/dist/recall-tag-filter.d.ts +3 -1
  314. package/dist/recall-timings.d.ts +3 -1
  315. package/dist/recall-xray-cli.d.ts +3 -1
  316. package/dist/recall-xray-cli.js +4 -4
  317. package/dist/recall-xray-renderer.d.ts +3 -1
  318. package/dist/recall-xray-renderer.js +3 -3
  319. package/dist/recall-xray.d.ts +7 -1
  320. package/dist/recall-xray.js +2 -2
  321. package/dist/reconcile/cursor.d.ts +3 -1
  322. package/dist/reconcile/manifest.d.ts +3 -1
  323. package/dist/reconcile/plan.d.ts +3 -1
  324. package/dist/replay/normalizers/chatgpt.d.ts +3 -1
  325. package/dist/replay/normalizers/claude.d.ts +3 -1
  326. package/dist/replay/normalizers/openclaw.d.ts +3 -1
  327. package/dist/replay/normalizers/shared.d.ts +3 -1
  328. package/dist/replay/runner.d.ts +3 -1
  329. package/dist/replay/types.d.ts +3 -1
  330. package/dist/replica-divergence.d.ts +3 -1
  331. package/dist/replica-peers-config.d.ts +3 -1
  332. package/dist/resolve-auth-token.d.ts +3 -1
  333. package/dist/resume-bundles.js +6 -4
  334. package/dist/retrieval-agents.d.ts +4 -2
  335. package/dist/retrieval-tiers.d.ts +3 -1
  336. package/dist/routing/engine.d.ts +3 -1
  337. package/dist/routing/store.d.ts +3 -1
  338. package/dist/salvage-envelope.d.ts +3 -1
  339. package/dist/schemas.d.ts +116 -116
  340. package/dist/{scope-profiles--vfXPl3X.d.ts → scope-profiles-NzGPDXLn.d.ts} +1 -1
  341. package/dist/search/embed-helper.d.ts +3 -1
  342. package/dist/search/factory.d.ts +3 -1
  343. package/dist/search/factory.js +6 -6
  344. package/dist/search/index.d.ts +3 -1
  345. package/dist/search/index.js +12 -12
  346. package/dist/search/lancedb-backend.d.ts +3 -1
  347. package/dist/search/meilisearch-backend.d.ts +3 -1
  348. package/dist/search/noop-backend.d.ts +3 -1
  349. package/dist/search/orama-backend.d.ts +3 -1
  350. package/dist/search/port.d.ts +3 -1
  351. package/dist/search/remote-backend.d.ts +3 -1
  352. package/dist/{semantic-consolidation-BBDuP9nJ.d.ts → semantic-consolidation-DLDKvyy5.d.ts} +1 -1
  353. package/dist/semantic-consolidation.d.ts +4 -2
  354. package/dist/semantic-consolidation.js +11 -10
  355. package/dist/semantic-rule-promotion.js +10 -9
  356. package/dist/semantic-rule-verifier.d.ts +3 -1
  357. package/dist/semantic-rule-verifier.js +10 -9
  358. package/dist/{service-B8DtbpCM.d.ts → service-BIgVM7fL.d.ts} +2 -2
  359. package/dist/session-observer-bands.d.ts +3 -1
  360. package/dist/session-observer-state.d.ts +3 -1
  361. package/dist/shared-context/manager.d.ts +11 -9
  362. package/dist/signal.d.ts +3 -1
  363. package/dist/source-agent-qualifier.d.ts +3 -1
  364. package/dist/source-agent-qualifier.js +18 -17
  365. package/dist/{storage-BkYN1RIy.d.ts → storage-CVfGWqCI.d.ts} +7 -6
  366. package/dist/storage.d.ts +4 -2
  367. package/dist/storage.js +9 -8
  368. package/dist/summarizer.d.ts +3 -1
  369. package/dist/summary-snapshot.d.ts +3 -1
  370. package/dist/temporal-supersession.d.ts +4 -2
  371. package/dist/temporal-timeline-recall.d.ts +3 -1
  372. package/dist/temporal-validity.d.ts +3 -1
  373. package/dist/threading.d.ts +3 -1
  374. package/dist/tier-migration.d.ts +4 -2
  375. package/dist/tier-routing.d.ts +3 -1
  376. package/dist/topics.d.ts +3 -1
  377. package/dist/transcript.d.ts +3 -1
  378. package/dist/transfer/autodetect.js +1 -1
  379. package/dist/transfer/backup.js +1 -1
  380. package/dist/transfer/capsule-export.js +2 -2
  381. package/dist/transfer/types.d.ts +66 -66
  382. package/dist/trust-score-stage.d.ts +3 -1
  383. package/dist/trust-score.d.ts +3 -1
  384. package/dist/{types-u2s9j1uD.d.ts → types-CkiDUorT.d.ts} +10 -16
  385. package/dist/types.d.ts +3 -1
  386. package/dist/types.js +1 -1
  387. package/dist/utility-runtime.d.ts +3 -1
  388. package/dist/verified-recall.js +10 -9
  389. package/dist/write-envelope.d.ts +3 -1
  390. package/package.json +2 -2
  391. package/src/archive-mutation-version.ts +59 -0
  392. package/src/config.test.ts +45 -0
  393. package/src/config.ts +10 -30
  394. package/src/contradiction/contradiction.test.ts +86 -1
  395. package/src/contradiction-config.ts +92 -0
  396. package/src/graph-path-reconstruction.ts +91 -0
  397. package/src/graph-path-scoring-config.ts +55 -0
  398. package/src/graph-path-scoring.test.ts +238 -0
  399. package/src/graph-path-scoring.ts +77 -0
  400. package/src/graph.test.ts +225 -5
  401. package/src/graph.ts +72 -5
  402. package/src/orchestration/contradiction-linking-coordinator.ts +246 -76
  403. package/src/orchestration/contradiction-localization.integration.test.ts +1953 -0
  404. package/src/orchestration/extraction-anchor-snapshot.ts +83 -0
  405. package/src/orchestration/extraction-persist-deps.ts +8 -2
  406. package/src/orchestration/extraction-persist.ts +43 -34
  407. package/src/orchestration/graph-path-state-loader.test.ts +801 -0
  408. package/src/orchestration/graph-path-state-loader.ts +318 -0
  409. package/src/orchestration/graph-recall-coordinator.integration.test.ts +1163 -0
  410. package/src/orchestration/graph-recall-coordinator.ts +206 -29
  411. package/src/orchestration/graph-recall-seam.ts +19 -0
  412. package/src/orchestration/recall-internal-deps.ts +7 -13
  413. package/src/orchestration/recall-internal.ts +5 -0
  414. package/src/orchestration/recall-introspection.ts +9 -1
  415. package/src/orchestration/recall-search-pipeline.ts +8 -13
  416. package/src/orchestration/update-localization.test.ts +784 -0
  417. package/src/orchestration/update-localization.ts +173 -0
  418. package/src/orchestrator.ts +19 -18
  419. package/src/recall-state.test.ts +29 -1
  420. package/src/recall-state.ts +13 -0
  421. package/src/recall-xray-renderer.test.ts +45 -0
  422. package/src/recall-xray-renderer.ts +16 -0
  423. package/src/recall-xray.ts +13 -0
  424. package/src/storage/supersession-side-effects.ts +97 -0
  425. package/src/storage/tombstone-blocked-capture-sync.ts +13 -5
  426. package/src/storage-contract/cache-coherence.test.ts +299 -0
  427. package/src/storage.ts +86 -88
  428. package/src/types.ts +12 -15
  429. package/dist/chunk-A4QMKFFO.js.map +0 -1
  430. package/dist/chunk-BJYET5TX.js.map +0 -1
  431. package/dist/chunk-BOFVT6P3.js.map +0 -1
  432. package/dist/chunk-IK6X5QPO.js.map +0 -1
  433. package/dist/chunk-IXXABW5A.js.map +0 -1
  434. package/dist/chunk-L2DPF4DF.js.map +0 -1
  435. package/dist/chunk-LAQ33B5D.js.map +0 -1
  436. package/dist/chunk-NSGU76YO.js.map +0 -1
  437. package/dist/chunk-PDEKQWDV.js.map +0 -1
  438. /package/dist/{graph-edge-decay-Z6ENALU2.js.map → archive-mutation-version.js.map} +0 -0
  439. /package/dist/{chunk-KDG2KTWW.js.map → chunk-33SV3E43.js.map} +0 -0
  440. /package/dist/{chunk-2HGUDBRJ.js.map → chunk-37ZO6LLJ.js.map} +0 -0
  441. /package/dist/{chunk-QW3WFHKU.js.map → chunk-45BRYON6.js.map} +0 -0
  442. /package/dist/{chunk-GZICBRWK.js.map → chunk-4F6X3RXW.js.map} +0 -0
  443. /package/dist/{chunk-7BAYBYY5.js.map → chunk-4PC4PRJE.js.map} +0 -0
  444. /package/dist/{chunk-VJXY5ZCT.js.map → chunk-52UKFTUK.js.map} +0 -0
  445. /package/dist/{chunk-ESG7Z255.js.map → chunk-5UDMFE3Q.js.map} +0 -0
  446. /package/dist/{chunk-JPHEOE6Z.js.map → chunk-6MTSFX7A.js.map} +0 -0
  447. /package/dist/{chunk-M4MP34AQ.js.map → chunk-AHZOMHWN.js.map} +0 -0
  448. /package/dist/{chunk-Z3RHPGSY.js.map → chunk-AIUBBHSF.js.map} +0 -0
  449. /package/dist/{chunk-S3AYIQCU.js.map → chunk-AXIDQG5A.js.map} +0 -0
  450. /package/dist/{chunk-QN7NTKRC.js.map → chunk-AZ2QBGYB.js.map} +0 -0
  451. /package/dist/{chunk-47J4EDGR.js.map → chunk-AZM4CCAC.js.map} +0 -0
  452. /package/dist/{chunk-LEJPSMKM.js.map → chunk-C5QLI33R.js.map} +0 -0
  453. /package/dist/{chunk-SV3PSA7Y.js.map → chunk-CV6BBVYV.js.map} +0 -0
  454. /package/dist/{chunk-V7X767RT.js.map → chunk-DCZBSE4F.js.map} +0 -0
  455. /package/dist/{chunk-7PKFPLLZ.js.map → chunk-FXTYIA46.js.map} +0 -0
  456. /package/dist/{chunk-64BHFFKZ.js.map → chunk-HLYR2TQL.js.map} +0 -0
  457. /package/dist/{chunk-5C2HNJMO.js.map → chunk-J5LLX6IL.js.map} +0 -0
  458. /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
  459. /package/dist/{chunk-PLKFO2HJ.js.map → chunk-JL43BVDE.js.map} +0 -0
  460. /package/dist/{chunk-2S72LWKX.js.map → chunk-JYL3BVVZ.js.map} +0 -0
  461. /package/dist/{chunk-IPLYGWQF.js.map → chunk-KQAFEZQX.js.map} +0 -0
  462. /package/dist/{chunk-PYKKWQZ2.js.map → chunk-M7BXDKPR.js.map} +0 -0
  463. /package/dist/{chunk-Z54EM5YZ.js.map → chunk-MAXVH44E.js.map} +0 -0
  464. /package/dist/{chunk-LYMNZZIM.js.map → chunk-NIS256NW.js.map} +0 -0
  465. /package/dist/{chunk-67QG75MJ.js.map → chunk-NLK2VZYZ.js.map} +0 -0
  466. /package/dist/{chunk-JYIFGGEM.js.map → chunk-OUKBMQ2O.js.map} +0 -0
  467. /package/dist/{chunk-75XOWNRS.js.map → chunk-OYESWJ43.js.map} +0 -0
  468. /package/dist/{chunk-TS4AJ2GI.js.map → chunk-PA45XCUD.js.map} +0 -0
  469. /package/dist/{chunk-4MBPIL4V.js.map → chunk-PUSLMZBQ.js.map} +0 -0
  470. /package/dist/{chunk-RVO6TCTU.js.map → chunk-QCECHYZL.js.map} +0 -0
  471. /package/dist/{chunk-GFIKG4FR.js.map → chunk-QGR6OVGT.js.map} +0 -0
  472. /package/dist/{chunk-HNZKVLAN.js.map → chunk-S354QO4R.js.map} +0 -0
  473. /package/dist/{chunk-NO37MR45.js.map → chunk-SOEN6KCF.js.map} +0 -0
  474. /package/dist/{chunk-FXX6RQYC.js.map → chunk-TPTECFWR.js.map} +0 -0
  475. /package/dist/{chunk-GDDGZVFI.js.map → chunk-UEVLYVNW.js.map} +0 -0
  476. /package/dist/{chunk-YQ4IQ2GA.js.map → chunk-UT5BV5OG.js.map} +0 -0
  477. /package/dist/{chunk-LNTUXKBT.js.map → chunk-UYYW2KPU.js.map} +0 -0
  478. /package/dist/{chunk-QSYL5CXK.js.map → chunk-VKXWK44Q.js.map} +0 -0
  479. /package/dist/{chunk-KMWYZTIE.js.map → chunk-VMMQDEN5.js.map} +0 -0
  480. /package/dist/{chunk-JB6D7EFB.js.map → chunk-VVG2BOKA.js.map} +0 -0
  481. /package/dist/{chunk-V5H6OJCR.js.map → chunk-W5XVQFLM.js.map} +0 -0
  482. /package/dist/{chunk-OIOZ6MOP.js.map → chunk-W6FNX2LP.js.map} +0 -0
  483. /package/dist/{chunk-6QPHF6RR.js.map → chunk-WQM326GS.js.map} +0 -0
  484. /package/dist/{chunk-TQFHQPWD.js.map → chunk-XADV5IZ3.js.map} +0 -0
  485. /package/dist/{chunk-DATDLJAO.js.map → chunk-XAPMEU3K.js.map} +0 -0
  486. /package/dist/{chunk-N3LL5NEU.js.map → chunk-ZMYDYNI4.js.map} +0 -0
@@ -4,10 +4,10 @@
4
4
  * Owns the graph-expansion subsystem in recall: spreading-activation
5
5
  * traversal from seed memories, seed-path resolution relative to
6
6
  * per-namespace storage, and the last-graph-recall snapshot persistence.
7
- * Behavior-preserving move from orchestrator.ts no logic changes; the
8
- * orchestrator constructs one instance and keeps thin delegating methods so
9
- * existing call sites (recallInternal, cold-fallback pipeline) continue to
10
- * work.
7
+ * Behavior-preserving move from orchestrator.ts with bounded graph-state
8
+ * lookups and optional path scoring. The orchestrator constructs one instance
9
+ * and keeps thin delegating methods so existing call sites (recallInternal,
10
+ * cold-fallback pipeline) continue to work.
11
11
  *
12
12
  * Config, storage, graph index, namespace resolution, and QMD result
13
13
  * resolution are accessed through getter callbacks (not captured at
@@ -27,6 +27,10 @@ import type { StorageManager } from "../index.js";
27
27
  import type { GraphIndex } from "../graph.js";
28
28
  import type { GraphRecallExpandedEntry } from "../recall-state.js";
29
29
  import { clampGraphRecallExpandedEntries } from "../recall-state.js";
30
+ import { scoreEvidencePathDetail, type PathNodeState } from "../graph-path-scoring.js";
31
+ import { isValidAsOf, isValidityExpiredNow } from "../temporal-validity.js";
32
+ import { inferMemoryStatus, toMemoryPathRel } from "../memory-lifecycle-ledger-utils.js";
33
+ import { GraphPathStateLoader } from "./graph-path-state-loader.js";
30
34
  import { qmdCollectionPathParts } from "./qmd-result-resolver.js";
31
35
  import { log } from "../logger.js";
32
36
  import { createHash } from "node:crypto";
@@ -113,6 +117,21 @@ export function blendGraphExpandedRecallScore(options: {
113
117
  return Math.max(minBound, Math.min(maxBound, blended));
114
118
  }
115
119
 
120
+ const KNOWN_PATH_NODE_STATUSES: Record<string, true> = {
121
+ active: true,
122
+ pending_review: true,
123
+ rejected: true,
124
+ quarantined: true,
125
+ superseded: true,
126
+ archived: true,
127
+ forgotten: true,
128
+ };
129
+
130
+ function normalizeInferredPathNodeStatus(value: unknown): PathNodeState["status"] {
131
+ if (typeof value !== "string" || KNOWN_PATH_NODE_STATUSES[value] !== true) return null;
132
+ return value as Exclude<PathNodeState["status"], null>;
133
+ }
134
+
116
135
  // ---------------------------------------------------------------------------
117
136
  // Coordinator
118
137
  // ---------------------------------------------------------------------------
@@ -139,7 +158,7 @@ export class GraphRecallCoordinator {
139
158
  recallNamespaces: readonly string[],
140
159
  preferredNamespace?: string,
141
160
  ) => Promise<MemoryFile | null>;
142
-
161
+ private readonly graphPathStateLoader = new GraphPathStateLoader();
143
162
  constructor(options: {
144
163
  getConfig: () => PluginConfig;
145
164
  getStorage: () => StorageManager;
@@ -173,10 +192,14 @@ export class GraphRecallCoordinator {
173
192
  this.readQmdResultMemory = options.readQmdResultMemory;
174
193
  }
175
194
 
195
+
176
196
  async expandResultsViaGraph(options: {
177
197
  memoryResults: QmdSearchResult[];
178
198
  recallNamespaces: string[];
179
199
  recallResultLimit: number;
200
+ /** Query-time instant used for graph-path invalidity checks. */
201
+ asOf?: string;
202
+ asOfMs?: number;
180
203
  deadlineAtMs?: number | null;
181
204
  /** Issue #681 — when true, bypass graphTraversalConfidenceFloor. */
182
205
  includeLowConfidence?: boolean;
@@ -187,6 +210,36 @@ export class GraphRecallCoordinator {
187
210
  seedResults: QmdSearchResult[];
188
211
  }> {
189
212
  const config = this.getConfig();
213
+ const parsedAsOfMs =
214
+ typeof options.asOf === "string" ? Date.parse(options.asOf) : Number.NaN;
215
+ const hasHistoricalAsOf =
216
+ Number.isFinite(parsedAsOfMs) ||
217
+ (typeof options.asOfMs === "number" && Number.isFinite(options.asOfMs));
218
+ const effectiveAsOfMs = Number.isFinite(parsedAsOfMs)
219
+ ? parsedAsOfMs
220
+ : typeof options.asOfMs === "number" && Number.isFinite(options.asOfMs)
221
+ ? options.asOfMs
222
+ : Date.now();
223
+ const effectiveAsOf = new Date(effectiveAsOfMs).toISOString();
224
+ const isEligibleGraphCandidate = (memory: MemoryFile, storageDir: string): boolean => {
225
+ if (hasHistoricalAsOf && !isValidAsOf(memory.frontmatter, effectiveAsOfMs)) {
226
+ return false;
227
+ }
228
+ if (
229
+ !hasHistoricalAsOf &&
230
+ config.temporalBiTemporal === true &&
231
+ config.temporalExpiredInInjection !== true &&
232
+ isValidityExpiredNow(memory.frontmatter, Date.now())
233
+ ) {
234
+ return false;
235
+ }
236
+ const lifecyclePath = toMemoryPathRel(storageDir, memory.path);
237
+ const status = inferMemoryStatus(memory.frontmatter, lifecyclePath);
238
+ return (
239
+ status === "active" ||
240
+ (status === "superseded" && hasHistoricalAsOf)
241
+ );
242
+ };
190
243
  const deadlineExpired = (): boolean =>
191
244
  typeof options.deadlineAtMs === "number" &&
192
245
  Date.now() >= options.deadlineAtMs;
@@ -275,6 +328,11 @@ export class GraphRecallCoordinator {
275
328
 
276
329
  const perNamespaceSeedCap = Math.max(3, options.recallResultLimit);
277
330
  const perNamespaceExpandedCap = Math.max(8, options.recallResultLimit * 2);
331
+ const graphPathStateLoadLimit = Math.min(
332
+ 200,
333
+ perNamespaceExpandedCap + Math.max(8, perNamespaceExpandedCap * 4),
334
+ );
335
+ const graphCandidateScanLimit = hasHistoricalAsOf ? 200 : graphPathStateLoadLimit;
278
336
  const seedPaths: string[] = [];
279
337
  const seedResults: QmdSearchResult[] = [];
280
338
  const expandedPaths: GraphRecallExpandedEntry[] = [];
@@ -296,9 +354,7 @@ export class GraphRecallCoordinator {
296
354
  : (
297
355
  await Promise.all(
298
356
  seedCandidates.map((result) =>
299
- this.graphSeedPathRelativeToStorage(storage, result, [
300
- namespace,
301
- ]),
357
+ this.graphSeedPathRelativeToStorage(storage, result, [namespace]),
302
358
  ),
303
359
  )
304
360
  ).filter(
@@ -316,11 +372,28 @@ export class GraphRecallCoordinator {
316
372
  ...seedRelativePaths.map((rel) => path.join(storage.dir, rel)),
317
373
  );
318
374
  const seedSet = new Set(seedRelativePaths);
375
+ const nodeMemoryCache = new Map<string, MemoryFile | null>();
376
+ const readGraphNode = async (
377
+ nodeId: string,
378
+ allowArchiveLookup: boolean,
379
+ ): Promise<MemoryFile | null> => {
380
+ if (nodeMemoryCache.has(nodeId)) return nodeMemoryCache.get(nodeId) ?? null;
381
+ const memory = await this.graphPathStateLoader.readNode(
382
+ storage,
383
+ nodeId,
384
+ options.deadlineAtMs,
385
+ allowArchiveLookup,
386
+ );
387
+ nodeMemoryCache.set(nodeId, memory);
388
+ return memory;
389
+ };
390
+ const scoringEnabled = config.graphPathScoring.enabled;
319
391
  const expanded = await this.graphIndexFor(storage).spreadingActivation(
320
392
  seedRelativePaths,
321
393
  config.maxGraphTraversalSteps,
322
394
  {
323
395
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
396
+ ...(scoringEnabled ? { recordPaths: true } : {}),
324
397
  ...(typeof options.deadlineAtMs === "number"
325
398
  ? { deadlineAtMs: options.deadlineAtMs }
326
399
  : {}),
@@ -329,35 +402,115 @@ export class GraphRecallCoordinator {
329
402
  if (expanded.length === 0) continue;
330
403
  if (deadlineExpired()) break;
331
404
 
332
- for (const candidate of expanded.slice(0, perNamespaceExpandedCap)) {
405
+ if (!scoringEnabled) {
406
+ let eligibleCount = 0;
407
+ for (const candidate of expanded.slice(0, graphCandidateScanLimit)) {
408
+ if (seedSet.has(candidate.path)) continue;
409
+ const memory = await readGraphNode(candidate.path, false);
410
+ if (deadlineExpired()) break;
411
+ if (!memory) continue;
412
+ if (/(?:^|[\\/])artifacts(?:[\\/]|$)/i.test(memory.path)) continue;
413
+ if (!isEligibleGraphCandidate(memory, storage.dir)) continue;
414
+ const score = blendGraphExpandedRecallScore({
415
+ graphActivationScore: candidate.score,
416
+ seedRecallScore,
417
+ activationWeight: config.graphExpansionActivationWeight,
418
+ blendMin: config.graphExpansionBlendMin,
419
+ blendMax: config.graphExpansionBlendMax,
420
+ });
421
+ expandedResults.push({
422
+ docid: memory.frontmatter.id,
423
+ path: memory.path,
424
+ namespace,
425
+ snippet: memory.content.slice(0, 400),
426
+ score,
427
+ });
428
+ expandedPaths.push({
429
+ path: memory.path,
430
+ score,
431
+ namespace,
432
+ seed: path.resolve(storage.dir, candidate.seed),
433
+ hopDepth: candidate.hopDepth,
434
+ decayedWeight: candidate.decayedWeight,
435
+ graphType: candidate.graphType,
436
+ edgeConfidence: candidate.edgeConfidence,
437
+ });
438
+ eligibleCount += 1;
439
+ if (eligibleCount >= perNamespaceExpandedCap) break;
440
+ }
441
+ continue;
442
+ }
443
+ const nodeStates = new Map<string, PathNodeState>();
444
+ const addState = (memory: MemoryFile): PathNodeState => {
445
+ const relativePath = graphPathRelativeToStorage(storage.dir, memory.path);
446
+ const lifecyclePath = toMemoryPathRel(storage.dir, memory.path);
447
+ const state: PathNodeState = {
448
+ id: memory.frontmatter.id,
449
+ status: normalizeInferredPathNodeStatus(
450
+ inferMemoryStatus(memory.frontmatter, lifecyclePath),
451
+ ),
452
+ created: memory.frontmatter.created,
453
+ valid_at: memory.frontmatter.valid_at,
454
+ invalid_at: memory.frontmatter.invalid_at,
455
+ supersededAt: memory.frontmatter.supersededAt,
456
+ eventTimeSource: memory.frontmatter.eventTimeSource,
457
+ };
458
+ const add = (key: string): void => {
459
+ if (!nodeStates.has(key)) nodeStates.set(key, state);
460
+ };
461
+ add(memory.frontmatter.id);
462
+ if (relativePath) {
463
+ add(relativePath);
464
+ if (relativePath.endsWith(".md")) add(path.basename(relativePath, ".md"));
465
+ }
466
+ return state;
467
+ };
468
+
469
+ const scoredExpanded: Array<{
470
+ result: QmdSearchResult;
471
+ entry: GraphRecallExpandedEntry;
472
+ }> = [];
473
+ for (const candidate of expanded.slice(0, graphCandidateScanLimit)) {
333
474
  if (deadlineExpired()) break;
334
475
  if (seedSet.has(candidate.path)) continue;
335
- const memoryPath = path.resolve(storage.dir, candidate.path);
336
- const memory = await storage.readMemoryByPath(memoryPath);
476
+ const memory = await readGraphNode(candidate.path, true);
337
477
  if (deadlineExpired()) break;
338
478
  if (!memory) continue;
339
479
  if (/(?:^|[\\/])artifacts(?:[\\/]|$)/i.test(memory.path)) continue;
340
- if (memory.frontmatter.status && memory.frontmatter.status !== "active")
341
- continue;
480
+ if (!isEligibleGraphCandidate(memory, storage.dir)) continue;
342
481
 
343
- const snippet = memory.content.slice(0, 400);
344
- const score = blendGraphExpandedRecallScore({
482
+ if (candidate.activationPath) {
483
+ for (const nodeId of candidate.activationPath.nodeIds.slice(1, -1)) {
484
+ if (deadlineExpired()) break;
485
+ const intermediate = await readGraphNode(nodeId, true);
486
+ if (deadlineExpired()) break;
487
+ if (!intermediate) {
488
+ log.debug(`graph path scoring missing intermediate memory state: ${nodeId}`);
489
+ continue;
490
+ }
491
+ const state = addState(intermediate);
492
+ nodeStates.set(nodeId, { ...state, id: nodeId });
493
+ }
494
+ if (deadlineExpired()) break;
495
+ }
496
+
497
+ const pathScoreDetail = scoreEvidencePathDetail(
498
+ candidate.activationPath ?? null,
499
+ nodeStates,
500
+ {
501
+ asOf: effectiveAsOf,
502
+ invalidNodePenalty: config.graphPathScoring.invalidNodePenalty,
503
+ },
504
+ );
505
+ const blendedScore = blendGraphExpandedRecallScore({
345
506
  graphActivationScore: candidate.score,
346
507
  seedRecallScore,
347
508
  activationWeight: config.graphExpansionActivationWeight,
348
509
  blendMin: config.graphExpansionBlendMin,
349
510
  blendMax: config.graphExpansionBlendMax,
350
511
  });
351
- expandedResults.push({
352
- docid: memory.frontmatter.id,
353
- // Absolute path, matching the globally-unique identity of primary
354
- // fanout hits, so the merge dedups a memory found by both (#2020).
355
- path: memory.path,
356
- namespace,
357
- snippet,
358
- score,
359
- });
360
- expandedPaths.push({
512
+ const score = blendedScore * pathScoreDetail.score;
513
+ const entry: GraphRecallExpandedEntry = {
361
514
  path: memory.path,
362
515
  score,
363
516
  namespace,
@@ -365,13 +518,37 @@ export class GraphRecallCoordinator {
365
518
  hopDepth: candidate.hopDepth,
366
519
  decayedWeight: candidate.decayedWeight,
367
520
  graphType: candidate.graphType,
368
- // Issue #681 PR 3/3 — surface the per-edge confidence used for
369
- // PageRank weighting / floor pruning so downstream observability
370
- // (recall_xray, memory_graph_explain) can attribute ranking and
371
- // pruning decisions to specific edges.
372
521
  edgeConfidence: candidate.edgeConfidence,
522
+ pathPenaltyApplied: pathScoreDetail.pathPenaltyApplied,
523
+ ...(config.graphPathScoring.includePathInProvenance &&
524
+ candidate.activationPath
525
+ ? { pathNodeIds: candidate.activationPath.nodeIds }
526
+ : {}),
527
+ };
528
+ scoredExpanded.push({
529
+ result: {
530
+ docid: memory.frontmatter.id,
531
+ path: memory.path,
532
+ namespace,
533
+ snippet: memory.content.slice(0, 400),
534
+ score,
535
+ pathPenaltyApplied: pathScoreDetail.pathPenaltyApplied,
536
+ ...(config.graphPathScoring.includePathInProvenance &&
537
+ candidate.activationPath
538
+ ? { pathNodeIds: candidate.activationPath.nodeIds }
539
+ : {}),
540
+ },
541
+ entry,
373
542
  });
374
543
  }
544
+ scoredExpanded.sort((a, b) => {
545
+ if (a.result.score !== b.result.score) return a.result.score > b.result.score ? -1 : 1;
546
+ return a.result.path < b.result.path ? -1 : a.result.path > b.result.path ? 1 : 0;
547
+ });
548
+ for (const item of scoredExpanded.slice(0, perNamespaceExpandedCap)) {
549
+ expandedResults.push(item.result);
550
+ expandedPaths.push(item.entry);
551
+ }
375
552
  }
376
553
 
377
554
  const namespacedPrimaryResults = Array.from(byNamespace.entries()).flatMap(
@@ -0,0 +1,19 @@
1
+ import type { QmdSearchResult } from "../types.js";
2
+ import type { GraphRecallExpandedEntry } from "../recall-state.js";
3
+
4
+ export interface GraphRecallExpansionOptions {
5
+ memoryResults: QmdSearchResult[];
6
+ recallNamespaces: string[];
7
+ recallResultLimit: number;
8
+ asOf?: string;
9
+ asOfMs?: number;
10
+ deadlineAtMs?: number | null;
11
+ includeLowConfidence?: boolean;
12
+ }
13
+
14
+ export interface GraphRecallExpansionResult {
15
+ merged: QmdSearchResult[];
16
+ seedPaths: string[];
17
+ expandedPaths: GraphRecallExpandedEntry[];
18
+ seedResults: QmdSearchResult[];
19
+ }
@@ -35,6 +35,10 @@ import type { CodingContext, EngramTraceEvent, IdentityInjectionMode, MemoryFile
35
35
  import type { VerifiedEpisodeResult } from "../verified-recall.js";
36
36
  import type { WorkProductLedgerSearchResult } from "../work-product-ledger.js";
37
37
  import type { GraphRecallRankedResult, GraphRecallShadowComparison } from "./graph-recall-coordinator.js";
38
+ import type {
39
+ GraphRecallExpansionOptions,
40
+ GraphRecallExpansionResult,
41
+ } from "./graph-recall-seam.js";
38
42
  import type { RecallRerankCoordinator, RecallResultPartitionSink } from "./recall-rerank-coordinator.js";
39
43
  import type { ArtifactRecallOptions } from "./recall-search-prefilter.js";
40
44
  import type { RecallSectionAppendOptions, RecallSectionBuckets } from "./recall-section-coordinator.js";
@@ -194,19 +198,9 @@ export interface RecallInternalDeps {
194
198
  ): QmdSearchResult[];
195
199
  effectiveCronRecallInstructionHeavyTokenCap(): number;
196
200
  emitTrace(event: EngramTraceEvent): void;
197
- expandResultsViaGraph(options: {
198
- memoryResults: QmdSearchResult[];
199
- recallNamespaces: string[];
200
- recallResultLimit: number;
201
- deadlineAtMs?: number | null;
202
- includeLowConfidence?: boolean;
203
- }): Promise<{
204
- merged: QmdSearchResult[];
205
- seedPaths: string[];
206
- expandedPaths: GraphRecallExpandedEntry[];
207
- seedResults: QmdSearchResult[];
208
- }>;
209
- extractMemoryIdsFromResults(results: QmdSearchResult[]): string[];
201
+ expandResultsViaGraph(
202
+ options: GraphRecallExpansionOptions,
203
+ ): Promise<GraphRecallExpansionResult>;
210
204
  readonly fastLlmForRerank: {
211
205
  chatCompletion: (
212
206
  messages: Array<{ role: string; content: string }>,
@@ -3746,6 +3746,7 @@ export class RecallInternalCoordinator {
3746
3746
  recallResultLimit,
3747
3747
  deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
3748
3748
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
3749
+ ...(typeof asOfMs === "number" ? { asOfMs } : {}),
3749
3750
  }),
3750
3751
  null as Awaited<ReturnType<typeof this.deps.expandResultsViaGraph>> | null,
3751
3752
  );
@@ -5088,6 +5089,10 @@ export class RecallInternalCoordinator {
5088
5089
  servedBy,
5089
5090
  scoreDecomposition,
5090
5091
  admittedBy: [],
5092
+ ...(xrayResult?.pathNodeIds ? { pathNodeIds: xrayResult.pathNodeIds } : {}),
5093
+ ...(typeof xrayResult?.pathPenaltyApplied === "boolean"
5094
+ ? { pathPenaltyApplied: xrayResult.pathPenaltyApplied }
5095
+ : {}),
5091
5096
  ...(provenance ? { provenance } : {}),
5092
5097
  ...(sourceSpan ? { sourceSpan } : {}),
5093
5098
  // Issue #1577 — per-result trust projection for X-ray visibility.
@@ -328,7 +328,15 @@ export class RecallIntrospectionCoordinator {
328
328
  typeof e.edgeConfidence === "number" && Number.isFinite(e.edgeConfidence)
329
329
  ? e.edgeConfidence.toFixed(2)
330
330
  : "n/a";
331
- return `- ${e.path} (score=${e.score.toFixed(3)}, ns=${e.namespace}, seed=${e.seed || "unknown"}, hop=${e.hopDepth}, w=${e.decayedWeight.toFixed(3)}, type=${e.graphType}, conf=${confLabel})`;
331
+ const pathLabel =
332
+ Array.isArray(e.pathNodeIds) && e.pathNodeIds.length > 0
333
+ ? `, path=${e.pathNodeIds.join("->")}`
334
+ : "";
335
+ const penaltyLabel =
336
+ typeof e.pathPenaltyApplied === "boolean"
337
+ ? `, penalty=${e.pathPenaltyApplied ? "yes" : "no"}`
338
+ : "";
339
+ return `- ${e.path} (score=${e.score.toFixed(3)}, ns=${e.namespace}, seed=${e.seed || "unknown"}, hop=${e.hopDepth}, w=${e.decayedWeight.toFixed(3)}, type=${e.graphType}, conf=${confLabel}${penaltyLabel}${pathLabel})`;
332
340
  }),
333
341
  `Final ranked results (${snapshot.finalResults?.length ?? 0}, showing ${finalResults.length}):`,
334
342
  ...finalResults.map(
@@ -28,7 +28,10 @@ import { NamespaceStorageRouter } from "../namespaces/storage.js";
28
28
  import { NegativeExampleStore } from "../negative.js";
29
29
  import { qmdCollectionPathParts } from "./qmd-result-resolver.js";
30
30
  import type { RecallRerankCoordinator, RecallResultPartitionSink } from "./recall-rerank-coordinator.js";
31
- import type { GraphRecallExpandedEntry } from "../recall-state.js";
31
+ import type {
32
+ GraphRecallExpansionOptions,
33
+ GraphRecallExpansionResult,
34
+ } from "./graph-recall-seam.js";
32
35
  import { RelevanceStore } from "../relevance.js";
33
36
  import { RerankCache, rerankLocalOrNoop, reorderByRankedKeys } from "../rerank.js";
34
37
  import type { SearchBackend, SearchDegradation, SearchExecutionOptions, SearchQueryOptions } from "../search/port.js";
@@ -119,18 +122,9 @@ export interface RecallSearchPipelineDeps {
119
122
  ): QmdSearchResult[];
120
123
  effectiveRecencyWeight(): number;
121
124
  readonly embeddingFallback: EmbeddingFallback;
122
- expandResultsViaGraph(options: {
123
- memoryResults: QmdSearchResult[];
124
- recallNamespaces: string[];
125
- recallResultLimit: number;
126
- deadlineAtMs?: number | null;
127
- includeLowConfidence?: boolean;
128
- }): Promise<{
129
- merged: QmdSearchResult[];
130
- seedPaths: string[];
131
- expandedPaths: GraphRecallExpandedEntry[];
132
- seedResults: QmdSearchResult[];
133
- }>;
125
+ expandResultsViaGraph(
126
+ options: GraphRecallExpansionOptions,
127
+ ): Promise<GraphRecallExpansionResult>;
134
128
  readonly fastLlmForRerank: {
135
129
  chatCompletion: (
136
130
  messages: Array<{ role: string; content: string }>,
@@ -814,6 +808,7 @@ export class RecallSearchPipelineCoordinator {
814
808
  recallResultLimit: options.recallResultLimit,
815
809
  deadlineAtMs: options.deadlineAtMs,
816
810
  ...(options.includeLowConfidence === true ? { includeLowConfidence: true } : {}),
811
+ ...(typeof options.asOfMs === "number" ? { asOfMs: options.asOfMs } : {}),
817
812
  });
818
813
  results = merged;
819
814
  }