@reventlessdev/reventless-core 3.0.0-alpha.275 → 3.0.0-alpha.276

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.276 (2026-09-25)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **spec:** a chapter that carries both keys backs neither ([cbd823e](https://github.com/ReventlessDev/reventless-core/commit/cbd823e4f87ddd5810debd929bb536b2003d0e4c))
11
+
12
+
6
13
  # 3.0.0-alpha.275 (2026-09-25)
7
14
 
8
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.275",
3
+ "version": "3.0.0-alpha.276",
4
4
  "description": "Core package for Reventless framework",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -30,15 +30,15 @@
30
30
  "uuid": "^13.0.0",
31
31
  "@reventlessdev/rescript-effect": "0.1.0-alpha.34",
32
32
  "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.15",
33
- "@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
34
- "@reventlessdev/rescript-jest": "1.0.0-alpha.11",
35
33
  "@reventlessdev/rescript-node": "2.0.0-alpha.15",
34
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.11",
35
+ "@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
36
36
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.22",
37
37
  "@reventlessdev/rescript-ssh2": "2.0.0-alpha.15",
38
38
  "@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
39
- "@reventlessdev/reventless-infra": "3.0.0-alpha.175",
40
- "@reventlessdev/reventless-interop": "3.0.0-alpha.38",
41
- "@reventlessdev/reventless-spec": "3.0.0-alpha.147"
39
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.176",
40
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.148",
41
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.38"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rescript": "12.3.1",
@@ -545,12 +545,37 @@ describe("DcbScopeInference:", () => {
545
545
  },
546
546
  )
547
547
 
548
+ // Every producer is present, so the arms it reads by `categoryId` all come from
549
+ // category slices: only the chapter can refuse the hint.
550
+ let categories = [
551
+ {...addCategory, chapter: "Category"},
552
+ {...renameCategory, chapter: "Category"},
553
+ {...archiveCategory, chapter: "Category"},
554
+ ]
555
+
548
556
  testSync(
549
557
  "a hint its chapter disagrees with is still a contradiction",
550
558
  () => {
551
- // Every event under `Product/` carries `productId`, not `categoryId`.
559
+ // `RenameProduct` writes only `productId`, so `Product/` is about products.
560
+ let renameProduct = slice(
561
+ "RenameProduct",
562
+ ~chapter="Product",
563
+ ~consumed=[ev("ProductAdded", [scal("productId")])],
564
+ ~produced=[ev("ProductRenamed", [scal("productId")])],
565
+ )
566
+ let inProduct = {...hinted(addProduct, "categoryId"), chapter: "Product"}
567
+ let issues = check([inProduct, renameProduct, ...categories])
568
+ expect(issues.contradictions->names)->toEqual(["AddProduct"])
569
+ expect(issues.overrides)->toEqual([])
570
+ },
571
+ )
572
+
573
+ testSync(
574
+ "a chapter that carries both keys everywhere backs neither",
575
+ () => {
576
+ // One slice, one event with both ids: the chapter cannot say which one it is about.
552
577
  let inProduct = {...hinted(addProduct, "categoryId"), chapter: "Product"}
553
- let issues = check([inProduct, {...addCategory, chapter: "Category"}])
578
+ let issues = check([inProduct, ...categories])
554
579
  expect(issues.contradictions->names)->toEqual(["AddProduct"])
555
580
  expect(issues.overrides)->toEqual([])
556
581
  },
@@ -1,5 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.js";
3
4
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
4
5
  import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
5
6
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
@@ -884,14 +885,47 @@ globalThis.describe("DcbScopeInference:", () => {
884
885
  globalThis.expect(issues.contradictions.map(e => e.sliceName)).toEqual(["ShipOrder"]);
885
886
  globalThis.expect(issues.overrides).toEqual([]);
886
887
  });
888
+ let newrecord = {...addCategory};
889
+ let newrecord$1 = {...renameCategory};
890
+ let newrecord$2 = {...archiveCategory};
891
+ let categories = [
892
+ (newrecord.chapter = "Category", newrecord),
893
+ (newrecord$1.chapter = "Category", newrecord$1),
894
+ (newrecord$2.chapter = "Category", newrecord$2)
895
+ ];
887
896
  globalThis.test("a hint its chapter disagrees with is still a contradiction", () => {
897
+ let renameProduct = slice("RenameProduct", undefined, [{
898
+ eventType: "ProductAdded",
899
+ idFields: [{
900
+ name: "productId",
901
+ isList: false
902
+ }]
903
+ }], [{
904
+ eventType: "ProductRenamed",
905
+ idFields: [{
906
+ name: "productId",
907
+ isList: false
908
+ }]
909
+ }], undefined, "Product");
888
910
  let newrecord = {...hinted(addProduct, "categoryId")};
889
911
  newrecord.chapter = "Product";
890
- let newrecord$1 = {...addCategory};
891
- let issues = DcbValidation$Reventless.validatePartitionHintsVsInference([
892
- newrecord,
893
- (newrecord$1.chapter = "Category", newrecord$1)
894
- ]);
912
+ let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(Belt_Array.concatMany([
913
+ [
914
+ newrecord,
915
+ renameProduct
916
+ ],
917
+ categories
918
+ ]));
919
+ globalThis.expect(issues.contradictions.map(e => e.sliceName)).toEqual(["AddProduct"]);
920
+ globalThis.expect(issues.overrides).toEqual([]);
921
+ });
922
+ globalThis.test("a chapter that carries both keys everywhere backs neither", () => {
923
+ let newrecord = {...hinted(addProduct, "categoryId")};
924
+ newrecord.chapter = "Product";
925
+ let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(Belt_Array.concatMany([
926
+ [newrecord],
927
+ categories
928
+ ]));
895
929
  globalThis.expect(issues.contradictions.map(e => e.sliceName)).toEqual(["AddProduct"]);
896
930
  globalThis.expect(issues.overrides).toEqual([]);
897
931
  });