@fgv/ts-agent-memory 5.1.0-46 → 5.1.0-48

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 (336) hide show
  1. package/README.md +55 -0
  2. package/dist/packlets/ingest/orchestrator.js +115 -20
  3. package/dist/packlets/ingest/orchestrator.js.map +1 -1
  4. package/dist/packlets/observe/memoryObservationStore.js +6 -0
  5. package/dist/packlets/observe/memoryObservationStore.js.map +1 -1
  6. package/dist/packlets/observe/observer.js.map +1 -1
  7. package/dist/packlets/store/fileTreeMemoryStore.js +63 -135
  8. package/dist/packlets/store/fileTreeMemoryStore.js.map +1 -1
  9. package/dist/packlets/store/vectorMaintenance.js +251 -0
  10. package/dist/packlets/store/vectorMaintenance.js.map +1 -0
  11. package/dist/packlets/vector/inMemoryCosineIndex.js +81 -18
  12. package/dist/packlets/vector/inMemoryCosineIndex.js.map +1 -1
  13. package/dist/packlets/vector/inMemoryFragmentCosineIndex.js +7 -0
  14. package/dist/packlets/vector/inMemoryFragmentCosineIndex.js.map +1 -1
  15. package/dist/packlets/vector/vectorIndex.js.map +1 -1
  16. package/dist/ts-agent-memory.d.ts +389 -71
  17. package/lib/packlets/ingest/orchestrator.d.ts +62 -5
  18. package/lib/packlets/ingest/orchestrator.d.ts.map +1 -1
  19. package/lib/packlets/ingest/orchestrator.js +115 -20
  20. package/lib/packlets/ingest/orchestrator.js.map +1 -1
  21. package/lib/packlets/observe/memoryObservationStore.d.ts.map +1 -1
  22. package/lib/packlets/observe/memoryObservationStore.js +6 -0
  23. package/lib/packlets/observe/memoryObservationStore.js.map +1 -1
  24. package/lib/packlets/observe/observer.d.ts +61 -0
  25. package/lib/packlets/observe/observer.d.ts.map +1 -1
  26. package/lib/packlets/observe/observer.js.map +1 -1
  27. package/lib/packlets/store/fileTreeMemoryStore.d.ts +97 -60
  28. package/lib/packlets/store/fileTreeMemoryStore.d.ts.map +1 -1
  29. package/lib/packlets/store/fileTreeMemoryStore.js +63 -135
  30. package/lib/packlets/store/fileTreeMemoryStore.js.map +1 -1
  31. package/lib/packlets/store/vectorMaintenance.d.ts +149 -0
  32. package/lib/packlets/store/vectorMaintenance.d.ts.map +1 -0
  33. package/lib/packlets/store/vectorMaintenance.js +255 -0
  34. package/lib/packlets/store/vectorMaintenance.js.map +1 -0
  35. package/lib/packlets/vector/inMemoryCosineIndex.d.ts +30 -7
  36. package/lib/packlets/vector/inMemoryCosineIndex.d.ts.map +1 -1
  37. package/lib/packlets/vector/inMemoryCosineIndex.js +80 -17
  38. package/lib/packlets/vector/inMemoryCosineIndex.js.map +1 -1
  39. package/lib/packlets/vector/inMemoryFragmentCosineIndex.d.ts +7 -0
  40. package/lib/packlets/vector/inMemoryFragmentCosineIndex.d.ts.map +1 -1
  41. package/lib/packlets/vector/inMemoryFragmentCosineIndex.js +7 -0
  42. package/lib/packlets/vector/inMemoryFragmentCosineIndex.js.map +1 -1
  43. package/lib/packlets/vector/vectorIndex.d.ts +129 -1
  44. package/lib/packlets/vector/vectorIndex.d.ts.map +1 -1
  45. package/lib/packlets/vector/vectorIndex.js.map +1 -1
  46. package/package.json +17 -7
  47. package/.rush/temp/6e1299d1cebb080772163a532c221cd181b54f9f.tar.log +0 -462
  48. package/.rush/temp/chunked-rush-logs/ts-agent-memory.build.chunks.jsonl +0 -9
  49. package/.rush/temp/operation/build/all.log +0 -9
  50. package/.rush/temp/operation/build/log-chunks.jsonl +0 -9
  51. package/.rush/temp/operation/build/state.json +0 -3
  52. package/.rush/temp/shrinkwrap-deps.json +0 -689
  53. package/config/api-extractor.json +0 -343
  54. package/config/jest.config.json +0 -14
  55. package/config/rig.json +0 -4
  56. package/dist/test/unit/converters/antagonistRoundTrip.test.js +0 -95
  57. package/dist/test/unit/converters/antagonistRoundTrip.test.js.map +0 -1
  58. package/dist/test/unit/converters/bodyConverterRegistry.test.js +0 -72
  59. package/dist/test/unit/converters/bodyConverterRegistry.test.js.map +0 -1
  60. package/dist/test/unit/converters/envelopeConverter.test.js +0 -313
  61. package/dist/test/unit/converters/envelopeConverter.test.js.map +0 -1
  62. package/dist/test/unit/index/memoryIndex.test.js +0 -214
  63. package/dist/test/unit/index/memoryIndex.test.js.map +0 -1
  64. package/dist/test/unit/ingest/antagonistCycleAndParity.test.js +0 -277
  65. package/dist/test/unit/ingest/antagonistCycleAndParity.test.js.map +0 -1
  66. package/dist/test/unit/ingest/cycleGuard.test.js +0 -81
  67. package/dist/test/unit/ingest/cycleGuard.test.js.map +0 -1
  68. package/dist/test/unit/ingest/orchestrator.test.js +0 -1055
  69. package/dist/test/unit/ingest/orchestrator.test.js.map +0 -1
  70. package/dist/test/unit/observe/memoryObservationStore.test.js +0 -118
  71. package/dist/test/unit/observe/memoryObservationStore.test.js.map +0 -1
  72. package/dist/test/unit/retrieve/fragmentSemanticRetriever.test.js +0 -116
  73. package/dist/test/unit/retrieve/fragmentSemanticRetriever.test.js.map +0 -1
  74. package/dist/test/unit/retrieve/linkTraversalRetriever.test.js +0 -257
  75. package/dist/test/unit/retrieve/linkTraversalRetriever.test.js.map +0 -1
  76. package/dist/test/unit/retrieve/retrievers.test.js +0 -768
  77. package/dist/test/unit/retrieve/retrievers.test.js.map +0 -1
  78. package/dist/test/unit/retrieve/temporalRetrievers.test.js +0 -182
  79. package/dist/test/unit/retrieve/temporalRetrievers.test.js.map +0 -1
  80. package/dist/test/unit/store/antagonistTemporalBoundary.test.js +0 -120
  81. package/dist/test/unit/store/antagonistTemporalBoundary.test.js.map +0 -1
  82. package/dist/test/unit/store/embedOnWrite.test.js +0 -317
  83. package/dist/test/unit/store/embedOnWrite.test.js.map +0 -1
  84. package/dist/test/unit/store/fileTreeMemoryStore.test.js +0 -778
  85. package/dist/test/unit/store/fileTreeMemoryStore.test.js.map +0 -1
  86. package/dist/test/unit/store/fragmentEmbedOnWrite.test.js +0 -255
  87. package/dist/test/unit/store/fragmentEmbedOnWrite.test.js.map +0 -1
  88. package/dist/test/unit/store/indexInjection.test.js +0 -432
  89. package/dist/test/unit/store/indexInjection.test.js.map +0 -1
  90. package/dist/test/unit/store/lenientOpen.test.js +0 -248
  91. package/dist/test/unit/store/lenientOpen.test.js.map +0 -1
  92. package/dist/test/unit/store/listScoped.test.js +0 -109
  93. package/dist/test/unit/store/listScoped.test.js.map +0 -1
  94. package/dist/test/unit/store/observations.test.js +0 -239
  95. package/dist/test/unit/store/observations.test.js.map +0 -1
  96. package/dist/test/unit/store/rankAxis.test.js +0 -254
  97. package/dist/test/unit/store/rankAxis.test.js.map +0 -1
  98. package/dist/test/unit/store/scopeEncoding.test.js +0 -24
  99. package/dist/test/unit/store/scopeEncoding.test.js.map +0 -1
  100. package/dist/test/unit/store/temporalStore.test.js +0 -398
  101. package/dist/test/unit/store/temporalStore.test.js.map +0 -1
  102. package/dist/test/unit/tools/memoryTools.test.js +0 -841
  103. package/dist/test/unit/tools/memoryTools.test.js.map +0 -1
  104. package/dist/test/unit/types/identityCodec.test.js +0 -187
  105. package/dist/test/unit/types/identityCodec.test.js.map +0 -1
  106. package/dist/test/unit/types/ids.test.js +0 -84
  107. package/dist/test/unit/types/ids.test.js.map +0 -1
  108. package/dist/test/unit/types/temporalCodec.test.js +0 -203
  109. package/dist/test/unit/types/temporalCodec.test.js.map +0 -1
  110. package/dist/test/unit/types/temporalPolicy.test.js +0 -83
  111. package/dist/test/unit/types/temporalPolicy.test.js.map +0 -1
  112. package/dist/test/unit/types/writePolicy.test.js +0 -331
  113. package/dist/test/unit/types/writePolicy.test.js.map +0 -1
  114. package/dist/test/unit/vector/fragmentConverters.test.js +0 -58
  115. package/dist/test/unit/vector/fragmentConverters.test.js.map +0 -1
  116. package/dist/test/unit/vector/inMemoryCosineIndex.test.js +0 -252
  117. package/dist/test/unit/vector/inMemoryCosineIndex.test.js.map +0 -1
  118. package/dist/test/unit/vector/inMemoryFragmentCosineIndex.test.js +0 -362
  119. package/dist/test/unit/vector/inMemoryFragmentCosineIndex.test.js.map +0 -1
  120. package/dist/test/unit/vector/vectorIndex.test.js +0 -51
  121. package/dist/test/unit/vector/vectorIndex.test.js.map +0 -1
  122. package/eslint.config.js +0 -15
  123. package/etc/ts-agent-memory.api.md +0 -938
  124. package/lib/test/unit/converters/antagonistRoundTrip.test.d.ts +0 -10
  125. package/lib/test/unit/converters/antagonistRoundTrip.test.d.ts.map +0 -1
  126. package/lib/test/unit/converters/antagonistRoundTrip.test.js +0 -97
  127. package/lib/test/unit/converters/antagonistRoundTrip.test.js.map +0 -1
  128. package/lib/test/unit/converters/bodyConverterRegistry.test.d.ts +0 -2
  129. package/lib/test/unit/converters/bodyConverterRegistry.test.d.ts.map +0 -1
  130. package/lib/test/unit/converters/bodyConverterRegistry.test.js +0 -74
  131. package/lib/test/unit/converters/bodyConverterRegistry.test.js.map +0 -1
  132. package/lib/test/unit/converters/envelopeConverter.test.d.ts +0 -2
  133. package/lib/test/unit/converters/envelopeConverter.test.d.ts.map +0 -1
  134. package/lib/test/unit/converters/envelopeConverter.test.js +0 -315
  135. package/lib/test/unit/converters/envelopeConverter.test.js.map +0 -1
  136. package/lib/test/unit/index/memoryIndex.test.d.ts +0 -2
  137. package/lib/test/unit/index/memoryIndex.test.d.ts.map +0 -1
  138. package/lib/test/unit/index/memoryIndex.test.js +0 -216
  139. package/lib/test/unit/index/memoryIndex.test.js.map +0 -1
  140. package/lib/test/unit/ingest/antagonistCycleAndParity.test.d.ts +0 -9
  141. package/lib/test/unit/ingest/antagonistCycleAndParity.test.d.ts.map +0 -1
  142. package/lib/test/unit/ingest/antagonistCycleAndParity.test.js +0 -279
  143. package/lib/test/unit/ingest/antagonistCycleAndParity.test.js.map +0 -1
  144. package/lib/test/unit/ingest/cycleGuard.test.d.ts +0 -2
  145. package/lib/test/unit/ingest/cycleGuard.test.d.ts.map +0 -1
  146. package/lib/test/unit/ingest/cycleGuard.test.js +0 -83
  147. package/lib/test/unit/ingest/cycleGuard.test.js.map +0 -1
  148. package/lib/test/unit/ingest/orchestrator.test.d.ts +0 -2
  149. package/lib/test/unit/ingest/orchestrator.test.d.ts.map +0 -1
  150. package/lib/test/unit/ingest/orchestrator.test.js +0 -1057
  151. package/lib/test/unit/ingest/orchestrator.test.js.map +0 -1
  152. package/lib/test/unit/observe/memoryObservationStore.test.d.ts +0 -2
  153. package/lib/test/unit/observe/memoryObservationStore.test.d.ts.map +0 -1
  154. package/lib/test/unit/observe/memoryObservationStore.test.js +0 -120
  155. package/lib/test/unit/observe/memoryObservationStore.test.js.map +0 -1
  156. package/lib/test/unit/retrieve/fragmentSemanticRetriever.test.d.ts +0 -2
  157. package/lib/test/unit/retrieve/fragmentSemanticRetriever.test.d.ts.map +0 -1
  158. package/lib/test/unit/retrieve/fragmentSemanticRetriever.test.js +0 -118
  159. package/lib/test/unit/retrieve/fragmentSemanticRetriever.test.js.map +0 -1
  160. package/lib/test/unit/retrieve/linkTraversalRetriever.test.d.ts +0 -2
  161. package/lib/test/unit/retrieve/linkTraversalRetriever.test.d.ts.map +0 -1
  162. package/lib/test/unit/retrieve/linkTraversalRetriever.test.js +0 -259
  163. package/lib/test/unit/retrieve/linkTraversalRetriever.test.js.map +0 -1
  164. package/lib/test/unit/retrieve/retrievers.test.d.ts +0 -2
  165. package/lib/test/unit/retrieve/retrievers.test.d.ts.map +0 -1
  166. package/lib/test/unit/retrieve/retrievers.test.js +0 -770
  167. package/lib/test/unit/retrieve/retrievers.test.js.map +0 -1
  168. package/lib/test/unit/retrieve/temporalRetrievers.test.d.ts +0 -2
  169. package/lib/test/unit/retrieve/temporalRetrievers.test.d.ts.map +0 -1
  170. package/lib/test/unit/retrieve/temporalRetrievers.test.js +0 -184
  171. package/lib/test/unit/retrieve/temporalRetrievers.test.js.map +0 -1
  172. package/lib/test/unit/store/antagonistTemporalBoundary.test.d.ts +0 -9
  173. package/lib/test/unit/store/antagonistTemporalBoundary.test.d.ts.map +0 -1
  174. package/lib/test/unit/store/antagonistTemporalBoundary.test.js +0 -122
  175. package/lib/test/unit/store/antagonistTemporalBoundary.test.js.map +0 -1
  176. package/lib/test/unit/store/embedOnWrite.test.d.ts +0 -2
  177. package/lib/test/unit/store/embedOnWrite.test.d.ts.map +0 -1
  178. package/lib/test/unit/store/embedOnWrite.test.js +0 -319
  179. package/lib/test/unit/store/embedOnWrite.test.js.map +0 -1
  180. package/lib/test/unit/store/fileTreeMemoryStore.test.d.ts +0 -2
  181. package/lib/test/unit/store/fileTreeMemoryStore.test.d.ts.map +0 -1
  182. package/lib/test/unit/store/fileTreeMemoryStore.test.js +0 -780
  183. package/lib/test/unit/store/fileTreeMemoryStore.test.js.map +0 -1
  184. package/lib/test/unit/store/fragmentEmbedOnWrite.test.d.ts +0 -2
  185. package/lib/test/unit/store/fragmentEmbedOnWrite.test.d.ts.map +0 -1
  186. package/lib/test/unit/store/fragmentEmbedOnWrite.test.js +0 -257
  187. package/lib/test/unit/store/fragmentEmbedOnWrite.test.js.map +0 -1
  188. package/lib/test/unit/store/indexInjection.test.d.ts +0 -2
  189. package/lib/test/unit/store/indexInjection.test.d.ts.map +0 -1
  190. package/lib/test/unit/store/indexInjection.test.js +0 -434
  191. package/lib/test/unit/store/indexInjection.test.js.map +0 -1
  192. package/lib/test/unit/store/lenientOpen.test.d.ts +0 -2
  193. package/lib/test/unit/store/lenientOpen.test.d.ts.map +0 -1
  194. package/lib/test/unit/store/lenientOpen.test.js +0 -250
  195. package/lib/test/unit/store/lenientOpen.test.js.map +0 -1
  196. package/lib/test/unit/store/listScoped.test.d.ts +0 -2
  197. package/lib/test/unit/store/listScoped.test.d.ts.map +0 -1
  198. package/lib/test/unit/store/listScoped.test.js +0 -111
  199. package/lib/test/unit/store/listScoped.test.js.map +0 -1
  200. package/lib/test/unit/store/observations.test.d.ts +0 -2
  201. package/lib/test/unit/store/observations.test.d.ts.map +0 -1
  202. package/lib/test/unit/store/observations.test.js +0 -241
  203. package/lib/test/unit/store/observations.test.js.map +0 -1
  204. package/lib/test/unit/store/rankAxis.test.d.ts +0 -2
  205. package/lib/test/unit/store/rankAxis.test.d.ts.map +0 -1
  206. package/lib/test/unit/store/rankAxis.test.js +0 -256
  207. package/lib/test/unit/store/rankAxis.test.js.map +0 -1
  208. package/lib/test/unit/store/scopeEncoding.test.d.ts +0 -2
  209. package/lib/test/unit/store/scopeEncoding.test.d.ts.map +0 -1
  210. package/lib/test/unit/store/scopeEncoding.test.js +0 -26
  211. package/lib/test/unit/store/scopeEncoding.test.js.map +0 -1
  212. package/lib/test/unit/store/temporalStore.test.d.ts +0 -2
  213. package/lib/test/unit/store/temporalStore.test.d.ts.map +0 -1
  214. package/lib/test/unit/store/temporalStore.test.js +0 -400
  215. package/lib/test/unit/store/temporalStore.test.js.map +0 -1
  216. package/lib/test/unit/tools/memoryTools.test.d.ts +0 -2
  217. package/lib/test/unit/tools/memoryTools.test.d.ts.map +0 -1
  218. package/lib/test/unit/tools/memoryTools.test.js +0 -843
  219. package/lib/test/unit/tools/memoryTools.test.js.map +0 -1
  220. package/lib/test/unit/types/identityCodec.test.d.ts +0 -2
  221. package/lib/test/unit/types/identityCodec.test.d.ts.map +0 -1
  222. package/lib/test/unit/types/identityCodec.test.js +0 -189
  223. package/lib/test/unit/types/identityCodec.test.js.map +0 -1
  224. package/lib/test/unit/types/ids.test.d.ts +0 -2
  225. package/lib/test/unit/types/ids.test.d.ts.map +0 -1
  226. package/lib/test/unit/types/ids.test.js +0 -86
  227. package/lib/test/unit/types/ids.test.js.map +0 -1
  228. package/lib/test/unit/types/temporalCodec.test.d.ts +0 -2
  229. package/lib/test/unit/types/temporalCodec.test.d.ts.map +0 -1
  230. package/lib/test/unit/types/temporalCodec.test.js +0 -205
  231. package/lib/test/unit/types/temporalCodec.test.js.map +0 -1
  232. package/lib/test/unit/types/temporalPolicy.test.d.ts +0 -2
  233. package/lib/test/unit/types/temporalPolicy.test.d.ts.map +0 -1
  234. package/lib/test/unit/types/temporalPolicy.test.js +0 -85
  235. package/lib/test/unit/types/temporalPolicy.test.js.map +0 -1
  236. package/lib/test/unit/types/writePolicy.test.d.ts +0 -2
  237. package/lib/test/unit/types/writePolicy.test.d.ts.map +0 -1
  238. package/lib/test/unit/types/writePolicy.test.js +0 -333
  239. package/lib/test/unit/types/writePolicy.test.js.map +0 -1
  240. package/lib/test/unit/vector/fragmentConverters.test.d.ts +0 -2
  241. package/lib/test/unit/vector/fragmentConverters.test.d.ts.map +0 -1
  242. package/lib/test/unit/vector/fragmentConverters.test.js +0 -60
  243. package/lib/test/unit/vector/fragmentConverters.test.js.map +0 -1
  244. package/lib/test/unit/vector/inMemoryCosineIndex.test.d.ts +0 -2
  245. package/lib/test/unit/vector/inMemoryCosineIndex.test.d.ts.map +0 -1
  246. package/lib/test/unit/vector/inMemoryCosineIndex.test.js +0 -254
  247. package/lib/test/unit/vector/inMemoryCosineIndex.test.js.map +0 -1
  248. package/lib/test/unit/vector/inMemoryFragmentCosineIndex.test.d.ts +0 -2
  249. package/lib/test/unit/vector/inMemoryFragmentCosineIndex.test.d.ts.map +0 -1
  250. package/lib/test/unit/vector/inMemoryFragmentCosineIndex.test.js +0 -364
  251. package/lib/test/unit/vector/inMemoryFragmentCosineIndex.test.js.map +0 -1
  252. package/lib/test/unit/vector/vectorIndex.test.d.ts +0 -2
  253. package/lib/test/unit/vector/vectorIndex.test.d.ts.map +0 -1
  254. package/lib/test/unit/vector/vectorIndex.test.js +0 -53
  255. package/lib/test/unit/vector/vectorIndex.test.js.map +0 -1
  256. package/rush-logs/ts-agent-memory.build.cache.log +0 -3
  257. package/rush-logs/ts-agent-memory.build.log +0 -9
  258. package/src/index.ts +0 -14
  259. package/src/packlets/converters/bodyConverterRegistry.ts +0 -105
  260. package/src/packlets/converters/envelopeConverter.ts +0 -233
  261. package/src/packlets/converters/index.ts +0 -7
  262. package/src/packlets/index/index.ts +0 -6
  263. package/src/packlets/index/memoryIndex.ts +0 -332
  264. package/src/packlets/ingest/cycleGuard.ts +0 -153
  265. package/src/packlets/ingest/hostStages.ts +0 -111
  266. package/src/packlets/ingest/index.ts +0 -9
  267. package/src/packlets/ingest/model.ts +0 -195
  268. package/src/packlets/ingest/orchestrator.ts +0 -873
  269. package/src/packlets/observe/index.ts +0 -7
  270. package/src/packlets/observe/memoryObservationStore.ts +0 -153
  271. package/src/packlets/observe/observer.ts +0 -119
  272. package/src/packlets/retrieve/fragmentSemanticRetriever.ts +0 -138
  273. package/src/packlets/retrieve/hybridRetriever.ts +0 -194
  274. package/src/packlets/retrieve/index.ts +0 -14
  275. package/src/packlets/retrieve/linkTraversalRetriever.ts +0 -158
  276. package/src/packlets/retrieve/recencyRetriever.ts +0 -54
  277. package/src/packlets/retrieve/retriever.ts +0 -291
  278. package/src/packlets/retrieve/semanticRetriever.ts +0 -152
  279. package/src/packlets/retrieve/structuredFilterRetriever.ts +0 -58
  280. package/src/packlets/retrieve/tagRetriever.ts +0 -58
  281. package/src/packlets/retrieve/temporalRetrievers.ts +0 -210
  282. package/src/packlets/store/fileTreeMemoryStore.ts +0 -1834
  283. package/src/packlets/store/index.ts +0 -7
  284. package/src/packlets/store/scopeEncoding.ts +0 -36
  285. package/src/packlets/tools/index.ts +0 -6
  286. package/src/packlets/tools/memoryTools.ts +0 -706
  287. package/src/packlets/types/envelope.ts +0 -196
  288. package/src/packlets/types/filenameSafety.ts +0 -57
  289. package/src/packlets/types/identityCodec.ts +0 -447
  290. package/src/packlets/types/ids.ts +0 -124
  291. package/src/packlets/types/index.ts +0 -11
  292. package/src/packlets/types/temporal.ts +0 -96
  293. package/src/packlets/types/writePolicy.ts +0 -612
  294. package/src/packlets/vector/fragmentConverters.ts +0 -55
  295. package/src/packlets/vector/inMemoryCosineIndex.ts +0 -196
  296. package/src/packlets/vector/inMemoryFragmentCosineIndex.ts +0 -289
  297. package/src/packlets/vector/index.ts +0 -9
  298. package/src/packlets/vector/vectorIndex.ts +0 -273
  299. package/src/test/unit/converters/antagonistRoundTrip.test.ts +0 -110
  300. package/src/test/unit/converters/bodyConverterRegistry.test.ts +0 -89
  301. package/src/test/unit/converters/envelopeConverter.test.ts +0 -418
  302. package/src/test/unit/index/memoryIndex.test.ts +0 -272
  303. package/src/test/unit/ingest/antagonistCycleAndParity.test.ts +0 -367
  304. package/src/test/unit/ingest/cycleGuard.test.ts +0 -110
  305. package/src/test/unit/ingest/orchestrator.test.ts +0 -1351
  306. package/src/test/unit/observe/memoryObservationStore.test.ts +0 -158
  307. package/src/test/unit/retrieve/fragmentSemanticRetriever.test.ts +0 -163
  308. package/src/test/unit/retrieve/linkTraversalRetriever.test.ts +0 -329
  309. package/src/test/unit/retrieve/retrievers.test.ts +0 -1018
  310. package/src/test/unit/retrieve/temporalRetrievers.test.ts +0 -226
  311. package/src/test/unit/store/antagonistTemporalBoundary.test.ts +0 -158
  312. package/src/test/unit/store/embedOnWrite.test.ts +0 -418
  313. package/src/test/unit/store/fileTreeMemoryStore.test.ts +0 -1041
  314. package/src/test/unit/store/fragmentEmbedOnWrite.test.ts +0 -349
  315. package/src/test/unit/store/indexInjection.test.ts +0 -550
  316. package/src/test/unit/store/lenientOpen.test.ts +0 -292
  317. package/src/test/unit/store/listScoped.test.ts +0 -138
  318. package/src/test/unit/store/observations.test.ts +0 -290
  319. package/src/test/unit/store/rankAxis.test.ts +0 -349
  320. package/src/test/unit/store/scopeEncoding.test.ts +0 -37
  321. package/src/test/unit/store/temporalStore.test.ts +0 -469
  322. package/src/test/unit/tools/memoryTools.test.ts +0 -1120
  323. package/src/test/unit/types/identityCodec.test.ts +0 -266
  324. package/src/test/unit/types/ids.test.ts +0 -94
  325. package/src/test/unit/types/temporalCodec.test.ts +0 -259
  326. package/src/test/unit/types/temporalPolicy.test.ts +0 -124
  327. package/src/test/unit/types/writePolicy.test.ts +0 -446
  328. package/src/test/unit/vector/fragmentConverters.test.ts +0 -80
  329. package/src/test/unit/vector/inMemoryCosineIndex.test.ts +0 -318
  330. package/src/test/unit/vector/inMemoryFragmentCosineIndex.test.ts +0 -477
  331. package/src/test/unit/vector/vectorIndex.test.ts +0 -64
  332. package/temp/build/lint/_eslint-5eVG3S6w.json +0 -302
  333. package/temp/build/typescript/ts_8nwakTlr.json +0 -1
  334. package/temp/ts-agent-memory.api.json +0 -20933
  335. package/temp/ts-agent-memory.api.md +0 -938
  336. package/tsconfig.json +0 -8
