@remnic/core 10.0.51 → 10.0.53

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 (266) hide show
  1. package/dist/access-admin-ops-surface.js +24 -24
  2. package/dist/access-authorization-probe.js +25 -25
  3. package/dist/access-boundary.js +24 -24
  4. package/dist/access-cli.js +65 -65
  5. package/dist/access-extraction-force-flush.js +24 -24
  6. package/dist/access-http-briefing.js +25 -25
  7. package/dist/access-http-query.js +26 -26
  8. package/dist/access-http.js +40 -40
  9. package/dist/access-identity-continuity-surface.js +24 -24
  10. package/dist/access-lcm-surface.js +24 -24
  11. package/dist/access-mcp.js +33 -33
  12. package/dist/access-namespace-preflight.js +24 -24
  13. package/dist/access-observe-write-surface.js +24 -24
  14. package/dist/access-operations-batch.js +25 -25
  15. package/dist/access-operations.js +32 -32
  16. package/dist/access-recall-concurrency.js +24 -24
  17. package/dist/access-recall-response.js +24 -24
  18. package/dist/access-recall-surface.js +24 -24
  19. package/dist/access-service.js +24 -24
  20. package/dist/access-surface-catalog.js +26 -26
  21. package/dist/active-recall.js +9 -9
  22. package/dist/briefing.js +10 -10
  23. package/dist/buffer.js +5 -5
  24. package/dist/causal-consolidation.js +11 -11
  25. package/dist/{chunk-3NL4ALUP.js → chunk-24SIB3EW.js} +3 -3
  26. package/dist/{chunk-Y3T5KQCR.js → chunk-2EYCW2ET.js} +2 -2
  27. package/dist/{chunk-AHGOOZUC.js → chunk-34UVJNSG.js} +2 -2
  28. package/dist/{chunk-2EXF6IIB.js → chunk-3632XJMR.js} +2 -2
  29. package/dist/{chunk-KETS5A62.js → chunk-3H3PNQEF.js} +2 -2
  30. package/dist/{chunk-SFRBUBUZ.js → chunk-3LNAQLW4.js} +3 -3
  31. package/dist/{chunk-75BK4XGV.js → chunk-4BUJICMI.js} +10 -10
  32. package/dist/{chunk-KIWO4327.js → chunk-4W5B5Z6P.js} +2 -2
  33. package/dist/{chunk-B35EQQ7L.js → chunk-53OFDW3P.js} +3 -3
  34. package/dist/{chunk-2ONKXEC7.js → chunk-5LBBXI2A.js} +2 -2
  35. package/dist/{chunk-UCLJTGP3.js → chunk-65B5RFKQ.js} +2 -2
  36. package/dist/{chunk-KAJYSO3U.js → chunk-6CDNOREO.js} +2 -2
  37. package/dist/{chunk-POJRFSJM.js → chunk-7XGNGLAN.js} +2 -2
  38. package/dist/{chunk-A6JDT6QF.js → chunk-AO5ZOD32.js} +2 -2
  39. package/dist/{chunk-RA7YRL6H.js → chunk-AOSCGNIC.js} +3 -3
  40. package/dist/{chunk-LWMLBVGB.js → chunk-B43P3DTC.js} +2 -2
  41. package/dist/{chunk-SJD334AG.js → chunk-CA6X37OB.js} +217 -173
  42. package/dist/chunk-CA6X37OB.js.map +1 -0
  43. package/dist/{chunk-VUMWVYMR.js → chunk-CIMD2MUR.js} +3 -3
  44. package/dist/{chunk-XRFLR3XF.js → chunk-DLZGSZVC.js} +22 -9
  45. package/dist/chunk-DLZGSZVC.js.map +1 -0
  46. package/dist/{chunk-5CWH2LKL.js → chunk-DOJBV6WR.js} +29 -14
  47. package/dist/chunk-DOJBV6WR.js.map +1 -0
  48. package/dist/{chunk-44EUCSG4.js → chunk-FFQNNFHX.js} +2 -2
  49. package/dist/{chunk-HEF4BRMT.js → chunk-FZLZUDJJ.js} +2 -2
  50. package/dist/{chunk-L3EFYRYK.js → chunk-GGFQAGOT.js} +7 -7
  51. package/dist/{chunk-ZLCBLDJO.js → chunk-GIRWNTMV.js} +2 -2
  52. package/dist/{chunk-EC2KVA27.js → chunk-H4DWSOBQ.js} +169 -105
  53. package/dist/chunk-H4DWSOBQ.js.map +1 -0
  54. package/dist/{chunk-SHNM7RIT.js → chunk-HJ4X4BGS.js} +2 -2
  55. package/dist/{chunk-MUNYUSBU.js → chunk-HJQ4NKKO.js} +2 -2
  56. package/dist/{chunk-V6Z4NAJZ.js → chunk-HM3ZTDAX.js} +2 -2
  57. package/dist/{chunk-EZS6QJNC.js → chunk-IFOCK3OJ.js} +2 -2
  58. package/dist/{chunk-LXXIV7Y2.js → chunk-JEX2JL3U.js} +7 -2
  59. package/dist/{chunk-LXXIV7Y2.js.map → chunk-JEX2JL3U.js.map} +1 -1
  60. package/dist/{chunk-DF6ZF2BN.js → chunk-LIVNX7WK.js} +2 -2
  61. package/dist/{chunk-WY66J4PI.js → chunk-LRVFS4KA.js} +2 -2
  62. package/dist/{chunk-LMB47UM6.js → chunk-LTDK6HBV.js} +2 -2
  63. package/dist/{chunk-HCIRR3BA.js → chunk-M4U25HLR.js} +2 -2
  64. package/dist/{chunk-YK7ZJPQM.js → chunk-MGN2RQRG.js} +2 -2
  65. package/dist/{chunk-G26YNEOC.js → chunk-NWA6IXR3.js} +1 -1
  66. package/dist/{chunk-G26YNEOC.js.map → chunk-NWA6IXR3.js.map} +1 -1
  67. package/dist/{chunk-JIJAWTRK.js → chunk-OCXDZJL4.js} +264 -194
  68. package/dist/chunk-OCXDZJL4.js.map +1 -0
  69. package/dist/{chunk-IUQXRRJB.js → chunk-OMWQO7H6.js} +2 -2
  70. package/dist/{chunk-7VO6E5UD.js → chunk-OVZIYLBZ.js} +6 -2
  71. package/dist/chunk-OVZIYLBZ.js.map +1 -0
  72. package/dist/{chunk-SPTPBKZX.js → chunk-OWNAWY6D.js} +2 -2
  73. package/dist/{chunk-XKDQTDXN.js → chunk-PFUXPTBT.js} +36 -15
  74. package/dist/chunk-PFUXPTBT.js.map +1 -0
  75. package/dist/{chunk-DQOGZZJA.js → chunk-QAHP5SBG.js} +3 -3
  76. package/dist/{chunk-GBGU5OZP.js → chunk-QF5EJ5VP.js} +13 -13
  77. package/dist/{chunk-FT75AQ74.js → chunk-QS5DUSBM.js} +2 -2
  78. package/dist/{chunk-72CBJ5VP.js → chunk-R3WZ74B2.js} +3 -3
  79. package/dist/{chunk-PDTNQLPC.js → chunk-RG3I2663.js} +2 -2
  80. package/dist/{chunk-CK6GCGMX.js → chunk-RTJJPW3C.js} +2 -2
  81. package/dist/{chunk-RJDYDF5K.js → chunk-TRAOZ2WP.js} +2 -2
  82. package/dist/{chunk-6ZAU7LAR.js → chunk-TTTPTQ6S.js} +2 -2
  83. package/dist/{chunk-JS44PBCM.js → chunk-U2A56LLF.js} +6 -6
  84. package/dist/{chunk-MC7PXJDP.js → chunk-UBOWDOL5.js} +5 -5
  85. package/dist/{chunk-4FM35YIA.js → chunk-UQYBPPVC.js} +2 -2
  86. package/dist/{chunk-OCRLJJOV.js → chunk-V4VCBFAL.js} +3 -3
  87. package/dist/{chunk-FNNGWN3O.js → chunk-VGE4PUY6.js} +2 -2
  88. package/dist/{chunk-5DVOBBTV.js → chunk-VV73XT3A.js} +2 -2
  89. package/dist/{chunk-GE3ZX6YK.js → chunk-W7NKMRAF.js} +2 -2
  90. package/dist/{chunk-AJJPXUE6.js → chunk-WBN66HPI.js} +2 -2
  91. package/dist/{chunk-XWJUFER3.js → chunk-WGFEGBFB.js} +2 -2
  92. package/dist/{chunk-43TUWQNR.js → chunk-XDKEHZUC.js} +2 -2
  93. package/dist/{chunk-ROAKLYOL.js → chunk-XHEKS4UN.js} +2 -2
  94. package/dist/{chunk-ZKK3VMWU.js → chunk-XVTB6BZS.js} +2 -2
  95. package/dist/{chunk-AZLD4CKG.js → chunk-Y56D5FSD.js} +17 -17
  96. package/dist/{chunk-MPWOAIIH.js → chunk-YDT3OEYF.js} +2 -2
  97. package/dist/{chunk-IN6U2BS5.js → chunk-YJHOVA42.js} +2 -2
  98. package/dist/{chunk-TC55M5PO.js → chunk-YLN4ZQV4.js} +2 -2
  99. package/dist/cli.js +50 -50
  100. package/dist/coding/export-okf-codegraph.js +9 -9
  101. package/dist/compounding/engine.js +11 -11
  102. package/dist/config.js +9 -9
  103. package/dist/connectors/codex-materialize-runner.js +10 -10
  104. package/dist/connectors/index.js +10 -10
  105. package/dist/convergence-refresh.js +12 -12
  106. package/dist/corpus-watermark.js +12 -12
  107. package/dist/entity-retrieval.js +10 -10
  108. package/dist/external-wiki-access.js +25 -25
  109. package/dist/extraction.js +14 -14
  110. package/dist/harmonic-retrieval.js +10 -10
  111. package/dist/index.js +65 -65
  112. package/dist/location/index.js +12 -12
  113. package/dist/maintenance/memory-governance.js +10 -10
  114. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
  115. package/dist/maintenance/rebuild-memory-projection-runner.js +12 -12
  116. package/dist/maintenance/rebuild-memory-projection.js +11 -11
  117. package/dist/memory-browse-operations.js +25 -25
  118. package/dist/memory-browse.js +5 -5
  119. package/dist/namespaces/migrate.js +11 -11
  120. package/dist/namespaces/search.d.ts.map +1 -1
  121. package/dist/namespaces/search.js +8 -8
  122. package/dist/namespaces/storage.js +10 -10
  123. package/dist/operator-doctor-corpus.js +13 -13
  124. package/dist/operator-toolkit.js +18 -18
  125. package/dist/orchestration/extraction-persist-deps.d.ts +2 -0
  126. package/dist/orchestration/extraction-persist-deps.d.ts.map +1 -1
  127. package/dist/orchestration/extraction-persist-promotion.d.ts +40 -10
  128. package/dist/orchestration/extraction-persist-promotion.d.ts.map +1 -1
  129. package/dist/orchestration/extraction-persist.d.ts.map +1 -1
  130. package/dist/orchestration/lifecycle-pending-fallback-drain.d.ts +18 -0
  131. package/dist/orchestration/lifecycle-pending-fallback-drain.d.ts.map +1 -0
  132. package/dist/orchestration/maintenance.d.ts +11 -13
  133. package/dist/orchestration/maintenance.d.ts.map +1 -1
  134. package/dist/orchestration/maintenance.js +20 -20
  135. package/dist/orchestration/qmd-maintenance-completion.d.ts +20 -0
  136. package/dist/orchestration/qmd-maintenance-completion.d.ts.map +1 -0
  137. package/dist/orchestrator.d.ts.map +1 -1
  138. package/dist/orchestrator.js +65 -65
  139. package/dist/qmd.js +2 -2
  140. package/dist/recall-composition-decision.js +2 -2
  141. package/dist/recall-navigation-operations.js +25 -25
  142. package/dist/recall-navigation.js +24 -24
  143. package/dist/recall-state-view-admission.js +5 -5
  144. package/dist/recall-why-service.js +5 -5
  145. package/dist/resume-bundles.js +9 -9
  146. package/dist/search/factory.js +7 -7
  147. package/dist/search/index.js +7 -7
  148. package/dist/search/lancedb-backend.d.ts +3 -0
  149. package/dist/search/lancedb-backend.d.ts.map +1 -1
  150. package/dist/search/lancedb-backend.js +2 -2
  151. package/dist/search/meilisearch-backend.d.ts +3 -0
  152. package/dist/search/meilisearch-backend.d.ts.map +1 -1
  153. package/dist/search/meilisearch-backend.js +2 -2
  154. package/dist/search/orama-backend.d.ts +3 -0
  155. package/dist/search/orama-backend.d.ts.map +1 -1
  156. package/dist/search/orama-backend.js +2 -2
  157. package/dist/search/port.d.ts +7 -0
  158. package/dist/search/port.d.ts.map +1 -1
  159. package/dist/search/port.js +1 -1
  160. package/dist/search/remote-backend.d.ts +2 -0
  161. package/dist/search/remote-backend.d.ts.map +1 -1
  162. package/dist/search/remote-backend.js +2 -2
  163. package/dist/semantic-consolidation.js +11 -11
  164. package/dist/semantic-rule-promotion.js +10 -10
  165. package/dist/semantic-rule-verifier.js +10 -10
  166. package/dist/source-agent-qualifier.js +13 -13
  167. package/dist/standup/build.js +10 -10
  168. package/dist/storage/entity-canonical-id-migration-adapter.d.ts +7 -1
  169. package/dist/storage/entity-canonical-id-migration-adapter.d.ts.map +1 -1
  170. package/dist/storage/entity-migration-maintenance-pending.d.ts +31 -0
  171. package/dist/storage/entity-migration-maintenance-pending.d.ts.map +1 -0
  172. package/dist/storage.d.ts +2 -2
  173. package/dist/storage.d.ts.map +1 -1
  174. package/dist/storage.js +9 -9
  175. package/dist/support-passport/index.js +27 -27
  176. package/dist/transfer/export-okf.js +10 -10
  177. package/dist/verified-recall.js +10 -10
  178. package/dist/who-knows-cli.js +11 -11
  179. package/dist/who-knows.js +10 -10
  180. package/package.json +2 -2
  181. package/src/namespaces/search.test.ts +121 -0
  182. package/src/namespaces/search.ts +8 -0
  183. package/src/orchestration/extraction-persist-deps.ts +3 -0
  184. package/src/orchestration/extraction-persist-promotion.ts +104 -16
  185. package/src/orchestration/extraction-persist.ts +66 -77
  186. package/src/orchestration/lifecycle-pending-fallback-drain.ts +97 -0
  187. package/src/orchestration/maintenance.test.ts +443 -1
  188. package/src/orchestration/maintenance.ts +73 -95
  189. package/src/orchestration/qmd-maintenance-completion.ts +32 -0
  190. package/src/orchestrator-entity-write-failure.test.ts +370 -0
  191. package/src/orchestrator.ts +9 -1
  192. package/src/search/lancedb-backend.ts +29 -12
  193. package/src/search/meilisearch-backend.test.ts +148 -0
  194. package/src/search/meilisearch-backend.ts +41 -14
  195. package/src/search/orama-backend.test.ts +75 -1
  196. package/src/search/orama-backend.ts +22 -7
  197. package/src/search/port.ts +7 -0
  198. package/src/search/remote-backend.ts +4 -0
  199. package/src/storage/entity-canonical-id-migration-adapter.ts +44 -9
  200. package/src/storage/entity-migration-maintenance-pending-helpers.test.ts +87 -0
  201. package/src/storage/entity-migration-maintenance-pending.test.ts +242 -0
  202. package/src/storage/entity-migration-maintenance-pending.ts +89 -0
  203. package/src/storage.ts +2 -2
  204. package/dist/chunk-5CWH2LKL.js.map +0 -1
  205. package/dist/chunk-7VO6E5UD.js.map +0 -1
  206. package/dist/chunk-EC2KVA27.js.map +0 -1
  207. package/dist/chunk-JIJAWTRK.js.map +0 -1
  208. package/dist/chunk-SJD334AG.js.map +0 -1
  209. package/dist/chunk-XKDQTDXN.js.map +0 -1
  210. package/dist/chunk-XRFLR3XF.js.map +0 -1
  211. /package/dist/{chunk-3NL4ALUP.js.map → chunk-24SIB3EW.js.map} +0 -0
  212. /package/dist/{chunk-Y3T5KQCR.js.map → chunk-2EYCW2ET.js.map} +0 -0
  213. /package/dist/{chunk-AHGOOZUC.js.map → chunk-34UVJNSG.js.map} +0 -0
  214. /package/dist/{chunk-2EXF6IIB.js.map → chunk-3632XJMR.js.map} +0 -0
  215. /package/dist/{chunk-KETS5A62.js.map → chunk-3H3PNQEF.js.map} +0 -0
  216. /package/dist/{chunk-SFRBUBUZ.js.map → chunk-3LNAQLW4.js.map} +0 -0
  217. /package/dist/{chunk-75BK4XGV.js.map → chunk-4BUJICMI.js.map} +0 -0
  218. /package/dist/{chunk-KIWO4327.js.map → chunk-4W5B5Z6P.js.map} +0 -0
  219. /package/dist/{chunk-B35EQQ7L.js.map → chunk-53OFDW3P.js.map} +0 -0
  220. /package/dist/{chunk-2ONKXEC7.js.map → chunk-5LBBXI2A.js.map} +0 -0
  221. /package/dist/{chunk-UCLJTGP3.js.map → chunk-65B5RFKQ.js.map} +0 -0
  222. /package/dist/{chunk-KAJYSO3U.js.map → chunk-6CDNOREO.js.map} +0 -0
  223. /package/dist/{chunk-POJRFSJM.js.map → chunk-7XGNGLAN.js.map} +0 -0
  224. /package/dist/{chunk-A6JDT6QF.js.map → chunk-AO5ZOD32.js.map} +0 -0
  225. /package/dist/{chunk-RA7YRL6H.js.map → chunk-AOSCGNIC.js.map} +0 -0
  226. /package/dist/{chunk-LWMLBVGB.js.map → chunk-B43P3DTC.js.map} +0 -0
  227. /package/dist/{chunk-VUMWVYMR.js.map → chunk-CIMD2MUR.js.map} +0 -0
  228. /package/dist/{chunk-44EUCSG4.js.map → chunk-FFQNNFHX.js.map} +0 -0
  229. /package/dist/{chunk-HEF4BRMT.js.map → chunk-FZLZUDJJ.js.map} +0 -0
  230. /package/dist/{chunk-L3EFYRYK.js.map → chunk-GGFQAGOT.js.map} +0 -0
  231. /package/dist/{chunk-ZLCBLDJO.js.map → chunk-GIRWNTMV.js.map} +0 -0
  232. /package/dist/{chunk-SHNM7RIT.js.map → chunk-HJ4X4BGS.js.map} +0 -0
  233. /package/dist/{chunk-MUNYUSBU.js.map → chunk-HJQ4NKKO.js.map} +0 -0
  234. /package/dist/{chunk-V6Z4NAJZ.js.map → chunk-HM3ZTDAX.js.map} +0 -0
  235. /package/dist/{chunk-EZS6QJNC.js.map → chunk-IFOCK3OJ.js.map} +0 -0
  236. /package/dist/{chunk-DF6ZF2BN.js.map → chunk-LIVNX7WK.js.map} +0 -0
  237. /package/dist/{chunk-WY66J4PI.js.map → chunk-LRVFS4KA.js.map} +0 -0
  238. /package/dist/{chunk-LMB47UM6.js.map → chunk-LTDK6HBV.js.map} +0 -0
  239. /package/dist/{chunk-HCIRR3BA.js.map → chunk-M4U25HLR.js.map} +0 -0
  240. /package/dist/{chunk-YK7ZJPQM.js.map → chunk-MGN2RQRG.js.map} +0 -0
  241. /package/dist/{chunk-IUQXRRJB.js.map → chunk-OMWQO7H6.js.map} +0 -0
  242. /package/dist/{chunk-SPTPBKZX.js.map → chunk-OWNAWY6D.js.map} +0 -0
  243. /package/dist/{chunk-DQOGZZJA.js.map → chunk-QAHP5SBG.js.map} +0 -0
  244. /package/dist/{chunk-GBGU5OZP.js.map → chunk-QF5EJ5VP.js.map} +0 -0
  245. /package/dist/{chunk-FT75AQ74.js.map → chunk-QS5DUSBM.js.map} +0 -0
  246. /package/dist/{chunk-72CBJ5VP.js.map → chunk-R3WZ74B2.js.map} +0 -0
  247. /package/dist/{chunk-PDTNQLPC.js.map → chunk-RG3I2663.js.map} +0 -0
  248. /package/dist/{chunk-CK6GCGMX.js.map → chunk-RTJJPW3C.js.map} +0 -0
  249. /package/dist/{chunk-RJDYDF5K.js.map → chunk-TRAOZ2WP.js.map} +0 -0
  250. /package/dist/{chunk-6ZAU7LAR.js.map → chunk-TTTPTQ6S.js.map} +0 -0
  251. /package/dist/{chunk-JS44PBCM.js.map → chunk-U2A56LLF.js.map} +0 -0
  252. /package/dist/{chunk-MC7PXJDP.js.map → chunk-UBOWDOL5.js.map} +0 -0
  253. /package/dist/{chunk-4FM35YIA.js.map → chunk-UQYBPPVC.js.map} +0 -0
  254. /package/dist/{chunk-OCRLJJOV.js.map → chunk-V4VCBFAL.js.map} +0 -0
  255. /package/dist/{chunk-FNNGWN3O.js.map → chunk-VGE4PUY6.js.map} +0 -0
  256. /package/dist/{chunk-5DVOBBTV.js.map → chunk-VV73XT3A.js.map} +0 -0
  257. /package/dist/{chunk-GE3ZX6YK.js.map → chunk-W7NKMRAF.js.map} +0 -0
  258. /package/dist/{chunk-AJJPXUE6.js.map → chunk-WBN66HPI.js.map} +0 -0
  259. /package/dist/{chunk-XWJUFER3.js.map → chunk-WGFEGBFB.js.map} +0 -0
  260. /package/dist/{chunk-43TUWQNR.js.map → chunk-XDKEHZUC.js.map} +0 -0
  261. /package/dist/{chunk-ROAKLYOL.js.map → chunk-XHEKS4UN.js.map} +0 -0
  262. /package/dist/{chunk-ZKK3VMWU.js.map → chunk-XVTB6BZS.js.map} +0 -0
  263. /package/dist/{chunk-AZLD4CKG.js.map → chunk-Y56D5FSD.js.map} +0 -0
  264. /package/dist/{chunk-MPWOAIIH.js.map → chunk-YDT3OEYF.js.map} +0 -0
  265. /package/dist/{chunk-IN6U2BS5.js.map → chunk-YJHOVA42.js.map} +0 -0
  266. /package/dist/{chunk-TC55M5PO.js.map → chunk-YLN4ZQV4.js.map} +0 -0
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  ActivityStore,
15
15
  MaintenanceScheduler
