@reventlessdev/reventless-core 3.0.0-alpha.176 → 3.0.0-alpha.178

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,28 @@
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.178 (2026-07-22)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **core:** derive the disconnect schedule's rule name in one place ([6324a5b](https://github.com/ReventlessDev/reventless-core/commit/6324a5bc678a375688ec98571423f164b09375ae))
11
+
12
+
13
+ # 3.0.0-alpha.177 (2026-07-22)
14
+
15
+ * refactor!: retire the stale "Admin" vocabulary for platform-owned resources ([2770bd9](https://github.com/ReventlessDev/reventless-core/commit/2770bd96f309142bdfc65b9f36bd1a3ef60641bd))
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * platform-owned resources are renamed Admin* -> Platform*
20
+ (PlatformDcbEventLog, PlatformDcbCmdTopic, PlatformEventColl). This replaces
21
+ a DynamoDB table, an SQS queue and an SNS topic — wipe and redeploy rather
22
+ than migrate. Both alpha AdminDcbEventLog tables held 0 items at the time of
23
+ the rename. MCP resource URI templates change from Admin/<field>/{id} to
24
+ Platform/<field>/{id}; MCP tool names are unaffected.
25
+
26
+
27
+
6
28
  # 3.0.0-alpha.176 (2026-07-22)
7
29
 
8
30
  * refactor!: retire the stale "core" vocabulary for platform things ([34e7480](https://github.com/ReventlessDev/reventless-core/commit/34e7480992bd58906a250b0a1ce6ff2c5ba45260))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.176",
3
+ "version": "3.0.0-alpha.178",
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.30",
32
32
  "@reventlessdev/rescript-fast-csv": "1.2.0-alpha.14",
33
- "@reventlessdev/rescript-jest": "1.0.0-alpha.9",
34
33
  "@reventlessdev/rescript-hash-object": "1.2.0-alpha.13",
34
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.9",
35
35
  "@reventlessdev/rescript-node-streams": "1.1.0-alpha.13",
36
- "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.17",
37
36
  "@reventlessdev/rescript-ssh2": "1.1.0-alpha.14",
38
- "@reventlessdev/reventless-infra": "3.0.0-alpha.104",
37
+ "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.17",
38
+ "@reventlessdev/rescript-uuid": "1.1.0-alpha.17",
39
39
  "@reventlessdev/reventless-interop": "3.0.0-alpha.29",
40
- "@reventlessdev/reventless-spec": "3.0.0-alpha.80",
41
- "@reventlessdev/rescript-uuid": "1.1.0-alpha.17"
40
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.104",
41
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.80"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rescript": "12.3.0",
@@ -35,7 +35,7 @@ module Make = (
35
35
  with type runtimeParts = RuntimeEnvironment.parts,
36
36
  QueryEngineAdapter: QueryDb_Adapter.QueryEngineAdapter,
37
37
  ClonerRunner: Cloner.Adapter.Runner,
38
- AdminRuntimeBuilder: PluginRuntime_Builder.T
38
+ PlatformRuntimeBuilder: PluginRuntime_Builder.T
39
39
  with module EventCollectorChannel = EventCollectorChannel
40
40
  and type runtimeParts = RuntimeEnvironment.parts,
41
41
  DcbEventLogStorage: DcbEventLog_Adapter.Storage,
@@ -51,9 +51,9 @@ module Make = (
51
51
  ECC: EventCollector_Adapter.Channel with type runtimeParts = RE.parts,
52
52
  RB: PluginRuntime_Builder.T with module EventCollectorChannel = ECC,
53
53
  ) => {
54
- module AdminEventCollector = EventCollector_Builder.Make(RE, ECC)
54
+ module PlatformEventCollector = EventCollector_Builder.Make(RE, ECC)
55
55
  let make = (~name, ~eventTopics, ~opts) => {
56
- let eventCollector = AdminEventCollector.make(~name, ~eventTopics, ~owner={kind: ComponentType.Plugin, name}, ~opts)
56
+ let eventCollector = PlatformEventCollector.make(~name, ~eventTopics, ~owner={kind: ComponentType.Plugin, name}, ~opts)
57
57
  let eventCollectorOutputs = eventCollector->Component.outputs
58
58
  (eventCollector, eventCollectorOutputs)
59
59
  }
@@ -76,8 +76,8 @@ module Make = (
76
76
 
77
77
  resources->Pulumi.Output.apply(resources => {
78
78
  let fakePluginDefinition: Reventless.Plugin.pluginDefinition = {
79
- id: "Admin@INTERNAL",
80
- name: "Admin",
79
+ id: Platform_Admin_Structure.pluginId ++ "@INTERNAL",
80
+ name: Platform_Admin_Structure.pluginId,
81
81
  version: "INTERNAL",
82
82
  extensionPoints: [],
83
83
  extensions: [],
@@ -90,11 +90,11 @@ module Make = (
90
90
  kind: Domain,
91
91
  }
92
92
 
93
- module Callback = Admin_Callback.Make({
93
+ module Callback = Platform_Admin_Callback.Make({
94
94
  let pluginDefinition = fakePluginDefinition
95
95
  let outgoingExtensionPointJsonEventsHandlers = extensionPointsOutgoingJsonEventsHandlers
96
96
  })
97
- let handler = AdminEventCollector.makeHandler(
97
+ let handler = PlatformEventCollector.makeHandler(
98
98
  ~eventCollector,
99
99
  ~jsonEventsHandler=Callback.handleJsonEvents,
100
100
  )
@@ -120,7 +120,9 @@ module Make = (
120
120
  ~outboundTranslationSlices: array<module(ReventlessInfra.OutboundTranslationSlice.T)>,
121
121
  ~inboundTranslationSlices: array<module(ReventlessInfra.InboundTranslationSlice.T)>,
122
122
  ) => {
123
- let name = "Admin"
123
+ // Names every platform-owned resource — the DCB substrate via DcbBuilder and the
124
+ // EventCollector below. Bound to pluginId so the two can't drift apart again.
125
+ let name = Platform_Admin_Structure.pluginId
124
126
  let opts: Pulumi.ComponentResource.options = {}
125
127
 
126
128
  // Construct DCB components and derive DCB-specific API schema entries
@@ -129,7 +131,7 @@ module Make = (
129
131
  DcbEventTopicPublisher,
130
132
  DcbCommandTopicChannel,
131
133
  DcbCommandTopicChannelAsync,
132
- AdminRuntimeBuilder,
134
+ PlatformRuntimeBuilder,
133
135
  Config,
134
136
  )
135
137
  // Aggregates constructed early so multi-source AutomationSlices created
@@ -142,15 +144,15 @@ module Make = (
142
144
  // `mutationResolverHook` and populate `aggregateMutationFieldsRegistry`.
143
145
  // The matching SDL entries are owned by
144
146
  // `PluginBaseFragment.pluginAggregateMutationEntries` (picked up via
145
- // `AdminApi.mutationEntries`) so the AWS path that pushes
146
- // `AdminApi.baseFragment` directly stays aligned with the in-memory path.
147
+ // `Platform_AdminApi.mutationEntries`) so the AWS path that pushes
148
+ // `Platform_AdminApi.baseFragment` directly stays aligned with the in-memory path.
147
149
  aggregates->Plugin_Helpers.registerAdminAggregateMutations(~hooks=Config.hooks)
148
150
 
149
151
  let dcbResult = DcbBuilder.construct(
150
152
  ~name,
151
153
  ~childName=name,
152
154
  // Admin slice command mutations render `Platform_*` (not `Admin_*`), byte-aligned with the
153
- // hand-declared admin SDL (`AdminApi.baseFragment`, via `Api_Naming.adminField`) so the
155
+ // hand-declared admin SDL (`Platform_AdminApi.baseFragment`, via `Api_Naming.adminField`) so the
154
156
  // auto-bound DCB resolver targets the exact field name that is pushed to the schema.
155
157
  ~apiNamePrefix="Platform",
156
158
  // Admin DCB mutation resolvers bind to the Platform API (split mode), not the deploy-target
@@ -178,13 +180,13 @@ module Make = (
178
180
  | None => ()
179
181
  }
180
182
 
181
- // Admin schema — composed from actual config. `AdminApi.mutationEntries`
183
+ // Admin schema — composed from actual config. `Platform_AdminApi.mutationEntries`
182
184
  // already includes the auto-derived `Platform_Plugin_Activate`/`Deactivate`
183
185
  // entries (via `PluginBaseFragment.pluginAggregateMutationEntries`) so the
184
186
  // SDL stays in sync with the resolver wiring fired above.
185
- let adminMutationEntries = AdminApi.mutationEntries(~cloner=Config.cloner)
187
+ let adminMutationEntries = Platform_AdminApi.mutationEntries(~cloner=Config.cloner)
186
188
  let allMutationEntries = Array.concat(adminMutationEntries, dcbResult.mutationEntries)
187
- let allQueryEntries = Array.concat(AdminApi.queryEntries, dcbResult.queryEntries)
189
+ let allQueryEntries = Array.concat(Platform_AdminApi.queryEntries, dcbResult.queryEntries)
188
190
  let adminFragment = GraphQL_FragmentGenerator.generate(
189
191
  ~mutationEntries=allMutationEntries,
190
192
  ~queryEntries=allQueryEntries,
@@ -202,7 +204,7 @@ module Make = (
202
204
  switch Config.hooks.mcpSchemaRegistrationHook {
203
205
  | Some(registerMcp) =>
204
206
  registerMcp({
205
- pluginName: "Admin",
207
+ pluginName: name,
206
208
  mutationEntries: allMutationEntries,
207
209
  queryEntries: allQueryEntries,
208
210
  eventLogEntries: dcbResult.eventLogEntries,
@@ -227,7 +229,7 @@ module Make = (
227
229
  // match the `Platform_Plugin`/`Platform_Plugins` SDL fields declared by
228
230
  // PluginBaseFragment.queryEntries — leaving the SDL fields without a
229
231
  // resolver and producing "Cannot return null for non-nullable type" errors.
230
- AdminApi.queryEntries->Array.forEach(entry => {
232
+ Platform_AdminApi.queryEntries->Array.forEach(entry => {
231
233
  let prefix = "Platform_"
232
234
  let entityName = if entry.returnTypeName->String.startsWith(prefix) {
233
235
  entry.returnTypeName->String.slice(
@@ -278,7 +280,7 @@ module Make = (
278
280
  //
279
281
  // BUT skip the StateViewSlice merge on a static-schema-push platform (AWS, where
280
282
  // preAdminResolversSchemaHook is Some): there the pushed schema is the static
281
- // AdminApi.baseFragment, which does NOT declare the auto `<prefix>_<Slice>` query
283
+ // Platform_AdminApi.baseFragment, which does NOT declare the auto `<prefix>_<Slice>` query
282
284
  // fields — so creating their resolvers would fail CreateResolver with
283
285
  // "No field named Admin_<Slice> on type Query". The admin StateView slices are
284
286
  // internal registries whose real query surface is served by dedicated Lambda
@@ -401,7 +403,7 @@ module Make = (
401
403
  module EventCollectorHelper = MakeEventCollectorHelper(
402
404
  RuntimeEnvironment,
403
405
  EventCollectorChannel,
404
- AdminRuntimeBuilder,
406
+ PlatformRuntimeBuilder,
405
407
  )
406
408
  let (eventCollector, _eventCollectorOutputs) = EventCollectorHelper.make(
407
409
  ~name,
@@ -6,25 +6,26 @@ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Pulumi from "@pulumi/pulumi";
7
7
  import * as Belt_SetString from "@rescript/runtime/lib/es6/Belt_SetString.js";
8
8
  import * as Cloner$ReventlessCore from "../components/Cloner.res.mjs";
9
- import * as AdminApi$ReventlessCore from "./AdminApi.res.mjs";
10
9
  import * as Aggregate$ReventlessCore from "../components/Aggregate/Aggregate.res.mjs";
11
10
  import * as Component$ReventlessCore from "../components/Component.res.mjs";
12
11
  import * as ReadModel$ReventlessCore from "../components/ReadModel/ReadModel.res.mjs";
13
12
  import * as Dcb_Builder$ReventlessCore from "../components/Dcb/Dcb_Builder.res.mjs";
14
- import * as Admin_Callback$ReventlessCore from "./Admin_Callback.res.mjs";
15
13
  import * as Plugin_Helpers$ReventlessCore from "../plugin/component/Plugin_Helpers.res.mjs";
16
14
  import * as Builder_Helpers$ReventlessCore from "../components/Builder_Helpers.res.mjs";
17
15
  import * as GraphQL_Stitcher$ReventlessCore from "../components/Api/GraphQL_Stitcher.res.mjs";
18
16
  import * as Plugin_Structure$ReventlessCore from "../plugin/component/Plugin_Structure.res.mjs";
17
+ import * as Platform_AdminApi$ReventlessCore from "./Platform_AdminApi.res.mjs";
19
18
  import * as EventCollector_Builder$ReventlessCore from "../components/EventCollector/EventCollector_Builder.res.mjs";
19
+ import * as Platform_Admin_Callback$ReventlessCore from "./Platform_Admin_Callback.res.mjs";
20
+ import * as Platform_Admin_Structure$ReventlessCore from "./Platform_Admin_Structure.res.mjs";
20
21
  import * as GraphQL_FragmentGenerator$ReventlessCore from "../components/Api/GraphQL_FragmentGenerator.res.mjs";
21
22
 
22
23
  function Make(RuntimeEnvironment) {
23
- return EventCollectorChannel => (QueryEngineAdapter => (ClonerRunner => (AdminRuntimeBuilder => (DcbEventLogStorage => (DcbEventTopicPublisher => (DcbCommandTopicChannel => (DcbCommandTopicChannelAsync => (Config => {
24
+ return EventCollectorChannel => (QueryEngineAdapter => (ClonerRunner => (PlatformRuntimeBuilder => (DcbEventLogStorage => (DcbEventTopicPublisher => (DcbCommandTopicChannel => (DcbCommandTopicChannelAsync => (Config => {
24
25
  let MakeEventCollectorHelper = RE => (ECC => (RB => {
25
- let AdminEventCollector = EventCollector_Builder$ReventlessCore.Make(RE)(ECC);
26
+ let PlatformEventCollector = EventCollector_Builder$ReventlessCore.Make(RE)(ECC);
26
27
  let make = (name, eventTopics, opts) => {
27
- let eventCollector = AdminEventCollector.make(name, eventTopics, {
28
+ let eventCollector = PlatformEventCollector.make(name, eventTopics, {
28
29
  kind: "Plugin",
29
30
  name: name
30
31
  }, opts);
@@ -38,8 +39,8 @@ function Make(RuntimeEnvironment) {
38
39
  let resources = Pulumi.all(extensionPointsOutputs.map(extensionPoint => extensionPoint.eventTopic)).apply(eventTopics => eventTopics.map(eventTopic => eventTopic.resources).flat());
39
40
  return resources.apply(resources => {
40
41
  let fakePluginDefinition = {
41
- id: "Admin@INTERNAL",
42
- name: "Admin",
42
+ id: Platform_Admin_Structure$ReventlessCore.pluginId + "@INTERNAL",
43
+ name: Platform_Admin_Structure$ReventlessCore.pluginId,
43
44
  version: "INTERNAL",
44
45
  extensionPoints: [],
45
46
  extensions: [],
@@ -51,39 +52,38 @@ function Make(RuntimeEnvironment) {
51
52
  dcbEventLog: undefined,
52
53
  kind: "Domain"
53
54
  };
54
- let Callback = Admin_Callback$ReventlessCore.Make({
55
+ let Callback = Platform_Admin_Callback$ReventlessCore.Make({
55
56
  pluginDefinition: fakePluginDefinition,
56
57
  outgoingExtensionPointJsonEventsHandlers: extensionPointsOutgoingJsonEventsHandlers
57
58
  });
58
- let handler = AdminEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
59
+ let handler = PlatformEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
59
60
  RB.forPluginEventCollector(handler, eventTopics, resources, undefined, undefined, eventCollector);
60
61
  });
61
62
  };
62
63
  return {
63
- AdminEventCollector: AdminEventCollector,
64
+ PlatformEventCollector: PlatformEventCollector,
64
65
  make: make,
65
66
  connect: connect
66
67
  };
67
68
  }));
68
69
  let construct = (param, extensionPoints, aggregates, readModels, scheduler, resourceNaming, api, apiRole, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices) => {
69
- let name = "Admin";
70
70
  let opts = {};
71
- let DcbBuilder = Dcb_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher)(DcbCommandTopicChannel)(DcbCommandTopicChannelAsync)(AdminRuntimeBuilder)({
71
+ let DcbBuilder = Dcb_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher)(DcbCommandTopicChannel)(DcbCommandTopicChannelAsync)(PlatformRuntimeBuilder)({
72
72
  hooks: Config.hooks
73
73
  });
74
74
  let aggregatesWithoutEventMappers = Builder_Helpers$ReventlessCore.createAggregatesWithoutEventMappers(aggregates, api, {}, opts);
75
75
  let aggregateEventTopics = Aggregate$ReventlessCore.allEventTopics(aggregatesWithoutEventMappers);
76
76
  Plugin_Helpers$ReventlessCore.registerAdminAggregateMutations(aggregates, Config.hooks);
77
- let dcbResult = DcbBuilder.construct(name, name, "Platform", true, undefined, undefined, aggregateEventTopics, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, undefined, undefined, undefined, opts);
77
+ let dcbResult = DcbBuilder.construct(Platform_Admin_Structure$ReventlessCore.pluginId, Platform_Admin_Structure$ReventlessCore.pluginId, "Platform", true, undefined, undefined, aggregateEventTopics, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, undefined, undefined, undefined, opts);
78
78
  let slicePublishJsons = dcbResult.dcbPublishJsons;
79
79
  if (slicePublishJsons !== undefined) {
80
80
  stateChangeSlices.forEach(Sc => {
81
81
  Builder_Helpers$ReventlessCore.publishToAggregates[Sc.Spec.name] = slicePublishJsons;
82
82
  });
83
83
  }
84
- let adminMutationEntries = AdminApi$ReventlessCore.mutationEntries(Config.cloner);
84
+ let adminMutationEntries = Platform_AdminApi$ReventlessCore.mutationEntries(Config.cloner);
85
85
  let allMutationEntries = adminMutationEntries.concat(dcbResult.mutationEntries);
86
- let allQueryEntries = AdminApi$ReventlessCore.queryEntries.concat(dcbResult.queryEntries);
86
+ let allQueryEntries = Platform_AdminApi$ReventlessCore.queryEntries.concat(dcbResult.queryEntries);
87
87
  let adminFragment = GraphQL_FragmentGenerator$ReventlessCore.generate(allMutationEntries, allQueryEntries);
88
88
  if (dcbResult.mutationEntries.length !== 0 || dcbResult.queryEntries.length !== 0) {
89
89
  let registerTypes = Config.hooks.schemaTypeRegistrationHook;
@@ -94,7 +94,7 @@ function Make(RuntimeEnvironment) {
94
94
  let registerMcp = Config.hooks.mcpSchemaRegistrationHook;
95
95
  if (registerMcp !== undefined) {
96
96
  registerMcp({
97
- pluginName: "Admin",
97
+ pluginName: Platform_Admin_Structure$ReventlessCore.pluginId,
98
98
  mutationEntries: allMutationEntries,
99
99
  queryEntries: allQueryEntries,
100
100
  eventLogEntries: dcbResult.eventLogEntries,
@@ -104,9 +104,9 @@ function Make(RuntimeEnvironment) {
104
104
  }
105
105
  let dcbOutputs = dcbResult.dcbEventLogOutputs;
106
106
  if (dcbOutputs !== undefined) {
107
- aggregateEventTopics[name + "DcbEventLog"] = dcbOutputs.eventTopic;
107
+ aggregateEventTopics[Platform_Admin_Structure$ReventlessCore.pluginId + "DcbEventLog"] = dcbOutputs.eventTopic;
108
108
  }
109
- AdminApi$ReventlessCore.queryEntries.forEach(entry => {
109
+ Platform_AdminApi$ReventlessCore.queryEntries.forEach(entry => {
110
110
  let prefix = "Platform_";
111
111
  let entityName = entry.returnTypeName.startsWith(prefix) ? entry.returnTypeName.slice(prefix.length, entry.returnTypeName.length) : entry.returnTypeName;
112
112
  let registryKey = Stdlib_Option.getOr(entry.specName, entityName);
@@ -175,9 +175,9 @@ function Make(RuntimeEnvironment) {
175
175
  let aggregateNames = Stdlib_Array.reduce(extensionPointsOutputs.map(extensionPointOutputs => Belt_SetString.fromArray(extensionPointOutputs.aggregateNames)), undefined, Belt_SetString.union);
176
176
  let aggregatesOutputs = Builder_Helpers$ReventlessCore.addEventMappers(aggregateEventTopics, queryEngine);
177
177
  let eventTopics = Aggregate$ReventlessCore.filterEventTopics(aggregatesOutputs, aggregateNames);
178
- let AdminEventCollector = EventCollector_Builder$ReventlessCore.Make(RuntimeEnvironment)(EventCollectorChannel);
178
+ let PlatformEventCollector = EventCollector_Builder$ReventlessCore.Make(RuntimeEnvironment)(EventCollectorChannel);
179
179
  let make = (name, eventTopics, opts) => {
180
- let eventCollector = AdminEventCollector.make(name, eventTopics, {
180
+ let eventCollector = PlatformEventCollector.make(name, eventTopics, {
181
181
  kind: "Plugin",
182
182
  name: name
183
183
  }, opts);
@@ -191,8 +191,8 @@ function Make(RuntimeEnvironment) {
191
191
  let resources = Pulumi.all(extensionPointsOutputs.map(extensionPoint => extensionPoint.eventTopic)).apply(eventTopics => eventTopics.map(eventTopic => eventTopic.resources).flat());
192
192
  return resources.apply(resources => {
193
193
  let fakePluginDefinition = {
194
- id: "Admin@INTERNAL",
195
- name: "Admin",
194
+ id: Platform_Admin_Structure$ReventlessCore.pluginId + "@INTERNAL",
195
+ name: Platform_Admin_Structure$ReventlessCore.pluginId,
196
196
  version: "INTERNAL",
197
197
  extensionPoints: [],
198
198
  extensions: [],
@@ -204,15 +204,15 @@ function Make(RuntimeEnvironment) {
204
204
  dcbEventLog: undefined,
205
205
  kind: "Domain"
206
206
  };
207
- let Callback = Admin_Callback$ReventlessCore.Make({
207
+ let Callback = Platform_Admin_Callback$ReventlessCore.Make({
208
208
  pluginDefinition: fakePluginDefinition,
209
209
  outgoingExtensionPointJsonEventsHandlers: extensionPointsOutgoingJsonEventsHandlers
210
210
  });
211
- let handler = AdminEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
212
- AdminRuntimeBuilder.forPluginEventCollector(handler, eventTopics, resources, undefined, undefined, eventCollector);
211
+ let handler = PlatformEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
212
+ PlatformRuntimeBuilder.forPluginEventCollector(handler, eventTopics, resources, undefined, undefined, eventCollector);
213
213
  });
214
214
  };
215
- let match$1 = make(name, eventTopics, opts);
215
+ let match$1 = make(Platform_Admin_Structure$ReventlessCore.pluginId, eventTopics, opts);
216
216
  let eventCollector = match$1[0];
217
217
  Output$Pulumi.flatMap(Pulumi.all(match[1]), extensionPointsOutgoingJsonEventsHandlers => connect(eventCollector, eventTopics, extensionPointsOutputs, extensionPointsOutgoingJsonEventsHandlers));
218
218
  Stdlib_Option.forEach(dcbResult.dcbRuntimeSetup, dcbRuntimeSetup => dcbRuntimeSetup());
@@ -12,7 +12,7 @@ module Make = (Spec: Spec): T => {
12
12
  stream
13
13
  ->Stream.mapEffect(eventJson' =>
14
14
  EffectLogger.logInfo(
15
- ~comp="Admin",
15
+ ~comp=Platform_Admin_Structure.pluginId,
16
16
  `handleJsonEvents: outgoing event: ${LogFormat.event'JsonToLogMessage(eventJson')}`,
17
17
  )->Effect.zipRight(
18
18
  Effect.all(
@@ -4,9 +4,10 @@ import * as Effect from "effect/Effect";
4
4
  import * as Stream from "effect/Stream";
5
5
  import * as LogFormat$ReventlessCore from "../util/LogFormat.res.mjs";
6
6
  import * as EffectLogger$ReventlessCore from "../util/EffectLogger.res.mjs";
7
+ import * as Platform_Admin_Structure$ReventlessCore from "./Platform_Admin_Structure.res.mjs";
7
8
 
8
9
  function Make(Spec) {
9
- let handleJsonEvents = stream => Stream.runDrain(Stream.mapEffect(stream, eventJson$p => Effect.zipRight(EffectLogger$ReventlessCore.logInfo("Admin", undefined, `handleJsonEvents: outgoing event: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)), Effect.map(Effect.all(Spec.outgoingExtensionPointJsonEventsHandlers.map(handleEvent => Effect.promise(() => handleEvent(eventJson$p, Spec.pluginDefinition))), {
10
+ let handleJsonEvents = stream => Stream.runDrain(Stream.mapEffect(stream, eventJson$p => Effect.zipRight(EffectLogger$ReventlessCore.logInfo(Platform_Admin_Structure$ReventlessCore.pluginId, undefined, `handleJsonEvents: outgoing event: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)), Effect.map(Effect.all(Spec.outgoingExtensionPointJsonEventsHandlers.map(handleEvent => Effect.promise(() => handleEvent(eventJson$p, Spec.pluginDefinition))), {
10
11
  concurrency: "unbounded"
11
12
  }), param => {}))));
12
13
  return {
@@ -88,7 +88,7 @@ let getStorageResources = (allQueryDbs, pluginName, queryDbName) =>
88
88
  // ---------------------------------------------------------------------------
89
89
  // Plugin EventCollector context registry.
90
90
  //
91
- // Adapter runtime entry points (e.g. AdminEventCollectorEntryPoint.mjs) read
91
+ // Adapter runtime entry points (e.g. EventCollectorEntryPoint.mjs) read
92
92
  // HANDLER_CONFIG to reconstruct Plugin_Callback at cold start. The JSON payload
93
93
  // is assembled at deploy time inside `forPluginEventCollector` (AWS), but the
94
94
  // plugin-specific data (pluginDefinition, the auto-included Connect extension
@@ -1024,7 +1024,7 @@ module NoopHooksConfig: HooksConfig = {
1024
1024
  // and fire `mutationResolverHook` so adapter-side SDL stubs get registered
1025
1025
  // synchronously. The matching `mutationSchemaEntry` records — needed to keep the
1026
1026
  // SDL aligned — live in `PluginBaseFragment.pluginAggregateMutationEntries` so the
1027
- // AWS path (which pushes `AdminApi.baseFragment` directly, not Admin.construct's
1027
+ // AWS path (which pushes `Platform_AdminApi.baseFragment` directly, not Admin.construct's
1028
1028
  // adminFragment) picks them up too. This helper is side-effect only.
1029
1029
  let registerAdminAggregateMutations = (
1030
1030
  type a,
@@ -78,7 +78,7 @@ module Make = (Spec: Spec) => {
78
78
  // plugins used to call DoConnectPlugin / DoDisconnectPlugin here so
79
79
  // each plugin's EC Lambda could subscribe / unsubscribe its own
80
80
  // queue to peer EP topics. Admin owns that work now
81
- // (manageSubscriptions in AdminEventCollectorEntryPoint.mjs) — these
81
+ // (manageSubscriptions in EventCollectorEntryPoint.mjs) — these
82
82
  // cases drop to no-ops.
83
83
  | _ => []
84
84
  }
@@ -29,6 +29,13 @@ module type Spec = {
29
29
  }
30
30
 
31
31
  module Make = (Spec: Spec) => {
32
+ // Single owner of the disconnect schedule's rule name. Create and delete must
33
+ // derive it identically — they previously did not (create prefixed the stack,
34
+ // delete did not), so every delete targeted a name that was never created and
35
+ // the rule survived. The stack prefix itself is load-bearing: several stacks
36
+ // share one EventBridge bus, and an unprefixed plugin id would collide.
37
+ let disconnectScheduleName = id => Spec.environment ++ ("-" ++ id)
38
+
32
39
  let forwardCommand = async (
33
40
  _id,
34
41
  command,
@@ -104,7 +111,7 @@ module Make = (Spec: Spec) => {
104
111
  switch directive {
105
112
  | PluginExtensionPointSpec.CreateDisconnectSchedule(id, timeout) =>
106
113
  await createSchedule({
107
- name: Spec.environment ++ ("-" ++ id),
114
+ name: id->disconnectScheduleName,
108
115
  rate: timeout->ScheduleOps.minutesFromNow,
109
116
  payload: {
110
117
  Message.id,
@@ -114,7 +121,7 @@ module Make = (Spec: Spec) => {
114
121
  ->Message.encodeCommand'(S.string, PluginExtensionPointSpec.commandSchema)
115
122
  ->JSON.stringify,
116
123
  })
117
- | DeleteDisconnectSchedule(id) => await deleteSchedule(id)
124
+ | DeleteDisconnectSchedule(id) => await deleteSchedule(id->disconnectScheduleName)
118
125
  | ForwardCommand({id, command, extensionPointName}) =>
119
126
  await forwardCommand(id, command, extensionPointName, queryEngine)
120
127
  | DoConnectPlugin(pluginDef) =>
@@ -23,6 +23,7 @@ function disconnectGrace(interval) {
23
23
  }
24
24
 
25
25
  function Make(Spec) {
26
+ let disconnectScheduleName = id => Spec.environment + ("-" + id);
26
27
  let forwardCommand = async (_id, command, extensionPointName, queryEngine) => {
27
28
  let jsons = await queryEngine.scan(PluginSpec$ReventlessCore.name, [
28
29
  [
@@ -81,7 +82,7 @@ function Make(Spec) {
81
82
  case "CreateDisconnectSchedule" :
82
83
  let id = directive._0;
83
84
  return await createSchedule({
84
- name: Spec.environment + ("-" + id),
85
+ name: disconnectScheduleName(id),
85
86
  rate: ScheduleOps$ReventlessCore.minutesFromNow(directive._1),
86
87
  payload: JSON.stringify(Message$ReventlessCore.encodeCommand$p({
87
88
  id: id,
@@ -90,7 +91,7 @@ function Make(Spec) {
90
91
  }, S.string, PluginExtensionPointSpec$ReventlessInfra.commandSchema))
91
92
  });
92
93
  case "DeleteDisconnectSchedule" :
93
- return await deleteSchedule(directive._0);
94
+ return await deleteSchedule(disconnectScheduleName(directive._0));
94
95
  case "DoConnectPlugin" :
95
96
  let fn = Spec.manageSubscriptions;
96
97
  if (fn !== undefined) {
@@ -355,6 +356,7 @@ function Make(Spec) {
355
356
  mapOutgoingEvent: mapOutgoingEvent
356
357
  });
357
358
  return {
359
+ disconnectScheduleName: disconnectScheduleName,
358
360
  forwardCommand: forwardCommand,
359
361
  directiveHandler: directiveHandler,
360
362
  PluginMapping: PluginMapping,
@@ -53,7 +53,7 @@ describe("GraphQL_Stitcher.subscriptionSources", () => {
53
53
  })
54
54
 
55
55
  testSync("core-emitted admin base fragment carries no provider directives", () => {
56
- let base = AdminApi.baseFragment(~cloner=true)
56
+ let base = Platform_AdminApi.baseFragment(~cloner=true)
57
57
  expect(base.encoded->String.includes("@aws_subscribe"))->toBe(false)
58
58
  expect(base.encoded->String.includes("@aws_auth"))->toBe(false)
59
59
  // The subscription→mutation fan-in rides the structured metadata instead.
@@ -0,0 +1,66 @@
1
+ // Guards the disconnect schedule's rule name. Create and delete must derive it
2
+ // identically: they previously did not — create prefixed `Spec.environment`,
3
+ // delete did not — so every delete targeted a rule that had never been created
4
+ // and the real rule survived. The leak is invisible at runtime, because the
5
+ // delete reports success against a name AWS simply doesn't have.
6
+
7
+ open JestGlobals
8
+
9
+ let created: ref<array<string>> = ref([])
10
+ let deleted: ref<array<string>> = ref([])
11
+
12
+ module DisconnectSpec = {
13
+ let runtimeOps: PluginRuntimeOperations.operations = {
14
+ messagePublish: {
15
+ sendMessageToChannel: async (~channelId as _, ~messageBody as _) => (),
16
+ },
17
+ }
18
+ let environment = "teststack"
19
+ let updateApiSchema = None
20
+ let manageSubscriptions = None
21
+ }
22
+
23
+ module EP = PluginExtensionPoint_Plugin.Make(DisconnectSpec)
24
+
25
+ let createSchedule: Reventless.Schedule.create = async schedule => {
26
+ created := created.contents->Array.concat([schedule.name])
27
+ }
28
+
29
+ let deleteSchedule: Reventless.Schedule.delete = async name => {
30
+ deleted := deleted.contents->Array.concat([name])
31
+ }
32
+
33
+ let queryEngine: Reventless.QueryEngine.operations = {
34
+ scan: async (~readModelName as _, ~filterConfigs as _, ~limit as _) => [],
35
+ query: async (
36
+ ~readModelName as _,
37
+ ~key as _=?,
38
+ ~id as _,
39
+ ~subIdConfig as _=?,
40
+ ~filterConfigs as _=?,
41
+ ~ascending as _=?,
42
+ ~limit as _=?,
43
+ ) => [],
44
+ }
45
+
46
+ let pluginId = "Catalog_1.0.0-alpha.169"
47
+
48
+ let handle = directive => EP.directiveHandler(createSchedule, deleteSchedule, queryEngine, directive)
49
+
50
+ describe("plugin disconnect schedule", () => {
51
+ test("create and delete address the same rule name", async () => {
52
+ created := []
53
+ deleted := []
54
+ await handle(ReventlessInfra.PluginExtensionPointSpec.CreateDisconnectSchedule(pluginId, 5))
55
+ await handle(DeleteDisconnectSchedule(pluginId))
56
+ expect(deleted.contents)->toEqual(created.contents)
57
+ })
58
+
59
+ test("the rule name is namespaced by stack", async () => {
60
+ created := []
61
+ await handle(ReventlessInfra.PluginExtensionPointSpec.CreateDisconnectSchedule(pluginId, 5))
62
+ // Several stacks share one EventBridge bus, so a bare plugin id would
63
+ // collide across them.
64
+ expect(created.contents)->toEqual(["teststack-" ++ pluginId])
65
+ })
66
+ })