@@ -116,6 +116,12 @@ class MemoryObservationStore {
116
116
  if (criteria.outcome !== undefined && record.outcome !== criteria.outcome) {
117
117
  return false;
118
118
  }
119
+ // A record carrying no embed outcome never matches an `embed` criterion —
120
+ // "the question did not apply here" is not the same answer as any of the
121
+ // four, and matching it would put unwired writes in a coverage-gap report.
122
+ if (criteria.embed !== undefined && record.embed !== criteria.embed) {
123
+ return false;
124
+ }
119
125
  return true;
120
126
  }
121
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memoryObservationStore.js","sourceRoot":"","sources":["../../../src/packlets/observe/memoryObservationStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAmE;AAenE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,sBAAsB;IASjC;;;OAGG;IACH,YAAoB,MAAiE;QACnF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAA4C;QAC/D,MAAM,UAAU,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAC;QAC1D,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC;YAClF,OAAO,IAAA,eAAI,EAAC,sEAAsE,UAAU,GAAG,CAAC,CAAC;QACnG,CAAC;QACD,OAAO,IAAA,kBAAO,EACZ,IAAI,sBAAsB,CACxB,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AO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA7GD,wDA6GC","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n * SPDX-License-Identifier: MIT\n */\n\nimport { Collections, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IMemoryObservationQuery, IMemoryObservationRecord, IMemoryObserver } from './observer';\n\n/**\n * Construction options for {@link MemoryObservationStore.create}.\n * @public\n */\nexport interface IMemoryObservationStoreCreateParams {\n /**\n * Maximum number of observation records retained before the oldest is\n * overwritten. Defaults to `1000`. Must be a positive integer if supplied.\n */\n readonly maxRecords?: number;\n}\n\n/**\n * The default in-memory observation store: an {@link IMemoryObserver} that\n * retains the records it observes in a bounded ring and answers schema-aware\n * {@link MemoryObservationStore.query | queries} over them.\n *\n * @remarks\n * **Privacy posture — this store is most-permissive by design.** It retains\n * every field of every record verbatim, including any `provenance` and\n * `querySnapshot`. The library bakes in **no** redaction, retention, or\n * field-stripping policy — that is deployment policy, not library policy. A\n * deployment that must redact wraps this store with its own\n * {@link IMemoryObserver} that transforms records before forwarding, or\n * substitutes a different observer entirely. Size is the only bounded\n * dimension, via `maxRecords`.\n *\n * The store composes `RetainingRingBuffer` from `@fgv/ts-utils` (it does not\n * hand-roll a ring) and implements {@link IMemoryObserver} directly — `observe`\n * (the hook) and `query` (the read surface) live on the same class. Wire it via\n * {@link IFileTreeMemoryStoreCreateParams.observers}. `seq` and `timestamp` are\n * assigned by the firing authority (the store) before `observe`, so this store\n * never mints them.\n * @public\n */\nexport class MemoryObservationStore implements IMemoryObserver {\n /**\n * The bounded ring of observed records. The firing authority assigns each\n * record's `seq`, so the ring's monotonic-`seq` cursor contract is satisfied\n * by that authority's per-instance counter.\n * @internal\n */\n private readonly _buffer: Collections.RetainingRingBuffer<IMemoryObservationRecord>;\n\n /**\n * @param buffer - The pre-constructed backing ring buffer.\n * @internal\n */\n private constructor(buffer: Collections.RetainingRingBuffer<IMemoryObservationRecord>) {\n this._buffer = buffer;\n }\n\n /**\n * The highest `seq` observed so far. Hold this value and pass it as\n * `sinceSeq` to {@link MemoryObservationStore.query | query} to page only\n * records observed afterward. Stable across ring eviction and\n * {@link MemoryObservationStore.clear | clear}.\n */\n public get lastSeq(): number {\n return this._buffer.lastSeq;\n }\n\n /**\n * The number of records currently retained.\n */\n public get size(): number {\n return this._buffer.size;\n }\n\n /**\n * Family-convention factory.\n * @param params - {@link IMemoryObservationStoreCreateParams | Construction options}.\n * @returns On success, a new store. Fails if `maxRecords` is supplied and is\n * not a positive integer.\n */\n public static create(params?: IMemoryObservationStoreCreateParams): Result<MemoryObservationStore> {\n const maxRecords: number | undefined = params?.maxRecords;\n if (maxRecords !== undefined && (!Number.isInteger(maxRecords) || maxRecords < 1)) {\n return fail(`MemoryObservationStore: maxRecords must be a positive integer (got ${maxRecords})`);\n }\n return succeed(\n new MemoryObservationStore(\n new Collections.RetainingRingBuffer<IMemoryObservationRecord>({ maxRecords })\n )\n );\n }\n\n /**\n * {@inheritDoc IMemoryObserver.observe}\n */\n public observe(record: IMemoryObservationRecord): Promise<Result<unknown>> {\n this._buffer.push(record);\n return Promise.resolve(succeed(record));\n }\n\n /**\n * Returns retained records, oldest-first, narrowed by the supplied criteria.\n * @param criteria - {@link IMemoryObservationQuery | AND-combined filter criteria}.\n * @returns The matching records, oldest-first.\n */\n public query(criteria?: IMemoryObservationQuery): ReadonlyArray<IMemoryObservationRecord> {\n return this._buffer.query({\n sinceSeq: criteria?.sinceSeq,\n limit: criteria?.limit,\n filter:\n criteria === undefined ? undefined : (record) => MemoryObservationStore._matches(record, criteria)\n });\n }\n\n /**\n * Clears all retained records. Does NOT reset\n * {@link MemoryObservationStore.lastSeq | lastSeq}, so a held `sinceSeq`\n * cursor never re-sees a sequence number.\n */\n public clear(): void {\n this._buffer.clear();\n }\n\n /**\n * Tests a record against the non-`seq`/`limit` criteria (those are applied by\n * the ring buffer itself).\n * @internal\n */\n private static _matches(record: IMemoryObservationRecord, criteria: IMemoryObservationQuery): boolean {\n if (criteria.since !== undefined && record.timestamp < criteria.since) {\n return false;\n }\n if (criteria.until !== undefined && record.timestamp > criteria.until) {\n return false;\n }\n if (criteria.scope !== undefined && record.scope !== criteria.scope) {\n return false;\n }\n if (criteria.kind !== undefined && record.kind !== criteria.kind) {\n return false;\n }\n if (criteria.phase !== undefined && record.phase !== criteria.phase) {\n return false;\n }\n if (criteria.outcome !== undefined && record.outcome !== criteria.outcome) {\n return false;\n }\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"memoryObservationStore.js","sourceRoot":"","sources":["../../../src/packlets/observe/memoryObservationStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAmE;AAenE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,sBAAsB;IASjC;;;OAGG;IACH,YAAoB,MAAiE;QACnF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAA4C;Q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AAS,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;QACD,0EAA0E;QAC1E,yEAAyE;QACzE,2EAA2E;QAC3E,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnHD,wDAmHC","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n * SPDX-License-Identifier: MIT\n */\n\nimport { Collections, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IMemoryObservationQuery, IMemoryObservationRecord, IMemoryObserver } from './observer';\n\n/**\n * Construction options for {@link MemoryObservationStore.create}.\n * @public\n */\nexport interface IMemoryObservationStoreCreateParams {\n /**\n * Maximum number of observation records retained before the oldest is\n * overwritten. Defaults to `1000`. Must be a positive integer if supplied.\n */\n readonly maxRecords?: number;\n}\n\n/**\n * The default in-memory observation store: an {@link IMemoryObserver} that\n * retains the records it observes in a bounded ring and answers schema-aware\n * {@link MemoryObservationStore.query | queries} over them.\n *\n * @remarks\n * **Privacy posture — this store is most-permissive by design.** It retains\n * every field of every record verbatim, including any `provenance` and\n * `querySnapshot`. The library bakes in **no** redaction, retention, or\n * field-stripping policy — that is deployment policy, not library policy. A\n * deployment that must redact wraps this store with its own\n * {@link IMemoryObserver} that transforms records before forwarding, or\n * substitutes a different observer entirely. Size is the only bounded\n * dimension, via `maxRecords`.\n *\n * The store composes `RetainingRingBuffer` from `@fgv/ts-utils` (it does not\n * hand-roll a ring) and implements {@link IMemoryObserver} directly — `observe`\n * (the hook) and `query` (the read surface) live on the same class. Wire it via\n * {@link IFileTreeMemoryStoreCreateParams.observers}. `seq` and `timestamp` are\n * assigned by the firing authority (the store) before `observe`, so this store\n * never mints them.\n * @public\n */\nexport class MemoryObservationStore implements IMemoryObserver {\n /**\n * The bounded ring of observed records. The firing authority assigns each\n * record's `seq`, so the ring's monotonic-`seq` cursor contract is satisfied\n * by that authority's per-instance counter.\n * @internal\n */\n private readonly _buffer: Collections.RetainingRingBuffer<IMemoryObservationRecord>;\n\n /**\n * @param buffer - The pre-constructed backing ring buffer.\n * @internal\n */\n private constructor(buffer: Collections.RetainingRingBuffer<IMemoryObservationRecord>) {\n this._buffer = buffer;\n }\n\n /**\n * The highest `seq` observed so far. Hold this value and pass it as\n * `sinceSeq` to {@link MemoryObservationStore.query | query} to page only\n * records observed afterward. Stable across ring eviction and\n * {@link MemoryObservationStore.clear | clear}.\n */\n public get lastSeq(): number {\n return this._buffer.lastSeq;\n }\n\n /**\n * The number of records currently retained.\n */\n public get size(): number {\n return this._buffer.size;\n }\n\n /**\n * Family-convention factory.\n * @param params - {@link IMemoryObservationStoreCreateParams | Construction options}.\n * @returns On success, a new store. Fails if `maxRecords` is supplied and is\n * not a positive integer.\n */\n public static create(params?: IMemoryObservationStoreCreateParams): Result<MemoryObservationStore> {\n const maxRecords: number | undefined = params?.maxRecords;\n if (maxRecords !== undefined && (!Number.isInteger(maxRecords) || maxRecords < 1)) {\n return fail(`MemoryObservationStore: maxRecords must be a positive integer (got ${maxRecords})`);\n }\n return succeed(\n new MemoryObservationStore(\n new Collections.RetainingRingBuffer<IMemoryObservationRecord>({ maxRecords })\n )\n );\n }\n\n /**\n * {@inheritDoc IMemoryObserver.observe}\n */\n public observe(record: IMemoryObservationRecord): Promise<Result<unknown>> {\n this._buffer.push(record);\n return Promise.resolve(succeed(record));\n }\n\n /**\n * Returns retained records, oldest-first, narrowed by the supplied criteria.\n * @param criteria - {@link IMemoryObservationQuery | AND-combined filter criteria}.\n * @returns The matching records, oldest-first.\n */\n public query(criteria?: IMemoryObservationQuery): ReadonlyArray<IMemoryObservationRecord> {\n return this._buffer.query({\n sinceSeq: criteria?.sinceSeq,\n limit: criteria?.limit,\n filter:\n criteria === undefined ? undefined : (record) => MemoryObservationStore._matches(record, criteria)\n });\n }\n\n /**\n * Clears all retained records. Does NOT reset\n * {@link MemoryObservationStore.lastSeq | lastSeq}, so a held `sinceSeq`\n * cursor never re-sees a sequence number.\n */\n public clear(): void {\n this._buffer.clear();\n }\n\n /**\n * Tests a record against the non-`seq`/`limit` criteria (those are applied by\n * the ring buffer itself).\n * @internal\n */\n private static _matches(record: IMemoryObservationRecord, criteria: IMemoryObservationQuery): boolean {\n if (criteria.since !== undefined && record.timestamp < criteria.since) {\n return false;\n }\n if (criteria.until !== undefined && record.timestamp > criteria.until) {\n return false;\n }\n if (criteria.scope !== undefined && record.scope !== criteria.scope) {\n return false;\n }\n if (criteria.kind !== undefined && record.kind !== criteria.kind) {\n return false;\n }\n if (criteria.phase !== undefined && record.phase !== criteria.phase) {\n return false;\n }\n if (criteria.outcome !== undefined && record.outcome !== criteria.outcome) {\n return false;\n }\n // A record carrying no embed outcome never matches an `embed` criterion —\n // \"the question did not apply here\" is not the same answer as any of the\n // four, and matching it would put unwired writes in a coverage-gap report.\n if (criteria.embed !== undefined && record.embed !== criteria.embed) {\n return false;\n }\n return true;\n }\n}\n"]}
@@ -18,6 +18,55 @@ export type MemoryObservationPhase = 'read' | 'write' | 'delete' | 'retrieve';
18
18
  * @public
19
19
  */
20
20
  export type MemoryObservationOutcome = 'success' | 'failure';
21
+ /**
22
+ * What the record-granular vector index did about a written record.
23
+ *
24
+ * @remarks
25
+ * This exists because **`embeddingRef` absence is three-ways ambiguous**: a
26
+ * record with no reference may have been declined, excluded, or genuinely
27
+ * failed to embed, and the `put`'s own `outcome` cannot tell you which — it is
28
+ * `'success'` in all three, because embed-on-write is best-effort by design and
29
+ * never fails a durable write. Deriving index coverage from the absent field
30
+ * alone therefore cannot distinguish a policy decision from an outage.
31
+ *
32
+ * - `'embedded'` — embedded and added; the record carries an `embeddingRef`.
33
+ * - `'declined'` — the {@link MemoryEmbedder} resolved `undefined`: deliberately
34
+ * not embedded. Not a fault.
35
+ * - `'excluded'` — the record's kind is outside the store's `embedKinds`
36
+ * declaration, so the embedder was never called. Also not a fault, and the
37
+ * cheaper of the two.
38
+ * - `'failed'` — the embedder returned a `Failure` (or threw), **or** the index
39
+ * `add` did. Both are faults, and what they leave behind depends on whether
40
+ * the record had been embedded before: a **first** write ends up with no
41
+ * `embeddingRef` and nothing in the index, while an **update** keeps the
42
+ * reference and vector it already had — so the index goes on answering on the
43
+ * record's **previous** content until a `rebuild` reconciles it. Stale, not
44
+ * absent. The store's diagnostic logger names which fault it was, because the
45
+ * remediation differs (an embedder outage versus an index outage) while the
46
+ * coverage answer — "this record needs a re-embed" — does not.
47
+ *
48
+ * Absent on a write observation means **no outcome is being reported**, which
49
+ * covers three cases:
50
+ *
51
+ * 1. no vector index / embedder is wired, so there is no index for the record to
52
+ * be absent from;
53
+ * 2. the `put` was a dedup no-op, which attempted nothing;
54
+ * 3. the `put` **failed** (`outcome: 'failure'`). An embed step may well have run
55
+ * before the failure — a record can even have been added to the index and then
56
+ * lost its durable write, leaving an orphan vector that a later `rebuild`
57
+ * reconciles. That is deliberately not reported here: the field answers
58
+ * "is this *stored* record in the index?", and on a failed write there is no
59
+ * stored record for it to be a statement about.
60
+ *
61
+ * So `embed` is a property of successful writes. Never present on `'read'` /
62
+ * `'delete'` / `'retrieve'`.
63
+ *
64
+ * Record-granular only. The fragment path is independent and reports nothing
65
+ * here — a record may be fragment-embedded while its record-level outcome is
66
+ * `'excluded'`.
67
+ * @public
68
+ */
69
+ export type MemoryEmbedOutcome = 'embedded' | 'declined' | 'excluded' | 'failed';
21
70
  /**
22
71
  * A single audit record produced by an observed store (or retriever) operation.
23
72
  *
@@ -51,6 +100,12 @@ export interface IMemoryObservationRecord {
51
100
  readonly error?: string;
52
101
  /** Structured provenance of the write, when the operation carried one. */
53
102
  readonly provenance?: IProvenance;
103
+ /**
104
+ * For `'write'` observations: what the record-granular vector index did about
105
+ * this record. Absent when the question does not apply — see
106
+ * {@link MemoryEmbedOutcome}.
107
+ */
108
+ readonly embed?: MemoryEmbedOutcome;
54
109
  /**
55
110
  * For `'retrieve'` observations: an opaque snapshot of the query that drove
56
111
  * the retrieval. Carried verbatim; never interpreted by the store.
@@ -106,5 +161,11 @@ export interface IMemoryObservationQuery {
106
161
  readonly phase?: MemoryObservationPhase;
107
162
  /** Only records with this outcome. */
108
163
  readonly outcome?: MemoryObservationOutcome;
164
+ /**
165
+ * Only `'write'` records with this embed outcome. Records carrying no embed
166
+ * outcome never match, so `embed: 'failed'` answers "which writes left the
167
+ * index short?" without a full scan of every record's `embeddingRef`.
168
+ */
169
+ readonly embed?: MemoryEmbedOutcome;
109
170
  }
