@remnic/core 10.0.13 → 10.0.15

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 (614) hide show
  1. package/dist/abstraction-nodes.js +3 -2
  2. package/dist/access-admin-ops-surface.js +96 -92
  3. package/dist/access-authorization-probe.js +97 -93
  4. package/dist/access-boundary.js +96 -92
  5. package/dist/access-cli.js +203 -198
  6. package/dist/access-cli.js.map +1 -1
  7. package/dist/access-extraction-force-flush.js +96 -92
  8. package/dist/access-http-briefing.js +97 -93
  9. package/dist/access-http-query.js +98 -94
  10. package/dist/access-http.js +121 -117
  11. package/dist/access-idempotency.js +3 -2
  12. package/dist/access-identity-continuity-surface.js +96 -92
  13. package/dist/access-lcm-surface.js +96 -92
  14. package/dist/access-mcp.js +110 -106
  15. package/dist/access-namespace-preflight.js +96 -92
  16. package/dist/access-observe-write-category.js +18 -17
  17. package/dist/access-observe-write-surface.js +96 -92
  18. package/dist/access-offline-manifest.js +17 -15
  19. package/dist/access-operations-batch.js +101 -97
  20. package/dist/access-operations.js +108 -104
  21. package/dist/access-recall-concurrency.js +96 -92
  22. package/dist/access-recall-diagnostics.js +2 -2
  23. package/dist/access-recall-response.js +96 -92
  24. package/dist/access-recall-surface.js +96 -92
  25. package/dist/access-schema.d.ts +2 -2
  26. package/dist/access-schema.js +13 -12
  27. package/dist/access-service.js +96 -92
  28. package/dist/access-surface-catalog.js +98 -94
  29. package/dist/access-surface-catalog.js.map +1 -1
  30. package/dist/active-recall.js +43 -39
  31. package/dist/active-recall.js.map +1 -1
  32. package/dist/adapters/index.js +4 -4
  33. package/dist/adapters/registry.js +2 -2
  34. package/dist/{auto-sync-DGJOZYGT.js → auto-sync-7WWAKW6F.js} +8 -8
  35. package/dist/briefing.js +32 -28
  36. package/dist/buffer.js +13 -13
  37. package/dist/calibration.d.ts.map +1 -1
  38. package/dist/calibration.js +6 -3
  39. package/dist/calibration.js.map +1 -1
  40. package/dist/{capsule-merge-M4HETD27.js → capsule-merge-LGYURS3C.js} +6 -5
  41. package/dist/{capsule-merge-M4HETD27.js.map → capsule-merge-LGYURS3C.js.map} +1 -1
  42. package/dist/capture-write-lock-backoff.d.ts +50 -0
  43. package/dist/capture-write-lock-backoff.d.ts.map +1 -0
  44. package/dist/capture-write-lock-backoff.js +30 -0
  45. package/dist/capture-write-lock.d.ts +6 -0
  46. package/dist/capture-write-lock.d.ts.map +1 -0
  47. package/dist/capture-write-lock.js +15 -0
  48. package/dist/causal-behavior.js +4 -3
  49. package/dist/causal-behavior.js.map +1 -1
  50. package/dist/causal-chain.js +4 -3
  51. package/dist/causal-consolidation.js +36 -32
  52. package/dist/causal-consolidation.js.map +1 -1
  53. package/dist/causal-retrieval.js +4 -3
  54. package/dist/causal-retrieval.js.map +1 -1
  55. package/dist/causal-trajectory-graph.js +7 -6
  56. package/dist/causal-trajectory-graph.js.map +1 -1
  57. package/dist/causal-trajectory.js +3 -2
  58. package/dist/{chunk-KZO43HPY.js → chunk-22RM2ZUJ.js} +112 -112
  59. package/dist/{chunk-ZUMXY4KA.js → chunk-22W2XWGH.js} +3 -3
  60. package/dist/{chunk-MZBWIJJN.js → chunk-23ZQPP2G.js} +24 -19
  61. package/dist/chunk-23ZQPP2G.js.map +1 -0
  62. package/dist/{chunk-PCWXLAJY.js → chunk-2PTH4PRL.js} +2 -2
  63. package/dist/{chunk-ZIZ2G47N.js → chunk-2PYHLSXK.js} +2 -2
  64. package/dist/{chunk-B6O2YLUR.js → chunk-2Z5DIDQD.js} +6 -1
  65. package/dist/chunk-2Z5DIDQD.js.map +1 -0
  66. package/dist/{chunk-7OAIOE5P.js → chunk-33G67YZF.js} +2 -2
  67. package/dist/{chunk-AV2OQF2O.js → chunk-3F3HA3R2.js} +2 -2
  68. package/dist/{chunk-RP5SJ3XR.js → chunk-3GNIJUUE.js} +2 -2
  69. package/dist/{chunk-QZZPUREO.js → chunk-3GYSZHMT.js} +3 -3
  70. package/dist/{chunk-QWWMS4AE.js → chunk-3MO4LWYU.js} +1 -1
  71. package/dist/chunk-3MO4LWYU.js.map +1 -0
  72. package/dist/{chunk-SWIKABKI.js → chunk-3Q3XD3NO.js} +2 -2
  73. package/dist/{chunk-AL6EHLB5.js → chunk-3X3PNU3T.js} +2 -2
  74. package/dist/{chunk-BTJ6CAIA.js → chunk-4IYIGN53.js} +10 -10
  75. package/dist/{chunk-BZTRPCCH.js → chunk-4PDTVVSW.js} +2 -2
  76. package/dist/{chunk-HM7RHKS4.js → chunk-4RNBLLZR.js} +2 -2
  77. package/dist/{chunk-Y3VDGK2O.js → chunk-4SCZZ3U7.js} +282 -84
  78. package/dist/chunk-4SCZZ3U7.js.map +1 -0
  79. package/dist/{chunk-JUWJYXI4.js → chunk-5ATSXCAG.js} +4 -4
  80. package/dist/{chunk-EHRE7ZG3.js → chunk-5B5WYAHQ.js} +2 -2
  81. package/dist/{chunk-WCGJK4NQ.js → chunk-5FNZ3G6X.js} +10 -10
  82. package/dist/{chunk-Y6DZ33PA.js → chunk-5GX5457J.js} +4 -4
  83. package/dist/{chunk-EMFBC7L3.js → chunk-5KGYTX5O.js} +2 -2
  84. package/dist/{chunk-OFCHT2TN.js → chunk-5LRV557D.js} +2 -2
  85. package/dist/{chunk-DXHVD4DS.js → chunk-5SMR542T.js} +3 -3
  86. package/dist/{chunk-S7LWX2PQ.js → chunk-655FVTCD.js} +2 -2
  87. package/dist/{chunk-DGRMWDQY.js → chunk-66BCOVW2.js} +7 -7
  88. package/dist/chunk-6EDW54SQ.js +298 -0
  89. package/dist/chunk-6EDW54SQ.js.map +1 -0
  90. package/dist/{chunk-5MDM7UE4.js → chunk-6WGMZQGG.js} +2 -2
  91. package/dist/chunk-77R7BQZ2.js +152 -0
  92. package/dist/chunk-77R7BQZ2.js.map +1 -0
  93. package/dist/{chunk-IPLYGWQF.js → chunk-7LCGFUMB.js} +6 -6
  94. package/dist/{chunk-5ZJYHOJT.js → chunk-7VQ6AI7H.js} +8 -8
  95. package/dist/{chunk-KYY4EACB.js → chunk-7Z3DLNSD.js} +2 -2
  96. package/dist/{chunk-LNH76ZJX.js → chunk-AIYXVWUH.js} +27 -2
  97. package/dist/{chunk-LNH76ZJX.js.map → chunk-AIYXVWUH.js.map} +1 -1
  98. package/dist/{chunk-G7NYVKD6.js → chunk-B2NXOVZN.js} +2 -2
  99. package/dist/{chunk-B43NMCGQ.js → chunk-BK2BVLZW.js} +2 -2
  100. package/dist/{chunk-QJ622LTI.js → chunk-BQOGQULP.js} +30 -8
  101. package/dist/chunk-BQOGQULP.js.map +1 -0
  102. package/dist/{chunk-BOOFTFFE.js → chunk-C2RW36YR.js} +2 -2
  103. package/dist/{chunk-XERVJYH2.js → chunk-C6JMGAMO.js} +7 -3
  104. package/dist/chunk-C6JMGAMO.js.map +1 -0
  105. package/dist/{chunk-5JMI26Q7.js → chunk-CBH2Z4UA.js} +2 -2
  106. package/dist/{chunk-P2S6P7X6.js → chunk-CFZ4SXXH.js} +2 -2
  107. package/dist/{chunk-YRH3C2OJ.js → chunk-CIIHIAJ2.js} +13 -5
  108. package/dist/chunk-CIIHIAJ2.js.map +1 -0
  109. package/dist/{chunk-6M56RFFJ.js → chunk-CJRENHVZ.js} +3 -3
  110. package/dist/{chunk-EGDYVYU7.js → chunk-CLWBFR7Q.js} +3 -3
  111. package/dist/{chunk-375ARKRS.js → chunk-D5SSBCYY.js} +70 -59
  112. package/dist/chunk-D5SSBCYY.js.map +1 -0
  113. package/dist/{chunk-KI6UOSNR.js → chunk-DEY7B77Y.js} +2 -2
  114. package/dist/chunk-DEY7B77Y.js.map +1 -0
  115. package/dist/{chunk-6VAHJ2F6.js → chunk-DMDWFQMR.js} +2 -2
  116. package/dist/{chunk-BLVHDY2U.js → chunk-DOWACHYO.js} +5 -2
  117. package/dist/chunk-DOWACHYO.js.map +1 -0
  118. package/dist/{chunk-UZSBCQEC.js → chunk-DPSOFK4D.js} +2 -2
  119. package/dist/{chunk-IZT3BVDW.js → chunk-DQR2LD3V.js} +2 -2
  120. package/dist/{chunk-K4QY55XV.js → chunk-EH4BQ7LT.js} +2 -2
  121. package/dist/chunk-EHHQJTAU.js +131 -0
  122. package/dist/chunk-EHHQJTAU.js.map +1 -0
  123. package/dist/{chunk-EBA5DA77.js → chunk-EOU6V4IN.js} +2 -2
  124. package/dist/{chunk-GD7BWGIB.js → chunk-EU6IRUCY.js} +6 -4
  125. package/dist/{chunk-GD7BWGIB.js.map → chunk-EU6IRUCY.js.map} +1 -1
  126. package/dist/{chunk-7KYJNHGM.js → chunk-EUCYTCFP.js} +2 -2
  127. package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
  128. package/dist/{chunk-CKUUP64O.js → chunk-F2772ATT.js} +2 -2
  129. package/dist/{chunk-46EST7JO.js → chunk-F2XNSIPP.js} +2 -2
  130. package/dist/{chunk-2KRNPFPK.js → chunk-FLI6DEIU.js} +2 -2
  131. package/dist/{chunk-OAIWPB2I.js → chunk-FT4UQYOV.js} +2 -2
  132. package/dist/{chunk-HYNEDMYJ.js → chunk-G2OYFTUD.js} +2 -2
  133. package/dist/{chunk-XTN54NML.js → chunk-G3T6YMBO.js} +4 -4
  134. package/dist/{chunk-CNG2XVZG.js → chunk-G3UUAQOD.js} +2 -2
  135. package/dist/{chunk-2ZQJLBV6.js → chunk-GCVDFX66.js} +4 -4
  136. package/dist/{chunk-ON4ILX3G.js → chunk-GFAM2LTC.js} +2 -2
  137. package/dist/{chunk-2LUSQV4U.js → chunk-GKJJNO7C.js} +2 -2
  138. package/dist/{chunk-T2YX56QI.js → chunk-GQJKVQJR.js} +2 -2
  139. package/dist/{chunk-5AOAQR37.js → chunk-GWVNGDJW.js} +3 -3
  140. package/dist/{chunk-YDH2FSDI.js → chunk-GZXXPCWJ.js} +3 -3
  141. package/dist/{chunk-5JCLELOP.js → chunk-H5IUN433.js} +2 -2
  142. package/dist/{chunk-IWHEJXR2.js → chunk-H6FREOYX.js} +8 -8
  143. package/dist/{chunk-B7CANWCA.js → chunk-HBAOOSHU.js} +2 -2
  144. package/dist/{chunk-Q4E24IRR.js → chunk-HDN7IVIO.js} +14 -11
  145. package/dist/chunk-HDN7IVIO.js.map +1 -0
  146. package/dist/{chunk-T3FMRLWQ.js → chunk-HFSPY26A.js} +2 -2
  147. package/dist/{chunk-B657ZGDH.js → chunk-HQSK2INQ.js} +2 -2
  148. package/dist/{chunk-RT6D3WN7.js → chunk-IJMDBYCO.js} +2 -2
  149. package/dist/{chunk-CS2JEHTB.js → chunk-IUCPLBDS.js} +9 -9
  150. package/dist/{chunk-XRBHXUTQ.js → chunk-IWD33CF4.js} +6 -6
  151. package/dist/{chunk-4IHBN6WU.js → chunk-JKMIGCK6.js} +2 -2
  152. package/dist/{chunk-YYO447A7.js → chunk-JNIVZNIB.js} +41 -253
  153. package/dist/chunk-JNIVZNIB.js.map +1 -0
  154. package/dist/{chunk-ROBHL3GL.js → chunk-JWX2Q6HS.js} +2 -2
  155. package/dist/{chunk-3I3U6FFT.js → chunk-K7BN34IA.js} +2 -2
  156. package/dist/{chunk-4O6WRBGE.js → chunk-KJXP6RUG.js} +5 -1
  157. package/dist/chunk-KJXP6RUG.js.map +1 -0
  158. package/dist/{chunk-4THZGKQ2.js → chunk-KLJVTZ3R.js} +3 -3
  159. package/dist/{chunk-4G4B3Z2B.js → chunk-KW4AJ7T3.js} +2 -2
  160. package/dist/{chunk-HT2C4EXO.js → chunk-L5VCT7LU.js} +8 -4
  161. package/dist/chunk-L5VCT7LU.js.map +1 -0
  162. package/dist/{chunk-ZI7LMSNI.js → chunk-LLHZZOIB.js} +2 -2
  163. package/dist/{chunk-LS2FHUML.js → chunk-LQ5SS4OP.js} +3 -3
  164. package/dist/{chunk-NSFOERZQ.js → chunk-LWFWZTWX.js} +3 -3
  165. package/dist/{chunk-BMWN7B3Y.js → chunk-LXATZLSC.js} +3 -3
  166. package/dist/{chunk-OYKQ6T4V.js → chunk-MATDGSJ7.js} +2 -2
  167. package/dist/{chunk-3NFN4Y4P.js → chunk-MGCKZWAE.js} +5 -5
  168. package/dist/{chunk-O4KYRDRT.js → chunk-MJIOGYKX.js} +2 -2
  169. package/dist/{chunk-6OMUHXHP.js → chunk-ML7ZJAKJ.js} +2 -2
  170. package/dist/{chunk-GKIXBH7Y.js → chunk-MO6N4QYY.js} +4 -4
  171. package/dist/{chunk-A2E4WNW4.js → chunk-MWWAQXZ6.js} +2 -2
  172. package/dist/{chunk-VYPFEVOM.js → chunk-NHUX6GXA.js} +6 -6
  173. package/dist/{chunk-AKREOU5F.js → chunk-NZCKG25S.js} +2 -2
  174. package/dist/{chunk-4NDWE44P.js → chunk-NZFFGO5O.js} +2 -2
  175. package/dist/{chunk-WWSRLS4M.js → chunk-O2YPCFJT.js} +17 -17
  176. package/dist/{chunk-ZSJGYC3C.js → chunk-OQJKY3Z5.js} +2 -2
  177. package/dist/{chunk-U7VPOXVM.js → chunk-OQR42XCN.js} +82 -78
  178. package/dist/chunk-OQR42XCN.js.map +1 -0
  179. package/dist/{chunk-OFEHITAZ.js → chunk-OXNTOHL6.js} +2 -2
  180. package/dist/{chunk-FQD2KPQH.js → chunk-P55FACBG.js} +2 -2
  181. package/dist/chunk-PGRZ3FYC.js +34 -0
  182. package/dist/chunk-PGRZ3FYC.js.map +1 -0
  183. package/dist/{chunk-JYZSRNR7.js → chunk-PIITB2YZ.js} +2 -2
  184. package/dist/{chunk-PBVNVKYN.js → chunk-PIN5OPBA.js} +2 -2
  185. package/dist/chunk-PPUNC7UX.js +73 -0
  186. package/dist/chunk-PPUNC7UX.js.map +1 -0
  187. package/dist/{chunk-EQWEIIKQ.js → chunk-PQM3B54K.js} +6 -1
  188. package/dist/chunk-PQM3B54K.js.map +1 -0
  189. package/dist/{chunk-4TTGRETU.js → chunk-PRU7OF3Y.js} +5 -5
  190. package/dist/{chunk-K2FSASGZ.js → chunk-PVHQSLNN.js} +7 -7
  191. package/dist/{chunk-SVDU4OHO.js → chunk-Q35L7TYB.js} +2 -2
  192. package/dist/{chunk-5VC7J76U.js → chunk-QPH52AZB.js} +2 -2
  193. package/dist/{chunk-6T42L5FI.js → chunk-QS3OLP5I.js} +2 -2
  194. package/dist/{chunk-P34FDDB5.js → chunk-QSEUUQUF.js} +2 -2
  195. package/dist/chunk-QUIRIG2P.js +31 -0
  196. package/dist/chunk-QUIRIG2P.js.map +1 -0
  197. package/dist/{chunk-PAAJWQH5.js → chunk-QUMKDRCF.js} +2 -2
  198. package/dist/{chunk-KZEMFD6E.js → chunk-R2H4ZFBJ.js} +3 -3
  199. package/dist/{chunk-X3VID2TT.js → chunk-RI2KCQHP.js} +7 -3
  200. package/dist/chunk-RI2KCQHP.js.map +1 -0
  201. package/dist/{chunk-JFVCDEIC.js → chunk-RP7PQWZM.js} +7 -7
  202. package/dist/{chunk-KC46VZR5.js → chunk-RTTPBBAN.js} +9 -9
  203. package/dist/{chunk-ZQ3WU6JO.js → chunk-RXFCU3CY.js} +2 -2
  204. package/dist/{chunk-CBP4HWCL.js → chunk-RYYVMZBR.js} +3 -3
  205. package/dist/{chunk-2NCBDGND.js → chunk-SA6GMZJY.js} +3 -3
  206. package/dist/{chunk-VFTK5WKI.js → chunk-STBX5X6B.js} +2 -2
  207. package/dist/{chunk-WVHRNAXL.js → chunk-SWWHIJUJ.js} +2 -2
  208. package/dist/{chunk-WADSXS4K.js → chunk-SX4QDWXK.js} +2 -2
  209. package/dist/{chunk-WETFW255.js → chunk-T7ASDYNK.js} +2 -2
  210. package/dist/{chunk-XZLWYZ7C.js → chunk-THEPGZBM.js} +2 -2
  211. package/dist/{chunk-YEM7K3KD.js → chunk-TMC7HBED.js} +6 -6
  212. package/dist/{chunk-RWRQ67OR.js → chunk-TPNCXSXP.js} +2 -2
  213. package/dist/{chunk-LZKOVXMX.js → chunk-TRMJ6BYC.js} +2 -2
  214. package/dist/{chunk-A6TVQ3QP.js → chunk-UGYUBENJ.js} +3 -3
  215. package/dist/{chunk-AAM66QCP.js → chunk-UZRSI6NX.js} +2 -2
  216. package/dist/{chunk-XHWJRUVP.js → chunk-V3TXIXXY.js} +3 -3
  217. package/dist/{chunk-2CXQZXWM.js → chunk-V4MB5ONM.js} +6 -6
  218. package/dist/{chunk-UOKPJFO3.js → chunk-VNZMZPAC.js} +3 -3
  219. package/dist/{chunk-FZB4TS2W.js → chunk-VPXIKBPX.js} +5 -5
  220. package/dist/{chunk-CYEK6Z3P.js → chunk-VW6VIJOS.js} +2 -2
  221. package/dist/{chunk-QUA7RLK6.js → chunk-W3FVQBGF.js} +2 -2
  222. package/dist/{chunk-6OQ6N5RP.js → chunk-WGTR573G.js} +22 -22
  223. package/dist/{chunk-W3K3HITK.js → chunk-WLT6LTQP.js} +2 -2
  224. package/dist/{chunk-6Z2AZ4AJ.js → chunk-XKRXN63M.js} +2 -2
  225. package/dist/{chunk-3J5JKBYD.js → chunk-XLBFX63V.js} +80 -77
  226. package/dist/chunk-XLBFX63V.js.map +1 -0
  227. package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
  228. package/dist/{chunk-DA2INEB5.js → chunk-XYGQSDTH.js} +4 -4
  229. package/dist/chunk-YET735EZ.js +99 -0
  230. package/dist/chunk-YET735EZ.js.map +1 -0
  231. package/dist/{chunk-RBJQYMMT.js → chunk-YRULQW5J.js} +4 -4
  232. package/dist/{chunk-QUNDYIYZ.js → chunk-YYEOR4XN.js} +3 -3
  233. package/dist/{chunk-6WHJ2EAB.js → chunk-Z64TS5V4.js} +2 -2
  234. package/dist/{chunk-NHLLKEKK.js → chunk-ZAJLJ35W.js} +2 -2
  235. package/dist/{chunk-M7V65M6H.js → chunk-ZKHSAMTE.js} +2 -2
  236. package/dist/cli.d.ts.map +1 -1
  237. package/dist/cli.js +154 -150
  238. package/dist/coding/export-okf-codegraph.js +32 -28
  239. package/dist/coding/export-okf-codegraph.js.map +1 -1
  240. package/dist/coding/pre-action-gate.js +4 -3
  241. package/dist/commitment-ledger.js +3 -2
  242. package/dist/compounding/engine.js +34 -30
  243. package/dist/config.js +43 -39
  244. package/dist/connectors/codex-materialize-runner.js +32 -28
  245. package/dist/connectors/index.js +32 -28
  246. package/dist/console/trace.d.ts +5 -14
  247. package/dist/console/trace.d.ts.map +1 -1
  248. package/dist/consolidation-provenance-check.d.ts.map +1 -1
  249. package/dist/consolidation-provenance-check.js +8 -6
  250. package/dist/consolidation-undo.js +5 -4
  251. package/dist/consolidation-undo.js.map +1 -1
  252. package/dist/contradiction/index.js +9 -7
  253. package/dist/converge-config.d.ts +2 -0
  254. package/dist/converge-config.d.ts.map +1 -1
  255. package/dist/converge-config.js +7 -3
  256. package/dist/convergence-refresh.js +34 -30
  257. package/dist/corpus-watermark.js +34 -30
  258. package/dist/correction/correction-planner.d.ts.map +1 -1
  259. package/dist/cue-anchors.js +4 -3
  260. package/dist/dashboard-runtime.js +2 -2
  261. package/dist/deep-recall-http-glue.js +14 -13
  262. package/dist/deep-recall.js +2 -2
  263. package/dist/{dreams-ledger-567VKVOU.js → dreams-ledger-UCHHRQ4R.js} +3 -2
  264. package/dist/embedding-fallback.js +5 -4
  265. package/dist/embedding-generation-lock.js +4 -3
  266. package/dist/entity-retrieval.js +33 -29
  267. package/dist/eval-trajectory-store.js +4 -3
  268. package/dist/eval-trajectory.js +4 -3
  269. package/dist/evals.js +3 -2
  270. package/dist/explicit-capture.js +11 -8
  271. package/dist/external-wiki-access.js +97 -93
  272. package/dist/extraction-quote-grounding.d.ts +67 -0
  273. package/dist/extraction-quote-grounding.d.ts.map +1 -0
  274. package/dist/extraction-quote-grounding.js +27 -0
  275. package/dist/extraction-quote-grounding.js.map +1 -0
  276. package/dist/extraction-source-grounding-helpers.d.ts +8 -0
  277. package/dist/extraction-source-grounding-helpers.d.ts.map +1 -1
  278. package/dist/extraction-source-grounding-helpers.js +11 -1
  279. package/dist/extraction-source-grounding-rules.d.ts +3 -1
  280. package/dist/extraction-source-grounding-rules.d.ts.map +1 -1
  281. package/dist/extraction-source-grounding-rules.js +3 -2
  282. package/dist/extraction-source-grounding.d.ts +1 -1
  283. package/dist/extraction-source-grounding.d.ts.map +1 -1
  284. package/dist/extraction-source-grounding.js +4 -3
  285. package/dist/extraction-span-materialize.js +2 -2
  286. package/dist/extraction.js +44 -39
  287. package/dist/{first-start-migration-HYAMKJ6V.js → first-start-migration-QVD22WWS.js} +9 -8
  288. package/dist/{first-start-migration-HYAMKJ6V.js.map → first-start-migration-QVD22WWS.js.map} +1 -1
  289. package/dist/{forget-OHAJ6PSU.js → forget-GXBWFKRC.js} +5 -4
  290. package/dist/{forget-OHAJ6PSU.js.map → forget-GXBWFKRC.js.map} +1 -1
  291. package/dist/{graph-edge-decay-CZ3SYLM4.js → graph-edge-decay-BYPZVJT4.js} +10 -9
  292. package/dist/graph-edge-decay-BYPZVJT4.js.map +1 -0
  293. package/dist/graph-jsonl.js +8 -7
  294. package/dist/graph-snapshot.js +8 -7
  295. package/dist/graph-write-lock.js +4 -3
  296. package/dist/graph.js +9 -8
  297. package/dist/harmonic-construction.js +5 -4
  298. package/dist/harmonic-retrieval.js +36 -32
  299. package/dist/harmonic-source-lookup.js +3 -2
  300. package/dist/http-retry.js +2 -1
  301. package/dist/http-retry.js.map +1 -1
  302. package/dist/index.d.ts +1 -1
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +244 -237
  305. package/dist/json-store.d.ts.map +1 -1
  306. package/dist/json-store.js +2 -1
  307. package/dist/lcm/engine.js +4 -4
  308. package/dist/lcm/index.js +12 -12
  309. package/dist/location/index.js +35 -31
  310. package/dist/maintenance/dreams-ledger.d.ts.map +1 -1
  311. package/dist/maintenance/memory-governance.d.ts.map +1 -1
  312. package/dist/maintenance/memory-governance.js +32 -28
  313. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +32 -28
  314. package/dist/maintenance/rebuild-memory-projection-runner.js +34 -30
  315. package/dist/maintenance/rebuild-memory-projection.js +33 -29
  316. package/dist/memory-browse-operations.js +97 -93
  317. package/dist/memory-browse.js +7 -7
  318. package/dist/memory-subject.js +5 -4
  319. package/dist/namespaces/migrate.js +33 -29
  320. package/dist/namespaces/search.js +11 -10
  321. package/dist/namespaces/storage.d.ts.map +1 -1
  322. package/dist/namespaces/storage.js +32 -28
  323. package/dist/objective-state-writers.js +4 -3
  324. package/dist/objective-state.js +3 -2
  325. package/dist/offline-sync-changeset-generations.js +7 -6
  326. package/dist/offline-sync-embedding-generation.js +6 -5
  327. package/dist/offline-sync-impression-drain.js +4 -4
  328. package/dist/offline-sync-snapshot-stream.js +10 -9
  329. package/dist/offline-sync.d.ts.map +1 -1
  330. package/dist/offline-sync.js +11 -10
  331. package/dist/operator-doctor-corpus.js +35 -31
  332. package/dist/operator-toolkit.js +58 -54
  333. package/dist/orchestration/maintenance.js +44 -40
  334. package/dist/orchestrator.js +205 -200
  335. package/dist/page-versioning.js +5 -4
  336. package/dist/profiling.d.ts.map +1 -1
  337. package/dist/profiling.js +2 -1
  338. package/dist/qmd-daemon-session.js +2 -2
  339. package/dist/qmd.js +4 -4
  340. package/dist/recall-explain-renderer.js +3 -3
  341. package/dist/recall-navigate-access.js +2 -2
  342. package/dist/recall-navigate-disclosure.js +2 -2
  343. package/dist/recall-navigate.js +2 -2
  344. package/dist/recall-navigation-operations.js +97 -93
  345. package/dist/recall-navigation.js +96 -92
  346. package/dist/recall-state-view-admission.js +7 -7
  347. package/dist/recall-state.js +4 -3
  348. package/dist/recall-why-service.js +7 -7
  349. package/dist/recall-xray-cli.js +4 -4
  350. package/dist/recall-xray-renderer.js +3 -3
  351. package/dist/recall-xray.js +2 -2
  352. package/dist/reconcile/cursor.js +4 -2
  353. package/dist/reconcile/cursor.js.map +1 -1
  354. package/dist/reconcile/manifest.js +9 -6
  355. package/dist/reconcile/plan.js +4 -2
  356. package/dist/{resolution-EKJHREVJ.js → resolution-ZU5BIAJA.js} +10 -8
  357. package/dist/resolution-ZU5BIAJA.js.map +1 -0
  358. package/dist/resume-bundles.js +48 -44
  359. package/dist/retrieval-agents.d.ts +1 -1
  360. package/dist/retrieval-agents.d.ts.map +1 -1
  361. package/dist/retrieval-agents.js +7 -1
  362. package/dist/salvage-envelope.js +7 -6
  363. package/dist/search/document-scanner.d.ts.map +1 -1
  364. package/dist/search/document-scanner.js +2 -1
  365. package/dist/search/factory.js +10 -9
  366. package/dist/search/index.js +16 -15
  367. package/dist/search/lancedb-backend.js +3 -2
  368. package/dist/search/meilisearch-backend.js +3 -2
  369. package/dist/search/orama-backend.js +3 -2
  370. package/dist/semantic-consolidation.js +37 -33
  371. package/dist/semantic-rule-promotion.js +32 -28
  372. package/dist/semantic-rule-verifier.js +32 -28
  373. package/dist/source-agent-qualifier.js +40 -35
  374. package/dist/standup/build.js +32 -28
  375. package/dist/storage/content-hash-index.d.ts +10 -0
  376. package/dist/storage/content-hash-index.d.ts.map +1 -1
  377. package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -1
  378. package/dist/storage/entity-store.d.ts +32 -1
  379. package/dist/storage/entity-store.d.ts.map +1 -1
  380. package/dist/storage/memory-read-store.d.ts.map +1 -1
  381. package/dist/storage/supersession-audit.d.ts.map +1 -1
  382. package/dist/storage/tombstone-blocked-capture-index.d.ts +3 -0
  383. package/dist/storage/tombstone-blocked-capture-index.d.ts.map +1 -1
  384. package/dist/storage/tombstone-blocked-capture-mutation.d.ts +23 -3
  385. package/dist/storage/tombstone-blocked-capture-mutation.d.ts.map +1 -1
  386. package/dist/storage.d.ts +6 -0
  387. package/dist/storage.d.ts.map +1 -1
  388. package/dist/storage.js +33 -29
  389. package/dist/subject-config.js +6 -5
  390. package/dist/summarizer.js +4 -4
  391. package/dist/summary-snapshot.js +4 -3
  392. package/dist/support-passport/index.js +99 -95
  393. package/dist/{tier-stats-RQM76XYY.js → tier-stats-C3IAMS4X.js} +6 -5
  394. package/dist/{tier-stats-RQM76XYY.js.map → tier-stats-C3IAMS4X.js.map} +1 -1
  395. package/dist/{trace-LXXCMZJA.js → trace-QBQVS5BC.js} +5 -21
  396. package/dist/trace-QBQVS5BC.js.map +1 -0
  397. package/dist/transcript.d.ts.map +1 -1
  398. package/dist/transcript.js +2 -1
  399. package/dist/transfer/autodetect.js +1 -1
  400. package/dist/transfer/backup.js +1 -1
  401. package/dist/transfer/capsule-export.js +3 -3
  402. package/dist/transfer/capsule-import.js +7 -6
  403. package/dist/transfer/export-okf.js +32 -28
  404. package/dist/trust-zones.js +3 -2
  405. package/dist/types.d.ts +9 -0
  406. package/dist/types.d.ts.map +1 -1
  407. package/dist/types.js +1 -1
  408. package/dist/utility-learner.js +4 -3
  409. package/dist/utility-runtime.js +5 -4
  410. package/dist/utility-telemetry.js +3 -2
  411. package/dist/utils/macos-replication-junk.d.ts +32 -0
  412. package/dist/utils/macos-replication-junk.d.ts.map +1 -0
  413. package/dist/utils/malformed-entity-record.d.ts +24 -0
  414. package/dist/utils/malformed-entity-record.d.ts.map +1 -0
  415. package/dist/utils/serialize-mutations.js +3 -2
  416. package/dist/utils/sleep.d.ts +6 -0
  417. package/dist/utils/sleep.d.ts.map +1 -1
  418. package/dist/verified-recall.js +32 -28
  419. package/dist/who-knows-cli.js +33 -29
  420. package/dist/who-knows.js +32 -28
  421. package/dist/work-product-ledger.js +3 -2
  422. package/dist/write-envelope.js +6 -5
  423. package/package.json +22 -2
  424. package/src/calibration.ts +3 -2
  425. package/src/capture-write-lock-backoff.test.ts +534 -0
  426. package/src/capture-write-lock-backoff.ts +140 -0
  427. package/src/capture-write-lock.ts +8 -0
  428. package/src/cli.ts +2 -2
  429. package/src/console/trace.ts +5 -36
  430. package/src/consolidation-provenance-check.ts +2 -0
  431. package/src/converge-config.ts +80 -1
  432. package/src/correction/correction-planner.ts +3 -2
  433. package/src/extraction-quote-grounding.test.ts +546 -0
  434. package/src/extraction-quote-grounding.ts +232 -0
  435. package/src/extraction-source-grounding-helpers.ts +35 -0
  436. package/src/extraction-source-grounding-rules.ts +90 -65
  437. package/src/extraction-source-grounding.ts +11 -2
  438. package/src/index.ts +1 -1
  439. package/src/json-store.ts +3 -0
  440. package/src/macos-replication-junk-scanners.test.ts +275 -0
  441. package/src/maintenance/dreams-ledger.ts +2 -0
  442. package/src/maintenance/memory-governance.ts +2 -0
  443. package/src/namespaces/storage.ts +2 -0
  444. package/src/offline-sync-macos-junk.test.ts +169 -0
  445. package/src/offline-sync.ts +7 -0
  446. package/src/profiling.ts +2 -1
  447. package/src/providers/codex-subscription.test.ts +15 -3
  448. package/src/retrieval-agents.ts +29 -12
  449. package/src/search/document-scanner.ts +4 -0
  450. package/src/storage/content-hash-index.ts +10 -0
  451. package/src/storage/entity-canonical-id-migration.ts +56 -13
  452. package/src/storage/entity-store.ts +173 -15
  453. package/src/storage/memory-read-store.ts +30 -5
  454. package/src/storage/supersession-audit.ts +2 -0
  455. package/src/storage/tombstone-blocked-capture-index.ts +8 -1
  456. package/src/storage/tombstone-blocked-capture-mutation.ts +133 -43
  457. package/src/storage.ts +16 -2
  458. package/src/transcript.ts +11 -10
  459. package/src/types.ts +9 -0
  460. package/src/utils/macos-replication-junk.test.ts +46 -0
  461. package/src/utils/macos-replication-junk.ts +65 -0
  462. package/src/utils/malformed-entity-record.ts +101 -0
  463. package/src/utils/sleep.ts +28 -0
  464. package/dist/chunk-375ARKRS.js.map +0 -1
  465. package/dist/chunk-3J5JKBYD.js.map +0 -1
  466. package/dist/chunk-4O6WRBGE.js.map +0 -1
  467. package/dist/chunk-6MINUTGJ.js +0 -64
  468. package/dist/chunk-6MINUTGJ.js.map +0 -1
  469. package/dist/chunk-7LEQREP2.js +0 -9
  470. package/dist/chunk-7LEQREP2.js.map +0 -1
  471. package/dist/chunk-B6O2YLUR.js.map +0 -1
  472. package/dist/chunk-BLVHDY2U.js.map +0 -1
  473. package/dist/chunk-EQWEIIKQ.js.map +0 -1
  474. package/dist/chunk-HT2C4EXO.js.map +0 -1
  475. package/dist/chunk-KI6UOSNR.js.map +0 -1
  476. package/dist/chunk-MZBWIJJN.js.map +0 -1
  477. package/dist/chunk-Q4E24IRR.js.map +0 -1
  478. package/dist/chunk-QJ622LTI.js.map +0 -1
  479. package/dist/chunk-QWWMS4AE.js.map +0 -1
  480. package/dist/chunk-U7VPOXVM.js.map +0 -1
  481. package/dist/chunk-X3VID2TT.js.map +0 -1
  482. package/dist/chunk-XERVJYH2.js.map +0 -1
  483. package/dist/chunk-Y3VDGK2O.js.map +0 -1
  484. package/dist/chunk-YRH3C2OJ.js.map +0 -1
  485. package/dist/chunk-YYO447A7.js.map +0 -1
  486. package/dist/trace-LXXCMZJA.js.map +0 -1
  487. /package/dist/{auto-sync-DGJOZYGT.js.map → auto-sync-7WWAKW6F.js.map} +0 -0
  488. /package/dist/{dreams-ledger-567VKVOU.js.map → capture-write-lock-backoff.js.map} +0 -0
  489. /package/dist/{graph-edge-decay-CZ3SYLM4.js.map → capture-write-lock.js.map} +0 -0
  490. /package/dist/{chunk-KZO43HPY.js.map → chunk-22RM2ZUJ.js.map} +0 -0
  491. /package/dist/{chunk-ZUMXY4KA.js.map → chunk-22W2XWGH.js.map} +0 -0
  492. /package/dist/{chunk-PCWXLAJY.js.map → chunk-2PTH4PRL.js.map} +0 -0
  493. /package/dist/{chunk-ZIZ2G47N.js.map → chunk-2PYHLSXK.js.map} +0 -0
  494. /package/dist/{chunk-7OAIOE5P.js.map → chunk-33G67YZF.js.map} +0 -0
  495. /package/dist/{chunk-AV2OQF2O.js.map → chunk-3F3HA3R2.js.map} +0 -0
  496. /package/dist/{chunk-RP5SJ3XR.js.map → chunk-3GNIJUUE.js.map} +0 -0
  497. /package/dist/{chunk-QZZPUREO.js.map → chunk-3GYSZHMT.js.map} +0 -0
  498. /package/dist/{chunk-SWIKABKI.js.map → chunk-3Q3XD3NO.js.map} +0 -0
  499. /package/dist/{chunk-AL6EHLB5.js.map → chunk-3X3PNU3T.js.map} +0 -0
  500. /package/dist/{chunk-BTJ6CAIA.js.map → chunk-4IYIGN53.js.map} +0 -0
  501. /package/dist/{chunk-BZTRPCCH.js.map → chunk-4PDTVVSW.js.map} +0 -0
  502. /package/dist/{chunk-HM7RHKS4.js.map → chunk-4RNBLLZR.js.map} +0 -0
  503. /package/dist/{chunk-JUWJYXI4.js.map → chunk-5ATSXCAG.js.map} +0 -0
  504. /package/dist/{chunk-EHRE7ZG3.js.map → chunk-5B5WYAHQ.js.map} +0 -0
  505. /package/dist/{chunk-WCGJK4NQ.js.map → chunk-5FNZ3G6X.js.map} +0 -0
  506. /package/dist/{chunk-Y6DZ33PA.js.map → chunk-5GX5457J.js.map} +0 -0
  507. /package/dist/{chunk-EMFBC7L3.js.map → chunk-5KGYTX5O.js.map} +0 -0
  508. /package/dist/{chunk-OFCHT2TN.js.map → chunk-5LRV557D.js.map} +0 -0
  509. /package/dist/{chunk-DXHVD4DS.js.map → chunk-5SMR542T.js.map} +0 -0
  510. /package/dist/{chunk-S7LWX2PQ.js.map → chunk-655FVTCD.js.map} +0 -0
  511. /package/dist/{chunk-DGRMWDQY.js.map → chunk-66BCOVW2.js.map} +0 -0
  512. /package/dist/{chunk-5MDM7UE4.js.map → chunk-6WGMZQGG.js.map} +0 -0
  513. /package/dist/{chunk-IPLYGWQF.js.map → chunk-7LCGFUMB.js.map} +0 -0
  514. /package/dist/{chunk-5ZJYHOJT.js.map → chunk-7VQ6AI7H.js.map} +0 -0
  515. /package/dist/{chunk-KYY4EACB.js.map → chunk-7Z3DLNSD.js.map} +0 -0
  516. /package/dist/{chunk-G7NYVKD6.js.map → chunk-B2NXOVZN.js.map} +0 -0
  517. /package/dist/{chunk-B43NMCGQ.js.map → chunk-BK2BVLZW.js.map} +0 -0
  518. /package/dist/{chunk-BOOFTFFE.js.map → chunk-C2RW36YR.js.map} +0 -0
  519. /package/dist/{chunk-5JMI26Q7.js.map → chunk-CBH2Z4UA.js.map} +0 -0
  520. /package/dist/{chunk-P2S6P7X6.js.map → chunk-CFZ4SXXH.js.map} +0 -0
  521. /package/dist/{chunk-6M56RFFJ.js.map → chunk-CJRENHVZ.js.map} +0 -0
  522. /package/dist/{chunk-EGDYVYU7.js.map → chunk-CLWBFR7Q.js.map} +0 -0
  523. /package/dist/{chunk-6VAHJ2F6.js.map → chunk-DMDWFQMR.js.map} +0 -0
  524. /package/dist/{chunk-UZSBCQEC.js.map → chunk-DPSOFK4D.js.map} +0 -0
  525. /package/dist/{chunk-IZT3BVDW.js.map → chunk-DQR2LD3V.js.map} +0 -0
  526. /package/dist/{chunk-K4QY55XV.js.map → chunk-EH4BQ7LT.js.map} +0 -0
  527. /package/dist/{chunk-EBA5DA77.js.map → chunk-EOU6V4IN.js.map} +0 -0
  528. /package/dist/{chunk-7KYJNHGM.js.map → chunk-EUCYTCFP.js.map} +0 -0
  529. /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
  530. /package/dist/{chunk-CKUUP64O.js.map → chunk-F2772ATT.js.map} +0 -0
  531. /package/dist/{chunk-46EST7JO.js.map → chunk-F2XNSIPP.js.map} +0 -0
  532. /package/dist/{chunk-2KRNPFPK.js.map → chunk-FLI6DEIU.js.map} +0 -0
  533. /package/dist/{chunk-OAIWPB2I.js.map → chunk-FT4UQYOV.js.map} +0 -0
  534. /package/dist/{chunk-HYNEDMYJ.js.map → chunk-G2OYFTUD.js.map} +0 -0
  535. /package/dist/{chunk-XTN54NML.js.map → chunk-G3T6YMBO.js.map} +0 -0
  536. /package/dist/{chunk-CNG2XVZG.js.map → chunk-G3UUAQOD.js.map} +0 -0
  537. /package/dist/{chunk-2ZQJLBV6.js.map → chunk-GCVDFX66.js.map} +0 -0
  538. /package/dist/{chunk-ON4ILX3G.js.map → chunk-GFAM2LTC.js.map} +0 -0
  539. /package/dist/{chunk-2LUSQV4U.js.map → chunk-GKJJNO7C.js.map} +0 -0
  540. /package/dist/{chunk-T2YX56QI.js.map → chunk-GQJKVQJR.js.map} +0 -0
  541. /package/dist/{chunk-5AOAQR37.js.map → chunk-GWVNGDJW.js.map} +0 -0
  542. /package/dist/{chunk-YDH2FSDI.js.map → chunk-GZXXPCWJ.js.map} +0 -0
  543. /package/dist/{chunk-5JCLELOP.js.map → chunk-H5IUN433.js.map} +0 -0
  544. /package/dist/{chunk-IWHEJXR2.js.map → chunk-H6FREOYX.js.map} +0 -0
  545. /package/dist/{chunk-B7CANWCA.js.map → chunk-HBAOOSHU.js.map} +0 -0
  546. /package/dist/{chunk-T3FMRLWQ.js.map → chunk-HFSPY26A.js.map} +0 -0
  547. /package/dist/{chunk-B657ZGDH.js.map → chunk-HQSK2INQ.js.map} +0 -0
  548. /package/dist/{chunk-RT6D3WN7.js.map → chunk-IJMDBYCO.js.map} +0 -0
  549. /package/dist/{chunk-CS2JEHTB.js.map → chunk-IUCPLBDS.js.map} +0 -0
  550. /package/dist/{chunk-XRBHXUTQ.js.map → chunk-IWD33CF4.js.map} +0 -0
  551. /package/dist/{chunk-4IHBN6WU.js.map → chunk-JKMIGCK6.js.map} +0 -0
  552. /package/dist/{chunk-ROBHL3GL.js.map → chunk-JWX2Q6HS.js.map} +0 -0
  553. /package/dist/{chunk-3I3U6FFT.js.map → chunk-K7BN34IA.js.map} +0 -0
  554. /package/dist/{chunk-4THZGKQ2.js.map → chunk-KLJVTZ3R.js.map} +0 -0
  555. /package/dist/{chunk-4G4B3Z2B.js.map → chunk-KW4AJ7T3.js.map} +0 -0
  556. /package/dist/{chunk-ZI7LMSNI.js.map → chunk-LLHZZOIB.js.map} +0 -0
  557. /package/dist/{chunk-LS2FHUML.js.map → chunk-LQ5SS4OP.js.map} +0 -0
  558. /package/dist/{chunk-NSFOERZQ.js.map → chunk-LWFWZTWX.js.map} +0 -0
  559. /package/dist/{chunk-BMWN7B3Y.js.map → chunk-LXATZLSC.js.map} +0 -0
  560. /package/dist/{chunk-OYKQ6T4V.js.map → chunk-MATDGSJ7.js.map} +0 -0
  561. /package/dist/{chunk-3NFN4Y4P.js.map → chunk-MGCKZWAE.js.map} +0 -0
  562. /package/dist/{chunk-O4KYRDRT.js.map → chunk-MJIOGYKX.js.map} +0 -0
  563. /package/dist/{chunk-6OMUHXHP.js.map → chunk-ML7ZJAKJ.js.map} +0 -0
  564. /package/dist/{chunk-GKIXBH7Y.js.map → chunk-MO6N4QYY.js.map} +0 -0
  565. /package/dist/{chunk-A2E4WNW4.js.map → chunk-MWWAQXZ6.js.map} +0 -0
  566. /package/dist/{chunk-VYPFEVOM.js.map → chunk-NHUX6GXA.js.map} +0 -0
  567. /package/dist/{chunk-AKREOU5F.js.map → chunk-NZCKG25S.js.map} +0 -0
  568. /package/dist/{chunk-4NDWE44P.js.map → chunk-NZFFGO5O.js.map} +0 -0
  569. /package/dist/{chunk-WWSRLS4M.js.map → chunk-O2YPCFJT.js.map} +0 -0
  570. /package/dist/{chunk-ZSJGYC3C.js.map → chunk-OQJKY3Z5.js.map} +0 -0
  571. /package/dist/{chunk-OFEHITAZ.js.map → chunk-OXNTOHL6.js.map} +0 -0
  572. /package/dist/{chunk-FQD2KPQH.js.map → chunk-P55FACBG.js.map} +0 -0
  573. /package/dist/{chunk-JYZSRNR7.js.map → chunk-PIITB2YZ.js.map} +0 -0
  574. /package/dist/{chunk-PBVNVKYN.js.map → chunk-PIN5OPBA.js.map} +0 -0
  575. /package/dist/{chunk-4TTGRETU.js.map → chunk-PRU7OF3Y.js.map} +0 -0
  576. /package/dist/{chunk-K2FSASGZ.js.map → chunk-PVHQSLNN.js.map} +0 -0
  577. /package/dist/{chunk-SVDU4OHO.js.map → chunk-Q35L7TYB.js.map} +0 -0
  578. /package/dist/{chunk-5VC7J76U.js.map → chunk-QPH52AZB.js.map} +0 -0
  579. /package/dist/{chunk-6T42L5FI.js.map → chunk-QS3OLP5I.js.map} +0 -0
  580. /package/dist/{chunk-P34FDDB5.js.map → chunk-QSEUUQUF.js.map} +0 -0
  581. /package/dist/{chunk-PAAJWQH5.js.map → chunk-QUMKDRCF.js.map} +0 -0
  582. /package/dist/{chunk-KZEMFD6E.js.map → chunk-R2H4ZFBJ.js.map} +0 -0
  583. /package/dist/{chunk-JFVCDEIC.js.map → chunk-RP7PQWZM.js.map} +0 -0
  584. /package/dist/{chunk-KC46VZR5.js.map → chunk-RTTPBBAN.js.map} +0 -0
  585. /package/dist/{chunk-ZQ3WU6JO.js.map → chunk-RXFCU3CY.js.map} +0 -0
  586. /package/dist/{chunk-CBP4HWCL.js.map → chunk-RYYVMZBR.js.map} +0 -0
  587. /package/dist/{chunk-2NCBDGND.js.map → chunk-SA6GMZJY.js.map} +0 -0
  588. /package/dist/{chunk-VFTK5WKI.js.map → chunk-STBX5X6B.js.map} +0 -0
  589. /package/dist/{chunk-WVHRNAXL.js.map → chunk-SWWHIJUJ.js.map} +0 -0
  590. /package/dist/{chunk-WADSXS4K.js.map → chunk-SX4QDWXK.js.map} +0 -0
  591. /package/dist/{chunk-WETFW255.js.map → chunk-T7ASDYNK.js.map} +0 -0
  592. /package/dist/{chunk-XZLWYZ7C.js.map → chunk-THEPGZBM.js.map} +0 -0
  593. /package/dist/{chunk-YEM7K3KD.js.map → chunk-TMC7HBED.js.map} +0 -0
  594. /package/dist/{chunk-RWRQ67OR.js.map → chunk-TPNCXSXP.js.map} +0 -0
  595. /package/dist/{chunk-LZKOVXMX.js.map → chunk-TRMJ6BYC.js.map} +0 -0
  596. /package/dist/{chunk-A6TVQ3QP.js.map → chunk-UGYUBENJ.js.map} +0 -0
  597. /package/dist/{chunk-AAM66QCP.js.map → chunk-UZRSI6NX.js.map} +0 -0
  598. /package/dist/{chunk-XHWJRUVP.js.map → chunk-V3TXIXXY.js.map} +0 -0
  599. /package/dist/{chunk-2CXQZXWM.js.map → chunk-V4MB5ONM.js.map} +0 -0
  600. /package/dist/{chunk-UOKPJFO3.js.map → chunk-VNZMZPAC.js.map} +0 -0
  601. /package/dist/{chunk-FZB4TS2W.js.map → chunk-VPXIKBPX.js.map} +0 -0
  602. /package/dist/{chunk-CYEK6Z3P.js.map → chunk-VW6VIJOS.js.map} +0 -0
  603. /package/dist/{chunk-QUA7RLK6.js.map → chunk-W3FVQBGF.js.map} +0 -0
  604. /package/dist/{chunk-6OQ6N5RP.js.map → chunk-WGTR573G.js.map} +0 -0
  605. /package/dist/{chunk-W3K3HITK.js.map → chunk-WLT6LTQP.js.map} +0 -0
  606. /package/dist/{chunk-6Z2AZ4AJ.js.map → chunk-XKRXN63M.js.map} +0 -0
  607. /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
  608. /package/dist/{chunk-DA2INEB5.js.map → chunk-XYGQSDTH.js.map} +0 -0
  609. /package/dist/{chunk-RBJQYMMT.js.map → chunk-YRULQW5J.js.map} +0 -0
  610. /package/dist/{chunk-QUNDYIYZ.js.map → chunk-YYEOR4XN.js.map} +0 -0
  611. /package/dist/{chunk-6WHJ2EAB.js.map → chunk-Z64TS5V4.js.map} +0 -0
  612. /package/dist/{chunk-NHLLKEKK.js.map → chunk-ZAJLJ35W.js.map} +0 -0
  613. /package/dist/{chunk-M7V65M6H.js.map → chunk-ZKHSAMTE.js.map} +0 -0
  614. /package/dist/{resolution-EKJHREVJ.js.map → dreams-ledger-UCHHRQ4R.js.map} +0 -0