16
- } from "./chunk-EC2KVA27.js";
16
+ } from "./chunk-H4DWSOBQ.js";
17
17
  import {
18
18
  runPeerProfileReasoner
19
19
  } from "./chunk-I74SUMNI.js";
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  CompoundingEngine,
34
34
  defaultTierMigrationCycleBudget
35
- } from "./chunk-B35EQQ7L.js";
35
+ } from "./chunk-53OFDW3P.js";
36
36
  import {
37
37
  SharedContextManager
38
38
  } from "./chunk-5KBIOI4G.js";
@@ -121,7 +121,7 @@ import {
121
121
  import {
122
122
  indexStateViewAnnotatedResults,
123
123
  resolveRecallStateViewActive
124
- } from "./chunk-PDTNQLPC.js";
124
+ } from "./chunk-RG3I2663.js";
125
125
  import {
126
126
  applyRecallStateViews
127
127
  } from "./chunk-DBB5JPSL.js";
@@ -136,7 +136,7 @@ import {
136
136
  decideRecallContextComposition,
137
137
  notifyContextComposition,
138
138
  recallFailureComposition
139
- } from "./chunk-YK7ZJPQM.js";
139
+ } from "./chunk-MGN2RQRG.js";
140
140
  import {
141
141
  installPrioritizedEmbedding
142
142
  } from "./chunk-ROI7BK7H.js";
