@reventlessdev/reventless-core 3.0.0-alpha.267 → 3.0.0-alpha.269

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 (37) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/package.json +16 -16
  4. package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +4 -4
  5. package/src/components/CommandGenerator/CommandGenerator_Callback.res.mjs +90 -92
  6. package/src/components/Counter/Counter_Callback.res.mjs +1 -1
  7. package/src/components/Counter/Counter_Operations.res.mjs +1 -1
  8. package/src/components/EventCollector/EventCollector_Builder.res.mjs +3 -3
  9. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +2 -3
  10. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +4 -4
  11. package/src/plugin/component/Plugin_Builder.res.mjs +3 -3
  12. package/src/plugin/component/Plugin_Helpers.res.mjs +2 -2
  13. package/src/plugin/component/Plugin_Structure.res +11 -3
  14. package/src/plugin/component/Plugin_Structure.res.mjs +6 -5
  15. package/src/plugin/lifecycle/PluginBehavior.res.mjs +1 -1
  16. package/src/util/Interstack.res.mjs +4 -4
  17. package/tests/aggregate/AggregateCacheTest.res.mjs +1 -1
  18. package/tests/api/BrandedMarkerCompositionTest.res.mjs +2 -3
  19. package/tests/api/GeolocationSemanticTest.res.mjs +1 -2
  20. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +2 -2
  21. package/tests/api/SuryToJsonSchemaTest.res +8 -8
  22. package/tests/api/SuryToJsonSchemaTest.res.mjs +24 -24
  23. package/tests/dcb/DcbFixtures.res.mjs +6 -6
  24. package/tests/dcb/DcbValidationTest.res.mjs +3 -3
  25. package/tests/eventmapper/EventMapperFixtures.res.mjs +5 -5
  26. package/tests/plugin/IdentityReferenceTest.res +21 -2
  27. package/tests/plugin/IdentityReferenceTest.res.mjs +43 -8
  28. package/tests/plugin/PluginSpecExperiment.res +2 -2
  29. package/tests/plugin/PluginSpecExperiment.res.mjs +3 -3
  30. package/tests/plugin/PluginStructureTest.res +1 -1
  31. package/tests/plugin/PluginStructureTest.res.mjs +5 -5
  32. package/tests/plugin/SchemaWalkerTest.res.mjs +2 -2
  33. package/tests/plugin/StateChange/PsReserveStock.res.mjs +1 -1
  34. package/tests/plugin/StateView/PsAnnotatedView.res +1 -1
  35. package/tests/plugin/StateView/PsAnnotatedView.res.mjs +4 -4
  36. package/tests/querydb/QueryDbFixtures.res.mjs +1 -1
  37. package/tests/util/CommandPublisherTest.res.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
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.269 (2026-09-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** update rescript to 12.3.1 ([ea1ce37](https://github.com/ReventlessDev/reventless-core/commit/ea1ce377297640f6d0d360e6c84c778d59ecbcc5))
11
+ * **deps:** update sury to 11.0.0 ([8715b22](https://github.com/ReventlessDev/reventless-core/commit/8715b22b33856c46ba57518aad151065c123a995))
12
+
13
+
14
+ # 3.0.0-alpha.268 (2026-09-21)
15
+
16
+ ### Bug Fixes
17
+
18
+ * **core:** a creating command's own id derives no reference ([58a921c](https://github.com/ReventlessDev/reventless-core/commit/58a921c84352f6522e7c175387927e32365aa94a))
19
+
20
+
6
21
  # 3.0.0-alpha.267 (2026-09-21)
7
22
 
8
23
  ### Bug Fixes
package/README.md CHANGED
@@ -59,7 +59,7 @@ Then register it as a ReScript dependency in `rescript.json`:
59
59
  }
60
60
  ```
61
61
 
62
- Requires ReScript `^12.3.0` (peer dependency).
62
+ Requires ReScript `^12.3.1` (peer dependency).
63
63
 
64
64
  ## Links
65
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.267",
3
+ "version": "3.0.0-alpha.269",
4
4
  "description": "Core package for Reventless framework",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -26,27 +26,27 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "sury": "11.0.0-rc.2",
29
+ "sury": "11.0.0",
30
30
  "uuid": "^13.0.0",
31
- "@reventlessdev/rescript-effect": "0.1.0-alpha.33",
32
- "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.12",
33
- "@reventlessdev/rescript-hash-object": "1.2.0-alpha.14",
34
- "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
35
- "@reventlessdev/rescript-node": "2.0.0-alpha.12",
36
- "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.21",
37
- "@reventlessdev/rescript-ssh2": "2.0.0-alpha.12",
38
- "@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
39
- "@reventlessdev/reventless-infra": "3.0.0-alpha.168",
40
- "@reventlessdev/reventless-interop": "3.0.0-alpha.37",
41
- "@reventlessdev/reventless-spec": "3.0.0-alpha.140"
31
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.34",
32
+ "@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
33
+ "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.13",
34
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.11",
35
+ "@reventlessdev/rescript-node": "2.0.0-alpha.13",
36
+ "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.22",
37
+ "@reventlessdev/rescript-ssh2": "2.0.0-alpha.13",
38
+ "@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
39
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.169",
40
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.38",
41
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.141"
42
42
  },
43
43
  "devDependencies": {
44
- "rescript": "12.3.0",
45
- "sury-ppx": "11.0.0-rc.2",
44
+ "rescript": "12.3.1",
45
+ "sury-ppx": "11.0.0",
46
46
  "@reventlessdev/reventless-ppx": "1.0.0-alpha.81"
47
47
  },
48
48
  "peerDependencies": {
49
- "rescript": "12.3.0"
49
+ "rescript": "^12.3.1"
50
50
  },
51
51
  "gitHead": "ddea51534dc210635d7b11968089627b3b697ce2",
52
52
  "publishConfig": {
@@ -28,8 +28,8 @@ let todoRowSchema = Sury.$schema(s => ({
28
28
  createdAt: s.m(Sury.string),
29
29
  processedAt: s.m(Sury.$option(Sury.string)),
30
30
  completedAt: s.m(Sury.$option(Sury.string)),
31
- retryCount: s.m(Sury.int),
32
- maxRetries: s.m(Sury.$option(Sury.int))
31
+ retryCount: s.m(Sury.int32),
32
+ maxRetries: s.m(Sury.$option(Sury.int32))
33
33
  }));
34
34
 
35
35
  function todoRowSchemaFor(itemSchema) {
@@ -39,8 +39,8 @@ function todoRowSchemaFor(itemSchema) {
39
39
  createdAt: s.m(Sury.string),
40
40
  processedAt: s.m(Sury.$option(Sury.string)),
41
41
  completedAt: s.m(Sury.$option(Sury.string)),
42
- retryCount: s.m(Sury.int),
43
- maxRetries: s.m(Sury.$option(Sury.int))
42
+ retryCount: s.m(Sury.int32),
43
+ maxRetries: s.m(Sury.$option(Sury.int32))
44
44
  }));
45
45
  }
46
46
 
@@ -59,103 +59,101 @@ function dropNullArguments(obj) {
59
59
  });
60
60
  }
61
61
 
62
- function makeGenerateCommand(publishJsons, publishJsonsAndWait, serviceName, commandSchema, componentKind, $staropt$star, partitionTag) {
63
- return payload => {
64
- let stripIdFromParams = $staropt$star !== undefined ? $staropt$star : true;
65
- return Effect.flatMap(Effect.tap(Effect.sync(() => {
66
- let msgId = Message$ReventlessCore.uuid();
67
- let meta_time = Message$ReventlessCore.nowAsISOString();
68
- let meta_ip = Stdlib_Option.getOr(payload.meta.ip.shift(), "");
69
- let meta_user = payload.meta.user;
70
- let meta = {
71
- service: serviceName,
72
- time: meta_time,
73
- ip: meta_ip,
74
- user: meta_user,
75
- msgId: msgId,
76
- correlationId: msgId
77
- };
78
- let obj = Stdlib_Option.flatMap(JSON.stringify(payload.arguments), jsonString => Stdlib_JSON.Decode.object(JSON.parse(jsonString)));
79
- let params = obj !== undefined ? (stripIdFromParams ? Stdlib_Dict.$$delete(obj, "id") : undefined, dropNullArguments(obj), stampOwnerFields(obj, commandSchema, payload.command, payload.identity, serviceName), Object.entries(obj)) : Stdlib_JsError.throwWithMessage("Couldn't decode:" + Stdlib_Option.getOr(JSON.stringify(payload.arguments), "<payload.arguments>"));
80
- let commandStr = payload.command;
81
- let match = params.length;
82
- let commandJson = match !== 0 ? Object.fromEntries([[
83
- "TAG",
84
- commandStr
85
- ]].concat(params)) : commandStr;
86
- let suppliedId = payload.arguments.id;
87
- let id;
88
- id = componentKind === "Aggregate" || !(suppliedId == null) ? suppliedId : Stdlib_Option.mapOr(partitionTag, "", pt => DcbTag$Reventless.partitionValueOfTags(DcbTag$Reventless.extractTagsFromJson(commandSchema, commandJson), pt));
89
- return [
90
- meta,
91
- commandJson,
92
- id
93
- ];
94
- }), param => {
95
- let commandJson = param[1];
96
- return EffectLogger$ReventlessCore.logInfo(`CommandGenerator(` + serviceName + `)`, commandJson, `generated command: ` + LogFormat$ReventlessCore.cmdLabelOfJson(commandJson));
97
- }), param => {
98
- let id = param[2];
99
- let commandJson = param[1];
100
- let meta = param[0];
101
- let val;
102
- try {
103
- val = Message$ReventlessCore.decode(commandJson, commandSchema);
104
- } catch (raw_err) {
105
- let err = Primitive_exceptions.internalToException(raw_err);
106
- let hook = Plugin_ResolverError$ReventlessCore.onResolverErrorHook.contents;
107
- if (hook !== undefined) {
108
- hook({
109
- pluginName: "",
110
- componentName: serviceName,
111
- attemptedCommandType: Message$ReventlessCore.variantNameOfJson(commandJson),
112
- timestamp: Message$ReventlessCore.nowAsISOString()
113
- });
114
- }
115
- let message = Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message);
116
- let reason = message !== undefined ? message : Stdlib_Option.getOr(JSON.stringify(err), "unknown error");
117
- return Plugin_ResolverError$ReventlessCore.throwCallerFault(`Error: Couldn't decode ` + JSON.stringify(commandJson) + `: ` + reason);
62
+ function makeGenerateCommand(publishJsons, publishJsonsAndWait, serviceName, commandSchema, componentKind, stripIdFromParamsOpt, partitionTag) {
63
+ let stripIdFromParams = stripIdFromParamsOpt !== undefined ? stripIdFromParamsOpt : true;
64
+ return payload => Effect.flatMap(Effect.tap(Effect.sync(() => {
65
+ let msgId = Message$ReventlessCore.uuid();
66
+ let meta_time = Message$ReventlessCore.nowAsISOString();
67
+ let meta_ip = Stdlib_Option.getOr(payload.meta.ip.shift(), "");
68
+ let meta_user = payload.meta.user;
69
+ let meta = {
70
+ service: serviceName,
71
+ time: meta_time,
72
+ ip: meta_ip,
73
+ user: meta_user,
74
+ msgId: msgId,
75
+ correlationId: msgId
76
+ };
77
+ let obj = Stdlib_Option.flatMap(JSON.stringify(payload.arguments), jsonString => Stdlib_JSON.Decode.object(JSON.parse(jsonString)));
78
+ let params = obj !== undefined ? (stripIdFromParams ? Stdlib_Dict.$$delete(obj, "id") : undefined, dropNullArguments(obj), stampOwnerFields(obj, commandSchema, payload.command, payload.identity, serviceName), Object.entries(obj)) : Stdlib_JsError.throwWithMessage("Couldn't decode:" + Stdlib_Option.getOr(JSON.stringify(payload.arguments), "<payload.arguments>"));
79
+ let commandStr = payload.command;
80
+ let match = params.length;
81
+ let commandJson = match !== 0 ? Object.fromEntries([[
82
+ "TAG",
83
+ commandStr
84
+ ]].concat(params)) : commandStr;
85
+ let suppliedId = payload.arguments.id;
86
+ let id;
87
+ id = componentKind === "Aggregate" || !(suppliedId == null) ? suppliedId : Stdlib_Option.mapOr(partitionTag, "", pt => DcbTag$Reventless.partitionValueOfTags(DcbTag$Reventless.extractTagsFromJson(commandSchema, commandJson), pt));
88
+ return [
89
+ meta,
90
+ commandJson,
91
+ id
92
+ ];
93
+ }), param => {
94
+ let commandJson = param[1];
95
+ return EffectLogger$ReventlessCore.logInfo(`CommandGenerator(` + serviceName + `)`, commandJson, `generated command: ` + LogFormat$ReventlessCore.cmdLabelOfJson(commandJson));
96
+ }), param => {
97
+ let id = param[2];
98
+ let commandJson = param[1];
99
+ let meta = param[0];
100
+ let val;
101
+ try {
102
+ val = Message$ReventlessCore.decode(commandJson, commandSchema);
103
+ } catch (raw_err) {
104
+ let err = Primitive_exceptions.internalToException(raw_err);
105
+ let hook = Plugin_ResolverError$ReventlessCore.onResolverErrorHook.contents;
106
+ if (hook !== undefined) {
107
+ hook({
108
+ pluginName: "",
109
+ componentName: serviceName,
110
+ attemptedCommandType: Message$ReventlessCore.variantNameOfJson(commandJson),
111
+ timestamp: Message$ReventlessCore.nowAsISOString()
112
+ });
118
113
  }
119
- let interceptor = commandInterceptorHook.contents;
120
- let interceptEffect = interceptor !== undefined ? Effect.promise(() => interceptor(payload.identity, serviceName, componentKind, payload.command, payload.arguments)) : Effect.succeed("Allow");
121
- return Effect.flatMap(interceptEffect, interceptResult => {
122
- if (typeof interceptResult !== "object") {
123
- if (publishJsonsAndWait !== undefined) {
124
- return Effect.map(Effect.promise(() => publishJsonsAndWait([{
125
- id: id,
126
- meta: meta,
127
- commandJson: commandJson
128
- }])), outcomes => {
129
- let payload = outcomes[0];
130
- switch (payload.TAG) {
131
- case "Accepted" :
132
- if (!Stdlib_Option.isNone(payload.entityId)) {
133
- return payload;
134
- }
135
- let newrecord = {...payload};
136
- newrecord.entityId = id;
137
- return newrecord;
138
- case "Rejected" :
139
- case "Pending" :
114
+ let message = Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message);
115
+ let reason = message !== undefined ? message : Stdlib_Option.getOr(JSON.stringify(err), "unknown error");
116
+ return Plugin_ResolverError$ReventlessCore.throwCallerFault(`Error: Couldn't decode ` + JSON.stringify(commandJson) + `: ` + reason);
117
+ }
118
+ let interceptor = commandInterceptorHook.contents;
119
+ let interceptEffect = interceptor !== undefined ? Effect.promise(() => interceptor(payload.identity, serviceName, componentKind, payload.command, payload.arguments)) : Effect.succeed("Allow");
120
+ return Effect.flatMap(interceptEffect, interceptResult => {
121
+ if (typeof interceptResult !== "object") {
122
+ if (publishJsonsAndWait !== undefined) {
123
+ return Effect.map(Effect.promise(() => publishJsonsAndWait([{
124
+ id: id,
125
+ meta: meta,
126
+ commandJson: commandJson
127
+ }])), outcomes => {
128
+ let payload = outcomes[0];
129
+ switch (payload.TAG) {
130
+ case "Accepted" :
131
+ if (!Stdlib_Option.isNone(payload.entityId)) {
140
132
  return payload;
141
- }
142
- });
143
- } else {
144
- return Effect.map(Effect.promise(() => publishJsons([{
145
- id: id,
146
- meta: meta,
147
- commandJson: commandJson
148
- }])), () => ({
149
- TAG: "Pending",
150
- msgId: meta.msgId
151
- }));
152
- }
133
+ }
134
+ let newrecord = {...payload};
135
+ newrecord.entityId = id;
136
+ return newrecord;
137
+ case "Rejected" :
138
+ case "Pending" :
139
+ return payload;
140
+ }
141
+ });
153
142
  } else {
154
- return Stdlib_JsError.throwWithMessage(interceptResult._0);
143
+ return Effect.map(Effect.promise(() => publishJsons([{
144
+ id: id,
145
+ meta: meta,
146
+ commandJson: commandJson
147
+ }])), () => ({
148
+ TAG: "Pending",
149
+ msgId: meta.msgId
150
+ }));
155
151
  }
156
- });
152
+ } else {
153
+ return Stdlib_JsError.throwWithMessage(interceptResult._0);
154
+ }
157
155
  });
158
- };
156
+ });
159
157
  }
160
158
 
161
159
  function Make(Spec) {
@@ -12,7 +12,7 @@ import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
12
12
 
13
13
  let countsStateSchema = Sury.$schema(s => ({
14
14
  id: s.m(Sury.string),
15
- count: s.m(Sury.int)
15
+ count: s.m(Sury.int32)
16
16
  }));
17
17
 
18
18
  function groupByCounterId(references) {
@@ -9,7 +9,7 @@ import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
9
9
 
10
10
  let referencesStateSchema = Sury.$schema(s => ({
11
11
  id: s.m(Sury.string),
12
- inc: s.m(Sury.int)
12
+ inc: s.m(Sury.int32)
13
13
  }));
14
14
 
15
15
  function groupCountItemsByCounterId(countItems) {
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
5
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Stream from "effect/Stream";
@@ -9,7 +9,7 @@ import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
9
9
  import * as EventCollector$ReventlessCore from "./EventCollector.res.mjs";
10
10
 
11
11
  function makeStreamHandler(eventCollector, schema, jsonEventsHandler) {
12
- let jsonHandler = stream => jsonEventsHandler(Stream.mapEffect(stream, json => Effect.trySync(_exn => "decode error", () => S.parseOrThrow(json, schema))));
12
+ let jsonHandler = stream => jsonEventsHandler(Stream.mapEffect(stream, json => Effect.trySync(_exn => "decode error", () => Sury.parseOrThrow(json, schema))));
13
13
  let channel = eventCollector.channel;
14
14
  return channel.handleChannelEvent(jsonHandler);
15
15
  }
@@ -61,4 +61,4 @@ export {
61
61
  makeStreamHandler,
62
62
  Make,
63
63
  }
64
- /* S Not a pure module */
64
+ /* sury Not a pure module */
@@ -1,6 +1,5 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
4
3
  import * as Sury from "sury";
5
4
  import * as Uuid from "uuid";
6
5
  import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
@@ -20,7 +19,7 @@ let auditRowSchema = Sury.$schema(s => ({
20
19
  input: s.m(Sury.string),
21
20
  status: s.m(auditStatusSchema),
22
21
  targetIds: s.m(Sury.$option(Sury.array(Sury.string))),
23
- commandCount: s.m(Sury.$option(Sury.int)),
22
+ commandCount: s.m(Sury.$option(Sury.int32)),
24
23
  error: s.m(Sury.$option(Sury.string)),
25
24
  receivedAt: s.m(Sury.string)
26
25
  }));
@@ -75,7 +74,7 @@ function Make(Spec) {
75
74
  try {
76
75
  input = {
77
76
  TAG: "Ok",
78
- _0: S.parseOrThrow(inputJson, Spec.externalInputSchema)
77
+ _0: Sury.parseOrThrow(inputJson, Spec.externalInputSchema)
79
78
  };
80
79
  } catch (raw_exn) {
81
80
  let exn = Primitive_exceptions.internalToException(raw_exn);
@@ -25,8 +25,8 @@ let todoRowSchema = Sury.$schema(s => ({
25
25
  createdAt: s.m(Sury.string),
26
26
  processedAt: s.m(Sury.$option(Sury.string)),
27
27
  completedAt: s.m(Sury.$option(Sury.string)),
28
- retryCount: s.m(Sury.int),
29
- maxRetries: s.m(Sury.$option(Sury.int)),
28
+ retryCount: s.m(Sury.int32),
29
+ maxRetries: s.m(Sury.$option(Sury.int32)),
30
30
  lastError: s.m(Sury.$option(Sury.string))
31
31
  }));
32
32
 
@@ -37,8 +37,8 @@ function todoRowSchemaFor(itemSchema) {
37
37
  createdAt: s.m(Sury.string),
38
38
  processedAt: s.m(Sury.$option(Sury.string)),
39
39
  completedAt: s.m(Sury.$option(Sury.string)),
40
- retryCount: s.m(Sury.int),
41
- maxRetries: s.m(Sury.$option(Sury.int)),
40
+ retryCount: s.m(Sury.int32),
41
+ maxRetries: s.m(Sury.$option(Sury.int32)),
42
42
  lastError: s.m(Sury.$option(Sury.string))
43
43
  }));
44
44
  }
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
5
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Pulumi from "@pulumi/pulumi";
@@ -461,7 +461,7 @@ function Make(Spec) {
461
461
  let extensionPointsOutputs = match$1[0];
462
462
  let coreSetup;
463
463
  if (interstackAdminExtensionPoints !== undefined) {
464
- let pluginExtensionPointUnwrapped = S.parseOrThrow(StackReference$Pulumi.get(interstackAdminExtensionPoints, PluginExtensionPointSpec$ReventlessInfra.name), ExtensionPoint$ReventlessInterop.resolvedOutputsSchema);
464
+ let pluginExtensionPointUnwrapped = Sury.parseOrThrow(StackReference$Pulumi.get(interstackAdminExtensionPoints, PluginExtensionPointSpec$ReventlessInfra.name), ExtensionPoint$ReventlessInterop.resolvedOutputsSchema);
465
465
  let pluginExtensionPointCommandTopicRemoteChannel = PluginExtensionPointRemoteChannel.make(pluginExtensionPointUnwrapped.commandTopic.resources.map(Adapter$ReventlessCore.fromInteropResolved));
466
466
  coreSetup = [
467
467
  pluginExtensionPointUnwrapped,
@@ -671,4 +671,4 @@ export {
671
671
  PluginExtensionPointSpec,
672
672
  Make,
673
673
  }
674
- /* S Not a pure module */
674
+ /* sury Not a pure module */
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
5
5
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
6
6
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
@@ -79,7 +79,7 @@ function getRemoteStorageResources(pluginName, queryDbName) {
79
79
  return [];
80
80
  }
81
81
  try {
82
- let readModel = S.parseOrThrow(rawReadModel, ReadModel$ReventlessInterop.resolvedOutputsSchema);
82
+ let readModel = Sury.parseOrThrow(rawReadModel, ReadModel$ReventlessInterop.resolvedOutputsSchema);
83
83
  return Adapter$ReventlessCore.fromInteropResources(readModel.queryDb.resources);
84
84
  } catch (raw_exn) {
85
85
  let exn = Primitive_exceptions.internalToException(raw_exn);
@@ -648,6 +648,9 @@ let identityReference = (
648
648
  // element schema.
649
649
  let extractReferences = (
650
650
  ~identityViews: option<identityViews>=?,
651
+ // The id a creating command mints. Its identity names the row the command
652
+ // brings into existence, not one it refers to, so nothing is derived for it.
653
+ ~minted: option<string>=?,
651
654
  properties: dict<S.t<unknown>>,
652
655
  ): array<Reventless.Plugin.fieldReference> =>
653
656
  properties
@@ -660,8 +663,9 @@ let extractReferences = (
660
663
  // nesting and the other not.
661
664
  let declared = Reventless.Reference.collectFieldTargets(fieldName, fieldSchema)
662
665
  let targets = switch identityViews {
663
- | Some(views) => identityReference(views, ~fieldName, fieldSchema, declared)
664
- | None => declared
666
+ | Some(views) if minted != Some(fieldName) =>
667
+ identityReference(views, ~fieldName, fieldSchema, declared)
668
+ | _ => declared
665
669
  }
666
670
  targets->Array.map(((path, target)): Reventless.Plugin.fieldReference => {
667
671
  Reventless.Plugin.fieldName: path,
@@ -849,7 +853,6 @@ let toCommandDef = (
849
853
  ~variantName,
850
854
  properties,
851
855
  )
852
- let references = extractReferences(~identityViews?, properties)
853
856
  // Evaluated against a synthetic value per constructor, the same shape the
854
857
  // resolver builds at call time: a payload-bearing variant compiles to
855
858
  // `{TAG, ...}`, a payload-less one to a bare string.
@@ -913,6 +916,11 @@ let toCommandDef = (
913
916
  | None => Reventless.Transition.targetState(declared)
914
917
  }
915
918
  let level = derived->Option.flatMap(d => d.level)->Option.getOr(guessedLevel)
919
+ let references = extractReferences(
920
+ ~identityViews?,
921
+ ~minted=?level == Reventless.Plugin.Collection ? aggregateIdField : None,
922
+ properties,
923
+ )
916
924
  // API-exposed iff the whole command isn't @noApi and this variant
917
925
  // isn't in its @noApi-variants set — mirrors the API-generation filter
918
926
  // (Plugin_Helpers / PluginBaseFragment). Drives the event-graph API badge.
@@ -481,12 +481,12 @@ function identityReference(identityViews, fieldName, fieldSchema, declared) {
481
481
  ]];
482
482
  }
483
483
 
484
- function extractReferences(identityViews, properties) {
484
+ function extractReferences(identityViews, minted, properties) {
485
485
  return Object.entries(properties).flatMap(param => {
486
486
  let fieldSchema = param[1];
487
487
  let fieldName = param[0];
488
488
  let declared = Reference$Reventless.collectFieldTargets(fieldName, fieldSchema);
489
- let targets = identityViews !== undefined ? identityReference(identityViews, fieldName, fieldSchema, declared) : declared;
489
+ let targets = identityViews !== undefined && Primitive_object.notequal(minted, fieldName) ? identityReference(identityViews, fieldName, fieldSchema, declared) : declared;
490
490
  return targets.map(param => {
491
491
  let target = param[1];
492
492
  return {
@@ -500,7 +500,7 @@ function extractReferences(identityViews, properties) {
500
500
 
501
501
  function toEventDef(identityViews, v) {
502
502
  let mkDef = (variantName, properties) => {
503
- let references = extractReferences(identityViews, properties);
503
+ let references = extractReferences(identityViews, undefined, properties);
504
504
  return {
505
505
  name: variantName,
506
506
  schema: JSON.stringify(SuryToJsonSchema$ReventlessCore.deriveObjectSchema(undefined, undefined, v)),
@@ -643,7 +643,7 @@ function annotateArgTypes(schema, argTypes) {
643
643
  function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, parentSchema, commandAuthorization, commandTransition, derivedEdgeFor, v) {
644
644
  let mkDef = (variantName, properties) => {
645
645
  let match = commandLevelAndId(isAggregate, partitionKey, variantName, properties);
646
- let references = extractReferences(identityViews, properties);
646
+ let aggregateIdField = match[1];
647
647
  let syntheticCommand = DcbTag$Reventless.isVariantPayloadBearing(parentSchema, variantName) ? ({
648
648
  TAG: variantName
649
649
  }) : variantName;
@@ -678,6 +678,7 @@ function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor
678
678
  });
679
679
  let targetState = observed !== undefined ? observed : Transition$Reventless.targetState(declared);
680
680
  let level = Stdlib_Option.getOr(Stdlib_Option.flatMap(derived, d => d.level), match[0]);
681
+ let references = extractReferences(identityViews, level === "Collection" ? aggregateIdField : undefined, properties);
681
682
  let apiExposed = false;
682
683
  if (!ApiNoApiHelpers$ReventlessCore.isNoApi(parentSchema)) {
683
684
  let excluded = ApiNoApiHelpers$ReventlessCore.getExcludedVariants(parentSchema);
@@ -691,7 +692,7 @@ function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor
691
692
  name: variantName,
692
693
  schema: JSON.stringify(annotatedSchema),
693
694
  level: level,
694
- aggregateIdField: match[1],
695
+ aggregateIdField: aggregateIdField,
695
696
  mutationField: mutationField,
696
697
  references: references,
697
698
  allowedStates: match$3[0],
@@ -20,7 +20,7 @@ let knownVersionSchema = Sury.$schema(s => ({
20
20
 
21
21
  let stateSchema = Sury.$schema(s => ({
22
22
  current: s.m(Sury.$option(Plugin$Reventless.versionSchema)),
23
- known: s.m(Sury.dict(knownVersionSchema))
23
+ known: s.m(Sury.record(knownVersionSchema))
24
24
  }));
25
25
 
26
26
  let initialState_known = {};
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
5
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Pulumi from "@pulumi/pulumi";
@@ -25,7 +25,7 @@ function fromJson(json) {
25
25
  try {
26
26
  return {
27
27
  TAG: "Ok",
28
- _0: S.parseOrThrow(json, Task$ReventlessInterop.resolvedOutputsSchema)
28
+ _0: Sury.parseOrThrow(json, Task$ReventlessInterop.resolvedOutputsSchema)
29
29
  };
30
30
  } catch (raw_exn) {
31
31
  let exn = Primitive_exceptions.internalToException(raw_exn);
@@ -54,7 +54,7 @@ function fromJson$1(json) {
54
54
  try {
55
55
  return {
56
56
  TAG: "Ok",
57
- _0: S.parseOrThrow(json, EventMapper$ReventlessInterop.resolvedOutputsSchema)
57
+ _0: Sury.parseOrThrow(json, EventMapper$ReventlessInterop.resolvedOutputsSchema)
58
58
  };
59
59
  } catch (raw_exn) {
60
60
  let exn = Primitive_exceptions.internalToException(raw_exn);
@@ -88,7 +88,7 @@ function fromJson$2(json) {
88
88
  try {
89
89
  return {
90
90
  TAG: "Ok",
91
- _0: S.parseOrThrow(json, ExtensionPoint$ReventlessInterop.resolvedOutputsSchema)
91
+ _0: Sury.parseOrThrow(json, ExtensionPoint$ReventlessInterop.resolvedOutputsSchema)
92
92
  };
93
93
  } catch (raw_exn) {
94
94
  let exn = Primitive_exceptions.internalToException(raw_exn);
@@ -25,7 +25,7 @@ let eventSchema = Sury.union([
25
25
  })),
26
26
  Sury.$schema(s => ({
27
27
  TAG: "CheckpointTaken",
28
- count: s.m(Sury.int)
28
+ count: s.m(Sury.int32)
29
29
  }))
30
30
  ]);
31
31
 
@@ -1,6 +1,5 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
4
3
  import * as Sury from "sury";
5
4
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
5
  import * as Owner$Reventless from "@reventlessdev/reventless-spec/src/components/Owner.res.mjs";
@@ -28,7 +27,7 @@ globalThis.describe("a field marker on a branded semantic:", () => {
28
27
  return false;
29
28
  }
30
29
  try {
31
- S.parseOrThrow(raw, schema);
30
+ Sury.parseOrThrow(raw, schema);
32
31
  return true;
33
32
  } catch (exn) {
34
33
  return false;
@@ -54,7 +53,7 @@ globalThis.describe("a field marker on a branded semantic:", () => {
54
53
  return false;
55
54
  }
56
55
  try {
57
- S.parseOrThrow(raw, schema);
56
+ Sury.parseOrThrow(raw, schema);
58
57
  return true;
59
58
  } catch (exn) {
60
59
  return false;
@@ -1,6 +1,5 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
4
3
  import * as Sury from "sury";
5
4
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
5
  import * as Semantic$Reventless from "@reventlessdev/reventless-spec/src/semantic/Semantic.res.mjs";
@@ -89,7 +88,7 @@ globalThis.describe("a row in the pre-union shape does not decode", () => {
89
88
  globalThis.test("the three-field shape is refused against the union schema", () => {
90
89
  let decodes;
91
90
  try {
92
- S.parseOrThrow(oldShapedRow, stateSchema);
91
+ Sury.parseOrThrow(oldShapedRow, stateSchema);
93
92
  decodes = true;
94
93
  } catch (exn) {
95
94
  decodes = false;