@remnic/core 10.0.169 → 10.0.170

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 (349) hide show
  1. package/dist/access-admin-ops-surface.js +124 -123
  2. package/dist/access-cli.js +124 -123
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-coding-context-resolution.js +8 -8
  5. package/dist/access-extraction-force-flush-preempt.js +124 -123
  6. package/dist/access-extraction-force-flush.js +124 -123
  7. package/dist/access-http-briefing.js +124 -123
  8. package/dist/access-http-query.js +124 -123
  9. package/dist/access-http.js +124 -123
  10. package/dist/access-identity-continuity-surface.js +124 -123
  11. package/dist/access-lcm-surface.js +124 -123
  12. package/dist/access-mcp.js +124 -123
  13. package/dist/access-observe-write-category.js +8 -8
  14. package/dist/access-observe-write-surface.js +124 -123
  15. package/dist/access-offline-manifest.js +5 -5
  16. package/dist/access-operations-batch.js +124 -123
  17. package/dist/access-operations.js +124 -123
  18. package/dist/access-recall-concurrency.js +124 -123
  19. package/dist/access-recall-diagnostics.js +2 -2
  20. package/dist/access-recall-response.js +124 -123
  21. package/dist/access-recall-surface.d.ts.map +1 -1
  22. package/dist/access-recall-surface.js +124 -123
  23. package/dist/access-schema.js +7 -7
  24. package/dist/access-service.js +124 -123
  25. package/dist/active-recall.js +21 -20
  26. package/dist/active-recall.js.map +1 -1
  27. package/dist/adapters/index.js +4 -4
  28. package/dist/adapters/registry.js +2 -2
  29. package/dist/behavior-learner.js +1 -1
  30. package/dist/briefing.js +13 -13
  31. package/dist/buffer.js +6 -6
  32. package/dist/causal-behavior.js +2 -2
  33. package/dist/causal-chain.js +2 -2
  34. package/dist/causal-consolidation.js +16 -16
  35. package/dist/causal-retrieval.js +2 -2
  36. package/dist/causal-trajectory-graph.js +2 -2
  37. package/dist/causal-trajectory.js +1 -1
  38. package/dist/{chunk-FHWX2REL.js → chunk-2OAFPBQB.js} +2 -2
  39. package/dist/{chunk-5IZL4DCV.js → chunk-4DF5LMBJ.js} +2 -2
  40. package/dist/{chunk-FWTGO4NE.js → chunk-4DLGKTM6.js} +2 -2
  41. package/dist/{chunk-D6YCETHG.js → chunk-4E2Z44CV.js} +2 -2
  42. package/dist/{chunk-W4EJMMPP.js → chunk-4LVQSHHN.js} +11 -11
  43. package/dist/{chunk-W4Q65VJL.js → chunk-4X7HQKAG.js} +2 -2
  44. package/dist/{chunk-I74SUMNI.js → chunk-5ACIRCBO.js} +65 -3
  45. package/dist/chunk-5ACIRCBO.js.map +1 -0
  46. package/dist/{chunk-LPUEBFX2.js → chunk-5JCYPBY5.js} +2 -2
  47. package/dist/{chunk-ID65XTF3.js → chunk-5SOSQTVE.js} +2 -2
  48. package/dist/{chunk-32OTLNAU.js → chunk-5YIOUS5T.js} +203 -198
  49. package/dist/chunk-5YIOUS5T.js.map +1 -0
  50. package/dist/{chunk-SEIGLG62.js → chunk-6VFMEBXY.js} +4 -4
  51. package/dist/{chunk-333SBFXB.js → chunk-7AAMJQFW.js} +2 -2
  52. package/dist/{chunk-AHOYKJ5X.js → chunk-7SNEJNA3.js} +96 -23
  53. package/dist/chunk-7SNEJNA3.js.map +1 -0
  54. package/dist/{chunk-T3MCVSUC.js → chunk-A2XFG462.js} +2 -2
  55. package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
  56. package/dist/{chunk-GWY5ZFHP.js → chunk-BJOQQCYC.js} +5 -5
  57. package/dist/{chunk-7OYDFIL4.js → chunk-CY2C5LM4.js} +3 -3
  58. package/dist/{chunk-BFBS7OFQ.js → chunk-DC55RIEZ.js} +4 -4
  59. package/dist/{chunk-TGQW3AMK.js → chunk-DNXQVCIC.js} +3 -3
  60. package/dist/{chunk-TQ4CELUR.js → chunk-E53NLIAP.js} +3 -3
  61. package/dist/{chunk-2LA3H54D.js → chunk-E5IZTY4W.js} +2 -2
  62. package/dist/{chunk-PFR6ZKQI.js → chunk-EBI6FI5U.js} +6 -6
  63. package/dist/{chunk-JN7OSQJR.js → chunk-ETTV5F53.js} +2 -2
  64. package/dist/{chunk-FRYCXXTB.js → chunk-FSORYJRP.js} +3 -3
  65. package/dist/{chunk-K36RMINQ.js → chunk-GOZXQNIM.js} +3 -3
  66. package/dist/{chunk-H4IU24V5.js → chunk-GUF2JKG5.js} +2 -2
  67. package/dist/{chunk-XTRC6SSS.js → chunk-H6TCS5XX.js} +11 -8
  68. package/dist/chunk-H6TCS5XX.js.map +1 -0
  69. package/dist/{chunk-MTJFK42O.js → chunk-HHVK2JRE.js} +2 -2
  70. package/dist/{chunk-D5ZLTLHF.js → chunk-HR3DKJCU.js} +2 -2
  71. package/dist/{chunk-AUFPPBC3.js → chunk-IJKO5RVJ.js} +3 -3
  72. package/dist/{chunk-O3OEVYUR.js → chunk-IK7NPYYU.js} +2 -2
  73. package/dist/{chunk-ILNPU5W5.js → chunk-IMA4DJ7K.js} +5 -45
  74. package/dist/chunk-IMA4DJ7K.js.map +1 -0
  75. package/dist/{chunk-ACPFBVUD.js → chunk-JDH2BA2P.js} +2 -2
  76. package/dist/{chunk-VF6SC4OD.js → chunk-JNBSTHVT.js} +2 -2
  77. package/dist/chunk-JVVWCZ2P.js +18 -0
  78. package/dist/chunk-JVVWCZ2P.js.map +1 -0
  79. package/dist/{chunk-OBPOIZNR.js → chunk-KBHUGMUW.js} +2 -2
  80. package/dist/{chunk-M7CFCRWJ.js → chunk-KW4XA7GM.js} +3 -3
  81. package/dist/{chunk-B5KTTWC7.js → chunk-L5EE2CXU.js} +2 -2
  82. package/dist/{chunk-QNUNAXBE.js → chunk-L7LZDISF.js} +1 -9
  83. package/dist/{chunk-QNUNAXBE.js.map → chunk-L7LZDISF.js.map} +1 -1
  84. package/dist/{chunk-N3FRR6II.js → chunk-LAOJHOTG.js} +2 -2
  85. package/dist/{chunk-QPLI7LUU.js → chunk-LH57QATU.js} +2 -2
  86. package/dist/{chunk-JGGNUEVD.js → chunk-NDPS6OU2.js} +2 -2
  87. package/dist/{chunk-N7AIFTSH.js → chunk-NJG63FY2.js} +1 -1
  88. package/dist/{chunk-N7AIFTSH.js.map → chunk-NJG63FY2.js.map} +1 -1
  89. package/dist/{chunk-UPD5XDJX.js → chunk-NKAGGDSL.js} +4 -4
  90. package/dist/{chunk-G3RLCVJC.js → chunk-OGQL7QC7.js} +2 -2
  91. package/dist/{chunk-K3FH3LAQ.js → chunk-OJXK5C6Z.js} +4 -4
  92. package/dist/{chunk-HDLNSDLK.js → chunk-P3XO7HE3.js} +2 -2
  93. package/dist/{chunk-VMRPLHEU.js → chunk-PQIFYBUX.js} +2 -2
  94. package/dist/{chunk-WLT6LTQP.js → chunk-PRRWKTK6.js} +2 -2
  95. package/dist/{chunk-CX24SVLK.js → chunk-Q7OKGBZY.js} +2 -2
  96. package/dist/{chunk-BHRPZBAH.js → chunk-QJBULLKG.js} +3 -3
  97. package/dist/{chunk-WCJQ3OUP.js → chunk-QKAFFVSO.js} +2 -2
  98. package/dist/{chunk-VKXJQF5C.js → chunk-QKBFVLDH.js} +2 -2
  99. package/dist/{chunk-7FPI5MFB.js → chunk-QMFHKWHN.js} +5 -5
  100. package/dist/{chunk-I7WPLMUX.js → chunk-QRCE77YX.js} +2 -2
  101. package/dist/{chunk-K2DTHNDY.js → chunk-R2AJAAHJ.js} +4 -4
  102. package/dist/{chunk-5KDDAQ6K.js → chunk-R3UQIS3F.js} +6 -6
  103. package/dist/{chunk-B3M56D2A.js → chunk-RDHEBINJ.js} +2 -2
  104. package/dist/{chunk-3I3NXB6X.js → chunk-RHQL2RIM.js} +2 -2
  105. package/dist/{chunk-FMIM36I4.js → chunk-SA2YALFU.js} +2 -2
  106. package/dist/{chunk-DPL5VO5V.js → chunk-SAPC7N43.js} +3 -3
  107. package/dist/{chunk-ZA6CYFAK.js → chunk-SOQOUZ2Y.js} +2 -2
  108. package/dist/{chunk-VHXRLD6S.js → chunk-T2JZF45K.js} +2 -2
  109. package/dist/{chunk-63A2BU2B.js → chunk-T4MKFTJF.js} +2 -2
  110. package/dist/{chunk-E7ATID4Z.js → chunk-UFX24WNJ.js} +14 -14
  111. package/dist/{chunk-HQPFACXO.js → chunk-UH3FPX3L.js} +2 -2
  112. package/dist/{chunk-3LADDLAF.js → chunk-V5W67PQV.js} +4 -4
  113. package/dist/{chunk-PRC7SZYM.js → chunk-VAQIBC2L.js} +2 -2
  114. package/dist/{chunk-3Q3XD3NO.js → chunk-W2E2WFXL.js} +3 -3
  115. package/dist/{chunk-GF5NN3LE.js → chunk-W2UV6VE3.js} +2 -2
  116. package/dist/{chunk-SH3GOZWK.js → chunk-W35ICLYZ.js} +2 -2
  117. package/dist/{chunk-ALTLOHO7.js → chunk-WF2LYKOB.js} +2 -2
  118. package/dist/{chunk-FSXYBIEZ.js → chunk-X5MFCZDL.js} +72 -35
  119. package/dist/chunk-X5MFCZDL.js.map +1 -0
  120. package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
  121. package/dist/{chunk-IJVU4ILJ.js → chunk-XYNUEXLC.js} +4 -4
  122. package/dist/{chunk-RVAPK2S7.js → chunk-Y65XX5PC.js} +2 -2
  123. package/dist/{chunk-YWMCV5HL.js → chunk-YE77U5HZ.js} +3 -3
  124. package/dist/{chunk-VPEIWMUT.js → chunk-YLTU2DC4.js} +2 -2
  125. package/dist/{chunk-62YZOQFR.js → chunk-YRD525ZO.js} +2 -2
  126. package/dist/{chunk-TBBDFYXW.js → chunk-YVUNHNB6.js} +2 -3
  127. package/dist/chunk-YVUNHNB6.js.map +1 -0
  128. package/dist/{chunk-ITGAGNX5.js → chunk-YY5UXARJ.js} +24 -12
  129. package/dist/chunk-YY5UXARJ.js.map +1 -0
  130. package/dist/{chunk-U7KP6QFU.js → chunk-ZJ3CEAJD.js} +2 -2
  131. package/dist/{chunk-QC2MHZDD.js → chunk-ZOJUWVAU.js} +1 -1
  132. package/dist/{chunk-HH6PXQ2B.js → chunk-ZYP4YEEI.js} +2 -2
  133. package/dist/cli.js +124 -123
  134. package/dist/coding/export-okf-codegraph.js +21 -21
  135. package/dist/coding/pre-action-gate.js +2 -2
  136. package/dist/compounding/engine.js +14 -14
  137. package/dist/config-deprecations.d.ts +3 -0
  138. package/dist/config-deprecations.d.ts.map +1 -0
  139. package/dist/config-deprecations.js +9 -0
  140. package/dist/config.d.ts.map +1 -1
  141. package/dist/config.js +21 -20
  142. package/dist/connectors/codex-materialize-runner.js +13 -13
  143. package/dist/connectors/index.js +13 -13
  144. package/dist/convergence-refresh.js +16 -16
  145. package/dist/corpus-watermark.js +15 -15
  146. package/dist/deep-recall-http-glue.js +8 -8
  147. package/dist/deep-recall.js +2 -2
  148. package/dist/embedding-fallback.js +1 -1
  149. package/dist/entity-retrieval.js +14 -14
  150. package/dist/explicit-capture.js +124 -123
  151. package/dist/extraction-span-materialize.js +2 -2
  152. package/dist/extraction.js +22 -22
  153. package/dist/{first-start-migration-BPVJ4HJQ.js → first-start-migration-PPPP54X6.js} +5 -5
  154. package/dist/{graph-edge-decay-CXTNJ7IQ.js → graph-edge-decay-EKWXRBWF.js} +5 -5
  155. package/dist/graph-jsonl.js +3 -3
  156. package/dist/graph-snapshot.js +3 -3
  157. package/dist/graph.js +2 -2
  158. package/dist/harmonic-retrieval.js +13 -13
  159. package/dist/index.js +173 -171
  160. package/dist/lcm/engine.js +2 -2
  161. package/dist/lcm/index.js +4 -4
  162. package/dist/lifecycle.d.ts +0 -6
  163. package/dist/lifecycle.d.ts.map +1 -1
  164. package/dist/lifecycle.js +1 -1
  165. package/dist/location/index.js +25 -15
  166. package/dist/location/provider-setup.d.ts +26 -1
  167. package/dist/location/provider-setup.d.ts.map +1 -1
  168. package/dist/maintenance/memory-governance.js +14 -14
  169. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +13 -13
  170. package/dist/maintenance/rebuild-memory-projection-runner.js +16 -16
  171. package/dist/maintenance/rebuild-memory-projection.js +15 -15
  172. package/dist/memory-browse.js +6 -6
  173. package/dist/{migrate-from-identity-anchor-MJYB6NNN.js → migrate-from-identity-anchor-TZSZXJ6L.js} +2 -2
  174. package/dist/migrate-from-identity-anchor-TZSZXJ6L.js.map +1 -0
  175. package/dist/model-registry.d.ts +0 -5
  176. package/dist/model-registry.d.ts.map +1 -1
  177. package/dist/model-registry.js +1 -1
  178. package/dist/namespaces/migrate.js +14 -14
  179. package/dist/namespaces/search.js +6 -6
  180. package/dist/namespaces/storage.js +13 -13
  181. package/dist/offline-sync-changeset-generations.js +3 -3
  182. package/dist/offline-sync-embedding-generation.js +2 -2
  183. package/dist/offline-sync-snapshot-stream.js +5 -5
  184. package/dist/offline-sync.js +4 -4
  185. package/dist/operator-doctor-corpus.js +16 -16
  186. package/dist/operator-toolkit.js +32 -31
  187. package/dist/orchestration/backlog-scheduler.js +125 -124
  188. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  189. package/dist/orchestration/buffer-drain-runner.js +125 -124
  190. package/dist/orchestration/maintenance.js +22 -22
  191. package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -1
  192. package/dist/orchestration/workspace-ops.d.ts.map +1 -1
  193. package/dist/orchestrator.js +124 -123
  194. package/dist/peers/index.d.ts +2 -1
  195. package/dist/peers/index.d.ts.map +1 -1
  196. package/dist/peers/index.js +3 -3
  197. package/dist/peers/interaction-log-append.d.ts +8 -0
  198. package/dist/peers/interaction-log-append.d.ts.map +1 -0
  199. package/dist/peers/storage.d.ts +22 -8
  200. package/dist/peers/storage.d.ts.map +1 -1
  201. package/dist/policy-runtime.js +2 -2
  202. package/dist/qmd.js +2 -2
  203. package/dist/recall-explain-renderer.js +3 -3
  204. package/dist/recall-navigate-access.js +2 -2
  205. package/dist/recall-navigate-disclosure.js +2 -2
  206. package/dist/recall-navigate.js +2 -2
  207. package/dist/recall-navigation.js +124 -123
  208. package/dist/recall-state-view-admission.js +6 -6
  209. package/dist/recall-why-service.js +6 -6
  210. package/dist/recall-xray-cli.js +4 -4
  211. package/dist/recall-xray-renderer.js +3 -3
  212. package/dist/recall-xray.js +2 -2
  213. package/dist/resume-bundles.js +22 -21
  214. package/dist/retrieval.js +2 -2
  215. package/dist/search/factory.js +5 -5
  216. package/dist/search/index.js +9 -9
  217. package/dist/semantic-consolidation.d.ts +10 -16
  218. package/dist/semantic-consolidation.d.ts.map +1 -1
  219. package/dist/semantic-consolidation.js +14 -14
  220. package/dist/semantic-rule-promotion.js +13 -13
  221. package/dist/semantic-rule-verifier.js +13 -13
  222. package/dist/source-agent-qualifier.js +17 -17
  223. package/dist/standup/build.js +13 -13
  224. package/dist/storage/links-frontmatter.d.ts +3 -0
  225. package/dist/storage/links-frontmatter.d.ts.map +1 -0
  226. package/dist/storage.d.ts.map +1 -1
  227. package/dist/storage.js +12 -12
  228. package/dist/summarizer.js +2 -2
  229. package/dist/tier-routing.js +2 -2
  230. package/dist/{tier-stats-FLFKN7Y6.js → tier-stats-XWJSVEHC.js} +5 -5
  231. package/dist/transfer/capsule-export.js +2 -2
  232. package/dist/transfer/capsule-import.js +2 -2
  233. package/dist/transfer/export-okf.js +13 -13
  234. package/dist/types.d.ts +1 -0
  235. package/dist/types.d.ts.map +1 -1
  236. package/dist/types.js +1 -1
  237. package/dist/utility-learner.js +2 -2
  238. package/dist/utility-runtime.js +3 -3
  239. package/dist/verified-recall.js +13 -13
  240. package/dist/who-knows-cli.js +14 -14
  241. package/dist/who-knows.js +13 -13
  242. package/package.json +2 -2
  243. package/src/access-recall-surface.ts +0 -2
  244. package/src/config-deprecations.ts +14 -0
  245. package/src/config.ts +2 -1
  246. package/src/lifecycle.ts +0 -8
  247. package/src/location/provider-setup.test.ts +273 -2
  248. package/src/location/provider-setup.ts +138 -32
  249. package/src/model-registry.ts +0 -11
  250. package/src/orchestration/semantic-consolidation-coordinator.ts +40 -33
  251. package/src/orchestration/semantic-consolidation-split.test.ts +72 -0
  252. package/src/orchestration/workspace-ops.test.ts +23 -0
  253. package/src/orchestration/workspace-ops.ts +6 -5
  254. package/src/peers/index.ts +1 -1
  255. package/src/peers/interaction-log-append.ts +132 -0
  256. package/src/peers/peers.test.ts +30 -0
  257. package/src/peers/profile-reasoner.ts +1 -1
  258. package/src/peers/storage.ts +4 -105
  259. package/src/semantic-consolidation.ts +35 -27
  260. package/src/storage/links-frontmatter.ts +69 -0
  261. package/src/storage-links-parse.test.ts +153 -0
  262. package/src/storage.ts +4 -18
  263. package/src/testing/subjects/dependency-propagation.test.ts +5 -4
  264. package/src/types.ts +1 -0
  265. package/dist/chunk-32OTLNAU.js.map +0 -1
  266. package/dist/chunk-AHOYKJ5X.js.map +0 -1
  267. package/dist/chunk-FSXYBIEZ.js.map +0 -1
  268. package/dist/chunk-I74SUMNI.js.map +0 -1
  269. package/dist/chunk-ILNPU5W5.js.map +0 -1
  270. package/dist/chunk-ITGAGNX5.js.map +0 -1
  271. package/dist/chunk-TBBDFYXW.js.map +0 -1
  272. package/dist/chunk-XTRC6SSS.js.map +0 -1
  273. /package/dist/{chunk-FHWX2REL.js.map → chunk-2OAFPBQB.js.map} +0 -0
  274. /package/dist/{chunk-5IZL4DCV.js.map → chunk-4DF5LMBJ.js.map} +0 -0
  275. /package/dist/{chunk-FWTGO4NE.js.map → chunk-4DLGKTM6.js.map} +0 -0
  276. /package/dist/{chunk-D6YCETHG.js.map → chunk-4E2Z44CV.js.map} +0 -0
  277. /package/dist/{chunk-W4EJMMPP.js.map → chunk-4LVQSHHN.js.map} +0 -0
  278. /package/dist/{chunk-W4Q65VJL.js.map → chunk-4X7HQKAG.js.map} +0 -0
  279. /package/dist/{chunk-LPUEBFX2.js.map → chunk-5JCYPBY5.js.map} +0 -0
  280. /package/dist/{chunk-ID65XTF3.js.map → chunk-5SOSQTVE.js.map} +0 -0
  281. /package/dist/{chunk-SEIGLG62.js.map → chunk-6VFMEBXY.js.map} +0 -0
  282. /package/dist/{chunk-333SBFXB.js.map → chunk-7AAMJQFW.js.map} +0 -0
  283. /package/dist/{chunk-T3MCVSUC.js.map → chunk-A2XFG462.js.map} +0 -0
  284. /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
  285. /package/dist/{chunk-GWY5ZFHP.js.map → chunk-BJOQQCYC.js.map} +0 -0
  286. /package/dist/{chunk-7OYDFIL4.js.map → chunk-CY2C5LM4.js.map} +0 -0
  287. /package/dist/{chunk-BFBS7OFQ.js.map → chunk-DC55RIEZ.js.map} +0 -0
  288. /package/dist/{chunk-TGQW3AMK.js.map → chunk-DNXQVCIC.js.map} +0 -0
  289. /package/dist/{chunk-TQ4CELUR.js.map → chunk-E53NLIAP.js.map} +0 -0
  290. /package/dist/{chunk-2LA3H54D.js.map → chunk-E5IZTY4W.js.map} +0 -0
  291. /package/dist/{chunk-PFR6ZKQI.js.map → chunk-EBI6FI5U.js.map} +0 -0
  292. /package/dist/{chunk-JN7OSQJR.js.map → chunk-ETTV5F53.js.map} +0 -0
  293. /package/dist/{chunk-FRYCXXTB.js.map → chunk-FSORYJRP.js.map} +0 -0
  294. /package/dist/{chunk-K36RMINQ.js.map → chunk-GOZXQNIM.js.map} +0 -0
  295. /package/dist/{chunk-H4IU24V5.js.map → chunk-GUF2JKG5.js.map} +0 -0
  296. /package/dist/{chunk-MTJFK42O.js.map → chunk-HHVK2JRE.js.map} +0 -0
  297. /package/dist/{chunk-D5ZLTLHF.js.map → chunk-HR3DKJCU.js.map} +0 -0
  298. /package/dist/{chunk-AUFPPBC3.js.map → chunk-IJKO5RVJ.js.map} +0 -0
  299. /package/dist/{chunk-O3OEVYUR.js.map → chunk-IK7NPYYU.js.map} +0 -0
  300. /package/dist/{chunk-ACPFBVUD.js.map → chunk-JDH2BA2P.js.map} +0 -0
  301. /package/dist/{chunk-VF6SC4OD.js.map → chunk-JNBSTHVT.js.map} +0 -0
  302. /package/dist/{chunk-OBPOIZNR.js.map → chunk-KBHUGMUW.js.map} +0 -0
  303. /package/dist/{chunk-M7CFCRWJ.js.map → chunk-KW4XA7GM.js.map} +0 -0
  304. /package/dist/{chunk-B5KTTWC7.js.map → chunk-L5EE2CXU.js.map} +0 -0
  305. /package/dist/{chunk-N3FRR6II.js.map → chunk-LAOJHOTG.js.map} +0 -0
  306. /package/dist/{chunk-QPLI7LUU.js.map → chunk-LH57QATU.js.map} +0 -0
  307. /package/dist/{chunk-JGGNUEVD.js.map → chunk-NDPS6OU2.js.map} +0 -0
  308. /package/dist/{chunk-UPD5XDJX.js.map → chunk-NKAGGDSL.js.map} +0 -0
  309. /package/dist/{chunk-G3RLCVJC.js.map → chunk-OGQL7QC7.js.map} +0 -0
  310. /package/dist/{chunk-K3FH3LAQ.js.map → chunk-OJXK5C6Z.js.map} +0 -0
  311. /package/dist/{chunk-HDLNSDLK.js.map → chunk-P3XO7HE3.js.map} +0 -0
  312. /package/dist/{chunk-VMRPLHEU.js.map → chunk-PQIFYBUX.js.map} +0 -0
  313. /package/dist/{chunk-WLT6LTQP.js.map → chunk-PRRWKTK6.js.map} +0 -0
  314. /package/dist/{chunk-CX24SVLK.js.map → chunk-Q7OKGBZY.js.map} +0 -0
  315. /package/dist/{chunk-BHRPZBAH.js.map → chunk-QJBULLKG.js.map} +0 -0
  316. /package/dist/{chunk-WCJQ3OUP.js.map → chunk-QKAFFVSO.js.map} +0 -0
  317. /package/dist/{chunk-VKXJQF5C.js.map → chunk-QKBFVLDH.js.map} +0 -0
  318. /package/dist/{chunk-7FPI5MFB.js.map → chunk-QMFHKWHN.js.map} +0 -0
  319. /package/dist/{chunk-I7WPLMUX.js.map → chunk-QRCE77YX.js.map} +0 -0
  320. /package/dist/{chunk-K2DTHNDY.js.map → chunk-R2AJAAHJ.js.map} +0 -0
  321. /package/dist/{chunk-5KDDAQ6K.js.map → chunk-R3UQIS3F.js.map} +0 -0
  322. /package/dist/{chunk-B3M56D2A.js.map → chunk-RDHEBINJ.js.map} +0 -0
  323. /package/dist/{chunk-3I3NXB6X.js.map → chunk-RHQL2RIM.js.map} +0 -0
  324. /package/dist/{chunk-FMIM36I4.js.map → chunk-SA2YALFU.js.map} +0 -0
  325. /package/dist/{chunk-DPL5VO5V.js.map → chunk-SAPC7N43.js.map} +0 -0
  326. /package/dist/{chunk-ZA6CYFAK.js.map → chunk-SOQOUZ2Y.js.map} +0 -0
  327. /package/dist/{chunk-VHXRLD6S.js.map → chunk-T2JZF45K.js.map} +0 -0
  328. /package/dist/{chunk-63A2BU2B.js.map → chunk-T4MKFTJF.js.map} +0 -0
  329. /package/dist/{chunk-E7ATID4Z.js.map → chunk-UFX24WNJ.js.map} +0 -0
  330. /package/dist/{chunk-HQPFACXO.js.map → chunk-UH3FPX3L.js.map} +0 -0
  331. /package/dist/{chunk-3LADDLAF.js.map → chunk-V5W67PQV.js.map} +0 -0
  332. /package/dist/{chunk-PRC7SZYM.js.map → chunk-VAQIBC2L.js.map} +0 -0
  333. /package/dist/{chunk-3Q3XD3NO.js.map → chunk-W2E2WFXL.js.map} +0 -0
  334. /package/dist/{chunk-GF5NN3LE.js.map → chunk-W2UV6VE3.js.map} +0 -0
  335. /package/dist/{chunk-SH3GOZWK.js.map → chunk-W35ICLYZ.js.map} +0 -0
  336. /package/dist/{chunk-ALTLOHO7.js.map → chunk-WF2LYKOB.js.map} +0 -0
  337. /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
  338. /package/dist/{chunk-IJVU4ILJ.js.map → chunk-XYNUEXLC.js.map} +0 -0
  339. /package/dist/{chunk-RVAPK2S7.js.map → chunk-Y65XX5PC.js.map} +0 -0
  340. /package/dist/{chunk-YWMCV5HL.js.map → chunk-YE77U5HZ.js.map} +0 -0
  341. /package/dist/{chunk-VPEIWMUT.js.map → chunk-YLTU2DC4.js.map} +0 -0
  342. /package/dist/{chunk-62YZOQFR.js.map → chunk-YRD525ZO.js.map} +0 -0
  343. /package/dist/{chunk-U7KP6QFU.js.map → chunk-ZJ3CEAJD.js.map} +0 -0
  344. /package/dist/{chunk-QC2MHZDD.js.map → chunk-ZOJUWVAU.js.map} +0 -0
  345. /package/dist/{chunk-HH6PXQ2B.js.map → chunk-ZYP4YEEI.js.map} +0 -0
  346. /package/dist/{graph-edge-decay-CXTNJ7IQ.js.map → config-deprecations.js.map} +0 -0
  347. /package/dist/{first-start-migration-BPVJ4HJQ.js.map → first-start-migration-PPPP54X6.js.map} +0 -0
  348. /package/dist/{migrate-from-identity-anchor-MJYB6NNN.js.map → graph-edge-decay-EKWXRBWF.js.map} +0 -0
  349. /package/dist/{tier-stats-FLFKN7Y6.js.map → tier-stats-XWJSVEHC.js.map} +0 -0