@@ -169,7 +169,7 @@ import {
169
169
  } from "./chunk-XXSOVESA.js";
170
170
  import {
171
171
  ExtractionEngine
172
- } from "./chunk-CK6GCGMX.js";
172
+ } from "./chunk-RTJJPW3C.js";
173
173
  import {
174
174
  buildFocusedListRecallSection,
175
175
  shouldRecallFocusedListEvidence
@@ -213,7 +213,7 @@ import {
213
213
  buildEntityRecallSection,
214
214
  entityRecentTranscriptLookbackHours,
215
215
  readRecentEntityTranscriptEntries
216
- } from "./chunk-FNNGWN3O.js";
216
+ } from "./chunk-VGE4PUY6.js";
217
217
  import {
218
218
  EmbeddingFallback
219
219
  } from "./chunk-GFAEKSFR.js";
@@ -225,7 +225,7 @@ import {
225
225
  } from "./chunk-7G5NTS7F.js";
226
226
  import {
227
227
  refreshConvergedNamespaces
228
- } from "./chunk-44EUCSG4.js";
228
+ } from "./chunk-FFQNNFHX.js";
229
229
  import {
230
230
  builtInConnectorPackageSpecifier,
231
231
  ensureBuiltInWearableConnectors,
@@ -234,7 +234,7 @@ import {
234
234
  runTimelinePublishCli,
235
235
  screenCandidateFact,
236
236
  summarizeVaultPublish
237
- } from "./chunk-AZLD4CKG.js";
237
+ } from "./chunk-Y56D5FSD.js";
238
238
  import {
239
239
  RoutingRulesStore
240
240
  } from "./chunk-TBUEE7XF.js";
