@reventlessdev/reventless-core 3.0.0-alpha.202 → 3.0.0-alpha.204

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,20 @@
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.204 (2026-08-02)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **core:** store offloaded plugin structure untagged in the read model ([9036991](https://github.com/ReventlessDev/reventless-core/commit/9036991d9fbc7bbb01157fa58be1702ea4ba36d1))
11
+
12
+
13
+ # 3.0.0-alpha.203 (2026-08-02)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **core:** run the offload hook at graph-construction, not inside .apply ([5a102f1](https://github.com/ReventlessDev/reventless-core/commit/5a102f149d6d218cdeeb28dbf9bded1d6fb1252e))
18
+
19
+
6
20
  # 3.0.0-alpha.202 (2026-08-02)
7
21
 
8
22
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.202",
3
+ "version": "3.0.0-alpha.204",
4
4
  "description": "Core package for Reventless framework",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -29,16 +29,16 @@
29
29
  "sury": "11.0.0-alpha.4",
30
30
  "uuid": "^13.0.0",
31
31
  "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
32
+ "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.1",
32
33
  "@reventlessdev/rescript-hash-object": "1.2.0-alpha.14",
33
- "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.0",
34
+ "@reventlessdev/rescript-node": "2.0.0-alpha.1",
34
35
  "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
35
- "@reventlessdev/rescript-node": "2.0.0-alpha.0",
36
+ "@reventlessdev/rescript-ssh2": "2.0.0-alpha.1",
36
37
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.18",
37
38
  "@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
38
- "@reventlessdev/rescript-ssh2": "2.0.0-alpha.0",
39
- "@reventlessdev/reventless-infra": "3.0.0-alpha.119",
40
- "@reventlessdev/reventless-spec": "3.0.0-alpha.94",
41
- "@reventlessdev/reventless-interop": "3.0.0-alpha.30"
39
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.121",
40
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.30",
41
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.96"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rescript": "12.3.0",
@@ -606,6 +606,32 @@ module Make = (
606
606
  | None => Pulumi.Output.make()
607
607
  }
608
608
 
609
+ // Offload the two large pluginDefinition fields at deploy time when a
610
+ // provider offers an object store (AWS writes a content-addressed object
611
+ // and returns a reference); unset locally, so they stay Inline. Computed
612
+ // HERE, at graph-construction time — both values are concrete and the hook
613
+ // (which creates the object resource) MUST run outside the Pulumi.Output.apply
614
+ // below: a resource cannot be created inside .apply, and an apply callback is
615
+ // skipped entirely on `pulumi preview` when its inputs are still unknown.
616
+ // Unconditional: these fields are always large enough to be worth offloading.
617
+ let toPayload = (value, ~schema, ~store) =>
618
+ switch Plugin_Helpers.offloadHook.contents {
619
+ | Some(hook) =>
620
+ Reventless.Offload.Offloaded(
621
+ hook(~store, ~bytes=value->S.reverseConvertToJsonStringOrThrow(schema)),
622
+ )
623
+ | None => Reventless.Offload.Inline(value)
624
+ }
625
+ let apiSchemaFragmentPayload = toPayload(
626
+ apiSchemaFragment,
627
+ ~schema=Reventless.Plugin.apiSchemaFragmentSchema,
628
+ ~store="pluginApiFragments",
629
+ )
630
+ let structurePayload =
631
+ pluginStructure->Option.map(s =>
632
+ toPayload(s, ~schema=Reventless.Plugin.pluginStructureSchema, ~store="pluginStructures")
633
+ )
634
+
609
635
  (
610
636
  (interstackAdminExtensionPoints, localAdminResolvedEP, schemaPushed)->Pulumi.Output.all3,
611
637
  aggregateResources->Pulumi.Output.allDict,
@@ -738,31 +764,6 @@ module Make = (
738
764
  // so reading it inside the async callback would always yield "Domain".
739
765
  let capturedDeployTarget = Spec.hooks.deployTarget.contents
740
766
 
741
- // Offload the two large pluginDefinition fields at deploy time when a
742
- // provider offers an object store (AWS writes a content-addressed object
743
- // and returns a reference); unset locally, so they stay Inline. Both
744
- // values are concrete here, so the hook — and the object write it does —
745
- // runs at graph-construction time, before the Pulumi.Output.apply below
746
- // (a resource cannot be created inside .apply). Unconditional: these
747
- // fields are always large enough to be worth offloading.
748
- let toPayload = (value, ~schema, ~store) =>
749
- switch Plugin_Helpers.offloadHook.contents {
750
- | Some(hook) =>
751
- Reventless.Offload.Offloaded(
752
- hook(~store, ~bytes=value->S.reverseConvertToJsonStringOrThrow(schema)),
753
- )
754
- | None => Reventless.Offload.Inline(value)
755
- }
756
- let apiSchemaFragmentPayload = toPayload(
757
- apiSchemaFragment,
758
- ~schema=Reventless.Plugin.apiSchemaFragmentSchema,
759
- ~store="pluginApiFragments",
760
- )
761
- let structurePayload =
762
- pluginStructure->Option.map(s =>
763
- toPayload(s, ~schema=Reventless.Plugin.pluginStructureSchema, ~store="pluginStructures")
764
- )
765
-
766
767
  // DCB EventLog definition — Some when this plugin has a DcbEventLog
767
768
  // component, None otherwise. Admin's manageSubscriptions reads this to
768
769
  // provision cross-plugin SNS subscriptions from peer plugins' DCB
@@ -421,6 +421,22 @@ function Make(Spec) {
421
421
  });
422
422
  let pushSchema = Spec.hooks.preResolversSchemaHook;
423
423
  let schemaPushed = pushSchema !== undefined ? pushSchema(extra$1, version, apiSchemaFragment) : Pulumi.output();
424
+ let toPayload = (value, schema, store) => {
425
+ let hook = Plugin_Helpers$ReventlessCore.offloadHook.contents;
426
+ if (hook !== undefined) {
427
+ return {
428
+ TAG: "Offloaded",
429
+ _0: hook(store, S.reverseConvertToJsonStringOrThrow(value, schema, undefined))
430
+ };
431
+ } else {
432
+ return {
433
+ TAG: "Inline",
434
+ _0: value
435
+ };
436
+ }
437
+ };
438
+ let apiSchemaFragmentPayload = toPayload(apiSchemaFragment, Plugin$Reventless.apiSchemaFragmentSchema, "pluginApiFragments");
439
+ let structurePayload = Stdlib_Option.map(pluginStructure, s => toPayload(s, Plugin$Reventless.pluginStructureSchema, "pluginStructures"));
424
440
  let builderOutputs = Pulumi.all([
425
441
  Pulumi.all([
426
442
  interstackAdminExtensionPoints,
@@ -487,22 +503,6 @@ function Make(Spec) {
487
503
  let match$3 = EventCollectorHelper.make(childName, eventTopics, opts);
488
504
  let eventCollector = match$3[0];
489
505
  let capturedDeployTarget = Spec.hooks.deployTarget.contents;
490
- let toPayload = (value, schema, store) => {
491
- let hook = Plugin_Helpers$ReventlessCore.offloadHook.contents;
492
- if (hook !== undefined) {
493
- return {
494
- TAG: "Offloaded",
495
- _0: hook(store, S.reverseConvertToJsonStringOrThrow(value, schema, undefined))
496
- };
497
- } else {
498
- return {
499
- TAG: "Inline",
500
- _0: value
501
- };
502
- }
503
- };
504
- let apiSchemaFragmentPayload = toPayload(apiSchemaFragment, Plugin$Reventless.apiSchemaFragmentSchema, "pluginApiFragments");
505
- let structurePayload = Stdlib_Option.map(pluginStructure, s => toPayload(s, Plugin$Reventless.pluginStructureSchema, "pluginStructures"));
506
506
  let dcbOutputs$1 = dcbResult.dcbEventLogOutputs;
507
507
  let dcbEventLogDef;
508
508
  if (dcbOutputs$1 !== undefined) {
@@ -54,8 +54,17 @@ let displayState = (
54
54
  extensions: def.extensions,
55
55
  status,
56
56
  statusChange,
57
- apiSchemaFragment: def.apiSchemaFragment,
58
- structure: def.structure,
57
+ // Store the offloadable fields as their untagged wire JSON (bare value, or an
58
+ // `{$offload: {...}}` reference), not the `Offload.payload` variant: the QueryDb
59
+ // write path marshals the raw ReScript value, so a variant would land in DynamoDB
60
+ // as `{TAG, _0}`. The ComponentDefinitions Lambda then reads structure back and
61
+ // resolves the sentinel.
62
+ apiSchemaFragment: def.apiSchemaFragment->Option.map(
63
+ Reventless.Offload.toJson(Reventless.Plugin.apiSchemaFragmentSchema, _),
64
+ ),
65
+ structure: def.structure->Option.map(
66
+ Reventless.Offload.toJson(Reventless.Plugin.pluginStructureSchema, _),
67
+ ),
59
68
  dcbEventLog: def.dcbEventLog,
60
69
  // A freshly projected row always knows its kind (the definition carries it as a
61
70
  // mandatory field). `option` here is purely for rows persisted before `kind`
@@ -3,6 +3,8 @@
3
3
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
4
4
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
5
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
+ import * as Plugin$Reventless from "@reventlessdev/reventless-spec/src/components/Plugin.res.mjs";
7
+ import * as Offload$Reventless from "@reventlessdev/reventless-spec/src/semantic/Offload.res.mjs";
6
8
  import * as Plugin$ReventlessCore from "../component/Plugin.res.mjs";
7
9
  import * as Projection$Reventless from "@reventlessdev/reventless-spec/src/types/Projection.res.mjs";
8
10
  import * as PluginSpec$ReventlessCore from "./PluginSpec.res.mjs";
@@ -70,8 +72,8 @@ function displayState(def, status, statusChange, otherConnectedVersions) {
70
72
  let base_extensionPointNames = def.extensionPoints.map(extensionPoint => extensionPoint.name);
71
73
  let base_extensionNames = def.extensions.map(extension => extension.extensionPointName);
72
74
  let base_extensions = def.extensions;
73
- let base_apiSchemaFragment = def.apiSchemaFragment;
74
- let base_structure = def.structure;
75
+ let base_apiSchemaFragment = Stdlib_Option.map(def.apiSchemaFragment, __x => Offload$Reventless.toJson(Plugin$Reventless.apiSchemaFragmentSchema, __x));
76
+ let base_structure = Stdlib_Option.map(def.structure, __x => Offload$Reventless.toJson(Plugin$Reventless.pluginStructureSchema, __x));
75
77
  let base_dcbEventLog = def.dcbEventLog;
76
78
  let base_kind = def.kind;
77
79
  let base_otherConnectedVersions = without(otherConnectedVersions, def.version);
@@ -24,15 +24,22 @@ type state = {
24
24
  extensions: array<Reventless.Plugin.extensionDefinition>,
25
25
  status: status,
26
26
  statusChange: Message.statusChange,
27
- apiSchemaFragment: @s.matches(Reventless.Plugin.apiSchemaFragmentOffloadSchema)
28
- option<Reventless.Offload.payload<Reventless.Plugin.apiSchemaFragment>>,
27
+ // Stored as the **untagged** offload wire JSON (a bare fragment, or an
28
+ // `{$offload: {...}}` reference) — NOT the `Offload.payload` variant. The QueryDb
29
+ // write path marshals the raw ReScript value straight to DynamoDB without
30
+ // sury-encoding through this field's schema, so a variant would persist as its
31
+ // runtime `{TAG, _0}` shape and no reader could parse it. UI-excluded
32
+ // (PluginBaseFragment.pluginUIOnlyExcludeFields), so JSON.t typing costs no
33
+ // GraphQL consumer. PluginsProjection.displayState writes it via Offload.toJson.
34
+ apiSchemaFragment: option<JSON.t>,
29
35
  // API target for split-API schema routing. Absent/None means "Domain" (backward compat).
30
36
  // "Platform" → excluded from DomainApi runtime schema stitching in updateApiSchema.
31
37
  apiTarget?: string,
32
38
  // Plugin structure (component metadata) — surfaced via Platform_ComponentDefinitions.
33
- // None for older plugins whose protocol version did not carry the field.
34
- structure: @s.matches(Reventless.Plugin.pluginStructureOffloadSchema)
35
- option<Reventless.Offload.payload<Reventless.Plugin.pluginStructure>>,
39
+ // None for older plugins whose protocol version did not carry the field. Same
40
+ // untagged-JSON storage as apiSchemaFragment above; the ComponentDefinitions
41
+ // Lambda detects the `$offload` sentinel and resolves it from S3.
42
+ structure: option<JSON.t>,
36
43
  // DCB EventLog definition for plugins that bundle a DcbEventLog component.
37
44
  // Admin's manageSubscriptions uses this to wire cross-plugin SNS subscriptions
38
45
  // from this plugin's DCB topic → peer EventCollectors (and vice-versa). None
@@ -74,9 +81,9 @@ type queryResult = {
74
81
  extensionNames: array<string>,
75
82
  extensions: array<Reventless.Plugin.extensionDefinition>,
76
83
  status: status,
77
- apiSchemaFragment: option<Reventless.Offload.payload<Reventless.Plugin.apiSchemaFragment>>,
84
+ apiSchemaFragment: option<JSON.t>,
78
85
  apiTarget?: string,
79
- structure: option<Reventless.Offload.payload<Reventless.Plugin.pluginStructure>>,
86
+ structure: option<JSON.t>,
80
87
  dcbEventLog: option<Reventless.Plugin.dcbEventLogDefinition>,
81
88
  kind: option<Reventless.Plugin.pluginKind>,
82
89
  }
@@ -23,9 +23,9 @@ let stateSchema = S.schema(s => ({
23
23
  extensions: s.m(S.array(Plugin$Reventless.extensionDefinitionSchema)),
24
24
  status: s.m(statusSchema),
25
25
  statusChange: s.m(Message$ReventlessCore.statusChangeSchema),
26
- apiSchemaFragment: s.m(Plugin$Reventless.apiSchemaFragmentOffloadSchema),
26
+ apiSchemaFragment: s.m(S.option(S.json)),
27
27
  apiTarget: s.m(S.option(S.string)),
28
- structure: s.m(Plugin$Reventless.pluginStructureOffloadSchema),
28
+ structure: s.m(S.option(S.json)),
29
29
  dcbEventLog: s.m(Plugin$Reventless.dcbEventLogOptionSchema),
30
30
  kind: s.m(S.option(Plugin$Reventless.pluginKindSchema)),
31
31
  otherConnectedVersions: s.m(S.array(Plugin$Reventless.versionSchema))