package/src/lifecycle.ts CHANGED
@@ -24,12 +24,6 @@ export interface LifecycleSignals {
24
24
  * This is intentionally low-impact to avoid circular amplification.
25
25
  */
26
26
  actionPriorScore?: number;
27
- /**
28
- * Optional causal impact score from CMC chain analysis in [0, 0.3].
29
- * Computed as 0.1 * incomingEdges + 0.15 * outgoingEdges, clamped.
30
- * Weight in heat/decay is intentionally low (0.05) to avoid circular amplification.
31
- */
32
- causalImpactScore?: number;
33
27
  }
34
28
 
35
29
  export interface LifecycleDecision {
@@ -141,13 +135,11 @@ export function computeHeat(
141
135
  if (frontmatter.status === "archived") return 0;
142
136
 
143
137
  const inputs = computeLifecycleValueInputs(memory, now, signals);
144
- const causalBoost = clamp01(signals?.causalImpactScore ?? 0) * 0.05;
145
138
  const score = (inputs.confidence * 0.25)
146
139
  + (inputs.access * 0.3)
147
140
  + (inputs.recency * 0.2)
148
141
  + (inputs.importance * 0.15)
149
142
  + (inputs.feedback * 0.1)
150
- + causalBoost
151
143
  - inputs.disputedPenalty;
152
144
  return clamp01(score);
153
145
  }
@@ -9,7 +9,16 @@ import test from "node:test";
9
9
 
10
10
  import { parseLocationConfig } from "./config.js";
11
11
  import { clearLocationProviders, getLocationProvider, registerLocationProvider } from "./registry.js";
12
- import { ensureConfiguredLocationProviders, type LocationProviderEnv } from "./provider-setup.js";
12
+ import {
13
+ ensureConfiguredLocationProviders,
14
+ getLocationProviderSetup,
15
+ listLocationProviderSetups,
16
+ registerLocationProviderSetup,
17
+ resetLocationProviderSetups,
18
+ unregisterLocationProviderSetup,
19
+ type LocationProviderEnv,
20
+ type LocationProviderSetupEntry,
21
+ } from "./provider-setup.js";
13
22
  import type { LocationProvider } from "./types.js";
14
23
 
15
24
  const ENV: LocationProviderEnv = {
@@ -43,7 +52,10 @@ function importModuleDouble(options: { registered: boolean; failWith?: Error })
43
52
  };
44
53
  }
