@reventlessdev/reventless-spec 3.0.0-alpha.169 → 3.0.0-alpha.171

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 (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +17 -3
  3. package/package.json +5 -4
  4. package/run-rename-to-decision.mjs +3 -0
  5. package/src/AnsiStyle.res +3 -3
  6. package/src/CliArgs.res +1 -1
  7. package/src/LogPrefix.res +1 -1
  8. package/src/codemod/RenameToDecision.res +207 -0
  9. package/src/codemod/RenameToDecision.res.mjs +334 -0
  10. package/src/components/Aggregate.res +1 -1
  11. package/src/components/CapabilityManifest.res +1 -1
  12. package/src/components/ComponentKind.res +2 -2
  13. package/src/components/ComponentKind.res.mjs +1 -1
  14. package/src/components/DcbScopeInference.res +2 -2
  15. package/src/components/DcbTag.res +5 -5
  16. package/src/components/OutboundTranslationSlice.res +2 -2
  17. package/src/components/Plugin.res +14 -14
  18. package/src/components/Plugin.res.mjs +8 -8
  19. package/src/components/Sensitive.res +1 -1
  20. package/src/components/Snapshot.res +5 -5
  21. package/src/components/StateAnnotations.res +1 -1
  22. package/src/components/StateChangeSlice.res +6 -5
  23. package/src/components/StateViewSlice.res +3 -3
  24. package/src/components/TaggedUnion.res +1 -1
  25. package/src/generator/Codegen.res +5 -5
  26. package/src/generator/Codegen.res.mjs +1 -1
  27. package/src/generator/Discovery.res +3 -3
  28. package/src/generator/Pairing.res +47 -18
  29. package/src/generator/Pairing.res.mjs +41 -10
  30. package/src/lifecycle/CheckLifecycleModel.res +8 -7
  31. package/src/lifecycle/CheckLifecycleModel.res.mjs +2 -2
  32. package/src/semantic/Capabilities.res +2 -2
  33. package/src/semantic/CapabilityNeed.res +3 -3
  34. package/src/semantic/Color.res +8 -8
  35. package/src/semantic/IdentityProvider.res +1 -1
  36. package/src/semantic/Messaging.res +2 -2
  37. package/src/types/{Behavior.res → Decision.res} +10 -6
  38. package/src/types/Message.res +1 -1
  39. package/src/types/OwnerScope.res +5 -5
  40. package/src/types/RoleCoverage.res +6 -6
  41. package/src/types/RoleCoverage.res.mjs +6 -6
  42. package/src/types/Trait.res +1 -1
  43. /package/src/types/{Behavior.res.mjs → Decision.res.mjs} +0 -0
@@ -21,8 +21,8 @@ absent. Every read here goes through a nullable cast for that reason; deleting
21
21
  one restores a silent failure rather than a type error.
22
22
  */
23
23
  /** Whether a JS value is a primitive string — `Cognito` and `InMemory` compile to
24
- bare strings while `Custom(_)` compiles to an object, so this is how a modelled
25
- provider is told from an unmodelled one that arrived as raw JSON. */
24
+ bare strings while `Custom(_)` compiles to an object, so this is how a modeled
25
+ provider is told from an unmodeled one that arrived as raw JSON. */
26
26
  let isJsString: 'a => bool = %raw(`v => typeof v === "string"`)
27
27
 
28
28
  external asNullableString: string => Nullable.t<string> = "%identity"
@@ -213,8 +213,8 @@ let classify = (identity: Identity.t, ~elevated: array<string>): t => {
213
213
 
214
214
  switch providerName {
215
215
  | Some(name) if systemProviders->Array.includes(name) => System
216
- // A modelled string provider, or `Custom(_)` (an object, so `providerName` is
217
- // None) — either way a caller claiming to be a person. Unmodelled strings fall
216
+ // A modeled string provider, or `Custom(_)` (an object, so `providerName` is
217
+ // None) — either way a caller claiming to be a person. Unmodeled strings fall
218
218
  // through to the refusal below.
219
219
  | Some("Cognito") | Some("InMemory") | None =>
220
220
  switch identity.userId->asNullableString->Nullable.toOption {
@@ -415,7 +415,7 @@ type retiredDecision =
415
415
  /**
416
416
  Combine a view's declared retirement flag with the caller behind the request.
417
417
 
418
- `~asked` is the caller's `includeRetired` request, honoured only where the
418
+ `~asked` is the caller's `includeRetired` request, honored only where the
419
419
  caller was going to see those rows anyway. Reading it before classifying would
420
420
  make the argument the decision rather than a request.
421
421
 
@@ -21,18 +21,18 @@ let needsOf = (structure: Plugin.pluginStructure, ~plugin: string): array<need>
21
21
  let need = (item, role) => {plugin, item, role, group: Role.groupOf(role)}
22
22
  let rolesOf = (item, roles: option<array<string>>) =>
23
23
  roles->Option.getOr([])->Array.map(role => need(item, Role.make(role)))
24
- let writable = (defs: array<Plugin.writableDef>) =>
24
+ let writeSide = (defs: array<Plugin.writeSideDef>) =>
25
25
  defs->Array.flatMap(w =>
26
26
  w.commands->Array.flatMap(c => rolesOf(`${w.name}.${c.name}`, c.requiredRoles))
27
27
  )
28
- let queryable = (defs: array<Plugin.queryableDef>) =>
28
+ let readSide = (defs: array<Plugin.readSideDef>) =>
29
29
  defs->Array.flatMap(q => rolesOf(q.name, q.requiredRoles))
30
30
  Array.flat([
31
- writable(structure.aggregates),
32
- writable(structure.stateChangeSlices),
31
+ writeSide(structure.aggregates),
32
+ writeSide(structure.stateChangeSlices),
33
33
  structure.inboundTranslationSlices->Array.flatMap(s => rolesOf(s.name, s.requiredRoles)),
34
- queryable(structure.readModels),
35
- queryable(structure.stateViewSlices),
34
+ readSide(structure.readModels),
35
+ readSide(structure.stateViewSlices),
36
36
  ])
37
37
  }
38
38
 
@@ -13,14 +13,14 @@ function needsOf(structure, plugin) {
13
13
  role: role,
14
14
  group: Role$Reventless.groupOf(role)
15
15
  }));
16
- let writable = defs => defs.flatMap(w => w.commands.flatMap(c => rolesOf(w.name + `.` + c.name, c.requiredRoles)));
17
- let queryable = defs => defs.flatMap(q => rolesOf(q.name, q.requiredRoles));
16
+ let writeSide = defs => defs.flatMap(w => w.commands.flatMap(c => rolesOf(w.name + `.` + c.name, c.requiredRoles)));
17
+ let readSide = defs => defs.flatMap(q => rolesOf(q.name, q.requiredRoles));
18
18
  return [
19
- writable(structure.aggregates),
20
- writable(structure.stateChangeSlices),
19
+ writeSide(structure.aggregates),
20
+ writeSide(structure.stateChangeSlices),
21
21
  structure.inboundTranslationSlices.flatMap(s => rolesOf(s.name, s.requiredRoles)),
22
- queryable(structure.readModels),
23
- queryable(structure.stateViewSlices)
22
+ readSide(structure.readModels),
23
+ readSide(structure.stateViewSlices)
24
24
  ].flat();
25
25
  }
26
26
 
@@ -19,7 +19,7 @@
19
19
  // annotation — an attribute's fields would all be strings the compiler never
20
20
  // checks, which is the failure this program exists to remove.
21
21
  //
22
- // **A declaration is a claim about origin, never about behaviour.** After a graft
22
+ // **A declaration is a claim about origin, never about behavior.** After a graft
23
23
  // the developer owns the files and may edit them freely. So this says "grafted
24
24
  // from trait X", and it does NOT say "still behaves like trait X" — the thing that
25
25
  // answers the second question is the trait's conformance suite, which runs in the