@cratis/pi 7.126.0 → 7.128.0

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 (36) hide show
  1. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +3 -2
  2. package/package/corpus/harnesses/copilot/instructions/secrets.instructions.md +1 -1
  3. package/package/corpus/hooks/README.md +1 -1
  4. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +13 -2
  5. package/package/corpus/rules/profiles.md +3 -2
  6. package/package/corpus/rules/secrets.md +1 -1
  7. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +1 -1
  8. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authproxy.md +26 -0
  9. package/package/corpus/skills/cratis-environments-and-secrets/LICENSE +9 -0
  10. package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +112 -0
  11. package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +48 -0
  12. package/package/corpus/skills/cratis-onboarding-runtime/LICENSE +9 -0
  13. package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +102 -0
  14. package/package/corpus/skills/cratis-onboarding-runtime/references/ante-onboarding-keys.md +31 -0
  15. package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +61 -0
  16. package/package/corpus/skills/cratis-onboarding-runtime/references/performance.md +86 -0
  17. package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +52 -0
  18. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/LICENSE +9 -0
  19. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +111 -0
  20. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +89 -0
  21. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/verification.json +32 -0
  22. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +1 -0
  23. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -0
  25. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +8 -0
  26. package/package/corpus/skills/cratis-screenplay-toolchain/references/neighbouring-skills.md +2 -0
  27. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract-exceptions.json +70 -0
  28. package/package/corpus/skills/cratis-showrunner-herald/LICENSE +9 -0
  29. package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +111 -0
  30. package/package/corpus/skills/cratis-showrunner-herald/references/options.md +35 -0
  31. package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +70 -0
  32. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +5 -0
  33. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +48 -0
  34. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +7 -0
  35. package/package/profile-catalog.json +6 -2
  36. package/package.json +1 -1
@@ -0,0 +1,70 @@
1
+ # Templates and images
2
+
3
+ ## Layout
4
+
5
+ ```
6
+ Emails/
7
+ invitation.json the values the invitation email accepts
8
+ invitation.en.html English
9
+ invitation.nb.html Norwegian
10
+ images/
11
+ logo.png
12
+ ```
13
+
14
+ ## Manifest
15
+
16
+ ```json
17
+ {
18
+ "values": [
19
+ { "name": "invitation.link", "required": true },
20
+ "invitation.expiresAt",
21
+ "inviter.name"
22
+ ]
23
+ }
24
+ ```
25
+
26
+ A plain string is an optional value. A required value that is missing or blank stops the email
27
+ before it is queued. A name cannot be both a value and a group (`inviter` and `inviter.name`),
28
+ and `look` is reserved for `look.brandColor` and `look.footer`.
29
+
30
+ ## Template
31
+
32
+ A header between two `---` lines carries `subject` and optionally `preview`; both may use values.
33
+ Then email-ready HTML.
34
+
35
+ ```html
36
+ ---
37
+ subject: {{inviter.name}} invited you to Ledger
38
+ preview: Accept the invitation before {{date invitation.expiresAt "d MMMM"}}
39
+ ---
40
+ <html>
41
+ <head><style>.button { background-color: {{look.brandColor}}; color: #ffffff; }</style></head>
42
+ <body>
43
+ <table role="presentation" width="600" align="center"><tr><td>
44
+ <img src="cid:logo.png" alt="Ledger" width="120">
45
+ {{#if inviter.name}}<p>{{inviter.name}} invited you.</p>{{/if}}
46
+ <a class="button" href="{{invitation.link}}">Accept the invitation</a>
47
+ <p>{{look.footer}}</p>
48
+ </td></tr></table>
49
+ </body>
50
+ </html>
51
+ ```
52
+
53
+ Author for email clients: table layout, about 600 px wide, `role="presentation"` on layout tables,
54
+ an `alt` on every image. Write styles in a `<style>` element; Herald moves the rules into `style`
55
+ attributes at render. Media queries stay in the element.
56
+
57
+ ## Rendering rules
58
+
59
+ - Every value is HTML-encoded in the body, quotes in attributes included. Subject and preview are plain text and not encoded.
60
+ - The subject is collapsed to one line. The plain-text alternative is generated from the HTML.
61
+ - Dates are ISO 8601 and formatted in the culture of the email's language.
62
+ - Language falls back from `nb-NO` to `nb` to `DefaultLanguage`; the language used is recorded.
63
+
64
+ ## Images
65
+
66
+ Referenced as `cid:logo.png` and embedded inline, so nothing is hosted and no remote content has
67
+ to be allowed. PNG, JPEG and GIF are embedded. SVG and anything else fail the rendering with an
68
+ error naming the file, because mail clients do not render SVG; export a PNG at twice the display
69
+ size. A referenced image that is missing also fails rendering. File names use letters, digits,
70
+ dots, dashes and underscores and are looked up only inside the images folder.
@@ -206,6 +206,11 @@ generated application: API on `9090`, Workbench on `https://localhost:35000`.
206
206
  Requires Cratis CLI 3.73.0 for the semantic engine by default, 3.75.0 for v27 keys;
