@rotorsoft/act-tck 1.30.4 → 1.31.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.
@@ -1 +1 @@
1
- {"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;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;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IAwgJtD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1806,6 +1806,46 @@ var runStoreTck = (options) => {
1806
1806
  await store.subscribe([{ stream: s }]);
1807
1807
  (0, import_vitest9.expect)(await read()).toBe(0);
1808
1808
  });
1809
+ (0, import_vitest9.describe)("correlate checkpoint", () => {
1810
+ const peek = async () => (await store.subscribe([])).correlated_at;
1811
+ (0, import_vitest9.it)("round-trips an advance through subscribe", async () => {
1812
+ const base = await peek();
1813
+ (0, import_vitest9.expect)((await store.subscribe([], base + 10)).correlated_at).toBe(
1814
+ base + 10
1815
+ );
1816
+ (0, import_vitest9.expect)(await peek()).toBe(base + 10);
1817
+ });
1818
+ (0, import_vitest9.it)("persists only when greater than the stored value", async () => {
1819
+ const base = await peek();
1820
+ await store.subscribe([], base - 5);
1821
+ (0, import_vitest9.expect)(await peek()).toBe(base);
1822
+ await store.subscribe([], base);
1823
+ (0, import_vitest9.expect)(await peek()).toBe(base);
1824
+ await store.subscribe([], base + 3);
1825
+ (0, import_vitest9.expect)(await peek()).toBe(base + 3);
1826
+ });
1827
+ (0, import_vitest9.it)("is left untouched when subscribe omits it", async () => {
1828
+ const base = await peek();
1829
+ await store.subscribe([]);
1830
+ (0, import_vitest9.expect)(await peek()).toBe(base);
1831
+ });
1832
+ (0, import_vitest9.it)("advances in the same call that registers discovered targets", async () => {
1833
+ const base = await peek();
1834
+ const s = `cp-sub-${uid()}`;
1835
+ const { subscribed, correlated_at } = await store.subscribe(
1836
+ [{ stream: s }],
1837
+ base + 7
1838
+ );
1839
+ (0, import_vitest9.expect)(subscribed).toBe(1);
1840
+ (0, import_vitest9.expect)(correlated_at).toBe(base + 7);
1841
+ });
1842
+ (0, import_vitest9.it)("is invisible to every stream-scoped surface", async () => {
1843
+ const seen = [];
1844
+ await store.query_streams((p) => seen.push(p.stream), {});
1845
+ (0, import_vitest9.expect)(seen.some((n) => n.startsWith("__correlate"))).toBe(false);
1846
+ (0, import_vitest9.expect)(seen).not.toContain("correlated");
1847
+ });
1848
+ });
1809
1849
  (0, import_vitest9.it)("claims a subscribed stream and ack releases the lease", async () => {
1810
1850
  const s = `claim-${uid()}`;
1811
1851
  await store.subscribe([{ stream: s }]);