@remnic/core 9.64.4 → 9.65.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 (473) hide show
  1. package/dist/access-admin-ops-surface.d.ts +12 -11
  2. package/dist/access-admin-ops-surface.js +36 -35
  3. package/dist/access-authorization-probe.d.ts +12 -11
  4. package/dist/access-authorization-probe.js +37 -36
  5. package/dist/access-boundary.d.ts +12 -11
  6. package/dist/access-boundary.js +36 -35
  7. package/dist/access-cli.js +91 -88
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +2 -1
  10. package/dist/access-extraction-force-flush.d.ts +12 -11
  11. package/dist/access-extraction-force-flush.js +36 -35
  12. package/dist/access-health-types.d.ts +2 -1
  13. package/dist/access-http-lcm-compaction.d.ts +12 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +12 -11
  15. package/dist/access-http-offline-stream.d.ts +12 -11
  16. package/dist/access-http-query.d.ts +3 -2
  17. package/dist/access-http-query.js +38 -37
  18. package/dist/access-http.d.ts +13 -12
  19. package/dist/access-http.js +49 -48
  20. package/dist/access-identity-continuity-surface.d.ts +10 -9
  21. package/dist/access-identity-continuity-surface.js +36 -35
  22. package/dist/access-lcm-surface.d.ts +12 -11
  23. package/dist/access-lcm-surface.js +36 -35
  24. package/dist/access-mcp.d.ts +12 -11
  25. package/dist/access-mcp.js +42 -41
  26. package/dist/access-memory-search-fanout.d.ts +3 -2
  27. package/dist/{access-namespace-preflight-CYeI1R2_.d.ts → access-namespace-preflight-BKUnKsBv.d.ts} +1 -1
  28. package/dist/access-namespace-preflight.d.ts +4 -3
  29. package/dist/access-namespace-preflight.js +36 -35
  30. package/dist/access-observe-write-surface.d.ts +12 -11
  31. package/dist/access-observe-write-surface.js +36 -35
  32. package/dist/access-offline-manifest.d.ts +10 -9
  33. package/dist/access-operations-batch.js +38 -37
  34. package/dist/access-operations.d.ts +12 -11
  35. package/dist/access-operations.js +41 -40
  36. package/dist/access-recall-concurrency.d.ts +12 -11
  37. package/dist/access-recall-concurrency.js +36 -35
  38. package/dist/access-recall-response.d.ts +12 -11
  39. package/dist/access-recall-response.js +36 -35
  40. package/dist/access-recall-surface.d.ts +12 -11
  41. package/dist/access-recall-surface.js +36 -35
  42. package/dist/{access-service-BKtdXnyk.d.ts → access-service-B1Lbb-nQ.d.ts} +13 -13
  43. package/dist/access-service-helpers.d.ts +12 -11
  44. package/dist/access-service.d.ts +12 -11
  45. package/dist/access-service.js +36 -35
  46. package/dist/access-surface-catalog.d.ts +12 -11
  47. package/dist/access-surface-catalog.js +38 -37
  48. package/dist/access-surface-catalog.js.map +1 -1
  49. package/dist/access-wearables-meetings-surface.d.ts +4 -3
  50. package/dist/action-confidence.d.ts +2 -1
  51. package/dist/active-memory-bridge.d.ts +2 -1
  52. package/dist/active-recall.d.ts +2 -1
  53. package/dist/active-recall.js +4 -2
  54. package/dist/active-recall.js.map +1 -1
  55. package/dist/ambient-provenance.d.ts +2 -1
  56. package/dist/artifact-search.d.ts +2 -1
  57. package/dist/behavior-learner.d.ts +2 -1
  58. package/dist/behavior-signals.d.ts +2 -1
  59. package/dist/bootstrap.d.ts +10 -9
  60. package/dist/briefing-window.d.ts +3 -2
  61. package/dist/briefing.d.ts +3 -2
  62. package/dist/briefing.js +15 -14
  63. package/dist/buffer-surprise-report.d.ts +2 -1
  64. package/dist/buffer-turn-helpers.d.ts +2 -1
  65. package/dist/buffer.d.ts +3 -2
  66. package/dist/buffer.js +5 -5
  67. package/dist/bulk-import/index.d.ts +4 -3
  68. package/dist/calibration.d.ts +2 -1
  69. package/dist/capabilities.d.ts +2 -1
  70. package/dist/{catalog-CLAqQO2L.d.ts → catalog-DjVhJoRM.d.ts} +1 -1
  71. package/dist/causal-behavior.d.ts +2 -1
  72. package/dist/causal-behavior.js +2 -2
  73. package/dist/causal-chain.js +2 -2
  74. package/dist/causal-consolidation.d.ts +2 -1
  75. package/dist/causal-consolidation.js +18 -17
  76. package/dist/causal-consolidation.js.map +1 -1
  77. package/dist/causal-retrieval.js +2 -2
  78. package/dist/causal-trajectory-graph.d.ts +2 -1
  79. package/dist/causal-trajectory-graph.js +2 -2
  80. package/dist/causal-trajectory.js +1 -1
  81. package/dist/{chunk-5HERQ5FX.js → chunk-256FBCVX.js} +5 -5
  82. package/dist/{chunk-GVRLED7R.js → chunk-2572MRP2.js} +2 -2
  83. package/dist/{chunk-TY35YQ6E.js → chunk-3MADV4YC.js} +2 -2
  84. package/dist/{chunk-XACYILRA.js → chunk-3PXVYJMC.js} +31 -31
  85. package/dist/{chunk-DC4FJY2G.js → chunk-3RHFGGI5.js} +4 -4
  86. package/dist/{chunk-LOETWOEB.js → chunk-3TMYV3LP.js} +2 -2
  87. package/dist/chunk-3WU7XOFN.js +102 -0
  88. package/dist/chunk-3WU7XOFN.js.map +1 -0
  89. package/dist/{chunk-XH4IQVTN.js → chunk-4W6INNXO.js} +2 -2
  90. package/dist/{chunk-SB6YBB2V.js → chunk-53ENM6F6.js} +2 -2
  91. package/dist/{chunk-7V3AZWWZ.js → chunk-5UYSCYR7.js} +9 -7
  92. package/dist/{chunk-7V3AZWWZ.js.map → chunk-5UYSCYR7.js.map} +1 -1
  93. package/dist/{chunk-Z6CJLYXT.js → chunk-63FHSH7E.js} +3 -3
  94. package/dist/{chunk-DG6MJD7W.js → chunk-6JJT5AKI.js} +2 -2
  95. package/dist/{chunk-7BVO64UC.js → chunk-6L27N6YI.js} +2 -2
  96. package/dist/chunk-7PHI6GUI.js +95 -0
  97. package/dist/chunk-7PHI6GUI.js.map +1 -0
  98. package/dist/{chunk-YXGU3MDQ.js → chunk-7PWWGYGO.js} +2 -2
  99. package/dist/{chunk-CKZHKFY3.js → chunk-7QFBLYFP.js} +3 -3
  100. package/dist/{chunk-RWLRKMZK.js → chunk-AGKIG3YA.js} +2 -2
  101. package/dist/{chunk-A2IBK3TG.js → chunk-ALCJRQ72.js} +2 -2
  102. package/dist/{chunk-44DSGZFF.js → chunk-BC4QD3FM.js} +2 -2
  103. package/dist/{chunk-YMOPYG3K.js → chunk-BIJAWZYW.js} +6 -6
  104. package/dist/{chunk-KRPE7ANR.js → chunk-CCTVAVTT.js} +2 -2
  105. package/dist/{chunk-VYEPACWY.js → chunk-CEH2AFXG.js} +7 -7
  106. package/dist/{chunk-XBRGJJK7.js → chunk-CEQF6L5K.js} +3 -3
  107. package/dist/{chunk-PVIXAMWM.js → chunk-CFRBTATE.js} +2 -2
  108. package/dist/{chunk-UIYYS2YI.js → chunk-CTQRPANJ.js} +2 -2
  109. package/dist/{chunk-XZUCNVGE.js → chunk-CUS6S7PN.js} +10 -10
  110. package/dist/{chunk-KWIGDKM2.js → chunk-D2YNNDML.js} +2 -2
  111. package/dist/{chunk-MJRVF7SF.js → chunk-DBXZZIDU.js} +87 -56
  112. package/dist/chunk-DBXZZIDU.js.map +1 -0
  113. package/dist/{chunk-2QI2JBLQ.js → chunk-DEFI2QBT.js} +16 -10
  114. package/dist/chunk-DEFI2QBT.js.map +1 -0
  115. package/dist/{chunk-JCSUNXYJ.js → chunk-ESCQ6LY7.js} +3 -3
  116. package/dist/{chunk-652S5A5D.js → chunk-EUYWQ7TS.js} +2 -2
  117. package/dist/{chunk-ML3U4KPR.js → chunk-GIC6BASP.js} +2 -2
  118. package/dist/{chunk-ZSYE2QVJ.js → chunk-GXWDWOWP.js} +2 -2
  119. package/dist/{chunk-55SJFHVD.js → chunk-HJQZQUPC.js} +11 -11
  120. package/dist/{chunk-6LTCUN3T.js → chunk-HQSBYI5X.js} +2 -2
  121. package/dist/{chunk-H5CGAD7L.js → chunk-HQSPXTQO.js} +1 -1
  122. package/dist/{chunk-EJDLQRUO.js → chunk-HUNSEO5U.js} +2 -2
  123. package/dist/{chunk-ON2P3SHG.js → chunk-IAY7YBXS.js} +2 -2
  124. package/dist/{chunk-MB6GLPRY.js → chunk-IVKIODHO.js} +4 -4
  125. package/dist/{chunk-CUIAHZPZ.js → chunk-IXRC7EQG.js} +2 -2
  126. package/dist/{chunk-VRYEXPRX.js → chunk-JFJ3MHGV.js} +1 -1
  127. package/dist/{chunk-VRYEXPRX.js.map → chunk-JFJ3MHGV.js.map} +1 -1
  128. package/dist/{chunk-LZKCMK3U.js → chunk-JTSVMJHV.js} +2 -2
  129. package/dist/{chunk-URS5GSM7.js → chunk-JXN77SGO.js} +1 -1
  130. package/dist/chunk-JXN77SGO.js.map +1 -0
  131. package/dist/{chunk-WBM5NR4E.js → chunk-KPBLJCCV.js} +2 -2
  132. package/dist/{chunk-VLES5S4K.js → chunk-LWVO2QZV.js} +36 -36
  133. package/dist/{chunk-NO7B6DRB.js → chunk-LYIZXQYY.js} +2 -2
  134. package/dist/{chunk-7RAJ3GXO.js → chunk-M6L7HI7R.js} +2 -156
  135. package/dist/chunk-M6L7HI7R.js.map +1 -0
  136. package/dist/{chunk-VUP47UJI.js → chunk-MIBKEW7A.js} +3 -3
  137. package/dist/{chunk-OQIRBGUU.js → chunk-N37X5RU7.js} +2 -2
  138. package/dist/{chunk-C6AKYOFO.js → chunk-N6TRHP72.js} +2 -2
  139. package/dist/{chunk-VANZKHTN.js → chunk-NNBZS3DY.js} +2 -2
  140. package/dist/{chunk-2PSX5BJU.js → chunk-NZPFCP5A.js} +2 -2
  141. package/dist/{chunk-LTBKKSCX.js → chunk-OLBZ2WGG.js} +2 -2
  142. package/dist/{chunk-PD66CVSD.js → chunk-OUKBMQ2O.js} +2 -2
  143. package/dist/{chunk-GPFZFCRN.js → chunk-PP7R754B.js} +1 -1
  144. package/dist/{chunk-TKI2WOL5.js → chunk-R3AAOKR2.js} +2 -2
  145. package/dist/{chunk-RNORDDD6.js → chunk-S2VBSTTA.js} +2 -2
  146. package/dist/{chunk-3A46U7XG.js → chunk-SYJ6EKKE.js} +2 -2
  147. package/dist/{chunk-YFQTDE7N.js → chunk-VJ6ECBIP.js} +2 -2
  148. package/dist/{chunk-IFK3PVM7.js → chunk-VPGRXEAB.js} +2 -2
  149. package/dist/{chunk-246HFJVG.js → chunk-VZVP2W4O.js} +2 -2
  150. package/dist/{chunk-SHQFYZTD.js → chunk-W6TSGWYS.js} +2 -2
  151. package/dist/{chunk-DA2O3F5V.js → chunk-WTOE7CW4.js} +13 -13
  152. package/dist/{chunk-IJXECCUV.js → chunk-X5SDZMO7.js} +2 -2
  153. package/dist/chunk-XAB6STPO.js +160 -0
  154. package/dist/chunk-XAB6STPO.js.map +1 -0
  155. package/dist/{chunk-DHKV6E4A.js → chunk-Y23B2QXP.js} +2 -2
  156. package/dist/{chunk-PE76XIDM.js → chunk-YEQEGSJA.js} +3 -3
  157. package/dist/{chunk-UMDZXW5J.js → chunk-YQ3CBLL4.js} +5 -85
  158. package/dist/chunk-YQ3CBLL4.js.map +1 -0
  159. package/dist/{chunk-VYISFWVX.js → chunk-YQNNHLCG.js} +2 -2
  160. package/dist/{chunk-3LOQN3TO.js → chunk-Z54TXZ2F.js} +3 -3
  161. package/dist/{cli-CLvBewKf.d.ts → cli-Pulnz-qm.d.ts} +5 -5
  162. package/dist/cli.d.ts +14 -13
  163. package/dist/cli.js +70 -67
  164. package/dist/coding/pre-action-gate.d.ts +2 -1
  165. package/dist/coding/pre-action-gate.js +2 -2
  166. package/dist/compounding/engine.d.ts +3 -2
  167. package/dist/compounding/engine.js +15 -14
  168. package/dist/compounding/preference-consolidator.d.ts +2 -1
  169. package/dist/compression-optimizer.d.ts +2 -1
  170. package/dist/config.d.ts +2 -1
  171. package/dist/config.js +4 -2
  172. package/dist/connectors/codex-materialize-runner.d.ts +2 -1
  173. package/dist/connectors/codex-materialize-runner.js +15 -14
  174. package/dist/connectors/codex-materialize.d.ts +2 -1
  175. package/dist/connectors/index.d.ts +2 -1
  176. package/dist/connectors/index.js +15 -14
  177. package/dist/consolidation-provenance-check.d.ts +3 -2
  178. package/dist/consolidation-undo.d.ts +3 -2
  179. package/dist/contradiction/index.d.ts +3 -2
  180. package/dist/converge-config.d.ts +2 -1
  181. package/dist/convergence-refresh.d.ts +3 -2
  182. package/dist/convergence-refresh.js +17 -16
  183. package/dist/conversation-index/backend.d.ts +2 -1
  184. package/dist/conversation-index/chunker.d.ts +2 -1
  185. package/dist/conversation-index/faiss-adapter.d.ts +2 -1
  186. package/dist/conversation-index/indexer.d.ts +2 -1
  187. package/dist/conversation-index/search.d.ts +2 -1
  188. package/dist/corpus-watermark.d.ts +2 -1
  189. package/dist/corpus-watermark.js +17 -16
  190. package/dist/cross-lingual-recall.d.ts +70 -0
  191. package/dist/cross-lingual-recall.js +14 -0
  192. package/dist/day-summary.d.ts +2 -1
  193. package/dist/delinearize.d.ts +2 -1
  194. package/dist/dependency-propagation-config.d.ts +2 -1
  195. package/dist/{dependency-propagation-delivery-DMqIw9Zh.d.ts → dependency-propagation-delivery-Co17gxYb.d.ts} +1 -1
  196. package/dist/direct-answer-wiring.d.ts +2 -1
  197. package/dist/direct-answer.d.ts +2 -1
  198. package/dist/embedding-fallback.d.ts +2 -1
  199. package/dist/enrichment/index.d.ts +2 -1
  200. package/dist/entity-origin-fields.d.ts +2 -1
  201. package/dist/entity-retrieval.d.ts +3 -2
  202. package/dist/entity-retrieval.js +15 -14
  203. package/dist/entity-schema.d.ts +2 -1
  204. package/dist/episodic-context.d.ts +2 -1
  205. package/dist/explicit-capture.d.ts +10 -9
  206. package/dist/external-wiki-access.d.ts +12 -11
  207. package/dist/external-wiki-access.js +37 -36
  208. package/dist/external-wiki-collection-registration.d.ts +2 -1
  209. package/dist/external-wiki-collection.d.ts +2 -1
  210. package/dist/external-wiki-mcp-tools.d.ts +12 -11
  211. package/dist/extraction-error-classification.d.ts +2 -1
  212. package/dist/extraction-faithfulness.d.ts +2 -1
  213. package/dist/extraction-judge-telemetry.d.ts +2 -1
  214. package/dist/extraction-judge-training.d.ts +2 -1
  215. package/dist/extraction-judge.d.ts +2 -1
  216. package/dist/extraction-liveness.d.ts +2 -1
  217. package/dist/extraction-normalization.d.ts +2 -1
  218. package/dist/extraction-prompt.d.ts +2 -1
  219. package/dist/extraction-source-grounding-rules.d.ts +2 -1
  220. package/dist/extraction-source-grounding.d.ts +2 -1
  221. package/dist/extraction.d.ts +2 -1
  222. package/dist/extraction.js +20 -19
  223. package/dist/fallback-llm.d.ts +2 -1
  224. package/dist/graph-dashboard-diff.d.ts +2 -1
  225. package/dist/graph-dashboard-key.d.ts +2 -1
  226. package/dist/graph-dashboard-parser.d.ts +2 -1
  227. package/dist/{graph-edge-decay-A4SDFMMS.js → graph-edge-decay-FXGELBFA.js} +4 -4
  228. package/dist/graph-edge-decay-FXGELBFA.js.map +1 -0
  229. package/dist/graph-edge-reinforcement.d.ts +2 -1
  230. package/dist/graph-path-reconstruction.d.ts +2 -1
  231. package/dist/graph-path-scoring.d.ts +2 -1
  232. package/dist/graph-snapshot.d.ts +2 -1
  233. package/dist/graph-snapshot.js +3 -3
  234. package/dist/graph.d.ts +2 -1
  235. package/dist/graph.js +3 -3
  236. package/dist/harmonic-retrieval.js +1 -1
  237. package/dist/importance.d.ts +2 -1
  238. package/dist/importers/index.d.ts +2 -1
  239. package/dist/in-flight-reads.d.ts +2 -1
  240. package/dist/index.d.ts +24 -23
  241. package/dist/index.js +130 -126
  242. package/dist/intent.d.ts +2 -1
  243. package/dist/lcm/engine.d.ts +2 -1
  244. package/dist/lcm/engine.js +2 -2
  245. package/dist/lcm/index.d.ts +2 -1
  246. package/dist/lcm/index.js +5 -5
  247. package/dist/lcm/tools.d.ts +2 -1
  248. package/dist/lifecycle.d.ts +2 -1
  249. package/dist/live-connectors-runner.d.ts +2 -1
  250. package/dist/local-llm.d.ts +2 -1
  251. package/dist/local-llm.js +2 -2
  252. package/dist/local-model-endpoint.d.ts +2 -1
  253. package/dist/location/index.d.ts +295 -0
  254. package/dist/location/index.js +798 -0
  255. package/dist/location/index.js.map +1 -0
  256. package/dist/maintenance/memory-governance.d.ts +2 -1
  257. package/dist/maintenance/memory-governance.js +15 -14
  258. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
  259. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +15 -14
  260. package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
  261. package/dist/maintenance/rebuild-memory-projection.js +16 -15
  262. package/dist/{maintenance-DITiehFX.d.ts → maintenance-DiSLtVN7.d.ts} +3 -3
  263. package/dist/mcp-memory-inspector-app.d.ts +12 -11
  264. package/dist/memory-action-policy.d.ts +2 -1
  265. package/dist/memory-cache.d.ts +2 -1
  266. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  267. package/dist/memory-projection-store.d.ts +2 -1
  268. package/dist/memory-provenance.d.ts +2 -1
  269. package/dist/memory-snapshot.d.ts +2 -1
  270. package/dist/memory-worth-outcomes.d.ts +3 -2
  271. package/dist/models-json.d.ts +2 -1
  272. package/dist/namespaces/migrate.d.ts +4 -3
  273. package/dist/namespaces/migrate.js +16 -15
  274. package/dist/namespaces/principal.d.ts +2 -1
  275. package/dist/namespaces/search.d.ts +2 -1
  276. package/dist/namespaces/search.js +10 -10
  277. package/dist/namespaces/storage.d.ts +4 -3
  278. package/dist/namespaces/storage.js +15 -14
  279. package/dist/native-knowledge.d.ts +2 -1
  280. package/dist/offline-sync-impression-drain.d.ts +2 -1
  281. package/dist/operator-doctor-corpus.d.ts +2 -1
  282. package/dist/operator-doctor-corpus.js +18 -17
  283. package/dist/operator-doctor-replica.d.ts +2 -1
  284. package/dist/operator-toolkit.d.ts +4 -3
  285. package/dist/operator-toolkit.js +29 -26
  286. package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
  287. package/dist/orchestration/maintenance.d.ts +5 -4
  288. package/dist/orchestration/maintenance.js +23 -21
  289. package/dist/{orchestrator-6fPa2l9x.d.ts → orchestrator-DzCaxNS4.d.ts} +8 -8
  290. package/dist/orchestrator.d.ts +10 -9
  291. package/dist/orchestrator.js +92 -89
  292. package/dist/patterns-cli.d.ts +2 -1
  293. package/dist/{pipeline-DHpYtfM3.d.ts → pipeline-HJ8DKbFl.d.ts} +1 -1
  294. package/dist/policy-runtime.d.ts +2 -1
  295. package/dist/proactive-contention.d.ts +2 -1
  296. package/dist/provenance.d.ts +2 -1
  297. package/dist/{public-http-BT36aBb-.d.ts → public-http-DwXauTX3.d.ts} +1 -1
  298. package/dist/{qmd-BaX31tM0.d.ts → qmd-BzxluoLt.d.ts} +1 -1
  299. package/dist/qmd-preflight.d.ts +3 -2
  300. package/dist/qmd-recall-cache.d.ts +2 -1
  301. package/dist/qmd.d.ts +3 -2
  302. package/dist/qmd.js +5 -5
  303. package/dist/recall-concurrency-config.d.ts +2 -1
  304. package/dist/recall-disclosure-escalation.d.ts +2 -1
  305. package/dist/recall-explain-renderer.d.ts +2 -1
  306. package/dist/recall-explain-renderer.js +3 -3
  307. package/dist/recall-memory-map.d.ts +2 -1
  308. package/dist/recall-planner-llm.d.ts +2 -1
  309. package/dist/recall-state.d.ts +2 -1
  310. package/dist/recall-tag-filter.d.ts +2 -1
  311. package/dist/recall-timings.d.ts +2 -1
  312. package/dist/recall-xray-cli.d.ts +2 -1
  313. package/dist/recall-xray-cli.js +4 -4
  314. package/dist/recall-xray-renderer.d.ts +2 -1
  315. package/dist/recall-xray-renderer.js +3 -3
  316. package/dist/recall-xray.d.ts +2 -1
  317. package/dist/recall-xray.js +2 -2
  318. package/dist/reconcile/cursor.d.ts +2 -1
  319. package/dist/reconcile/manifest.d.ts +2 -1
  320. package/dist/reconcile/plan.d.ts +2 -1
  321. package/dist/replay/normalizers/chatgpt.d.ts +2 -1
  322. package/dist/replay/normalizers/claude.d.ts +2 -1
  323. package/dist/replay/normalizers/openclaw.d.ts +2 -1
  324. package/dist/replay/normalizers/shared.d.ts +2 -1
  325. package/dist/replay/runner.d.ts +2 -1
  326. package/dist/replay/types.d.ts +2 -1
  327. package/dist/replica-divergence.d.ts +2 -1
  328. package/dist/replica-peers-config.d.ts +2 -1
  329. package/dist/resolve-auth-token.d.ts +2 -1
  330. package/dist/resume-bundles.js +5 -3
  331. package/dist/retrieval-agents.d.ts +3 -2
  332. package/dist/retrieval-tiers.d.ts +2 -1
  333. package/dist/routing/engine.d.ts +2 -1
  334. package/dist/routing/store.d.ts +2 -1
  335. package/dist/salvage-envelope.d.ts +2 -1
  336. package/dist/schemas.d.ts +30 -30
  337. package/dist/{scope-profiles-1hYWJ9bM.d.ts → scope-profiles-CEMZz0t5.d.ts} +1 -1
  338. package/dist/search/embed-helper.d.ts +2 -1
  339. package/dist/search/factory.d.ts +2 -1
  340. package/dist/search/factory.js +9 -9
  341. package/dist/search/index.d.ts +2 -1
  342. package/dist/search/index.js +13 -13
  343. package/dist/search/lancedb-backend.d.ts +2 -1
  344. package/dist/search/lancedb-backend.js +2 -2
  345. package/dist/search/meilisearch-backend.d.ts +2 -1
  346. package/dist/search/meilisearch-backend.js +2 -2
  347. package/dist/search/noop-backend.d.ts +2 -1
  348. package/dist/search/orama-backend.d.ts +2 -1
  349. package/dist/search/orama-backend.js +2 -2
  350. package/dist/search/port.d.ts +3 -2
  351. package/dist/search/port.js +1 -1
  352. package/dist/search/remote-backend.d.ts +2 -1
  353. package/dist/search/remote-backend.js +2 -2
  354. package/dist/{semantic-consolidation-Chmddvcg.d.ts → semantic-consolidation-D9dYj6vu.d.ts} +1 -1
  355. package/dist/semantic-consolidation.d.ts +3 -2
  356. package/dist/semantic-consolidation.js +16 -15
  357. package/dist/semantic-rule-promotion.js +15 -14
  358. package/dist/semantic-rule-verifier.d.ts +2 -1
  359. package/dist/semantic-rule-verifier.js +15 -14
  360. package/dist/{service-DMs_dCCg.d.ts → service-_qgST_0y.d.ts} +2 -2
  361. package/dist/session-observer-bands.d.ts +2 -1
  362. package/dist/session-observer-state.d.ts +2 -1
  363. package/dist/shared-context/manager.d.ts +2 -1
  364. package/dist/signal.d.ts +2 -1
  365. package/dist/source-agent-qualifier.d.ts +2 -1
  366. package/dist/source-agent-qualifier.js +17 -16
  367. package/dist/{storage-CzorrpcN.d.ts → storage-B9lbNTYE.d.ts} +1 -1
  368. package/dist/storage.d.ts +3 -2
  369. package/dist/storage.js +14 -13
  370. package/dist/summarizer.d.ts +2 -1
  371. package/dist/summarizer.js +3 -3
  372. package/dist/summary-snapshot.d.ts +2 -1
  373. package/dist/support-passport/index.d.ts +15 -14
  374. package/dist/support-passport/index.js +39 -38
  375. package/dist/temporal-supersession.d.ts +3 -2
  376. package/dist/temporal-timeline-recall.d.ts +2 -1
  377. package/dist/temporal-validity.d.ts +2 -1
  378. package/dist/threading.d.ts +2 -1
  379. package/dist/tier-migration.d.ts +3 -2
  380. package/dist/tier-routing.d.ts +2 -1
  381. package/dist/topics.d.ts +2 -1
  382. package/dist/transcript.d.ts +2 -1
  383. package/dist/transfer/types.d.ts +12 -12
  384. package/dist/trust-score-stage.d.ts +2 -1
  385. package/dist/trust-score.d.ts +2 -1
  386. package/dist/{types-BP5MC8UU.d.ts → types-BrEzuxPA.d.ts} +3 -23
  387. package/dist/types-CM86alG1.d.ts +89 -0
  388. package/dist/types.d.ts +2 -1
  389. package/dist/types.js +1 -1
  390. package/dist/utility-runtime.d.ts +2 -1
  391. package/dist/verified-recall.js +15 -14
  392. package/dist/who-knows-cli.d.ts +12 -11
  393. package/dist/who-knows-cli.js +16 -15
  394. package/dist/who-knows.d.ts +12 -11
  395. package/dist/who-knows.js +15 -14
  396. package/dist/write-envelope.d.ts +2 -1
  397. package/package.json +12 -2
  398. package/src/cross-lingual-recall.test.ts +47 -0
  399. package/src/cross-lingual-recall.ts +186 -0
  400. package/src/location/adapter-isolation.test.ts +44 -0
  401. package/src/location/index.ts +16 -0
  402. package/src/orchestration/recall-internal-deps.ts +2 -0
  403. package/src/orchestration/recall-internal.ts +35 -33
  404. package/src/orchestration/recall-search-pipeline.ts +16 -0
  405. package/src/search/port.ts +2 -1
  406. package/src/storage.ts +5 -1
  407. package/src/types.ts +2 -0
  408. package/dist/chunk-2QI2JBLQ.js.map +0 -1
  409. package/dist/chunk-7RAJ3GXO.js.map +0 -1
  410. package/dist/chunk-MJRVF7SF.js.map +0 -1
  411. package/dist/chunk-UMDZXW5J.js.map +0 -1
  412. package/dist/chunk-URS5GSM7.js.map +0 -1
  413. /package/dist/{chunk-5HERQ5FX.js.map → chunk-256FBCVX.js.map} +0 -0
  414. /package/dist/{chunk-GVRLED7R.js.map → chunk-2572MRP2.js.map} +0 -0
  415. /package/dist/{chunk-TY35YQ6E.js.map → chunk-3MADV4YC.js.map} +0 -0
  416. /package/dist/{chunk-XACYILRA.js.map → chunk-3PXVYJMC.js.map} +0 -0
  417. /package/dist/{chunk-DC4FJY2G.js.map → chunk-3RHFGGI5.js.map} +0 -0
  418. /package/dist/{chunk-LOETWOEB.js.map → chunk-3TMYV3LP.js.map} +0 -0
  419. /package/dist/{chunk-XH4IQVTN.js.map → chunk-4W6INNXO.js.map} +0 -0
  420. /package/dist/{chunk-SB6YBB2V.js.map → chunk-53ENM6F6.js.map} +0 -0
  421. /package/dist/{chunk-Z6CJLYXT.js.map → chunk-63FHSH7E.js.map} +0 -0
  422. /package/dist/{chunk-DG6MJD7W.js.map → chunk-6JJT5AKI.js.map} +0 -0
  423. /package/dist/{chunk-7BVO64UC.js.map → chunk-6L27N6YI.js.map} +0 -0
  424. /package/dist/{chunk-YXGU3MDQ.js.map → chunk-7PWWGYGO.js.map} +0 -0
  425. /package/dist/{chunk-CKZHKFY3.js.map → chunk-7QFBLYFP.js.map} +0 -0
  426. /package/dist/{chunk-RWLRKMZK.js.map → chunk-AGKIG3YA.js.map} +0 -0
  427. /package/dist/{chunk-A2IBK3TG.js.map → chunk-ALCJRQ72.js.map} +0 -0
  428. /package/dist/{chunk-44DSGZFF.js.map → chunk-BC4QD3FM.js.map} +0 -0
  429. /package/dist/{chunk-YMOPYG3K.js.map → chunk-BIJAWZYW.js.map} +0 -0
  430. /package/dist/{chunk-KRPE7ANR.js.map → chunk-CCTVAVTT.js.map} +0 -0
  431. /package/dist/{chunk-VYEPACWY.js.map → chunk-CEH2AFXG.js.map} +0 -0
  432. /package/dist/{chunk-XBRGJJK7.js.map → chunk-CEQF6L5K.js.map} +0 -0
  433. /package/dist/{chunk-PVIXAMWM.js.map → chunk-CFRBTATE.js.map} +0 -0
  434. /package/dist/{chunk-UIYYS2YI.js.map → chunk-CTQRPANJ.js.map} +0 -0
  435. /package/dist/{chunk-XZUCNVGE.js.map → chunk-CUS6S7PN.js.map} +0 -0
  436. /package/dist/{chunk-KWIGDKM2.js.map → chunk-D2YNNDML.js.map} +0 -0
  437. /package/dist/{chunk-JCSUNXYJ.js.map → chunk-ESCQ6LY7.js.map} +0 -0
  438. /package/dist/{chunk-652S5A5D.js.map → chunk-EUYWQ7TS.js.map} +0 -0
  439. /package/dist/{chunk-ML3U4KPR.js.map → chunk-GIC6BASP.js.map} +0 -0
  440. /package/dist/{chunk-ZSYE2QVJ.js.map → chunk-GXWDWOWP.js.map} +0 -0
  441. /package/dist/{chunk-55SJFHVD.js.map → chunk-HJQZQUPC.js.map} +0 -0
  442. /package/dist/{chunk-6LTCUN3T.js.map → chunk-HQSBYI5X.js.map} +0 -0
  443. /package/dist/{chunk-H5CGAD7L.js.map → chunk-HQSPXTQO.js.map} +0 -0
  444. /package/dist/{chunk-EJDLQRUO.js.map → chunk-HUNSEO5U.js.map} +0 -0
  445. /package/dist/{chunk-ON2P3SHG.js.map → chunk-IAY7YBXS.js.map} +0 -0
  446. /package/dist/{chunk-MB6GLPRY.js.map → chunk-IVKIODHO.js.map} +0 -0
  447. /package/dist/{chunk-CUIAHZPZ.js.map → chunk-IXRC7EQG.js.map} +0 -0
  448. /package/dist/{chunk-LZKCMK3U.js.map → chunk-JTSVMJHV.js.map} +0 -0
  449. /package/dist/{chunk-WBM5NR4E.js.map → chunk-KPBLJCCV.js.map} +0 -0
  450. /package/dist/{chunk-VLES5S4K.js.map → chunk-LWVO2QZV.js.map} +0 -0
  451. /package/dist/{chunk-NO7B6DRB.js.map → chunk-LYIZXQYY.js.map} +0 -0
  452. /package/dist/{chunk-VUP47UJI.js.map → chunk-MIBKEW7A.js.map} +0 -0
  453. /package/dist/{chunk-OQIRBGUU.js.map → chunk-N37X5RU7.js.map} +0 -0
  454. /package/dist/{chunk-C6AKYOFO.js.map → chunk-N6TRHP72.js.map} +0 -0
  455. /package/dist/{chunk-VANZKHTN.js.map → chunk-NNBZS3DY.js.map} +0 -0
  456. /package/dist/{chunk-2PSX5BJU.js.map → chunk-NZPFCP5A.js.map} +0 -0
  457. /package/dist/{chunk-LTBKKSCX.js.map → chunk-OLBZ2WGG.js.map} +0 -0
  458. /package/dist/{chunk-PD66CVSD.js.map → chunk-OUKBMQ2O.js.map} +0 -0
  459. /package/dist/{chunk-GPFZFCRN.js.map → chunk-PP7R754B.js.map} +0 -0
  460. /package/dist/{chunk-TKI2WOL5.js.map → chunk-R3AAOKR2.js.map} +0 -0
  461. /package/dist/{chunk-RNORDDD6.js.map → chunk-S2VBSTTA.js.map} +0 -0
  462. /package/dist/{chunk-3A46U7XG.js.map → chunk-SYJ6EKKE.js.map} +0 -0
  463. /package/dist/{chunk-YFQTDE7N.js.map → chunk-VJ6ECBIP.js.map} +0 -0
  464. /package/dist/{chunk-IFK3PVM7.js.map → chunk-VPGRXEAB.js.map} +0 -0
  465. /package/dist/{chunk-246HFJVG.js.map → chunk-VZVP2W4O.js.map} +0 -0
  466. /package/dist/{chunk-SHQFYZTD.js.map → chunk-W6TSGWYS.js.map} +0 -0
  467. /package/dist/{chunk-DA2O3F5V.js.map → chunk-WTOE7CW4.js.map} +0 -0
  468. /package/dist/{chunk-IJXECCUV.js.map → chunk-X5SDZMO7.js.map} +0 -0
  469. /package/dist/{chunk-DHKV6E4A.js.map → chunk-Y23B2QXP.js.map} +0 -0
  470. /package/dist/{chunk-PE76XIDM.js.map → chunk-YEQEGSJA.js.map} +0 -0
  471. /package/dist/{chunk-VYISFWVX.js.map → chunk-YQNNHLCG.js.map} +0 -0
  472. /package/dist/{chunk-3LOQN3TO.js.map → chunk-Z54TXZ2F.js.map} +0 -0
  473. /package/dist/{graph-edge-decay-A4SDFMMS.js.map → cross-lingual-recall.js.map} +0 -0
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Cross-lingual recall planner (issue #2197).
3
+ *
4
+ * Lexical tiers (BM25/FTS) match on shared surface tokens, so a query whose
5
+ * dominant script differs from the corpus's cannot retrieve lexically — an
6
+ * English query never token-overlaps a Japanese fact. When the planner
7
+ * detects that mismatch it leans on the vector tier (the embedding-fallback
8
+ * supplement in the recall search pipeline), and when NO vector tier exists
9
+ * it emits a {@link SearchDegradation} so "no results" stays distinguishable
10
+ * from "cross-script query, vectors unavailable" (rule 34).
11
+ *
12
+ * The write-time half is a dominant-script hint stamped into frontmatter
13
+ * `language` by `StorageManager.writeMemory` (ISO 15924 script codes);
14
+ * legacy files without the field simply do not vote for the corpus script.
15
+ */
16
+
17
+ import type { MemoryFile } from "./types.js";
18
+ import type { SearchDegradation } from "./search/port.js";
19
+
20
+ type CorpusLanguageStorage = {
21
+ dir: string;
22
+ readAllMemories: () => Promise<MemoryFile[]>;
23
+ getCorpusScanVersion: () => string;
24
+ };
25
+
26
+ /** Script classes the cheap detector can distinguish. ISO 15924 codes. */
27
+ export type LanguageHint =
28
+ | "latn"
29
+ | "jpan"
30
+ | "kore"
31
+ | "hani"
32
+ | "cyrl"
33
+ | "grek"
34
+ | "arab"
35
+ | "hebr"
36
+ | "thai"
37
+ | "deva";
38
+
39
+ /** Inclusive codepoint ranges per script class. `kana` folds into `jpan` at detection. */
40
+ const SCRIPT_RANGES: ReadonlyArray<readonly [LanguageHint | "kana", number, number]> = [
41
+ ["latn", 0x41, 0x5a],
42
+ ["latn", 0x61, 0x7a],
43
+ ["latn", 0xc0, 0x24f],
44
+ ["grek", 0x370, 0x3ff],
45
+ ["cyrl", 0x400, 0x4ff],
46
+ ["cyrl", 0x500, 0x52f],
47
+ ["hebr", 0x590, 0x5ff],
48
+ ["arab", 0x600, 0x6ff],
49
+ ["arab", 0x750, 0x77f],
50
+ ["deva", 0x900, 0x97f],
51
+ ["thai", 0xe00, 0xe7f],
52
+ ["kore", 0x1100, 0x11ff],
53
+ ["latn", 0x1e00, 0x1eff],
54
+ ["kana", 0x3040, 0x309f],
55
+ ["kana", 0x30a0, 0x30ff],
56
+ ["kana", 0x31f0, 0x31ff],
57
+ ["hani", 0x3400, 0x4dbf],
58
+ ["hani", 0x4e00, 0x9fff],
59
+ ["kore", 0xac00, 0xd7a3],
60
+ ["kana", 0xff66, 0xff9d],
61
+ ];
62
+
63
+ /**
64
+ * Dominant-script hint for a text. Codepoint-range counting (no regex):
65
+ * kana anywhere maps to `jpan` — kana is unique to Japanese and disambiguates
66
+ * it from `hani` (Chinese, or kanji-only Japanese). Returns `undefined` when
67
+ * the text contains no lettered script class.
68
+ */
69
+ export function detectLanguageHint(text: string): LanguageHint | undefined {
70
+ const counts = new Map<LanguageHint | "kana", number>();
71
+ for (let i = 0; i < text.length; i += 1) {
72
+ const code = text.charCodeAt(i);
73
+ for (const [script, low, high] of SCRIPT_RANGES) {
74
+ if (code < low) break;
75
+ if (code <= high) {
76
+ counts.set(script, (counts.get(script) ?? 0) + 1);
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ // SCRIPT_RANGES is sorted by start codepoint, so `break` on the first
82
+ // range starting past the codepoint is exact — one range test per char.
83
+ if (counts.has("kana")) return "jpan";
84
+ let best: LanguageHint | undefined;
85
+ let bestCount = 0;
86
+ for (const [script, count] of counts) {
87
+ if (script === "kana") continue;
88
+ if (count > bestCount) {
89
+ best = script;
90
+ bestCount = count;
91
+ }
92
+ }
93
+ return best;
94
+ }
95
+
96
+ /** Dominant hint over a corpus sample; `undefined` entries (legacy files) never vote. */
97
+ export function corpusDominantLanguage(
98
+ hints: Iterable<string | undefined>,
99
+ ): LanguageHint | undefined {
100
+ const counts = new Map<string, number>();
101
+ for (const hint of hints) {
102
+ if (hint === undefined || hint === "") continue;
103
+ counts.set(hint, (counts.get(hint) ?? 0) + 1);
104
+ }
105
+ let best: string | undefined;
106
+ let bestCount = 0;
107
+ for (const [hint, count] of counts) {
108
+ if (count > bestCount) {
109
+ best = hint;
110
+ bestCount = count;
111
+ }
112
+ }
113
+ return best as LanguageHint | undefined;
114
+ }
115
+
116
+ /** Planner decision for one recall query. */
117
+ export interface CrossScriptPlan {
118
+ queryLanguage: LanguageHint | undefined;
119
+ corpusLanguage: LanguageHint | undefined;
120
+ /** True when both hints resolved and differ — lexical tiers cannot serve this query. */
121
+ crossScript: boolean;
122
+ /** Emitted when `crossScript` is true and no vector tier can compensate. */
123
+ degradation?: SearchDegradation;
124
+ }
125
+
126
+ /**
127
+ * Pure planner core: compare query/corpus hints and, on a mismatch without a
128
+ * vector tier, build the visible degradation signal.
129
+ */
130
+ export function planCrossScript(input: {
131
+ queryLanguage: LanguageHint | undefined;
132
+ corpusLanguage: LanguageHint | undefined;
133
+ vectorTierAvailable: boolean;
134
+ }): CrossScriptPlan {
135
+ const crossScript =
136
+ input.queryLanguage !== undefined &&
137
+ input.corpusLanguage !== undefined &&
138
+ input.queryLanguage !== input.corpusLanguage;
139
+ return {
140
+ queryLanguage: input.queryLanguage,
141
+ corpusLanguage: input.corpusLanguage,
142
+ crossScript,
143
+ degradation:
144
+ crossScript && !input.vectorTierAvailable
145
+ ? {
146
+ backend: "qmd",
147
+ code: "vector_tier_unavailable",
148
+ detail:
149
+ `cross-script query (${input.queryLanguage}) over a ${input.corpusLanguage} corpus: ` +
150
+ "lexical recall cannot match across scripts — enable a multilingual embedding model " +
151
+ "(embedding fallback) so the vector tier can serve it",
152
+ }
153
+ : undefined,
154
+ };
155
+ }
156
+
157
+ /** Corpus sample cap: dominant script stabilizes well below the full corpus. */
158
+ const CORPUS_SAMPLE_CAP = 500;
159
+
160
+ /** Memoized dominant corpus language per storage dir, keyed by corpus scan version. */
161
+ const corpusLanguageCache = new Map<string, { version: string; language: LanguageHint | undefined }>();
162
+
163
+ /**
164
+ * Dominant corpus language for a storage manager, sampled from the newest
165
+ * frontmatter `language` hints (capped, memoized on the corpus scan version so
166
+ * recurring recalls pay one pass per corpus generation, not per query).
167
+ * Read failures degrade to `undefined` — never break recall.
168
+ */
169
+ export async function dominantCorpusLanguage(
170
+ storage: CorpusLanguageStorage,
171
+ ): Promise<LanguageHint | undefined> {
172
+ try {
173
+ const version = storage.getCorpusScanVersion();
174
+ const cached = corpusLanguageCache.get(storage.dir);
175
+ if (cached?.version === version) return cached.language;
176
+ const memories = await storage.readAllMemories();
177
+ const language = corpusDominantLanguage(
178
+ memories.slice(0, CORPUS_SAMPLE_CAP).map((memory: MemoryFile) => memory.frontmatter.language),
179
+ );
180
+ if (corpusLanguageCache.size > 8) corpusLanguageCache.clear();
181
+ corpusLanguageCache.set(storage.dir, { version, language });
182
+ return language;
183
+ } catch {
184
+ return undefined;
185
+ }
186
+ }
@@ -0,0 +1,44 @@
1
+ import assert from "node:assert/strict";
2
+ import { readdirSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { test } from "node:test";
5
+
6
+ /**
7
+ * Architecture boundary (issue #2045): `@remnic/core` must never statically
8
+ * depend on an optional provider package. Provider implementations register
9
+ * through the location registry at runtime; the connector package consumes
10
+ * core, never the reverse. A static import here would break à-la-carte
11
+ * installs (`npm install @remnic/core` alone must work) and drag a network
12
+ * adapter into every base install.
13
+ */
14
+ const FORBIDDEN_SPECIFIERS = ["@remnic/connector-reitti", "connector-reitti/src"];
15
+
16
+ // Production sources only: this test file itself names the banned specifier.
17
+ function collectSourceFiles(dir: string, files: string[] = []): string[] {
18
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
19
+ const path = join(dir, entry.name);
20
+ if (entry.isDirectory()) {
21
+ if (entry.name === "dist" || entry.name === "node_modules") continue;
22
+ collectSourceFiles(path, files);
23
+ } else if (entry.isFile() && /\.tsx?$/.test(entry.name) && !/\.test\.tsx?$/.test(entry.name)) {
24
+ files.push(path);
25
+ }
26
+ }
27
+ return files;
28
+ }
29
+
30
+ test("core source never statically imports @remnic/connector-reitti", () => {
31
+ // The whole core tree, not just src/location: a static import anywhere in
32
+ // core would break a base install.
33
+ const coreSrc = join(import.meta.dirname, "..");
34
+ const offenders: string[] = [];
35
+ for (const file of collectSourceFiles(coreSrc)) {
36
+ const content = readFileSync(file, "utf8");
37
+ for (const specifier of FORBIDDEN_SPECIFIERS) {
38
+ if (content.includes(specifier)) {
39
+ offenders.push(`${file} references ${specifier}`);
40
+ }
41
+ }
42
+ }
43
+ assert.deepEqual(offenders, []);
44
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Location context subsystem — public surface (issues #2044, #2045).
3
+ *
4
+ * Consumed by host adapters and optional provider packages via the
5
+ * `@remnic/core/location` subpath export; the root index stays frozen at its
6
+ * ratchet ceiling, and core never statically imports a provider package
7
+ * (register implementations through `registerLocationProvider` instead).
8
+ */
9
+
10
+ export * from "./types.js";
11
+ export * from "./registry.js";
12
+ export * from "./config.js";
13
+ export * from "./intervals.js";
14
+ export * from "./store.js";
15
+ export * from "./pipeline.js";
16
+ export * from "./cli.js";
@@ -219,6 +219,8 @@ export interface RecallInternalDeps {
219
219
  searchOptions?: SearchQueryOptions;
220
220
  onDebugSnapshot?: (snapshot: QmdRecallSnapshot) => Promise<void>;
221
221
  /** Backend degradation observer, threaded into every QMD call (#1536). */
222
+ /** Cross-lingual plan flag (#2197): supplement the lexical page with vector-tier hits. */
223
+ crossScript?: boolean;
222
224
  onDegradation?: (degradation: SearchDegradation) => void;
223
225
  abortSignal?: AbortSignal;
224
226
  },
@@ -25,6 +25,7 @@ import path from "node:path";
25
25
  import { type BoxFrontmatter } from "../boxes.js";
26
26
  import { type CapabilitySet, type GraphConstructionCapabilitySet, type MemoryLifecycleCapabilitySet, type SecurityCapabilitySet, resolveCapabilities, resolveCompressionCapabilities, resolveConsolidationCapabilities, resolveConversationContextCapabilities, resolveCreationMemoryCapabilities, resolveGraphConstructionCapabilities, resolveIdentityContinuityCapabilities, resolveIndexingCapabilities, resolveMemoryLifecycleCapabilities, resolveNamespaceCapabilities, resolveObjectiveStateCapabilities, resolvePipelineProcessingCapabilities, resolvePresentationCapabilities, resolveQmdCapabilities, resolveRecallAuxiliaryCapabilities, resolveRecallEnhancementCapabilities, resolveSecurityCapabilities } from "../capabilities.js";
27
27
  import { searchCausalTrajectories } from "../causal-trajectory.js";
28
+ import { detectLanguageHint, dominantCorpusLanguage, planCrossScript } from "../cross-lingual-recall.js";
28
29
  import { buildEntityRecallSection, entityRecentTranscriptLookbackHours, readRecentEntityTranscriptEntries } from "../entity-retrieval.js";
29
30
  import { buildEventOrderRecallSection, shouldRecallEventOrderEvidence } from "../event-order-recall.js";
30
31
  import { buildExplicitCueRecallSection } from "../explicit-cue-recall.js";
@@ -261,34 +262,22 @@ export class RecallInternalCoordinator {
261
262
  // per-result explain data (e.g. reinforcementBoost) from the result that
262
263
  // was actually served.
263
264
  let xrayRecalledResults: QmdSearchResult[] = [];
264
- // Issue #1577 — per-recall trust map (admitted + quarantined items).
265
- // A LOCAL, not instance state, so concurrent recalls on the same
266
- // orchestrator cannot race on it (review: shared-trust-map concurrency).
267
- // Populated by applyTrustScoreRerank on whichever recall path runs;
268
- // consumed by formatQmdResults (epistemic hedge), publishRecallResults
269
- // (quarantine filtering on ALL paths), and the X-ray capture (trust
270
- // projection + quarantined-item visibility — rule 34).
265
+ // Issue #1577 — per-recall trust map (admitted + quarantined). LOCAL, not
266
+ // instance state, so concurrent recalls cannot race on it. Consumed by
267
+ // formatQmdResults, publishRecallResults (quarantine filtering on ALL
268
+ // paths), and the X-ray capture (rule 34).
271
269
  let recallTrustByPath: Map<string, TrustStageResultItem> | null = null;
272
- // Issue #1577 — sink for the cold-fallback pipeline's trust map. The cold
273
- // pipeline scores internally (applyColdFallbackPipeline) and writes its
274
- // per-path trust map here; each cold caller reads it back into
275
- // recallTrustByPath so cold/embedding/recent paths feed the same X-ray +
276
- // epistemic-rendering + publisher-quarantine consumers the hot path uses
277
- // (rule 41: the feature gate applies across ALL parallel recall paths).
270
+ // Issue #1577 — sink for the cold pipeline's trust map: cold callers read
271
+ // it back into recallTrustByPath so every path feeds the same consumers
272
+ // (rule 41 parity).
278
273
  const trustByPathSink: { trustByPath: Map<string, TrustStageResultItem> | null } = {
279
274
  trustByPath: null,
280
275
  };
281
276
  const lcmStructuredXrayResults: RecallXrayResult[] = [];
282
- // Per-branch pre-limit candidate pool size for the X-ray filter
283
- // trace (issue #570 PR 1). `recalledMemoryCount` is assigned
284
- // AFTER MMR + truncation so using it alone would make the
285
- // `recall-result-limit` trace report `considered == admitted`
286
- // even when many candidates were dropped. Each entry captures
287
- // the pool size BEFORE truncation at that branch. The X-ray
288
- // capture block picks the pool that corresponds to the branch
289
- // that actually produced the admitted results (via `recallSource`)
290
- // so a pool from a branch whose candidates were killed by an
291
- // earlier gate cannot leak into the `considered` count.
277
+ // Per-branch PRE-truncation pool size for the X-ray filter trace
278
+ // (issue #570 PR 1): `recalledMemoryCount` is post-truncation, so the
279
+ // trace would otherwise report considered == admitted. The capture block
280
+ // picks the branch that produced the admitted results via `recallSource`.
292
281
  const xrayBranchPoolSize: Record<
293
282
  "hot_qmd" | "hot_embedding" | "cold_fallback" | "recent_scan",
294
283
  number
@@ -298,11 +287,9 @@ export class RecallInternalCoordinator {
298
287
  cold_fallback: 0,
299
288
  recent_scan: 0,
300
289
  };
301
- // Shared out-parameter sink the cold-fallback pipeline writes
302
- // its pre-truncation pool size into (issue #570 PR 1). Declared
303
- // once so every call to `applyColdFallbackPipeline` (four call
304
- // sites) updates the same counter; the X-ray capture block
305
- // reads this as the cold-fallback pool.
290
+ // Sink the cold-fallback pipeline (four call sites) writes its
291
+ // pre-truncation pool size into (issue #570 PR 1); the X-ray capture
292
+ // block reads it as the cold-fallback pool.
306
293
  const xrayColdPoolSink = { size: 0 };
307
294
  let selectedResultPartition: RecallResultPartition | null = null;
308
295
  let identityInjectionModeUsed: IdentityInjectionMode | "none" = "none";
@@ -1908,6 +1895,19 @@ export class RecallInternalCoordinator {
1908
1895
  degradations?: SearchDegradation[];
1909
1896
  } | null;
1910
1897
 
1898
+ // Cross-lingual recall (#2197): computed beside the prefilter; never
1899
+ // throws — a failed corpus sample only skips the plan.
1900
+ const crossScriptPlanPromise = (async () => {
1901
+ const queryLanguage = detectLanguageHint(retrievalQuery);
1902
+ if (queryLanguage === undefined) return null;
1903
+ const corpusLanguage = await dominantCorpusLanguage(this.deps.storage);
1904
+ if (corpusLanguage === undefined) return null;
1905
+ return planCrossScript({
1906
+ queryLanguage,
1907
+ corpusLanguage,
1908
+ vectorTierAvailable: resolveMemoryLifecycleCapabilities(this.deps.config).embeddingFallback,
1909
+ });
1910
+ })().catch(() => null);
1911
1911
  const qmdEnrichmentAbort = createEnrichmentAbortHandle(options.abortSignal);
1912
1912
  const qmdPromise = observeEnrichmentPromise(
1913
1913
  (async (): Promise<QmdPhaseResult> => {
@@ -1989,7 +1989,11 @@ export class RecallInternalCoordinator {
1989
1989
  }
1990
1990
  return cachedQmd.value;
1991
1991
  }
1992
-
1992
+ const crossScriptPlan = await crossScriptPlanPromise;
1993
+ if (crossScriptPlan?.degradation) {
1994
+ backendDegradations.push(crossScriptPlan.degradation);
1995
+ }
1996
+ const crossScript = crossScriptPlan?.crossScript === true;
1993
1997
  if (!this.deps.qmd.isAvailable()) {
1994
1998
  const now = Date.now();
1995
1999
  const QMD_REPROBE_COOLDOWN_MS = 60_000;
@@ -2141,6 +2145,7 @@ export class RecallInternalCoordinator {
2141
2145
  resolveNamespace: (p) => this.deps.namespaceFromPath(p),
2142
2146
  queryAwarePrefilter,
2143
2147
  searchOptions: qmdSearchOptions,
2148
+ crossScript,
2144
2149
  abortSignal: qmdEnrichmentAbort.signal,
2145
2150
  onDegradation: (degradation) => {
2146
2151
  backendDegradations.push(degradation);
@@ -4105,8 +4110,6 @@ export class RecallInternalCoordinator {
4105
4110
  undefined,
4106
4111
  { asOfMs, requestingConnector: options.sourceConnector },
4107
4112
  );
4108
- // MMR runs on the pre-truncation pool so diverse candidates just
4109
- // below the cutoff can be promoted into the injected set.
4110
4113
  xrayBranchPoolSize.hot_embedding = Math.max(
4111
4114
  xrayBranchPoolSize.hot_embedding,
4112
4115
  boostedScoped.length,
@@ -4319,8 +4322,7 @@ export class RecallInternalCoordinator {
4319
4322
  undefined,
4320
4323
  { asOfMs, requestingConnector: options.sourceConnector },
4321
4324
  );
4322
- // MMR runs on the pre-truncation pool so diverse candidates just
4323
- // below the cutoff can be promoted into the injected set.
4325
+ // MMR runs on the pre-truncation pool (see the hot-embedding branch).
4324
4326
  xrayBranchPoolSize.hot_embedding = Math.max(
4325
4327
  xrayBranchPoolSize.hot_embedding,
4326
4328
  boostedScoped.length,
@@ -281,6 +281,8 @@ export class RecallSearchPipelineCoordinator {
281
281
  searchOptions?: SearchQueryOptions;
282
282
  onDebugSnapshot?: (snapshot: QmdRecallSnapshot) => Promise<void>;
283
283
  /** Backend degradation observer, threaded into every QMD call (#1536). */
284
+ /** Cross-lingual plan flag (#2197): supplement the lexical page with vector-tier hits. */
285
+ crossScript?: boolean;
284
286
  onDegradation?: (degradation: SearchDegradation) => void;
285
287
  abortSignal?: AbortSignal;
286
288
  },
@@ -334,6 +336,12 @@ export class RecallSearchPipelineCoordinator {
334
336
  const debugSearchOptions = backendHonorsQmdSearchSignals
335
337
  ? resolvedSearchOptions
336
338
  : undefined;
339
+ // Cross-lingual recall (#2197): lexical tiers cannot match a query whose
340
+ // dominant script differs from the corpus's, whatever the page fill.
341
+ // Supplement with the embedding-fallback tier ONCE, before widening.
342
+ const crossScriptVectorHits = options.crossScript
343
+ ? await this.searchEmbeddingFallback(prompt, fetchLimit)
344
+ : [];
337
345
  let bestFiltered = filterRecallCandidates(scopedSeedResults, {
338
346
  namespacesEnabled: options.namespacesEnabled,
339
347
  recallNamespaces: options.recallNamespaces,
@@ -475,6 +483,14 @@ export class RecallSearchPipelineCoordinator {
475
483
  }
476
484
  }
477
485
 
486
+ if (crossScriptVectorHits.length > 0) {
487
+ mergedResults = dedupeResultsByNamespace(
488
+ [...mergedResults, ...crossScriptVectorHits],
489
+ this.deps.namespaceFromPath,
490
+ fetchLimit,
491
+ { filter: recallable },
492
+ );
493
+ }
478
494
  if (scopedSeedResults.length > 0) {
479
495
  mergedResults = dedupeResultsByNamespace(
480
496
  [...scopedSeedResults, ...mergedResults],
@@ -27,7 +27,8 @@ export interface SearchDegradation {
27
27
  | "daemon_loading"
28
28
  | "subprocess_error"
29
29
  | "deadline_exceeded"
30
- | "remote_error";
30
+ | "remote_error"
31
+ | "vector_tier_unavailable";
31
32
  detail?: string;
32
33
  }
33
34
 
package/src/storage.ts CHANGED
@@ -244,6 +244,7 @@ import { normalizeProjectionPreview, normalizeProjectionTags } from "./memory-pr
244
244
  import { isSupportPassportPrivateMemory } from "./support-passport/card-projection.js";
245
245
  import { parseFlexibleIsoTimestamp } from "./utils/iso-timestamp.js";
246
246
  import { parseOriginClass } from "./security/origin-authority.js";
247
+ import { detectLanguageHint } from "./cross-lingual-recall.js";
247
248
  import {
248
249
  composeMemoryEnvelope,
249
250
  isSealedMemoryEnvelope,
@@ -322,6 +323,7 @@ function serializeFrontmatter(fm: MemoryFrontmatter): string {
322
323
  `tags: [${fm.tags.map((t) => `"${t}"`).join(", ")}]`,
323
324
  ];
324
325
  // OKF v0.1 interop (issue #1946): inert presentation metadata; `category` stays canonical.
326
+ if (fm.language) lines.push(`language: ${fm.language}`);
325
327
  if (fm.type !== undefined) lines.push(`type: ${fm.type}`);
326
328
  if (fm.origin) lines.push(`origin: ${/^[A-Za-z0-9:_.*-]+$/.test(fm.origin) ? fm.origin : JSON.stringify(fm.origin)}`);
327
329
  if (fm.entityRef) lines.push(`entityRef: ${fm.entityRef}`);
@@ -859,8 +861,9 @@ export function parseFrontmatter(raw: string): { frontmatter: MemoryFrontmatter;
859
861
  frontmatter: {
860
862
  id: fm.id ?? "",
861
863
  category: (fm.category ?? "fact") as MemoryCategory,
862
- type: parseFrontmatterStringValue(fm.type),
863
864
  created: fm.created ?? new Date().toISOString(),
865
+ language: fm.language || undefined,
866
+ type: parseFrontmatterStringValue(fm.type),
864
867
  updated: fm.updated ?? new Date().toISOString(),
865
868
  source: fm.source ?? "unknown",
866
869
  confidence: conf,
@@ -3729,6 +3732,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
3729
3732
  category,
3730
3733
  created: now.toISOString(),
3731
3734
  updated: now.toISOString(),
3735
+ language: detectLanguageHint(content),
3732
3736
  source: options.source ?? "extraction",
3733
3737
  confidence: conf,
3734
3738
  confidenceTier: tier,
package/src/types.ts CHANGED
@@ -2807,6 +2807,8 @@ export interface MemoryFrontmatter extends SourceConnectorProvenance, OriginMeta
2807
2807
  category: MemoryCategory;
2808
2808
  /** OKF v0.1 interop metadata (issue #1946). Inert: presentation only, never overrides `category`. */
2809
2809
  type?: string;
2810
+ /** Dominant-script hint (ISO 15924, e.g. `latn`/`jpan`) for cross-lingual recall (#2197). Absent on legacy files. */
2811
+ language?: string;
2810
2812
  created: string;
2811
2813
  updated: string;
2812
2814
  source: string;