45
54
 
46
- test.afterEach(() => clearLocationProviders());
55
+ test.afterEach(() => {
56
+ clearLocationProviders();
57
+ resetLocationProviderSetups();
58
+ });
47
59
 
48
60
  test("registers reitti from env credentials with timezone threaded through", async () => {
49
61
  const config = parseLocationConfig({ enabled: true, timezone: "Europe/Berlin", sources: [{ id: "reitti" }] });
@@ -104,3 +116,262 @@ test("invalid authMode falls back to the connector default (single header form)"
104
116
  });
105
117
  assert.equal("authMode" in (loader.calls[0] ?? {}), false, "invalid mode must not be forwarded");
106
118
  });
119
+
120
+ interface OwntracksModule {
121
+ ensureOwntracksRegistered(opts: { baseUrl: string; token: string; timezone: string }): boolean;
122
+ }
123
+
124
+ function stubLocationProvider(id: string, displayName: string): LocationProvider {
125
+ return {
126
+ id,
127
+ displayName,
128
+ verify: async () => ({ ok: true }),
129
+ fetchObservations: async () => ({ observations: [], nextCursor: null }),
130
+ };
131
+ }
132
+
133
+ function makeOwntracksSetupEntry(calls: Array<{ baseUrl: string; token: string; timezone: string }>): LocationProviderSetupEntry {
134
+ return {
135
+ id: "owntracks",
136
+ packageSpecifier: "@remnic/connector-owntracks",
137
+ setup: async (context) => {
138
+ const baseUrl = context.env?.baseUrl?.trim();
139
+ const token = context.env?.token?.trim();
140
+ if (!baseUrl || !token) return false;
141
+ const mod = await context.loadPackage<OwntracksModule>();
142
+ const opts = { baseUrl, token, timezone: context.config.timezone };
143
+ calls.push(opts);
144
+ return mod.ensureOwntracksRegistered(opts);
145
+ },
146
+ };
147
+ }
148
+
149
+ test("registers non-reitti provider registered in setup table with idempotency", async () => {
150
+ const setupCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
151
+ const requestedSpecifiers: string[] = [];
152
+ registerLocationProviderSetup(makeOwntracksSetupEntry(setupCalls));
153
+
154
+ assert.equal(getLocationProviderSetup("owntracks")?.packageSpecifier, "@remnic/connector-owntracks");
155
+ assert.ok(listLocationProviderSetups().includes("owntracks"));
156
+
157
+ const importModule = async (specifier: string) => {
158
+ requestedSpecifiers.push(specifier);
159
+ const mod: OwntracksModule = {
160
+ ensureOwntracksRegistered: () => {
161
+ registerLocationProvider(stubLocationProvider("owntracks", "OwnTracks"));
162
+ return true;
163
+ },
164
+ };
165
+ return mod;
166
+ };
167
+
168
+ const config = parseLocationConfig({
169
+ enabled: true,
170
+ timezone: "America/Chicago",
171
+ sources: [{ id: "owntracks" }],
172
+ });
173
+ const registered = await ensureConfiguredLocationProviders(config, {
174
+ env: { baseUrl: "https://owntracks.example.invalid", token: "ot-secret" },
175
+ importModule,
176
+ });
177
+
178
+ assert.deepEqual(registered, ["owntracks"]);
179
+ assert.deepEqual(requestedSpecifiers, ["@remnic/connector-owntracks"]);
180
+ assert.deepEqual(setupCalls, [
181
+ { baseUrl: "https://owntracks.example.invalid", token: "ot-secret", timezone: "America/Chicago" },
182
+ ]);
183
+ assert.equal(getLocationProvider("owntracks")?.displayName, "OwnTracks");
184
+
185
+ const registeredAgain = await ensureConfiguredLocationProviders(config, {
186
+ env: { baseUrl: "https://owntracks.example.invalid", token: "ot-secret" },
187
+ importModule,
188
+ });
189
+ assert.deepEqual(registeredAgain, []);
190
+ assert.equal(requestedSpecifiers.length, 1);
191
+ });
192
+
193
+ test("bootstraps multiple configured sources independently using envBySource", async () => {
194
+ const owntracksCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
195
+ registerLocationProviderSetup(makeOwntracksSetupEntry(owntracksCalls));
196
+
197
+ const reittiLoader = importModuleDouble({ registered: true });
198
+ const requestedSpecifiers: string[] = [];
199
+ const importModule = async (specifier: string) => {
200
+ requestedSpecifiers.push(specifier);
201
+ if (specifier === "@remnic/connector-owntracks") {
202
+ const mod: OwntracksModule = {
203
+ ensureOwntracksRegistered: () => {
204
+ registerLocationProvider(stubLocationProvider("owntracks", "OwnTracks"));
205
+ return true;
206
+ },
207
+ };
208
+ return mod;
209
+ }
210
+ return reittiLoader.importModule();
211
+ };
212
+
213
+ const config = parseLocationConfig({
214
+ enabled: true,
215
+ timezone: "UTC",
216
+ sources: [{ id: "reitti" }, { id: "owntracks" }],
217
+ });
218
+ const envBySource = new Map<string, LocationProviderEnv>([
219
+ ["reitti", ENV],
220
+ ["owntracks", { baseUrl: "https://owntracks.example.invalid", token: "ot-token" }],
221
+ ]);
222
+
223
+ const registered = await ensureConfiguredLocationProviders(config, { envBySource, importModule });
224
+ assert.deepEqual(registered, ["reitti", "owntracks"]);
225
+ assert.deepEqual(requestedSpecifiers, ["@remnic/connector-reitti", "@remnic/connector-owntracks"]);
226
+ assert.ok(getLocationProvider("reitti"));
227
+ assert.ok(getLocationProvider("owntracks"));
228
+
229
+ clearLocationProviders();
230
+ const partialEnvBySource = new Map<string, LocationProviderEnv>([
231
+ ["reitti", { baseUrl: ENV.baseUrl }],
232
+ ["owntracks", { baseUrl: "https://owntracks.example.invalid", token: "ot-token" }],
233
+ ]);
234
+ const partialRegistered = await ensureConfiguredLocationProviders(config, {
235
+ envBySource: partialEnvBySource,
236
+ importModule,
237
+ });
238
+ assert.deepEqual(partialRegistered, ["owntracks"]);
239
+ });
240
+
241
+ test("setup registry validates ids, rejects duplicates, unregisters, and resets to defaults", async () => {
242
+ assert.equal(getLocationProviderSetup("reitti")?.packageSpecifier, "@remnic/connector-reitti");
243
+ assert.deepEqual(listLocationProviderSetups(), ["reitti"]);
244
+
245
+ const dummySetup: LocationProviderSetupEntry["setup"] = async () => false;
246
+ assert.throws(
247
+ () => registerLocationProviderSetup({ id: "", packageSpecifier: "@remnic/x", setup: dummySetup }),
248
+ RangeError,
249
+ );
250
+ assert.throws(
251
+ () => registerLocationProviderSetup({ id: "UpperCase", packageSpecifier: "@remnic/x", setup: dummySetup }),
252
+ RangeError,
253
+ );
254
+ assert.throws(
255
+ () => registerLocationProviderSetup({ id: "../traversal", packageSpecifier: "@remnic/x", setup: dummySetup }),
256
+ RangeError,
257
+ );
258
+ assert.throws(
259
+ () => registerLocationProviderSetup({ id: "valid-id", packageSpecifier: " ", setup: dummySetup }),
260
+ TypeError,
261
+ );
262
+ assert.throws(
263
+ () => registerLocationProviderSetup({ id: "reitti", packageSpecifier: "@remnic/other", setup: dummySetup }),
264
+ /already registered/,
265
+ );
266
+
267
+ registerLocationProviderSetup({
268
+ id: "custom-gps",
269
+ packageSpecifier: "@remnic/connector-custom-gps",
270
+ setup: async (context) => {
271
+ await context.loadPackage<OwntracksModule>();
272
+ registerLocationProvider(stubLocationProvider("custom-gps", "Custom GPS"));
273
+ return true;
274
+ },
275
+ });
276
+ assert.deepEqual(listLocationProviderSetups(), ["custom-gps", "reitti"]);
277
+ assert.equal(unregisterLocationProviderSetup("custom-gps"), true);
278
+ assert.equal(unregisterLocationProviderSetup("custom-gps"), false);
279
+
280
+ let loaded = false;
281
+ const skipped = await ensureConfiguredLocationProviders(
282
+ parseLocationConfig({ enabled: true, sources: [{ id: "custom-gps" }] }),
283
+ {
284
+ env: ENV,
285
+ importModule: async () => {
286
+ loaded = true;
287
+ return {};
288
+ },
289
+ },
290
+ );
291
+ assert.deepEqual(skipped, []);
292
+ assert.equal(loaded, false);
293
+
294
+ registerLocationProviderSetup({
295
+ id: "custom-gps",
296
+ packageSpecifier: "@remnic/connector-custom-gps",
297
+ setup: dummySetup,
298
+ });
299
+ resetLocationProviderSetups();
300
+ assert.deepEqual(listLocationProviderSetups(), ["reitti"]);
301
+ });
302
+
303
+ test("absent optional package and load failures on registered custom setup do not throw", async () => {
304
+ const setupCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
305
+ registerLocationProviderSetup(makeOwntracksSetupEntry(setupCalls));
306
+ registerLocationProviderSetup({
307
+ id: "second-provider",
308
+ packageSpecifier: "@remnic/connector-second",
309
+ setup: async (context) => {
310
+ const mod = await context.loadPackage<OwntracksModule>();
311
+ return mod.ensureOwntracksRegistered({
312
+ baseUrl: context.env?.baseUrl ?? "",
313
+ token: context.env?.token ?? "",
314
+ timezone: context.config.timezone,
315
+ });
316
+ },
317
+ });
318
+
319
+ const configOne = parseLocationConfig({ enabled: true, sources: [{ id: "owntracks" }] });
320
+ const absent = await ensureConfiguredLocationProviders(configOne, {
321
+ env: ENV,
322
+ importModule: async () => {
323
+ throw Object.assign(new Error("Cannot find module '@remnic/connector-owntracks'"), {
324
+ code: "ERR_MODULE_NOT_FOUND",
325
+ });
326
+ },
327
+ });
328
+ assert.deepEqual(absent, []);
329
+
330
+ const configBoth = parseLocationConfig({
331
+ enabled: true,
332
+ sources: [{ id: "owntracks" }, { id: "second-provider" }],
333
+ });
334
+ const partialAfterFailure = await ensureConfiguredLocationProviders(configBoth, {
335
+ env: ENV,
336
+ importModule: async (specifier: string) => {
337
+ if (specifier === "@remnic/connector-owntracks") {
338
+ throw new Error("syntax error in broken optional package");
339
+ }
340
+ const mod: OwntracksModule = {
341
+ ensureOwntracksRegistered: () => {
342
+ registerLocationProvider(stubLocationProvider("second-provider", "Second"));
343
+ return true;
344
+ },
345
+ };
346
+ return mod;
347
+ },
348
+ });
349
+ assert.deepEqual(partialAfterFailure, ["second-provider"]);
350
+ });
351
+
352
+ test("getSetup dependency overrides global setup lookup", async () => {
353
+ let calledSpecifier = "";
354
+ const injectedEntry: LocationProviderSetupEntry = {
355
+ id: "custom-seam",
356
+ packageSpecifier: "@remnic/connector-seam",
357
+ setup: async (context) => {
358
+ await context.loadPackage<OwntracksModule>();
359
+ registerLocationProvider(stubLocationProvider("custom-seam", "Custom Seam"));
360
+ return true;
361
+ },
362
+ };
363
+
364
+ const registered = await ensureConfiguredLocationProviders(
365
+ parseLocationConfig({ enabled: true, sources: [{ id: "custom-seam" }] }),
366
+ {
367
+ importModule: async (specifier: string) => {
368
+ calledSpecifier = specifier;
369
+ return {};
370
+ },
371
+ getSetup: (id: string) => (id === "custom-seam" ? injectedEntry : undefined),
372
+ },
373
+ );
374
+ assert.deepEqual(registered, ["custom-seam"]);
375
+ assert.equal(calledSpecifier, "@remnic/connector-seam");
376
+ assert.equal(getLocationProviderSetup("custom-seam"), undefined);
377
+ });
@@ -24,21 +24,45 @@ export interface LocationProviderEnv {
24
24
  }