@@ -2,17 +2,30 @@ import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import { createHash } from "node:crypto";
3
3
  import { mkdir } from "node:fs/promises";
4
4
  import path from "node:path";
5
- import { withHeldFileLock } from "../utils/serialize-mutations.js";
5
+ import { raceAbort, throwIfAborted } from "../abort-error.js";
6
+ import {
7
+ CAPTURE_WRITE_LOCK_BUSY_MESSAGE,
8
+ type CaptureWriteLockLimitSource,
9
+ captureWriteLockDelayMs,
10
+ resolveCaptureWriteLockBackoffLimits,
11
+ } from "../capture-write-lock-backoff.js";
12
+ import { log } from "../logger.js";
6
13
  import type { MemoryFile, MemoryFrontmatter } from "../types.js";
14
+ import { withHeldFileLock } from "../utils/serialize-mutations.js";
15
+ import { sleepAbortable } from "../utils/sleep.js";
7
16
  import type { CasRevisionTransaction } from "./cas-revision-store.js";
8
- const TOMBSTONE_CAPTURE_WRITE_LOCK_STALE_MS = 60_000;
9
- const CAPTURE_WRITE_LOCK_MAX_ATTEMPTS = 3;
10
- const CAPTURE_WRITE_LOCK_RETRY_BASE_MS = 25;
11
- const CAPTURE_WRITE_LOCK_BUSY_MESSAGE = "tombstone-blocked capture write lock remained busy";
12
17
 