@@ -244,14 +244,14 @@ import {
244
244
  import {
245
245
  compareVerifiedEpisodeResults,
246
246
  searchVerifiedEpisodes
247
- } from "./chunk-ROAKLYOL.js";
247
+ } from "./chunk-XHEKS4UN.js";
248
248
  import {
249
249
  ThreadingManager
250
250
  } from "./chunk-R7WYAXPO.js";
251
251
  import {
252
252
  compareVerifiedSemanticRuleResults,
253
253
  searchVerifiedSemanticRules
254
- } from "./chunk-SPTPBKZX.js";
254
+ } from "./chunk-OWNAWY6D.js";
255
255
  import {
256
256
  searchWorkProductLedgerEntries
257
257
  } from "./chunk-B2NXOVZN.js";
@@ -264,10 +264,10 @@ import {
264
264
  import {
265
265
  runNamespaceMaintenanceFanout,
266
266
  summarizeNamespaceMaintenanceHealth
267
- } from "./chunk-L3EFYRYK.js";
267
+ } from "./chunk-GGFQAGOT.js";
268
268
  import {
269
269
  planNamespaceMaintenance
270
- } from "./chunk-72CBJ5VP.js";
270
+ } from "./chunk-R3WZ74B2.js";
271
271
  import {
272
272
  isAboveImportanceThreshold,
273
273
  scoreImportance
@@ -296,10 +296,10 @@ import {
296
296
  materializeAfterSemanticConsolidation,
297
297
  parseConsolidationResponse,
298
298
  parseOperatorAwareConsolidationResponse
299
- } from "./chunk-LMB47UM6.js";
299
+ } from "./chunk-LTDK6HBV.js";
300
300
  import {
301
301
  SmartBuffer
302
- } from "./chunk-IN6U2BS5.js";
302
+ } from "./chunk-YJHOVA42.js";
303
303
  import {
304
304
  semanticChunkContent
305
305
  } from "./chunk-2GBFKHBZ.js";