25
25
 
26
26
  export interface LocationProviderSetupDeps {
27
- /** Injectable env (tests); defaults to REITTI_* process variables. */
27
+ /** Injectable env (tests); defaults to provider-specific process variables. */
28
28
  env?: LocationProviderEnv;
29
+ /** Per-source env overrides keyed by provider id. */
30
+ envBySource?: ReadonlyMap<string, LocationProviderEnv>;
29
31
  /** Injectable module loader (tests); defaults to a dynamic import. */
30
32
  importModule?: (specifier: string) => Promise<unknown>;
33
+ /** Injectable setup lookup (tests); defaults to the global setup registry. */
34
+ getSetup?: (id: string) => LocationProviderSetupEntry | undefined;
35
+ }
36
+
37
+ export type LocationProviderPackageLoader = <TModule>() => Promise<TModule>;
38
+
39
+ export interface LocationProviderSetupContext {
40
+ readonly config: LocationConfig;
41
+ readonly env?: LocationProviderEnv;
42
+ readonly loadPackage: LocationProviderPackageLoader;
43
+ }
44
+
45
+ export interface LocationProviderSetupEntry {
46
+ readonly id: string;
47
+ readonly packageSpecifier: string;
48
+ readonly setup: (context: LocationProviderSetupContext) => Promise<boolean>;
49
+ }
50
+
51
+ interface ReittiProviderRegistrationOptions {
52
+ baseUrl: string;
53
+ token: string;
54
+ timezone: string;
55
+ authMode?: "x-api-token" | "bearer";
31
56
  }
