@remnic/core 9.45.4 → 9.46.0

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 (460) hide show
  1. package/dist/access-admin-ops-surface.d.ts +10 -10
  2. package/dist/access-admin-ops-surface.js +30 -29
  3. package/dist/access-authorization-probe.d.ts +10 -10
  4. package/dist/access-authorization-probe.js +31 -30
  5. package/dist/access-boundary.d.ts +10 -10
  6. package/dist/access-boundary.js +30 -29
  7. package/dist/access-cli.js +91 -87
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +10 -10
  11. package/dist/access-extraction-force-flush.js +30 -29
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-lcm-compaction.d.ts +10 -10
  14. package/dist/access-http-lifecycle-flush.d.ts +10 -10
  15. package/dist/access-http-offline-stream.d.ts +10 -10
  16. package/dist/access-http-offline-stream.js +1 -1
  17. package/dist/access-http-query.js +30 -29
  18. package/dist/access-http.d.ts +10 -11
  19. package/dist/access-http.js +42 -41
  20. package/dist/access-identity-continuity-surface.d.ts +8 -8
  21. package/dist/access-identity-continuity-surface.js +30 -29
  22. package/dist/access-lcm-surface.d.ts +10 -10
  23. package/dist/access-lcm-surface.js +30 -29
  24. package/dist/access-mcp.d.ts +10 -10
  25. package/dist/access-mcp.js +36 -35
  26. package/dist/access-memory-search-fanout.d.ts +2 -2
  27. package/dist/{access-namespace-preflight-CWUDwB4M.d.ts → access-namespace-preflight--H6HwN85.d.ts} +1 -1
  28. package/dist/access-namespace-preflight.d.ts +3 -3
  29. package/dist/access-namespace-preflight.js +30 -29
  30. package/dist/access-observe-write-surface.d.ts +10 -10
  31. package/dist/access-observe-write-surface.js +30 -29
  32. package/dist/access-offline-manifest.d.ts +8 -8
  33. package/dist/access-operations-batch.js +31 -30
  34. package/dist/access-operations.d.ts +13 -13
  35. package/dist/access-operations.js +35 -34
  36. package/dist/access-recall-concurrency.d.ts +10 -10
  37. package/dist/access-recall-concurrency.js +30 -29
  38. package/dist/access-recall-response.d.ts +10 -10
  39. package/dist/access-recall-response.js +30 -29
  40. package/dist/access-recall-surface.d.ts +10 -10
  41. package/dist/access-recall-surface.js +30 -29
  42. package/dist/access-schema.d.ts +84 -84
  43. package/dist/access-service-helpers.d.ts +10 -10
  44. package/dist/{access-service-CsU-ljFD.d.ts → access-service-loJadYd7.d.ts} +7 -7
  45. package/dist/access-service.d.ts +10 -10
  46. package/dist/access-service.js +30 -29
  47. package/dist/access-surface-catalog.d.ts +10 -10
  48. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  49. package/dist/action-confidence.d.ts +1 -1
  50. package/dist/active-memory-bridge.d.ts +1 -1
  51. package/dist/active-recall.d.ts +1 -1
  52. package/dist/adapters/index.js +4 -4
  53. package/dist/adapters/registry.js +2 -2
  54. package/dist/ambient-provenance.d.ts +109 -0
  55. package/dist/ambient-provenance.js +22 -0
  56. package/dist/ambient-provenance.js.map +1 -0
  57. package/dist/{auto-sync-UPTUVE4X.js → auto-sync-7O6RP2RT.js} +3 -2
  58. package/dist/{auto-sync-UPTUVE4X.js.map → auto-sync-7O6RP2RT.js.map} +1 -1
  59. package/dist/behavior-learner.d.ts +1 -1
  60. package/dist/behavior-signals.d.ts +1 -1
  61. package/dist/bootstrap.d.ts +8 -8
  62. package/dist/briefing.d.ts +2 -2
  63. package/dist/briefing.js +6 -5
  64. package/dist/buffer-surprise-report.d.ts +1 -1
  65. package/dist/buffer-turn-helpers.d.ts +1 -1
  66. package/dist/buffer-turn-helpers.js +1 -1
  67. package/dist/buffer.d.ts +2 -2
  68. package/dist/buffer.js +5 -5
  69. package/dist/bulk-import/index.d.ts +3 -3
  70. package/dist/calibration.d.ts +1 -1
  71. package/dist/capabilities.d.ts +1 -1
  72. package/dist/{catalog-bctMURhN.d.ts → catalog-Iwbk9h5E.d.ts} +1 -1
  73. package/dist/causal-behavior.d.ts +1 -1
  74. package/dist/causal-consolidation.d.ts +1 -1
  75. package/dist/causal-consolidation.js +7 -6
  76. package/dist/causal-consolidation.js.map +1 -1
  77. package/dist/causal-trajectory-graph.d.ts +1 -1
  78. package/dist/{chunk-7RZJWZ46.js → chunk-227UFSEQ.js} +5 -5
  79. package/dist/{chunk-ER7W6H4T.js → chunk-2AD5SXO4.js} +5 -2
  80. package/dist/chunk-2AD5SXO4.js.map +1 -0
  81. package/dist/{chunk-XSFHWBQO.js → chunk-2DSUT7DZ.js} +10 -64
  82. package/dist/{chunk-XSFHWBQO.js.map → chunk-2DSUT7DZ.js.map} +1 -1
  83. package/dist/{chunk-DZPFMQZ7.js → chunk-3S63QIFQ.js} +1 -1
  84. package/dist/chunk-3S63QIFQ.js.map +1 -0
  85. package/dist/{chunk-UQWIKLQK.js → chunk-47J4EDGR.js} +9 -9
  86. package/dist/{chunk-5SNZSWWR.js → chunk-5LRDM4R7.js} +42 -42
  87. package/dist/{chunk-7YERSTN7.js → chunk-5R6S4DJZ.js} +7 -7
  88. package/dist/{chunk-C26TE27X.js → chunk-5VQPZ4GV.js} +3 -3
  89. package/dist/{chunk-U2VLVBBH.js → chunk-64BHFFKZ.js} +3 -3
  90. package/dist/{chunk-AJQ57VV3.js → chunk-6H744ZBH.js} +4 -4
  91. package/dist/chunk-6H744ZBH.js.map +1 -0
  92. package/dist/{chunk-7CITSYSH.js → chunk-7T4TOGMS.js} +2 -2
  93. package/dist/{chunk-ZMAYKGPN.js → chunk-7YQ6ESEA.js} +12 -41
  94. package/dist/chunk-7YQ6ESEA.js.map +1 -0
  95. package/dist/{chunk-YMAQDHQM.js → chunk-BDNL34CT.js} +2 -2
  96. package/dist/{chunk-GQL52GQ5.js → chunk-CDKHKZL5.js} +15 -12
  97. package/dist/chunk-CDKHKZL5.js.map +1 -0
  98. package/dist/{chunk-WGP57SR3.js → chunk-CK5KOVHW.js} +3 -2
  99. package/dist/{chunk-WGP57SR3.js.map → chunk-CK5KOVHW.js.map} +1 -1
  100. package/dist/{chunk-JH6BPLOP.js → chunk-E4FOAENZ.js} +4 -4
  101. package/dist/{chunk-ZFGZ6PZ2.js → chunk-FULKGK7P.js} +2 -2
  102. package/dist/{chunk-BGHFOD5A.js → chunk-HJ3SVHUW.js} +3 -3
  103. package/dist/{chunk-TYISDI6B.js → chunk-HXXTXLKA.js} +2 -2
  104. package/dist/{chunk-FZP32336.js → chunk-IDE5AR5W.js} +53 -31
  105. package/dist/chunk-IDE5AR5W.js.map +1 -0
  106. package/dist/{chunk-7SHJHPTY.js → chunk-ILBLZ5Y5.js} +2 -2
  107. package/dist/chunk-J7T4MX7P.js +131 -0
  108. package/dist/chunk-J7T4MX7P.js.map +1 -0
  109. package/dist/{chunk-DSUAAZZX.js → chunk-JFO5QZ7N.js} +2 -2
  110. package/dist/{chunk-EJHEWCGQ.js → chunk-KA47C7BF.js} +2 -2
  111. package/dist/{chunk-NUEQKLNB.js → chunk-KMWYZTIE.js} +2 -2
  112. package/dist/{chunk-TQ4GD737.js → chunk-L7G72WY4.js} +2 -2
  113. package/dist/{chunk-CLB32OHM.js → chunk-LI7OE7G6.js} +2 -2
  114. package/dist/{chunk-TN76AKO3.js → chunk-M2INOSTA.js} +2 -2
  115. package/dist/{chunk-DYVMXPCF.js → chunk-M32URQXV.js} +665 -614
  116. package/dist/chunk-M32URQXV.js.map +1 -0
  117. package/dist/{chunk-WQIHRA5F.js → chunk-N3LL5NEU.js} +2 -2
  118. package/dist/{chunk-HFPASSFV.js → chunk-P2OTGMTR.js} +2 -2
  119. package/dist/{chunk-Y7HRYCNW.js → chunk-PFJXPOD4.js} +2 -2
  120. package/dist/{chunk-MDISBSYA.js → chunk-PKCLQ7KM.js} +43 -143
  121. package/dist/chunk-PKCLQ7KM.js.map +1 -0
  122. package/dist/chunk-QW27DOHG.js +84 -0
  123. package/dist/chunk-QW27DOHG.js.map +1 -0
  124. package/dist/{chunk-ZI32MKDW.js → chunk-RCU25Z66.js} +32 -35
  125. package/dist/chunk-RCU25Z66.js.map +1 -0
  126. package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
  127. package/dist/{chunk-QCECHYZL.js → chunk-RVO6TCTU.js} +6 -6
  128. package/dist/{chunk-D3I2MCN7.js → chunk-RVPTS4U5.js} +3 -3
  129. package/dist/{chunk-W3IC7QOY.js → chunk-RVYVMQK4.js} +3 -3
  130. package/dist/chunk-S2HLHAZ4.js +16 -0
  131. package/dist/chunk-S2HLHAZ4.js.map +1 -0
  132. package/dist/{chunk-2MRHJNWL.js → chunk-ST5IEK3H.js} +2 -2
  133. package/dist/{chunk-O4KMGRXE.js → chunk-SXWHN7GC.js} +2 -2
  134. package/dist/{chunk-KXEFRMCF.js → chunk-T6JRMVOV.js} +2 -2
  135. package/dist/{chunk-R5RFK3CB.js → chunk-U6JGQ37L.js} +2 -2
  136. package/dist/{chunk-UV72DEZD.js → chunk-UYUYZ4WY.js} +36 -10
  137. package/dist/chunk-UYUYZ4WY.js.map +1 -0
  138. package/dist/{chunk-EITZHSX6.js → chunk-V5FE3UAI.js} +2 -2
  139. package/dist/chunk-VL35ZFSZ.js +102 -0
  140. package/dist/chunk-VL35ZFSZ.js.map +1 -0
  141. package/dist/{chunk-NTOIP2E6.js → chunk-W2ZSNIBP.js} +2 -2
  142. package/dist/{chunk-QVSBTCVP.js → chunk-WHWDBTCJ.js} +2 -2
  143. package/dist/{chunk-5CEECY6P.js → chunk-WOC6DXP5.js} +3 -3
  144. package/dist/{chunk-XTAUXTDO.js → chunk-XBMJ35IP.js} +2 -2
  145. package/dist/{chunk-VOUOLGIP.js → chunk-YRFAYOFQ.js} +11 -13
  146. package/dist/chunk-YRFAYOFQ.js.map +1 -0
  147. package/dist/{chunk-P7NGM24P.js → chunk-YWCOJOUI.js} +2 -2
  148. package/dist/{chunk-6NNNURLK.js → chunk-Z54EM5YZ.js} +4 -4
  149. package/dist/{chunk-ULVR5KG7.js → chunk-ZDAYWJV6.js} +2 -2
  150. package/dist/chunk-ZDAYWJV6.js.map +1 -0
  151. package/dist/{cli-BBHDtG36.d.ts → cli-D_RcqXfZ.d.ts} +5 -5
  152. package/dist/cli.d.ts +12 -12
  153. package/dist/cli.js +61 -60
  154. package/dist/compat/checks.js +1 -1
  155. package/dist/compounding/engine.d.ts +2 -2
  156. package/dist/compounding/engine.js +6 -5
  157. package/dist/compounding/preference-consolidator.d.ts +1 -1
  158. package/dist/compression-optimizer.d.ts +1 -1
  159. package/dist/config.d.ts +1 -1
  160. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  161. package/dist/connectors/codex-materialize-runner.js +6 -5
  162. package/dist/connectors/codex-materialize.d.ts +1 -1
  163. package/dist/connectors/index.d.ts +1 -1
  164. package/dist/connectors/index.js +6 -5
  165. package/dist/consolidation-provenance-check.d.ts +2 -2
  166. package/dist/consolidation-undo.d.ts +2 -2
  167. package/dist/contradiction/index.d.ts +2 -2
  168. package/dist/converge-config.d.ts +1 -1
  169. package/dist/convergence-refresh.d.ts +2 -2
  170. package/dist/convergence-refresh.js +8 -7
  171. package/dist/conversation-index/backend.d.ts +1 -1
  172. package/dist/conversation-index/backend.js +2 -2
  173. package/dist/conversation-index/chunker.d.ts +1 -1
  174. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  175. package/dist/conversation-index/indexer.d.ts +1 -1
  176. package/dist/conversation-index/search.d.ts +1 -1
  177. package/dist/corpus-watermark.d.ts +1 -1
  178. package/dist/corpus-watermark.js +17 -16
  179. package/dist/day-summary.d.ts +1 -1
  180. package/dist/delinearize.d.ts +1 -1
  181. package/dist/direct-answer-wiring.d.ts +1 -1
  182. package/dist/direct-answer.d.ts +1 -1
  183. package/dist/embedding-fallback.d.ts +1 -1
  184. package/dist/enrichment/index.d.ts +1 -1
  185. package/dist/entity-retrieval.d.ts +2 -2
  186. package/dist/entity-retrieval.js +6 -5
  187. package/dist/entity-schema.d.ts +1 -1
  188. package/dist/explicit-capture.d.ts +8 -8
  189. package/dist/external-wiki-access.d.ts +10 -10
  190. package/dist/external-wiki-access.js +33 -32
  191. package/dist/external-wiki-cli.js +4 -90
  192. package/dist/external-wiki-cli.js.map +1 -1
  193. package/dist/external-wiki-collection-registration.d.ts +1 -1
  194. package/dist/external-wiki-collection.d.ts +1 -1
  195. package/dist/external-wiki-mcp-tools.d.ts +10 -10
  196. package/dist/external-wiki-search.js +2 -2
  197. package/dist/external-wiki.d.ts +1 -5
  198. package/dist/external-wiki.js +1 -3
  199. package/dist/extraction-error-classification.d.ts +1 -1
  200. package/dist/extraction-faithfulness.d.ts +1 -1
  201. package/dist/extraction-judge-telemetry.d.ts +1 -1
  202. package/dist/extraction-judge-training.d.ts +1 -1
  203. package/dist/extraction-judge.d.ts +1 -1
  204. package/dist/extraction-liveness.d.ts +1 -1
  205. package/dist/extraction-prompt.d.ts +36 -0
  206. package/dist/extraction-prompt.js +16 -0
  207. package/dist/extraction-prompt.js.map +1 -0
  208. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  209. package/dist/extraction-source-grounding.d.ts +1 -1
  210. package/dist/extraction.d.ts +6 -14
  211. package/dist/extraction.js +13 -10
  212. package/dist/fallback-llm.d.ts +1 -1
  213. package/dist/{first-start-migration-F2QJD66E.js → first-start-migration-ZSHEFEI3.js} +10 -12
  214. package/dist/{first-start-migration-F2QJD66E.js.map → first-start-migration-ZSHEFEI3.js.map} +1 -1
  215. package/dist/graph-dashboard-diff.d.ts +1 -1
  216. package/dist/graph-dashboard-key.d.ts +1 -1
  217. package/dist/graph-dashboard-parser.d.ts +1 -1
  218. package/dist/graph-edge-reinforcement.d.ts +1 -1
  219. package/dist/graph-snapshot.d.ts +1 -1
  220. package/dist/graph.d.ts +1 -1
  221. package/dist/importance.d.ts +1 -1
  222. package/dist/importers/index.d.ts +1 -1
  223. package/dist/in-flight-reads.d.ts +1 -1
  224. package/dist/index.d.ts +701 -697
  225. package/dist/index.js +133 -128
  226. package/dist/intent.d.ts +1 -1
  227. package/dist/lcm/engine.d.ts +1 -1
  228. package/dist/lcm/engine.js +2 -2
  229. package/dist/lcm/index.d.ts +1 -1
  230. package/dist/lcm/index.js +2 -2
  231. package/dist/lcm/tools.d.ts +1 -1
  232. package/dist/lifecycle.d.ts +1 -1
  233. package/dist/live-connectors-runner.d.ts +1 -1
  234. package/dist/local-llm.d.ts +1 -1
  235. package/dist/local-model-endpoint.d.ts +1 -1
  236. package/dist/maintenance/memory-governance.d.ts +1 -1
  237. package/dist/maintenance/memory-governance.js +6 -5
  238. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  239. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -5
  240. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  241. package/dist/maintenance/rebuild-memory-projection.js +7 -6
  242. package/dist/{maintenance-D2mveyCd.d.ts → maintenance-DQrL93Uu.d.ts} +3 -3
  243. package/dist/mcp-memory-inspector-app.d.ts +10 -10
  244. package/dist/memory-action-policy.d.ts +1 -1
  245. package/dist/memory-cache.d.ts +1 -1
  246. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  247. package/dist/memory-projection-store.d.ts +1 -1
  248. package/dist/memory-provenance.d.ts +1 -1
  249. package/dist/memory-snapshot.d.ts +10 -0
  250. package/dist/memory-snapshot.js +8 -0
  251. package/dist/memory-snapshot.js.map +1 -0
  252. package/dist/memory-worth-outcomes.d.ts +2 -2
  253. package/dist/models-json.d.ts +1 -1
  254. package/dist/namespaces/migrate.d.ts +3 -3
  255. package/dist/namespaces/migrate.js +16 -15
  256. package/dist/namespaces/principal.d.ts +1 -1
  257. package/dist/namespaces/search.d.ts +1 -1
  258. package/dist/namespaces/search.js +9 -9
  259. package/dist/namespaces/storage.d.ts +3 -3
  260. package/dist/namespaces/storage.js +6 -5
  261. package/dist/native-knowledge.d.ts +1 -1
  262. package/dist/offline-sync-impression-drain.d.ts +1 -1
  263. package/dist/operator-doctor-corpus.d.ts +1 -1
  264. package/dist/operator-doctor-corpus.js +18 -17
  265. package/dist/operator-doctor-replica.d.ts +1 -1
  266. package/dist/operator-toolkit.d.ts +3 -3
  267. package/dist/operator-toolkit.js +22 -21
  268. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  269. package/dist/orchestration/maintenance.d.ts +4 -4
  270. package/dist/orchestration/maintenance.js +11 -10
  271. package/dist/{orchestrator-DJYlwiUv.d.ts → orchestrator-LPGegii3.d.ts} +8 -8
  272. package/dist/orchestrator.d.ts +8 -8
  273. package/dist/orchestrator.js +93 -89
  274. package/dist/patterns-cli.d.ts +1 -1
  275. package/dist/{pipeline-CNjY4wk3.d.ts → pipeline-1h2GpiHP.d.ts} +1 -1
  276. package/dist/policy-runtime.d.ts +1 -1
  277. package/dist/proactive-contention.d.ts +1 -1
  278. package/dist/provenance.d.ts +1 -1
  279. package/dist/{qmd-C0UDZidt.d.ts → qmd-UdwoF71D.d.ts} +1 -1
  280. package/dist/qmd-preflight.d.ts +2 -2
  281. package/dist/qmd-recall-cache.d.ts +1 -1
  282. package/dist/qmd.d.ts +2 -2
  283. package/dist/qmd.js +4 -4
  284. package/dist/recall-concurrency-config.d.ts +1 -1
  285. package/dist/recall-disclosure-escalation.d.ts +1 -1
  286. package/dist/recall-explain-renderer.d.ts +1 -1
  287. package/dist/recall-explain-renderer.js +3 -3
  288. package/dist/recall-memory-map.d.ts +1 -1
  289. package/dist/recall-planner-llm.d.ts +1 -1
  290. package/dist/recall-state.d.ts +1 -1
  291. package/dist/recall-tag-filter.d.ts +1 -1
  292. package/dist/recall-timings.d.ts +1 -1
  293. package/dist/recall-xray-cli.d.ts +1 -1
  294. package/dist/recall-xray-cli.js +4 -4
  295. package/dist/recall-xray-renderer.d.ts +1 -1
  296. package/dist/recall-xray-renderer.js +3 -3
  297. package/dist/recall-xray.d.ts +1 -1
  298. package/dist/recall-xray.js +2 -2
  299. package/dist/reconcile/cursor.d.ts +1 -1
  300. package/dist/reconcile/manifest.d.ts +1 -1
  301. package/dist/reconcile/plan.d.ts +1 -1
  302. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  303. package/dist/replay/normalizers/claude.d.ts +1 -1
  304. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  305. package/dist/replay/normalizers/shared.d.ts +1 -1
  306. package/dist/replay/runner.d.ts +1 -1
  307. package/dist/replay/types.d.ts +1 -1
  308. package/dist/replica-divergence.d.ts +1 -1
  309. package/dist/replica-peers-config.d.ts +1 -1
  310. package/dist/resolve-auth-token.d.ts +1 -1
  311. package/dist/retrieval-agents.d.ts +2 -2
  312. package/dist/retrieval-tiers.d.ts +1 -1
  313. package/dist/routing/engine.d.ts +1 -1
  314. package/dist/routing/store.d.ts +1 -1
  315. package/dist/salvage-envelope.d.ts +1 -1
  316. package/dist/schemas.d.ts +76 -76
  317. package/dist/{scope-profiles-BJzp2F5A.d.ts → scope-profiles-APjhSe-w.d.ts} +1 -1
  318. package/dist/sdk-compat.js.map +1 -1
  319. package/dist/search/embed-helper.d.ts +1 -1
  320. package/dist/search/factory.d.ts +1 -1
  321. package/dist/search/factory.js +8 -8
  322. package/dist/search/index.d.ts +1 -1
  323. package/dist/search/index.js +14 -14
  324. package/dist/search/lancedb-backend.d.ts +1 -1
  325. package/dist/search/meilisearch-backend.d.ts +1 -1
  326. package/dist/search/noop-backend.d.ts +1 -1
  327. package/dist/search/orama-backend.d.ts +1 -1
  328. package/dist/search/port.d.ts +1 -1
  329. package/dist/search/remote-backend.d.ts +1 -1
  330. package/dist/{semantic-consolidation-D4KAZO2G.d.ts → semantic-consolidation-CrySDbk3.d.ts} +1 -1
  331. package/dist/semantic-consolidation.d.ts +2 -2
  332. package/dist/semantic-consolidation.js +7 -6
  333. package/dist/semantic-rule-promotion.js +6 -5
  334. package/dist/semantic-rule-verifier.d.ts +1 -1
  335. package/dist/semantic-rule-verifier.js +6 -5
  336. package/dist/{service-BeDxSqE-.d.ts → service-DJ0LDyuN.d.ts} +2 -2
  337. package/dist/session-observer-bands.d.ts +1 -1
  338. package/dist/session-observer-state.d.ts +1 -1
  339. package/dist/shared-context/manager.d.ts +9 -9
  340. package/dist/signal.d.ts +1 -1
  341. package/dist/source-agent-qualifier.d.ts +4 -1
  342. package/dist/source-agent-qualifier.js +10 -9
  343. package/dist/{storage-DfjxusTE.d.ts → storage-y340tYKb.d.ts} +5 -2
  344. package/dist/storage.d.ts +2 -2
  345. package/dist/storage.js +5 -4
  346. package/dist/summarizer.d.ts +1 -1
  347. package/dist/summary-snapshot.d.ts +1 -1
  348. package/dist/temporal-supersession.d.ts +2 -2
  349. package/dist/temporal-timeline-recall.d.ts +1 -1
  350. package/dist/temporal-validity.d.ts +1 -1
  351. package/dist/threading.d.ts +1 -1
  352. package/dist/tier-migration.d.ts +2 -2
  353. package/dist/tier-migration.js +1 -1
  354. package/dist/tier-routing.d.ts +1 -1
  355. package/dist/topics.d.ts +1 -1
  356. package/dist/transcript.d.ts +1 -1
  357. package/dist/transfer/types.d.ts +66 -66
  358. package/dist/trust-score-stage.d.ts +1 -1
  359. package/dist/trust-score.d.ts +1 -1
  360. package/dist/{types-yX_FwERf.d.ts → types-D_Au9qJO.d.ts} +13 -2
  361. package/dist/types.d.ts +1 -1
  362. package/dist/types.js +1 -1
  363. package/dist/utility-runtime.d.ts +1 -1
  364. package/dist/verified-recall.js +6 -5
  365. package/dist/write-envelope.d.ts +1 -1
  366. package/package.json +2 -12
  367. package/src/access-http-offline-stream.ts +1 -0
  368. package/src/access-http.ts +0 -57
  369. package/src/access-operations-batch.ts +1 -1
  370. package/src/access-service-observe-lcm-parity.test.ts +45 -20
  371. package/src/access-service.ts +3 -4
  372. package/src/ambient-provenance.test.ts +510 -0
  373. package/src/ambient-provenance.ts +229 -0
  374. package/src/buffer-turn-helpers.ts +17 -1
  375. package/src/compat/checks.test.ts +45 -1
  376. package/src/compat/checks.ts +16 -16
  377. package/src/external-wiki-cli.ts +28 -20
  378. package/src/external-wiki-search.test.ts +68 -2
  379. package/src/external-wiki.ts +12 -38
  380. package/src/extraction-prompt.ts +142 -0
  381. package/src/extraction.ts +37 -148
  382. package/src/index.ts +1 -5
  383. package/src/maintenance/first-start-migration.ts +11 -11
  384. package/src/meetings/memory-gen.test.ts +51 -0
  385. package/src/meetings/memory-gen.ts +36 -8
  386. package/src/meetings/summary-extractor.ts +4 -2
  387. package/src/memory-snapshot.ts +15 -0
  388. package/src/orchestration/recall-internal.ts +5 -148
  389. package/src/orchestration/recall-profile-storage.ts +194 -0
  390. package/src/orchestration/recall-search-pipeline.ts +13 -182
  391. package/src/orchestration/recall-search-prefilter.ts +254 -0
  392. package/src/orchestration/session-context.ts +1 -1
  393. package/src/orchestrator.ts +1 -1
  394. package/src/sdk-compat.ts +2 -4
  395. package/src/source-agent-qualifier.ts +3 -0
  396. package/src/storage-contract/cache-coherence.test.ts +99 -0
  397. package/src/storage-fact-hash-index-defer.test.ts +14 -7
  398. package/src/storage.ts +47 -48
  399. package/src/testing/subjects/first-start-tier-migration.test.ts +75 -0
  400. package/src/testing/subjects/recall-profile-storage.test.ts +362 -0
  401. package/src/testing/subjects/recall-search-prefilter.test.ts +365 -0
  402. package/src/tier-migration.ts +10 -12
  403. package/src/types.ts +2 -2
  404. package/src/wearables/memory-gen.test.ts +82 -0
  405. package/src/wearables/memory-gen.ts +54 -5
  406. package/src/wearables/trust.ts +19 -2
  407. package/dist/chunk-AJQ57VV3.js.map +0 -1
  408. package/dist/chunk-DYVMXPCF.js.map +0 -1
  409. package/dist/chunk-DZPFMQZ7.js.map +0 -1
  410. package/dist/chunk-ER7W6H4T.js.map +0 -1
  411. package/dist/chunk-FZP32336.js.map +0 -1
  412. package/dist/chunk-GQL52GQ5.js.map +0 -1
  413. package/dist/chunk-MDISBSYA.js.map +0 -1
  414. package/dist/chunk-ULVR5KG7.js.map +0 -1
  415. package/dist/chunk-UV72DEZD.js.map +0 -1
  416. package/dist/chunk-VOUOLGIP.js.map +0 -1
  417. package/dist/chunk-ZI32MKDW.js.map +0 -1
  418. package/dist/chunk-ZMAYKGPN.js.map +0 -1
  419. package/dist/legacy-hook-compat.d.ts +0 -3
  420. package/dist/legacy-hook-compat.js +0 -36
  421. package/dist/legacy-hook-compat.js.map +0 -1
  422. package/src/legacy-hook-compat.test.ts +0 -20
  423. package/src/legacy-hook-compat.ts +0 -45
  424. /package/dist/{chunk-7RZJWZ46.js.map → chunk-227UFSEQ.js.map} +0 -0
  425. /package/dist/{chunk-UQWIKLQK.js.map → chunk-47J4EDGR.js.map} +0 -0
  426. /package/dist/{chunk-5SNZSWWR.js.map → chunk-5LRDM4R7.js.map} +0 -0
  427. /package/dist/{chunk-7YERSTN7.js.map → chunk-5R6S4DJZ.js.map} +0 -0
  428. /package/dist/{chunk-C26TE27X.js.map → chunk-5VQPZ4GV.js.map} +0 -0
  429. /package/dist/{chunk-U2VLVBBH.js.map → chunk-64BHFFKZ.js.map} +0 -0
  430. /package/dist/{chunk-7CITSYSH.js.map → chunk-7T4TOGMS.js.map} +0 -0
  431. /package/dist/{chunk-YMAQDHQM.js.map → chunk-BDNL34CT.js.map} +0 -0
  432. /package/dist/{chunk-JH6BPLOP.js.map → chunk-E4FOAENZ.js.map} +0 -0
  433. /package/dist/{chunk-ZFGZ6PZ2.js.map → chunk-FULKGK7P.js.map} +0 -0
  434. /package/dist/{chunk-BGHFOD5A.js.map → chunk-HJ3SVHUW.js.map} +0 -0
  435. /package/dist/{chunk-TYISDI6B.js.map → chunk-HXXTXLKA.js.map} +0 -0
  436. /package/dist/{chunk-7SHJHPTY.js.map → chunk-ILBLZ5Y5.js.map} +0 -0
  437. /package/dist/{chunk-DSUAAZZX.js.map → chunk-JFO5QZ7N.js.map} +0 -0
  438. /package/dist/{chunk-EJHEWCGQ.js.map → chunk-KA47C7BF.js.map} +0 -0
  439. /package/dist/{chunk-NUEQKLNB.js.map → chunk-KMWYZTIE.js.map} +0 -0
  440. /package/dist/{chunk-TQ4GD737.js.map → chunk-L7G72WY4.js.map} +0 -0
  441. /package/dist/{chunk-CLB32OHM.js.map → chunk-LI7OE7G6.js.map} +0 -0
  442. /package/dist/{chunk-TN76AKO3.js.map → chunk-M2INOSTA.js.map} +0 -0
  443. /package/dist/{chunk-WQIHRA5F.js.map → chunk-N3LL5NEU.js.map} +0 -0
  444. /package/dist/{chunk-HFPASSFV.js.map → chunk-P2OTGMTR.js.map} +0 -0
  445. /package/dist/{chunk-Y7HRYCNW.js.map → chunk-PFJXPOD4.js.map} +0 -0
  446. /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
  447. /package/dist/{chunk-QCECHYZL.js.map → chunk-RVO6TCTU.js.map} +0 -0
  448. /package/dist/{chunk-D3I2MCN7.js.map → chunk-RVPTS4U5.js.map} +0 -0
  449. /package/dist/{chunk-W3IC7QOY.js.map → chunk-RVYVMQK4.js.map} +0 -0
  450. /package/dist/{chunk-2MRHJNWL.js.map → chunk-ST5IEK3H.js.map} +0 -0
  451. /package/dist/{chunk-O4KMGRXE.js.map → chunk-SXWHN7GC.js.map} +0 -0
  452. /package/dist/{chunk-KXEFRMCF.js.map → chunk-T6JRMVOV.js.map} +0 -0
  453. /package/dist/{chunk-R5RFK3CB.js.map → chunk-U6JGQ37L.js.map} +0 -0
  454. /package/dist/{chunk-EITZHSX6.js.map → chunk-V5FE3UAI.js.map} +0 -0
  455. /package/dist/{chunk-NTOIP2E6.js.map → chunk-W2ZSNIBP.js.map} +0 -0
  456. /package/dist/{chunk-QVSBTCVP.js.map → chunk-WHWDBTCJ.js.map} +0 -0
  457. /package/dist/{chunk-5CEECY6P.js.map → chunk-WOC6DXP5.js.map} +0 -0
  458. /package/dist/{chunk-XTAUXTDO.js.map → chunk-XBMJ35IP.js.map} +0 -0
  459. /package/dist/{chunk-P7NGM24P.js.map → chunk-YWCOJOUI.js.map} +0 -0
  460. /package/dist/{chunk-6NNNURLK.js.map → chunk-Z54EM5YZ.js.map} +0 -0
