@remnic/core 10.0.14 → 10.0.16

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 (366) hide show
  1. package/dist/abstraction-nodes.js +3 -2
  2. package/dist/access-admin-ops-surface.js +34 -32
  3. package/dist/access-authorization-probe.js +35 -33
  4. package/dist/access-boundary.js +34 -32
  5. package/dist/access-cli.js +90 -88
  6. package/dist/access-cli.js.map +1 -1
  7. package/dist/access-extraction-force-flush.js +34 -32
  8. package/dist/access-http-briefing.js +35 -33
  9. package/dist/access-http-query.js +36 -34
  10. package/dist/access-http.js +53 -51
  11. package/dist/access-identity-continuity-surface.js +34 -32
  12. package/dist/access-lcm-surface.js +34 -32
  13. package/dist/access-mcp.js +45 -43
  14. package/dist/access-namespace-preflight.js +34 -32
  15. package/dist/access-observe-write-category.js +4 -3
  16. package/dist/access-observe-write-surface.js +34 -32
  17. package/dist/access-offline-manifest.js +3 -2
  18. package/dist/access-operations-batch.js +37 -35
  19. package/dist/access-operations.js +44 -42
  20. package/dist/access-recall-concurrency.js +34 -32
  21. package/dist/access-recall-response.js +34 -32
  22. package/dist/access-recall-surface.js +34 -32
  23. package/dist/access-schema.js +3 -2
  24. package/dist/access-service.js +34 -32
  25. package/dist/access-surface-catalog.js +36 -34
  26. package/dist/access-surface-catalog.js.map +1 -1
  27. package/dist/active-recall.js +14 -12
  28. package/dist/active-recall.js.map +1 -1
  29. package/dist/briefing.js +10 -8
  30. package/dist/buffer.js +2 -2
  31. package/dist/calibration.d.ts.map +1 -1
  32. package/dist/calibration.js +6 -3
  33. package/dist/calibration.js.map +1 -1
  34. package/dist/causal-behavior.js +4 -3
  35. package/dist/causal-behavior.js.map +1 -1
  36. package/dist/causal-chain.js +4 -3
  37. package/dist/causal-consolidation.js +14 -12
  38. package/dist/causal-consolidation.js.map +1 -1
  39. package/dist/causal-retrieval.js +4 -3
  40. package/dist/causal-retrieval.js.map +1 -1
  41. package/dist/causal-trajectory.js +3 -2
  42. package/dist/{chunk-63B2IZYE.js → chunk-23ZQPP2G.js} +6 -1
  43. package/dist/chunk-23ZQPP2G.js.map +1 -0
  44. package/dist/{chunk-YFMBHQRG.js → chunk-2PTH4PRL.js} +2 -2
  45. package/dist/{chunk-TITG2NBS.js → chunk-2PYHLSXK.js} +2 -2
  46. package/dist/{chunk-B6O2YLUR.js → chunk-2Z5DIDQD.js} +6 -1
  47. package/dist/chunk-2Z5DIDQD.js.map +1 -0
  48. package/dist/{chunk-KH2LKDX7.js → chunk-33G67YZF.js} +2 -2
  49. package/dist/{chunk-SWIKABKI.js → chunk-3Q3XD3NO.js} +2 -2
  50. package/dist/{chunk-4KY5GSMB.js → chunk-4PDTVVSW.js} +2 -2
  51. package/dist/{chunk-HM7RHKS4.js → chunk-4RNBLLZR.js} +2 -2
  52. package/dist/{chunk-PAZ35RJ4.js → chunk-4SCZZ3U7.js} +240 -55
  53. package/dist/chunk-4SCZZ3U7.js.map +1 -0
  54. package/dist/{chunk-Y4NKEXQT.js → chunk-5ATSXCAG.js} +3 -3
  55. package/dist/{chunk-JDZFIR2S.js → chunk-5KGYTX5O.js} +2 -2
  56. package/dist/{chunk-J7JWFZHI.js → chunk-5MLGY6IY.js} +39 -39
  57. package/dist/{chunk-NW2E4CI2.js → chunk-5SMR542T.js} +2 -2
  58. package/dist/{chunk-S7LWX2PQ.js → chunk-655FVTCD.js} +2 -2
  59. package/dist/{chunk-4OSG5Y6M.js → chunk-6YEPGWUP.js} +2 -2
  60. package/dist/{chunk-W47S5TIH.js → chunk-7VQ6AI7H.js} +2 -2
  61. package/dist/{chunk-WLMZ2L5P.js → chunk-AZDTDWS2.js} +2 -2
  62. package/dist/{chunk-G7NYVKD6.js → chunk-B2NXOVZN.js} +2 -2
  63. package/dist/{chunk-N7KYEVLK.js → chunk-BK2BVLZW.js} +2 -2
  64. package/dist/{chunk-QJ622LTI.js → chunk-BQOGQULP.js} +30 -8
  65. package/dist/chunk-BQOGQULP.js.map +1 -0
  66. package/dist/{chunk-S2I7DL5Q.js → chunk-C2RW36YR.js} +2 -2
  67. package/dist/{chunk-P5NQN4JE.js → chunk-C6JMGAMO.js} +6 -2
  68. package/dist/chunk-C6JMGAMO.js.map +1 -0
  69. package/dist/{chunk-6LG7BWKW.js → chunk-CFZ4SXXH.js} +2 -2
  70. package/dist/{chunk-JQ7XU625.js → chunk-CQOIWJ5E.js} +6 -6
  71. package/dist/{chunk-FSIMZNBC.js → chunk-CXOYUANR.js} +2 -2
  72. package/dist/{chunk-BLVHDY2U.js → chunk-DOWACHYO.js} +5 -2
  73. package/dist/chunk-DOWACHYO.js.map +1 -0
  74. package/dist/{chunk-QOZJCSFO.js → chunk-DQR2LD3V.js} +2 -2
  75. package/dist/{chunk-MATDGSJ7.js → chunk-DUPHIZBY.js} +2 -2
  76. package/dist/{chunk-EBA5DA77.js → chunk-EOU6V4IN.js} +2 -2
  77. package/dist/{chunk-5WCJLQTM.js → chunk-F2772ATT.js} +2 -2
  78. package/dist/{chunk-46EST7JO.js → chunk-F2XNSIPP.js} +2 -2
  79. package/dist/{chunk-PZHQWFR3.js → chunk-G3UUAQOD.js} +2 -2
  80. package/dist/{chunk-YE36AJL7.js → chunk-GCVDFX66.js} +2 -2
  81. package/dist/{chunk-ZV65I6ME.js → chunk-GFWRXPF6.js} +29 -26
  82. package/dist/chunk-GFWRXPF6.js.map +1 -0
  83. package/dist/{chunk-T2YX56QI.js → chunk-GQJKVQJR.js} +2 -2
  84. package/dist/{chunk-I7S55EOB.js → chunk-GUY6L6LL.js} +2 -2
  85. package/dist/{chunk-L5DAHSEZ.js → chunk-GWVNGDJW.js} +2 -2
  86. package/dist/{chunk-N45NEBOD.js → chunk-GZXXPCWJ.js} +3 -3
  87. package/dist/{chunk-EPJDSQHF.js → chunk-H5IUN433.js} +2 -2
  88. package/dist/{chunk-EUAIYYYR.js → chunk-H6FREOYX.js} +7 -7
  89. package/dist/{chunk-Q4E24IRR.js → chunk-HDN7IVIO.js} +14 -11
  90. package/dist/chunk-HDN7IVIO.js.map +1 -0
  91. package/dist/{chunk-T3FMRLWQ.js → chunk-HFSPY26A.js} +2 -2
  92. package/dist/{chunk-GH7AOMJD.js → chunk-IJMDBYCO.js} +2 -2
  93. package/dist/{chunk-4IHBN6WU.js → chunk-JKMIGCK6.js} +2 -2
  94. package/dist/{chunk-ROBHL3GL.js → chunk-JWX2Q6HS.js} +2 -2
  95. package/dist/{chunk-DPR2WTN3.js → chunk-JZTEOBOR.js} +16 -16
  96. package/dist/{chunk-4O6WRBGE.js → chunk-KJXP6RUG.js} +5 -1
  97. package/dist/chunk-KJXP6RUG.js.map +1 -0
  98. package/dist/{chunk-JIHMUOOS.js → chunk-KLJVTZ3R.js} +3 -3
  99. package/dist/{chunk-FP4JYE66.js → chunk-KW4AJ7T3.js} +2 -2
  100. package/dist/{chunk-NIRQGDYC.js → chunk-L5VCT7LU.js} +5 -1
  101. package/dist/chunk-L5VCT7LU.js.map +1 -0
  102. package/dist/{chunk-QODKDRSP.js → chunk-L6AZOEXV.js} +4 -4
  103. package/dist/{chunk-CLWBFR7Q.js → chunk-LO76EF3Y.js} +1 -1
  104. package/dist/chunk-LO76EF3Y.js.map +1 -0
  105. package/dist/{chunk-LS2FHUML.js → chunk-LQ5SS4OP.js} +3 -3
  106. package/dist/{chunk-SIIRTDJ4.js → chunk-LWFWZTWX.js} +2 -2
  107. package/dist/{chunk-BMWN7B3Y.js → chunk-LXATZLSC.js} +3 -3
  108. package/dist/{chunk-O4SGYW7H.js → chunk-MAVYEZKM.js} +2 -2
  109. package/dist/{chunk-B665A6BO.js → chunk-MJIOGYKX.js} +2 -2
  110. package/dist/{chunk-RTKV5XHL.js → chunk-MO6N4QYY.js} +2 -2
  111. package/dist/{chunk-N4C7QKOG.js → chunk-MWWAQXZ6.js} +2 -2
  112. package/dist/{chunk-LCKVXX5F.js → chunk-MXV2MY6C.js} +2 -2
  113. package/dist/{chunk-FFOVKNQV.js → chunk-NAGMQXWV.js} +2 -2
  114. package/dist/{chunk-ZJVMUBYF.js → chunk-NHUX6GXA.js} +6 -6
  115. package/dist/{chunk-CB6ANA2I.js → chunk-NZCKG25S.js} +2 -2
  116. package/dist/{chunk-UMTCNEVQ.js → chunk-O2YPCFJT.js} +11 -11
  117. package/dist/{chunk-WSGPFRBH.js → chunk-OMERTLB7.js} +3 -3
  118. package/dist/{chunk-QX6JN3O4.js → chunk-PEF5LHQU.js} +6 -6
  119. package/dist/{chunk-JYZSRNR7.js → chunk-PIITB2YZ.js} +2 -2
  120. package/dist/chunk-PPUNC7UX.js +73 -0
  121. package/dist/chunk-PPUNC7UX.js.map +1 -0
  122. package/dist/{chunk-EQWEIIKQ.js → chunk-PQM3B54K.js} +6 -1
  123. package/dist/chunk-PQM3B54K.js.map +1 -0
  124. package/dist/{chunk-UQDG3YLN.js → chunk-PRU7OF3Y.js} +3 -3
  125. package/dist/{chunk-EU534WGS.js → chunk-PVHQSLNN.js} +7 -7
  126. package/dist/{chunk-TZNDKTX5.js → chunk-Q7DWEXG2.js} +37 -33
  127. package/dist/chunk-Q7DWEXG2.js.map +1 -0
  128. package/dist/{chunk-5VC7J76U.js → chunk-QPH52AZB.js} +2 -2
  129. package/dist/{chunk-XISROV24.js → chunk-QSEUUQUF.js} +2 -2
  130. package/dist/chunk-QUIRIG2P.js +31 -0
  131. package/dist/chunk-QUIRIG2P.js.map +1 -0
  132. package/dist/{chunk-FUFAXVBA.js → chunk-RI2KCQHP.js} +6 -2
  133. package/dist/chunk-RI2KCQHP.js.map +1 -0
  134. package/dist/{chunk-O2IPAX26.js → chunk-RTTPBBAN.js} +4 -4
  135. package/dist/{chunk-W5MCEVUS.js → chunk-RYYVMZBR.js} +2 -2
  136. package/dist/{chunk-ZSH2NRDV.js → chunk-TN4EA4X4.js} +2 -2
  137. package/dist/{chunk-SS3IS2JR.js → chunk-UGYUBENJ.js} +2 -2
  138. package/dist/{chunk-GELS5Z5Z.js → chunk-V3TXIXXY.js} +3 -3
  139. package/dist/{chunk-WVADKFWV.js → chunk-VNZMZPAC.js} +2 -2
  140. package/dist/{chunk-JPTPS4OB.js → chunk-VPXIKBPX.js} +2 -2
  141. package/dist/{chunk-OP6N4H6A.js → chunk-W3FVQBGF.js} +2 -2
  142. package/dist/{chunk-W3K3HITK.js → chunk-WLT6LTQP.js} +2 -2
  143. package/dist/{chunk-GMXWTJNU.js → chunk-XKRXN63M.js} +2 -2
  144. package/dist/{chunk-KR6ZKECI.js → chunk-XYGQSDTH.js} +3 -3
  145. package/dist/{chunk-22W2XWGH.js → chunk-YBO2WGCV.js} +2 -2
  146. package/dist/{chunk-P7TOIOT7.js → chunk-YR4COAEC.js} +2 -2
  147. package/dist/{chunk-6WHJ2EAB.js → chunk-Z64TS5V4.js} +2 -2
  148. package/dist/{chunk-NHLLKEKK.js → chunk-ZAJLJ35W.js} +2 -2
  149. package/dist/cli.d.ts.map +1 -1
  150. package/dist/cli.js +73 -71
  151. package/dist/coding/export-okf-codegraph.js +9 -7
  152. package/dist/coding/export-okf-codegraph.js.map +1 -1
  153. package/dist/coding/pre-action-gate.js +4 -3
  154. package/dist/commitment-ledger.js +3 -2
  155. package/dist/compounding/engine.js +11 -9
  156. package/dist/config.js +14 -12
  157. package/dist/connectors/codex-materialize-runner.js +10 -8
  158. package/dist/connectors/index.js +10 -8
  159. package/dist/consolidation-provenance-check.d.ts.map +1 -1
  160. package/dist/consolidation-provenance-check.js +2 -1
  161. package/dist/contradiction/index.js +3 -2
  162. package/dist/convergence-refresh.js +12 -10
  163. package/dist/corpus-watermark.js +12 -10
  164. package/dist/correction/correction-planner.d.ts.map +1 -1
  165. package/dist/cue-anchors.js +4 -3
  166. package/dist/deep-recall-http-glue.js +4 -3
  167. package/dist/{dreams-ledger-567VKVOU.js → dreams-ledger-UCHHRQ4R.js} +3 -2
  168. package/dist/entity-retrieval.js +10 -8
  169. package/dist/eval-trajectory-store.js +4 -3
  170. package/dist/eval-trajectory.js +4 -3
  171. package/dist/evals.js +3 -2
  172. package/dist/external-wiki-access.js +35 -33
  173. package/dist/extraction.js +14 -12
  174. package/dist/{first-start-migration-6A5BJPDW.js → first-start-migration-QVD22WWS.js} +6 -5
  175. package/dist/{first-start-migration-6A5BJPDW.js.map → first-start-migration-QVD22WWS.js.map} +1 -1
  176. package/dist/harmonic-construction.js +5 -4
  177. package/dist/harmonic-retrieval.js +14 -12
  178. package/dist/harmonic-source-lookup.js +3 -2
  179. package/dist/index.js +90 -88
  180. package/dist/json-store.d.ts.map +1 -1
  181. package/dist/json-store.js +2 -1
  182. package/dist/location/index.js +12 -10
  183. package/dist/maintenance/dreams-ledger.d.ts.map +1 -1
  184. package/dist/maintenance/memory-governance.d.ts.map +1 -1
  185. package/dist/maintenance/memory-governance.js +10 -8
  186. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -8
  187. package/dist/maintenance/rebuild-memory-projection-runner.js +12 -10
  188. package/dist/maintenance/rebuild-memory-projection.js +11 -9
  189. package/dist/memory-browse-operations.js +35 -33
  190. package/dist/namespaces/migrate.js +11 -9
  191. package/dist/namespaces/search.js +7 -6
  192. package/dist/namespaces/storage.d.ts.map +1 -1
  193. package/dist/namespaces/storage.js +10 -8
  194. package/dist/objective-state-writers.js +4 -3
  195. package/dist/objective-state.js +3 -2
  196. package/dist/offline-sync-snapshot-stream.js +3 -2
  197. package/dist/offline-sync.d.ts.map +1 -1
  198. package/dist/offline-sync.js +2 -1
  199. package/dist/operator-doctor-corpus.js +13 -11
  200. package/dist/operator-toolkit.js +25 -23
  201. package/dist/orchestration/extraction-run.d.ts +6 -20
  202. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  203. package/dist/orchestration/maintenance.js +20 -18
  204. package/dist/orchestrator.js +90 -88
  205. package/dist/profiling.d.ts.map +1 -1
  206. package/dist/profiling.js +2 -1
  207. package/dist/recall-navigation-operations.js +35 -33
  208. package/dist/recall-navigation.js +34 -32
  209. package/dist/{resolution-7AY36LGJ.js → resolution-ZU5BIAJA.js} +4 -3
  210. package/dist/resume-bundles.js +19 -17
  211. package/dist/retrieval-agents.d.ts +1 -1
  212. package/dist/retrieval-agents.d.ts.map +1 -1
  213. package/dist/retrieval-agents.js +7 -1
  214. package/dist/search/document-scanner.d.ts.map +1 -1
  215. package/dist/search/document-scanner.js +2 -1
  216. package/dist/search/factory.js +6 -5
  217. package/dist/search/index.js +6 -5
  218. package/dist/search/lancedb-backend.js +3 -2
  219. package/dist/search/meilisearch-backend.js +3 -2
  220. package/dist/search/orama-backend.js +3 -2
  221. package/dist/semantic-consolidation.js +11 -9
  222. package/dist/semantic-rule-promotion.js +10 -8
  223. package/dist/semantic-rule-verifier.js +10 -8
  224. package/dist/source-agent-qualifier.js +12 -10
  225. package/dist/standup/build.js +10 -8
  226. package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -1
  227. package/dist/storage/entity-store.d.ts +32 -1
  228. package/dist/storage/entity-store.d.ts.map +1 -1
  229. package/dist/storage/memory-read-store.d.ts.map +1 -1
  230. package/dist/storage/supersession-audit.d.ts.map +1 -1
  231. package/dist/storage.d.ts.map +1 -1
  232. package/dist/storage.js +9 -7
  233. package/dist/support-passport/index.js +37 -35
  234. package/dist/{tier-stats-RQM76XYY.js → tier-stats-C3IAMS4X.js} +6 -5
  235. package/dist/{tier-stats-RQM76XYY.js.map → tier-stats-C3IAMS4X.js.map} +1 -1
  236. package/dist/transcript.d.ts.map +1 -1
  237. package/dist/transcript.js +2 -1
  238. package/dist/transfer/export-okf.js +10 -8
  239. package/dist/trust-zones.js +3 -2
  240. package/dist/utility-learner.js +4 -3
  241. package/dist/utility-runtime.js +5 -4
  242. package/dist/utility-telemetry.js +3 -2
  243. package/dist/utils/macos-replication-junk.d.ts +32 -0
  244. package/dist/utils/macos-replication-junk.d.ts.map +1 -0
  245. package/dist/utils/malformed-entity-record.d.ts +24 -0
  246. package/dist/utils/malformed-entity-record.d.ts.map +1 -0
  247. package/dist/verified-recall.js +10 -8
  248. package/dist/who-knows-cli.js +11 -9
  249. package/dist/who-knows.js +10 -8
  250. package/dist/work-product-ledger.js +3 -2
  251. package/package.json +2 -2
  252. package/src/calibration.ts +3 -2
  253. package/src/cli.ts +2 -2
  254. package/src/consolidation-provenance-check.ts +2 -0
  255. package/src/correction/correction-planner.ts +3 -2
  256. package/src/json-store.ts +3 -0
  257. package/src/macos-replication-junk-scanners.test.ts +275 -0
  258. package/src/maintenance/dreams-ledger.ts +2 -0
  259. package/src/maintenance/memory-governance.ts +2 -0
  260. package/src/namespaces/storage.ts +2 -0
  261. package/src/offline-sync-macos-junk.test.ts +169 -0
  262. package/src/offline-sync.ts +7 -0
  263. package/src/orchestration/extraction-run.ts +6 -20
  264. package/src/profiling.ts +2 -1
  265. package/src/retrieval-agents.ts +29 -12
  266. package/src/search/document-scanner.ts +4 -0
  267. package/src/storage/entity-canonical-id-migration.ts +56 -13
  268. package/src/storage/entity-store.ts +173 -15
  269. package/src/storage/memory-read-store.ts +30 -5
  270. package/src/storage/supersession-audit.ts +2 -0
  271. package/src/storage.ts +3 -2
  272. package/src/transcript.ts +11 -10
  273. package/src/utils/macos-replication-junk.test.ts +46 -0
  274. package/src/utils/macos-replication-junk.ts +65 -0
  275. package/src/utils/malformed-entity-record.ts +101 -0
  276. package/dist/chunk-4O6WRBGE.js.map +0 -1
  277. package/dist/chunk-63B2IZYE.js.map +0 -1
  278. package/dist/chunk-B6O2YLUR.js.map +0 -1
  279. package/dist/chunk-BLVHDY2U.js.map +0 -1
  280. package/dist/chunk-CLWBFR7Q.js.map +0 -1
  281. package/dist/chunk-EQWEIIKQ.js.map +0 -1
  282. package/dist/chunk-FUFAXVBA.js.map +0 -1
  283. package/dist/chunk-NIRQGDYC.js.map +0 -1
  284. package/dist/chunk-P5NQN4JE.js.map +0 -1
  285. package/dist/chunk-PAZ35RJ4.js.map +0 -1
  286. package/dist/chunk-Q4E24IRR.js.map +0 -1
  287. package/dist/chunk-QJ622LTI.js.map +0 -1
  288. package/dist/chunk-TZNDKTX5.js.map +0 -1
  289. package/dist/chunk-ZV65I6ME.js.map +0 -1
  290. /package/dist/{chunk-YFMBHQRG.js.map → chunk-2PTH4PRL.js.map} +0 -0
  291. /package/dist/{chunk-TITG2NBS.js.map → chunk-2PYHLSXK.js.map} +0 -0
  292. /package/dist/{chunk-KH2LKDX7.js.map → chunk-33G67YZF.js.map} +0 -0
  293. /package/dist/{chunk-SWIKABKI.js.map → chunk-3Q3XD3NO.js.map} +0 -0
  294. /package/dist/{chunk-4KY5GSMB.js.map → chunk-4PDTVVSW.js.map} +0 -0
  295. /package/dist/{chunk-HM7RHKS4.js.map → chunk-4RNBLLZR.js.map} +0 -0
  296. /package/dist/{chunk-Y4NKEXQT.js.map → chunk-5ATSXCAG.js.map} +0 -0
  297. /package/dist/{chunk-JDZFIR2S.js.map → chunk-5KGYTX5O.js.map} +0 -0
  298. /package/dist/{chunk-J7JWFZHI.js.map → chunk-5MLGY6IY.js.map} +0 -0
  299. /package/dist/{chunk-NW2E4CI2.js.map → chunk-5SMR542T.js.map} +0 -0
  300. /package/dist/{chunk-S7LWX2PQ.js.map → chunk-655FVTCD.js.map} +0 -0
  301. /package/dist/{chunk-4OSG5Y6M.js.map → chunk-6YEPGWUP.js.map} +0 -0
  302. /package/dist/{chunk-W47S5TIH.js.map → chunk-7VQ6AI7H.js.map} +0 -0
  303. /package/dist/{chunk-WLMZ2L5P.js.map → chunk-AZDTDWS2.js.map} +0 -0
  304. /package/dist/{chunk-G7NYVKD6.js.map → chunk-B2NXOVZN.js.map} +0 -0
  305. /package/dist/{chunk-N7KYEVLK.js.map → chunk-BK2BVLZW.js.map} +0 -0
  306. /package/dist/{chunk-S2I7DL5Q.js.map → chunk-C2RW36YR.js.map} +0 -0
  307. /package/dist/{chunk-6LG7BWKW.js.map → chunk-CFZ4SXXH.js.map} +0 -0
  308. /package/dist/{chunk-JQ7XU625.js.map → chunk-CQOIWJ5E.js.map} +0 -0
  309. /package/dist/{chunk-FSIMZNBC.js.map → chunk-CXOYUANR.js.map} +0 -0
  310. /package/dist/{chunk-QOZJCSFO.js.map → chunk-DQR2LD3V.js.map} +0 -0
  311. /package/dist/{chunk-MATDGSJ7.js.map → chunk-DUPHIZBY.js.map} +0 -0
  312. /package/dist/{chunk-EBA5DA77.js.map → chunk-EOU6V4IN.js.map} +0 -0
  313. /package/dist/{chunk-5WCJLQTM.js.map → chunk-F2772ATT.js.map} +0 -0
  314. /package/dist/{chunk-46EST7JO.js.map → chunk-F2XNSIPP.js.map} +0 -0
  315. /package/dist/{chunk-PZHQWFR3.js.map → chunk-G3UUAQOD.js.map} +0 -0
  316. /package/dist/{chunk-YE36AJL7.js.map → chunk-GCVDFX66.js.map} +0 -0
  317. /package/dist/{chunk-T2YX56QI.js.map → chunk-GQJKVQJR.js.map} +0 -0
  318. /package/dist/{chunk-I7S55EOB.js.map → chunk-GUY6L6LL.js.map} +0 -0
  319. /package/dist/{chunk-L5DAHSEZ.js.map → chunk-GWVNGDJW.js.map} +0 -0
  320. /package/dist/{chunk-N45NEBOD.js.map → chunk-GZXXPCWJ.js.map} +0 -0
  321. /package/dist/{chunk-EPJDSQHF.js.map → chunk-H5IUN433.js.map} +0 -0
  322. /package/dist/{chunk-EUAIYYYR.js.map → chunk-H6FREOYX.js.map} +0 -0
  323. /package/dist/{chunk-T3FMRLWQ.js.map → chunk-HFSPY26A.js.map} +0 -0
  324. /package/dist/{chunk-GH7AOMJD.js.map → chunk-IJMDBYCO.js.map} +0 -0
  325. /package/dist/{chunk-4IHBN6WU.js.map → chunk-JKMIGCK6.js.map} +0 -0
  326. /package/dist/{chunk-ROBHL3GL.js.map → chunk-JWX2Q6HS.js.map} +0 -0
  327. /package/dist/{chunk-DPR2WTN3.js.map → chunk-JZTEOBOR.js.map} +0 -0
  328. /package/dist/{chunk-JIHMUOOS.js.map → chunk-KLJVTZ3R.js.map} +0 -0
  329. /package/dist/{chunk-FP4JYE66.js.map → chunk-KW4AJ7T3.js.map} +0 -0
  330. /package/dist/{chunk-QODKDRSP.js.map → chunk-L6AZOEXV.js.map} +0 -0
  331. /package/dist/{chunk-LS2FHUML.js.map → chunk-LQ5SS4OP.js.map} +0 -0
  332. /package/dist/{chunk-SIIRTDJ4.js.map → chunk-LWFWZTWX.js.map} +0 -0
  333. /package/dist/{chunk-BMWN7B3Y.js.map → chunk-LXATZLSC.js.map} +0 -0
  334. /package/dist/{chunk-O4SGYW7H.js.map → chunk-MAVYEZKM.js.map} +0 -0
  335. /package/dist/{chunk-B665A6BO.js.map → chunk-MJIOGYKX.js.map} +0 -0
  336. /package/dist/{chunk-RTKV5XHL.js.map → chunk-MO6N4QYY.js.map} +0 -0
  337. /package/dist/{chunk-N4C7QKOG.js.map → chunk-MWWAQXZ6.js.map} +0 -0
  338. /package/dist/{chunk-LCKVXX5F.js.map → chunk-MXV2MY6C.js.map} +0 -0
  339. /package/dist/{chunk-FFOVKNQV.js.map → chunk-NAGMQXWV.js.map} +0 -0
  340. /package/dist/{chunk-ZJVMUBYF.js.map → chunk-NHUX6GXA.js.map} +0 -0
  341. /package/dist/{chunk-CB6ANA2I.js.map → chunk-NZCKG25S.js.map} +0 -0
  342. /package/dist/{chunk-UMTCNEVQ.js.map → chunk-O2YPCFJT.js.map} +0 -0
  343. /package/dist/{chunk-WSGPFRBH.js.map → chunk-OMERTLB7.js.map} +0 -0
  344. /package/dist/{chunk-QX6JN3O4.js.map → chunk-PEF5LHQU.js.map} +0 -0
  345. /package/dist/{chunk-JYZSRNR7.js.map → chunk-PIITB2YZ.js.map} +0 -0
  346. /package/dist/{chunk-UQDG3YLN.js.map → chunk-PRU7OF3Y.js.map} +0 -0
  347. /package/dist/{chunk-EU534WGS.js.map → chunk-PVHQSLNN.js.map} +0 -0
  348. /package/dist/{chunk-5VC7J76U.js.map → chunk-QPH52AZB.js.map} +0 -0
  349. /package/dist/{chunk-XISROV24.js.map → chunk-QSEUUQUF.js.map} +0 -0
  350. /package/dist/{chunk-O2IPAX26.js.map → chunk-RTTPBBAN.js.map} +0 -0
  351. /package/dist/{chunk-W5MCEVUS.js.map → chunk-RYYVMZBR.js.map} +0 -0
  352. /package/dist/{chunk-ZSH2NRDV.js.map → chunk-TN4EA4X4.js.map} +0 -0
  353. /package/dist/{chunk-SS3IS2JR.js.map → chunk-UGYUBENJ.js.map} +0 -0
  354. /package/dist/{chunk-GELS5Z5Z.js.map → chunk-V3TXIXXY.js.map} +0 -0
  355. /package/dist/{chunk-WVADKFWV.js.map → chunk-VNZMZPAC.js.map} +0 -0
  356. /package/dist/{chunk-JPTPS4OB.js.map → chunk-VPXIKBPX.js.map} +0 -0
  357. /package/dist/{chunk-OP6N4H6A.js.map → chunk-W3FVQBGF.js.map} +0 -0
  358. /package/dist/{chunk-W3K3HITK.js.map → chunk-WLT6LTQP.js.map} +0 -0
  359. /package/dist/{chunk-GMXWTJNU.js.map → chunk-XKRXN63M.js.map} +0 -0
  360. /package/dist/{chunk-KR6ZKECI.js.map → chunk-XYGQSDTH.js.map} +0 -0
  361. /package/dist/{chunk-22W2XWGH.js.map → chunk-YBO2WGCV.js.map} +0 -0
  362. /package/dist/{chunk-P7TOIOT7.js.map → chunk-YR4COAEC.js.map} +0 -0
  363. /package/dist/{chunk-6WHJ2EAB.js.map → chunk-Z64TS5V4.js.map} +0 -0
  364. /package/dist/{chunk-NHLLKEKK.js.map → chunk-ZAJLJ35W.js.map} +0 -0
  365. /package/dist/{dreams-ledger-567VKVOU.js.map → dreams-ledger-UCHHRQ4R.js.map} +0 -0
  366. /package/dist/{resolution-7AY36LGJ.js.map → resolution-ZU5BIAJA.js.map} +0 -0