110
171
  //# sourceMappingURL=observer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/packlets/observe/observer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;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EAAE,cAAc,CAAC;IAChC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC;IACxC,sCAAsC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;CACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../../src/packlets/observe/observer.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n * SPDX-License-Identifier: MIT\n */\n\nimport { Result } from '@fgv/ts-utils';\nimport { IProvenance, Kind, MemoryId, MemoryScopeKey } from '../types';\n\n/**\n * The store/retriever operation an observation record describes.\n *\n * @remarks\n * `'read'` / `'write'` / `'delete'` are fired post-op by\n * {@link FileTreeMemoryStore} (on `get` / `put` / `delete` respectively) when\n * observers are wired. `'retrieve'` is reserved for retriever-fired\n * observations; no B2 retriever fires one (a single seq authority per\n * observation store is the supported topology), so it never appears in B2 but\n * is part of the vocabulary so a future retriever-firing hook is additive.\n * @public\n */\nexport type MemoryObservationPhase = 'read' | 'write' | 'delete' | 'retrieve';\n\n/**\n * The outcome of the observed operation.\n * @public\n */\nexport type MemoryObservationOutcome = 'success' | 'failure';\n\n/**\n * A single audit record produced by an observed store (or retriever) operation.\n *\n * @remarks\n * `seq` and `timestamp` are assigned by the firing authority (the store) before\n * fan-out, so the same record carries the same `seq` across every observer it\n * lands in. `seq` is strictly increasing per authority, satisfying the\n * `RetainingRingBuffer` cursor contract that {@link MemoryObservationStore}\n * relies on.\n * @public\n */\nexport interface IMemoryObservationRecord {\n /**\n * Monotonic 1-based sequence number assigned by the firing authority, stable\n * across a store's ring eviction. The ordering / paging key.\n */\n readonly seq: number;\n /** Milliseconds since epoch when the firing authority produced the record. */\n readonly timestamp: number;\n /** Which operation this record describes. */\n readonly phase: MemoryObservationPhase;\n /** The scope the operation touched, when resolvable. */\n readonly scope?: MemoryScopeKey;\n /** The record id the operation touched, when resolvable. */\n readonly id?: MemoryId;\n /** The kind the operation targeted, when known. */\n readonly kind?: Kind;\n /** Whether the operation succeeded. */\n readonly outcome: MemoryObservationOutcome;\n /** Present on failure: the failure `Result`'s message. */\n readonly error?: string;\n /** Structured provenance of the write, when the operation carried one. */\n readonly provenance?: IProvenance;\n /**\n * For `'retrieve'` observations: an opaque snapshot of the query that drove\n * the retrieval. Carried verbatim; never interpreted by the store.\n */\n readonly querySnapshot?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Single-method async observer hook. The store fires `observe` once per public\n * `get` / `put` / `delete` call when observers are wired.\n *\n * @remarks\n * Observer errors never affect the store operation — the store swallows a\n * failed `Result` or a thrown / rejected `observe`, logging it to the injected\n * diagnostic logger at `warn`.\n * @public\n */\nexport interface IMemoryObserver {\n /**\n * When `true`, the store dispatches `observe` without awaiting it, so a slow\n * remote observer (SIEM, network sink) does not extend the store operation's\n * latency. Defaults to `false` (awaited), which is correct for the cheap\n * in-memory default {@link MemoryObservationStore}. Errors are swallowed\n * either way.\n */\n readonly fireAndForget?: boolean;\n /**\n * Receives a fully-formed observation record.\n * @param record - The observation record.\n * @returns A `Result` whose failure is swallowed (logged to the store's\n * diagnostic logger). A rejected promise is likewise swallowed.\n */\n observe(record: IMemoryObservationRecord): Promise<Result<unknown>>;\n}\n\n/**\n * Query criteria for {@link MemoryObservationStore.query}. All supplied criteria\n * are AND-combined.\n * @public\n */\nexport interface IMemoryObservationQuery {\n /** Only records with `seq > sinceSeq` (incremental paging cursor). */\n readonly sinceSeq?: number;\n /** Return at most this many records — the most-recent N, still oldest-first. */\n readonly limit?: number;\n /** Only records with `timestamp >= since`. */\n readonly since?: number;\n /** Only records with `timestamp <= until`. */\n readonly until?: number;\n /** Only records that touched this scope. */\n readonly scope?: MemoryScopeKey;\n /** Only records that targeted this kind. */\n readonly kind?: Kind;\n /** Only records of this phase. */\n readonly phase?: MemoryObservationPhase;\n /** Only records with this outcome. */\n readonly outcome?: MemoryObservationOutcome;\n}\n"]}
1
+ {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../../src/packlets/observe/observer.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n * SPDX-License-Identifier: MIT\n */\n\nimport { Result } from '@fgv/ts-utils';\nimport { IProvenance, Kind, MemoryId, MemoryScopeKey } from '../types';\n\n/**\n * The store/retriever operation an observation record describes.\n *\n * @remarks\n * `'read'` / `'write'` / `'delete'` are fired post-op by\n * {@link FileTreeMemoryStore} (on `get` / `put` / `delete` respectively) when\n * observers are wired. `'retrieve'` is reserved for retriever-fired\n * observations; no B2 retriever fires one (a single seq authority per\n * observation store is the supported topology), so it never appears in B2 but\n * is part of the vocabulary so a future retriever-firing hook is additive.\n * @public\n */\nexport type MemoryObservationPhase = 'read' | 'write' | 'delete' | 'retrieve';\n\n/**\n * The outcome of the observed operation.\n * @public\n */\nexport type MemoryObservationOutcome = 'success' | 'failure';\n\n/**\n * What the record-granular vector index did about a written record.\n *\n * @remarks\n * This exists because **`embeddingRef` absence is three-ways ambiguous**: a\n * record with no reference may have been declined, excluded, or genuinely\n * failed to embed, and the `put`'s own `outcome` cannot tell you which — it is\n * `'success'` in all three, because embed-on-write is best-effort by design and\n * never fails a durable write. Deriving index coverage from the absent field\n * alone therefore cannot distinguish a policy decision from an outage.\n *\n * - `'embedded'` — embedded and added; the record carries an `embeddingRef`.\n * - `'declined'` — the {@link MemoryEmbedder} resolved `undefined`: deliberately\n * not embedded. Not a fault.\n * - `'excluded'` — the record's kind is outside the store's `embedKinds`\n * declaration, so the embedder was never called. Also not a fault, and the\n * cheaper of the two.\n * - `'failed'` — the embedder returned a `Failure` (or threw), **or** the index\n * `add` did. Both are faults, and what they leave behind depends on whether\n * the record had been embedded before: a **first** write ends up with no\n * `embeddingRef` and nothing in the index, while an **update** keeps the\n * reference and vector it already had — so the index goes on answering on the\n * record's **previous** content until a `rebuild` reconciles it. Stale, not\n * absent. The store's diagnostic logger names which fault it was, because the\n * remediation differs (an embedder outage versus an index outage) while the\n * coverage answer — \"this record needs a re-embed\" — does not.\n *\n * Absent on a write observation means **no outcome is being reported**, which\n * covers three cases:\n *\n * 1. no vector index / embedder is wired, so there is no index for the record to\n * be absent from;\n * 2. the `put` was a dedup no-op, which attempted nothing;\n * 3. the `put` **failed** (`outcome: 'failure'`). An embed step may well have run\n * before the failure — a record can even have been added to the index and then\n * lost its durable write, leaving an orphan vector that a later `rebuild`\n * reconciles. That is deliberately not reported here: the field answers\n * \"is this *stored* record in the index?\", and on a failed write there is no\n * stored record for it to be a statement about.\n *\n * So `embed` is a property of successful writes. Never present on `'read'` /\n * `'delete'` / `'retrieve'`.\n *\n * Record-granular only. The fragment path is independent and reports nothing\n * here — a record may be fragment-embedded while its record-level outcome is\n * `'excluded'`.\n * @public\n */\nexport type MemoryEmbedOutcome = 'embedded' | 'declined' | 'excluded' | 'failed';\n\n/**\n * A single audit record produced by an observed store (or retriever) operation.\n *\n * @remarks\n * `seq` and `timestamp` are assigned by the firing authority (the store) before\n * fan-out, so the same record carries the same `seq` across every observer it\n * lands in. `seq` is strictly increasing per authority, satisfying the\n * `RetainingRingBuffer` cursor contract that {@link MemoryObservationStore}\n * relies on.\n * @public\n */\nexport interface IMemoryObservationRecord {\n /**\n * Monotonic 1-based sequence number assigned by the firing authority, stable\n * across a store's ring eviction. The ordering / paging key.\n */\n readonly seq: number;\n /** Milliseconds since epoch when the firing authority produced the record. */\n readonly timestamp: number;\n /** Which operation this record describes. */\n readonly phase: MemoryObservationPhase;\n /** The scope the operation touched, when resolvable. */\n readonly scope?: MemoryScopeKey;\n /** The record id the operation touched, when resolvable. */\n readonly id?: MemoryId;\n /** The kind the operation targeted, when known. */\n readonly kind?: Kind;\n /** Whether the operation succeeded. */\n readonly outcome: MemoryObservationOutcome;\n /** Present on failure: the failure `Result`'s message. */\n readonly error?: string;\n /** Structured provenance of the write, when the operation carried one. */\n readonly provenance?: IProvenance;\n /**\n * For `'write'` observations: what the record-granular vector index did about\n * this record. Absent when the question does not apply — see\n * {@link MemoryEmbedOutcome}.\n */\n readonly embed?: MemoryEmbedOutcome;\n /**\n * For `'retrieve'` observations: an opaque snapshot of the query that drove\n * the retrieval. Carried verbatim; never interpreted by the store.\n */\n readonly querySnapshot?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Single-method async observer hook. The store fires `observe` once per public\n * `get` / `put` / `delete` call when observers are wired.\n *\n * @remarks\n * Observer errors never affect the store operation — the store swallows a\n * failed `Result` or a thrown / rejected `observe`, logging it to the injected\n * diagnostic logger at `warn`.\n * @public\n */\nexport interface IMemoryObserver {\n /**\n * When `true`, the store dispatches `observe` without awaiting it, so a slow\n * remote observer (SIEM, network sink) does not extend the store operation's\n * latency. Defaults to `false` (awaited), which is correct for the cheap\n * in-memory default {@link MemoryObservationStore}. Errors are swallowed\n * either way.\n */\n readonly fireAndForget?: boolean;\n /**\n * Receives a fully-formed observation record.\n * @param record - The observation record.\n * @returns A `Result` whose failure is swallowed (logged to the store's\n * diagnostic logger). A rejected promise is likewise swallowed.\n */\n observe(record: IMemoryObservationRecord): Promise<Result<unknown>>;\n}\n\n/**\n * Query criteria for {@link MemoryObservationStore.query}. All supplied criteria\n * are AND-combined.\n * @public\n */\nexport interface IMemoryObservationQuery {\n /** Only records with `seq > sinceSeq` (incremental paging cursor). */\n readonly sinceSeq?: number;\n /** Return at most this many records — the most-recent N, still oldest-first. */\n readonly limit?: number;\n /** Only records with `timestamp >= since`. */\n readonly since?: number;\n /** Only records with `timestamp <= until`. */\n readonly until?: number;\n /** Only records that touched this scope. */\n readonly scope?: MemoryScopeKey;\n /** Only records that targeted this kind. */\n readonly kind?: Kind;\n /** Only records of this phase. */\n readonly phase?: MemoryObservationPhase;\n /** Only records with this outcome. */\n readonly outcome?: MemoryObservationOutcome;\n /**\n * Only `'write'` records with this embed outcome. Records carrying no embed\n * outcome never match, so `embed: 'failed'` answers \"which writes left the\n * index short?\" without a full scan of every record's `embeddingRef`.\n */\n readonly embed?: MemoryEmbedOutcome;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Logging, Result } from '@fgv/ts-utils';
2
2
  import { FileTree } from '@fgv/ts-json-base';
3
- import { EntityId, IIdentityCodec, IMemoryRecord, IWritePolicy, Kind, MemoryId, MemoryScopeKey, RankProjector, Tag } from '../types';
3
+ import { DedupScope, EntityId, IIdentityCodec, IMemoryRecord, IWritePolicy, Kind, MemoryId, MemoryScopeKey, RankProjector, Tag } from '../types';
4
4
  import { IBodyConverterRegistry as IRegistry } from '../converters';
5
5
  import { IMemoryIndex } from '../index';
6
6
  import { IMemoryObserver } from '../observe';
@@ -87,12 +87,67 @@ export interface IMemoryStore {
87
87
  /**
88
88
  * Adapt this store to the {@link IMemoryRecordSource} seam so it can drive
89
89
  * {@link IVectorIndex} rebuilds (e.g. `InMemoryCosineIndex.rebuild`). The
90
- * returned source's `list()` delegates to {@link IMemoryStore.listScoped}. The
91
- * store cannot implement {@link IMemoryRecordSource} directly because its
90
+ * returned source's `list()` delegates to {@link IMemoryStore.listScoped},
91
+ * **filtered to the kinds {@link IMemoryStore.embedsKind | embedsKind} reports**
92
+ * this source exists to feed the record vector index, so a kind excluded from
93
+ * that index is excluded here too, and a reopen does not re-embed records the
94
+ * index will never return. With no
95
+ * {@link IFileTreeMemoryStoreCreateParams.embedKinds | embedKinds} declaration
96
+ * every kind participates and the filter is the identity. `listScoped` itself is
97
+ * **not** filtered and remains the whole-vault surface.
98
+ *
99
+ * The store cannot implement {@link IMemoryRecordSource} directly because its
92
100
  * `list(filter?)` returns bare records (the ergonomic query surface) while the
93
101
  * seam's `list()` returns scope-qualified records.
94
102
  */
95
103
  asRecordSource(): IMemoryRecordSource;
104
+ /**
105
+ * The EFFECTIVE {@link DedupScope} for `kind` — the granularity at which a
106
+ * write for this kind deduplicates against the existing vault.
107
+ *
108
+ * @remarks
109
+ * This is a **read accessor over the store's already-injected write policies**,
110
+ * and it is the single place any caller — the store's own write path included —
111
+ * asks what a kind's dedup granularity is. It resolves the full chain the store
112
+ * applies on write: the kind's registered {@link IWritePolicy}, falling back to
113
+ * the store's default policy, then that policy's
114
+ * {@link IWritePolicy.dedupScope | dedupScope}, falling back to
115
+ * {@link DEFAULT_DEDUP_SCOPE}. Note the store's default policy is a
116
+ * {@link KnowledgeLwwPolicy}, which declares `'content'` — so a kind with NO
117
+ * registered policy resolves to `'content'`, not to `DEFAULT_DEDUP_SCOPE`.
118
+ *
119
+ * It exists so a caller that must agree with the store about dedup granularity
120
+ * — notably the ingest orchestrator's stage-4 layer-1 exact match — can read the
121
+ * declaration through this seam instead of being handed a second copy of the
122
+ * policy map. A second declaration site is precisely the defect this accessor
123
+ * was added to remove.
124
+ *
125
+ * Deliberately synchronous, total, and NOT `Result`-returning: it reads
126
+ * constructor-injected configuration, touches no I/O, and cannot fail (every
127
+ * link in the fallback chain has a total default). It exposes only the scope,
128
+ * never the {@link IWritePolicy} itself, so it can never become a back door for
129
+ * invoking admission or merge logic out of band.
130
+ */
131
+ dedupScopeFor(kind: Kind): DedupScope;
132
+ /**
133
+ * Whether records of `kind` participate in the **record-granular** vector index.
134
+ *
135
+ * @remarks
136
+ * A read accessor over the store's injected {@link IFileTreeMemoryStoreCreateParams.embedKinds | embedKinds}
137
+ * declaration, in the same spirit as {@link IMemoryStore.dedupScopeFor} — one
138
+ * place to ask, so the store's write path and any caller reasoning about index
139
+ * coverage cannot disagree. `true` for every kind when no declaration was made.
140
+ *
141
+ * **This is distinct from a {@link MemoryEmbedder} decline, and the difference is
142
+ * cost.** An embedder that returns `undefined` has already been called: the
143
+ * round trip is paid, and on a locally-hosted model that round trip is the
144
+ * expense. A kind excluded here is never handed to the embedder at all. The
145
+ * decline makes the intent *expressible*; this makes it *free*.
146
+ *
147
+ * Deliberately synchronous, total, and NOT `Result`-returning: it reads
148
+ * constructor-injected configuration, touches no I/O, and cannot fail.
149
+ */
150
+ embedsKind(kind: Kind): boolean;
96
151
  /**
97
152
  * Write a record. Validates the body, computes a content hash, deduplicates
98
153
  * (scope-wide, before policy), applies the kind's {@link IWritePolicy}, stamps
@@ -136,6 +191,37 @@ export interface IFileTreeMemoryStoreCreateParams {
136
191
  * guard-host-callbacks conventions).
137
192
  */
138
193
  readonly rankProjectors?: ReadonlyMap<Kind, RankProjector>;
194
+ /**
195
+ * The kinds whose records participate in the **record-granular** vector index.
196
+ *
197
+ * @remarks
198
+ * **Absent means every kind participates**, which is the pre-existing behavior —
199
+ * so omitting this is byte-identical to before it existed. Supplying it makes the
200
+ * set an allowlist: a kind outside it is never handed to the {@link MemoryEmbedder}
201
+ * on write, and is omitted from {@link IMemoryStore.asRecordSource | asRecordSource},
202
+ * so a rebuild driven from this store does not pay for it either.
203
+ *
204
+ * Two costs motivate it, and the second is the one that is easy to miss:
205
+ *
206
+ * - **Embedder work on the critical path.** Embed-on-write is synchronous with
207
+ * the write. A bookkeeping row — a status, a counter, a lease — that no query
208
+ * will ever return still pays a full embedding round trip, and on a
209
+ * locally-hosted model the first call after a restart pays a cold model load
210
+ * on top.
211
+ * - **Un-queried kinds crowd the `topK` window.** `IVectorIndex.query` applies
212
+ * `topK` *before* any kind filter the retriever adds, so vectors that can never
213
+ * be returned still occupy candidate slots. Over-fetching to compensate hides
214
+ * this until the un-queried kinds start scoring well — at which point recall is
215
+ * silently lost. Restricting what is indexed fixes the recall problem, not just
216
+ * the cost.
217
+ *
218
+ * Applies to the record-granular path only. The fragment path
219
+ * ({@link IFileTreeMemoryStoreCreateParams.fragmentIndex | fragmentIndex} /
220
+ * `fragmentEmbedder`) is independent and unaffected — a kind may legitimately be
221
+ * fragment-embedded and not record-embedded, which is the right shape for a long
222
+ * document whose whole body exceeds the model's context.
223
+ */
224
+ readonly embedKinds?: ReadonlySet<Kind>;
139
225
  /** Default codec for kinds without an explicit entry. */
140
226
  readonly defaultCodec?: IIdentityCodec;
141
227
  /**
@@ -290,6 +376,8 @@ export declare class FileTreeMemoryStore implements IMemoryStore {
290
376
  private readonly _writePolicies;
291
377
  private readonly _codecs;
292
378
  private readonly _rankProjectors;
379
+ /** `undefined` = no declaration = every kind participates. */
380
+ private readonly _embedKinds;
293
381
  private readonly _defaultCodec;
294
382
  private readonly _defaultPolicy;
295
383
  private readonly _scopeEncoding;
@@ -297,11 +385,9 @@ export declare class FileTreeMemoryStore implements IMemoryStore {
297
385
  private readonly _index;
298
386
  private readonly _hasher;
299
387
  private readonly _observers;
388
+ /** Record- and fragment-vector maintenance; every operation is best-effort. */
389
+ private readonly _vectors;
300
390
  private readonly _logger;
301
- private readonly _vectorIndex;
302
- private readonly _embed;
303
- private readonly _fragmentIndex;
304
- private readonly _fragmentEmbedder;
305
391
  /**
306
392
  * Records the initial walk could not load. Populated during `create()` in
307
393
  * {@link MemoryRecordErrorMode | `'skip'` mode}; empty otherwise.
@@ -418,39 +504,6 @@ export declare class FileTreeMemoryStore implements IMemoryStore {
418
504
  * later eviction failure never loses data with nothing written in its place.
419
505
  */
420
506
  private _admitWrite;
421
- /**
422
- * Best-effort embed-on-write. When a vector index AND an embedder are wired,
423
- * embeds the built record, `add`s the vector (replace semantics handle a same-id
424
- * re-embed — no explicit remove), and stamps the returned `embeddingRef`. A
425
- * failure (returned `fail` OR a thrown/rejected hook) is logged and the
426
- * unembedded record is returned unchanged — the put still persists, and the
427
- * derived index is reconciled by a later `rebuild`. A pass-through no-op when
428
- * unwired (byte-identical record).
429
- *
430
- * Always succeeds (`Result` is the chain's shape, never a vector-induced
431
- * failure).
432
- */
433
- private _embedOnWrite;
434
- /**
435
- * Best-effort fragment-embed-on-write. When a fragment index AND a fragment
436
- * embedder are wired, chunks + embeds the built record and replaces its
437
- * fragments in the index (`addFragments` is whole-record-replace, so a re-authored
438
- * document never leaves stale fragments behind — no explicit remove needed). A
439
- * failure (returned `fail` OR a thrown/rejected hook) is logged and the record is
440
- * returned unchanged — the put still persists, and the fragment index is a derived
441
- * view a later `rebuild` reconciles. Unlike {@link FileTreeMemoryStore._embedOnWrite}
442
- * it stamps nothing on the record (fragments have no per-record `embeddingRef`
443
- * analog). A pass-through no-op when unwired (byte-identical record).
444
- */
445
- private _embedFragmentsOnWrite;
446
- /**
447
- * Best-effort fragment removal. A no-op unless the full fragment lifecycle is
448
- * wired (both an index AND an embedder), so an unwired store does no fragment
449
- * work and behaves byte-identically. Failures are logged, never surfaced — a
450
- * committed delete/eviction must not fail because a derived fragment index could
451
- * not be pruned.
452
- */
453
- private _removeFragmentsBestEffort;
454
507
  /**
455
508
  * Evict the records named by a `cull-oldest` decision, best-effort. Runs only
456
509
  * after the authoritative `_persist`, so a failed eviction is logged (never
@@ -459,26 +512,6 @@ export declare class FileTreeMemoryStore implements IMemoryStore {
459
512
  * `accept` / `reject` decisions evict nothing.
460
513
  */
461
514
  private _applyEvictions;
462
- /**
463
- * Best-effort vector removal for each evicted record (never fails the put).
464
- * Every evicted record is in the same `scope` as the incoming write (the
465
- * cull-oldest cohort is the incoming record's `(scope, kind)` cohort), so that
466
- * scope qualifies each removal target.
467
- */
468
- private _removeEvictedVectors;
469
- /**
470
- * Run a consumer-supplied vector hook, normalizing a thrown/rejected hook into a
471
- * `Failure` and logging any failure at `warn`. Best-effort: the caller proceeds
472
- * regardless, since the index is rebuildable.
473
- */
474
- private _tryVectorOp;
475
- /**
476
- * Best-effort vector removal. A no-op unless the full vector lifecycle is wired
477
- * (both an index AND an embedder), so an unwired store does no vector work and
478
- * behaves byte-identically. Failures are logged, never surfaced — a committed
479
- * delete/eviction must not fail because a derived index could not be pruned.
480
- */
481
- private _removeVectorBestEffort;
482
515
  /**
483
516
  * Build the record to persist. On a first write the incoming envelope is the
484
517
  * base (final content equals the incoming content, so the dedup `hash` is
@@ -610,6 +643,10 @@ export declare class FileTreeMemoryStore implements IMemoryStore {
610
643
  private _stampRank;
611
644
  private _codecFor;
612
645
  private _policyFor;
646
+ /** {@inheritDoc IMemoryStore.dedupScopeFor} */
647
+ dedupScopeFor(kind: Kind): DedupScope;
648
+ /** {@inheritDoc IMemoryStore.embedsKind} */
649
+ embedsKind(kind: Kind): boolean;
613
650
  /**
614
651
  * Read and validate the record at `<scope>/<idStem>.md`, returning `undefined`
615
652
  * when the scope directory or file is absent. Verifies the on-disk id ↔
@@ -1 +1 @@
1
- {"version":3,"file":"fileTreeMemoryStore.d.ts","sourceRoot":"","sources":["../../../src/packlets/store/fileTreeMemoryStore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,OAAO,EAAE,MAAM,EAAyC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAIL,QAAQ,EAER,cAAc,EAEd,aAAa,EAGb,YAAY,EACZ,IAAI,EAEJ,QAAQ,EACR,cAAc,EACd,aAAa,EACb,GAAG,EAMJ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,sBAAsB,IAAI,SAAS,EAAwC,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAwB,YAAY,EAAe,MAAM,UAAU,CAAC;AAC3E,OAAO,EAEL,eAAe,EAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACf,MAAM,WAAW,CAAC;AAMnB;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,wCAAwC;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,qBAAqB,GAAG,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