32
57
 
33
58
  interface ReittiProviderModule {
34
- ensureReittiProviderRegistered(options: {
35
- baseUrl: string;
36
- token: string;
37
- timezone: string;
38
- authMode?: "x-api-token" | "bearer";
39
- }): boolean;
59
+ ensureReittiProviderRegistered(options: ReittiProviderRegistrationOptions): boolean;
40
60
  }
41
61
 
62
+ const PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
63
+ // Computed scope prefix prevents bundlers from statically resolving optional connectors.
64
+ const OPTIONAL_PACKAGE_SCOPE = "@remnic/";
65
+
42
66
  const loadFailuresWarned = new Set<string>();
43
67
 
44
68
  function readReittiEnv(): LocationProviderEnv {
@@ -49,6 +73,95 @@ function readReittiEnv(): LocationProviderEnv {
49
73
  };
50
74
  }
51
75
 
76
+ const BUILT_IN_LOCATION_PROVIDER_SETUPS: readonly LocationProviderSetupEntry[] = [
77
+ {
78
+ id: "reitti",
79
+ packageSpecifier: `${OPTIONAL_PACKAGE_SCOPE}connector-reitti`,
80
+ async setup(context) {
81
+ const env = context.env ?? readReittiEnv();
82
+ const baseUrl = env.baseUrl?.trim();
83
+ const token = env.token?.trim();
84
+ if (!baseUrl || !token) return false;
85
+ const mod = await context.loadPackage<ReittiProviderModule>();
86
+ const options: ReittiProviderRegistrationOptions = {
87
+ baseUrl,
88
+ token,
89
+ timezone: context.config.timezone,
90
+ };
91
+ if (env.authMode === "x-api-token" || env.authMode === "bearer") {
92
+ options.authMode = env.authMode;
93
+ }
94
+ return mod.ensureReittiProviderRegistered(options);
95
+ },
96
+ },
97
+ ];
98
+
99
+ const providerSetups = new Map<string, LocationProviderSetupEntry>();
100
+
101
+ function seedBuiltInProviderSetups(): void {
102
+ for (const entry of BUILT_IN_LOCATION_PROVIDER_SETUPS) {
103
+ providerSetups.set(entry.id, entry);
104
+ }
105
+ }
106
+
107
+ seedBuiltInProviderSetups();
108
+
109
+ function assertValidProviderSetup(entry: LocationProviderSetupEntry): void {
110
+ if (!entry || !(entry instanceof Object)) {
111
+ throw new TypeError("location provider setup must be an object");
112
+ }
113
+ if (!entry.id || entry.id.constructor !== String || !PROVIDER_ID_PATTERN.test(entry.id)) {
114
+ throw new RangeError(
115
+ "location provider setup id must be a non-empty lowercase kebab string (a-z, 0-9, hyphens)",
116
+ );
117
+ }
118
+ if (
119
+ !entry.packageSpecifier ||
120
+ entry.packageSpecifier.constructor !== String ||
121
+ entry.packageSpecifier.trim().length === 0
122
+ ) {
123
+ throw new TypeError(`location provider setup '${entry.id}' must declare a non-empty packageSpecifier`);
124
+ }
125
+ if (!(entry.setup instanceof Function)) {
126
+ throw new TypeError(`location provider setup '${entry.id}' must implement setup()`);
127
+ }
128
+ }
129
+
130
+ /** Register an optional location provider bootstrap entry for a source id. */
131
+ export function registerLocationProviderSetup(entry: LocationProviderSetupEntry): void {
132
+ assertValidProviderSetup(entry);
133
+ if (providerSetups.has(entry.id)) {
134
+ throw new Error(`location provider setup '${entry.id}' is already registered`);
135
+ }
136
+ providerSetups.set(entry.id, {
137
+ id: entry.id,
138
+ packageSpecifier: entry.packageSpecifier.trim(),
139
+ setup: entry.setup,
140
+ });
141
+ }
142
+
143
+ /** Remove a registered provider setup entry by id. Returns `true` if removed. */
144
+ export function unregisterLocationProviderSetup(id: string): boolean {
145
+ return Boolean(id && id.constructor === String && providerSetups.delete(id));
146
+ }
147
+
148
+ /** Look up a registered provider setup entry by source id. */
149
+ export function getLocationProviderSetup(id: string): LocationProviderSetupEntry | undefined {
150
+ return !id || id.constructor !== String ? undefined : providerSetups.get(id);
151
+ }
152
+
153
+ /** List registered provider setup source ids in sorted order. */
154
+ export function listLocationProviderSetups(): string[] {
155
+ return [...providerSetups.keys()].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
156
+ }
157
+
158
+ /** Test-only: reset provider setups to built-in defaults and clear warned specifiers. */
159
+ export function resetLocationProviderSetups(): void {
160
+ providerSetups.clear();
161
+ loadFailuresWarned.clear();
162
+ seedBuiltInProviderSetups();
163
+ }
164
+
52
165
  /**
53
166
  * Register every configured+enabled source's provider when its optional
54
167
  * package and credentials are available. Idempotent; returns the ids this
@@ -61,40 +174,33 @@ export async function ensureConfiguredLocationProviders(
61
174
  ): Promise<string[]> {
62
175
  const registered: string[] = [];
63
176
  if (!config.enabled) return registered;
177
+ const load = deps.importModule ?? ((s: string) => import(s));
178
+ const resolveSetup = deps.getSetup ?? getLocationProviderSetup;
64
179
  for (const source of config.sources) {
65
180
  if (!source.enabled) continue;
66
181
  if (getLocationProvider(source.id) !== undefined) continue;
67
- // ponytail: only the `reitti` built-in exists today; add cases here as
68
- // provider packages land — a registry table when there is more than one.
69
- if (source.id !== "reitti") continue;
70
- const env = deps.env ?? readReittiEnv();
71
- const baseUrl = env.baseUrl?.trim();
72
- const token = env.token?.trim();
73
- if (!baseUrl || !token) continue;
74
- const authMode =
75
- env.authMode === "x-api-token" || env.authMode === "bearer" ? env.authMode : undefined;
76
- const specifier = "@remnic/" + "connector-reitti";
77
- const load = deps.importModule ?? ((s: string) => import(s));
182
+ const entry = resolveSetup(source.id);
183
+ if (entry === undefined) continue;
184
+ const env = deps.envBySource?.get(source.id) ?? deps.env;
185
+ const loadPackage: LocationProviderPackageLoader = async <TModule>(): Promise<TModule> => {
186
+ // SAFETY: Dynamic ESM import returns an opaque module namespace; each
187
+ // registered setup entry declares its optional package's export contract.
188
+ return (await load(entry.packageSpecifier)) as TModule;
189
+ };
78
190
  try {
79
- const mod = (await load(specifier)) as ReittiProviderModule;
80
- if (
81
- mod.ensureReittiProviderRegistered({
82
- baseUrl,
83
- token,
84
- timezone: config.timezone,
85
- ...(authMode !== undefined ? { authMode } : {}),
86
- })
87
- ) {
88
- registered.push("reitti");
191
+ if (await entry.setup({ config, env, loadPackage })) {
192
+ registered.push(source.id);
89
193
  }
90
194
  } catch (err) {
91
195
  // Absent optional package is the common case (skip silently); a real
92
196
  // load failure is worth one warn line, never credentials.
93
197
  const message = err instanceof Error ? err.message : String(err);
94
- if (!message.includes(specifier)) {
95
- if (!loadFailuresWarned.has(specifier)) {
96
- loadFailuresWarned.add(specifier);
97
- log.warn(`location: failed to load optional provider package ${specifier}: ${message}`);
198
+ if (!message.includes(entry.packageSpecifier)) {
199
+ if (!loadFailuresWarned.has(entry.packageSpecifier)) {
200
+ loadFailuresWarned.add(entry.packageSpecifier);
201
+ log.warn(
202
+ `location: failed to load optional provider package ${entry.packageSpecifier}: ${message}`,
203
+ );
98
204
  }
99
205
  }
100
206
  }
@@ -322,17 +322,6 @@ export class ModelRegistry {
322
322
  };
323
323
  }
324
324
 
325
- /**
326
- * Fetch capabilities from Hugging Face (if available)
327
- * Returns true if successful
328
- */
329
- async fetchFromHuggingFace(modelId: string): Promise<boolean> {
330
- // This would be implemented to fetch from HF Hub API
331
- // For now, we rely on the known models and manual updates
332
- log.info(`ModelRegistry: fetchFromHuggingFace not yet implemented for ${modelId}`);
333
- return false;
334
- }
335
-
336
325
  /**
337
326
  * List all cached models
338
327
  */