@@ -0,0 +1,275 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdir, mkdtemp, readFile, rm, utimes, writeFile } from "node:fs/promises";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import test from "node:test";
6
+
7
+ import { readCalibrationCorrections } from "./calibration.js";
8
+ import { CorrectionPlanner, type PlannerDeps } from "./correction/correction-planner.js";
9
+ import { listJsonFiles } from "./json-store.js";
10
+ import { parseConfig } from "./config.js";
11
+ import { ProfilingCollector } from "./profiling.js";
12
+ import { TranscriptManager } from "./transcript.js";
13
+ import { resolveDefaultNamespaceRoot } from "./namespaces/storage.js";
14
+ import { runDirectAgent } from "./retrieval-agents.js";
15
+ import { scanMemoryDir } from "./search/document-scanner.js";
16
+ import { StorageManager } from "./storage.js";
17
+ import { hasSupersessionAudit } from "./storage/supersession-audit.js";
18
+ import type { PluginConfig } from "./types.js";
19
+
20
+ const CORRECTION_BODY = [
21
+ "---",
22
+ "id: correction-sidecar",
23
+ "confidence: 0.9",
24
+ "---",
25
+ "Synthetic correction that must not be loaded from Finder metadata.",
26
+ ].join("\n");
27
+
28
+ test("scanMemoryDir ignores AppleDouble and .DS_Store index inputs", async () => {
29
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-scan-macos-junk-"));
30
+ try {
31
+ const factsDir = path.join(memoryDir, "facts", "2026-02-22");
32
+ await mkdir(factsDir, { recursive: true });
33
+ await writeFile(
34
+ path.join(factsDir, "inside.md"),
35
+ ["---", "id: inside", "category: fact", "---", "A real fact."].join("\n"),
36
+ "utf8"
37
+ );
38
+ await writeFile(path.join(factsDir, "._inside.md"), Buffer.from([0, 5, 22]));
39
+ await writeFile(path.join(factsDir, ".DS_Store"), "finder");
40
+
41
+ const docs = await scanMemoryDir(memoryDir);
42
+ assert.deepEqual(
43
+ docs.map((doc) => doc.docid),
44
+ ["inside"]
45
+ );
46
+ } finally {
47
+ await rm(memoryDir, { recursive: true, force: true });
48
+ }
49
+ });
50
+
51
+ test("memory reads skip macOS replication junk beside real facts", async () => {
52
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-memories-macos-junk-"));
53
+ try {
54
+ const storage = new StorageManager(memoryDir);
55
+ const written = await storage.writeMemory("fact", "Synthetic dome schedule is stored once.");
56
+ const factDir = path.dirname(written.memory.path);
57
+ await writeFile(path.join(factDir, "._inside.md"), CORRECTION_BODY, "utf8");
58
+ await writeFile(path.join(factDir, ".DS_Store"), "finder");
59
+
60
+ const memories = await storage.readAllMemories();
61
+ assert.deepEqual(
62
+ memories.map((memory) => memory.frontmatter.id),
63
+ [written.id]
64
+ );
65
+ } finally {
66
+ await rm(memoryDir, { recursive: true, force: true });
67
+ }
68
+ });
69
+
70
+ test("correction scans and calibration ignore macOS replication junk", async () => {
71
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-corrections-macos-junk-"));
72
+ try {
73
+ const correctionsDir = path.join(memoryDir, "corrections");
74
+ await mkdir(correctionsDir, { recursive: true });
75
+ await writeFile(
76
+ path.join(correctionsDir, "correction-real.md"),
77
+ CORRECTION_BODY.replace("correction-sidecar", "correction-real"),
78
+ "utf8"
79
+ );
80
+ await writeFile(path.join(correctionsDir, "._sidecar.md"), CORRECTION_BODY, "utf8");
81
+ await writeFile(path.join(correctionsDir, ".DS_Store"), "finder");
82
+
83
+ const corrections = await readCalibrationCorrections(memoryDir);
84
+ assert.deepEqual(
85
+ corrections.map((correction) => correction.id),
86
+ ["correction-real"]
87
+ );
88
+
89
+ const reads: string[] = [];
90
+ const found = await hasSupersessionAudit(
91
+ {
92
+ correctionsDir,
93
+ async readMemoryByPath(filePath) {
94
+ reads.push(path.basename(filePath));
95
+ return null;
96
+ },
97
+ },
98
+ "old-id",
99
+ "new-id",
100
+ "audit body"
101
+ );
102
+ assert.equal(found, false);
103
+ assert.deepEqual(reads, ["correction-real.md"]);
104
+ } finally {
105
+ await rm(memoryDir, { recursive: true, force: true });
106
+ }
107
+ });
108
+
109
+ test("state JSON listings and pending correction plans ignore macOS replication junk", async () => {
110
+ const root = await mkdtemp(path.join(os.tmpdir(), "remnic-state-macos-junk-"));
111
+ try {
112
+ const stateDir = path.join(root, "state");
113
+ await mkdir(stateDir, { recursive: true });
114
+ await writeFile(path.join(stateDir, "real.json"), "{}\n");
115
+ await writeFile(path.join(stateDir, "._state.json"), "{}\n");
116
+ await writeFile(path.join(stateDir, ".DS_Store"), "finder");
117
+ const listed = (await listJsonFiles(stateDir)).map((file) => path.basename(file));
118
+ assert.deepEqual(listed, ["real.json"]);
119
+
120
+ const pendingDir = path.join(stateDir, "corrections", "pending");
121
+ await mkdir(pendingDir, { recursive: true });
122
+ await writeFile(path.join(pendingDir, "._plan.json"), "{}\n");
123
+ await writeFile(path.join(pendingDir, ".DS_Store"), "finder");
124
+ const planner = new CorrectionPlanner({
125
+ storageDir: async () => root,
126
+ } as unknown as PlannerDeps);
127
+ assert.deepEqual(await planner.listPending("default"), []);
128
+ } finally {
129
+ await rm(root, { recursive: true, force: true });
130
+ }
131
+ });
132
+
133
+ test("profiling prune keeps AppleDouble traces and deletes only real jsonl files", async () => {
134
+ const storageDir = await mkdtemp(path.join(os.tmpdir(), "remnic-profiling-macos-junk-"));
135
+ try {
136
+ const junk = path.join(storageDir, "._trace.jsonl");
137
+ const older = path.join(storageDir, "recall-old.jsonl");
138
+ const newer = path.join(storageDir, "recall-new.jsonl");
139
+ await writeFile(junk, "sidecar\n");
140
+ await writeFile(older, "old\n");
141
+ await writeFile(newer, "new\n");
142
+ const oldTime = new Date("2020-01-01T00:00:00Z");
143
+ const newTime = new Date("2024-01-01T00:00:00Z");
144
+ await utimes(older, oldTime, oldTime);
145
+ await utimes(newer, newTime, newTime);
146
+
147
+ const collector = new ProfilingCollector({ enabled: false, storageDir, maxTraces: 1 });
148
+ await collector.pruneFiles();
149
+
150
+ assert.equal(await readFile(junk, "utf8"), "sidecar\n");
151
+ assert.equal(await readFile(newer, "utf8"), "new\n");
152
+ await assert.rejects(() => readFile(older), { code: "ENOENT" });
153
+ } finally {
154
+ await rm(storageDir, { recursive: true, force: true });
155
+ }
156
+ });
157
+
158
+ test("direct entity recall ignores AppleDouble sidecars and malformed entities", async () => {
159
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-direct-macos-junk-"));
160
+ try {
161
+ const entitiesDir = path.join(memoryDir, "entities");
162
+ await mkdir(entitiesDir, { recursive: true });
163
+ await writeFile(path.join(entitiesDir, "project-real.md"), "# Real\n**Type:** project\n");
164
+ await writeFile(path.join(entitiesDir, "project-real-gap.md"), "# \n**Type:** project\n");
165
+ await writeFile(path.join(entitiesDir, "project-real-tab.md"), "#\tTabbed\n**Type:** project\n");
166
+ await writeFile(path.join(entitiesDir, "._project-real.md"), Buffer.from([0, 5, 22]));
167
+ await writeFile(path.join(entitiesDir, ".DS_Store"), "finder");
168
+ const encrypted = Buffer.alloc(12);
169
+ Buffer.from("REMNIC-ENC").copy(encrypted);
170
+ await writeFile(path.join(entitiesDir, "project-real-locked.md"), encrypted);
171
+
172
+ const hits = await runDirectAgent("real", memoryDir);
173
+ assert.deepEqual(
174
+ hits.map((hit) => path.basename(hit.path)).sort(),
175
+ ["project-real-locked.md", "project-real.md"],
176
+ );
177
+ } finally {
178
+ await rm(memoryDir, { recursive: true, force: true });
179
+ }
180
+ });
181
+
182
+ test("transcript writes ignore AppleDouble jsonl sidecars", async () => {
183
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-transcript-macos-junk-"));
184
+ try {
185
+ const transcript = new TranscriptManager(parseConfig({
186
+ memoryDir,
187
+ transcriptEnabled: true,
188
+ transcriptSkipChannelTypes: [],
189
+ }));
190
+ await transcript.initialize();
191
+ const sessionKey = "agent:main:desk";
192
+ const located = transcript.getTranscriptPath(sessionKey);
193
+ const channelDir = path.join(memoryDir, "transcripts", located.dir);
194
+ const toolDir = path.join(memoryDir, "state", "tool-usage", located.dir);
195
+ await mkdir(channelDir, { recursive: true });
196
+ await mkdir(toolDir, { recursive: true });
197
+ const sidecar = Buffer.from([0, 5, 22]);
198
+ await writeFile(path.join(channelDir, `._${located.file}`), sidecar);
199
+ await writeFile(path.join(toolDir, `._${located.file}`), sidecar);
200
+
201
+ await transcript.append({
202
+ timestamp: "2026-04-13T10:00:00.000Z",
203
+ role: "user",
204
+ content: "North Dome schedule",
205
+ sessionKey,
206
+ turnId: "turn-1",
207
+ });
208
+ await transcript.appendToolUse({
209
+ timestamp: "2026-04-13T10:00:01.000Z",
210
+ sessionKey,
211
+ tool: "lookup",
212
+ });
213
+
214
+ assert.match(await readFile(path.join(channelDir, located.file), "utf8"), /North Dome schedule/);
215
+ assert.match(await readFile(path.join(toolDir, located.file), "utf8"), /lookup/);
216
+ assert.deepEqual(await readFile(path.join(channelDir, `._${located.file}`)), sidecar);
217
+ await assert.rejects(
218
+ () => readFile(path.join(memoryDir, "transcripts", located.alternateDir, located.file)),
219
+ { code: "ENOENT" },
220
+ );
221
+ } finally {
222
+ await rm(memoryDir, { recursive: true, force: true });
223
+ }
224
+ });
225
+
226
+ test("archive and summary reads ignore macOS replication junk", async () => {
227
+ const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-archive-macos-junk-"));
228
+ try {
229
+ const storage = new StorageManager(dir);
230
+ await storage.ensureDirectories();
231
+ const archive = path.join(dir, "archive");
232
+ await mkdir(archive, { recursive: true });
233
+ await writeFile(
234
+ path.join(archive, "archived-real.md"),
235
+ ["---", "id: archived-real", "category: fact", "---", "Kept."].join("\n"),
236
+ "utf8",
237
+ );
238
+ await writeFile(path.join(archive, "._archived-real.md"), "{not-a-memory");
239
+ await writeFile(path.join(archive, ".DS_Store"), "finder");
240
+ const archived = await storage.readArchivedMemories();
241
+ assert.deepEqual(archived.map((memory) => memory.frontmatter.id), ["archived-real"]);
242
+
243
+ const summaries = path.join(dir, "summaries");
244
+ await mkdir(summaries, { recursive: true });
245
+ await writeFile(path.join(summaries, "sum-real.json"), JSON.stringify({ id: "sum-real", text: "ok" }));
246
+ await writeFile(path.join(summaries, "._sum-real.json"), "{not-json");
247
+ const loaded = await storage.readSummaries();
248
+ assert.deepEqual(loaded.map((summary) => summary.id), ["sum-real"]);
249
+ } finally {
250
+ await rm(dir, { recursive: true, force: true });
251
+ }
252
+ });
253
+
254
+ test("namespace routing ignores macOS replication junk in the legacy root", async () => {
255
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-ns-macos-junk-"));
256
+ try {
257
+ const config = {
258
+ memoryDir,
259
+ namespacesEnabled: true,
260
+ defaultNamespace: "default",
261
+ } as PluginConfig;
262
+ await mkdir(path.join(memoryDir, "namespaces", "default", "facts"), { recursive: true });
263
+ await mkdir(path.join(memoryDir, "entities"), { recursive: true });
264
+ await writeFile(path.join(memoryDir, "entities", ".DS_Store"), "finder");
265
+ await writeFile(path.join(memoryDir, "entities", "._sidecar.md"), Buffer.from([0, 5]));
266
+ assert.equal(
267
+ await resolveDefaultNamespaceRoot(config),
268
+ path.join(memoryDir, "namespaces", "default"),
269
+ );
270
+ await writeFile(path.join(memoryDir, "entities", "project-real.md"), "# Real\n");
271
+ assert.equal(await resolveDefaultNamespaceRoot(config), memoryDir);
272
+ } finally {
273
+ await rm(memoryDir, { recursive: true, force: true });
274
+ }
275
+ });
@@ -16,6 +16,7 @@ import path from "node:path";
16
16
  import { createReadStream, type ReadStream } from "node:fs";