@@ -373,7 +373,7 @@ import {
373
373
  } from "./chunk-QW27DOHG.js";
374
374
  import {
375
375
  MeetingsInputError
376
- } from "./chunk-75BK4XGV.js";
376
+ } from "./chunk-4BUJICMI.js";
377
377
  import {
378
378
  WearablesInputError,
379
379
  describeErrorForOperator
@@ -391,7 +391,7 @@ import {
391
391
  } from "./chunk-AAANTXCQ.js";
392
392
  import {
393
393
  NamespaceCatalog
394
- } from "./chunk-ZKK3VMWU.js";
394
+ } from "./chunk-XVTB6BZS.js";
395
395
  import {
396
396
  RecallResultFormatter,
397
397
  SessionContextCoordinator,
@@ -400,7 +400,7 @@ import {
400
400
  detectPassiveCorrections,
401
401
  renderSessionExperiencePreview,
402
402
  scoreSessionExperienceForPrompt
403
- } from "./chunk-GBGU5OZP.js";
403
+ } from "./chunk-QF5EJ5VP.js";
404
404
  import {
405
405
  importCapsule
406
406
  } from "./chunk-A3UFV4K3.js";
@@ -440,10 +440,10 @@ import {
440
440
  isTopLevelArchivePath,
441
441
  journalPath,
442
442
  writeJournalFile
443
- } from "./chunk-5DVOBBTV.js";
443
+ } from "./chunk-VV73XT3A.js";
444
444
  import {
445
445
  searchHarmonicRetrieval
446
- } from "./chunk-WY66J4PI.js";
446
+ } from "./chunk-LRVFS4KA.js";
447
447
  import {
448
448
  ProfilingCollector
449
449
  } from "./chunk-DOWACHYO.js";
@@ -469,7 +469,7 @@ import {
469
469
  } from "./chunk-LXATZLSC.js";
470
470
  import {
471
471
  NamespaceStorageRouter
472
- } from "./chunk-AHGOOZUC.js";
472
+ } from "./chunk-34UVJNSG.js";
473
473
  import {
474
474
  GraphIndex
475
475
  } from "./chunk-KRAMCBIW.js";
@@ -480,7 +480,7 @@ import {
480
480
  ExtractionDeadlineError,
481
481
  ExtractionRunCoordinator,
482
482
  classifyExtractionOrigin
483
- } from "./chunk-43TUWQNR.js";
483
+ } from "./chunk-XDKEHZUC.js";
484
484
  import {
485
485
  ARTIFACT_STATUS_CACHE_TTL_MS,
486
486
  BulkImportBatchPartialFailureError,
@@ -520,7 +520,7 @@ import {
520
520
  throwIfRecallAborted,
521
521
  tokenizeRecallQuery,
522
522
  utcDateKeysForLocalDay
523
- } from "./chunk-MPWOAIIH.js";
523
+ } from "./chunk-YDT3OEYF.js";
524
524
  import {
525
525
  inferIntentFromText,
526
526
  intentCompatibilityScore,
@@ -537,7 +537,7 @@ import {
537
537
  } from "./chunk-74AY3S7U.js";
538
538
  import {
539
539
  buildChainFollowupGenerator
540
- } from "./chunk-A6JDT6QF.js";
540
+ } from "./chunk-AO5ZOD32.js";
541
541
  import {
542
542
  decideLifecycleTransition,
543
543
  resolveLifecycleState
@@ -582,7 +582,7 @@ import {
582
582
  reconstructFusionInputs,
583
583
  selfDeps,
584
584
  serializeFusionDay
585
- } from "./chunk-JIJAWTRK.js";
585
+ } from "./chunk-OCXDZJL4.js";
586
586
  import {
587
587
  bodyIsEscaped,
588
588
  decodeTranscriptBody,
@@ -599,12 +599,12 @@ import {
599
599
  import {
600
600
  NamespaceSearchRouter,
601
601
  namespaceCollectionName
602
- } from "./chunk-LXXIV7Y2.js";
602
+ } from "./chunk-JEX2JL3U.js";
603
603
  import {
604
604
  createConversationIndexRuntime,
605
605
  createSearchBackend,
606
606
  isSearchBackendEnabled
607
- } from "./chunk-JS44PBCM.js";
607
+ } from "./chunk-U2A56LLF.js";
608
608
  import {
609
609
  NoopSearchBackend
610
610
  } from "./chunk-CYEPCZN5.js";
@@ -5199,6 +5199,91 @@ async function readPromotionReceiptStatus(storage, filePath) {
5199
5199
  }
5200
5200
  }
5201
5201
 
5202
+ // src/orchestration/harmonic-construction-persist.ts
5203
+ function filterHarmonicEntityMentions(facts, entityMentions) {
5204
+ const identitiesBySegment = /* @__PURE__ */ new Map();
5205
+ for (const entity of entityMentions) {
5206
+ const segment = harmonicEntitySegment(entity.name);
5207
+ const identities = identitiesBySegment.get(segment) ?? /* @__PURE__ */ new Set();
5208
+ identities.add(normalizedHarmonicEntityIdentity(entity.name));
5209
+ identitiesBySegment.set(segment, identities);
5210
+ }
5211
+ return entityMentions.flatMap((entity) => {
5212
+ const allowSegmentFallback = identitiesBySegment.get(harmonicEntitySegment(entity.name))?.size === 1;
5213
+ const activeFacts = facts.filter(
5214
+ (fact) => typeof fact.entityRef === "string" && harmonicEntityReferenceMatches(fact.entityRef, entity.name, allowSegmentFallback)
5215
+ );
5216
+ return activeFacts.length > 0 ? [{ ...entity, facts: activeFacts.map((fact) => fact.content) }] : [];
5217
+ });
5218
+ }
5219
+ async function enqueueMergedTargetForHarmonicConstruction(entries, storage, fact, memoryId, content, insertedAt) {
5220
+ let committed = null;
5221
+ try {
5222
+ committed = await storage.getMemoryByIdIncludingArchived(memoryId);
5223
+ } catch {
5224
+ committed = null;
5225
+ }
5226
+ const derived = committed && committed.content === content ? {
5227
+ ...fact,
5228
+ category: committed.frontmatter.category,
5229
+ tags: [.../* @__PURE__ */ new Set([...committed.frontmatter.tags ?? [], ...fact.tags])],
5230
+ entityRef: committed.frontmatter.entityRef ?? fact.entityRef,
5231
+ validAt: committed.frontmatter.valid_at ?? fact.validAt
5232
+ } : fact;
5233
+ const entry = entries.get(storage.dir) ?? { storage, facts: [] };
5234
+ const prior = entry.facts.findIndex((existing) => existing.memoryId === memoryId);
5235
+ if (prior !== -1) {
5236
+ entry.facts[prior] = {
5237
+ ...derived,
5238
+ content,
5239
+ memoryId,
5240
+ insertedAt,
5241
+ cueAnchors: [
5242
+ ...entry.facts[prior].cueAnchors ?? [],
5243
+ ...derived.cueAnchors ?? []
5244
+ ]
5245
+ };
5246
+ } else {
5247
+ entry.facts.push({ ...derived, content, memoryId, insertedAt });
5248
+ }
5249
+ entries.set(storage.dir, entry);
5250
+ }
5251
+ async function persistConstructedHarmonicRecords(options) {
5252
+ const sessionKey = options.sessionKey?.trim();
5253
+ if (!sessionKey) {
5254
+ log.warn("harmonic construction skipped: extraction session key is missing");
5255
+ return;
5256
+ }
5257
+ const recordedAt = options.validAt && Number.isFinite(Date.parse(options.validAt)) ? new Date(options.validAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString();
5258
+ const entries = [...options.entries];
5259
+ const sharedEpisodeTitle = entries.length === 1 ? options.episodeTitle : void 0;
5260
+ for (const entry of entries) {
5261
+ try {
5262
+ const records = deriveHarmonicRecords({
5263
+ sessionKey,
5264
+ recordedAt,
5265
+ episodeTitle: sharedEpisodeTitle,
5266
+ persistedFacts: entry.facts,
5267
+ entityMentions: filterHarmonicEntityMentions(entry.facts, options.entityMentions).map((entity) => ({
5268
+ name: entity.name,
5269
+ type: entity.type,
5270
+ facts: entity.facts
5271
+ }))
5272
+ });
5273
+ await persistHarmonicRecords({
5274
+ memoryDir: entry.storage.dir,
5275
+ abstractionNodeStoreDir: entry.storage.dir === options.baseStorageDir ? options.abstractionNodeStoreDir : void 0,
5276
+ nodes: records.nodes,
5277
+ anchors: options.anchorsEnabled ? records.anchors : []
5278
+ });
5279
+ } catch (error) {
5280
+ log.warn(
5281
+ `harmonic construction failed open for namespace ${entry.storage.dir}: ${error instanceof Error ? error.message : String(error)}`
5282
+ );
5283
+ }
5284
+ }
5285
+ }
5286
+
5202
5287
  // src/orchestration/extraction-persist-promotion.ts
5203
5288
  var confidenceTierOrder = [
5204
5289
  "explicit",
@@ -5246,11 +5331,57 @@ async function readActiveMemoriesBothTiers(storage) {
5246
5331
  ]);
5247
5332
  return coldMems.length === 0 ? hotMems : [...hotMems, ...coldMems];
5248
5333
  }