207
207
  older CLIs use the legacy EventModel engine, which does not enforce authorization.
208
208
  Unsigned caller headers make sandbox authorization no security boundary.
209
+ A model with `authentication` makes `cratis run` start a stack instead: AuthProxy (the
210
+ address to open), the Stage with `Stage__Sandbox__ForwardedIdentity=true` so it trusts the
211
+ forwarded identity instead of playing a persona, and with `onboarding` Ante and MongoDB.
212
+ `cratis render` realizes authentication and onboarding (`references/rendered-application.md`).
213
+ Requires cratis CLI 3.116.0 (`cratis --version`); older CLIs run the Stage alone and play a persona.
209
214
  Read [references/sandbox-and-specrunner.md](references/sandbox-and-specrunner.md)
210
215
  before running either image: engine selection, protected reads, outside-append
211
216
  conflicts/retries, reached bodies, authored occurrence and generated-spec limits live there.
@@ -6,6 +6,7 @@
6
6
  - Runtime package migration
7
7
  - Lists on screen
8
8
  - Reducer layout for new applications
9
+ - Authentication and onboarding
9
10
  - What is managed
10
11
  - `Customizations/` (unmanaged)
11
12
  - Re-render checklist
@@ -104,6 +105,53 @@ an existing classic application to `self`: observer identity and old reducer rem
104
105
  need migration-aware publication. This opt-in does not automatically change CLI,
105
106
  Studio or semantic-engine execution.
106
107
 
108
+ ## Authentication and onboarding
109
+
110
+ A model with an `authentication` block renders an application that runs behind AuthProxy
111
+ and trusts the identity it forwards. The model's `onboarding` block renders the code that
112
+ acts on the outcomes of the application's own Ante. Both are realized by the renderer;
113
+ none of it is hand-written gap-fill.
114
+
115
+ Requires cratis CLI 3.116.0 with Stage 4.211.0 (`cratis --version`); older releases report `authentication` and `onboarding` as unrendered warnings.
116
+
117
+ | Rendered | Purpose |
118
+ | --- | --- |
119
+ | `appsettings.json` with `Cratis:Arc:TrustForwardedIdentityHeaders` true | Arc builds the caller from the headers AuthProxy forwards. |
120
+ | `GeneratedAuthentication/` (`Personas`, `MemberIdentity`, `RuntimeConventions`) | Roles and claims per persona, the identity of a person, and the Chronicle connection string read from `CRATIS_CHRONICLE_CONNECTION_STRING_FILE`. |
121
+ | `GeneratedOnboarding/` | Reactor on Ante's outcomes, idempotent provisioning, the invite-member command, member persona claims, Herald email sending. |
122
+ | `Emails/` | Email templates and images laid out for Herald. |
123
+ | `.runtime/authproxy.application.json`, `.runtime/ante.onboarding.json`, `.runtime/environment.json` | What a runtime (`cratis run`, Stage Manager) starts AuthProxy and Ante with, and the environment keys the model needs. |
124
+
125
+ - The identity headers are unsigned. Never expose a rendered application with authentication
126
+ except through AuthProxy.
127
+ - Only provider kinds AuthProxy supports render (`EntraId`, `GitHub`, `Google`, `Apple`,
128
+ `OpenId`). Another kind is left out with `STAGE-AUTH-001`; a persona that is not a
129
+ requirement on authentication, roles or claims is never matched (`STAGE-AUTH-002`).
130
+ - `offering <Name>` renders against Box Office: the default offering is declared, and a
131
+ retrying reactor on tenant provisioning starts each new tenant on it (`StartTenant`) as soon as
132
+ the operator publishes the offer. Provisioning and the welcome email do not wait for it.
133
+ `STAGE-ONBOARDING-008` is information: the operator must publish an offer with that name, and
134
+ Box Office seat and compute policies are not rendered. Requires Stage 4.212.0
135
+ for the offering and the declined email; older renderers render neither.
136
+ `STAGE-ONBOARDING-002` to `-006` cover a tenant invitation with no command,
137
+ a sign-up without a first-member persona, a legal document count other than two, a
138
+ missing email template and an invitation without inviters. `-001` and `-007` are retired
139
+ and never reused.
140
+ - An invitation Ante rejects (a persona or invitation type the model does not allow) is a
141
+ mistake in the invitation, not a decision about the person: the application records
142
+ `OnboardingInvitationRejected` and logs a warning for an administrator, and emails no
143
+ one.
144
+ - The `signupDeclined` template is sent on `OrganizationRegistrationDeclined`, with the
145
+ reviewer's message as `decline.message`, once per registration. Ante publishes that only
146
+ when sign-up review is on; the model has no review syntax, so a rendered application leaves
147
+ review off and the host adds approve and decline commands by hand (`cratis-onboarding-runtime`).
148
+ - An application with onboarding pins a newer Chronicle client and kernel image than
149
+ other applications; read them from the rendered files.
150
+ - Realization needs the model folder: email images are read from the model root.
151
+
152
+ Read the Stage references `authentication-rendering.md` and `onboarding-rendering.md` for
153
+ exact files and keys.
154
+
107
155
  ## What is managed