13
- export function isTombstoneBlockedCaptureWriteLockBusy(error: unknown): boolean {
14
- return error instanceof Error && error.message === CAPTURE_WRITE_LOCK_BUSY_MESSAGE;
15
- }
18
+ export { isTombstoneBlockedCaptureWriteLockBusy } from "../capture-write-lock-backoff.js";
19
+
20
+ const TOMBSTONE_CAPTURE_WRITE_LOCK_STALE_MS = 60_000;
21
+ /**
22
+ * One exclusive-create probe. The bounded wait lives in the outer backoff,
23
+ * which runs only after every lock from this attempt has been released.
24
+ * A multi-second poll here would hold an already-acquired sibling lock.
25
+ */
26
+ const CAPTURE_WRITE_LOCK_PROBE_MS = 1;
27
+ const CAPTURE_WRITE_LOCK_RETRY = Symbol("capture-write-lock-retry");
28
+ const CAPTURE_WRITE_LOCK_PERMANENT = Symbol("capture-write-lock-permanent-failure");
16
29
 
17
30
  export function normalizeExplicitCaptureContent(value: string): string {
18
31
  return value.toLowerCase().replace(/\s+/g, " ").trim();
@@ -46,6 +59,15 @@ export function captureIdentityHash(memory: MemoryFile): string {
46
59
  export type TombstoneBlockedCaptureWriteLockOptions = {
47
60
  readonly stateDir: string;
48
61
  readonly withHeldFileLock?: typeof withHeldFileLock;
62
+ /** Read when an acquire starts, after the caller has installed converge config. */
63
+ readonly lockOptions?: () => CaptureWriteLockLimitSource | undefined;
64
+ readonly now?: () => number;
65
+ readonly random?: () => number;
66
+ readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
67
+ readonly logDebug?: (message: string) => void;
68
+ readonly logWarn?: (message: string) => void;
69
+ /** Direct seam. Converge passes the same signal through `lockOptions` instead. */
70
+ readonly signal?: AbortSignal;
49
71
  };
50
72
 
51
73
  export class TombstoneBlockedCaptureWriteLock {
@@ -59,45 +81,107 @@ export class TombstoneBlockedCaptureWriteLock {
59
81
  return path.join(this.options.stateDir, "tombstone-blocked-capture", filename);
60
82
  }
61
83
 
62
- private async withSingleCaptureWriteLock<T>(lockPath: string, task: () => Promise<T>): Promise<T> {
84
+ private now(): number {
85
+ return this.options.now?.() ?? Date.now();
86
+ }
87
+
88
+ private debug(message: string): void {
89
+ if (this.options.logDebug) {
90
+ this.options.logDebug(message);
91
+ return;
92
+ }
93
+ log.debug(message);
94
+ }
95
+
96
+ private warn(message: string): void {
97
+ if (this.options.logWarn) {
98
+ this.options.logWarn(message);
99
+ return;
100
+ }
101
+ log.warn(message);
102
+ }
103
+
104
+ /** Prefer the constructor seam; converge installs the signal on lock options at acquire time. */
105
+ private captureAbortSignal(): AbortSignal | undefined {
106
+ return this.options.signal ?? this.options.lockOptions?.()?.captureWriteLockSignal;
107
+ }
108
+
109
+ /**
110
+ * One probe of a single lock file. Returns the retry symbol when the lock
111
+ * is busy and the permanent symbol on a filesystem error. Does not sleep:
112
+ * the caller backs off only after the whole chain has unwound.
113
+ */
114
+ private async withSingleCaptureWriteLockOnce<T>(
115
+ lockPath: string,
116
+ task: () => Promise<T | typeof CAPTURE_WRITE_LOCK_RETRY>
117
+ ): Promise<T | typeof CAPTURE_WRITE_LOCK_RETRY | typeof CAPTURE_WRITE_LOCK_PERMANENT> {
63
118
  await mkdir(path.dirname(lockPath), { recursive: true });
64
- const retry = Symbol("retry");
65
- const permanentFailure = Symbol("permanent-failure");
66
119
  const runWithHeldFileLock = this.options.withHeldFileLock ?? withHeldFileLock;
67
- for (let attempt = 0; attempt < CAPTURE_WRITE_LOCK_MAX_ATTEMPTS; attempt += 1) {
68
- const result = await runWithHeldFileLock<T | typeof retry | typeof permanentFailure>(
69
- lockPath,
70
- {
71
- staleMs: TOMBSTONE_CAPTURE_WRITE_LOCK_STALE_MS,
72
- maxWaitMs: 1_000,
73
- pollMs: 25,
74
- },
75
- async (acquired, controller) => {
76
- if (acquired) return await task();
77
- return controller.failure === "error" ? permanentFailure : retry;
78
- }
79
- );
80
- if (result === permanentFailure) {
81
- throw new Error("tombstone-blocked capture write lock acquisition failed");
120
+ return await runWithHeldFileLock(
121
+ lockPath,
122
+ {
123
+ staleMs: TOMBSTONE_CAPTURE_WRITE_LOCK_STALE_MS,
124
+ maxWaitMs: CAPTURE_WRITE_LOCK_PROBE_MS,
125
+ pollMs: CAPTURE_WRITE_LOCK_PROBE_MS,
126
+ },
127
+ async (acquired, controller) => {
128
+ if (acquired) return await task();
129
+ return controller.failure === "error" ? CAPTURE_WRITE_LOCK_PERMANENT : CAPTURE_WRITE_LOCK_RETRY;
82
130
  }
83
- if (result !== retry) return result;
84
- if (attempt === CAPTURE_WRITE_LOCK_MAX_ATTEMPTS - 1) break;
85
- const delayState = Promise.withResolvers<void>();
86
- setTimeout(delayState.resolve, CAPTURE_WRITE_LOCK_RETRY_BASE_MS * 2 ** attempt);
87
- await delayState.promise;
88
- }
89
- throw new Error(CAPTURE_WRITE_LOCK_BUSY_MESSAGE);
131
+ );
90
132
  }
133
+
91
134
  private async withPhysicalCaptureWriteLocks<T>(
92
135
  task: () => Promise<T>,
93
136
  identityHashes: readonly string[]
94
137
  ): Promise<T> {
138
+ const signal = this.captureAbortSignal();
95
139
  const lockPaths = [...new Set(identityHashes.map((hash) => this.captureWriteLockPathForHash(hash)))];
96
- const acquire = async (index: number): Promise<T> => {
97
- if (index === lockPaths.length) return await task();
98
- return await this.withSingleCaptureWriteLock(lockPaths[index], () => acquire(index + 1));
140
+ const limits = resolveCaptureWriteLockBackoffLimits(this.options.lockOptions?.());
141
+ const deadline = this.now() + limits.deadlineMs;
142
+ const giveUp = (): never => {
143
+ throwIfAborted(signal);
144
+ this.warn(
145
+ `tombstone-blocked capture write lock remained busy after ${limits.deadlineMs}ms; failing this write so the rest of the cycle can continue`
146
+ );
147
+ throw new Error(CAPTURE_WRITE_LOCK_BUSY_MESSAGE);
99
148
  };
100
- return await acquire(0);
149
+ const acquire = async (
150
+ index: number
151
+ ): Promise<T | typeof CAPTURE_WRITE_LOCK_RETRY | typeof CAPTURE_WRITE_LOCK_PERMANENT> => {
152
+ throwIfAborted(signal);
153
+ // The deadline gates each probe: a chain that started before the
154
+ // deadline must not keep probing locks (or run the write) after it.
155
+ const runTask = async (): Promise<T> => {
156
+ if (this.now() >= deadline) giveUp();
157
+ return await task();
158
+ };
159
+ if (index === lockPaths.length) return await runTask();
160
+ const lockPath = lockPaths[index];
161
+ if (lockPath === undefined) return await runTask();
162
+ if (this.now() >= deadline) giveUp();
163
+ return await this.withSingleCaptureWriteLockOnce(lockPath, () => acquire(index + 1));
164
+ };
165
+ for (let attempt = 0; ; attempt += 1) {
166
+ throwIfAborted(signal);
167
+ const outcome = await acquire(0);
168
+ if (outcome === CAPTURE_WRITE_LOCK_PERMANENT) {
169
+ throw new Error("tombstone-blocked capture write lock acquisition failed");
170
+ }
171
+ if (outcome !== CAPTURE_WRITE_LOCK_RETRY) return outcome;
172
+ throwIfAborted(signal);
173
+ const now = this.now();
174
+ if (now >= deadline) giveUp();
175
+ const delay = Math.min(
176
+ captureWriteLockDelayMs(attempt, limits, this.options.random ?? Math.random),
177
+ deadline - now
178
+ );
179
+ if (delay <= 0) giveUp();
180
+ this.debug(`tombstone-blocked capture write lock busy; backing off ${delay}ms before retry ${attempt + 1}`);
181
+ // raceAbort covers seam sleeps that ignore the signal; the default
182
+ // sleepAbortable also clears its timer so abort holds no Timeout.
183
+ await raceAbort((this.options.sleep ?? sleepAbortable)(delay, signal), signal);
184
+ }
101
185
  }
102
186
 
103
187
  async withCaptureWriteLock<T>(task: () => Promise<T>, identity?: string | readonly string[]): Promise<T> {
@@ -125,6 +209,7 @@ export class TombstoneBlockedCaptureWriteLock {
125
209
  identities: readonly string[],
126
210
  identityHashes: readonly string[]
127
211
  ): Promise<T> {
212
+ throwIfAborted(this.captureAbortSignal());
128
213
  const current = this.context.getStore();
129
214
  const hashToken = (key: string): string =>
130
215
  `\u0000${key.length === 0 ? "" : createHash("sha256").update(key).digest("hex")}`;
@@ -179,7 +264,10 @@ export class TombstoneBlockedCaptureWriteLock {
179
264
  next.add(hashToken(key));
180
265
  }
181
266
  for (const hash of hashes) next.add(`\u0000${hash}`);
182
- const run = () => this.context.run(next, task);
267
+ const run = () => {
268
+ throwIfAborted(this.captureAbortSignal());
269
+ return this.context.run(next, task);
270
+ };
183
271
  if (physicalMissing.length === 0) return await run();
184
272
  return await this.withPhysicalCaptureWriteLocks(run, physicalMissing);
185
273
  }
@@ -197,7 +285,10 @@ export type TombstoneBlockedMutationHost = {
197
285
  writeStorageSecureFile: (pathname: string, fileContent: string) => Promise<void>;
198
286
  withCaptureWriteLock: (task: () => Promise<void>, identity: string | readonly string[]) => Promise<void>;
199
287
  logWarning: (message: string) => void;
200
- beginDurableMemoryRevision?: (pathname: string, expectedContent?: string | Buffer | null) => Promise<CasRevisionTransaction | undefined>;
288
+ beginDurableMemoryRevision?: (
289
+ pathname: string,
290
+ expectedContent?: string | Buffer | null
291
+ ) => Promise<CasRevisionTransaction | undefined>;
201
292
  };
202
293
 
203
294
  export type TombstoneBlockedMutation = {
@@ -263,7 +354,7 @@ export async function runTombstoneBlockedMutation(
263
354
  await transaction.abort();
264
355
  } catch (abortError) {
265
356
  host.logWarning(
266
- `storage.tombstoneBlocked failed to abort the reserved receipt (pending marker preserved): ${abortError}`,
357
+ `storage.tombstoneBlocked failed to abort the reserved receipt (pending marker preserved): ${abortError}`
267
358
  );
268
359
  }
269
360
  }
@@ -280,7 +371,7 @@ export async function runTombstoneBlockedMutation(
280
371
  await transaction.writeLanded();
281
372
  } catch (evidenceError) {
282
373
  host.logWarning(
283
- `storage.tombstoneBlocked failed to record receipt crash evidence (pending marker preserved): ${evidenceError}`,
374
+ `storage.tombstoneBlocked failed to record receipt crash evidence (pending marker preserved): ${evidenceError}`
284
375
  );
285
376
  }
286
377
  try {
@@ -292,7 +383,7 @@ export async function runTombstoneBlockedMutation(
292
383
  // and promotion/rollback refuse until recovery reconciles. The
293
384
  // reservation must NOT be aborted: the write is on disk.
294
385
  host.logWarning(
295
- `storage.tombstoneBlocked receipt publication failed after the memory write (pending marker preserved for recovery): ${err}`,
386
+ `storage.tombstoneBlocked receipt publication failed after the memory write (pending marker preserved for recovery): ${err}`
296
387
  );
297
388
  await discardRebuildMarker();
298
389
  throw err;
@@ -318,7 +409,6 @@ export async function runTombstoneBlockedMutation(
318
409
  }
319
410
  }
320
411
 
321
-
322
412
  export function tombstoneBlocked(frontmatter: MemoryFrontmatter): boolean {
323
413
  return frontmatter.status === "pending_review" && Boolean(frontmatter.blockedBy);
324
414
  }
package/src/storage.ts CHANGED
@@ -65,6 +65,7 @@ import { readEntityAliasConfigSync } from "./storage/entity-alias-config.js";
65
65
  import { assertSafeEntityId } from "./storage/entity-id-safety.js";
66
66
  export { normalizeEntityName } from "./entity-id-normalization.js";
67
67
  import { isErrnoCode } from "./utils/errno.js";
68
+ import { isMacOsReplicationJunkBasename } from "./utils/macos-replication-junk.js";
68
69
  import { getCategoryDir, categoryDirName } from "./utils/category-dir.js";
69
70
  import { decodeYamlScalar } from "./utils/yaml-scalar.js";
70
71
  import { qmdCollectionPathParts, qmdResultPathCandidates } from "./orchestration/qmd-result-resolver.js";
@@ -3219,6 +3220,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
3219
3220
  secureStoreKeyProvider: () => this._secureStoreKey,
3220
3221
  secureStoreWriteKeyProvider: () => this.resolveWriteKey(),
3221
3222
  lockOptions: () => this.factHashIndexLockOptions,
3223
+ captureLockLimitSource: () => this.captureLockLimitSource(),
3222
3224
  parseMemory: (filePath, content) =>
3223
3225
  parseTombstoneBlockedOfflineSyncMemory(
3224
3226
  filePath,
@@ -3232,6 +3234,18 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
3232
3234
  readAllColdMemories: () => this.readAllColdMemories(),
3233
3235
  };
3234
3236
  }
3237
+
3238
+ /**
3239
+ * Lock-limit source for tombstone-blocked captures. Undefined until the
3240
+ * converge path installs capture-lock limits, so an ordinary capture
3241
+ * resolves to the legacy short bounds instead of the converge deadline.
3242
+ */
3243
+ private captureLockLimitSource(): ContentHashIndexLockOptions | undefined {
3244
+ const options = this.factHashIndexLockOptions;
3245
+ const keys = ["captureWriteLockInitialDelayMs", "captureWriteLockMaxDelayMs", "captureWriteLockDeadlineMs", "captureWriteLockSignal"] as const;
3246
+ return keys.some((key) => options[key] !== undefined) ? options : undefined;
3247
+ }
3248
+
3235
3249
  private async getFactHashIndex(): Promise<ContentHashIndex> {
3236
3250
  if (this.factHashIndex) {
3237
3251
  return this.factHashIndex;
@@ -4869,7 +4883,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
4869
4883
 
4870
4884
  const readDir = async (dir: string) => {
4871
4885
  try {
4872
- const entries = await readdir(dir, { withFileTypes: true });
4886
+ const entries = (await readdir(dir, { withFileTypes: true })).filter((e) => !isMacOsReplicationJunkBasename(e.name));
4873
4887
  for (const entry of entries) {
4874
4888
  checkCorpusReadAbort(options);
4875
4889
  const fullPath = path.join(dir, entry.name);
@@ -7120,7 +7134,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
7120
7134
  const summaries: MemorySummary[] = [];
7121
7135
 
7122
7136
  for (const file of files) {
7123
- if (!file.endsWith(".json")) continue;
7137
+ if (isMacOsReplicationJunkBasename(file) || !file.endsWith(".json")) continue;
7124
7138
  const filePath = path.join(this.summariesDir, file);
7125
7139
  const raw = await this.readStorageSecureFile(filePath);
7126
7140
  summaries.push(JSON.parse(raw) as MemorySummary);
package/src/transcript.ts CHANGED
@@ -6,6 +6,7 @@ import { analyzeSessionIntegrity, type SessionIntegrityReport } from "./session-
6
6
  import { isDailyFileDatedBefore, resolveSafeStoragePath } from "./storage-paths.js";
7
7
  import { sessionStoragePaths } from "./session-identity.js";
8
8
  import { estimateTokenCount } from "./token-estimate.js";
9
+ import { isMacOsReplicationJunkBasename } from "./utils/macos-replication-junk.js";
9
10
 
10
11
  type DirectorySessionStatus = "missing" | "empty" | "matches" | "occupied";
11
12
  type DirectoryOwnershipCacheEntry = {
@@ -166,7 +167,7 @@ export class TranscriptManager {
166
167
  for (const idEnt of idEntries) {
167
168
  if (!idEnt.isDirectory()) continue;
168
169
  const chanDir = path.join(typeDir, idEnt.name);
169
- const files = (await readdir(chanDir)).filter((f) => f.endsWith(".jsonl")).sort();
170
+ const files = (await readdir(chanDir)).filter((f) => f.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(f)).sort();
170
171
  const last = files[files.length - 1];
171
172
  if (!last) continue;
172
173
  try {
@@ -261,7 +262,7 @@ export class TranscriptManager {
261
262
 
262
263
  let names: string[];
263
264
  try {
264
- names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl"));
265
+ names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(file));
265
266
  } catch {
266
267
  return "occupied";
267
268
  }
@@ -345,7 +346,7 @@ export class TranscriptManager {
345
346
  ): Promise<void> {
346
347
  try {
347
348
  const channelDir = await resolveSafeStoragePath(root, dir);
348
- const names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl"));
349
+ const names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(file));
349
350
  const fileSizes = await this.directoryJsonlFileSizes(root, dir, names);
350
351
  if (!fileSizes) return;
351
352
  this.directoryOwnershipCache.set(
@@ -380,7 +381,7 @@ export class TranscriptManager {
380
381
 
381
382
  let names: string[];
382
383
  try {
383
- names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl")).sort();
384
+ names = (await readdir(channelDir)).filter((file) => file.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(file)).sort();
384
385
  } catch {
385
386
  continue;
386
387
  }
@@ -641,14 +642,14 @@ export class TranscriptManager {
641
642
  try {
642
643
  const channelFiles = await readdir(channelDir);
643
644
  for (const file of channelFiles) {
644
- if (file.endsWith(".jsonl")) {
645
+ if (file.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(file)) {
645
646
  files.push(path.join(entry.name, channelTypeEntry.name, file));
646
647
  }
647
648
  }
648
649
  } catch {
649
650
  // Skip unreadable directories
650
651
  }
651
- } else if (channelTypeEntry.isFile() && channelTypeEntry.name.endsWith(".jsonl")) {
652
+ } else if (channelTypeEntry.isFile() && channelTypeEntry.name.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(channelTypeEntry.name)) {
652
653
  // Legacy: channel type dir contains .jsonl files directly
653
654
  files.push(path.join(entry.name, channelTypeEntry.name));
654
655
  }
@@ -656,7 +657,7 @@ export class TranscriptManager {
656
657
  } catch {
657
658
  // Skip unreadable directories
658
659
  }
659
- } else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
660
+ } else if (entry.isFile() && entry.name.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(entry.name)) {
660
661
  // Legacy flat file - still include for backward compatibility
661
662
  files.push(entry.name);
662
663
  }
@@ -865,7 +866,7 @@ export class TranscriptManager {
865
866
  try {
866
867
  const channelFiles = await readdir(channelDir);
867
868
  for (const file of channelFiles) {
868
- if (!file.endsWith(".jsonl")) continue;
869
+ if (isMacOsReplicationJunkBasename(file) || !file.endsWith(".jsonl")) continue;
869
870
 
870
871
  const filePath = path.join(channelDir, file);
871
872
 
@@ -894,7 +895,7 @@ export class TranscriptManager {
894
895
  } catch (err) {
895
896
  log.debug(`failed to process channel directory ${entry.name}/${channelTypeEntry.name}:`, err);
896
897
  }
897
- } else if (channelTypeEntry.isFile() && channelTypeEntry.name.endsWith(".jsonl")) {
898
+ } else if (channelTypeEntry.isFile() && channelTypeEntry.name.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(channelTypeEntry.name)) {
898
899
  // Legacy: channel type dir contains .jsonl files directly
899
900
  const filePath = path.join(channelTypeDir, channelTypeEntry.name);
900
901
  const cleaned = await this.cleanupTranscriptFile(filePath, cutoff);
@@ -906,7 +907,7 @@ export class TranscriptManager {
906
907
  } catch (err) {
907
908
  log.debug(`failed to process channel type directory ${entry.name}:`, err);
908
909
  }
909
- } else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
910
+ } else if (entry.isFile() && entry.name.endsWith(".jsonl") && !isMacOsReplicationJunkBasename(entry.name)) {
910
911
  // Handle legacy flat files - delete if older than retentionDays
911
912
  if (this.isLegacyTranscriptFile(entry.name)) {
912
913
  const dateStr = entry.name.slice(0, 10);
package/src/types.ts CHANGED
@@ -41,6 +41,15 @@ export interface ConvergeConfig {
41
41
  conflictPolicy: ConvergeConflictPolicy;
42
42
  /** Per-request peer HTTP timeout in ms (plan/apply/watch). Default 30000; clamped to <= 3600000. */
43
43
  peerRequestTimeoutMs?: number;
44
+ /**
45
+ * Tombstone-blocked capture write-lock backoff for converge apply/watch.
46
+ * Defaults: 50ms initial (jittered to 25–50), 2000ms cap per wait, 60000ms
47
+ * deadline. Positive integers, clamped to <= 3600000. An inverted schedule
48
+ * (initial > max, or max > deadline) is rejected.
49
+ */
50
+ captureWriteLockInitialDelayMs?: number;
51
+ captureWriteLockMaxDelayMs?: number;
52
+ captureWriteLockDeadlineMs?: number;
44
53
  }
45
54
  export type SignalLevel = "none" | "low" | "medium" | "high";
46
55
  export type MemoryCategory =
@@ -0,0 +1,46 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import {
5
+ isMacOsReplicationJunkBasename,
6
+ isMacOsReplicationJunkRelativePath,
7
+ warnIgnoredMacOsReplicationJunk,
8
+ withoutMacOsReplicationJunk,
9
+ } from "./macos-replication-junk.js";
10
+
11
+ test("macOS replication junk is AppleDouble sidecars and .DS_Store only", () => {
12
+ assert.equal(isMacOsReplicationJunkBasename("._project-notes.md"), true);
13
+ assert.equal(isMacOsReplicationJunkBasename("._"), true);
14
+ assert.equal(isMacOsReplicationJunkBasename(".DS_Store"), true);
15
+ assert.equal(isMacOsReplicationJunkBasename("project-notes.md"), false);
16
+ assert.equal(isMacOsReplicationJunkBasename(".gitignore"), false);
17
+ assert.equal(isMacOsReplicationJunkBasename("DS_Store"), false);
18
+ assert.equal(isMacOsReplicationJunkRelativePath("namespaces/lab/entities/._project-notes.md"), true);
19
+ assert.equal(isMacOsReplicationJunkRelativePath("namespaces\\lab\\.DS_Store"), true);
20
+ assert.equal(isMacOsReplicationJunkRelativePath("entities/project-notes.md"), false);
21
+ });
22
+
23
+ test("withoutMacOsReplicationJunk keeps real names and counts junk once", () => {
24
+ const { kept, ignored } = withoutMacOsReplicationJunk(
25
+ ["project-notes.md", "._project-notes.md", ".DS_Store", "correction-1.md"],
26
+ (name) => name
27
+ );
28
+ assert.deepEqual(kept, ["project-notes.md", "correction-1.md"]);
29
+ assert.equal(ignored, 2);
30
+ });
31
+
32
+ test("warnIgnoredMacOsReplicationJunk emits one summary per directory and count", () => {
33
+ const messages: string[] = [];
34
+ const warn = (message: string) => {
35
+ messages.push(message);
36
+ };
37
+ const directory = `junk-warn-${process.pid}-${Date.now()}`;
38
+ warnIgnoredMacOsReplicationJunk(directory, 2, warn);
39
+ warnIgnoredMacOsReplicationJunk(directory, 2, warn);
40
+ warnIgnoredMacOsReplicationJunk(directory, 0, warn);
41
+ warnIgnoredMacOsReplicationJunk(directory, 3, warn);
42
+ assert.deepEqual(messages, [
43
+ "ignored 2 macOS replication junk file(s) (._* and .DS_Store)",
44
+ "ignored 3 macOS replication junk file(s) (._* and .DS_Store)",
45
+ ]);
46
+ });
@@ -0,0 +1,65 @@
1
+ /**
2
+ * macOS Finder metadata that arrives through Mac-to-Linux copies.
3
+ *
4
+ * AppleDouble sidecars are named `._` plus the real file's basename
5
+ * (`._project-notes.md` beside `project-notes.md`). Finder also writes
6
+ * `.DS_Store` into any directory it opens. Neither is a Remnic record.
7
+ * Directory scanners and replication must ignore them so they are never
8
+ * parsed as entities, memories, or sync objects.
9
+ *
10
+ * QMD's own indexer already drops every hidden path (`dot: false` plus a
11
+ * hidden-segment filter). Callers that build index inputs themselves still
12
+ * use this helper so the non-QMD scanners stay in parity.
13
+ */
14
+
15
+ const warnedJunkDirectories = new Set<string>();
16
+
17
+ /** True for an AppleDouble sidecar or a Finder `.DS_Store` file. */
18
+ export function isMacOsReplicationJunkBasename(basename: string): boolean {
19
+ return basename === ".DS_Store" || basename.startsWith("._");
20
+ }
21
+
22
+ /** True when the final path segment is macOS replication junk. */
23
+ export function isMacOsReplicationJunkRelativePath(relPath: string): boolean {
24
+ const normalized = relPath.includes("\\") ? relPath.replaceAll("\\", "/") : relPath;
25
+ const slash = normalized.lastIndexOf("/");
26
+ const basename = slash === -1 ? normalized : normalized.slice(slash + 1);
27
+ return isMacOsReplicationJunkBasename(basename);
28
+ }
29
+
30
+ /**
31
+ * Drop junk names from a directory listing. `ignored` is the count of
32
+ * names removed, so the caller can emit one summary warning.
33
+ */
34
+ export function withoutMacOsReplicationJunk<T>(
35
+ entries: readonly T[],
36
+ basenameOf: (entry: T) => string
37
+ ): { kept: T[]; ignored: number } {
38
+ const kept: T[] = [];
39
+ let ignored = 0;
40
+ for (const entry of entries) {
41
+ if (isMacOsReplicationJunkBasename(basenameOf(entry))) {
42
+ ignored += 1;
43
+ continue;
44
+ }
45
+ kept.push(entry);
46
+ }
47
+ return { kept, ignored };
48
+ }
49
+
50
+ /**
51
+ * Emit at most one junk warning per directory and count. A later scan of
52
+ * the same directory (entity migration, then entity load) stays quiet
53
+ * instead of repeating the same summary.
54
+ */
55
+ export function warnIgnoredMacOsReplicationJunk(
56
+ directoryKey: string,
57
+ count: number,
58
+ warn: (message: string) => void
59
+ ): void {
60
+ if (count <= 0) return;
61
+ const key = `${directoryKey}\0${count}`;
62
+ if (warnedJunkDirectories.has(key)) return;
63
+ warnedJunkDirectories.add(key);
64
+ warn(`ignored ${count} macOS replication junk file(s) (._* and .DS_Store)`);
65
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Heading and type flags for an entity markdown body.
3
+ *
4
+ * The heading rule matches `parseEntityFile`: a line must start with `# `
5
+ * (hash, space) and the remainder must contain a name. A tab after `#`
6
+ * is not a heading. The type rule matches a `**Type:**` line with a
7
+ * non-empty value. A missing type line is still readable: the parser
8
+ * defaults the type to `other`.
9
+ */
10
+ function entityRecordFlags(content: string): { hasName: boolean; hasType: boolean } {
11
+ const body = entityRecordBody(content);
12
+ let hasName = false;
13
+ let hasType = false;
14
+ let start = 0;
15
+ while (start <= body.length) {
16
+ const newline = body.indexOf("\n", start);
17
+ const end = newline === -1 ? body.length : newline;
18
+ let line = body.slice(start, end);
19
+ if (line.endsWith("\r")) line = line.slice(0, -1);
20
+ if (!hasName && line.startsWith("# ") && line.slice(2).trim().length > 0) hasName = true;
21
+ if (!hasType && line.startsWith("**Type:**") && line.slice("**Type:**".length).trim().length > 0) {
22
+ hasType = true;
23
+ }
24
+ if (hasName && hasType) return { hasName, hasType };
25
+ if (newline === -1) break;
26
+ start = newline + 1;
27
+ }
28
+ return { hasName, hasType };
29
+ }
30
+
31
+ /**
32
+ * No `# ` name. A named file whose type line is absent stays readable:
33
+ * `parseEntityFile` defaults the type to `other`.
34
+ */
35
+ export function isUnnamedEntityRecord(content: string): boolean {
36
+ return !entityRecordFlags(content).hasName;
37
+ }
38
+
39
+ function entityBodyHasText(content: string): boolean {
40
+ const body = entityRecordBody(content);
41
+ for (let i = 0; i < body.length; i++) {
42
+ const char = body.charCodeAt(i);
43
+ if (char !== 32 && char !== 9 && char !== 10 && char !== 13) return true;
44
+ }
45
+ return false;
46
+ }
47
+
48
+ /**
49
+ * Unnamed entity body that still has text. An empty body under frontmatter
50
+ * stays readable so a canonical filename can supply the type. A tab heading,
51
+ * a blank `# ` heading, or prose with no name does not.
52
+ */
53
+ export function isPopulatedUnnamedEntityRecord(content: string): boolean {
54
+ return isUnnamedEntityRecord(content) && entityBodyHasText(content);
55
+ }
56
+
57
+ /**
58
+ * Unnamed file that still looks like an entity record (`#` or `**Type:**`).
59
+ * Direct filename recall keeps unstructured placeholders such as "content".
60
+ */
61
+ export function isShapedUnnamedEntityRecord(content: string): boolean {
62
+ if (!isUnnamedEntityRecord(content)) return false;
63
+ const body = entityRecordBody(content);
64
+ let start = 0;
65
+ while (start <= body.length) {
66
+ const newline = body.indexOf("\n", start);
67
+ const end = newline === -1 ? body.length : newline;
68
+ let line = body.slice(start, end);
69
+ if (line.endsWith("\r")) line = line.slice(0, -1);
70
+ if (line.startsWith("#") || line.startsWith("**Type:**")) return true;
71
+ if (newline === -1) break;
72
+ start = newline + 1;
73
+ }
74
+ return false;
75
+ }
76
+
77
+ /**
78
+ * Migration gate. Canonical ids are derived from name and type, and the
79
+ * old startup throw required an explicit `**Type:**` line. Files that
80
+ * only have a heading stay on disk and are not renamed. Listing does not
81
+ * use this predicate: `parseEntityFile` defaults a missing type to `other`.
82
+ */
83
+ export function isMalformedEntityRecord(content: string): boolean {
84
+ const flags = entityRecordFlags(content);
85
+ return !flags.hasName || !flags.hasType;
86
+ }
87
+
88
+ function entityRecordBody(content: string): string {
89
+ const firstNewline = content.indexOf("\n");
90
+ if (firstNewline === -1) return content;
91
+ const firstLine = content.slice(0, firstNewline).endsWith("\r")
92
+ ? content.slice(0, firstNewline - 1)
93
+ : content.slice(0, firstNewline);
94
+ if (firstLine !== "---") return content;
95
+ const close = content.indexOf("\n---", firstNewline + 1);
96
+ if (close === -1) return content;
97
+ let rest = close + "\n---".length;
98
+ if (content.charAt(rest) === "\r") rest += 1;
99
+ if (content.charAt(rest) === "\n") rest += 1;
100
+ return content.slice(rest);
101
+ }
@@ -3,3 +3,31 @@ export function sleep(ms: number): Promise<void> {
3
3
  // Constructor form keeps this reachable utility compatible with ES2022 adapter type graphs.
4
4
  return new Promise((resolve) => setTimeout(resolve, ms));
5
5
  }
6
+
7
+ import { abortError } from "../abort-error.js";
8
+
9
+ /**
10
+ * Wait until `ms` elapses, or reject with `AbortError` when `signal` fires.
11
+ * The timer is cleared on abort so a cancelled wait holds no Timeout handle.
12
+ * Executor form: this module targets ES2022 type graphs (no withResolvers).
13
+ */
14
+ export function sleepAbortable(ms: number, signal?: AbortSignal): Promise<void> {
15
+ return new Promise((resolve, reject) => {
16
+ if (signal?.aborted) {
17
+ reject(abortError("operation aborted"));
18
+ return;
19
+ }
20
+ const timer = setTimeout(() => {
21
+ if (signal && onAbort) signal.removeEventListener("abort", onAbort);
22
+ resolve();
23
+ }, ms);
24
+ let onAbort: (() => void) | null = null;
25
+ if (signal) {
26
+ onAbort = () => {
27
+ clearTimeout(timer);
28
+ reject(abortError("operation aborted"));
29
+ };
30
+ signal.addEventListener("abort", onAbort, { once: true });
31
+ }
32
+ });
33
+ }