@reventlessdev/reventless-core 3.0.0-alpha.313 → 3.0.0-alpha.315

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,45 @@
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.315 (2026-10-29)
7
+
8
+ * feat(ppx)!: `@pii` marks a value about a person, and an event reads it as `Pii.t` ([37174c1](https://github.com/ReventlessDev/reventless-core/commit/37174c10eb80e9e3adbb93a52ad7a9ef5def7100))
9
+ ### Features
10
+
11
+ * **bindings:** AES-256-GCM in rescript-node and a KMS client in rescript-aws-sdk ([4c57d9a](https://github.com/ReventlessDev/reventless-core/commit/4c57d9a4572b8d4986670f923b57e5b81912e857))
12
+ * **core:** no log line prints a personal value ([af03709](https://github.com/ReventlessDev/reventless-core/commit/af037090770992c254e5dc69ab71ef251bad2db9))
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * the ledger's events carry `address: Pii.t<Email.t>`. Pattern-match
17
+ `Value(address)` where the address is read.
18
+
19
+ The published per-platform PPX binary does not know `@pii` until it is republished.
20
+
21
+ Step PD2 of docs/plans/a-personal-field-is-marked-redacted-and-encrypted-at-the-seam.md.
22
+ Claude-Session: https://claude.ai/code/session_01HiQfdxVEsHwLHRoHSUcus1
23
+
24
+
25
+
26
+ # 3.0.0-alpha.314 (2026-10-29)
27
+
28
+ * feat(ppx)!: `@pii` marks a value about a person, and an event reads it as `Pii.t` ([37174c1](https://github.com/ReventlessDev/reventless-core/commit/37174c10eb80e9e3adbb93a52ad7a9ef5def7100))
29
+ ### Features
30
+
31
+ * **core:** no log line prints a personal value ([af03709](https://github.com/ReventlessDev/reventless-core/commit/af037090770992c254e5dc69ab71ef251bad2db9))
32
+
33
+ ### BREAKING CHANGES
34
+
35
+ * the ledger's events carry `address: Pii.t<Email.t>`. Pattern-match
36
+ `Value(address)` where the address is read.
37
+
38
+ The published per-platform PPX binary does not know `@pii` until it is republished.
39
+
40
+ Step PD2 of docs/plans/a-personal-field-is-marked-redacted-and-encrypted-at-the-seam.md.
41
+ Claude-Session: https://claude.ai/code/session_01HiQfdxVEsHwLHRoHSUcus1
42
+
43
+
44
+
6
45
  # 3.0.0-alpha.313 (2026-10-29)
7
46
 
8
47
  * feat(ppx)!: `@pii` marks a value about a person, and an event reads it as `Pii.t` ([37174c1](https://github.com/ReventlessDev/reventless-core/commit/37174c10eb80e9e3adbb93a52ad7a9ef5def7100))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.313",
3
+ "version": "3.0.0-alpha.315",
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",
30
30
  "uuid": "^13.0.0",
31
31
  "@reventlessdev/rescript-effect": "1.0.0-alpha.1",
32
- "@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
33
- "@reventlessdev/rescript-node": "2.0.0-alpha.23",
34
- "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.23",
32
+ "@reventlessdev/rescript-fast-csv": "2.0.0-alpha.24",
35
33
  "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
34
+ "@reventlessdev/rescript-node": "2.0.0-alpha.24",
35
+ "@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
36
36
  "@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
37
- "@reventlessdev/rescript-ssh2": "2.0.0-alpha.24",
38
- "@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
39
- "@reventlessdev/reventless-infra": "3.0.0-alpha.210",
37
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.212",
40
38
  "@reventlessdev/reventless-interop": "3.0.0-alpha.42",
41
- "@reventlessdev/reventless-spec": "3.0.0-alpha.181"
39
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.183",
40
+ "@reventlessdev/rescript-ssh2": "2.0.0-alpha.25",
41
+ "@reventlessdev/rescript-uuid": "2.0.0-alpha.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rescript": "12.3.1",
@@ -38,7 +38,7 @@ globalThis.describe("LogFormat", () => {
38
38
  msgId: "testMsgId",
39
39
  correlationId: "testCorrelationId"
40
40
  };
41
- let metaStr = JSON.stringify(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema));
41
+ let metaStr = JSON.stringify(LogFormat$ReventlessCore.metaForLog(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema)));
42
42
  let arr = commands.map((command, idx) => ({
43
43
  id: idx.toString(),
44
44
  meta: meta,
@@ -84,7 +84,7 @@ globalThis.describe("LogFormat", () => {
84
84
  msgId: "testMsgId",
85
85
  correlationId: "testCorrelationId"
86
86
  };
87
- let metaStr = JSON.stringify(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema));
87
+ let metaStr = JSON.stringify(LogFormat$ReventlessCore.metaForLog(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema)));
88
88
  let arr = commands.map((command, idx) => ({
89
89
  id: idx.toString(),
90
90
  meta: meta,
@@ -116,7 +116,7 @@ globalThis.describe("LogFormat", () => {
116
116
  }
117
117
  }, Sury.string, PluginSpec$ReventlessCore.eventSchema);
118
118
  let msg = LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p);
119
- globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","ip":"testIp","user":"testUser"},"id":"testId"}`);
119
+ globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","user":"testUser"},"id":"testId"}`);
120
120
  });
121
121
  });
122
122
  globalThis.describe("variantFields", () => {
@@ -0,0 +1,40 @@
1
+ // The AES-256-GCM binding an encrypting provider seals values with.
2
+
3
+ open JestGlobals
4
+
5
+ let key = NodeCrypto.aesKey()
6
+
7
+ describe("NodeCrypto AES-256-GCM", () => {
8
+ testSync("round-trips, and never repeats a ciphertext", () => {
9
+ let a = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
10
+ let b = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
11
+ expect(a == b)->toBe(false)
12
+ expect(NodeCrypto.aesGcmDecrypt(~key, a))->toEqual(Ok("Ada Lovelace"))
13
+ expect(a->String.includes("Ada"))->toBe(false)
14
+ })
15
+
16
+ testSync("a tampered value does not open", () => {
17
+ let sealed = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
18
+ let flipped = sealed->String.charAt(20) == "A" ? "B" : "A"
19
+ let tampered =
20
+ sealed->String.slice(~start=0, ~end=20) ++ flipped ++ sealed->String.slice(~start=21)
21
+ expect(NodeCrypto.aesGcmDecrypt(~key, tampered)->Result.isError)->toBe(true)
22
+ })
23
+
24
+ testSync("another key, or another aad, does not open it", () => {
25
+ let sealed = NodeCrypto.aesGcmEncrypt(~key, ~aad="member-1/name", "Ada")
26
+ expect(
27
+ NodeCrypto.aesGcmDecrypt(
28
+ ~key=NodeCrypto.aesKey(),
29
+ ~aad="member-1/name",
30
+ sealed,
31
+ )->Result.isError,
32
+ )->toBe(true)
33
+ expect(NodeCrypto.aesGcmDecrypt(~key, ~aad="member-2/name", sealed)->Result.isError)->toBe(true)
34
+ expect(NodeCrypto.aesGcmDecrypt(~key, ~aad="member-1/name", sealed))->toEqual(Ok("Ada"))
35
+ })
36
+
37
+ testSync("a value too short to hold a nonce and a tag is refused", () =>
38
+ expect(NodeCrypto.aesGcmDecrypt(~key, "AAAA")->Result.isError)->toBe(true)
39
+ )
40
+ })
@@ -0,0 +1,42 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as NodeCrypto from "@reventlessdev/rescript-node/src/NodeCrypto.res.mjs";
4
+ import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
5
+
6
+ let key = NodeCrypto.aesKey();
7
+
8
+ globalThis.describe("NodeCrypto AES-256-GCM", () => {
9
+ globalThis.test("round-trips, and never repeats a ciphertext", () => {
10
+ let a = NodeCrypto.aesGcmEncrypt(key, undefined, "Ada Lovelace");
11
+ let b = NodeCrypto.aesGcmEncrypt(key, undefined, "Ada Lovelace");
12
+ globalThis.expect(a === b).toBe(false);
13
+ globalThis.expect(NodeCrypto.aesGcmDecrypt(key, undefined, a)).toEqual({
14
+ TAG: "Ok",
15
+ _0: "Ada Lovelace"
16
+ });
17
+ globalThis.expect(a.includes("Ada")).toBe(false);
18
+ });
19
+ globalThis.test("a tampered value does not open", () => {
20
+ let sealed = NodeCrypto.aesGcmEncrypt(key, undefined, "Ada Lovelace");
21
+ let flipped = sealed.charAt(20) === "A" ? "B" : "A";
22
+ let tampered = sealed.slice(0, 20) + flipped + sealed.slice(21);
23
+ globalThis.expect(Stdlib_Result.isError(NodeCrypto.aesGcmDecrypt(key, undefined, tampered))).toBe(true);
24
+ });
25
+ globalThis.test("another key, or another aad, does not open it", () => {
26
+ let sealed = NodeCrypto.aesGcmEncrypt(key, "member-1/name", "Ada");
27
+ globalThis.expect(Stdlib_Result.isError(NodeCrypto.aesGcmDecrypt(NodeCrypto.aesKey(), "member-1/name", sealed))).toBe(true);
28
+ globalThis.expect(Stdlib_Result.isError(NodeCrypto.aesGcmDecrypt(key, "member-2/name", sealed))).toBe(true);
29
+ globalThis.expect(NodeCrypto.aesGcmDecrypt(key, "member-1/name", sealed)).toEqual({
30
+ TAG: "Ok",
31
+ _0: "Ada"
32
+ });
33
+ });
34
+ globalThis.test("a value too short to hold a nonce and a tag is refused", () => {
35
+ globalThis.expect(Stdlib_Result.isError(NodeCrypto.aesGcmDecrypt(key, undefined, "AAAA"))).toBe(true);
36
+ });
37
+ });
38
+
39
+ export {
40
+ key,
41
+ }
42
+ /* key Not a pure module */
@@ -5,6 +5,7 @@ import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/P
5
5
  import * as Semantic$Reventless from "@reventlessdev/reventless-spec/src/semantic/Semantic.res.mjs";
6
6
  import * as Sensitive$Reventless from "@reventlessdev/reventless-spec/src/components/Sensitive.res.mjs";
7
7
  import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
8
+ import * as LogFormat$ReventlessCore from "../../src/util/LogFormat.res.mjs";
8
9
  import * as PiiMember$ReventlessCore from "./PiiMember.res.mjs";
9
10
  import * as SuryToJsonSchema$ReventlessCore from "../../src/components/Api/SuryToJsonSchema.res.mjs";
10
11
 
@@ -140,6 +141,50 @@ globalThis.describe("the JSON schema", () => {
140
141
  });
141
142
  });
142
143
 
144
+ globalThis.describe("a log line of a @pii event or command", () => {
145
+ globalThis.test("holds no personal value, whichever formatter prints it", () => {
146
+ let eventJson = Util_Sury$Reventless.toJson(joined, PiiMember$ReventlessCore.eventSchema);
147
+ let envelope = Object.fromEntries([
148
+ [
149
+ "id",
150
+ "m-1"
151
+ ],
152
+ [
153
+ "meta",
154
+ Object.fromEntries([[
155
+ "ip",
156
+ "10.0.0.1"
157
+ ]])
158
+ ],
159
+ [
160
+ "event",
161
+ eventJson
162
+ ]
163
+ ]);
164
+ let lines = [
165
+ LogFormat$ReventlessCore.eventDetail(envelope),
166
+ LogFormat$ReventlessCore.eventFull(envelope)
167
+ ];
168
+ lines.forEach(line => {
169
+ globalThis.expect(line.includes("Ada")).toBe(false);
170
+ globalThis.expect(line.includes("ada@example.com")).toBe(false);
171
+ globalThis.expect(line.includes("mathematician")).toBe(false);
172
+ globalThis.expect(line.includes("10.0.0.1")).toBe(false);
173
+ globalThis.expect(line.includes("m-1")).toBe(true);
174
+ });
175
+ let join = {
176
+ TAG: "Join",
177
+ memberId: "m-1",
178
+ name: "Ada",
179
+ address: "ada@example.com"
180
+ };
181
+ let commandJson = Util_Sury$Reventless.toJson(join, PiiMember$ReventlessCore.commandSchema);
182
+ let label = LogFormat$ReventlessCore.cmdLabelOfJson(commandJson);
183
+ globalThis.expect(label.includes("Ada")).toBe(false);
184
+ globalThis.expect(label.includes("m-1")).toBe(true);
185
+ });
186
+ });
187
+
143
188
  let M;
144
189
 
145
190
  export {