@remnic/core 10.0.38 → 10.0.40

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 (444) hide show
  1. package/dist/access-admin-ops-surface.js +73 -73
  2. package/dist/access-audit.js +2 -2
  3. package/dist/access-authorization-probe.js +74 -74
  4. package/dist/access-boundary.js +73 -73
  5. package/dist/access-citation-namespace.js +2 -2
  6. package/dist/access-cli.js +162 -161
  7. package/dist/access-cli.js.map +1 -1
  8. package/dist/access-extraction-force-flush.js +73 -73
  9. package/dist/access-http-briefing.js +74 -74
  10. package/dist/access-http-query.js +75 -75
  11. package/dist/access-http.js +98 -98
  12. package/dist/access-identity-continuity-surface.js +73 -73
  13. package/dist/access-lcm-surface.js +73 -73
  14. package/dist/access-mcp.js +87 -87
  15. package/dist/access-namespace-preflight.js +73 -73
  16. package/dist/access-observe-write-category.js +15 -15
  17. package/dist/access-observe-write-surface.js +73 -73
  18. package/dist/access-offline-manifest.js +12 -12
  19. package/dist/access-operations-batch.js +77 -77
  20. package/dist/access-operations.js +84 -84
  21. package/dist/access-recall-concurrency.js +73 -73
  22. package/dist/access-recall-diagnostics.js +2 -2
  23. package/dist/access-recall-response.js +73 -73
  24. package/dist/access-recall-surface.js +73 -73
  25. package/dist/access-schema.js +10 -10
  26. package/dist/access-service.d.ts +2 -2
  27. package/dist/access-service.d.ts.map +1 -1
  28. package/dist/access-service.js +73 -73
  29. package/dist/access-surface-catalog.js +75 -75
  30. package/dist/active-recall.js +29 -29
  31. package/dist/adapters/index.js +4 -4
  32. package/dist/adapters/registry.js +2 -2
  33. package/dist/{auto-sync-432USQDH.js → auto-sync-BNCBMU6H.js} +7 -7
  34. package/dist/briefing.js +19 -19
  35. package/dist/buffer-types.d.ts +59 -0
  36. package/dist/buffer-types.d.ts.map +1 -0
  37. package/dist/buffer-types.js +1 -0
  38. package/dist/buffer.d.ts +14 -22
  39. package/dist/buffer.d.ts.map +1 -1
  40. package/dist/buffer.js +11 -11
  41. package/dist/calibration.js +2 -2
  42. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-GWVG7LGC.js} +2 -2
  43. package/dist/causal-behavior.js +2 -2
  44. package/dist/causal-chain.js +2 -2
  45. package/dist/causal-consolidation.js +22 -22
  46. package/dist/causal-retrieval.js +2 -2
  47. package/dist/causal-trajectory-graph.js +2 -2
  48. package/dist/causal-trajectory.js +1 -1
  49. package/dist/{chunk-MKE5DP3S.js → chunk-23ZMQONL.js} +2 -2
  50. package/dist/{chunk-3K5IEJTK.js → chunk-2AV2U2SZ.js} +3 -3
  51. package/dist/{chunk-HJ3UTGIW.js → chunk-2JNBPOZ2.js} +3 -3
  52. package/dist/{chunk-5ANUG4JZ.js → chunk-2T6KEOUL.js} +2 -2
  53. package/dist/{chunk-EEOYF3IB.js → chunk-3RJDYZJE.js} +2 -2
  54. package/dist/{chunk-P5CUEB2Q.js → chunk-4QLKVZH6.js} +8 -8
  55. package/dist/{chunk-XTBEXZFN.js → chunk-5SF7JOJB.js} +4 -4
  56. package/dist/{chunk-53BLBDV6.js → chunk-5TRU6QQC.js} +2 -2
  57. package/dist/{chunk-DKHX2FHI.js → chunk-64WHWIPL.js} +2 -2
  58. package/dist/{chunk-TVIGN3XZ.js → chunk-6FRFVIKC.js} +10 -10
  59. package/dist/{chunk-JIA435P3.js → chunk-6ITNEPJO.js} +2 -2
  60. package/dist/{chunk-WEK3OUGO.js → chunk-6X3J4NLZ.js} +10 -5
  61. package/dist/chunk-6X3J4NLZ.js.map +1 -0
  62. package/dist/{chunk-FGEY2AGV.js → chunk-7BCYAJKP.js} +2 -2
  63. package/dist/{chunk-PSQ2P2T3.js → chunk-7XZ7TOLQ.js} +3 -3
  64. package/dist/{chunk-6JEEY42N.js → chunk-AER3HD3B.js} +2 -2
  65. package/dist/{chunk-POGPI5GR.js → chunk-AY6LO7GD.js} +2 -2
  66. package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
  67. package/dist/{chunk-WCBLPKG3.js → chunk-BIYVUPC6.js} +172 -143
  68. package/dist/chunk-BIYVUPC6.js.map +1 -0
  69. package/dist/{chunk-KQAFEZQX.js → chunk-BUKK5SWA.js} +2 -2
  70. package/dist/{chunk-LHBOFROT.js → chunk-CHNZPOWX.js} +4 -3
  71. package/dist/{chunk-LHBOFROT.js.map → chunk-CHNZPOWX.js.map} +1 -1
  72. package/dist/{chunk-6F5BGIAF.js → chunk-CNAL35D5.js} +3 -3
  73. package/dist/{chunk-YC2C67F7.js → chunk-CRXGQRNA.js} +3 -3
  74. package/dist/{chunk-WRDFYSUC.js → chunk-CZVNOTLR.js} +2 -2
  75. package/dist/{chunk-VPO53QMG.js → chunk-D6DOLQYK.js} +2 -2
  76. package/dist/{chunk-RGKXF4W3.js → chunk-E5IEI2MR.js} +2 -2
  77. package/dist/{chunk-Z2T5BPOZ.js → chunk-EIYJK7OD.js} +2 -2
  78. package/dist/{chunk-FRAL3EU4.js → chunk-EKPRLTAE.js} +2 -2
  79. package/dist/{chunk-MCPSMWUC.js → chunk-EPEDMEHO.js} +10 -10
  80. package/dist/{chunk-MCPSMWUC.js.map → chunk-EPEDMEHO.js.map} +1 -1
  81. package/dist/{chunk-TYGLV6ZG.js → chunk-EYGOM6AI.js} +2 -2
  82. package/dist/{chunk-TYGLV6ZG.js.map → chunk-EYGOM6AI.js.map} +1 -1
  83. package/dist/{chunk-I75BWXRZ.js → chunk-F2RDRE7M.js} +2 -2
  84. package/dist/{chunk-2AKIVSHP.js → chunk-FAKRTS3Y.js} +2 -2
  85. package/dist/{chunk-MZWHIAOL.js → chunk-FC3ZFEXF.js} +2 -2
  86. package/dist/{chunk-3PLAL2KP.js → chunk-FJ264QBP.js} +17 -9
  87. package/dist/chunk-FJ264QBP.js.map +1 -0
  88. package/dist/{chunk-7VFNGQ4V.js → chunk-FLDXEJFX.js} +2 -2
  89. package/dist/{chunk-TYLNWE4D.js → chunk-FNEYSTB6.js} +2 -2
  90. package/dist/{chunk-XHX67LX6.js → chunk-FPHU6KVI.js} +2 -2
  91. package/dist/{chunk-JH4FCVWJ.js → chunk-G6OFEGUR.js} +2 -2
  92. package/dist/{chunk-WCIDCJOQ.js → chunk-GAUS4XGN.js} +3 -3
  93. package/dist/{chunk-SZPPCEYT.js → chunk-GDOI4U4D.js} +2 -2
  94. package/dist/{chunk-63YPKHAU.js → chunk-GLB6VV3J.js} +2 -2
  95. package/dist/{chunk-3XVBGGF3.js → chunk-GRN4BVPM.js} +2 -2
  96. package/dist/{chunk-ZAP7BKTZ.js → chunk-GZMHBRIR.js} +6 -6
  97. package/dist/{chunk-645WOU5I.js → chunk-H7BZBSP6.js} +4 -4
  98. package/dist/{chunk-TXP7Q7T5.js → chunk-HN35OH2C.js} +2 -2
  99. package/dist/{chunk-SWZOAQUM.js → chunk-HSNV4CSW.js} +57 -57
  100. package/dist/{chunk-GFYFKXWZ.js → chunk-HUDPXTXW.js} +2 -2
  101. package/dist/{chunk-C2KOW2UQ.js → chunk-I7CWAJHX.js} +2 -2
  102. package/dist/{chunk-L2JQSG5M.js → chunk-I7TR2OCU.js} +2 -2
  103. package/dist/{chunk-5DCS4C4S.js → chunk-ICTJOOWZ.js} +4 -4
  104. package/dist/{chunk-NH6GZEQN.js → chunk-IF6EG22P.js} +10 -10
  105. package/dist/chunk-IF6EG22P.js.map +1 -0
  106. package/dist/{chunk-STM4T335.js → chunk-IJH6METJ.js} +2 -2
  107. package/dist/{chunk-6SYS5YX3.js → chunk-IJJWM2ZA.js} +2 -2
  108. package/dist/{chunk-3AODCBKX.js → chunk-IWDFHVPJ.js} +6 -6
  109. package/dist/{chunk-XHVO3CGX.js → chunk-JGS55BAS.js} +53 -2
  110. package/dist/chunk-JGS55BAS.js.map +1 -0
  111. package/dist/{chunk-L7PGPH4E.js → chunk-JJSMSS45.js} +2 -2
  112. package/dist/{chunk-74AY3S7U.js → chunk-JNLYHJG7.js} +4 -4
  113. package/dist/{chunk-OLH4XCLU.js → chunk-JXQTECMU.js} +2 -2
  114. package/dist/{chunk-6QOL4G76.js → chunk-KQXRVELF.js} +2 -2
  115. package/dist/{chunk-PJRKLB4Z.js → chunk-L5PM7B3I.js} +16 -2
  116. package/dist/{chunk-PJRKLB4Z.js.map → chunk-L5PM7B3I.js.map} +1 -1
  117. package/dist/{chunk-VGRM43X6.js → chunk-LB6HIXQC.js} +2 -2
  118. package/dist/{chunk-N7DVBHU3.js → chunk-LR7RW4T6.js} +3 -3
  119. package/dist/{chunk-AYBAC2N4.js → chunk-LWIU5BMA.js} +3 -3
  120. package/dist/{chunk-FZVZYU5C.js → chunk-LXN737FX.js} +2 -2
  121. package/dist/{chunk-7ZRRJ6RG.js → chunk-MGYZENUY.js} +2 -2
  122. package/dist/{chunk-YQ6SLFNZ.js → chunk-MPJDQC4G.js} +3 -3
  123. package/dist/{chunk-7HXZOWTR.js → chunk-N3PUGD7E.js} +2 -2
  124. package/dist/{chunk-EGNONTVT.js → chunk-NBEM5QEH.js} +6 -6
  125. package/dist/{chunk-QO5KDQGG.js → chunk-NFJWB27H.js} +20 -18
  126. package/dist/chunk-NFJWB27H.js.map +1 -0
  127. package/dist/{chunk-JF3MEIHO.js → chunk-O67H7OXJ.js} +4 -4
  128. package/dist/{chunk-OLHN4ZNT.js → chunk-ONIVKGNC.js} +3 -3
  129. package/dist/{chunk-2NLLXCJG.js → chunk-OWHERGF2.js} +2 -2
  130. package/dist/{chunk-I73ZSORJ.js → chunk-OXSTKCYK.js} +4 -4
  131. package/dist/{chunk-UFM3PJDT.js → chunk-PARM6OYL.js} +1 -1
  132. package/dist/chunk-PARM6OYL.js.map +1 -0
  133. package/dist/{chunk-VSSQIBVU.js → chunk-PJXSBXEC.js} +2 -2
  134. package/dist/{chunk-4B37KNMP.js → chunk-PW63SXFM.js} +2 -2
  135. package/dist/{chunk-TPKB7T6Z.js → chunk-Q6UZREJK.js} +2 -2
  136. package/dist/{chunk-X247CYL6.js → chunk-Q77SLBWT.js} +4 -4
  137. package/dist/{chunk-TAEJ2MRR.js → chunk-QFD7OANX.js} +62 -62
  138. package/dist/chunk-QFD7OANX.js.map +1 -0
  139. package/dist/{chunk-5K23NQRI.js → chunk-QGNZ5QPV.js} +2 -2
  140. package/dist/{chunk-UJDTXWMT.js → chunk-QIMGULGN.js} +2 -2
  141. package/dist/{chunk-E24RUQEN.js → chunk-QNIYL5SK.js} +2 -2
  142. package/dist/{chunk-KOY25HUB.js → chunk-QYAXMXOB.js} +2 -2
  143. package/dist/{chunk-J7G656MY.js → chunk-R42VUN5V.js} +4 -4
  144. package/dist/{chunk-LOMSBYNS.js → chunk-RPHCSMTQ.js} +309 -106
  145. package/dist/chunk-RPHCSMTQ.js.map +1 -0
  146. package/dist/{chunk-AYXRK264.js → chunk-RROFIAYI.js} +9 -9
  147. package/dist/{chunk-YYGZ4EIY.js → chunk-RUAIO5UA.js} +2 -2
  148. package/dist/{chunk-E5PVMB3I.js → chunk-SDXBR5QO.js} +2 -2
  149. package/dist/{chunk-OKKBOTRA.js → chunk-SLVR3U4E.js} +2 -2
  150. package/dist/{chunk-CUWOSRCS.js → chunk-SUKPM6DV.js} +2 -2
  151. package/dist/{chunk-TDCR6PQL.js → chunk-TWRPWJJT.js} +2 -2
  152. package/dist/{chunk-6DTIYAAN.js → chunk-UGV256H3.js} +2 -2
  153. package/dist/{chunk-DG4H56SK.js → chunk-UIK3U36O.js} +2 -2
  154. package/dist/{chunk-KOAVX2IT.js → chunk-UKIIAEJF.js} +2 -2
  155. package/dist/{chunk-XLEP7SS3.js → chunk-UMSH4I3E.js} +2 -2
  156. package/dist/{chunk-X7Y7WX73.js → chunk-UVYI6VIX.js} +1 -1
  157. package/dist/chunk-VA3GNAWQ.js +58 -0
  158. package/dist/chunk-VA3GNAWQ.js.map +1 -0
  159. package/dist/{chunk-4P4VLPGB.js → chunk-VECRSYQG.js} +1 -1
  160. package/dist/{chunk-GGI6FLO6.js → chunk-VHBGJAYC.js} +2 -2
  161. package/dist/{chunk-NMKETOAX.js → chunk-VSHWPOUB.js} +2 -2
  162. package/dist/{chunk-VC3X7XP3.js → chunk-VTZSIG6O.js} +2 -2
  163. package/dist/{chunk-UBN5AOLT.js → chunk-W5EO4USJ.js} +2 -2
  164. package/dist/{chunk-Y7427SL7.js → chunk-WCGJK4NQ.js} +4 -4
  165. package/dist/{chunk-4IZ6AC2U.js → chunk-WJMAWDAU.js} +2 -2
  166. package/dist/{chunk-JH2ALMPR.js → chunk-WR5POHQ3.js} +2 -2
  167. package/dist/{chunk-EHIKY2IA.js → chunk-WU5WTCH5.js} +2 -2
  168. package/dist/{chunk-QKXPOLQD.js → chunk-WUBGMV3G.js} +6 -6
  169. package/dist/{chunk-FKTMWDN2.js → chunk-WUL6LDJ4.js} +2 -2
  170. package/dist/{chunk-5UPOKIFP.js → chunk-XBHUMPIQ.js} +12 -12
  171. package/dist/{chunk-Y5ZHZKZD.js → chunk-XJ77IOAD.js} +2 -2
  172. package/dist/{chunk-U7HJBODU.js → chunk-XKTHJHSQ.js} +5 -5
  173. package/dist/{chunk-FQFMLOAC.js → chunk-XLUMO5H2.js} +20 -20
  174. package/dist/chunk-XLUMO5H2.js.map +1 -0
  175. package/dist/{chunk-JFI3ATK4.js → chunk-XMYWYJM2.js} +2 -2
  176. package/dist/{chunk-64S6X4IU.js → chunk-XTN54NML.js} +4 -4
  177. package/dist/{chunk-CVMAOPAH.js → chunk-XXBCUIYQ.js} +10 -10
  178. package/dist/{chunk-QOUKZ2N3.js → chunk-XXW3P3RX.js} +2 -2
  179. package/dist/{chunk-RWRHGE75.js → chunk-Y473XFTD.js} +2 -2
  180. package/dist/{chunk-VGFNTY3Y.js → chunk-YFXRLRKP.js} +2 -2
  181. package/dist/{chunk-DAOMWGO2.js → chunk-ZX5N5D6M.js} +4 -4
  182. package/dist/cli.js +121 -121
  183. package/dist/coding/export-okf-codegraph.js +20 -20
  184. package/dist/coding/pre-action-gate.js +2 -2
  185. package/dist/compounding/engine.js +21 -21
  186. package/dist/config.d.ts.map +1 -1
  187. package/dist/config.js +29 -29
  188. package/dist/connectors/codex-materialize-runner.js +19 -19
  189. package/dist/connectors/index.js +19 -19
  190. package/dist/contradiction/index.js +5 -5
  191. package/dist/convergence-refresh.js +21 -21
  192. package/dist/corpus-watermark.js +21 -21
  193. package/dist/deep-recall-http-glue.js +11 -11
  194. package/dist/deep-recall.js +2 -2
  195. package/dist/entity-retrieval.js +20 -20
  196. package/dist/event-order-recall.js +2 -2
  197. package/dist/explicit-capture.js +6 -6
  198. package/dist/external-wiki-access.js +74 -74
  199. package/dist/extraction-error-classification.d.ts +15 -0
  200. package/dist/extraction-error-classification.d.ts.map +1 -1
  201. package/dist/extraction-error-classification.js +7 -3
  202. package/dist/extraction-window-drain.d.ts +48 -0
  203. package/dist/extraction-window-drain.d.ts.map +1 -0
  204. package/dist/extraction-window-drain.js +14 -0
  205. package/dist/extraction.js +28 -28
  206. package/dist/{graph-edge-decay-2BZTY2IM.js → graph-edge-decay-3HVLMT6U.js} +5 -5
  207. package/dist/graph-edge-decay-3HVLMT6U.js.map +1 -0
  208. package/dist/graph-jsonl.js +3 -3
  209. package/dist/graph-snapshot.js +3 -3
  210. package/dist/graph.js +4 -4
  211. package/dist/harmonic-retrieval.js +20 -20
  212. package/dist/harmonic-source-lookup.js +2 -2
  213. package/dist/index.js +209 -208
  214. package/dist/lcm/engine.js +2 -2
  215. package/dist/lcm/index.js +7 -7
  216. package/dist/local-llm.js +2 -2
  217. package/dist/location/index.js +22 -22
  218. package/dist/maintenance/memory-governance.js +19 -19
  219. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +19 -19
  220. package/dist/maintenance/rebuild-memory-projection-runner.js +21 -21
  221. package/dist/maintenance/rebuild-memory-projection.js +20 -20
  222. package/dist/memory-browse-operations.js +74 -74
  223. package/dist/memory-browse.js +6 -6
  224. package/dist/memory-subject.js +3 -3
  225. package/dist/namespaces/migrate.js +20 -20
  226. package/dist/namespaces/search.d.ts +1 -0
  227. package/dist/namespaces/search.d.ts.map +1 -1
  228. package/dist/namespaces/search.js +11 -9
  229. package/dist/namespaces/storage.js +19 -19
  230. package/dist/offline-sync-changeset-generations.js +3 -3
  231. package/dist/offline-sync-embedding-generation.js +2 -2
  232. package/dist/offline-sync-file-io.js +2 -2
  233. package/dist/offline-sync-impression-drain.js +3 -3
  234. package/dist/offline-sync-snapshot-stream.js +8 -8
  235. package/dist/offline-sync-upload-staging.js +3 -3
  236. package/dist/offline-sync.js +9 -9
  237. package/dist/operator-doctor-corpus.js +22 -22
  238. package/dist/operator-toolkit.js +40 -40
  239. package/dist/orchestration/extraction-drain.d.ts +90 -0
  240. package/dist/orchestration/extraction-drain.d.ts.map +1 -0
  241. package/dist/orchestration/extraction-run-helpers.d.ts +3 -0
  242. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
  243. package/dist/orchestration/extraction-run.d.ts +4 -1
  244. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  245. package/dist/orchestration/maintenance.js +33 -33
  246. package/dist/orchestration/qmd-result-resolver.d.ts +5 -0
  247. package/dist/orchestration/qmd-result-resolver.d.ts.map +1 -1
  248. package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -1
  249. package/dist/orchestration/turn-ingestion.d.ts +3 -0
  250. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  251. package/dist/orchestrator.d.ts +8 -0
  252. package/dist/orchestrator.d.ts.map +1 -1
  253. package/dist/orchestrator.js +162 -161
  254. package/dist/qmd.js +5 -5
  255. package/dist/recall-explain-renderer.js +3 -3
  256. package/dist/recall-navigate-access.js +2 -2
  257. package/dist/recall-navigate-disclosure.js +2 -2
  258. package/dist/recall-navigate.js +2 -2
  259. package/dist/recall-navigation-operations.js +74 -74
  260. package/dist/recall-navigation.js +73 -73
  261. package/dist/recall-state-view-admission.js +6 -6
  262. package/dist/recall-why-service.js +6 -6
  263. package/dist/recall-xray-cli.js +4 -4
  264. package/dist/recall-xray-renderer.js +3 -3
  265. package/dist/recall-xray.js +2 -2
  266. package/dist/reconcile/manifest.js +3 -3
  267. package/dist/{resolution-4ZEQPXUZ.js → resolution-NNYG37YB.js} +6 -6
  268. package/dist/resolution-NNYG37YB.js.map +1 -0
  269. package/dist/resume-bundles.js +30 -30
  270. package/dist/retrieval-agents.js +2 -2
  271. package/dist/salvage-envelope.js +5 -5
  272. package/dist/search/factory.js +6 -6
  273. package/dist/search/index.js +10 -10
  274. package/dist/secure-store/index.js +2 -2
  275. package/dist/semantic-consolidation.js +20 -20
  276. package/dist/semantic-rule-promotion.js +19 -19
  277. package/dist/semantic-rule-verifier.js +19 -19
  278. package/dist/source-agent-qualifier.js +23 -23
  279. package/dist/standup/build.js +19 -19
  280. package/dist/storage/dropped-extraction-chunk.d.ts +8 -0
  281. package/dist/storage/dropped-extraction-chunk.d.ts.map +1 -0
  282. package/dist/storage.d.ts +1 -0
  283. package/dist/storage.d.ts.map +1 -1
  284. package/dist/storage.js +18 -18
  285. package/dist/subject-config.js +4 -4
  286. package/dist/summarizer.js +3 -3
  287. package/dist/support-passport/index.js +76 -76
  288. package/dist/transfer/backup.js +2 -2
  289. package/dist/transfer/capsule-export.js +2 -2
  290. package/dist/transfer/capsule-import.js +2 -2
  291. package/dist/transfer/export-okf.js +20 -20
  292. package/dist/types.d.ts +7 -0
  293. package/dist/types.d.ts.map +1 -1
  294. package/dist/types.js +1 -1
  295. package/dist/verified-recall.js +19 -19
  296. package/dist/who-knows-cli.js +20 -20
  297. package/dist/who-knows.js +19 -19
  298. package/dist/write-envelope.js +4 -4
  299. package/package.json +2 -2
  300. package/src/access-entity-principal.test.ts +190 -0
  301. package/src/access-http.ts +2 -2
  302. package/src/access-operations-batch.ts +2 -2
  303. package/src/access-service.ts +7 -6
  304. package/src/buffer-drop-extraction-chunk.test.ts +196 -0
  305. package/src/buffer-types.ts +65 -0
  306. package/src/buffer.ts +60 -62
  307. package/src/chat/chat-executor.ts +1 -1
  308. package/src/config.ts +8 -0
  309. package/src/extraction-error-classification.ts +23 -0
  310. package/src/extraction-local-failure-class.test.ts +55 -0
  311. package/src/extraction-window-drain.test.ts +123 -0
  312. package/src/extraction-window-drain.ts +110 -0
  313. package/src/extraction.ts +9 -9
  314. package/src/namespaces/search.ts +1 -1
  315. package/src/orchestration/extraction-drain.ts +261 -0
  316. package/src/orchestration/extraction-run-helpers.ts +8 -0
  317. package/src/orchestration/extraction-run.test.ts +83 -2
  318. package/src/orchestration/extraction-run.ts +5 -4
  319. package/src/orchestration/qmd-result-resolver.ts +26 -1
  320. package/src/orchestration/recall-search-pipeline.ts +11 -12
  321. package/src/orchestration/turn-ingestion.ts +9 -5
  322. package/src/orchestrator.ts +21 -0
  323. package/src/secure-store/secure-fs.ts +3 -1
  324. package/src/storage/dropped-extraction-chunk.ts +27 -0
  325. package/src/storage-dropped-chunk-filenames.test.ts +30 -0
  326. package/src/storage.ts +6 -7
  327. package/src/types.ts +7 -0
  328. package/dist/chunk-3PLAL2KP.js.map +0 -1
  329. package/dist/chunk-FQFMLOAC.js.map +0 -1
  330. package/dist/chunk-LOMSBYNS.js.map +0 -1
  331. package/dist/chunk-NH6GZEQN.js.map +0 -1
  332. package/dist/chunk-QO5KDQGG.js.map +0 -1
  333. package/dist/chunk-TAEJ2MRR.js.map +0 -1
  334. package/dist/chunk-UFM3PJDT.js.map +0 -1
  335. package/dist/chunk-WCBLPKG3.js.map +0 -1
  336. package/dist/chunk-WEK3OUGO.js.map +0 -1
  337. package/dist/chunk-XHVO3CGX.js.map +0 -1
  338. /package/dist/{auto-sync-432USQDH.js.map → auto-sync-BNCBMU6H.js.map} +0 -0
  339. /package/dist/{capsule-crypto-7FJQINUR.js.map → buffer-types.js.map} +0 -0
  340. /package/dist/{graph-edge-decay-2BZTY2IM.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  341. /package/dist/{chunk-MKE5DP3S.js.map → chunk-23ZMQONL.js.map} +0 -0
  342. /package/dist/{chunk-3K5IEJTK.js.map → chunk-2AV2U2SZ.js.map} +0 -0
  343. /package/dist/{chunk-HJ3UTGIW.js.map → chunk-2JNBPOZ2.js.map} +0 -0
  344. /package/dist/{chunk-5ANUG4JZ.js.map → chunk-2T6KEOUL.js.map} +0 -0
  345. /package/dist/{chunk-EEOYF3IB.js.map → chunk-3RJDYZJE.js.map} +0 -0
  346. /package/dist/{chunk-P5CUEB2Q.js.map → chunk-4QLKVZH6.js.map} +0 -0
  347. /package/dist/{chunk-XTBEXZFN.js.map → chunk-5SF7JOJB.js.map} +0 -0
  348. /package/dist/{chunk-53BLBDV6.js.map → chunk-5TRU6QQC.js.map} +0 -0
  349. /package/dist/{chunk-DKHX2FHI.js.map → chunk-64WHWIPL.js.map} +0 -0
  350. /package/dist/{chunk-TVIGN3XZ.js.map → chunk-6FRFVIKC.js.map} +0 -0
  351. /package/dist/{chunk-JIA435P3.js.map → chunk-6ITNEPJO.js.map} +0 -0
  352. /package/dist/{chunk-FGEY2AGV.js.map → chunk-7BCYAJKP.js.map} +0 -0
  353. /package/dist/{chunk-PSQ2P2T3.js.map → chunk-7XZ7TOLQ.js.map} +0 -0
  354. /package/dist/{chunk-6JEEY42N.js.map → chunk-AER3HD3B.js.map} +0 -0
  355. /package/dist/{chunk-POGPI5GR.js.map → chunk-AY6LO7GD.js.map} +0 -0
  356. /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
  357. /package/dist/{chunk-KQAFEZQX.js.map → chunk-BUKK5SWA.js.map} +0 -0
  358. /package/dist/{chunk-6F5BGIAF.js.map → chunk-CNAL35D5.js.map} +0 -0
  359. /package/dist/{chunk-YC2C67F7.js.map → chunk-CRXGQRNA.js.map} +0 -0
  360. /package/dist/{chunk-WRDFYSUC.js.map → chunk-CZVNOTLR.js.map} +0 -0
  361. /package/dist/{chunk-VPO53QMG.js.map → chunk-D6DOLQYK.js.map} +0 -0
  362. /package/dist/{chunk-RGKXF4W3.js.map → chunk-E5IEI2MR.js.map} +0 -0
  363. /package/dist/{chunk-Z2T5BPOZ.js.map → chunk-EIYJK7OD.js.map} +0 -0
  364. /package/dist/{chunk-FRAL3EU4.js.map → chunk-EKPRLTAE.js.map} +0 -0
  365. /package/dist/{chunk-I75BWXRZ.js.map → chunk-F2RDRE7M.js.map} +0 -0
  366. /package/dist/{chunk-2AKIVSHP.js.map → chunk-FAKRTS3Y.js.map} +0 -0
  367. /package/dist/{chunk-MZWHIAOL.js.map → chunk-FC3ZFEXF.js.map} +0 -0
  368. /package/dist/{chunk-7VFNGQ4V.js.map → chunk-FLDXEJFX.js.map} +0 -0
  369. /package/dist/{chunk-TYLNWE4D.js.map → chunk-FNEYSTB6.js.map} +0 -0
  370. /package/dist/{chunk-XHX67LX6.js.map → chunk-FPHU6KVI.js.map} +0 -0
  371. /package/dist/{chunk-JH4FCVWJ.js.map → chunk-G6OFEGUR.js.map} +0 -0
  372. /package/dist/{chunk-WCIDCJOQ.js.map → chunk-GAUS4XGN.js.map} +0 -0
  373. /package/dist/{chunk-SZPPCEYT.js.map → chunk-GDOI4U4D.js.map} +0 -0
  374. /package/dist/{chunk-63YPKHAU.js.map → chunk-GLB6VV3J.js.map} +0 -0
  375. /package/dist/{chunk-3XVBGGF3.js.map → chunk-GRN4BVPM.js.map} +0 -0
  376. /package/dist/{chunk-ZAP7BKTZ.js.map → chunk-GZMHBRIR.js.map} +0 -0
  377. /package/dist/{chunk-645WOU5I.js.map → chunk-H7BZBSP6.js.map} +0 -0
  378. /package/dist/{chunk-TXP7Q7T5.js.map → chunk-HN35OH2C.js.map} +0 -0
  379. /package/dist/{chunk-SWZOAQUM.js.map → chunk-HSNV4CSW.js.map} +0 -0
  380. /package/dist/{chunk-GFYFKXWZ.js.map → chunk-HUDPXTXW.js.map} +0 -0
  381. /package/dist/{chunk-C2KOW2UQ.js.map → chunk-I7CWAJHX.js.map} +0 -0
  382. /package/dist/{chunk-L2JQSG5M.js.map → chunk-I7TR2OCU.js.map} +0 -0
  383. /package/dist/{chunk-5DCS4C4S.js.map → chunk-ICTJOOWZ.js.map} +0 -0
  384. /package/dist/{chunk-STM4T335.js.map → chunk-IJH6METJ.js.map} +0 -0
  385. /package/dist/{chunk-6SYS5YX3.js.map → chunk-IJJWM2ZA.js.map} +0 -0
  386. /package/dist/{chunk-3AODCBKX.js.map → chunk-IWDFHVPJ.js.map} +0 -0
  387. /package/dist/{chunk-L7PGPH4E.js.map → chunk-JJSMSS45.js.map} +0 -0
  388. /package/dist/{chunk-74AY3S7U.js.map → chunk-JNLYHJG7.js.map} +0 -0
  389. /package/dist/{chunk-OLH4XCLU.js.map → chunk-JXQTECMU.js.map} +0 -0
  390. /package/dist/{chunk-6QOL4G76.js.map → chunk-KQXRVELF.js.map} +0 -0
  391. /package/dist/{chunk-VGRM43X6.js.map → chunk-LB6HIXQC.js.map} +0 -0
  392. /package/dist/{chunk-N7DVBHU3.js.map → chunk-LR7RW4T6.js.map} +0 -0
  393. /package/dist/{chunk-AYBAC2N4.js.map → chunk-LWIU5BMA.js.map} +0 -0
  394. /package/dist/{chunk-FZVZYU5C.js.map → chunk-LXN737FX.js.map} +0 -0
  395. /package/dist/{chunk-7ZRRJ6RG.js.map → chunk-MGYZENUY.js.map} +0 -0
  396. /package/dist/{chunk-YQ6SLFNZ.js.map → chunk-MPJDQC4G.js.map} +0 -0
  397. /package/dist/{chunk-7HXZOWTR.js.map → chunk-N3PUGD7E.js.map} +0 -0
  398. /package/dist/{chunk-EGNONTVT.js.map → chunk-NBEM5QEH.js.map} +0 -0
  399. /package/dist/{chunk-JF3MEIHO.js.map → chunk-O67H7OXJ.js.map} +0 -0
  400. /package/dist/{chunk-OLHN4ZNT.js.map → chunk-ONIVKGNC.js.map} +0 -0
  401. /package/dist/{chunk-2NLLXCJG.js.map → chunk-OWHERGF2.js.map} +0 -0
  402. /package/dist/{chunk-I73ZSORJ.js.map → chunk-OXSTKCYK.js.map} +0 -0
  403. /package/dist/{chunk-VSSQIBVU.js.map → chunk-PJXSBXEC.js.map} +0 -0
  404. /package/dist/{chunk-4B37KNMP.js.map → chunk-PW63SXFM.js.map} +0 -0
  405. /package/dist/{chunk-TPKB7T6Z.js.map → chunk-Q6UZREJK.js.map} +0 -0
  406. /package/dist/{chunk-X247CYL6.js.map → chunk-Q77SLBWT.js.map} +0 -0
  407. /package/dist/{chunk-5K23NQRI.js.map → chunk-QGNZ5QPV.js.map} +0 -0
  408. /package/dist/{chunk-UJDTXWMT.js.map → chunk-QIMGULGN.js.map} +0 -0
  409. /package/dist/{chunk-E24RUQEN.js.map → chunk-QNIYL5SK.js.map} +0 -0
  410. /package/dist/{chunk-KOY25HUB.js.map → chunk-QYAXMXOB.js.map} +0 -0
  411. /package/dist/{chunk-J7G656MY.js.map → chunk-R42VUN5V.js.map} +0 -0
  412. /package/dist/{chunk-AYXRK264.js.map → chunk-RROFIAYI.js.map} +0 -0
  413. /package/dist/{chunk-YYGZ4EIY.js.map → chunk-RUAIO5UA.js.map} +0 -0
  414. /package/dist/{chunk-E5PVMB3I.js.map → chunk-SDXBR5QO.js.map} +0 -0
  415. /package/dist/{chunk-OKKBOTRA.js.map → chunk-SLVR3U4E.js.map} +0 -0
  416. /package/dist/{chunk-CUWOSRCS.js.map → chunk-SUKPM6DV.js.map} +0 -0
  417. /package/dist/{chunk-TDCR6PQL.js.map → chunk-TWRPWJJT.js.map} +0 -0
  418. /package/dist/{chunk-6DTIYAAN.js.map → chunk-UGV256H3.js.map} +0 -0
  419. /package/dist/{chunk-DG4H56SK.js.map → chunk-UIK3U36O.js.map} +0 -0
  420. /package/dist/{chunk-KOAVX2IT.js.map → chunk-UKIIAEJF.js.map} +0 -0
  421. /package/dist/{chunk-XLEP7SS3.js.map → chunk-UMSH4I3E.js.map} +0 -0
  422. /package/dist/{chunk-X7Y7WX73.js.map → chunk-UVYI6VIX.js.map} +0 -0
  423. /package/dist/{chunk-4P4VLPGB.js.map → chunk-VECRSYQG.js.map} +0 -0
  424. /package/dist/{chunk-GGI6FLO6.js.map → chunk-VHBGJAYC.js.map} +0 -0
  425. /package/dist/{chunk-NMKETOAX.js.map → chunk-VSHWPOUB.js.map} +0 -0
  426. /package/dist/{chunk-VC3X7XP3.js.map → chunk-VTZSIG6O.js.map} +0 -0
  427. /package/dist/{chunk-UBN5AOLT.js.map → chunk-W5EO4USJ.js.map} +0 -0
  428. /package/dist/{chunk-Y7427SL7.js.map → chunk-WCGJK4NQ.js.map} +0 -0
  429. /package/dist/{chunk-4IZ6AC2U.js.map → chunk-WJMAWDAU.js.map} +0 -0
  430. /package/dist/{chunk-JH2ALMPR.js.map → chunk-WR5POHQ3.js.map} +0 -0
  431. /package/dist/{chunk-EHIKY2IA.js.map → chunk-WU5WTCH5.js.map} +0 -0
  432. /package/dist/{chunk-QKXPOLQD.js.map → chunk-WUBGMV3G.js.map} +0 -0
  433. /package/dist/{chunk-FKTMWDN2.js.map → chunk-WUL6LDJ4.js.map} +0 -0
  434. /package/dist/{chunk-5UPOKIFP.js.map → chunk-XBHUMPIQ.js.map} +0 -0
  435. /package/dist/{chunk-Y5ZHZKZD.js.map → chunk-XJ77IOAD.js.map} +0 -0
  436. /package/dist/{chunk-U7HJBODU.js.map → chunk-XKTHJHSQ.js.map} +0 -0
  437. /package/dist/{chunk-JFI3ATK4.js.map → chunk-XMYWYJM2.js.map} +0 -0
  438. /package/dist/{chunk-64S6X4IU.js.map → chunk-XTN54NML.js.map} +0 -0
  439. /package/dist/{chunk-CVMAOPAH.js.map → chunk-XXBCUIYQ.js.map} +0 -0
  440. /package/dist/{chunk-QOUKZ2N3.js.map → chunk-XXW3P3RX.js.map} +0 -0
  441. /package/dist/{chunk-RWRHGE75.js.map → chunk-Y473XFTD.js.map} +0 -0
  442. /package/dist/{chunk-VGFNTY3Y.js.map → chunk-YFXRLRKP.js.map} +0 -0
  443. /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
  444. /package/dist/{resolution-4ZEQPXUZ.js.map → extraction-window-drain.js.map} +0 -0
@@ -21,8 +21,9 @@ import {
21
21
  validateRoots
22
22
  } from "./chunk-VY6BD5KB.js";
23
23
  import {
24
- normalizeQmdResultPath
25
- } from "./chunk-LHBOFROT.js";
24
+ normalizeQmdResultPath,
25
+ resolveNamespaceResultPath
26
+ } from "./chunk-CHNZPOWX.js";
26
27
  import {
27
28
  withholdToolScopedFromSharedNamespace
28
29
  } from "./chunk-S2V7RUCL.js";
