@rulvar/store-conformance 1.61.0 → 1.63.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 (2) hide show
  1. package/dist/index.js +38 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -671,6 +671,24 @@ function leasableStoreConformance(mk, options) {
671
671
  ensure(loaded.length === 2 && !loaded.some((item) => item.seq === 2), "fencing-stale-epoch", "a rejected stale-epoch append must never appear in load");
672
672
  }
673
673
  },
674
+ {
675
+ id: "fencing-epoch-tombstone",
676
+ title: "delete/recreate of the same runId keeps the epoch strictly monotonic",
677
+ async run() {
678
+ const store = await mk();
679
+ const zombie = await store.acquire(RUN$2, "owner-stable");
680
+ await store.append(RUN$2, leaseEntry(0), zombie);
681
+ await store.release(zombie);
682
+ await store.delete(RUN$2);
683
+ const fresh = await store.acquire(RUN$2, "owner-stable");
684
+ ensure(fresh.epoch > zombie.epoch, "fencing-epoch-tombstone", `acquire after delete/recreate must return a strictly higher epoch than any epoch the deleted incarnation held (got ${fresh.epoch} after ${zombie.epoch}); keep an epoch tombstone through deletion`);
685
+ await store.append(RUN$2, leaseEntry(0), fresh);
686
+ ensure(await mustReject(() => store.append(RUN$2, leaseEntry(1), zombie)) !== void 0, "fencing-epoch-tombstone", "an append under a lease from a deleted incarnation must reject");
687
+ ensure(await mustReject(() => store.renew(zombie)) !== void 0, "fencing-epoch-tombstone", "renew of a lease from a deleted incarnation must reject");
688
+ const loaded = await store.load(RUN$2);
689
+ ensure(loaded.length === 1 && !loaded.some((item) => item.seq === 1), "fencing-epoch-tombstone", "a rejected zombie append must never appear in the recreated run");
690
+ }
691
+ },
674
692
  {
675
693
  id: "lease-release-fences",
676
694
  title: "a released lease can neither renew nor append",
@@ -802,6 +820,26 @@ function fencedWritesConformance(mk) {
802
820
  ensure((await store.load(RUN$1)).length === 0 && await readMeta$1(store, RUN$1) === void 0, "fenced-delete-stale-rejected", "a delete under the current lease must remove the journal and the meta row");
803
821
  }
804
822
  },
823
+ {
824
+ id: "fenced-tombstone-zombie-rejected",
825
+ title: "a lease from a deleted incarnation guards nothing after recreate",
826
+ async run() {
827
+ const store = await mk();
828
+ const zombie = await store.acquire(RUN$1, "owner-stable");
829
+ await store.append(RUN$1, fencedEntry(0), zombie);
830
+ await store.putMeta(meta(RUN$1, "running", 1), zombie);
831
+ await store.release(zombie);
832
+ await store.delete(RUN$1);
833
+ const fresh = await store.acquire(RUN$1, "owner-stable");
834
+ await store.append(RUN$1, fencedEntry(0), fresh);
835
+ await store.putMeta(meta(RUN$1, "running", 1), fresh);
836
+ await mustRejectFenced$1("fenced-tombstone-zombie-rejected", "a putMeta under a lease from a deleted incarnation", () => store.putMeta(meta(RUN$1, "ok", 1), zombie));
837
+ await mustRejectFenced$1("fenced-tombstone-zombie-rejected", "a delete under a lease from a deleted incarnation", () => store.delete(RUN$1, zombie));
838
+ const current = await readMeta$1(store, RUN$1);
839
+ ensure(current !== void 0 && current.status === "running", "fenced-tombstone-zombie-rejected", "the recreated run must survive every zombie mutation attempt unchanged");
840
+ ensure((await store.load(RUN$1)).length === 1, "fenced-tombstone-zombie-rejected", "the recreated journal must survive a zombie delete attempt");
841
+ }
842
+ },
805
843
  {
806
844
  id: "fenced-run-match",
807
845
  title: "a live lease for a different run guards nothing",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/store-conformance",
3
- "version": "1.61.0",
3
+ "version": "1.63.0",
4
4
  "description": "Rulvar executable store conformance kit (DEF-4).",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,7 +22,7 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.61.0"
25
+ "@rulvar/core": "1.63.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.0",