108
156
 
109
157
  Every path in `.cratis-render.json` is managed: the scaffold files (project, solution,
@@ -49,6 +49,13 @@ ports or an authenticated proxy). Rendered applications use the renderer's admit
49
49
  authorization instead, which is the thing to test for production behavior (Debug tests
50
50
  of a render, [render-example.md](render-example.md)).
51
51
 
52
+ `Stage__Sandbox__ForwardedIdentity=true` (`Stage:Sandbox:ForwardedIdentity`) is the exception:
53
+ the sandbox runs behind AuthProxy, trusts the identity it forwards and plays no persona, so the
54
+ signed-in caller is the caller authorization runs for. It overrides `Stage:Sandbox:Identity`.
55
+ `cratis run` sets it when the model declares `authentication`; set it yourself only behind an
56
+ AuthProxy, because the headers are unsigned and anything that can reach the sandbox directly
57
+ can forge them. Requires Stage 4.211.0; an older sandbox ignores the setting.
58
+
52
59
  The semantic Host encrypts personal-data and secret concepts at rest through Chronicle and
53
60
  releases values on read; erasure deletes event-source keys. Encryption applies to new
54
61
  writes only: events already stored in plaintext in an existing Play store are not
@@ -522,7 +522,8 @@
522
522
  "cratis-chronicle-reducer",
523
523
  "cratis-event-model-diagram",
524
524
  "cratis-multi-service-architecture",
525
- "cratis-multi-service-local-orchestration"
525
+ "cratis-multi-service-local-orchestration",
526
+ "cratis-showrunner-herald"
526
527
  ],
527
528
  "languages": [
528
529
  "csharp",
@@ -623,7 +624,8 @@
623
624
  "availableTargets": [
624
625
  "cratis-commits-and-pull-requests",
625
626
  "cratis-rtk",
626
- "cratis-chronicle-cli-operations"
627
+ "cratis-chronicle-cli-operations",
628
+ "cratis-environments-and-secrets"
627
629
  ],
628
630
  "languages": [
629
631
  "shell"
@@ -953,6 +955,7 @@
953
955
  "availableTargets": [
954
956
  "cratis-commits-and-pull-requests",
955
957
  "cratis-rtk",
958
+ "cratis-screenplay-authentication-and-onboarding",
956
959
  "cratis-screenplay-automations-and-translations",
957
960
  "cratis-screenplay-captures-and-reactions",
958
961
  "cratis-screenplay-command-surface",
@@ -1026,6 +1029,7 @@
1026
1029
  "availableTargets": [
1027
1030
  "cratis-commits-and-pull-requests",
1028
1031
  "cratis-rtk",
1032
+ "cratis-onboarding-runtime",
1029
1033
  "cratis-stage-rendering-and-sandbox"
1030
1034
  ],
1031
1035
  "languages": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.126.0",
3
+ "version": "7.128.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [