@graphrefly/graphrefly 0.47.2 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/base/composition/index.cjs +4 -3
  2. package/dist/base/composition/index.cjs.map +1 -1
  3. package/dist/base/composition/index.d.cts +14 -5
  4. package/dist/base/composition/index.d.ts +14 -5
  5. package/dist/base/composition/index.js +8 -8
  6. package/dist/base/index.cjs +152 -78
  7. package/dist/base/index.cjs.map +1 -1
  8. package/dist/base/index.d.cts +2 -2
  9. package/dist/base/index.d.ts +2 -2
  10. package/dist/base/index.js +75 -70
  11. package/dist/base/io/index.cjs +31 -17
  12. package/dist/base/io/index.cjs.map +1 -1
  13. package/dist/base/io/index.d.cts +32 -5
  14. package/dist/base/io/index.d.ts +32 -5
  15. package/dist/base/io/index.js +1 -1
  16. package/dist/base/mutation/index.cjs +21 -0
  17. package/dist/base/mutation/index.cjs.map +1 -1
  18. package/dist/base/mutation/index.d.cts +23 -1
  19. package/dist/base/mutation/index.d.ts +23 -1
  20. package/dist/base/mutation/index.js +3 -1
  21. package/dist/base/sources/browser/index.cjs +5 -3
  22. package/dist/base/sources/browser/index.cjs.map +1 -1
  23. package/dist/base/sources/browser/index.d.cts +20 -2
  24. package/dist/base/sources/browser/index.d.ts +20 -2
  25. package/dist/base/sources/browser/index.js +5 -3
  26. package/dist/base/sources/browser/index.js.map +1 -1
  27. package/dist/base/sources/event/index.cjs +28 -0
  28. package/dist/base/sources/event/index.cjs.map +1 -1
  29. package/dist/base/sources/event/index.d.cts +67 -3
  30. package/dist/base/sources/event/index.d.ts +67 -3
  31. package/dist/base/sources/event/index.js +4 -1
  32. package/dist/base/sources/index.cjs +75 -37
  33. package/dist/base/sources/index.cjs.map +1 -1
  34. package/dist/base/sources/index.d.cts +1 -1
  35. package/dist/base/sources/index.d.ts +1 -1
  36. package/dist/base/sources/index.js +5 -2
  37. package/dist/{chunk-R6ZCSXKX.js → chunk-23MAWVOJ.js} +3 -3
  38. package/dist/{chunk-MS3WPRJR.js → chunk-3REMCHSS.js} +6 -6
  39. package/dist/chunk-3REMCHSS.js.map +1 -0
  40. package/dist/{chunk-CEVNQ74M.js → chunk-3YGXPUHW.js} +2 -2
  41. package/dist/{chunk-CEVNQ74M.js.map → chunk-3YGXPUHW.js.map} +1 -1
  42. package/dist/{chunk-6ZLCPUXS.js → chunk-46X2EFQH.js} +15 -4
  43. package/dist/chunk-46X2EFQH.js.map +1 -0
  44. package/dist/{chunk-NY2PYHNC.js → chunk-5UY3PNFY.js} +12 -5
  45. package/dist/chunk-5UY3PNFY.js.map +1 -0
  46. package/dist/{chunk-FQSQONOU.js → chunk-65OM4XLQ.js} +49 -3
  47. package/dist/chunk-65OM4XLQ.js.map +1 -0
  48. package/dist/{chunk-3PSLNJDU.js → chunk-6DQYBIHW.js} +314 -49
  49. package/dist/chunk-6DQYBIHW.js.map +1 -0
  50. package/dist/{chunk-LDCSZ72P.js → chunk-6YBER5UP.js} +3 -3
  51. package/dist/{chunk-LDCSZ72P.js.map → chunk-6YBER5UP.js.map} +1 -1
  52. package/dist/{chunk-3O3NKZJW.js → chunk-7T7WLEPM.js} +24 -3
  53. package/dist/chunk-7T7WLEPM.js.map +1 -0
  54. package/dist/{chunk-PKPO3JTZ.js → chunk-AQAKDE7F.js} +29 -11
  55. package/dist/chunk-AQAKDE7F.js.map +1 -0
  56. package/dist/{chunk-6MRSX3YK.js → chunk-B5Y5GPD5.js} +2 -2
  57. package/dist/{chunk-BXGZFGZ4.js → chunk-C5QD5DQX.js} +22 -1
  58. package/dist/chunk-C5QD5DQX.js.map +1 -0
  59. package/dist/{chunk-4XCHZRUJ.js → chunk-D5YGR4TP.js} +58 -7
  60. package/dist/chunk-D5YGR4TP.js.map +1 -0
  61. package/dist/{chunk-NPRP3MCV.js → chunk-DHDCOOJU.js} +2 -2
  62. package/dist/chunk-DHDCOOJU.js.map +1 -0
  63. package/dist/{chunk-VP3TIUDF.js → chunk-DVTDF5OI.js} +2 -2
  64. package/dist/{chunk-OXD5LFQP.js → chunk-G7H6PN7P.js} +2 -2
  65. package/dist/{chunk-EL5VHUGK.js → chunk-GGKHHG5Y.js} +32 -18
  66. package/dist/chunk-GGKHHG5Y.js.map +1 -0
  67. package/dist/{chunk-446I4EGD.js → chunk-J5TBZFBD.js} +2 -2
  68. package/dist/{chunk-7AVQIGF6.js → chunk-K4ZYJ4EM.js} +554 -460
  69. package/dist/chunk-K4ZYJ4EM.js.map +1 -0
  70. package/dist/{chunk-QFE5BQH7.js → chunk-LTSI7ULC.js} +2 -2
  71. package/dist/{chunk-5GVURVIG.js → chunk-MMHGYX44.js} +12 -2
  72. package/dist/{chunk-5GVURVIG.js.map → chunk-MMHGYX44.js.map} +1 -1
  73. package/dist/{chunk-KRFGO5QH.js → chunk-MQMTRKY3.js} +118 -43
  74. package/dist/chunk-MQMTRKY3.js.map +1 -0
  75. package/dist/{chunk-42FQ27MQ.js → chunk-MTODGQBR.js} +44 -179
  76. package/dist/chunk-MTODGQBR.js.map +1 -0
  77. package/dist/{chunk-FVINAAKA.js → chunk-NBK6QQMG.js} +14 -13
  78. package/dist/{chunk-FVINAAKA.js.map → chunk-NBK6QQMG.js.map} +1 -1
  79. package/dist/{chunk-KNU73RZW.js → chunk-NSA5K5G2.js} +2 -2
  80. package/dist/{chunk-MLTPJMH6.js → chunk-QQYULEZL.js} +2 -2
  81. package/dist/chunk-QSW4DFKE.js +31 -0
  82. package/dist/chunk-QSW4DFKE.js.map +1 -0
  83. package/dist/{chunk-VAZXUK6G.js → chunk-SUNCHMML.js} +2 -2
  84. package/dist/{chunk-EP4WVQLX.js → chunk-T2U6N3FV.js} +6 -6
  85. package/dist/{chunk-T7SP3EYR.js → chunk-T5URUIIY.js} +33 -24
  86. package/dist/chunk-T5URUIIY.js.map +1 -0
  87. package/dist/{chunk-VNXAF2KE.js → chunk-TPTZZV25.js} +6 -6
  88. package/dist/chunk-TPTZZV25.js.map +1 -0
  89. package/dist/{chunk-IOJDYUA7.js → chunk-V46JWFGV.js} +6 -5
  90. package/dist/chunk-V46JWFGV.js.map +1 -0
  91. package/dist/{chunk-WGDEBIP4.js → chunk-X6ESZDR6.js} +5 -6
  92. package/dist/chunk-X6ESZDR6.js.map +1 -0
  93. package/dist/{chunk-N65E26UL.js → chunk-XEWV254I.js} +2 -2
  94. package/dist/{chunk-N65E26UL.js.map → chunk-XEWV254I.js.map} +1 -1
  95. package/dist/{chunk-PTWADEH3.js → chunk-YBJVKMTM.js} +34 -14
  96. package/dist/chunk-YBJVKMTM.js.map +1 -0
  97. package/dist/{chunk-DDTS7F5O.js → chunk-ZW32BPXV.js} +12 -3
  98. package/dist/chunk-ZW32BPXV.js.map +1 -0
  99. package/dist/compat/index.cjs +51 -4
  100. package/dist/compat/index.cjs.map +1 -1
  101. package/dist/compat/index.d.cts +1 -1
  102. package/dist/compat/index.d.ts +1 -1
  103. package/dist/compat/index.js +6 -6
  104. package/dist/compat/nestjs/index.cjs +51 -4
  105. package/dist/compat/nestjs/index.cjs.map +1 -1
  106. package/dist/compat/nestjs/index.d.cts +1 -1
  107. package/dist/compat/nestjs/index.d.ts +1 -1
  108. package/dist/compat/nestjs/index.js +3 -3
  109. package/dist/{fallback-Bx46zqky.d.cts → fallback-BROR6ZhO.d.cts} +1 -1
  110. package/dist/{fallback-pIWW8A2d.d.ts → fallback-DO80aM_3.d.ts} +1 -1
  111. package/dist/{index-B_p8tnvf.d.cts → index-D1z3XcF9.d.cts} +1 -0
  112. package/dist/{index-_HDSmPyp.d.ts → index-DZ6yua0Q.d.ts} +1 -0
  113. package/dist/index.cjs +2215 -1676
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.d.cts +10 -10
  116. package/dist/index.d.ts +10 -10
  117. package/dist/index.js +169 -146
  118. package/dist/index.js.map +1 -1
  119. package/dist/presets/ai/index.cjs +46 -0
  120. package/dist/presets/ai/index.cjs.map +1 -1
  121. package/dist/presets/ai/index.js +12 -12
  122. package/dist/presets/harness/index.cjs +130 -18
  123. package/dist/presets/harness/index.cjs.map +1 -1
  124. package/dist/presets/harness/index.d.cts +15 -5
  125. package/dist/presets/harness/index.d.ts +15 -5
  126. package/dist/presets/harness/index.js +22 -22
  127. package/dist/presets/index.cjs +222 -53
  128. package/dist/presets/index.cjs.map +1 -1
  129. package/dist/presets/index.d.cts +2 -2
  130. package/dist/presets/index.d.ts +2 -2
  131. package/dist/presets/index.js +45 -45
  132. package/dist/presets/inspect/index.cjs +63 -14
  133. package/dist/presets/inspect/index.cjs.map +1 -1
  134. package/dist/presets/inspect/index.d.cts +1 -1
  135. package/dist/presets/inspect/index.d.ts +1 -1
  136. package/dist/presets/inspect/index.js +6 -6
  137. package/dist/presets/resilience/index.cjs +29 -21
  138. package/dist/presets/resilience/index.cjs.map +1 -1
  139. package/dist/presets/resilience/index.d.cts +12 -8
  140. package/dist/presets/resilience/index.d.ts +12 -8
  141. package/dist/presets/resilience/index.js +3 -3
  142. package/dist/{rate-limiter-DpVbSYdH.d.cts → rate-limiter-DC26FM8J.d.cts} +10 -1
  143. package/dist/{rate-limiter-CEALq4N1.d.ts → rate-limiter-DyWpwpQP.d.ts} +10 -1
  144. package/dist/{reactive-layout-fswlBUvX.d.ts → reactive-layout-BBBWH0V_.d.cts} +85 -4
  145. package/dist/{reactive-layout-fswlBUvX.d.cts → reactive-layout-BBBWH0V_.d.ts} +85 -4
  146. package/dist/solutions/index.cjs +168 -47
  147. package/dist/solutions/index.cjs.map +1 -1
  148. package/dist/solutions/index.d.cts +2 -2
  149. package/dist/solutions/index.d.ts +2 -2
  150. package/dist/solutions/index.js +28 -28
  151. package/dist/{spawnable-5mDY501F.d.cts → spawnable-B2IlW60f.d.cts} +23 -2
  152. package/dist/{spawnable-D3lR0oQu.d.ts → spawnable-tttFz2Nh.d.ts} +23 -2
  153. package/dist/testing/index.cjs +94 -0
  154. package/dist/testing/index.cjs.map +1 -0
  155. package/dist/testing/index.d.cts +59 -0
  156. package/dist/testing/index.d.ts +59 -0
  157. package/dist/testing/index.js +73 -0
  158. package/dist/testing/index.js.map +1 -0
  159. package/dist/utils/ai/browser.cjs.map +1 -1
  160. package/dist/utils/ai/browser.d.cts +2 -2
  161. package/dist/utils/ai/browser.d.ts +2 -2
  162. package/dist/utils/ai/browser.js +6 -6
  163. package/dist/utils/ai/browser.js.map +1 -1
  164. package/dist/utils/ai/index.cjs +250 -166
  165. package/dist/utils/ai/index.cjs.map +1 -1
  166. package/dist/utils/ai/index.d.cts +108 -12
  167. package/dist/utils/ai/index.d.ts +108 -12
  168. package/dist/utils/ai/index.js +21 -19
  169. package/dist/utils/ai/node.cjs.map +1 -1
  170. package/dist/utils/ai/node.d.cts +5 -5
  171. package/dist/utils/ai/node.d.ts +5 -5
  172. package/dist/utils/ai/node.js +2 -2
  173. package/dist/utils/ai/node.js.map +1 -1
  174. package/dist/utils/cqrs/index.cjs +29 -3
  175. package/dist/utils/cqrs/index.cjs.map +1 -1
  176. package/dist/utils/cqrs/index.d.cts +12 -7
  177. package/dist/utils/cqrs/index.d.ts +12 -7
  178. package/dist/utils/cqrs/index.js +2 -2
  179. package/dist/utils/demo-shell/index.cjs +45 -19
  180. package/dist/utils/demo-shell/index.cjs.map +1 -1
  181. package/dist/utils/demo-shell/index.d.cts +1 -1
  182. package/dist/utils/demo-shell/index.d.ts +1 -1
  183. package/dist/utils/demo-shell/index.js +2 -2
  184. package/dist/utils/domain-templates/index.cjs.map +1 -1
  185. package/dist/utils/domain-templates/index.js +3 -3
  186. package/dist/utils/graphspec/index.cjs.map +1 -1
  187. package/dist/utils/graphspec/index.js +3 -3
  188. package/dist/utils/index.cjs +1642 -1225
  189. package/dist/utils/index.cjs.map +1 -1
  190. package/dist/utils/index.d.cts +7 -7
  191. package/dist/utils/index.d.ts +7 -7
  192. package/dist/utils/index.js +72 -54
  193. package/dist/utils/inspect/index.cjs +52 -4
  194. package/dist/utils/inspect/index.cjs.map +1 -1
  195. package/dist/utils/inspect/index.d.cts +32 -3
  196. package/dist/utils/inspect/index.d.ts +32 -3
  197. package/dist/utils/inspect/index.js +4 -4
  198. package/dist/utils/job-queue/index.cjs +46 -9
  199. package/dist/utils/job-queue/index.cjs.map +1 -1
  200. package/dist/utils/job-queue/index.d.cts +33 -3
  201. package/dist/utils/job-queue/index.d.ts +33 -3
  202. package/dist/utils/job-queue/index.js +2 -2
  203. package/dist/utils/memory/index.cjs +556 -462
  204. package/dist/utils/memory/index.cjs.map +1 -1
  205. package/dist/utils/memory/index.d.cts +203 -24
  206. package/dist/utils/memory/index.d.ts +203 -24
  207. package/dist/utils/memory/index.js +10 -2
  208. package/dist/utils/messaging/index.cjs.map +1 -1
  209. package/dist/utils/messaging/index.d.cts +4 -3
  210. package/dist/utils/messaging/index.d.ts +4 -3
  211. package/dist/utils/messaging/index.js +2 -2
  212. package/dist/utils/orchestration/index.cjs +9 -0
  213. package/dist/utils/orchestration/index.cjs.map +1 -1
  214. package/dist/utils/orchestration/index.js +3 -3
  215. package/dist/utils/process/index.cjs +32 -2
  216. package/dist/utils/process/index.cjs.map +1 -1
  217. package/dist/utils/process/index.d.cts +4 -3
  218. package/dist/utils/process/index.d.ts +4 -3
  219. package/dist/utils/process/index.js +2 -2
  220. package/dist/utils/reactive-layout/index.cjs +184 -55
  221. package/dist/utils/reactive-layout/index.cjs.map +1 -1
  222. package/dist/utils/reactive-layout/index.d.cts +128 -3
  223. package/dist/utils/reactive-layout/index.d.ts +128 -3
  224. package/dist/utils/reactive-layout/index.js +16 -8
  225. package/dist/utils/reduction/index.cjs.map +1 -1
  226. package/dist/utils/reduction/index.js +2 -2
  227. package/dist/utils/resilience/index.cjs +29 -20
  228. package/dist/utils/resilience/index.cjs.map +1 -1
  229. package/dist/utils/resilience/index.d.cts +1 -1
  230. package/dist/utils/resilience/index.d.ts +1 -1
  231. package/dist/utils/resilience/index.js +2 -2
  232. package/dist/utils/surface/index.cjs.map +1 -1
  233. package/dist/utils/surface/index.js +4 -4
  234. package/package.json +15 -3
  235. package/dist/chunk-3O3NKZJW.js.map +0 -1
  236. package/dist/chunk-3PSLNJDU.js.map +0 -1
  237. package/dist/chunk-42FQ27MQ.js.map +0 -1
  238. package/dist/chunk-4XCHZRUJ.js.map +0 -1
  239. package/dist/chunk-6ZLCPUXS.js.map +0 -1
  240. package/dist/chunk-7AVQIGF6.js.map +0 -1
  241. package/dist/chunk-BXGZFGZ4.js.map +0 -1
  242. package/dist/chunk-DDTS7F5O.js.map +0 -1
  243. package/dist/chunk-EL5VHUGK.js.map +0 -1
  244. package/dist/chunk-FQSQONOU.js.map +0 -1
  245. package/dist/chunk-IOJDYUA7.js.map +0 -1
  246. package/dist/chunk-KRFGO5QH.js.map +0 -1
  247. package/dist/chunk-MS3WPRJR.js.map +0 -1
  248. package/dist/chunk-NPRP3MCV.js.map +0 -1
  249. package/dist/chunk-NY2PYHNC.js.map +0 -1
  250. package/dist/chunk-PKPO3JTZ.js.map +0 -1
  251. package/dist/chunk-PTWADEH3.js.map +0 -1
  252. package/dist/chunk-T7SP3EYR.js.map +0 -1
  253. package/dist/chunk-VNXAF2KE.js.map +0 -1
  254. package/dist/chunk-W2BOPXTI.js +0 -1
  255. package/dist/chunk-W2BOPXTI.js.map +0 -1
  256. package/dist/chunk-WGDEBIP4.js.map +0 -1
  257. /package/dist/{chunk-R6ZCSXKX.js.map → chunk-23MAWVOJ.js.map} +0 -0
  258. /package/dist/{chunk-6MRSX3YK.js.map → chunk-B5Y5GPD5.js.map} +0 -0
  259. /package/dist/{chunk-VP3TIUDF.js.map → chunk-DVTDF5OI.js.map} +0 -0
  260. /package/dist/{chunk-OXD5LFQP.js.map → chunk-G7H6PN7P.js.map} +0 -0
  261. /package/dist/{chunk-446I4EGD.js.map → chunk-J5TBZFBD.js.map} +0 -0
  262. /package/dist/{chunk-QFE5BQH7.js.map → chunk-LTSI7ULC.js.map} +0 -0
  263. /package/dist/{chunk-KNU73RZW.js.map → chunk-NSA5K5G2.js.map} +0 -0
  264. /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
  265. /package/dist/{chunk-VAZXUK6G.js.map → chunk-SUNCHMML.js.map} +0 -0
  266. /package/dist/{chunk-EP4WVQLX.js.map → chunk-T2U6N3FV.js.map} +0 -0
@@ -173,6 +173,16 @@ interface FactStoreAuditRecord extends BaseAuditRecord {
173
173
  readonly action: "ingest" | "invalidate" | "outcome" | "consolidate" | "decay" | "overflow";
174
174
  readonly id?: FactId;
175
175
  readonly reason?: CascadeReason;
176
+ /**
177
+ * Number of facts whose state actually changed in a batch action
178
+ * (post-filter — excludes no-op / non-finite / resurrection-guard
179
+ * skips; equals the length of the emitted `decay_processor` value
180
+ * array). Populated for `"decay"` (a per-tick batch over many facts
181
+ * with no single `id` — the bare `{action,t_ns,seq}` record was opaque
182
+ * to audit-log forensics). Absent for single-fact actions (`id`
183
+ * carries those).
184
+ */
185
+ readonly count?: number;
176
186
  }
177
187
  interface ReactiveFactStoreConfig<T> {
178
188
  readonly extractDependencies: (f: MemoryFragment<T>) => readonly FactId[];
@@ -306,29 +316,6 @@ interface ReactiveFactStoreConfig<T> {
306
316
  */
307
317
  readonly recordIngest?: boolean;
308
318
  }
309
- interface ReactiveFactStoreGraph<T> extends Graph {
310
- /** Per-shard `state<FactStore<T>>` nodes (length = shard count). */
311
- readonly shards: readonly Node<FactStore<T>>[];
312
- /** Unified read view across all shards (derived). */
313
- readonly factStore: Node<FactStore<T>>;
314
- readonly dependentsIndex: Node<DependentsIndex>;
315
- readonly answer: Node<MemoryAnswer<T> | null>;
316
- readonly cascade: Node<readonly CascadeEvent[]>;
317
- readonly cascadeOverflow: Node<CascadeOverflow | null>;
318
- readonly review: Node<ReviewRequest | null>;
319
- readonly consolidated: Node<readonly MemoryFragment<T>[]>;
320
- readonly events: ReactiveLogBundle<FactStoreAuditRecord>;
321
- /**
322
- * Payload-carrying, replayable log of every committed fragment. Present iff
323
- * {@link ReactiveFactStoreConfig.recordIngest} is `true`. Unlike
324
- * {@link ReactiveFactStoreGraph.events} (action-only audit), each entry is
325
- * the full {@link MemoryFragment} — `attachStorage` it for a durable,
326
- * replayable projection source (see `recordIngest` docs for the recipe).
327
- */
328
- readonly ingestLog?: ReactiveLogBundle<MemoryFragment<T>>;
329
- /** Reactive read: a single fact by id (SENTINEL until the fact exists). */
330
- itemNode(id: FactId): Node<MemoryFragment<T> | undefined>;
331
- }
332
319
  /**
333
320
  * Build a static-topology reactive fact store (DS-14.7 architecture C).
334
321
  *
@@ -362,6 +349,38 @@ interface ReactiveFactStoreGraph<T> extends Graph {
362
349
  *
363
350
  * @category memory
364
351
  */
352
+ declare class ReactiveFactStoreGraph<T> extends Graph {
353
+ /** Per-shard `state<FactStore<T>>` nodes (length = shard count). */
354
+ readonly shards: readonly Node<FactStore<T>>[];
355
+ /** Unified read view across all shards (derived). */
356
+ readonly factStore: Node<FactStore<T>>;
357
+ readonly dependentsIndex: Node<DependentsIndex>;
358
+ readonly answer: Node<MemoryAnswer<T> | null>;
359
+ readonly cascade: Node<readonly CascadeEvent[]>;
360
+ readonly cascadeOverflow: Node<CascadeOverflow | null>;
361
+ readonly review: Node<ReviewRequest | null>;
362
+ readonly consolidated: Node<readonly MemoryFragment<T>[]>;
363
+ readonly events: ReactiveLogBundle<FactStoreAuditRecord>;
364
+ /**
365
+ * Payload-carrying, replayable log of every committed fragment. Present iff
366
+ * {@link ReactiveFactStoreConfig.recordIngest} is `true`. Unlike
367
+ * {@link ReactiveFactStoreGraph.events} (action-only audit), each entry is
368
+ * the full {@link MemoryFragment} — `attachStorage` it for a durable,
369
+ * replayable projection source (see `recordIngest` docs for the recipe).
370
+ */
371
+ readonly ingestLog?: ReactiveLogBundle<MemoryFragment<T>>;
372
+ constructor(config: ReactiveFactStoreConfig<T>);
373
+ /** Reactive read: a single fact by id (SENTINEL until the fact exists). */
374
+ itemNode(id: FactId): Node<MemoryFragment<T> | undefined>;
375
+ }
376
+ /**
377
+ * Build a static-topology reactive fact store (DS-14.7 architecture C).
378
+ *
379
+ * Thin factory over {@link ReactiveFactStoreGraph} — see that class for the
380
+ * full topology / locked-decision docs and the `instanceof`-narrowable type.
381
+ *
382
+ * @category memory
383
+ */
365
384
  declare function reactiveFactStore<T>(config: ReactiveFactStoreConfig<T>): ReactiveFactStoreGraph<T>;
366
385
 
367
386
  /**
@@ -954,6 +973,166 @@ interface ShardByTenantConfig<T> {
954
973
  */
955
974
  declare function shardByTenant<T>(tenantOf: (f: MemoryFragment<T>) => string, opts?: ShardByTenantOptions): ShardByTenantConfig<T>;
956
975
 
976
+ /**
977
+ * `simpleFactStore()` — the 80%-case ergonomic wrapper over
978
+ * {@link reactiveFactStore} / {@link persistentReactiveFactStore}
979
+ * (DS-14.7 follow-up #2; design LOCKED 2026-05-17 `/dev-dispatch` Q-walk,
980
+ * Q1–Q6 + sub-decisions resolved).
981
+ *
982
+ * Closes the gap where a consumer wanting durable agent memory had to
983
+ * hand-compose: an `ingest` source + `extractDependencies` + (optionally) a
984
+ * `StorageBackend` + decay/consolidation recipes + the
985
+ * `BigInt(monotonicNs())` fragment boilerplate. `simpleFactStore` owns all
986
+ * of that and exposes a single ergonomic `remember(id, payload, opts?)`.
987
+ *
988
+ * **Q-walk locks (canonical: `docs/optimizations.md` DS-14.7 follow-up #2):**
989
+ * - **Q1** — `extractDependencies` defaults to `() => []` (flat store;
990
+ * cascade inert by default — dependency-tracking is opt-in).
991
+ * - **Q2** — single factory, **optional `storage`**: present → wraps
992
+ * {@link persistentReactiveFactStore} (durable, event-sourced); absent →
993
+ * in-memory {@link reactiveFactStore}.
994
+ * - **Q3** — the wrapper **owns** the internal `ingest` source and exposes
995
+ * {@link SimpleFactStoreGraph.remember}. `remember` `.emit`s into the
996
+ * owned leaf source — this is the *sanctioned* external push that the
997
+ * `reactiveFactStore` ingest contract documents (same shape as the
998
+ * `decay`/replay recipes' `.emit`-into-source), **not** a spec-§5.9
999
+ * imperative trigger: it feeds DATA into a source node, it does not
1000
+ * bypass topology for control flow. Reactive reads (`answer` / `review` /
1001
+ * `events`) stay the canonical observation surface.
1002
+ * - **Q4** — auto-wire **default recipes** with internal `fromTimer`
1003
+ * cadences (batteries-included; user-blessed 2026-05-17). `decay` is
1004
+ * generically meaningful (confidence forgetting needs no domain
1005
+ * knowledge) → **ON by default** with conservative defaults
1006
+ * ({@link DEFAULT_DECAY_HALF_LIFE_NS} / {@link DEFAULT_DECAY_PERIOD_MS}),
1007
+ * tunable or `false` to disable. `consolidate` is **domain-bound** —
1008
+ * {@link consolidationRem} *requires* a `summarize` (there is no generic
1009
+ * default; an arbitrary `T` cannot be summarized blindly), so it is wired
1010
+ * **iff** the caller supplies `opts.consolidate`. This consolidation
1011
+ * asymmetry is dictated by the recipe's own required contract, not an
1012
+ * autonomous downgrade of the Q4 lock.
1013
+ * - **Q5** — minimal input: `remember(id, payload, { tags? })` auto-fills
1014
+ * `t_ns = BigInt(monotonicNs())` (per the {@link MemoryFragment.t_ns}
1015
+ * contract + the clock-return-type rule — `monotonicNs()` is `number`,
1016
+ * the `BigInt(...)` wrap is load-bearing) and `confidence = 1`.
1017
+ * - **Q6** — **wraps** the existing factories (not a parallel impl).
1018
+ *
1019
+ * Presentation-only (`@graphrefly/graphrefly`, `utils/memory` barrel),
1020
+ * universal tier (`fromTimer` only, no `node:*`/DOM — the optional
1021
+ * `StorageBackend` impl's tier is the *caller's* concern, forwarded
1022
+ * verbatim, exactly as {@link persistentReactiveFactStore} does).
1023
+ *
1024
+ * @module
1025
+ */
1026
+
1027
+ /**
1028
+ * Default exponential-decay half-life: **7 days** in nanoseconds. Confidence
1029
+ * halves once per week of fact age — gentle forgetting suitable for the
1030
+ * 80%-case agent memory. Override via `opts.decay.halfLifeNs`.
1031
+ */
1032
+ declare const DEFAULT_DECAY_HALF_LIFE_NS = 604800000000000n;
1033
+ /**
1034
+ * Default decay tick cadence: **1 hour** (ms). How often the forgetting pass
1035
+ * runs. Override via `opts.decay.periodMs`.
1036
+ */
1037
+ declare const DEFAULT_DECAY_PERIOD_MS = 3600000;
1038
+ /** Per-fact override fields accepted by {@link SimpleFactStoreGraph.remember}. */
1039
+ interface RememberOptions {
1040
+ /** Tags. Default `[]`. */
1041
+ readonly tags?: readonly string[];
1042
+ /** Dependency edges (fact IDs this fact derives from). Default `[]`. */
1043
+ readonly sources?: readonly FactId[];
1044
+ /** Confidence 0..1. Default `1`. */
1045
+ readonly confidence?: number;
1046
+ /** Valid-time end — set to obsolete a fact (MEME L3 lever). */
1047
+ readonly validTo?: bigint;
1048
+ /** Valid-time start — `undefined` = unbounded past. */
1049
+ readonly validFrom?: bigint;
1050
+ /** Free-form provenance string. */
1051
+ readonly provenance?: string;
1052
+ }
1053
+ interface SimpleFactStoreOptions<T> {
1054
+ /**
1055
+ * Durable backing. Present → delegates to
1056
+ * {@link persistentReactiveFactStore} (event-sourced, replay-on-start,
1057
+ * substrate-owned cursor). Absent → in-memory {@link reactiveFactStore}.
1058
+ * The backend's runtime tier (node / browser) is the caller's concern —
1059
+ * forwarded verbatim.
1060
+ */
1061
+ readonly storage?: StorageBackend;
1062
+ /**
1063
+ * Cascade dependency extractor. **Default `() => []`** — flat store, no
1064
+ * cascade. Supply to opt into MEME L2 cascade invalidation.
1065
+ */
1066
+ readonly extractDependencies?: (f: MemoryFragment<T>) => readonly FactId[];
1067
+ /**
1068
+ * Exponential-decay forgetting. **Default: ON** with
1069
+ * {@link DEFAULT_DECAY_HALF_LIFE_NS} / {@link DEFAULT_DECAY_PERIOD_MS}.
1070
+ * Pass a partial to tune; pass `false` to disable. Wires an internal
1071
+ * `fromTimer` (the user-blessed batteries-included cadence).
1072
+ */
1073
+ readonly decay?: false | Partial<DecayExponentialOptions>;
1074
+ /**
1075
+ * REM-replay consolidation. **Domain-bound** — requires a `summarize`
1076
+ * (no generic default exists). Supply the full
1077
+ * {@link ConsolidationRemOptions} to enable; omit to disable. Wires an
1078
+ * internal `fromTimer` at `consolidate.periodMs`.
1079
+ */
1080
+ readonly consolidate?: ConsolidationRemOptions<T>;
1081
+ /** Persistent-only: durable bucket name. Default `fact_store_ingest`. */
1082
+ readonly persistName?: string;
1083
+ /** Persistent-only: durable codec. Default `bigintJsonCodecFor`. */
1084
+ readonly codec?: Codec<readonly MemoryFragment<T>[]>;
1085
+ }
1086
+ /**
1087
+ * The ergonomic write added to every `simpleFactStore` graph. Normalizes to a
1088
+ * {@link MemoryFragment} (auto `t_ns = BigInt(monotonicNs())`,
1089
+ * `confidence = 1`, `tags`/`sources` = `[]`) and `.emit`s it into the owned
1090
+ * `ingest` source. Re-`remember`ing an existing `id` is the MEME L1
1091
+ * direct-replace lever; set `opts.validTo` to obsolete (MEME L3).
1092
+ */
1093
+ type SimpleFactStoreRemember<T> = (id: FactId, payload: T, opts?: RememberOptions) => void;
1094
+ /**
1095
+ * In-memory `simpleFactStore` graph (no `storage`) augmented with
1096
+ * {@link SimpleFactStoreRemember}.
1097
+ */
1098
+ interface SimpleFactStoreGraph<T> extends ReactiveFactStoreGraph<T> {
1099
+ remember: SimpleFactStoreRemember<T>;
1100
+ }
1101
+ /**
1102
+ * Durable (`storage`-backed) `simpleFactStore` graph — the **type-honest**
1103
+ * persistent surface. EC-LOW-1 (`/qa` 2026-05-17): the `storage` overload
1104
+ * returns this so `position` / `replayedCount` / `flush` / `tier` are typed
1105
+ * without a hand-cast (the durable path is the headline 80%-case).
1106
+ */
1107
+ type PersistentSimpleFactStoreGraph<T> = PersistentReactiveFactStoreGraph<T> & {
1108
+ remember: SimpleFactStoreRemember<T>;
1109
+ };
1110
+ /**
1111
+ * Build a fact store with sensible defaults and a one-call `remember`.
1112
+ *
1113
+ * @example
1114
+ * ```ts
1115
+ * import { simpleFactStore } from "@graphrefly/graphrefly/utils/memory";
1116
+ * import { memoryBackend } from "@graphrefly/graphrefly/extra";
1117
+ *
1118
+ * const mem = simpleFactStore<string>(); // in-memory, decay ON
1119
+ * mem.remember("user:lang", "TypeScript", { tags: ["pref"] });
1120
+ * mem.answer.subscribe((a) => console.log(a)); // reactive read
1121
+ *
1122
+ * // Durable: the `storage` overload returns the typed persistent surface
1123
+ * // (no hand-cast needed for `position` / `flush`).
1124
+ * const durable = simpleFactStore<string>({ storage: memoryBackend() });
1125
+ * durable.remember("k", "v");
1126
+ * await durable.flush();
1127
+ * ```
1128
+ *
1129
+ * @category memory
1130
+ */
1131
+ declare function simpleFactStore<T>(opts: SimpleFactStoreOptions<T> & {
1132
+ storage: StorageBackend;
1133
+ }): PersistentSimpleFactStoreGraph<T>;
1134
+ declare function simpleFactStore<T>(opts?: SimpleFactStoreOptions<T>): SimpleFactStoreGraph<T>;
1135
+
957
1136
  /**
958
1137
  * Memory patterns (roadmap §4.3) — public-face Phase-4 primitives audited under
959
1138
  * `archive/docs/SESSION-public-face-blocks-review.md` (Wave A, locked 2026-04-25).
@@ -1295,4 +1474,4 @@ type KnowledgeGraph<TEntity, TRelation extends string = string> = Graph & {
1295
1474
  */
1296
1475
  declare function knowledgeGraph<TEntity, TRelation extends string = string>(name: string, opts?: KnowledgeGraphOptions): KnowledgeGraph<TEntity, TRelation>;
1297
1476
 
1298
- export { type AdmissionFilter, type AdmissionLlmJudgeOptions, type BitemporalQueryOptions, type CascadeEvent, type CascadeOverflow, type CascadeReason, type CollectionAuditRecord, type CollectionEntry, type CollectionGraph, type CollectionOptions, type CollectionScoreFn, type ConsolidationRemConfig, type ConsolidationRemOptions, type DecayExponentialOptions, type DecayPolicy, type DependentsIndex, type FactId, type FactStore, type FactStoreAuditRecord, type HnswAdapter, type InfluenceAnalysis, type InfluenceAnalysisOptions, type InfluenceRow, type InvalidationTraceEntry, type InvalidationTracerOptions, type KnowledgeEdge, type KnowledgeGraph, type KnowledgeGraphAuditRecord, type KnowledgeGraphOptions, type MemoryAnswer, type MemoryFragment, type MemoryQuery, NodeOrValue, type OutcomeSignal, type PersistentReactiveFactStoreConfig, type PersistentReactiveFactStoreGraph, type RankedCollectionEntry, type ReactiveFactStoreConfig, type ReactiveFactStoreGraph, type ReviewRequest, type ScoringByOutcomeOptions, type ScoringPolicy, type ShardByTenantConfig, type ShardByTenantOptions, type ShardKey, type StoreReadHandle, type VectorBackend, type VectorIndexAuditRecord, type VectorIndexGraph, type VectorIndexOptions, type VectorRecord, type VectorSearchResult, admissionLlmJudge, bitemporalQuery, collection, consolidationRem, cosineSimilarity, decayExponential, influenceAnalysis, invalidationTracer, knowledgeGraph, persistentReactiveFactStore, reactiveFactStore, scoringByOutcome, shardByTenant, vectorIndex };
1477
+ export { type AdmissionFilter, type AdmissionLlmJudgeOptions, type BitemporalQueryOptions, type CascadeEvent, type CascadeOverflow, type CascadeReason, type CollectionAuditRecord, type CollectionEntry, type CollectionGraph, type CollectionOptions, type CollectionScoreFn, type ConsolidationRemConfig, type ConsolidationRemOptions, DEFAULT_DECAY_HALF_LIFE_NS, DEFAULT_DECAY_PERIOD_MS, type DecayExponentialOptions, type DecayPolicy, type DependentsIndex, type FactId, type FactStore, type FactStoreAuditRecord, type HnswAdapter, type InfluenceAnalysis, type InfluenceAnalysisOptions, type InfluenceRow, type InvalidationTraceEntry, type InvalidationTracerOptions, type KnowledgeEdge, type KnowledgeGraph, type KnowledgeGraphAuditRecord, type KnowledgeGraphOptions, type MemoryAnswer, type MemoryFragment, type MemoryQuery, NodeOrValue, type OutcomeSignal, type PersistentReactiveFactStoreConfig, type PersistentReactiveFactStoreGraph, type RankedCollectionEntry, type ReactiveFactStoreConfig, ReactiveFactStoreGraph, type RememberOptions, type ReviewRequest, type ScoringByOutcomeOptions, type ScoringPolicy, type ShardByTenantConfig, type ShardByTenantOptions, type ShardKey, type SimpleFactStoreGraph, type SimpleFactStoreOptions, type StoreReadHandle, type VectorBackend, type VectorIndexAuditRecord, type VectorIndexGraph, type VectorIndexOptions, type VectorRecord, type VectorSearchResult, admissionLlmJudge, bitemporalQuery, collection, consolidationRem, cosineSimilarity, decayExponential, influenceAnalysis, invalidationTracer, knowledgeGraph, persistentReactiveFactStore, reactiveFactStore, scoringByOutcome, shardByTenant, simpleFactStore, vectorIndex };
@@ -173,6 +173,16 @@ interface FactStoreAuditRecord extends BaseAuditRecord {
173
173
  readonly action: "ingest" | "invalidate" | "outcome" | "consolidate" | "decay" | "overflow";
174
174
  readonly id?: FactId;
175
175
  readonly reason?: CascadeReason;
176
+ /**
177
+ * Number of facts whose state actually changed in a batch action
178
+ * (post-filter — excludes no-op / non-finite / resurrection-guard
179
+ * skips; equals the length of the emitted `decay_processor` value
180
+ * array). Populated for `"decay"` (a per-tick batch over many facts
181
+ * with no single `id` — the bare `{action,t_ns,seq}` record was opaque
182
+ * to audit-log forensics). Absent for single-fact actions (`id`
183
+ * carries those).
184
+ */
185
+ readonly count?: number;
176
186
  }
177
187
  interface ReactiveFactStoreConfig<T> {
178
188
  readonly extractDependencies: (f: MemoryFragment<T>) => readonly FactId[];
@@ -306,29 +316,6 @@ interface ReactiveFactStoreConfig<T> {
306
316
  */
307
317
  readonly recordIngest?: boolean;
308
318
  }
309
- interface ReactiveFactStoreGraph<T> extends Graph {
310
- /** Per-shard `state<FactStore<T>>` nodes (length = shard count). */
311
- readonly shards: readonly Node<FactStore<T>>[];
312
- /** Unified read view across all shards (derived). */
313
- readonly factStore: Node<FactStore<T>>;
314
- readonly dependentsIndex: Node<DependentsIndex>;
315
- readonly answer: Node<MemoryAnswer<T> | null>;
316
- readonly cascade: Node<readonly CascadeEvent[]>;
317
- readonly cascadeOverflow: Node<CascadeOverflow | null>;
318
- readonly review: Node<ReviewRequest | null>;
319
- readonly consolidated: Node<readonly MemoryFragment<T>[]>;
320
- readonly events: ReactiveLogBundle<FactStoreAuditRecord>;
321
- /**
322
- * Payload-carrying, replayable log of every committed fragment. Present iff
323
- * {@link ReactiveFactStoreConfig.recordIngest} is `true`. Unlike
324
- * {@link ReactiveFactStoreGraph.events} (action-only audit), each entry is
325
- * the full {@link MemoryFragment} — `attachStorage` it for a durable,
326
- * replayable projection source (see `recordIngest` docs for the recipe).
327
- */
328
- readonly ingestLog?: ReactiveLogBundle<MemoryFragment<T>>;
329
- /** Reactive read: a single fact by id (SENTINEL until the fact exists). */
330
- itemNode(id: FactId): Node<MemoryFragment<T> | undefined>;
331
- }
332
319
  /**
333
320
  * Build a static-topology reactive fact store (DS-14.7 architecture C).
334
321
  *
@@ -362,6 +349,38 @@ interface ReactiveFactStoreGraph<T> extends Graph {
362
349
  *
363
350
  * @category memory
364
351
  */
352
+ declare class ReactiveFactStoreGraph<T> extends Graph {
353
+ /** Per-shard `state<FactStore<T>>` nodes (length = shard count). */
354
+ readonly shards: readonly Node<FactStore<T>>[];
355
+ /** Unified read view across all shards (derived). */
356
+ readonly factStore: Node<FactStore<T>>;
357
+ readonly dependentsIndex: Node<DependentsIndex>;
358
+ readonly answer: Node<MemoryAnswer<T> | null>;
359
+ readonly cascade: Node<readonly CascadeEvent[]>;
360
+ readonly cascadeOverflow: Node<CascadeOverflow | null>;
361
+ readonly review: Node<ReviewRequest | null>;
362
+ readonly consolidated: Node<readonly MemoryFragment<T>[]>;
363
+ readonly events: ReactiveLogBundle<FactStoreAuditRecord>;
364
+ /**
365
+ * Payload-carrying, replayable log of every committed fragment. Present iff
366
+ * {@link ReactiveFactStoreConfig.recordIngest} is `true`. Unlike
367
+ * {@link ReactiveFactStoreGraph.events} (action-only audit), each entry is
368
+ * the full {@link MemoryFragment} — `attachStorage` it for a durable,
369
+ * replayable projection source (see `recordIngest` docs for the recipe).
370
+ */
371
+ readonly ingestLog?: ReactiveLogBundle<MemoryFragment<T>>;
372
+ constructor(config: ReactiveFactStoreConfig<T>);
373
+ /** Reactive read: a single fact by id (SENTINEL until the fact exists). */
374
+ itemNode(id: FactId): Node<MemoryFragment<T> | undefined>;
375
+ }
376
+ /**
377
+ * Build a static-topology reactive fact store (DS-14.7 architecture C).
378
+ *
379
+ * Thin factory over {@link ReactiveFactStoreGraph} — see that class for the
380
+ * full topology / locked-decision docs and the `instanceof`-narrowable type.
381
+ *
382
+ * @category memory
383
+ */
365
384
  declare function reactiveFactStore<T>(config: ReactiveFactStoreConfig<T>): ReactiveFactStoreGraph<T>;
366
385
 
367
386
  /**
@@ -954,6 +973,166 @@ interface ShardByTenantConfig<T> {
954
973
  */
955
974
  declare function shardByTenant<T>(tenantOf: (f: MemoryFragment<T>) => string, opts?: ShardByTenantOptions): ShardByTenantConfig<T>;
956
975
 
976
+ /**
977
+ * `simpleFactStore()` — the 80%-case ergonomic wrapper over
978
+ * {@link reactiveFactStore} / {@link persistentReactiveFactStore}
979
+ * (DS-14.7 follow-up #2; design LOCKED 2026-05-17 `/dev-dispatch` Q-walk,
980
+ * Q1–Q6 + sub-decisions resolved).
981
+ *
982
+ * Closes the gap where a consumer wanting durable agent memory had to
983
+ * hand-compose: an `ingest` source + `extractDependencies` + (optionally) a
984
+ * `StorageBackend` + decay/consolidation recipes + the
985
+ * `BigInt(monotonicNs())` fragment boilerplate. `simpleFactStore` owns all
986
+ * of that and exposes a single ergonomic `remember(id, payload, opts?)`.
987
+ *
988
+ * **Q-walk locks (canonical: `docs/optimizations.md` DS-14.7 follow-up #2):**
989
+ * - **Q1** — `extractDependencies` defaults to `() => []` (flat store;
990
+ * cascade inert by default — dependency-tracking is opt-in).
991
+ * - **Q2** — single factory, **optional `storage`**: present → wraps
992
+ * {@link persistentReactiveFactStore} (durable, event-sourced); absent →
993
+ * in-memory {@link reactiveFactStore}.
994
+ * - **Q3** — the wrapper **owns** the internal `ingest` source and exposes
995
+ * {@link SimpleFactStoreGraph.remember}. `remember` `.emit`s into the
996
+ * owned leaf source — this is the *sanctioned* external push that the
997
+ * `reactiveFactStore` ingest contract documents (same shape as the
998
+ * `decay`/replay recipes' `.emit`-into-source), **not** a spec-§5.9
999
+ * imperative trigger: it feeds DATA into a source node, it does not
1000
+ * bypass topology for control flow. Reactive reads (`answer` / `review` /
1001
+ * `events`) stay the canonical observation surface.
1002
+ * - **Q4** — auto-wire **default recipes** with internal `fromTimer`
1003
+ * cadences (batteries-included; user-blessed 2026-05-17). `decay` is
1004
+ * generically meaningful (confidence forgetting needs no domain
1005
+ * knowledge) → **ON by default** with conservative defaults
1006
+ * ({@link DEFAULT_DECAY_HALF_LIFE_NS} / {@link DEFAULT_DECAY_PERIOD_MS}),
1007
+ * tunable or `false` to disable. `consolidate` is **domain-bound** —
1008
+ * {@link consolidationRem} *requires* a `summarize` (there is no generic
1009
+ * default; an arbitrary `T` cannot be summarized blindly), so it is wired
1010
+ * **iff** the caller supplies `opts.consolidate`. This consolidation
1011
+ * asymmetry is dictated by the recipe's own required contract, not an
1012
+ * autonomous downgrade of the Q4 lock.
1013
+ * - **Q5** — minimal input: `remember(id, payload, { tags? })` auto-fills
1014
+ * `t_ns = BigInt(monotonicNs())` (per the {@link MemoryFragment.t_ns}
1015
+ * contract + the clock-return-type rule — `monotonicNs()` is `number`,
1016
+ * the `BigInt(...)` wrap is load-bearing) and `confidence = 1`.
1017
+ * - **Q6** — **wraps** the existing factories (not a parallel impl).
1018
+ *
1019
+ * Presentation-only (`@graphrefly/graphrefly`, `utils/memory` barrel),
1020
+ * universal tier (`fromTimer` only, no `node:*`/DOM — the optional
1021
+ * `StorageBackend` impl's tier is the *caller's* concern, forwarded
1022
+ * verbatim, exactly as {@link persistentReactiveFactStore} does).
1023
+ *
1024
+ * @module
1025
+ */
1026
+
1027
+ /**
1028
+ * Default exponential-decay half-life: **7 days** in nanoseconds. Confidence
1029
+ * halves once per week of fact age — gentle forgetting suitable for the
1030
+ * 80%-case agent memory. Override via `opts.decay.halfLifeNs`.
1031
+ */
1032
+ declare const DEFAULT_DECAY_HALF_LIFE_NS = 604800000000000n;
1033
+ /**
1034
+ * Default decay tick cadence: **1 hour** (ms). How often the forgetting pass
1035
+ * runs. Override via `opts.decay.periodMs`.
1036
+ */
1037
+ declare const DEFAULT_DECAY_PERIOD_MS = 3600000;
1038
+ /** Per-fact override fields accepted by {@link SimpleFactStoreGraph.remember}. */
1039
+ interface RememberOptions {
1040
+ /** Tags. Default `[]`. */
1041
+ readonly tags?: readonly string[];
1042
+ /** Dependency edges (fact IDs this fact derives from). Default `[]`. */
1043
+ readonly sources?: readonly FactId[];
1044
+ /** Confidence 0..1. Default `1`. */
1045
+ readonly confidence?: number;
1046
+ /** Valid-time end — set to obsolete a fact (MEME L3 lever). */
1047
+ readonly validTo?: bigint;
1048
+ /** Valid-time start — `undefined` = unbounded past. */
1049
+ readonly validFrom?: bigint;
1050
+ /** Free-form provenance string. */
1051
+ readonly provenance?: string;
1052
+ }
1053
+ interface SimpleFactStoreOptions<T> {
1054
+ /**
1055
+ * Durable backing. Present → delegates to
1056
+ * {@link persistentReactiveFactStore} (event-sourced, replay-on-start,
1057
+ * substrate-owned cursor). Absent → in-memory {@link reactiveFactStore}.
1058
+ * The backend's runtime tier (node / browser) is the caller's concern —
1059
+ * forwarded verbatim.
1060
+ */
1061
+ readonly storage?: StorageBackend;
1062
+ /**
1063
+ * Cascade dependency extractor. **Default `() => []`** — flat store, no
1064
+ * cascade. Supply to opt into MEME L2 cascade invalidation.
1065
+ */
1066
+ readonly extractDependencies?: (f: MemoryFragment<T>) => readonly FactId[];
1067
+ /**
1068
+ * Exponential-decay forgetting. **Default: ON** with
1069
+ * {@link DEFAULT_DECAY_HALF_LIFE_NS} / {@link DEFAULT_DECAY_PERIOD_MS}.
1070
+ * Pass a partial to tune; pass `false` to disable. Wires an internal
1071
+ * `fromTimer` (the user-blessed batteries-included cadence).
1072
+ */
1073
+ readonly decay?: false | Partial<DecayExponentialOptions>;
1074
+ /**
1075
+ * REM-replay consolidation. **Domain-bound** — requires a `summarize`
1076
+ * (no generic default exists). Supply the full
1077
+ * {@link ConsolidationRemOptions} to enable; omit to disable. Wires an
1078
+ * internal `fromTimer` at `consolidate.periodMs`.
1079
+ */
1080
+ readonly consolidate?: ConsolidationRemOptions<T>;
1081
+ /** Persistent-only: durable bucket name. Default `fact_store_ingest`. */
1082
+ readonly persistName?: string;
1083
+ /** Persistent-only: durable codec. Default `bigintJsonCodecFor`. */
1084
+ readonly codec?: Codec<readonly MemoryFragment<T>[]>;
1085
+ }
1086
+ /**
1087
+ * The ergonomic write added to every `simpleFactStore` graph. Normalizes to a
1088
+ * {@link MemoryFragment} (auto `t_ns = BigInt(monotonicNs())`,
1089
+ * `confidence = 1`, `tags`/`sources` = `[]`) and `.emit`s it into the owned
1090
+ * `ingest` source. Re-`remember`ing an existing `id` is the MEME L1
1091
+ * direct-replace lever; set `opts.validTo` to obsolete (MEME L3).
1092
+ */
1093
+ type SimpleFactStoreRemember<T> = (id: FactId, payload: T, opts?: RememberOptions) => void;
1094
+ /**
1095
+ * In-memory `simpleFactStore` graph (no `storage`) augmented with
1096
+ * {@link SimpleFactStoreRemember}.
1097
+ */
1098
+ interface SimpleFactStoreGraph<T> extends ReactiveFactStoreGraph<T> {
1099
+ remember: SimpleFactStoreRemember<T>;
1100
+ }
1101
+ /**
1102
+ * Durable (`storage`-backed) `simpleFactStore` graph — the **type-honest**
1103
+ * persistent surface. EC-LOW-1 (`/qa` 2026-05-17): the `storage` overload
1104
+ * returns this so `position` / `replayedCount` / `flush` / `tier` are typed
1105
+ * without a hand-cast (the durable path is the headline 80%-case).
1106
+ */
1107
+ type PersistentSimpleFactStoreGraph<T> = PersistentReactiveFactStoreGraph<T> & {
1108
+ remember: SimpleFactStoreRemember<T>;
1109
+ };
1110
+ /**
1111
+ * Build a fact store with sensible defaults and a one-call `remember`.
1112
+ *
1113
+ * @example
1114
+ * ```ts
1115
+ * import { simpleFactStore } from "@graphrefly/graphrefly/utils/memory";
1116
+ * import { memoryBackend } from "@graphrefly/graphrefly/extra";
1117
+ *
1118
+ * const mem = simpleFactStore<string>(); // in-memory, decay ON
1119
+ * mem.remember("user:lang", "TypeScript", { tags: ["pref"] });
1120
+ * mem.answer.subscribe((a) => console.log(a)); // reactive read
1121
+ *
1122
+ * // Durable: the `storage` overload returns the typed persistent surface
1123
+ * // (no hand-cast needed for `position` / `flush`).
1124
+ * const durable = simpleFactStore<string>({ storage: memoryBackend() });
1125
+ * durable.remember("k", "v");
1126
+ * await durable.flush();
1127
+ * ```
1128
+ *
1129
+ * @category memory
1130
+ */
1131
+ declare function simpleFactStore<T>(opts: SimpleFactStoreOptions<T> & {
1132
+ storage: StorageBackend;
1133
+ }): PersistentSimpleFactStoreGraph<T>;
1134
+ declare function simpleFactStore<T>(opts?: SimpleFactStoreOptions<T>): SimpleFactStoreGraph<T>;
1135
+
957
1136
  /**
958
1137
  * Memory patterns (roadmap §4.3) — public-face Phase-4 primitives audited under
959
1138
  * `archive/docs/SESSION-public-face-blocks-review.md` (Wave A, locked 2026-04-25).
@@ -1295,4 +1474,4 @@ type KnowledgeGraph<TEntity, TRelation extends string = string> = Graph & {
1295
1474
  */
1296
1475
  declare function knowledgeGraph<TEntity, TRelation extends string = string>(name: string, opts?: KnowledgeGraphOptions): KnowledgeGraph<TEntity, TRelation>;
1297
1476
 
1298
- export { type AdmissionFilter, type AdmissionLlmJudgeOptions, type BitemporalQueryOptions, type CascadeEvent, type CascadeOverflow, type CascadeReason, type CollectionAuditRecord, type CollectionEntry, type CollectionGraph, type CollectionOptions, type CollectionScoreFn, type ConsolidationRemConfig, type ConsolidationRemOptions, type DecayExponentialOptions, type DecayPolicy, type DependentsIndex, type FactId, type FactStore, type FactStoreAuditRecord, type HnswAdapter, type InfluenceAnalysis, type InfluenceAnalysisOptions, type InfluenceRow, type InvalidationTraceEntry, type InvalidationTracerOptions, type KnowledgeEdge, type KnowledgeGraph, type KnowledgeGraphAuditRecord, type KnowledgeGraphOptions, type MemoryAnswer, type MemoryFragment, type MemoryQuery, NodeOrValue, type OutcomeSignal, type PersistentReactiveFactStoreConfig, type PersistentReactiveFactStoreGraph, type RankedCollectionEntry, type ReactiveFactStoreConfig, type ReactiveFactStoreGraph, type ReviewRequest, type ScoringByOutcomeOptions, type ScoringPolicy, type ShardByTenantConfig, type ShardByTenantOptions, type ShardKey, type StoreReadHandle, type VectorBackend, type VectorIndexAuditRecord, type VectorIndexGraph, type VectorIndexOptions, type VectorRecord, type VectorSearchResult, admissionLlmJudge, bitemporalQuery, collection, consolidationRem, cosineSimilarity, decayExponential, influenceAnalysis, invalidationTracer, knowledgeGraph, persistentReactiveFactStore, reactiveFactStore, scoringByOutcome, shardByTenant, vectorIndex };
1477
+ export { type AdmissionFilter, type AdmissionLlmJudgeOptions, type BitemporalQueryOptions, type CascadeEvent, type CascadeOverflow, type CascadeReason, type CollectionAuditRecord, type CollectionEntry, type CollectionGraph, type CollectionOptions, type CollectionScoreFn, type ConsolidationRemConfig, type ConsolidationRemOptions, DEFAULT_DECAY_HALF_LIFE_NS, DEFAULT_DECAY_PERIOD_MS, type DecayExponentialOptions, type DecayPolicy, type DependentsIndex, type FactId, type FactStore, type FactStoreAuditRecord, type HnswAdapter, type InfluenceAnalysis, type InfluenceAnalysisOptions, type InfluenceRow, type InvalidationTraceEntry, type InvalidationTracerOptions, type KnowledgeEdge, type KnowledgeGraph, type KnowledgeGraphAuditRecord, type KnowledgeGraphOptions, type MemoryAnswer, type MemoryFragment, type MemoryQuery, NodeOrValue, type OutcomeSignal, type PersistentReactiveFactStoreConfig, type PersistentReactiveFactStoreGraph, type RankedCollectionEntry, type ReactiveFactStoreConfig, ReactiveFactStoreGraph, type RememberOptions, type ReviewRequest, type ScoringByOutcomeOptions, type ScoringPolicy, type ShardByTenantConfig, type ShardByTenantOptions, type ShardKey, type SimpleFactStoreGraph, type SimpleFactStoreOptions, type StoreReadHandle, type VectorBackend, type VectorIndexAuditRecord, type VectorIndexGraph, type VectorIndexOptions, type VectorRecord, type VectorSearchResult, admissionLlmJudge, bitemporalQuery, collection, consolidationRem, cosineSimilarity, decayExponential, influenceAnalysis, invalidationTracer, knowledgeGraph, persistentReactiveFactStore, reactiveFactStore, scoringByOutcome, shardByTenant, simpleFactStore, vectorIndex };
@@ -1,4 +1,7 @@
1
1
  import {
2
+ DEFAULT_DECAY_HALF_LIFE_NS,
3
+ DEFAULT_DECAY_PERIOD_MS,
4
+ ReactiveFactStoreGraph,
2
5
  admissionLlmJudge,
3
6
  bitemporalQuery,
4
7
  collection,
@@ -12,13 +15,17 @@ import {
12
15
  reactiveFactStore,
13
16
  scoringByOutcome,
14
17
  shardByTenant,
18
+ simpleFactStore,
15
19
  vectorIndex
16
- } from "../../chunk-7AVQIGF6.js";
20
+ } from "../../chunk-K4ZYJ4EM.js";
17
21
  import "../../chunk-QMBYUVRL.js";
18
22
  import "../../chunk-FMPF42Q4.js";
19
- import "../../chunk-BXGZFGZ4.js";
23
+ import "../../chunk-C5QD5DQX.js";
20
24
  import "../../chunk-AZDQPQ3V.js";
21
25
  export {
26
+ DEFAULT_DECAY_HALF_LIFE_NS,
27
+ DEFAULT_DECAY_PERIOD_MS,
28
+ ReactiveFactStoreGraph,
22
29
  admissionLlmJudge,
23
30
  bitemporalQuery,
24
31
  collection,
@@ -32,6 +39,7 @@ export {
32
39
  reactiveFactStore,
33
40
  scoringByOutcome,
34
41
  shardByTenant,
42
+ simpleFactStore,
35
43
  vectorIndex
36
44
  };
37
45
  //# sourceMappingURL=index.js.map