5249
- async function flushDeferredFactHashOnFailure(saveContentHashIndexes, deferred) {
5250
- if (!deferred) return;
5251
- await saveContentHashIndexes().catch(
5252
- (err) => log.warn(`content-hash flush after post-write failure failed: ${err}`)
5334
+ async function finalizeExtractionCommittedWrites(options) {
5335
+ await options.saveContentHashIndexes().catch((err) => {
5336
+ log.warn(`content-hash index save failed: ${err}`);
5337
+ });
5338
+ const behaviorEntries = [...options.behaviorSignalsByStorage];
5339
+ for (const { storage: targetStorage, events } of behaviorEntries) {
5340
+ const dedupedSignals = dedupeBehaviorSignalsByMemoryAndHash(events);
5341
+ if (dedupedSignals.length === 0) continue;
5342
+ await targetStorage.appendBehaviorSignals(dedupedSignals).catch(
5343
+ (err) => log.warn(`appendBehaviorSignals failed (non-fatal): ${err}`)
5344
+ );
5345
+ }
5346
+ const harmonic = options.harmonic;
5347
+ let harmonicEntryCount = 0;
5348
+ if (harmonic?.enabled) {
5349
+ const entries = [...harmonic.entries];
5350
+ harmonicEntryCount = entries.length;
5351
+ if (entries.length > 0) {
5352
+ await persistConstructedHarmonicRecords({
5353
+ entries,
5354
+ baseStorageDir: harmonic.baseStorageDir,
5355
+ abstractionNodeStoreDir: harmonic.abstractionNodeStoreDir,
5356
+ sessionKey: harmonic.sessionKey,
5357
+ validAt: harmonic.validAt,
5358
+ episodeTitle: harmonic.episodeTitle,
5359
+ anchorsEnabled: harmonic.anchorsEnabled,
5360
+ entityMentions: harmonic.entityMentions
5361
+ });
5362
+ }
5363
+ }
5364
+ void (async () => {
5365
+ if (options.persistedIdsByStorage.size === 0) {
5366
+ await options.updateTemporalTagIndexes(options.fallbackStorage, []);
5367
+ return;
5368
+ }
5369
+ for (const entry of options.persistedIdsByStorage.values()) {
5370
+ await options.updateTemporalTagIndexes(entry.storage, entry.ids);
5371
+ }
5372
+ })().catch(
5373
+ (err) => log.debug(`temporal-index update error (non-fatal): ${err}`)
5253
5374
  );
5375
+ if (!options.scheduleQmd || !options.requestQmdMaintenance) return;
5376
+ const hasCommitted = options.persistedIdsByStorage.size > 0 || behaviorEntries.length > 0 || harmonicEntryCount > 0;
5377
+ if (!hasCommitted) return;
5378
+ try {
5379
+ options.requestQmdMaintenance();
5380
+ } catch (err) {
5381
+ log.warn(
5382
+ `QMD maintenance schedule after partial persist failed (non-fatal): ${err}`
5383
+ );
5384
+ }
5254
5385
  }
5255
5386
  function promotionWithholdsToolScope(options) {
5256
5387
  return options.toolScoped === true || withholdToolScopedFromSharedNamespace(options);
@@ -5427,91 +5558,6 @@ async function retireStaleMergedTargetPromotionCopies(args) {
5427
5558
  return retired;
5428
5559
  }
5429
5560
 
5430
- // src/orchestration/harmonic-construction-persist.ts
5431
- function filterHarmonicEntityMentions(facts, entityMentions) {
5432
- const identitiesBySegment = /* @__PURE__ */ new Map();
5433
- for (const entity of entityMentions) {
5434
- const segment = harmonicEntitySegment(entity.name);
5435
- const identities = identitiesBySegment.get(segment) ?? /* @__PURE__ */ new Set();
5436
- identities.add(normalizedHarmonicEntityIdentity(entity.name));
5437
- identitiesBySegment.set(segment, identities);
5438
- }
5439
- return entityMentions.flatMap((entity) => {
5440
- const allowSegmentFallback = identitiesBySegment.get(harmonicEntitySegment(entity.name))?.size === 1;
5441
- const activeFacts = facts.filter(
5442
- (fact) => typeof fact.entityRef === "string" && harmonicEntityReferenceMatches(fact.entityRef, entity.name, allowSegmentFallback)
5443
- );
5444
- return activeFacts.length > 0 ? [{ ...entity, facts: activeFacts.map((fact) => fact.content) }] : [];
5445
- });
5446
- }
5447
- async function enqueueMergedTargetForHarmonicConstruction(entries, storage, fact, memoryId, content, insertedAt) {
5448
- let committed = null;
5449
- try {
5450
- committed = await storage.getMemoryByIdIncludingArchived(memoryId);
5451
- } catch {
5452
- committed = null;
5453
- }
5454
- const derived = committed && committed.content === content ? {
5455
- ...fact,
5456
- category: committed.frontmatter.category,
5457
- tags: [.../* @__PURE__ */ new Set([...committed.frontmatter.tags ?? [], ...fact.tags])],
5458
- entityRef: committed.frontmatter.entityRef ?? fact.entityRef,
5459
- validAt: committed.frontmatter.valid_at ?? fact.validAt
5460
- } : fact;
5461
- const entry = entries.get(storage.dir) ?? { storage, facts: [] };
5462
- const prior = entry.facts.findIndex((existing) => existing.memoryId === memoryId);
5463
- if (prior !== -1) {
5464
- entry.facts[prior] = {
5465
- ...derived,
5466
- content,
5467
- memoryId,
5468
- insertedAt,
5469
- cueAnchors: [
5470
- ...entry.facts[prior].cueAnchors ?? [],
5471
- ...derived.cueAnchors ?? []
5472
- ]
5473
- };
5474
- } else {
5475
- entry.facts.push({ ...derived, content, memoryId, insertedAt });
5476
- }
5477
- entries.set(storage.dir, entry);
5478
- }
5479
- async function persistConstructedHarmonicRecords(options) {
5480
- const sessionKey = options.sessionKey?.trim();
5481
- if (!sessionKey) {
5482
- log.warn("harmonic construction skipped: extraction session key is missing");
5483
- return;
5484
- }
5485
- const recordedAt = options.validAt && Number.isFinite(Date.parse(options.validAt)) ? new Date(options.validAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString();
5486
- const entries = [...options.entries];
5487
- const sharedEpisodeTitle = entries.length === 1 ? options.episodeTitle : void 0;
5488
- for (const entry of entries) {
5489
- try {
5490
- const records = deriveHarmonicRecords({
5491
- sessionKey,
5492
- recordedAt,
5493
- episodeTitle: sharedEpisodeTitle,
5494
- persistedFacts: entry.facts,
5495
- entityMentions: filterHarmonicEntityMentions(entry.facts, options.entityMentions).map((entity) => ({
5496
- name: entity.name,
5497
- type: entity.type,
5498
- facts: entity.facts
5499
- }))
5500
- });
5501
- await persistHarmonicRecords({
5502
- memoryDir: entry.storage.dir,
5503
- abstractionNodeStoreDir: entry.storage.dir === options.baseStorageDir ? options.abstractionNodeStoreDir : void 0,
5504
- nodes: records.nodes,
5505
- anchors: options.anchorsEnabled ? records.anchors : []
5506
- });
5507
- } catch (error) {
5508
- log.warn(
5509
- `harmonic construction failed open for namespace ${entry.storage.dir}: ${error instanceof Error ? error.message : String(error)}`
5510
- );
5511
- }
5512
- }
5513
- }
5514
-
5515
5561
  // src/orchestration/semantic-merge-persist.ts
5516
5562
  import path5 from "path";
5517
5563
 
@@ -6925,6 +6971,28 @@ var ExtractionPersistCoordinator = class {
6925
6971
  0,
6926
6972
  this.deps.config.extractionMaxProfileUpdatesPerRun
6927
6973
  );
6974
+ const finalizeCommittedWrites = async (scheduleQmd) => {
6975
+ await finalizeExtractionCommittedWrites({
6976
+ saveContentHashIndexes: () => this.deps.saveContentHashIndexes(),
6977
+ behaviorSignalsByStorage: behaviorSignalsByStorage.values(),
6978
+ harmonic: {
6979
+ enabled: harmonicConstructionEnabled,
6980
+ entries: harmonicFactsByStorage.values(),
6981
+ baseStorageDir: storage.dir,
6982
+ abstractionNodeStoreDir: !scopeProfileWritePlan && harmonicBaseNamespace === this.deps.config.defaultNamespace ? this.deps.config.abstractionNodeStoreDir : void 0,
6983
+ sessionKey: sourceContext?.sessionKey,
6984
+ validAt: sourceContext?.validAt,
6985
+ episodeTitle: result.episodeTitle,
6986
+ anchorsEnabled: harmonicAnchorsEnabled,
6987
+ entityMentions: entities
6988
+ },
6989
+ updateTemporalTagIndexes: (target, ids) => this.deps.updateTemporalTagIndexes(target, ids),
6990
+ fallbackStorage: storage,
6991
+ persistedIdsByStorage,
6992
+ requestQmdMaintenance: () => this.deps.requestQmdMaintenance(),
6993
+ scheduleQmd
6994
+ });
6995
+ };
6928
6996
  if (facts.length < result.facts.length || entities.length < result.entities.length || questions.length < result.questions.length || profileUpdates.length < result.profileUpdates.length) {
6929
6997
  log.warn(
6930
6998
  `persistExtraction: capped extraction payload to guardrails (facts ${facts.length}/${result.facts.length}, entities ${entities.length}/${result.entities.length}, questions ${questions.length}/${result.questions.length}, profile ${profileUpdates.length}/${result.profileUpdates.length})`
@@ -7860,6 +7928,22 @@ var ExtractionPersistCoordinator = class {
7860
7928
  const memoryId = factWrite.id;
7861
7929
  const tombstoneBlocked = factWrite.tombstoneBlocked;
7862
7930
  const postWriteGuard = faithfulnessEnforceStatus === "pending_review" || tombstoneBlocked;
7931
+ trackBehaviorSignals(
7932
+ targetStorage,
7933
+ buildBehaviorSignalsForMemory({
7934
+ memoryId,
7935
+ category: writeCategory,
7936
+ content: fact.content,
7937
+ namespace: this.deps.storageDirNamespace(targetStorage.dir),
7938
+ confidence: fact.confidence,
7939
+ source: "extraction"
7940
+ })
7941
+ );
7942
+ trackPersistedId(targetStorage, memoryId, {
7943
+ pendingReview: postWriteGuard,
7944
+ category: writeCategory,
7945
+ harmonicFact
7946
+ });
7863
7947
  try {
7864
7948
  const contradictionOutcome = await this.deps.applyDeferredContradictionResolve(
7865
7949
  contradiction,
@@ -7871,7 +7955,9 @@ var ExtractionPersistCoordinator = class {
7871
7955
  await anchorSnapshots.remove(targetStorage, contradiction.supersededId);
7872
7956
  }
7873
7957
  } catch (err) {
7874
- await flushDeferredFactHashOnFailure(() => this.deps.saveContentHashIndexes(), factDedupEnabled);
7958
+ await finalizeCommittedWrites(true).catch(
7959
+ (finalizeErr) => log.warn(`committed-write finalization after post-write failure failed: ${finalizeErr}`)
7960
+ );
7875
7961
  throw err;
7876
7962
  }
7877
7963
  if (routedRuleId) {
@@ -7899,22 +7985,6 @@ var ExtractionPersistCoordinator = class {
7899
7985
  }
7900
7986
  }
7901
7987
  try {
7902
- trackBehaviorSignals(
7903
- targetStorage,
7904
- buildBehaviorSignalsForMemory({
7905
- memoryId,
7906
- category: writeCategory,
7907
- content: fact.content,
7908
- namespace: this.deps.storageDirNamespace(targetStorage.dir),
7909
- confidence: fact.confidence,
7910
- source: "extraction"
7911
- })
7912
- );
7913
- trackPersistedId(targetStorage, memoryId, {
7914
- pendingReview: postWriteGuard,
7915
- category: writeCategory,
7916
- harmonicFact
7917
- });
7918
7988
  await anchorSnapshots.replace(targetStorage, memoryId, writeCategory, memoryPathById);
7919
7989
  if (!postWriteGuard && threadEpisodeIdsForGraph && !threadEpisodeIdsForGraph.includes(memoryId)) {
7920
7990
  threadEpisodeIdsForGraph.push(memoryId);
@@ -8015,7 +8085,9 @@ var ExtractionPersistCoordinator = class {
8015
8085
  );
8016
8086
  }
8017
8087
  } catch (err) {
8018
- await flushDeferredFactHashOnFailure(() => this.deps.saveContentHashIndexes(), factDedupEnabled);
8088
+ await finalizeCommittedWrites(true).catch(
8089
+ (finalizeErr) => log.warn(`committed-write finalization after post-write failure failed: ${finalizeErr}`)
8090
+ );
8019
8091
  throw err;
8020
8092
  }
8021
8093
  }
@@ -8051,7 +8123,10 @@ var ExtractionPersistCoordinator = class {
8051
8123
  recordDurableNonFactWrite();
8052
8124
  }
8053
8125
  } catch (err) {
8054
- log.warn(`persistExtraction: entity write failed: ${err}`);
8126
+ await finalizeCommittedWrites(true).catch(
8127
+ (finalizeErr) => log.warn(`committed-write finalization after entity failure failed: ${finalizeErr}`)
8128
+ );
8129
+ throw err;
8055
8130
  }
8056
8131
  }
8057
8132
  if (resolveRecallEnhancementCapabilities(this.deps.config).entityRelationships && Array.isArray(result.relationships)) {
@@ -8131,19 +8206,7 @@ ${q.context ?? ""}`], entityScreenOn, entityScreenProfile);
8131
8206
  if (durableNonFactWritten) {
8132
8207
  touchBaseNonFactNamespace();
8133
8208
  }
8134
- await this.deps.saveContentHashIndexes().catch((err) => {
8135
- log.warn(`content-hash index save failed: ${err}`);
8136
- });
8137
- for (const {
8138
- storage: targetStorage,
8139
- events
8140
- } of behaviorSignalsByStorage.values()) {
8141
- const dedupedSignals = dedupeBehaviorSignalsByMemoryAndHash(events);
8142
- if (dedupedSignals.length === 0) continue;
8143
- await targetStorage.appendBehaviorSignals(dedupedSignals).catch(
8144
- (err) => log.warn(`appendBehaviorSignals failed (non-fatal): ${err}`)
8145
- );
8146
- }
8209
+ await finalizeCommittedWrites(false);
8147
8210
  const dedupSuffix = `${dedupedCount > 0 ? ` (${dedupedCount} deduped)` : ""}${semanticMergedCount > 0 ? ` (${semanticMergedCount} merged)` : ""}`;
8148
8211
  const gatedSuffix = importanceGatedCount > 0 ? ` (${importanceGatedCount} gated)` : "";
8149
8212
  const judgeSuffix = judgeGatedCount > 0 ? ` (${judgeGatedCount} judge-rejected)` : "";
@@ -8151,29 +8214,6 @@ ${q.context ?? ""}`], entityScreenOn, entityScreenProfile);
8151
8214
  log.info(
8152
8215
  `persisted: ${facts.length - dedupedCount - importanceGatedCount - judgeGatedCount - redactionGatedCount - semanticMergedCount} facts${dedupSuffix}${gatedSuffix}${judgeSuffix}${redactionSuffix}, ${entities.length} entities, ${questions.length} questions, ${profileUpdates.length} profile updates`
8153
8216
  );
8154
- if (harmonicConstructionEnabled && harmonicFactsByStorage.size > 0) {
8155
- await persistConstructedHarmonicRecords({
8156
- entries: harmonicFactsByStorage.values(),
8157
- baseStorageDir: storage.dir,
8158
- abstractionNodeStoreDir: !scopeProfileWritePlan && harmonicBaseNamespace === this.deps.config.defaultNamespace ? this.deps.config.abstractionNodeStoreDir : void 0,
8159
- sessionKey: sourceContext?.sessionKey,
8160
- validAt: sourceContext?.validAt,
8161
- episodeTitle: result.episodeTitle,
8162
- anchorsEnabled: harmonicAnchorsEnabled,
8163
- entityMentions: entities
8164
- });
8165
- }
8166
- void (async () => {
8167
- if (persistedIdsByStorage.size === 0) {
8168
- await this.deps.updateTemporalTagIndexes(storage, []);
8169
- return;
8170
- }
8171
- for (const entry of persistedIdsByStorage.values()) {
8172
- await this.deps.updateTemporalTagIndexes(entry.storage, entry.ids);
8173
- }
8174
- })().catch(
8175
- (err) => log.debug(`temporal-index update error (non-fatal): ${err}`)
8176
- );
8177
8217
  this.deps.setLastPersistExtractionPendingReviewIds(pendingReviewPersistedIds);
8178
8218
  return { persistedIds, memoryPathById };
8179
8219
  }
@@ -22023,7 +22063,8 @@ var Orchestrator = class {
22023
22063
  indexPersistedMemory: (storage, memoryId) => this.indexPersistedMemory(storage, memoryId),
22024
22064
  buildGraphEdge: (storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps) => this.buildGraphEdge(storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps),
22025
22065
  invalidateGraphEdgeCache: (storage) => this.graphIndexFor(storage).invalidateEdgeCache(),
22026
- updateTemporalTagIndexes: (storage, persistedIds) => this.updateTemporalTagIndexes(storage, persistedIds)
22066
+ updateTemporalTagIndexes: (storage, persistedIds) => this.updateTemporalTagIndexes(storage, persistedIds),
22067
+ requestQmdMaintenance: () => this.requestQmdMaintenance()
22027
22068
  });
22028
22069
  }
22029
22070
  return this._extractionPersistCoordinator;
@@ -22511,7 +22552,10 @@ var Orchestrator = class {
22511
22552
  });
22512
22553
  const bindStorage = (storage, namespace) => {
22513
22554
  storage.onEntityMigrationComplete = () => {
22514
- if (this.acceptingEntityMigrationMaintenance) this.requestQmdMaintenance();
22555
+ if (!this.acceptingEntityMigrationMaintenance) return false;
22556
+ const served = this.maintenanceScheduler.requestQmdMaintenanceCompletion();
22557
+ this.requestQmdMaintenance();
22558
+ return served;
22515
22559
  };
22516
22560
  if (this.prioritizedEmbedding) storage.onMemoryWrite = (filePath) => this.prioritizedEmbedding?.enqueue(filePath, namespace);
22517
22561
  };
@@ -31573,4 +31617,4 @@ export {
31573
31617
  qmdStartupCollectionChecksWithTimeout,
31574
31618
  Orchestrator
31575
31619
  };
31576
- //# sourceMappingURL=chunk-SJD334AG.js.map
31620
+ //# sourceMappingURL=chunk-CA6X37OB.js.map