@@ -207,7 +207,7 @@ export class SemanticConsolidationCoordinator {
207
207
  {
208
208
  role: "system" as const,
209
209
  content: operatorAwareEnabled
210
- ? 'You are a memory consolidation system. Return ONLY a JSON object with two keys, "operator" and "output". The "operator" value MUST be one of the exact strings "merge", "update", or "split" — never a pipe-separated placeholder, never prose. The "output" value is the canonical memory text.'
210
+ ? 'You are a memory consolidation system. Return ONLY a JSON object with an "operator" key and either "output" or, for split, "outputs". The "operator" value MUST be one of the exact strings "merge", "update", or "split" — never a pipe-separated placeholder, never prose. "output" is the canonical memory text; "outputs" is an array with one canonical memory text per separated fact.'
211
211
  : "You are a memory consolidation system. Output only the consolidated memory text.",
212
212
  },
213
213
  { role: "user" as const, content: prompt },
@@ -248,20 +248,20 @@ export class SemanticConsolidationCoordinator {
248
248
  // wider `ConsolidationOperator` type in #687 PR 2/4 but is
249
249
  // reserved for the maintenance job and must never be assignable
250
250
  // here (Cursor Bugbot review, PR #730).
251
- let canonicalContent: string;
251
+ let canonicalOutputs: string[];
252
252
  let operator: SemanticConsolidationLlmOperator;
253
253
  if (operatorAwareEnabled) {
254
254
  const parsed = parseOperatorAwareConsolidationResponse(
255
255
  response.content,
256
256
  cluster,
257
257
  );
258
- canonicalContent = parsed.output;
258
+ canonicalOutputs = parsed.outputs;
259
259
  operator = parsed.operator;
260
260
  } else {
261
- canonicalContent = parseConsolidationResponse(response.content);
261
+ canonicalOutputs = [parseConsolidationResponse(response.content)];
262
262
  operator = chooseConsolidationOperator(cluster);
263
263
  }
264
- cluster.canonicalContent = canonicalContent;
264
+ cluster.canonicalContent = canonicalOutputs.join("\n\n");
265
265
 
266
266
  // Pick the most recent memory's metadata as the basis for lineage
267
267
  const sorted = [...cluster.memories].sort(
@@ -294,36 +294,43 @@ export class SemanticConsolidationCoordinator {
294
294
  // Sealed-envelope write (issue #1989 PR4): canonical content is
295
295
  // LLM-merged and tags are unioned from stored rows — salvage so a
296
296
  // limit-violating union cannot abort consolidation (warn-logged).
297
- const canonicalEnvelope = composeMemoryEnvelope(
298
- {
299
- content: canonicalContent,
300
- category: newest.frontmatter.category,
301
- confidence: newest.frontmatter.confidence,
302
- tags: [
303
- ...new Set(
304
- cluster.memories.flatMap((m) => m.frontmatter.tags ?? []),
305
- ),
306
- ],
307
- },
308
- { source: "semantic-consolidation" },
309
- { salvage: true },
310
- );
311
- if (canonicalEnvelope.salvageNotes.length > 0) {
312
- log.warn(`semantic-consolidation write salvaged invalid fields: ${canonicalEnvelope.salvageNotes.join("; ")}`);
297
+ // SPLIT writes one canonical memory per output (#3566); every write shares the lineage.
298
+ const canonicalIds: string[] = [];
299
+ let canonicalBlocked = false;
300
+ for (const canonicalContent of canonicalOutputs) {
301
+ const canonicalEnvelope = composeMemoryEnvelope(
302
+ {
303
+ content: canonicalContent,
304
+ category: newest.frontmatter.category,
305
+ confidence: newest.frontmatter.confidence,
306
+ tags: [
307
+ ...new Set(
308
+ cluster.memories.flatMap((m) => m.frontmatter.tags ?? []),
309
+ ),
310
+ ],
311
+ },
312
+ { source: "semantic-consolidation" },
313
+ { salvage: true },
314
+ );
315
+ if (canonicalEnvelope.salvageNotes.length > 0) {
316
+ log.warn(`semantic-consolidation write salvaged invalid fields: ${canonicalEnvelope.salvageNotes.join("; ")}`);
317
+ }
318
+ const written = await targetStorage.writeSealedMemory(
319
+ canonicalEnvelope,
320
+ {
321
+ actor: "semantic-consolidation",
322
+ lineage: lineageIds,
323
+ derivedFrom: derivedFromEntries.length > 0 ? derivedFromEntries : undefined,
324
+ derivedVia: operator,
325
+ },
326
+ );
327
+ canonicalIds.push(written.id);
328
+ if (written.tombstoneBlocked) canonicalBlocked = true;
313
329
  }
314
- const { id: canonicalId, tombstoneBlocked: canonicalBlocked } = await targetStorage.writeSealedMemory(
315
- canonicalEnvelope,
316
- {
317
- actor: "semantic-consolidation",
318
- lineage: lineageIds,
319
- derivedFrom: derivedFromEntries.length > 0 ? derivedFromEntries : undefined,
320
- derivedVia: operator,
321
- },
322
- );
323
330
  if (canonicalBlocked) {
324
331
  // #1645: canonical matched a tombstone (pending_review). Don't archive
325
332
  // the sources — consolidation must never delete the only active copy.
326
- log.info(`[semantic-consolidation] cluster in "${cluster.category}" tombstone-blocked — keeping ${cluster.memories.length} source(s) active (pending_review ${canonicalId})`);
333
+ log.info(`[semantic-consolidation] cluster in "${cluster.category}" tombstone-blocked — keeping ${cluster.memories.length} source(s) active (pending_review ${canonicalIds.join(", ")})`);
327
334
  continue;
328
335
  }
329
336
  canonicalWriteCompleted = true;
@@ -340,7 +347,7 @@ export class SemanticConsolidationCoordinator {
340
347
  const archiveResult = await targetStorage.archiveMemory(m, {
341
348
  actor: "semantic-consolidation",
342
349
  reasonCode: "semantic-consolidation",
343
- relatedMemoryIds: [canonicalId],
350
+ relatedMemoryIds: canonicalIds,
344
351
  });
345
352
  if (archiveResult) {
346
353
  // Remove from the same storage-scoped content-hash index that
@@ -392,7 +399,7 @@ export class SemanticConsolidationCoordinator {
392
399
  }
393
400
 
394
401
  log.info(
395
- `[semantic-consolidation] consolidated ${cluster.memories.length} memories → ${canonicalId}`,
402
+ `[semantic-consolidation] consolidated ${cluster.memories.length} memories → ${canonicalIds.join(", ")}`,
396
403
  );
397
404
  } catch (err) {
398
405
  log.warn(