@@ -0,0 +1,365 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdir, writeFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+
5
+ import { parseConfig } from "../../config.js";
6
+ import type { EmbeddingFallback } from "../../embedding-fallback.js";
7
+ import {
8
+ type PrefilterAndArtifactDeps,
9
+ buildQueryAwarePrefilter,
10
+ fetchActiveArtifactsForNamespace,
11
+ searchEmbeddingFallback,
12
+ searchQueryAwareFallback,
13
+ } from "../../orchestration/recall-search-prefilter.js";
14
+ import type { QueryAwarePrefilter } from "../../orchestrator.js";
15
+ import { StorageManager } from "../../storage.js";
16
+ import type { MemoryFile, PluginConfig, QmdSearchResult } from "../../types.js";
17
+ import { type LifecycleSubject, type MatrixRow, runLifecycleMatrix } from "../lifecycle-matrix.js";
18
+ import { cleanupDir, mkTempMemoryDir } from "../orchestrator-lite.js";
19
+
20
+ interface RecallSearchPrefilterState {
21
+ memoryDir: string;
22
+ config: PluginConfig;
23
+ storage: StorageManager;
24
+ fetchLimitsSeen: number[];
25
+ activeArtifactsResult?: MemoryFile[];
26
+ prefilterResult?: QueryAwarePrefilter;
27
+ prefilterOverflowResult?: QueryAwarePrefilter;
28
+ embeddingResult?: QmdSearchResult[];
29
+ embeddingDisabledResult?: QmdSearchResult[];
30
+ queryAwareFallbackResult?: QmdSearchResult[];
31
+ queryAwareFallbackEmptyResult?: QmdSearchResult[];
32
+ scopedOptionsSeen?: { allowArchived?: boolean };
33
+ scopedNamespacesSeen?: string[];
34
+ }
35
+
36
+ const subject: LifecycleSubject<RecallSearchPrefilterState> = {
37
+ appliesTo(row: MatrixRow): boolean | string {
38
+ if (row.id === "explicit-provider-identity" || row.id === "restart-reload-recovery") {
39
+ return true;
40
+ }
41
+ return `recall search prefilter helper pipeline has no ${row.id} session/flush/dedupe semantics to realize`;
42
+ },
43
+
44
+ async setup(row: MatrixRow): Promise<RecallSearchPrefilterState> {
45
+ const memoryDir = await mkTempMemoryDir(`recall-search-prefilter-${row.id}`);
46
+ try {
47
+ const config = parseConfig({
48
+ memoryDir,
49
+ queryAwareIndexingEnabled: true,
50
+ queryAwareIndexingMaxCandidates: 100,
51
+ embeddingFallbackEnabled: true,
52
+ });
53
+ const storage = new StorageManager(memoryDir);
54
+ return {
55
+ memoryDir,
56
+ config,
57
+ storage,
58
+ fetchLimitsSeen: [],
59
+ };
60
+ } catch (error) {
61
+ await cleanupDir(memoryDir);
62
+ throw error;
63
+ }
64
+ },
65
+
66
+ async exercise(state: RecallSearchPrefilterState, row: MatrixRow): Promise<void> {
67
+ await state.storage.ensureDirectories();
68
+ const stateDir = path.join(state.memoryDir, "state");
69
+ await mkdir(stateDir, { recursive: true });
70
+
71
+ await writeFile(
72
+ path.join(stateDir, "index_tags.json"),
73
+ JSON.stringify({
74
+ version: 2,
75
+ tags: {
76
+ review: { paths: ["facts/a.md", "facts/b.md"] },
77
+ report: { paths: ["facts/b.md", "facts/c.md"] },
78
+ },
79
+ aliases: {},
80
+ }),
81
+ "utf8"
82
+ );
83
+ await writeFile(
84
+ path.join(stateDir, "index_time.json"),
85
+ JSON.stringify({
86
+ version: 2,
87
+ dates: {
88
+ "2026-07-31": ["facts/a.md"],
89
+ },
90
+ events: {},
91
+ }),
92
+ "utf8"
93
+ );
94
+
95
+ const writtenMem = await state.storage.writeMemory(
96
+ "fact",
97
+ "Embedding fallback test memory content for hydration verification.",
98
+ { source: "test-source" }
99
+ );
100
+ const memFile = await state.storage.getMemoryById(writtenMem.id);
101
+ assert.ok(memFile, "stored memory file must exist for embedding test");
102
+ const memPath = memFile.path;
103
+
104
+ if (row.dimensions.restart) {
105
+ state.storage = new StorageManager(state.memoryDir);
106
+ }
107
+
108
+ const mockArtifacts: MemoryFile[] = [
109
+ {
110
+ path: "artifacts/stale.md",
111
+ content: "stale artifact",
112
+ frontmatter: { sourceMemoryId: "src-stale" },
113
+ } as unknown as MemoryFile,
114
+ {
115
+ path: "artifacts/active1.md",
116
+ content: "active artifact 1",
117
+ frontmatter: { sourceMemoryId: "src-active1" },
118
+ } as unknown as MemoryFile,
119
+ {
120
+ path: "artifacts/active2.md",
121
+ content: "active artifact 2",
122
+ frontmatter: { sourceMemoryId: "src-active2" },
123
+ } as unknown as MemoryFile,
124
+ {
125
+ path: "artifacts/missing.md",
126
+ content: "missing artifact",
127
+ frontmatter: { sourceMemoryId: "src-missing" },
128
+ } as unknown as MemoryFile,
129
+ ];
130
+
131
+ const storageRouter = {
132
+ storageFor: async () =>
133
+ ({
134
+ searchArtifacts: async (_prompt: string, limit: number) => {
135
+ state.fetchLimitsSeen.push(limit);
136
+ if (state.fetchLimitsSeen.length === 1) {
137
+ return [mockArtifacts[1], ...Array.from({ length: limit - 1 }, () => mockArtifacts[0])];
138
+ }
139
+ return mockArtifacts;
140
+ },
141
+ }) as unknown as StorageManager,
142
+ } as unknown as PrefilterAndArtifactDeps["storageRouter"];
143
+
144
+ const resolveArtifactSourceStatuses = async (
145
+ _stg: unknown,
146
+ sourceIds: string[]
147
+ ): Promise<Map<string, "active" | "superseded" | "archived" | "missing">> => {
148
+ const map = new Map<string, "active" | "superseded" | "archived" | "missing">();
149
+ for (const id of sourceIds) {
150
+ if (id === "src-stale") map.set(id, "superseded");
151
+ else if (id === "src-active1" || id === "src-active2") map.set(id, "active");
152
+ else if (id === "src-missing") map.set(id, "missing");
153
+ }
154
+ return map;
155
+ };
156
+
157
+ state.activeArtifactsResult = await fetchActiveArtifactsForNamespace(
158
+ {
159
+ storageRouter,
160
+ resolveArtifactSourceStatuses,
161
+ },
162
+ "default",
163
+ "artifact prompt",
164
+ 2
165
+ );
166
+
167
+ const scopeQueryAwarePaths = (paths: Set<string> | null, namespaces: string[]): Set<string> | null => {
168
+ state.scopedNamespacesSeen = namespaces;
169
+ return paths;
170
+ };
171
+
172
+ state.prefilterResult = await buildQueryAwarePrefilter(
173
+ {
174
+ config: state.config,
175
+ scopeQueryAwarePaths,
176
+ },
177
+ "2026-07-31 #review quarterly report",
178
+ ["default"]
179
+ );
180
+
181
+ const overflowConfig = parseConfig({
182
+ memoryDir: state.memoryDir,
183
+ queryAwareIndexingEnabled: true,
184
+ queryAwareIndexingMaxCandidates: 1,
185
+ });
186
+
187
+ state.prefilterOverflowResult = await buildQueryAwarePrefilter(
188
+ {
189
+ config: overflowConfig,
190
+ scopeQueryAwarePaths,
191
+ },
192
+ "#review quarterly report",
193
+ ["default"]
194
+ );
195
+
196
+ const embeddingFallback: EmbeddingFallback = {
197
+ isAvailable: async () => true,
198
+ search: async (_query: string, _limit: number) => [
199
+ {
200
+ id: "emb-hit-1",
201
+ path: memPath,
202
+ score: 0.95,
203
+ },
204
+ ],
205
+ } as unknown as EmbeddingFallback;
206
+
207
+ state.embeddingResult = await searchEmbeddingFallback(
208
+ {
209
+ config: state.config,
210
+ embeddingFallback,
211
+ storage: state.storage,
212
+ },
213
+ "hydration query",
214
+ 5
215
+ );
216
+
217
+ const disabledConfig = parseConfig({
218
+ memoryDir: state.memoryDir,
219
+ embeddingFallbackEnabled: false,
220
+ });
221
+
222
+ state.embeddingDisabledResult = await searchEmbeddingFallback(
223
+ {
224
+ config: disabledConfig,
225
+ embeddingFallback,
226
+ storage: state.storage,
227
+ },
228
+ "hydration query",
229
+ 5
230
+ );
231
+
232
+ const meetingRecordPath = "meetings/2026-03-10/mtg-2026-03-10-abcdef01.md";
233
+ const recallablePath = "facts/quarterly-report.md";
234
+
235
+ const searchScopedMemoryCandidates = async (
236
+ candidatePaths: Set<string>,
237
+ _query: string,
238
+ limit: number,
239
+ options?: { allowArchived?: boolean }
240
+ ): Promise<QmdSearchResult[]> => {
241
+ state.scopedOptionsSeen = options;
242
+ const all: QmdSearchResult[] = [
243
+ { docid: "doc-mtg", path: meetingRecordPath, score: 0.99, snippet: "meeting" },
244
+ { docid: "doc-fact", path: recallablePath, score: 0.88, snippet: "fact" },
245
+ ];
246
+ return all.filter((item) => candidatePaths.has(item.path)).slice(0, limit);
247
+ };
248
+
249
+ const prefilterForFallback: QueryAwarePrefilter = {
250
+ candidatePaths: new Set([meetingRecordPath, recallablePath]),
251
+ temporalFromDate: null,
252
+ matchedTags: ["review"],
253
+ expandedTags: ["review"],
254
+ combination: "tag",
255
+ filteredToFullSearch: false,
256
+ };
257
+
258
+ state.queryAwareFallbackResult = await searchQueryAwareFallback(
259
+ {
260
+ config: state.config,
261
+ searchScopedMemoryCandidates,
262
+ },
263
+ "quarterly",
264
+ 1,
265
+ prefilterForFallback
266
+ );
267
+
268
+ state.queryAwareFallbackEmptyResult = await searchQueryAwareFallback(
269
+ {
270
+ config: state.config,
271
+ searchScopedMemoryCandidates,
272
+ },
273
+ "quarterly",
274
+ 0,
275
+ prefilterForFallback
276
+ );
277
+ },
278
+
279
+ async invariants(state: RecallSearchPrefilterState, _row: MatrixRow): Promise<void> {
280
+ assert.ok(state.activeArtifactsResult, "activeArtifactsResult must be populated");
281
+ assert.equal(state.activeArtifactsResult.length, 2, "must adaptively retrieve targetCount active artifacts");
282
+ assert.deepEqual(
283
+ state.activeArtifactsResult.map((a) => a.path),
284
+ ["artifacts/active1.md", "artifacts/active2.md"],
285
+ "must filter out stale and missing source artifacts"
286
+ );
287
+ assert.ok(
288
+ state.fetchLimitsSeen.length > 1,
289
+ "must attempt top-up with grown fetch limit when initial results yield fewer active artifacts than targetCount"
290
+ );
291
+ assert.ok(
292
+ state.fetchLimitsSeen[1] > state.fetchLimitsSeen[0],
293
+ "fetchLimit must adaptively increase across top-up attempts"
294
+ );
295
+
296
+ assert.ok(state.prefilterResult, "prefilterResult must be populated");
297
+ assert.ok(state.prefilterResult.matchedTags.includes("review"), "must extract matched tags from prompt");
298
+ assert.ok(
299
+ state.prefilterResult.candidatePaths instanceof Set,
300
+ "candidatePaths must be a Set when candidate count <= maxCandidates"
301
+ );
302
+ assert.equal(state.prefilterResult.filteredToFullSearch, false, "must not set filteredToFullSearch when under cap");
303
+ assert.equal(
304
+ state.prefilterResult.temporalFromDate,
305
+ "2026-07-31",
306
+ "must combine temporal and tag prefilter inputs"
307
+ );
308
+ assert.deepEqual(
309
+ state.prefilterResult.candidatePaths,
310
+ new Set(["facts/a.md"]),
311
+ "must intersect temporal and tag candidates"
312
+ );
313
+ assert.deepEqual(state.scopedNamespacesSeen, ["default"], "must scope query-aware paths to the recall namespaces");
314
+
315
+ assert.ok(state.prefilterOverflowResult, "prefilterOverflowResult must be populated");
316
+ assert.equal(
317
+ state.prefilterOverflowResult.candidatePaths,
318
+ null,
319
+ "candidatePaths must be reset to null when exceeding maxCandidates"
320
+ );
321
+ assert.equal(
322
+ state.prefilterOverflowResult.filteredToFullSearch,
323
+ true,
324
+ "filteredToFullSearch must be true when candidates exceed maxCandidates"
325
+ );
326
+
327
+ assert.ok(state.embeddingResult, "embeddingResult must be populated");
328
+ assert.equal(state.embeddingResult.length, 1, "must return hydrated search hit");
329
+ assert.equal(state.embeddingResult[0].docid, "emb-hit-1");
330
+ assert.equal(state.embeddingResult[0].score, 0.95);
331
+ assert.match(
332
+ state.embeddingResult[0].snippet,
333
+ /Embedding fallback test memory content for hydration verification/,
334
+ "must hydrate memory content into search snippet"
335
+ );
336
+
337
+ assert.ok(state.embeddingDisabledResult, "embeddingDisabledResult must be populated");
338
+ assert.deepEqual(
339
+ state.embeddingDisabledResult,
340
+ [],
341
+ "must return empty array when embeddingFallback capability is disabled"
342
+ );
343
+
344
+ assert.ok(state.queryAwareFallbackResult, "queryAwareFallbackResult must be populated");
345
+ assert.equal(state.queryAwareFallbackResult.length, 1, "must respect result limit cap");
346
+ assert.equal(
347
+ state.queryAwareFallbackResult[0].path,
348
+ "facts/quarterly-report.md",
349
+ "must exclude meeting record before applying result cap so valid candidate is returned at the cap"
350
+ );
351
+ assert.deepEqual(
352
+ state.scopedOptionsSeen,
353
+ { allowArchived: true },
354
+ "must request allowArchived when searching candidate paths for historical filtering"
355
+ );
356
+
357
+ assert.deepEqual(state.queryAwareFallbackEmptyResult, [], "must return empty array when limit is zero");
358
+ },
359
+
360
+ async teardown(state: RecallSearchPrefilterState): Promise<void> {
361
+ await cleanupDir(state.memoryDir);
362
+ },
363
+ };
364
+
365
+ runLifecycleMatrix("recall-search-prefilter", subject);
@@ -88,18 +88,16 @@ export class TierMigrationExecutor {
88
88
 
89
89
  await this.appendJournal(result);
90
90
 
91
- if (result.changed) {
92
- const destinationCollection = this.collectionForTier(toTier);
93
- const sourceCollection = this.collectionForTier(fromTier);
94
- await this.updateCollectionFromTierRoot(destinationCollection, toTier);
95
- if (sourceCollection !== destinationCollection && this.qmd.updatesAllCollections?.() !== true) {
96
- await this.updateCollectionFromTierRoot(sourceCollection, fromTier);
97
- }
98
- if (this.autoEmbed) {
99
- await this.qmd.embedCollection(destinationCollection);
100
- if (sourceCollection !== destinationCollection) {
101
- await this.qmd.embedCollection(sourceCollection);
102
- }
91
+ const destinationCollection = this.collectionForTier(toTier);
92
+ const sourceCollection = this.collectionForTier(fromTier);
93
+ await this.updateCollectionFromTierRoot(destinationCollection, toTier);
94
+ if (sourceCollection !== destinationCollection && this.qmd.updatesAllCollections?.() !== true) {
95
+ await this.updateCollectionFromTierRoot(sourceCollection, fromTier);
96
+ }
97
+ if (this.autoEmbed) {
98
+ await this.qmd.embedCollection(destinationCollection);
99
+ if (sourceCollection !== destinationCollection) {
100
+ await this.qmd.embedCollection(sourceCollection);
103
101
  }
104
102
  }
105
103
 
package/src/types.ts CHANGED
@@ -6,7 +6,7 @@ import type { ExtractionLivenessConfig } from "./extraction-liveness.js";
6
6
  import type { ReplicaPeersConfig } from "./replica-peers-config.js";
7
7
  import type { ExternalWikiRoot } from "./external-wiki-config.js";
8
8
 
9
- import type { BufferTurnOwner } from "./buffer-turn-helpers.js";
9
+ import type { AmbientCaptureProvenance, BufferTurnOwner } from "./buffer-turn-helpers.js";
10
10
  export type ReasoningEffort = "none" | "low" | "medium" | "high";
11
11
  export type TriggerMode = "smart" | "every_n" | "time_based";
12
12
  export type ConvergeConflictPolicy = "newest-wins" | "manual";
@@ -2643,7 +2643,7 @@ export interface RelevanceFeedback {
2643
2643
  export interface SourceConnectorProvenance {
2644
2644
  sourceConnector?: string;
2645
2645
  }
2646
- export interface BufferTurn extends SourceConnectorProvenance, BufferTurnOwner {
2646
+ export interface BufferTurn extends SourceConnectorProvenance, BufferTurnOwner, AmbientCaptureProvenance {
2647
2647
  role: "user" | "assistant";
2648
2648
  content: string;
2649
2649
  timestamp: string;
@@ -224,6 +224,33 @@ test("auto mode writes active status", async () => {
224
224
  assert.equal(writes[0].options.status, "active");
225
225
  });
226
226
 
227
+ test("auto mode still refuses to write a high-impact personal claim active (#2294)", async () => {
228
+ // `auto` has no trust scoring, and an operator may lower minConfidence to or
229
+ // below the speculative ceiling the ambient clamp writes — which would let a
230
+ // clamped TV line straight into recall without this guard.
231
+ const { writer, writes } = makeWriter();
232
+ await generateWearableMemories(
233
+ "limitless",
234
+ "2026-06-10",
235
+ [LONG_CONVERSATION],
236
+ settings({ memoryMode: "auto", minConfidence: 0.3 }),
237
+ REGISTRY,
238
+ {
239
+ extract: extractionReturning([
240
+ { category: "fact", content: "Dana's mother has a birthday on June 3rd.", confidence: 0.39, tags: [] },
241
+ { category: "fact", content: "Vendor call happens tomorrow morning.", confidence: 0.8, tags: [] },
242
+ ]),
243
+ writer,
244
+ },
245
+ );
246
+ const personal = writes.find((w) => w.content.includes("birthday"));
247
+ assert.ok(personal, "the personal claim was written");
248
+ assert.equal(personal!.options.status, "pending_review");
249
+ const ordinary = writes.find((w) => w.content.includes("Vendor call"));
250
+ assert.ok(ordinary, "the ordinary fact was written");
251
+ assert.equal(ordinary!.options.status, "active");
252
+ });
253
+
227
254
  test("gates: confidence floor, importance floor, dedup, and unsupported categories", async () => {
228
255
  const { writer, writes } = makeWriter(["Already stored fact about the vendor."]);
229
256
  const result = await generateWearableMemories(
@@ -343,6 +370,61 @@ test("daily digest writes one deterministic episode memory and dedups", async ()
343
370
  assert.equal(writes2.length, 0);
344
371
  });
345
372
 
373
+ test("review mode queues a clamped personal claim instead of dropping it below the floor (#2294)", async () => {
374
+ // The extraction clamp pins high-impact ambient facts to 0.39, under the 0.6
375
+ // default minConfidence — so without an exemption the pre-filter would drop
376
+ // exactly the candidates review mode promises to queue.
377
+ const { writer, writes } = makeWriter();
378
+ const result = await generateWearableMemories(
379
+ "limitless",
380
+ "2026-06-10",
381
+ [LONG_CONVERSATION],
382
+ settings({ memoryMode: "review" }),
383
+ REGISTRY,
384
+ {
385
+ extract: extractionReturning([
386
+ { category: "fact", content: "Dana's mother has a birthday on June 3rd.", confidence: 0.39, tags: [] },
387
+ { category: "fact", content: "A low-signal rumor about the vendor.", confidence: 0.39, tags: [] },
388
+ ]),
389
+ writer,
390
+ },
391
+ );
392
+
393
+ assert.equal(writes.length, 1, "only the high-impact claim is exempt from the floor");
394
+ assert.match(writes[0].content, /birthday/);
395
+ assert.equal(writes[0].options.status, "pending_review");
396
+ assert.equal(result.skippedByReason["below-confidence"], 1, "ordinary low-confidence facts still drop");
397
+ });
398
+
399
+ test("a digest whose provider title is a personal claim is held for review (#2294)", async () => {
400
+ // Providers derive conversation.title from the same captured audio, so a
401
+ // title lifted from a television scene must not ride into recall on the
402
+ // digest, which bypasses extraction and its clamp entirely.
403
+ const { writer, writes } = makeWriter();
404
+ const wrote = await writeDailyDigestMemory(
405
+ "limitless",
406
+ "2026-06-10",
407
+ [{ ...LONG_CONVERSATION, title: "Dana's cancer diagnosis" }],
408
+ settings({ memoryMode: "smart" }),
409
+ REGISTRY,
410
+ writer,
411
+ );
412
+
413
+ assert.equal(wrote, true, "the digest is still written, just not active");
414
+ assert.equal(writes[0].options.status, "pending_review");
415
+
416
+ const { writer: clean, writes: cleanWrites } = makeWriter();
417
+ await writeDailyDigestMemory(
418
+ "limitless",
419
+ "2026-06-10",
420
+ [LONG_CONVERSATION],
421
+ settings({ memoryMode: "smart" }),
422
+ REGISTRY,
423
+ clean,
424
+ );
425
+ assert.equal(cleanWrites[0].options.status, "active", "an ordinary digest is unaffected");
426
+ });
427
+
346
428
  function judgeReturning(
347
429
  kinds: Array<"accept" | "reject" | "defer">,
348
430
  ): NonNullable<Parameters<typeof generateWearableMemories>[5]["judgeFacts"]> {
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  import { scoreImportance } from "../importance.js";
31
+ import { collectPersonEntityRefs, isHighImpactPersonalFact } from "../ambient-provenance.js";
31
32
  import type { MemoryWriteResult } from "../storage.js";
32
33
  import {
33
34
  composeMemoryEnvelope,
@@ -241,6 +242,9 @@ export function buildExtractionTurns(
241
242
  timestamp,
242
243
  sourceValidAt: timestamp,
243
244
  sessionKey,
245
+ // Always-on capture: this transcript may carry TV, podcast, or
246
+ // overheard speech the wearer never authored (issue #2294).
247
+ ambientCapture: true,
244
248
  });
245
249
  chunkLines = [];
246
250
  chunkChars = 0;
@@ -258,6 +262,12 @@ interface GatedCandidate {
258
262
  fact: ExtractedFact;
259
263
  importance: ImportanceScore;
260
264
  conversation: WearableConversation;
265
+ /**
266
+ * Ambient high-impact verdict, decided where the extraction's entity list is
267
+ * still in scope so personhood comes from the extractor's own `type:
268
+ * "person"` metadata rather than the spelling of `entityRef` (#2294).
269
+ */
270
+ highImpact: boolean;
261
271
  }
262
272
 
263
273
  interface ScoredCandidate {
@@ -375,6 +385,7 @@ export async function generateWearableMemories(
375
385
  result.completed = false;
376
386
  break;
377
387
  }
388
+ const personRefs = collectPersonEntityRefs(extraction);
378
389
  for (const fact of extraction.facts) {
379
390
  const content = fact.content?.trim();
380
391
  if (!content) {
@@ -385,10 +396,18 @@ export async function generateWearableMemories(
385
396
  skip("unsupported-category");
386
397
  continue;
387
398
  }
399
+ const highImpact = isHighImpactPersonalFact({ ...fact, content }, personRefs);
388
400
  // In smart mode the trust bands subsume the hard confidence
389
401
  // floor — a borderline fact belongs in the review band, not on
390
402
  // the floor. The pre-filter applies to review/auto modes only.
403
+ //
404
+ // High-impact ambient claims are exempt: the extraction clamp just
405
+ // pinned them to 0.39, which is below the 0.6 default floor, so the
406
+ // pre-filter would silently drop the very candidates `review` mode
407
+ // promises to queue and would make the auto-mode cap unreachable
408
+ // (#2294). They skip the floor and land pending_review via the cap.
391
409
  if (
410
+ highImpact === false &&
392
411
  settings.memoryMode !== "smart" &&
393
412
  typeof fact.confidence === "number" &&
394
413
  fact.confidence < settings.minConfidence
@@ -410,7 +429,12 @@ export async function generateWearableMemories(
410
429
  continue;
411
430
  }
412
431
  seenContent.add(dedupKey);
413
- candidates.push({ fact: { ...fact, content }, importance, conversation });
432
+ candidates.push({
433
+ fact: { ...fact, content },
434
+ importance,
435
+ conversation,
436
+ highImpact,
437
+ });
414
438
  }
415
439
  }
416
440
 
@@ -446,8 +470,13 @@ export async function generateWearableMemories(
446
470
  const promoteScores = await scoreCandidates(promotable, settings, deps, result);
447
471
  for (const [index, candidate] of promotable.entries()) {
448
472
  const scored = promoteScores.get(index);
473
+ // Every wearable candidate is ambient by construction, so a high-impact
474
+ // personal claim can only ever reach the review queue — late-arriving
475
+ // corroboration must not promote a clamped TV line to active (#2294).
449
476
  const decision = scored
450
- ? decideSmart(scored.trust, scored.verdict, settings)
477
+ ? decideSmart(scored.trust, scored.verdict, settings, {
478
+ capAtReview: candidate.highImpact,
479
+ })
451
480
  : undefined;
452
481
  if (!scored || !decision) {
453
482
  skip("duplicate-existing");
@@ -536,13 +565,24 @@ export async function generateWearableMemories(
536
565
  const modeStatus = memoryStatusForMode(settings.memoryMode);
537
566
  const writable: Writable[] = [];
538
567
  novel.forEach((candidate, index) => {
568
+ // Every wearable candidate is ambient, so a high-impact personal claim can
569
+ // never be written active — on ANY mode. `auto` has no trust scoring and an
570
+ // operator may set minConfidence at or below the speculative ceiling, which
571
+ // would otherwise let a clamped TV line straight into recall (#2294).
572
+ const capAtReview = candidate.highImpact;
539
573
  if (settings.memoryMode !== "smart") {
540
- writable.push({ candidate, index, status: modeStatus, trustAttributes: {} });
574
+ const status = capAtReview ? "pending_review" : modeStatus;
575
+ writable.push({
576
+ candidate,
577
+ index,
578
+ status,
579
+ trustAttributes: capAtReview ? { trustDecision: "ambient-high-impact" } : {},
580
+ });
541
581
  return;
542
582
  }
543
583
  const scored = trustById.get(index);
544
584
  if (!scored) return;
545
- const decision = decideSmart(scored.trust, scored.verdict, settings);
585
+ const decision = decideSmart(scored.trust, scored.verdict, settings, { capAtReview });
546
586
  if (decision.outcome === "drop") {
547
587
  skip(decision.reason);
548
588
  return;
@@ -680,10 +720,19 @@ export async function writeDailyDigestMemory(
680
720
  },
681
721
  { source: wearableSourceLabel(sourceId) },
682
722
  );
723
+ // A provider derives conversation.title from the same captured audio, so a
724
+ // title lifted from a television scene ("Dana's cancer diagnosis") would
725
+ // otherwise ride into recall on the digest, bypassing the extraction prompt
726
+ // and its clamp entirely. Digest content is `moment`, which the classifier
727
+ // already treats as personal-claim-shaped, so this reads the titles alone
728
+ // and holds only a contaminated digest for review (#2294).
729
+ const titleIsHighImpact = lines.some((line) =>
730
+ isHighImpactPersonalFact({ category: "fact", content: line }),
731
+ );
683
732
  await writer.writeSealedMemory(digestEnvelope, {
684
733
  importance: scoreImportance(content, "moment", ["daily-digest"]),
685
734
  contentHashSource: content,
686
- status: memoryStatusForMode(settings.memoryMode),
735
+ status: titleIsHighImpact ? "pending_review" : memoryStatusForMode(settings.memoryMode),
687
736
  memoryKind: "episode",
688
737
  });
689
738
  return true;
@@ -142,15 +142,30 @@ export interface SmartDecision {
142
142
  | "judge-deferred"
143
143
  | "auto-approved"
144
144
  | "queued-for-review"
145
- | "below-trust";
145
+ | "below-trust"
146
+ | "ambient-high-impact";
146
147
  trust: number;
147
148
  }
148
149
 
150
+ export interface SmartDecisionOptions {
151
+ /**
152
+ * Deny auto-approval regardless of score (issue #2294). Set for high-impact
153
+ * personal facts derived from ambient capture: clamping extraction
154
+ * confidence to the speculative ceiling is not enough on its own, because
155
+ * judge-accept plus cross-source and existing-memory boosts sum past
156
+ * `autoApproveTrust` — and two devices in one room recording the same
157
+ * television program corroborate each other perfectly. Such a candidate
158
+ * tops out in the review queue.
159
+ */
160
+ capAtReview?: boolean;
161
+ }
162
+
149
163
  /** Map judge verdict + trust score to the smart-mode decision. */
150
164
  export function decideSmart(
151
165
  trust: number,
152
166
  judgeVerdict: "accept" | "reject" | "defer" | undefined,
153
167
  thresholds: { autoApproveTrust: number; reviewTrust: number },
168
+ options?: SmartDecisionOptions,
154
169
  ): SmartDecision {
155
170
  if (judgeVerdict === "reject") {
156
171
  return { outcome: "drop", reason: "judge-rejected", trust };
@@ -159,7 +174,9 @@ export function decideSmart(
159
174
  return { outcome: "review", reason: "judge-deferred", trust };
160
175
  }
161
176
  if (trust >= thresholds.autoApproveTrust) {
162
- return { outcome: "active", reason: "auto-approved", trust };
177
+ return options?.capAtReview === true
178
+ ? { outcome: "review", reason: "ambient-high-impact", trust }
179
+ : { outcome: "active", reason: "auto-approved", trust };
163
180
  }
164
181
  if (trust >= thresholds.reviewTrust) {
165
182
  return { outcome: "review", reason: "queued-for-review", trust };