17
17
  import { appendFile, lstat, mkdir, readdir, readFile } from "node:fs/promises";
18
18
  import { createInterface } from "node:readline";
19
+ import { isMacOsReplicationJunkBasename } from "../utils/macos-replication-junk.js";
19
20
 
20
21
  // ── Types ─────────────────────────────────────────────────────────────────────
21
22
 
@@ -553,6 +554,7 @@ async function listMemoryFiles(memoryDir: string): Promise<string[]> {
553
554
  }
554
555
  for (const entry of entries) {
555
556
  if (entry.isSymbolicLink()) continue;
557
+ if (isMacOsReplicationJunkBasename(entry.name)) continue;
556
558
  const full = path.join(dir, entry.name);
557
559
  if (entry.isDirectory()) {
558
560
  // Skip state/ and archive/ subdirs.
@@ -6,6 +6,7 @@ import type { MemoryFile, MemoryStatus } from "../types.js";
6
6
  import { RECALL_FALLBACK_DIRS } from "../utils/category-dir.js";
7
7
  import { bumpMemoryCorpusVersionForDir } from "../memory-corpus-version.js";
8
8
  import { assertPathInsideRoot } from "../utils/path-containment.js";
9
+ import { isMacOsReplicationJunkBasename } from "../utils/macos-replication-junk.js";
9
10
  import { requestEntityCanonicalIdReconcile } from "../storage/entity-canonical-id-references.js";
10
11
  import { excludeSupportPassportPrivateMemories } from "../support-passport/card-projection.js";
11
12
 
@@ -361,6 +362,7 @@ async function listMarkdownFiles(root: string, containmentRoot: string): Promise
361
362
  const entries = await readdir(dir, { withFileTypes: true });
362
363
  for (const entry of entries) {
363
364
  if (entry.isSymbolicLink()) continue; // never follow symlinked entries
365
+ if (isMacOsReplicationJunkBasename(entry.name)) continue;
364
366
  const fullPath = path.join(dir, entry.name);
365
367
  if (entry.isDirectory()) {
366
368
  await walk(fullPath);
@@ -6,6 +6,7 @@ import { StorageManager } from "../storage.js";
6
6
  import { keyring, secureStoreDir } from "../secure-store/index.js";
7
7
  import type { PluginConfig } from "../types.js";
8
8
  import { ALL_CATEGORY_DIRS } from "../utils/category-dir.js";
9
+ import { isMacOsReplicationJunkBasename } from "../utils/macos-replication-junk.js";
9
10
  import {
10
11
  namespaceIdentityLegacyToken,
11
12
  namespaceIdentityToken,
@@ -30,6 +31,7 @@ async function hasStoredEntries(p: string): Promise<boolean> {
30
31
  if (!entry.isDirectory()) return true;
31
32
  const children = await readdir(p, { withFileTypes: true });
32
33
  for (const child of children) {
34
+ if (isMacOsReplicationJunkBasename(child.name)) continue;
33
35
  const childPath = path.join(p, child.name);
34
36
  if (child.isSymbolicLink() || child.isFile()) return true;
35
37
  if (child.isDirectory() && (await hasStoredEntries(childPath))) return true;
@@ -0,0 +1,169 @@
1
+ import assert from "node:assert/strict";
2
+ import { createHash } from "node:crypto";
3
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import test from "node:test";
7
+
8
+ import {
9
+ OFFLINE_SYNC_CHANGESET_FORMAT,
10
+ OFFLINE_SYNC_SNAPSHOT_FORMAT,
11
+ applyOfflineSyncFileContentChunk,
12
+ applyOfflineSyncSnapshot,
13
+ buildOfflineSyncSnapshot,
14
+ buildOfflineSyncSnapshotForPaths,
15
+ buildOfflineSyncSnapshotFromBase,
16
+ normalizeOfflineSyncChangeset,
17
+ normalizeOfflineSyncSnapshot,
18
+ } from "./offline-sync.js";
19
+
20
+ async function write(root: string, relPath: string, content: string | Buffer): Promise<void> {
21
+ const filePath = path.join(root, relPath);
22
+ await mkdir(path.dirname(filePath), { recursive: true });
23
+ await writeFile(filePath, content);
24
+ }
25
+
26
+ test("offline sync omits macOS replication junk on snapshot, push, and pull", async () => {
27
+ const root = await mkdtemp(path.join(os.tmpdir(), "remnic-offline-macos-junk-"));
28
+ const dest = await mkdtemp(path.join(os.tmpdir(), "remnic-offline-macos-junk-dest-"));
29
+ try {
30
+ await write(root, "namespaces/lab/entities/project-real.md", "real entity");
31
+ await write(root, "namespaces/lab/entities/._sidecar.md", Buffer.from([0, 5, 22]));
32
+ await write(root, "namespaces/lab/.DS_Store", "finder");
33
+ await write(root, "entities/._root.md", Buffer.from([0, 5, 22]));
34
+ await write(root, ".DS_Store", "finder-root");
35
+ await write(root, "facts/._ignored/record.md", "nested junk");
36
+
37
+ const snapshot = await buildOfflineSyncSnapshot({
38
+ root,
39
+ sourceId: "remote",
40
+ includeContent: true,
41
+ });
42
+ assert.deepEqual(
43
+ snapshot.files.map((file) => file.path),
44
+ ["namespaces/lab/entities/project-real.md"]
45
+ );
46
+
47
+ const pullSide = await buildOfflineSyncSnapshotFromBase({
48
+ root,
49
+ sourceId: "local",
50
+ includeContent: false,
51
+ excludeNodeLocalState: false,
52
+ });
53
+ assert.deepEqual(
54
+ pullSide.files.map((file) => file.path),
55
+ ["namespaces/lab/entities/project-real.md"]
56
+ );
57
+
58
+ await assert.rejects(
59
+ () =>
60
+ buildOfflineSyncSnapshotForPaths({
61
+ root,
62
+ sourceId: "remote",
63
+ paths: ["namespaces/lab/entities/._sidecar.md"],
64
+ includeContent: true,
65
+ }),
66
+ /offline sync snapshot path is excluded/
67
+ );
68
+ await assert.rejects(
69
+ () =>
70
+ buildOfflineSyncSnapshotForPaths({
71
+ root,
72
+ sourceId: "remote",
73
+ paths: ["facts/._ignored/record.md"],
74
+ includeContent: true,
75
+ }),
76
+ /offline sync snapshot path is excluded/
77
+ );
78
+ await assert.rejects(
79
+ () =>
80
+ applyOfflineSyncFileContentChunk({
81
+ root: dest,
82
+ sourceId: "remote",
83
+ path: "namespaces/lab/.DS_Store",
84
+ sha256: createHash("sha256").update("finder").digest("hex"),
85
+ bytes: 6,
86
+ mtimeMs: 1,
87
+ content: Buffer.from("finder"),
88
+ }),
89
+ /offline sync file content path is excluded/
90
+ );
91
+
92
+ const real = snapshot.files[0];
93
+ const incoming = {
94
+ format: OFFLINE_SYNC_SNAPSHOT_FORMAT,
95
+ schemaVersion: 1 as const,
96
+ createdAt: snapshot.createdAt,
97
+ sourceId: "remote",
98
+ includeTranscripts: true,
99
+ files: [
100
+ real,
101
+ {
102
+ ...real,
103
+ path: "namespaces/lab/entities/._sidecar.md",
104
+ contentBase64: Buffer.from("sidecar").toString("base64"),
105
+ sha256: createHash("sha256").update("sidecar").digest("hex"),
106
+ bytes: Buffer.byteLength("sidecar"),
107
+ },
108
+ {
109
+ ...real,
110
+ path: "namespaces/other/.DS_Store",
111
+ contentBase64: Buffer.from("finder").toString("base64"),
112
+ sha256: createHash("sha256").update("finder").digest("hex"),
113
+ bytes: Buffer.byteLength("finder"),
114
+ },
115
+ {
116
+ ...real,
117
+ path: "facts/._ignored/record.md",
118
+ contentBase64: Buffer.from("nested junk").toString("base64"),
119
+ sha256: createHash("sha256").update("nested junk").digest("hex"),
120
+ bytes: Buffer.byteLength("nested junk"),
121
+ },
122
+ ],
123
+ deletions: [
124
+ { path: "facts/removed.md", mtimeMs: 2 },
125
+ { path: "entities/._root.md", mtimeMs: 1 },
126
+ { path: "facts/._ignored/record.md", mtimeMs: 3 },
127
+ ],
128
+ };
129
+ const normalized = normalizeOfflineSyncSnapshot(incoming);
130
+ assert.deepEqual(
131
+ normalized.files.map((file) => file.path),
132
+ ["namespaces/lab/entities/project-real.md"]
133
+ );
134
+ assert.deepEqual(normalized.deletions, [{ path: "facts/removed.md", mtimeMs: 2 }]);
135
+
136
+ const applied = await applyOfflineSyncSnapshot({ root: dest, snapshot: incoming });
137
+ assert.equal(applied.upserted, 1);
138
+ assert.equal(await readFile(path.join(dest, "namespaces/lab/entities/project-real.md"), "utf8"), "real entity");
139
+ await assert.rejects(() => readFile(path.join(dest, "namespaces/lab/entities/._sidecar.md")), { code: "ENOENT" });
140
+ await assert.rejects(() => readFile(path.join(dest, "namespaces/other/.DS_Store")), { code: "ENOENT" });
141
+ await assert.rejects(() => readFile(path.join(dest, "facts/._ignored/record.md")), { code: "ENOENT" });
142
+
143
+ const changeset = normalizeOfflineSyncChangeset({
144
+ format: OFFLINE_SYNC_CHANGESET_FORMAT,
145
+ schemaVersion: 1,
146
+ createdAt: snapshot.createdAt,
147
+ sourceId: "remote",
148
+ includeTranscripts: true,
149
+ changes: [
150
+ { type: "upsert", path: real.path, file: real },
151
+ {
152
+ type: "upsert",
153
+ path: "namespaces/lab/.DS_Store",
154
+ file: {
155
+ ...real,
156
+ path: "namespaces/lab/.DS_Store",
157
+ },
158
+ },
159
+ ],
160
+ });
161
+ assert.deepEqual(
162
+ changeset.changes.map((change) => change.path),
163
+ ["namespaces/lab/entities/project-real.md"]
164
+ );
165
+ } finally {
166
+ await rm(root, { recursive: true, force: true });
167
+ await rm(dest, { recursive: true, force: true });
168
+ }
169
+ });
@@ -26,6 +26,7 @@ import {
26
26
  import { parseFlexibleIsoTimestamp } from "./utils/iso-timestamp.js";
27
27
  import { EmbeddingIndexStorageError } from "./embedding-index-storage.js";
28
28
  import { isEmbeddingGenerationMarkerPath, matchesOfflineSyncDefaultExclude } from "./offline-sync-exclude-globs.js";
29
+ import { isMacOsReplicationJunkBasename } from "./utils/macos-replication-junk.js";
29
30
  import {
30
31
  applyIncomingEmbeddingGenerations,
31
32
  assertEmbeddingGenerationStillIncluded,
@@ -699,6 +700,7 @@ function shouldExcludeRelPath(relPosix: string, includeTranscripts: boolean): bo
699
700
  if (parts.some((part) => part === SYNC_INTERNAL_DIR)) return true;
700
701
  if (!includeTranscripts && parts[0] === "transcripts") return true;
701
702
  const basename = parts[parts.length - 1] ?? "";
703
+ if (parts.some((part) => isMacOsReplicationJunkBasename(part))) return true;
702
704
  if (isCanonicalRuntimeStatePath(parts) && basename.includes(".tmp-")) return true;
703
705
  if (EXCLUDED_FILE_NAMES.has(basename)) return true;
704
706
  if (EXCLUDED_FILE_PREFIXES.some((prefix) => basename.startsWith(prefix))) return true;
@@ -748,6 +750,11 @@ function shouldIgnoreIncomingRuntimePath(relPosix: string): boolean {
748
750
  if (isInternalRemnicStatePath(relPosix)) return true;
749
751
  const parts = relPosix.split("/");
750
752
  const basename = parts[parts.length - 1] ?? "";
753
+ // Drop Finder metadata before the structural-exclude throw. An older
754
+ // peer snapshot that still lists `._*` or `.DS_Store` — including a file
755
+ // nested under a junk directory — must not fail the whole pull; those
756
+ // paths are never written.
757
+ if (parts.some((part) => isMacOsReplicationJunkBasename(part))) return true;
751
758
  return isCanonicalRuntimeStatePath(parts) && basename.includes(".tmp-");
752
759
  }
753
760
 
@@ -1,24 +1,10 @@
1
1
  /**
2
- * Extraction-run coordinator — extracted from the orchestrator
3
- * (issue #1526, seam 15).
4
- *
5
- * Owns the buffer→extract→persist pipeline orchestration:
6
- * - `runExtraction` — the main extraction pipeline coordinator
7
- * (normalize → threshold gate → namespace resolve → dedupe
8
- * fingerprint → extract → validate → persist → post-write hooks)
9
- * - dedupe support: `shouldQueueExtraction`,
10
- * `buildExtractionFingerprint`, `normalizeExtractionFingerprintTurns`
11
- * - `recordProcessedExtractionFingerprint` — meta recording
12
- *
13
- * The orchestrator constructs one instance and delegates the extraction
14
- * run to it. `persistExtraction`, `maybeCapturePassiveCorrections`, and
15
- * all post-write side-effect helpers arrive as injectable delegates so
16
- * the orchestrator keeps ownership of cross-subsystem routing and the
17
- * behavior-critical chokepoints it hosts.
18
- *
19
- * Behavior-preserving move from orchestrator.ts. No logic changes — the
20
- * orchestrator keeps thin delegating methods so existing call sites
21
- * and tests that exercise the public API continue to work.
2
+ * Buffer → extract → persist coordinator (issue #1526, seam 15).
3
+ * Owns runExtraction, shouldQueueExtraction, buildExtractionFingerprint,
4
+ * normalizeExtractionFingerprintTurns and recordProcessedExtractionFingerprint.
5
+ * The orchestrator delegates here and retains cross-subsystem routing,
6
+ * persistence and post-write side effects via injected dependencies.
7
+ * Extracted from orchestrator.ts without behavior changes.
22
8
  */
23
9
 
24
10
  import { createHash } from "node:crypto";
package/src/profiling.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  import { join } from "node:path";
11
11
 
12
12
  import { log } from "./logger.js";
13
+ import { isMacOsReplicationJunkBasename } from "./utils/macos-replication-junk.js";
13
14
 
14
15
  // ---------------------------------------------------------------------------
15
16
  // Types
@@ -358,7 +359,7 @@ export class ProfilingCollector {
358
359
  try {
359
360
  const dir = this.storageDir;
360
361
  const entries = await fsp.readdir(dir);
361
- const jsonlFiles = entries.filter((f) => f.endsWith(".jsonl"));
362
+ const jsonlFiles = entries.filter((f) => !isMacOsReplicationJunkBasename(f) && f.endsWith(".jsonl"));
362
363
  const withMtime = await Promise.all(
363
364
  jsonlFiles.map(async (f) => ({
364
365
  name: f,
@@ -17,14 +17,17 @@
17
17
  * - Spec: docs/ideas/parallel-specialized-retrieval.md
18
18
  */
19
19
 
20
+ import { lstat, readFile, readdir, realpath, stat } from "node:fs/promises";
20
21
  import path from "node:path";
21
- import { lstat, readdir, readFile, realpath, stat } from "node:fs/promises";
22
+ import { isAbortError } from "./abort-error.js";
22
23
  import { log } from "./logger.js";
23
- import type { QmdSearchResult } from "./types.js";
24
24
  import type { QmdClient } from "./qmd.js";
25
- import { isTemporalQuery, recencyWindowBoundsFromPrompt } from "./temporal-index.js";
26
- import { isAbortError } from "./abort-error.js";
27
25
  import { normalizeRecallTokens } from "./recall-tokenization.js";
26
+ import { isEncryptedFile } from "./secure-store/secure-fs.js";
27
+ import { isTemporalQuery, recencyWindowBoundsFromPrompt } from "./temporal-index.js";
28
+ import type { QmdSearchResult } from "./types.js";
29
+ import { isMacOsReplicationJunkBasename } from "./utils/macos-replication-junk.js";
30
+ import { isShapedUnnamedEntityRecord } from "./utils/malformed-entity-record.js";
28
31
 
29
32
 
30
33
  // ─── Types ───────────────────────────────────────────────────────────────────
@@ -117,6 +120,7 @@ async function resolveContainedRegularFile(
117
120
  * QmdSearchResult[]. Zero LLM inference; pure file I/O.
118
121
  *
119
122
  * Cost: readdir on entities/ + filename scoring. Typically <5ms.
123
+ * Scored hits are read, up to the result cap, so a malformed record is not returned.
120
124
  *
121
125
  */
122
126
  // Agents scan one namespace storage dir and return absolute paths. Contextual
@@ -152,9 +156,9 @@ export async function runDirectAgent(
152
156
  const queryTokens = tokenize(query);
153
157
  if (queryTokens.length === 0) return [];
154
158
 
155
- const results: ParallelSearchResult[] = [];
159
+ const scored: Array<{ nameWithoutExt: string; safePath: string; score: number }> = [];
156
160
  for (const entry of entries) {
157
- if (!entry.endsWith(".md")) continue;
161
+ if (isMacOsReplicationJunkBasename(entry) || !entry.endsWith(".md")) continue;
158
162
 
159
163
  // Filename tokens: split on hyphens (normalizeEntityName uses hyphens)
160
164
  const nameWithoutExt = entry.slice(0, -3);
@@ -166,14 +170,29 @@ export async function runDirectAgent(
166
170
  const fullPath = path.join(entitiesDir, entry);
167
171
  const safePath = await resolveContainedRegularFile(memoryDir, fullPath, canonicalRoot);
168
172
  if (!safePath) continue;
173
+ scored.push({ nameWithoutExt, safePath, score });
174
+ }
169
175
 
176
+ scored.sort((a, b) => b.score - a.score);
177
+ const results: ParallelSearchResult[] = [];
178
+ for (const hit of scored) {
179
+ if (results.length >= maxResults) break;
180
+ let bytes: Buffer;
181
+ try {
182
+ bytes = await readFile(hit.safePath);
183
+ } catch {
184
+ continue;
185
+ }
186
+ // Ciphertext has no heading. The secure resolver decrypts after this
187
+ // candidate is kept; this scan does not look up a key.
188
+ if (!isEncryptedFile(bytes) && isShapedUnnamedEntityRecord(bytes.toString("utf8"))) continue;
170
189
  results.push(
171
190
  namespaceRelativeResult(
172
191
  {
173
- docid: nameWithoutExt,
174
- path: safePath,
192
+ docid: hit.nameWithoutExt,
193
+ path: hit.safePath,
175
194
  snippet: "", // populated by augmentWithDirectAndTemporal after merge
176
- score,
195
+ score: hit.score,
177
196
  transport: "scoped_prefilter",
178
197
  agentSource: "direct",
179
198
  },
@@ -183,9 +202,7 @@ export async function runDirectAgent(
183
202
  );
184
203
  }
185
204
 
186
- return results
187
- .sort((a, b) => b.score - a.score)
188
- .slice(0, maxResults);
205
+ return results;
189
206
  } catch (err) {
190
207
  log.debug(`DirectFactAgent error: ${err}`);
191
208
  return [];
@@ -3,6 +3,7 @@ import { lstat, readdir, readFile, realpath } from "node:fs/promises";
3
3
  import { RECALL_FALLBACK_DIRS } from "../utils/category-dir.js";
4
4
  import { assertPathInsideRoot } from "../utils/path-containment.js";
5
5
  import { isErrnoCode } from "../utils/errno.js";
6
+ import { isMacOsReplicationJunkBasename } from "../utils/macos-replication-junk.js";
6
7
 
7
8
  export interface IndexableDocument {
8
9
  /** Memory ID from frontmatter or filename stem */
@@ -60,6 +61,9 @@ async function scanDir(dir: string, memoryRootReal: string): Promise<IndexableDo
60
61
  const entries = await readdir(dir, { withFileTypes: true });
61
62
  for (const entry of entries) {
62
63
  if (entry.isSymbolicLink()) continue;
64
+ // QMD's indexer already skips hidden paths. This scanner is the
65
+ // non-QMD index input and must ignore the same Finder metadata.
66
+ if (isMacOsReplicationJunkBasename(entry.name)) continue;
63
67
  const fullPath = path.join(dir, entry.name);
64
68
  if (entry.isDirectory()) {
65
69
  assertPathInsideRoot(memoryRootReal, await realpath(fullPath), fullPath);