@@ -40,9 +41,6 @@ import {
40
41
  import {
41
42
  createMemorySnapshot
42
43
  } from "./chunk-S2HLHAZ4.js";
43
- import {
44
- rotateMarkdownFileToArchive
45
- } from "./chunk-DM2T26WE.js";
46
44
  import {
47
45
  closeContinuityIncidentRecord,
48
46
  createContinuityIncidentRecord,
@@ -52,6 +50,9 @@ import {
52
50
  serializeContinuityIncident,
53
51
  upsertContinuityLoopInMarkdown
54
52
  } from "./chunk-LDXUBPMO.js";
53
+ import {
54
+ rotateMarkdownFileToArchive
55
+ } from "./chunk-DM2T26WE.js";
55
56
  import {
56
57
  parseProvenanceSources,
57
58
  parseProvenanceTag,
@@ -69,7 +70,7 @@ import {
69
70
  invalidationCommitFingerprint,
70
71
  parseTombstoneBlockedOfflineSyncMemory,
71
72
  withCasCommitReceipt
72
- } from "./chunk-YQ6SLFNZ.js";
73
+ } from "./chunk-MPJDQC4G.js";
73
74
  import {
74
75
  matchEntitySchemaSection,
75
76
  normalizeEntityStructuredSection,
@@ -163,12 +164,12 @@ import {
163
164
  import {
164
165
  SPECULATIVE_TTL_DAYS,
165
166
  confidenceTier
166
- } from "./chunk-UFM3PJDT.js";
167
+ } from "./chunk-PARM6OYL.js";
167
168
  import {
168
169
  composeMemoryEnvelope,
169
170
  isSealedMemoryEnvelope,
170
171
  sealedWriteToLegacyArgs
171
- } from "./chunk-TDCR6PQL.js";
172
+ } from "./chunk-TWRPWJJT.js";
172
173
  import {
173
174
  DEFAULT_CITATION_FORMAT,
174
175
  hasCitationForTemplate,
@@ -189,7 +190,7 @@ import {
189
190
  readMemoryActionEventRowsFromLines,
190
191
  readProjectionRebuiltAt,
191
192
  serializeLifecycleAppendPayload
192
- } from "./chunk-UJDTXWMT.js";
193
+ } from "./chunk-QIMGULGN.js";
193
194
  import {
194
195
  assertMemoryFrontmatterId,
195
196
  warnProjectionFallback
@@ -214,7 +215,7 @@ import {
214
215
  CONTENT_HASH_INDEX_RETRY_MAX_DELAY_MS,
215
216
  ContentHashIndex,
216
217
  FactHashIndexNotAuthoritativeError
217
- } from "./chunk-UBN5AOLT.js";
218
+ } from "./chunk-W5EO4USJ.js";
218
219
  import {
219
220
  computeLegacyContentHash
220
221
  } from "./chunk-5FVVY2EB.js";
@@ -257,7 +258,7 @@ import {
257
258
  readMaybeEncryptedFile,
258
259
  readMaybeEncryptedFileBuffer,
259
260
  writeMaybeEncryptedFile
260
- } from "./chunk-TYGLV6ZG.js";
261
+ } from "./chunk-EYGOM6AI.js";
261
262
  import {
262
263
  assertPathInsideRoot,
263
264
  pathIsInside
@@ -283,7 +284,7 @@ import {
283
284
  realpath as realpath3,
284
285
  stat as stat3,
285
286
  writeFile,
286
- mkdir,
287
+ mkdir as mkdir2,
287
288
  unlink as unlink4,
288
289
  appendFile,
289
290
  open
@@ -313,7 +314,7 @@ function parseDriftProvenance(fm) {
313
314
  }
314
315
 
315
316
  // src/storage.ts
316
- import path13 from "path";
317
+ import path14 from "path";
317
318
 
318
319
  // src/storage/tombstone-migration-sources.ts
319
320
  import { statSync } from "fs";
@@ -3100,6 +3101,7 @@ function decodeYamlScalar(value) {
3100
3101
  }
3101
3102
 
3102
3103
  // src/orchestration/qmd-result-resolver.ts
3104
+ import { existsSync } from "fs";
3103
3105
  import path8 from "path";
3104
3106
  var INTERNAL_QMD_ROOTS = /* @__PURE__ */ new Set([
3105
3107
  ...ALL_CATEGORY_DIRS,
@@ -3176,6 +3178,19 @@ function qmdResultPathCandidates(storageDir, resultPath) {
3176
3178
  }
3177
3179
  return [...candidates];
3178
3180
  }
3181
+ function normalizeFlatQmdResults(results, config, collection = config.qmdCollection) {
3182
+ if (!collection || resolveNamespaceCapabilities(config).namespaces || collection !== config.qmdCollection) return results;
3183
+ return results.map((result) => ({
3184
+ ...result,
3185
+ path: withHotFactsPath(config.memoryDir, resolveNamespaceResultPath(config.memoryDir, collection, result.path))
3186
+ }));
3187
+ }
3188
+ function withHotFactsPath(memoryDir, resolved) {
3189
+ const relative2 = path8.relative(path8.resolve(memoryDir), resolved).split(path8.sep).join("/");
3190
+ if (!/^\d{4}-\d{2}-\d{2}\//.test(relative2) || existsSync(resolved)) return resolved;
3191
+ const hot = path8.join(path8.resolve(memoryDir), "facts", relative2);
3192
+ return existsSync(hot) ? hot : resolved;
3193
+ }
3179
3194
  function storageDirOrNull(storage) {
3180
3195
  const dir = storage.dir;
3181
3196
  return typeof dir === "string" && dir.length > 0 ? dir : null;
@@ -5118,6 +5133,20 @@ Reason: ${reason}`;
5118
5133
  }
5119
5134
  }
5120
5135
 
5136
+ // src/storage/dropped-extraction-chunk.ts
5137
+ import { randomUUID } from "crypto";
5138
+ import { mkdir } from "fs/promises";
5139
+ import path13 from "path";
5140
+ async function saveDroppedExtractionChunk(stateDir, writeSecureFile, bufferKey, reason, turns) {
5141
+ const droppedDir = path13.join(stateDir, "dropped");
5142
+ await mkdir(droppedDir, { recursive: true });
5143
+ const safeKey = bufferKey.replace(/[^a-zA-Z0-9._-]/g, "-").slice(0, 80) || "default";
5144
+ const filePath = path13.join(droppedDir, `${Date.now()}-${randomUUID().slice(0, 8)}-${safeKey}.json`);
5145
+ const payload = { bufferKey, reason, droppedAt: (/* @__PURE__ */ new Date()).toISOString(), turns };
5146
+ await writeSecureFile(filePath, JSON.stringify(payload, null, 2));
5147
+ return filePath;
5148
+ }
5149
+
5121
5150
  // src/storage/entity-timeline.ts
5122
5151
  import { createHash as createHash5 } from "crypto";
5123
5152
  var ENTITY_TIMELINE_METADATA_MARKER = "remnic-meta-v1";
@@ -6118,17 +6147,17 @@ function inferEntityTypeFromContent(content) {
6118
6147
  }
6119
6148
  var KNOWN_ENTITY_FILENAME_PREFIXES = /* @__PURE__ */ new Set(["company", "other", "person", "place", "project", "tool", "topic"]);
6120
6149
  function inferEntityTypeFromFilename(pathRel) {
6121
- const basename = path13.basename(pathRel, ".md").toLowerCase();
6150
+ const basename = path14.basename(pathRel, ".md").toLowerCase();
6122
6151
  const separator = basename.indexOf("-");
6123
6152
  if (separator <= 0) return void 0;
6124
6153
  const candidate = basename.slice(0, separator);
6125
6154
  return KNOWN_ENTITY_FILENAME_PREFIXES.has(candidate) ? candidate : void 0;
6126
6155
  }
6127
6156
  function normalizeFrontmatterForPath(frontmatter, pathRel, content = "") {
6128
- const normalizedPath = pathRel.split(path13.sep).join("/");
6157
+ const normalizedPath = pathRel.split(path14.sep).join("/");
6129
6158
  let normalizedFrontmatter = frontmatter;
6130
6159
  if (normalizedPath === "entities" || normalizedPath.startsWith("entities/") || normalizedPath.includes("/entities/")) {
6131
- const basename = path13.basename(pathRel, ".md");
6160
+ const basename = path14.basename(pathRel, ".md");
6132
6161
  const inferredType = inferEntityTypeFromContent(content) || inferEntityTypeFromFilename(pathRel) || "entity";
6133
6162
  const existingTags = Array.isArray(frontmatter.tags) ? frontmatter.tags : [];
6134
6163
  normalizedFrontmatter = {
@@ -6601,9 +6630,9 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6601
6630
  this.entitySchemas = entitySchemas;
6602
6631
  this.deletionRevisionStore = new DeletionRevisionStore({
6603
6632
  baseDir,
6604
- deletionRevisionMetadataPath: path13.join(baseDir, ".offline-sync", "deletion-revisions.v1.json"),
6605
- invalidationCommitMetadataPath: path13.join(baseDir, ".offline-sync", "invalidation-commits.v1.json"),
6606
- deletionRevisionLockPath: path13.join(baseDir, ".offline-sync", "deletion-revisions.v1.json.lock"),
6633
+ deletionRevisionMetadataPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json"),
6634
+ invalidationCommitMetadataPath: path14.join(baseDir, ".offline-sync", "invalidation-commits.v1.json"),
6635
+ deletionRevisionLockPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json.lock"),
6607
6636
  assertManagedStoragePath: (filePath, method) => this.assertManagedStoragePath(filePath, method)
6608
6637
  });
6609
6638
  this.casRevisions = new CasRevisionHost(baseDir);
@@ -6789,8 +6818,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6789
6818
  }
6790
6819
  /** Whether `filePath` resolves to `stateDir` itself or a path contained in it. */
6791
6820
  isStateFilePath(filePath) {
6792
- const rel = path13.relative(this.stateDir, path13.resolve(filePath));
6793
- return rel === "" || !rel.startsWith("..") && !path13.isAbsolute(rel);
6821
+ const rel = path14.relative(this.stateDir, path14.resolve(filePath));
6822
+ return rel === "" || !rel.startsWith("..") && !path14.isAbsolute(rel);
6794
6823
  }
6795
6824
  // ── Tombstone store (issue #1579) ───────────────────────────────────────
6796
6825
  // Instance-scoped (rule 11) + namespace-scoped (rule 42) tombstone index.
@@ -6905,8 +6934,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6905
6934
  * /srv/cold/remnic), skipping the patch and stranding a stale hot entry.
6906
6935
  */
6907
6936
  isColdOrArchiveTierPath(p) {
6908
- const rel = path13.relative(this.baseDir, p);
6909
- return rel === "cold" || rel === "archive" || rel.startsWith(`cold${path13.sep}`) || rel.startsWith(`archive${path13.sep}`);
6937
+ const rel = path14.relative(this.baseDir, p);
6938
+ return rel === "cold" || rel === "archive" || rel.startsWith(`cold${path14.sep}`) || rel.startsWith(`archive${path14.sep}`);
6910
6939
  }
6911
6940
  /**
6912
6941
  * Mark the secure-store as required for this storage instance.
@@ -6993,7 +7022,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6993
7022
  void 0,
6994
7023
  this.baseDir
6995
7024
  );
6996
- const rel = path13.relative(this.baseDir, filePath).split(path13.sep).join("/");
7025
+ const rel = path14.relative(this.baseDir, filePath).split(path14.sep).join("/");
6997
7026
  return `${rel}:${version.versionId}`;
6998
7027
  } catch (err) {
6999
7028
  log.warn(
@@ -7038,10 +7067,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7038
7067
  _StorageManager.okfConformanceByDir.set(memoryDir, enabled !== false);
7039
7068
  }
7040
7069
  okfConformanceEnabled() {
7041
- for (let dir = this.baseDir; ; dir = path13.dirname(dir)) {
7070
+ for (let dir = this.baseDir; ; dir = path14.dirname(dir)) {
7042
7071
  const registered = _StorageManager.okfConformanceByDir.get(dir);
7043
7072
  if (registered !== void 0) return registered;
7044
- if (dir === path13.dirname(dir)) return true;
7073
+ if (dir === path14.dirname(dir)) return true;
7045
7074
  }
7046
7075
  }
7047
7076
  /**
@@ -7085,12 +7114,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7085
7114
  }
7086
7115
  identityFilePath(workspaceDir, namespace) {
7087
7116
  const rawNamespace = typeof namespace === "string" ? namespace.trim() : "";
7088
- if (!rawNamespace) return path13.join(workspaceDir, "IDENTITY.md");
7117
+ if (!rawNamespace) return path14.join(workspaceDir, "IDENTITY.md");
7089
7118
  const safeNamespace = rawNamespace.replace(/[^a-zA-Z0-9._-]/g, "-");
7090
- return path13.join(workspaceDir, `IDENTITY.${safeNamespace}.md`);
7119
+ return path14.join(workspaceDir, `IDENTITY.${safeNamespace}.md`);
7091
7120
  }
7092
7121
  versionFilePath(kind) {
7093
- return path13.join(this.stateDir, `.${kind}-version.log`);
7122
+ return path14.join(this.stateDir, `.${kind}-version.log`);
7094
7123
  }
7095
7124
  bumpSharedVersion(kind, fallbackMap) {
7096
7125
  const filePath = this.versionFilePath(kind);
@@ -7197,7 +7226,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7197
7226
  // memories.
7198
7227
  // -------------------------------------------------------------------------
7199
7228
  get wearablesDir() {
7200
- return path13.join(this.baseDir, WEARABLES_DIR_NAME);
7229
+ return path14.join(this.baseDir, WEARABLES_DIR_NAME);
7201
7230
  }
7202
7231
  /**
7203
7232
  * Resolve the on-disk path for a source/day transcript. Throws on
@@ -7213,7 +7242,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7213
7242
  if (!isValidTranscriptDate(date)) {
7214
7243
  throw new Error(`invalid wearable transcript date '${String(date)}' \u2014 expected YYYY-MM-DD`);
7215
7244
  }
7216
- return path13.join(this.wearablesDir, sourceId, `${date}.md`);
7245
+ return path14.join(this.wearablesDir, sourceId, `${date}.md`);
7217
7246
  }
7218
7247
  async writeWearableDayTranscript(sourceId, date, serialized) {
7219
7248
  const targetPath = this.wearableTranscriptPath(sourceId, date);
@@ -7327,25 +7356,25 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7327
7356
  });
7328
7357
  }
7329
7358
  get factsDir() {
7330
- return path13.join(this.baseDir, "facts");
7359
+ return path14.join(this.baseDir, "facts");
7331
7360
  }
7332
7361
  get correctionsDir() {
7333
- return path13.join(this.baseDir, "corrections");
7362
+ return path14.join(this.baseDir, "corrections");
7334
7363
  }
7335
7364
  get proceduresDir() {
7336
- return path13.join(this.baseDir, "procedures");
7365
+ return path14.join(this.baseDir, "procedures");
7337
7366
  }
7338
7367
  get reasoningTracesDir() {
7339
- return path13.join(this.baseDir, "reasoning-traces");
7368
+ return path14.join(this.baseDir, "reasoning-traces");
7340
7369
  }
7341
7370
  get entitiesDir() {
7342
- return path13.join(this.baseDir, "entities");
7371
+ return path14.join(this.baseDir, "entities");
7343
7372
  }
7344
7373
  resolveEntityFilePath(name) {
7345
7374
  if (typeof name !== "string") return null;
7346
- const filePath = path13.resolve(this.entitiesDir, `${name}.md`);
7347
- const relative2 = path13.relative(this.entitiesDir, filePath);
7348
- if (relative2 === "" || relative2.startsWith("..") || path13.isAbsolute(relative2)) {
7375
+ const filePath = path14.resolve(this.entitiesDir, `${name}.md`);
7376
+ const relative2 = path14.relative(this.entitiesDir, filePath);
7377
+ if (relative2 === "" || relative2.startsWith("..") || path14.isAbsolute(relative2)) {
7349
7378
  return null;
7350
7379
  }
7351
7380
  return filePath;
@@ -7356,7 +7385,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7356
7385
  async readDependencyPropagationQueueFile(filePath) {
7357
7386
  const target = await resolveSafeStoragePath(
7358
7387
  this.baseDir,
7359
- path13.relative(
7388
+ path14.relative(
7360
7389
  this.baseDir,
7361
7390
  this.assertManagedStoragePath(filePath, "storage.readDependencyPropagationQueueFile")
7362
7391
  )
@@ -7366,7 +7395,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7366
7395
  async writeDependencyPropagationQueueFile(filePath, content) {
7367
7396
  const target = await resolveSafeStoragePath(
7368
7397
  this.baseDir,
7369
- path13.relative(
7398
+ path14.relative(
7370
7399
  this.baseDir,
7371
7400
  this.assertManagedStoragePath(filePath, "storage.writeDependencyPropagationQueueFile")
7372
7401
  )
@@ -7381,10 +7410,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7381
7410
  });
7382
7411
  }
7383
7412
  assertManagedStoragePath(filePath, method) {
7384
- const resolved = path13.resolve(filePath);
7385
- const base = path13.resolve(this.baseDir);
7386
- const rel = path13.relative(base, resolved);
7387
- if (rel === "" || rel === ".." || rel.startsWith(`..${path13.sep}`) || path13.isAbsolute(rel)) {
7413
+ const resolved = path14.resolve(filePath);
7414
+ const base = path14.resolve(this.baseDir);
7415
+ const rel = path14.relative(base, resolved);
7416
+ if (rel === "" || rel === ".." || rel.startsWith(`..${path14.sep}`) || path14.isAbsolute(rel)) {
7388
7417
  throw new Error(`${method}: file path escapes memory dir`);
7389
7418
  }
7390
7419
  return resolved;
@@ -7421,7 +7450,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7421
7450
  async digestOfflineSyncFile(filePath) {
7422
7451
  const target = this.assertManagedStoragePath(filePath, "storage.digestOfflineSyncFile");
7423
7452
  const st = await stat3(target);
7424
- const relPath = path13.relative(this.baseDir, target).split(path13.sep).join("/");
7453
+ const relPath = path14.relative(this.baseDir, target).split(path14.sep).join("/");
7425
7454
  const cache = await this.loadOfflineSyncDigestCache();
7426
7455
  const cached = cache.get(relPath);
7427
7456
  if (cached && cached.statBytes === st.size && cached.mtimeMs === st.mtimeMs && cached.ctimeMs === st.ctimeMs && !cached.encrypted) {
@@ -7506,7 +7535,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7506
7535
  const cache = this.offlineSyncDigestCache;
7507
7536
  if (!cache) return;
7508
7537
  const entries = [...cache.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([entryPath, entry]) => ({ path: entryPath, ...entry }));
7509
- await mkdir(path13.dirname(this.offlineSyncDigestCachePath), { recursive: true });
7538
+ await mkdir2(path14.dirname(this.offlineSyncDigestCachePath), { recursive: true });
7510
7539
  await writeFile(this.offlineSyncDigestCachePath, `${JSON.stringify({ version: 1, entries })}
7511
7540
  `, "utf-8");
7512
7541
  }).catch((err) => {
@@ -7607,7 +7636,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7607
7636
  }
7608
7637
  async appendStorageSecureFileUnlocked(filePath, content) {
7609
7638
  const writeKey = this.resolveWriteKey();
7610
- await mkdir(path13.dirname(filePath), { recursive: true });
7639
+ await mkdir2(path14.dirname(filePath), { recursive: true });
7611
7640
  if (writeKey === null) {
7612
7641
  try {
7613
7642
  if (await this.isEncryptedFileHeader(filePath)) {
@@ -7633,13 +7662,13 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7633
7662
  this.notifyCatalogWriteForPath(filePath);
7634
7663
  }
7635
7664
  get stateDir() {
7636
- return path13.join(this.baseDir, "state");
7665
+ return path14.join(this.baseDir, "state");
7637
7666
  }
7638
7667
  get offlineSyncDigestCachePath() {
7639
- return path13.join(this.baseDir, ".offline-sync", "digest-cache.v1.json");
7668
+ return path14.join(this.baseDir, ".offline-sync", "digest-cache.v1.json");
7640
7669
  }
7641
7670
  get entitySynthesisQueuePath() {
7642
- return path13.join(this.stateDir, "entity-synthesis-queue.json");
7671
+ return path14.join(this.stateDir, "entity-synthesis-queue.json");
7643
7672
  }
7644
7673
  // ── Tombstone store access (issue #1579) ─────────────────────────────────
7645
7674
  /**
@@ -7649,7 +7678,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7649
7678
  * helpers are injected into the store).
7650
7679
  */
7651
7680
  get tombstonesPath() {
7652
- return path13.join(this.stateDir, "tombstones.jsonl");
7681
+ return path14.join(this.stateDir, "tombstones.jsonl");
7653
7682
  }
7654
7683
  /**
7655
7684
  * Configure the tombstone invariant for this storage instance. Installed
@@ -7962,55 +7991,55 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7962
7991
  return legacyMatches.length > 0 ? [...new Set(legacyMatches.map((content) => ContentHashIndex.computeHash(content)))] : [persistedHash];
7963
7992
  }
7964
7993
  get questionsDir() {
7965
- return path13.join(this.baseDir, "questions");
7994
+ return path14.join(this.baseDir, "questions");
7966
7995
  }
7967
7996
  get artifactsDir() {
7968
- return path13.join(this.baseDir, "artifacts");
7997
+ return path14.join(this.baseDir, "artifacts");
7969
7998
  }
7970
7999
  get identityDir() {
7971
- return path13.join(this.baseDir, "identity");
8000
+ return path14.join(this.baseDir, "identity");
7972
8001
  }
7973
8002
  get identityAnchorPath() {
7974
- return path13.join(this.identityDir, "identity-anchor.md");
8003
+ return path14.join(this.identityDir, "identity-anchor.md");
7975
8004
  }
7976
8005
  get identityIncidentsDir() {
7977
- return path13.join(this.identityDir, "incidents");
8006
+ return path14.join(this.identityDir, "incidents");
7978
8007
  }
7979
8008
  get identityAuditsWeeklyDir() {
7980
- return path13.join(this.identityDir, "audits", "weekly");
8009
+ return path14.join(this.identityDir, "audits", "weekly");
7981
8010
  }
7982
8011
  get identityAuditsMonthlyDir() {
7983
- return path13.join(this.identityDir, "audits", "monthly");
8012
+ return path14.join(this.identityDir, "audits", "monthly");
7984
8013
  }
7985
8014
  get identityImprovementLoopsPath() {
7986
- return path13.join(this.identityDir, "improvement-loops.md");
8015
+ return path14.join(this.identityDir, "improvement-loops.md");
7987
8016
  }
7988
8017
  get identityReflectionsPath() {
7989
- return path13.join(this.identityDir, "reflections.md");
8018
+ return path14.join(this.identityDir, "reflections.md");
7990
8019
  }
7991
8020
  get profilePath() {
7992
- return path13.join(this.baseDir, "profile.md");
8021
+ return path14.join(this.baseDir, "profile.md");
7993
8022
  }
7994
8023
  get memoryActionsPath() {
7995
- return path13.join(this.stateDir, "memory-actions.jsonl");
8024
+ return path14.join(this.stateDir, "memory-actions.jsonl");
7996
8025
  }
7997
8026
  get memoryLifecycleLedgerPath() {
7998
- return path13.join(this.stateDir, "memory-lifecycle-ledger.jsonl");
8027
+ return path14.join(this.stateDir, "memory-lifecycle-ledger.jsonl");
7999
8028
  }
8000
8029
  get compressionGuidelinesPath() {
8001
- return path13.join(this.stateDir, "compression-guidelines.md");
8030
+ return path14.join(this.stateDir, "compression-guidelines.md");
8002
8031
  }
8003
8032
  get compressionGuidelineDraftPath() {
8004
- return path13.join(this.stateDir, "compression-guidelines.draft.md");
8033
+ return path14.join(this.stateDir, "compression-guidelines.draft.md");
8005
8034
  }
8006
8035
  get compressionGuidelineStatePath() {
8007
- return path13.join(this.stateDir, "compression-guideline-state.json");
8036
+ return path14.join(this.stateDir, "compression-guideline-state.json");
8008
8037
  }
8009
8038
  get compressionGuidelineDraftStatePath() {
8010
- return path13.join(this.stateDir, "compression-guideline-draft-state.json");
8039
+ return path14.join(this.stateDir, "compression-guideline-draft-state.json");
8011
8040
  }
8012
8041
  get behaviorSignalsPath() {
8013
- return path13.join(this.stateDir, "behavior-signals.jsonl");
8042
+ return path14.join(this.stateDir, "behavior-signals.jsonl");
8014
8043
  }
8015
8044
  /**
8016
8045
  * In-memory dedup key set for behavior-signals appends (issue #1909),
@@ -8042,7 +8071,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8042
8071
  * governance sweeps can treat it uniformly.
8043
8072
  */
8044
8073
  get bufferSurpriseLedgerPath() {
8045
- return path13.join(this.stateDir, "buffer-surprise-ledger.jsonl");
8074
+ return path14.join(this.stateDir, "buffer-surprise-ledger.jsonl");
8046
8075
  }
8047
8076
  /**
8048
8077
  * Entity alias table loaded from THIS store's config/aliases.json.
@@ -8105,7 +8134,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8105
8134
  this.loadAliasesSync();
8106
8135
  }
8107
8136
  loadAliasesSync() {
8108
- const aliasPath = path13.join(this.baseDir, "config", "aliases.json");
8137
+ const aliasPath = path14.join(this.baseDir, "config", "aliases.json");
8109
8138
  this.userAliases = {};
8110
8139
  const raw = readEntityAliasConfigSync(this.baseDir);
8111
8140
  if (raw === void 0) return;
@@ -8140,22 +8169,22 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8140
8169
  return completionFingerprint;
8141
8170
  }
8142
8171
  async ensureDirectories(options = {}) {
8143
- await mkdir(this.baseDir, { recursive: true });
8172
+ await mkdir2(this.baseDir, { recursive: true });
8144
8173
  await validateRoots(this.baseDir, this.entitiesDir, this.stateDir, this.archiveDir);
8145
8174
  const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
8146
- await mkdir(path13.join(this.factsDir, today), { recursive: true });
8147
- await mkdir(path13.join(this.proceduresDir, today), { recursive: true });
8148
- await mkdir(path13.join(this.reasoningTracesDir, today), { recursive: true });
8149
- await mkdir(this.correctionsDir, { recursive: true });
8150
- await mkdir(this.entitiesDir, { recursive: true });
8151
- await mkdir(this.stateDir, { recursive: true });
8152
- await mkdir(this.questionsDir, { recursive: true });
8153
- await mkdir(this.artifactsDir, { recursive: true });
8154
- await mkdir(this.identityDir, { recursive: true });
8155
- await mkdir(this.identityIncidentsDir, { recursive: true });
8156
- await mkdir(this.identityAuditsWeeklyDir, { recursive: true });
8157
- await mkdir(this.identityAuditsMonthlyDir, { recursive: true });
8158
- await mkdir(path13.join(this.baseDir, "config"), { recursive: true });
8175
+ await mkdir2(path14.join(this.factsDir, today), { recursive: true });
8176
+ await mkdir2(path14.join(this.proceduresDir, today), { recursive: true });
8177
+ await mkdir2(path14.join(this.reasoningTracesDir, today), { recursive: true });
8178
+ await mkdir2(this.correctionsDir, { recursive: true });
8179
+ await mkdir2(this.entitiesDir, { recursive: true });
8180
+ await mkdir2(this.stateDir, { recursive: true });
8181
+ await mkdir2(this.questionsDir, { recursive: true });
8182
+ await mkdir2(this.artifactsDir, { recursive: true });
8183
+ await mkdir2(this.identityDir, { recursive: true });
8184
+ await mkdir2(this.identityIncidentsDir, { recursive: true });
8185
+ await mkdir2(this.identityAuditsWeeklyDir, { recursive: true });
8186
+ await mkdir2(this.identityAuditsMonthlyDir, { recursive: true });
8187
+ await mkdir2(path14.join(this.baseDir, "config"), { recursive: true });
8159
8188
  await this.entityCanonicalIdMigration.begin(options.waitForEntityMigration !== false, this.entitiesDir);
8160
8189
  if (this.hotMemoriesCacheEnabled && this.getMemoryCorpusVersion() === 0) {
8161
8190
  this.bumpMemoryCorpusVersion();
@@ -8177,12 +8206,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8177
8206
  */
8178
8207
  async resolveCategoryWritePath(category, id, today) {
8179
8208
  if (category === "correction") {
8180
- await mkdir(this.correctionsDir, { recursive: true });
8181
- return path13.join(this.correctionsDir, `${id}.md`);
8209
+ await mkdir2(this.correctionsDir, { recursive: true });
8210
+ return path14.join(this.correctionsDir, `${id}.md`);
8182
8211
  }
8183
- const datedDir = path13.join(getCategoryDir(this.baseDir, category), today);
8184
- await mkdir(datedDir, { recursive: true });
8185
- return path13.join(datedDir, `${id}.md`);
8212
+ const datedDir = path14.join(getCategoryDir(this.baseDir, category), today);
8213
+ await mkdir2(datedDir, { recursive: true });
8214
+ return path14.join(datedDir, `${id}.md`);
8186
8215
  }
8187
8216
  async findExistingTombstoneBlockedMemory(content, category, sourceConnector) {
8188
8217
  const identity = buildExplicitCaptureDedupKey(content, category, sourceConnector);
@@ -8561,8 +8590,8 @@ ${sanitized.text}
8561
8590
  await this.ensureDirectories();
8562
8591
  const now = /* @__PURE__ */ new Date();
8563
8592
  const day = now.toISOString().slice(0, 10);
8564
- const dir = path13.join(this.artifactsDir, day);
8565
- await mkdir(dir, { recursive: true });
8593
+ const dir = path14.join(this.artifactsDir, day);
8594
+ await mkdir2(dir, { recursive: true });
8566
8595
  const id = `artifact-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
8567
8596
  const fm = {
8568
8597
  id,
@@ -8588,7 +8617,7 @@ ${sanitized.text}
8588
8617
  log.warn(`artifact content rejected for ${id}; violations=${sanitized.violations.join(", ")}`);
8589
8618
  return "";
8590
8619
  }
8591
- const filePath = path13.join(dir, `${id}.md`);
8620
+ const filePath = path14.join(dir, `${id}.md`);
8592
8621
  await this.writeStorageSecureFile(filePath, `${serializeFrontmatter(this.withOkfType(fm))}
8593
8622
 
8594
8623
  ${sanitized.text}
@@ -8882,7 +8911,7 @@ ${sanitized.text}
8882
8911
  * per-process in-memory cache safe across process boundaries.
8883
8912
  */
8884
8913
  invalidateColdMemoriesCache() {
8885
- const coldRoot = path13.join(this.baseDir, "cold");
8914
+ const coldRoot = path14.join(this.baseDir, "cold");
8886
8915
  _StorageManager.coldMemoriesCache.delete(coldRoot);
8887
8916
  this.bumpColdWriteVersion();
8888
8917
  invalidateAllForDir(this.baseDir);
@@ -9000,7 +9029,7 @@ ${sanitized.text}
9000
9029
  const correctionPaths = [];
9001
9030
  const factPaths = [];
9002
9031
  for (const filePath of filePaths) {
9003
- if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${path13.sep}`)) {
9032
+ if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${path14.sep}`)) {
9004
9033
  correctionPaths.push(filePath);
9005
9034
  } else {
9006
9035
  factPaths.push(filePath);
@@ -9066,7 +9095,7 @@ ${sanitized.text}
9066
9095
  const entries = (await readdir6(dir, { withFileTypes: true })).filter((e) => !isMacOsReplicationJunkBasename(e.name));
9067
9096
  for (const entry of entries) {
9068
9097
  checkCorpusReadAbort(options);
9069
- const fullPath = path13.join(dir, entry.name);
9098
+ const fullPath = path14.join(dir, entry.name);
9070
9099
  if (entry.isDirectory()) {
9071
9100
  await readDir(fullPath);
9072
9101
  } else if (entry.name.endsWith(".md")) {
@@ -9106,7 +9135,7 @@ ${sanitized.text}
9106
9135
  return this.rememberMemorySnapshot(await this.memoryReadStore.readMemoryByPath(filePath));
9107
9136
  }
9108
9137
  resolveTierRootDir(tier) {
9109
- return tier === "cold" ? path13.join(this.baseDir, "cold") : this.baseDir;
9138
+ return tier === "cold" ? path14.join(this.baseDir, "cold") : this.baseDir;
9110
9139
  }
9111
9140
  resolveMemoryDateDir(memory) {
9112
9141
  const preferred = memory.frontmatter.created || memory.frontmatter.updated;
@@ -9121,13 +9150,13 @@ ${sanitized.text}
9121
9150
  buildTierMemoryPath(memory, tier) {
9122
9151
  const root = this.resolveTierRootDir(tier);
9123
9152
  if (this.isArtifactMemory(memory)) {
9124
- return path13.join(root, "artifacts", this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9153
+ return path14.join(root, "artifacts", this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9125
9154
  }
9126
9155
  if (memory.frontmatter.category === "correction") {
9127
- return path13.join(root, "corrections", `${memory.frontmatter.id}.md`);
9156
+ return path14.join(root, "corrections", `${memory.frontmatter.id}.md`);
9128
9157
  }
9129
9158
  const dir = categoryDirName(memory.frontmatter.category);
9130
- return path13.join(root, dir, this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9159
+ return path14.join(root, dir, this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9131
9160
  }
9132
9161
  async writeMemoryFileAtomic(targetPath, memory) {
9133
9162
  assertNotOkfReservedBasename(targetPath);
@@ -9206,8 +9235,8 @@ ${memory.content}
9206
9235
  memory.frontmatter.entityRef = current.frontmatter.entityRef;
9207
9236
  }
9208
9237
  durable = true;
9209
- const sourcePath = path13.resolve(current.path);
9210
- const destPath = path13.resolve(targetPath);
9238
+ const sourcePath = path14.resolve(current.path);
9239
+ const destPath = path14.resolve(targetPath);
9211
9240
  if (sourcePath !== destPath) {
9212
9241
  await recordArchiveDelete2(this.baseDir, current.path, () => this.deleteManagedStorageFile(current.path));
9213
9242
  this.invalidateAllMemoriesCache();
@@ -9231,8 +9260,8 @@ ${memory.content}
9231
9260
  }
9232
9261
  async migrateMemoryToTier(memory, targetTier) {
9233
9262
  const targetPath = this.buildTierMemoryPath(memory, targetTier);
9234
- const sourcePath = path13.resolve(memory.path);
9235
- const destPath = path13.resolve(targetPath);
9263
+ const sourcePath = path14.resolve(memory.path);
9264
+ const destPath = path14.resolve(targetPath);
9236
9265
  if (sourcePath === destPath) {
9237
9266
  return { changed: false, targetPath };
9238
9267
  }
@@ -9242,7 +9271,7 @@ ${memory.content}
9242
9271
  return { changed, targetPath };
9243
9272
  }
9244
9273
  get archiveDir() {
9245
- return path13.join(this.baseDir, "archive");
9274
+ return path14.join(this.baseDir, "archive");
9246
9275
  }
9247
9276
  /**
9248
9277
  * Archive a memory by moving it from facts/ to archive/YYYY-MM-DD/.
@@ -9255,8 +9284,8 @@ ${memory.content}
9255
9284
  try {
9256
9285
  const now = lifecycle?.at ?? /* @__PURE__ */ new Date();
9257
9286
  const today = now.toISOString().slice(0, 10);
9258
- const destDir = path13.join(this.archiveDir, today);
9259
- await mkdir(destDir, { recursive: true });
9287
+ const destDir = path14.join(this.archiveDir, today);
9288
+ await mkdir2(destDir, { recursive: true });
9260
9289
  const refIdsAtWrite = this.currentHistoricalIds();
9261
9290
  const updatedFm = canonicalizeEntityRefOption(
9262
9291
  {
@@ -9271,7 +9300,7 @@ ${memory.content}
9271
9300
 
9272
9301
  ${current.content}
9273
9302
  `;
9274
- const destPath = path13.join(destDir, path13.basename(current.path));
9303
+ const destPath = path14.join(destDir, path14.basename(current.path));
9275
9304
  const priorDest = await this.readStorageSecureFile(destPath).catch(() => null);
9276
9305
  await recordArchiveWrite(this.baseDir, destPath, () => this.writeStorageSecureFile(destPath, fileContent));
9277
9306
  if (typeof current.frontmatter.entityRef === "string") {
@@ -9505,7 +9534,7 @@ ${memory.content}
9505
9534
  `;
9506
9535
  await this.writeTombstoneBlockedFrontmatter(memory, fileContent, updated, async () => {
9507
9536
  this.invalidateAllMemoriesCache();
9508
- if (memory.path.includes(`${path13.sep}cold${path13.sep}`)) {
9537
+ if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
9509
9538
  this.invalidateColdMemoriesCache();
9510
9539
  }
9511
9540
  });
@@ -9517,7 +9546,7 @@ ${memory.content}
9517
9546
  }
9518
9547
  if (mentionReentry && !entityMentionEpoch.neutral(memory.frontmatter, updated)) entityMentionEpoch.bump(this.baseDir);
9519
9548
  await this.patchHotMemoriesCache({ addedPath: memory.path });
9520
- if (memory.path.includes(`${path13.sep}cold${path13.sep}`)) {
9549
+ if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
9521
9550
  this.invalidateColdMemoriesCache();
9522
9551
  }
9523
9552
  try {
@@ -9615,8 +9644,11 @@ ${memory.content}
9615
9644
  async deleteBufferSession(key) {
9616
9645
  await this.bufferSessionFiles().remove(key);
9617
9646
  }
9647
+ saveDroppedExtractionChunk(bufferKey, reason, turns) {
9648
+ return saveDroppedExtractionChunk(this.stateDir, (file, content) => this.writeStorageSecureFile(file, content), bufferKey, reason, turns);
9649
+ }
9618
9650
  async loadMeta() {
9619
- const metaPath = path13.join(this.stateDir, "meta.json");
9651
+ const metaPath = path14.join(this.stateDir, "meta.json");
9620
9652
  try {
9621
9653
  const raw = await this.readStorageSecureFile(metaPath);
9622
9654
  const parsed = JSON.parse(raw);
@@ -9649,8 +9681,7 @@ ${memory.content}
9649
9681
  }
9650
9682
  async saveMeta(state) {
9651
9683
  await this.ensureDirectories();
9652
- const metaPath = path13.join(this.stateDir, "meta.json");
9653
- await this.writeStorageSecureFile(metaPath, JSON.stringify(state, null, 2));
9684
+ await this.writeStorageSecureFile(path14.join(this.stateDir, "meta.json"), JSON.stringify(state, null, 2));
9654
9685
  }
9655
9686
  async appendMemoryActionEvents(events) {
9656
9687
  if (events.length === 0) return 0;
@@ -9719,7 +9750,7 @@ ${memory.content}
9719
9750
  },
9720
9751
  (payload) => this.appendStorageSecureFile(target, payload),
9721
9752
  async () => {
9722
- await mkdir(path13.dirname(target), { recursive: true });
9753
+ await mkdir2(path14.dirname(target), { recursive: true });
9723
9754
  }
9724
9755
  );
9725
9756
  }
@@ -9817,7 +9848,7 @@ ${memory.content}
9817
9848
  async appendReextractJobs(events) {
9818
9849
  if (events.length === 0) return 0;
9819
9850
  await this.ensureDirectories();
9820
- const filePath = path13.join(this.stateDir, "reextract-jobs.jsonl");
9851
+ const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
9821
9852
  const lines = events.map((event) => JSON.stringify(event)).join("\n") + "\n";
9822
9853
  try {
9823
9854
  await this.appendStorageSecureFile(filePath, lines);
@@ -9830,7 +9861,7 @@ ${memory.content}
9830
9861
  }
9831
9862
  async readReextractJobs(limit = 200) {
9832
9863
  const safeLimit = Number.isFinite(limit) ? Math.max(1, Math.min(1e3, Math.floor(limit))) : 200;
9833
- const filePath = path13.join(this.stateDir, "reextract-jobs.jsonl");
9864
+ const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
9834
9865
  try {
9835
9866
  const raw = await this.readStorageSecureFile(filePath);
9836
9867
  const lines = raw.split("\n").filter((line) => line.trim().length > 0);
@@ -10048,7 +10079,7 @@ ${memory.content}
10048
10079
  return `${prefix}-${ts}-${rand}`;
10049
10080
  }
10050
10081
  async writeQuestion(question, context, priority) {
10051
- await mkdir(this.questionsDir, { recursive: true });
10082
+ await mkdir2(this.questionsDir, { recursive: true });
10052
10083
  const id = this.generateId("q");
10053
10084
  const frontmatter = {
10054
10085
  id,
@@ -10065,7 +10096,7 @@ ${question}
10065
10096
 
10066
10097
  **Context:** ${context}
10067
10098
  `;
10068
- const filePath = path13.join(this.questionsDir, `${id}.md`);
10099
+ const filePath = path14.join(this.questionsDir, `${id}.md`);
10069
10100
  await this.writeStorageSecureFile(filePath, content);
10070
10101
  log.debug(`wrote question ${id} to ${filePath}`);
10071
10102
  this.invalidateQuestionsCache();
@@ -10124,11 +10155,11 @@ ${question}
10124
10155
  } catch {
10125
10156
  }
10126
10157
  const hygiene = opts?.hygiene;
10127
- const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(path13.basename(identityPath));
10158
+ const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(path14.basename(identityPath));
10128
10159
  if (rotateEnabled) {
10129
10160
  const maxBytes = hygiene.rotateMaxBytes;
10130
10161
  if (existing.length > maxBytes) {
10131
- const archiveDir = path13.join(workspaceDir, hygiene.archiveDir);
10162
+ const archiveDir = path14.join(workspaceDir, hygiene.archiveDir);
10132
10163
  const { newContent } = await rotateMarkdownFileToArchive({
10133
10164
  filePath: identityPath,
10134
10165
  archiveDir,
@@ -10180,7 +10211,7 @@ ${reflection}
10180
10211
  }
10181
10212
  }
10182
10213
  async writeIdentityReflections(content) {
10183
- await mkdir(this.identityDir, { recursive: true });
10214
+ await mkdir2(this.identityDir, { recursive: true });
10184
10215
  await this.writeStorageSecureFile(this.identityReflectionsPath, content);
10185
10216
  }
10186
10217
  async appendIdentityReflection(reflection) {
@@ -10212,7 +10243,7 @@ ${reflection}
10212
10243
 
10213
10244
  ${reflection}
10214
10245
  `;
10215
- await mkdir(this.identityDir, { recursive: true });
10246
+ await mkdir2(this.identityDir, { recursive: true });
10216
10247
  await this.writeStorageSecureFile(this.identityReflectionsPath, `${existing.trimEnd()}${section}`);
10217
10248
  log.debug(`appended namespace-local reflection to ${this.identityReflectionsPath}`);
10218
10249
  }
@@ -10268,7 +10299,7 @@ ${reflection}
10268
10299
  const rightTs = latestEntityTimelineTimestamp(right.entity) ?? "";
10269
10300
  return compareEntityTimestamps(rightTs, leftTs);
10270
10301
  }).map(({ entityName }) => entityName);
10271
- await mkdir(this.stateDir, { recursive: true });
10302
+ await mkdir2(this.stateDir, { recursive: true });
10272
10303
  await this.writeStorageSecureFile(
10273
10304
  this.entitySynthesisQueuePath,
10274
10305
  JSON.stringify(
@@ -10288,7 +10319,7 @@ ${reflection}
10288
10319
  if (queue.length === 0) return;
10289
10320
  const removals = new Set(entityNames);
10290
10321
  const nextQueue = queue.filter((name) => !removals.has(name));
10291
- await mkdir(this.stateDir, { recursive: true });
10322
+ await mkdir2(this.stateDir, { recursive: true });
10292
10323
  await this.writeStorageSecureFile(
10293
10324
  this.entitySynthesisQueuePath,
10294
10325
  JSON.stringify(
@@ -10388,7 +10419,7 @@ ${reflection}
10388
10419
  if (entries.length === 0) return 0;
10389
10420
  const memories = await this.readAllMemories();
10390
10421
  const memoryMap = new Map(memories.map((m) => [m.frontmatter.id, m]));
10391
- const memoryPathMap = new Map(memories.map((m) => [path13.resolve(m.path), m]));
10422
+ const memoryPathMap = new Map(memories.map((m) => [path14.resolve(m.path), m]));
10392
10423
  let updated = 0;
10393
10424
  const prevVersion = this.getMemoryCorpusVersion();
10394
10425
  let entityRefMoved = false;
@@ -10396,7 +10427,7 @@ ${reflection}
10396
10427
  const warm = this.hotMemoriesCacheEnabled && getCachedMemories(this.baseDir, prevVersion, keyId, this.hotCacheTtlMs()) !== null;
10397
10428
  const appliedPatches = /* @__PURE__ */ new Map();
10398
10429
  for (const entry of entries) {
10399
- const memory = entry.memoryPath ? memoryPathMap.get(path13.resolve(entry.memoryPath)) : memoryMap.get(entry.memoryId);
10430
+ const memory = entry.memoryPath ? memoryPathMap.get(path14.resolve(entry.memoryPath)) : memoryMap.get(entry.memoryId);
10400
10431
  if (!memory) continue;
10401
10432
  try {
10402
10433
  const applied = await this.withTombstoneBlockedMemoryPathLock(memory.path, async (current) => {
@@ -10428,7 +10459,7 @@ ${current.content}
10428
10459
  if (warm) {
10429
10460
  updateCacheOnWrite(this.baseDir, { ...applied.current, frontmatter: applied.newFm }, keyId);
10430
10461
  }
10431
- appliedPatches.set(path13.resolve(memory.path), {
10462
+ appliedPatches.set(path14.resolve(memory.path), {
10432
10463
  accessCount: entry.newCount,
10433
10464
  lastAccessed: entry.lastAccessed
10434
10465
  });
@@ -10446,7 +10477,7 @@ ${current.content}
10446
10477
  const cur = getCachedMemories(this.baseDir, prevVersion, keyId);
10447
10478
  if (cur) {
10448
10479
  const reapplied = cur.map((m) => {
10449
- const patch = appliedPatches.get(path13.resolve(m.path));
10480
+ const patch = appliedPatches.get(path14.resolve(m.path));
10450
10481
  return patch ? {
10451
10482
  ...m,
10452
10483
  frontmatter: { ...m.frontmatter, accessCount: patch.accessCount, lastAccessed: patch.lastAccessed }
@@ -10476,7 +10507,7 @@ ${current.content}
10476
10507
  const pathsById = /* @__PURE__ */ new Map();
10477
10508
  const filePathsById = /* @__PURE__ */ new Map();
10478
10509
  for (const filePath of filePaths) {
10479
- const memoryId = path13.basename(filePath, ".md");
10510
+ const memoryId = path14.basename(filePath, ".md");
10480
10511
  if (!wantedIds.has(memoryId)) continue;
10481
10512
  const paths = filePathsById.get(memoryId) ?? [];
10482
10513
  paths.push(filePath);
@@ -10488,7 +10519,7 @@ ${current.content}
10488
10519
  const preferredMatches = [];
10489
10520
  for (const preferredPath of preferred) {
10490
10521
  const directCandidates = new Set(qmdResultPathCandidates(this.baseDir, preferredPath));
10491
- const directMatch = existingPaths.find((filePath) => directCandidates.has(path13.resolve(filePath)));
10522
+ const directMatch = existingPaths.find((filePath) => directCandidates.has(path14.resolve(filePath)));
10492
10523
  if (directMatch) {
10493
10524
  preferredMatches.push(directMatch);
10494
10525
  continue;
@@ -10500,7 +10531,7 @@ ${current.content}
10500
10531
  candidates.add(candidate);
10501
10532
  }
10502
10533
  }
10503
- const match = existingPaths.find((filePath) => candidates.has(path13.resolve(filePath)));
10534
+ const match = existingPaths.find((filePath) => candidates.has(path14.resolve(filePath)));
10504
10535
  if (match) preferredMatches.push(match);
10505
10536
  }
10506
10537
  if (preferredMatches.length > 0) {
@@ -10822,11 +10853,11 @@ ${current.content}
10822
10853
  }
10823
10854
  }
10824
10855
  get summariesDir() {
10825
- return path13.join(this.baseDir, "summaries");
10856
+ return path14.join(this.baseDir, "summaries");
10826
10857
  }
10827
10858
  async writeSummary(summary) {
10828
- await mkdir(this.summariesDir, { recursive: true });
10829
- const filePath = path13.join(this.summariesDir, `${summary.id}.json`);
10859
+ await mkdir2(this.summariesDir, { recursive: true });
10860
+ const filePath = path14.join(this.summariesDir, `${summary.id}.json`);
10830
10861
  await this.writeStorageSecureFile(filePath, JSON.stringify(summary, null, 2));
10831
10862
  log.debug(`wrote summary ${summary.id}`);
10832
10863
  }
@@ -10836,7 +10867,7 @@ ${current.content}
10836
10867
  const summaries = [];
10837
10868
  for (const file of files) {
10838
10869
  if (isMacOsReplicationJunkBasename(file) || !file.endsWith(".json")) continue;
10839
- const filePath = path13.join(this.summariesDir, file);
10870
+ const filePath = path14.join(this.summariesDir, file);
10840
10871
  const raw = await this.readStorageSecureFile(filePath);
10841
10872
  summaries.push(JSON.parse(raw));
10842
10873
  }
@@ -10906,16 +10937,13 @@ ${current.content}
10906
10937
  return archived;
10907
10938
  }
10908
10939
  async saveTopics(topics) {
10909
- const metaPath = path13.join(this.stateDir, "topics.json");
10910
- await mkdir(this.stateDir, { recursive: true });
10911
- await this.writeStorageSecureFile(
10912
- metaPath,
10913
- JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)
10914
- );
10940
+ const metaPath = path14.join(this.stateDir, "topics.json");
10941
+ await mkdir2(this.stateDir, { recursive: true });
10942
+ await this.writeStorageSecureFile(metaPath, JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2));
10915
10943
  log.debug(`saved ${topics.length} topic scores`);
10916
10944
  }
10917
10945
  async loadTopics() {
10918
- const metaPath = path13.join(this.stateDir, "topics.json");
10946
+ const metaPath = path14.join(this.stateDir, "topics.json");
10919
10947
  try {
10920
10948
  const raw = await this.readStorageSecureFile(metaPath);
10921
10949
  return JSON.parse(raw);
@@ -10996,6 +11024,7 @@ export {
10996
11024
  selfDeps,
10997
11025
  qmdCollectionPathParts,
10998
11026
  qmdResultPathCandidates,
11027
+ normalizeFlatQmdResults,
10999
11028
  QmdResultResolver,
11000
11029
  DEFAULT_PROXIMITY_GAP_MS,
11001
11030
  clusterConversations,
@@ -11034,4 +11063,4 @@ export {
11034
11063
  isValidBufferSurpriseEvent,
11035
11064
  StorageManager3 as StorageManager
11036
11065
  };
11037
- //# sourceMappingURL=chunk-WCBLPKG3.js.map
11066
+ //# sourceMappingURL=chunk-BIYVUPC6.js.map