@cratis/pi 7.14.1 → 7.14.3
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/package/corpus/agents/security-reviewer.md +2 -1
- package/package/corpus/rules/concepts.md +13 -7
- package/package/corpus/rules/glossary.md +2 -1
- package/package/corpus/rules/vertical-slices.md +5 -4
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +11 -2
- package/package/corpus/skills/cratis-application-slice-conformance/references/build-prompts.md +8 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +10 -6
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +11 -7
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +12 -2
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +16 -1
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +7 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/observable-emission-guards.md +9 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +24 -16
- package/package/corpus/skills/cratis-arc-command/references/command-result.md +7 -0
- package/package/corpus/skills/cratis-arc-command/references/handler-shapes.md +10 -3
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-command-operation/SKILL.md +5 -1
- package/package/corpus/skills/cratis-arc-command-operation/references/execution-and-recovery.md +12 -0
- package/package/corpus/skills/cratis-arc-command-operation/references/testing.md +10 -3
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +20 -116
- package/package/corpus/skills/cratis-arc-command-typescript/references/chronicle-events.md +11 -8
- package/package/corpus/skills/cratis-arc-command-typescript/references/command-specifications.md +63 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/hosting-and-storage.md +10 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/proxy-generation.md +38 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/slice-layout.md +19 -0
- package/package/corpus/skills/cratis-arc-command-typescript/verification.json +1 -1
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +11 -10
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +30 -19
- package/package/corpus/skills/cratis-arc-react-page/references/data-page.md +11 -0
- package/package/corpus/skills/cratis-arc-react-page/references/data-tables.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/references/dialogs.md +12 -10
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/references/mvvm.md +11 -0
- package/package/corpus/skills/cratis-arc-react-page/references/queries-and-commands.md +7 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +58 -122
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/compatibility-check.md +26 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +22 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/hosting.md +31 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +52 -131
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/append-api.md +19 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/variants.md +73 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +29 -232
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-lifecycle.md +20 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/discovery-and-registration.md +44 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/java-api.md +33 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/spring-boot.md +54 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/variants.md +77 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +26 -102
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/read-models-and-projections.md +23 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/variants.md +63 -0
- package/package/corpus/skills/cratis-chronicle-compliance/SKILL.md +11 -2
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -13
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -4
- package/package/corpus/skills/cratis-chronicle-projection/references/fluent-builder.md +10 -0
- package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md +14 -6
- package/package/corpus/skills/cratis-chronicle-projection/references/variants.md +9 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +7 -49
- package/package/corpus/skills/cratis-chronicle-reactor/references/domain-failures.md +19 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/specifications.md +33 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-read-model/references/queries.md +11 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +1 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +24 -24
- package/package/corpus/skills/cratis-content-length/SKILL.md +1 -1
- package/package/corpus/skills/cratis-content-length/references/length-evidence.md +12 -0
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +19 -19
- package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +10 -0
- package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +10 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +5 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/code-style.md +15 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +9 -4
- package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +1 -2
- package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +8 -0
- package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +1 -2
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +10 -0
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +4 -4
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +1 -1
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +18 -18
- package/package/corpus/skills/cratis-performance-review/SKILL.md +1 -1
- package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +29 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +16 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +4 -15
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +6 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +1 -6
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +45 -245
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +42 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +155 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +27 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-reads-example.md +21 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +70 -221
- package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +10 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +51 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +62 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +46 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +36 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +11 -11
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +10 -3
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +1 -6
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +13 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +8 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +11 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +7 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +75 -198
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/file-layout.md +89 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/naming-primitives.md +26 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +14 -1
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +8 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/slice-type-rules.md +12 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +12 -6
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +5 -6
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/candidate-inventory.md +11 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +8 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +11 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +33 -10
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +8 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +13 -17
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +11 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +9 -9
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +9 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +16 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +9 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +17 -8
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +8 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +1 -6
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +19 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +1 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +11 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +2 -2
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +3 -4
- package/package/corpus/skills/cratis-screenplay-projections/references/pdl-grammar.md +8 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +8 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +10 -10
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +8 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +4 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +17 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +10 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +11 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +12 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +7 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +8 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +16 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +10 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +52 -360
- package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +34 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +77 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +39 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +72 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +110 -0
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +6 -6
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +23 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +3 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +16 -20
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +16 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +13 -7
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +10 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +12 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +10 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +15 -5
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +11 -13
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +1 -1
- package/package/corpus/skills/cratis-security-review/SKILL.md +13 -8
- package/package/corpus/skills/cratis-social-feed-post/SKILL.md +10 -10
- package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +12 -0
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +13 -2
- package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +10 -10
- package/package/corpus/skills/cratis-specifications-csharp/references/csharp-patterns.md +10 -0
- package/package/corpus/skills/cratis-specifications-csharp/references/integration-specs.md +9 -0
- package/package/corpus/skills/cratis-specifications-typescript/SKILL.md +1 -2
- package/package/corpus/skills/cratis-specifications-typescript/references/typescript-patterns.md +11 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -21
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +9 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +5 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +2 -4
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +2 -2
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +39 -39
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +10 -0
- package/package.json +1 -1
|
@@ -46,6 +46,55 @@ use the newer main commit above; do not attribute their verification to the old
|
|
|
46
46
|
each construct binds to, is in the `cratis-screenplay-model-authoring` language
|
|
47
47
|
reference.
|
|
48
48
|
|
|
49
|
+
## `concept` and `type`
|
|
50
|
+
|
|
51
|
+
```screenplay
|
|
52
|
+
concept InvoiceId : Uuid
|
|
53
|
+
concept DiscountPercentage : Decimal
|
|
54
|
+
validate
|
|
55
|
+
>= 0 message "A discount cannot be negative"
|
|
56
|
+
<= 100 message "A discount cannot exceed 100 percent"
|
|
57
|
+
concept PersonName : String @pii
|
|
58
|
+
pii reason "Billing contact name; lawful basis: contract performance."
|
|
59
|
+
concept InvoiceStatus : Enum
|
|
60
|
+
draft
|
|
61
|
+
sent
|
|
62
|
+
paid
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The seven primitives are `Uuid`, `String`, `Int`, `Decimal`, `Bool`, `Date` and
|
|
66
|
+
`DateTime`. `Enum` is **not** one of them — it is a separate concept kind, which
|
|
67
|
+
is why the compiler says *expected … or Enum* rather than listing it among them.
|
|
68
|
+
Attributes `@pii` and `@sensitive`, each with at most one `reason`; a
|
|
69
|
+
reason for an attribute the concept does not declare is an error. **Compliance is
|
|
70
|
+
inherited** — a property typed with a `@pii` concept is PII everywhere. The
|
|
71
|
+
executable model does not bind compliance attributes (`PLAY0268`, "compliance attributes
|
|
72
|
+
require portable data-subject semantics"), so a `@pii` model stops at authorable (V1);
|
|
73
|
+
keep the attribute, because the classification is the point, and never drop it to bind
|
|
74
|
+
or render.
|
|
75
|
+
|
|
76
|
+
`@pii` is personal data (erasable); `@sensitive` is an **operational secret** (API key,
|
|
77
|
+
token, a company's bank account number): encrypted at rest without erasure and withheld
|
|
78
|
+
from the causation chain (Screenplay decision 0034, Screenplay#384). C# providers render
|
|
79
|
+
`@sensitive` as `[Encrypted]` + `[NotAudited]`, `@pii` as `[PII]`, and `@pii @sensitive`
|
|
80
|
+
as `[PII]` only, because Chronicle rejects `[PII]` with `[Encrypted]` (`CHR0053`); Stage
|
|
81
|
+
renders this from v4.29.0. The executable model still stops at `PLAY0268` for either.
|
|
82
|
+
|
|
83
|
+
⚠️ **Identifiers are neither `@pii` nor `@sensitive`.** Chronicle rejects `[PII]` on an
|
|
84
|
+
event source id (`CHR0034`) and `[Encrypted]` on one (`CHR0052`); Screenplay reports
|
|
85
|
+
`PLAY0515` for `@pii` from Screenplay 4.69.1 and for `@sensitive` from 4.84.1, on a
|
|
86
|
+
command identifier, an explicit `for` destination or an event source identifier; earlier
|
|
87
|
+
versions compile it silently and only Chronicle catches it. Keep the stream identity a surrogate `Uuid`
|
|
88
|
+
concept and carry the personal value (name, email) as a separate `@pii` property and a
|
|
89
|
+
secret as a `@sensitive` property.
|
|
90
|
+
|
|
91
|
+
⚠️ **Enum trap.** A value literally named `validate` is read as an empty validate
|
|
92
|
+
block. Write `@validate` for the value; the compiler warns when it sees the
|
|
93
|
+
ambiguity.
|
|
94
|
+
|
|
95
|
+
Use `type <Name>` for a composite shape (several properties) that events and
|
|
96
|
+
commands reference; use `concept` for a single wrapped primitive.
|
|
97
|
+
|
|
49
98
|
## The command block
|
|
50
99
|
|
|
51
100
|
Excerpt: the concepts, the `InvoiceLine` type, the policy and the event are
|
|
@@ -140,17 +189,8 @@ Do not use `reads` to fetch data the caller could supply.
|
|
|
140
189
|
Each rule takes an optional `severity information|warning|error` and then an
|
|
141
190
|
optional `message "<text>"` (or `$strings.<key>`). The default severity is `error`.
|
|
142
191
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
| `not empty` | `name not empty` |
|
|
146
|
-
| `max <n>` / `min <n>` | `reason max 500` (length on text), `quantity min 1` (value on numbers) |
|
|
147
|
-
| `> <v>` / `>= <v>` / `< <v>` / `<= <v>` | `quantity > 0`, `discountPct <= 100` |
|
|
148
|
-
| `== <v>` / `!= <v>` | `currency == "NOK"`, `status != draft` |
|
|
149
|
-
| `length == <n>` | `currency length == 3` |
|
|
150
|
-
| `matches email` | the only named pattern; any other name is `PLAY0366` |
|
|
151
|
-
| `matches "<regex>"` | ECMAScript; matches **any substring** unless anchored with `^…$`; an invalid pattern is `PLAY0367` |
|
|
152
|
-
| `all > <v>` / `all >= <v>` | `lines.quantity all > 0` |
|
|
153
|
-
| `rule <Name>` | `orgNumber rule BeAValidOrganizationNumber` |
|
|
192
|
+
The rule vocabulary (`not empty`, `min`/`max`, comparisons, `length`, `matches`, `all`, `rule <Name>`) is in
|
|
193
|
+
[references/validate-rules.md](references/validate-rules.md): read it when choosing or writing a rule form.
|
|
154
194
|
|
|
155
195
|
⚠️ **Validation severity is not compiler severity.** Every failed rule and
|
|
156
196
|
`require` rejects the command, at `information` and `warning` too; severity only
|
|
@@ -161,24 +201,9 @@ optional `severity`, sharing the condition grammar with `produces … when`:
|
|
|
161
201
|
`and` binds tighter than `or`, parentheses group. A conditional rule is an
|
|
162
202
|
implication: `require isExtension == false or newEndDate > endDate`.
|
|
163
203
|
|
|
164
|
-
**Rules whose logic is code.** A bare `rule <Name>`
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
fenced `validate` block for cross-field rules. Excerpt, inside a command:
|
|
168
|
-
|
|
169
|
-
```screenplay
|
|
170
|
-
validate
|
|
171
|
-
orgNumber rule BeAValidOrganizationNumber message "Must be a valid organization number"
|
|
172
|
-
file Validations/BeAValidOrganizationNumber.cs
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
A bodied rule or fenced block on a validation, rule or policy binds as opaque code
|
|
176
|
-
(ESM v3): the reference runner reports it unsupported, and a target must supply the
|
|
177
|
-
implementation. Two exceptions never bind: the command `handler`, and a `file`
|
|
178
|
-
constraint (the binder records the requirement, then rejects it with `PLAY0268`;
|
|
179
|
-
only `unique` constraints bind).
|
|
180
|
-
Stage 4.24 admits only pure reducer bodies, so such a body is gap-fill code there. Prefer a
|
|
181
|
-
declarative rule when one can say it.
|
|
204
|
+
**Rules whose logic is code.** A bare `rule <Name>` has no portable meaning (`PLAY0268`) and a bodied rule binds only as
|
|
205
|
+
opaque code. Read [references/validate-rules.md](references/validate-rules.md) when a rule's logic must live in a `file`
|
|
206
|
+
or fenced code body.
|
|
182
207
|
|
|
183
208
|
**Put format rules on the `concept`, not the command.** A concept carries its own
|
|
184
209
|
`validate` block and every use inherits it — that is Screenplay's type system, and
|
|
@@ -211,65 +236,10 @@ A continuation line extends the clause.
|
|
|
211
236
|
|
|
212
237
|
## Inline events and destinations
|
|
213
238
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
concept ProjectId : Uuid
|
|
219
|
-
concept ProjectName : String
|
|
220
|
-
module Projects
|
|
221
|
-
feature Naming
|
|
222
|
-
slice StateChange RenameProject
|
|
223
|
-
command RenameProject
|
|
224
|
-
projectId ProjectId identifier
|
|
225
|
-
name ProjectName
|
|
226
|
-
produces event ProjectRenamed
|
|
227
|
-
description "A project received a new name"
|
|
228
|
-
documentation
|
|
229
|
-
```markdown
|
|
230
|
-
Existing links retain the project's identity.
|
|
231
|
-
```
|
|
232
|
-
tag audit
|
|
233
|
-
name ProjectName = name
|
|
234
|
-
````
|
|
235
|
-
|
|
236
|
-
The omitted `for` means the command's required scalar identifier **only for
|
|
237
|
-
inline productions**, when every production targets that same source. Once a
|
|
238
|
-
production targets another source, every production must state `for`. Mixing
|
|
239
|
-
omitted inline and plain destinations also fails (`PLAY0470`); there is no
|
|
240
|
-
verified MCP repair for that diagnostic. Explicit syntax does not make cross-source
|
|
241
|
-
execution supported.
|
|
242
|
-
|
|
243
|
-
Plain `produces X` references a declared event; omitting `for` does not infer
|
|
244
|
-
the command's identifier. In ESM v2+, it inherits a sibling production's resolved
|
|
245
|
-
destination through the command destination default. An allocated identity is
|
|
246
|
-
used only when no production resolves a destination. State `for` explicitly on
|
|
247
|
-
every production targeting the identifier. `PLAY0478` offers advice and a
|
|
248
|
-
reviewed repair, not permission to silently retarget an append. Supply an
|
|
249
|
-
allocated identity to the executable model when allocation is intentional.
|
|
250
|
-
|
|
251
|
-
Inline declarations are slice-owned contracts, usable by other consumers.
|
|
252
|
-
Their `tag` lines are event-type tags; plain production tags apply at that one
|
|
253
|
-
append site. Both inline and standalone events accept a quoted description or
|
|
254
|
-
text/Markdown description fence, and one nonempty fenced Markdown `documentation`.
|
|
255
|
-
New events omit `id`. Only a rename preserving an old stored name needs
|
|
256
|
-
`id "<old name>"`; it does not replace the catalog's `EventContractId`.
|
|
257
|
-
|
|
258
|
-
| Diagnostic | What to change |
|
|
259
|
-
| --- | --- |
|
|
260
|
-
| `PLAY0469` | Do not copy the same-source command identifier into payload. Inline copies warn; plain copies with explicit `for` are information. Review persistence before changing a contract. |
|
|
261
|
-
| `PLAY0471` / `PLAY0472` | Remove a redundant name-equal `id`; an id must be one nonempty quoted value. |
|
|
262
|
-
| `PLAY0473` / `PLAY0474` | Avoid declaration/import collisions; inline events belong only in commands, never reactions. |
|
|
263
|
-
| `PLAY0475` | Extract the inline event before adding generations. |
|
|
264
|
-
| `PLAY0476` | Inline `origin` and unescaped system-assigned production metadata are forbidden. |
|
|
265
|
-
| `PLAY0477` | Use one nonempty Markdown documentation fence. |
|
|
266
|
-
|
|
267
|
-
MCP can declare a missing produced event (`PLAY0166`), add explicit routing
|
|
268
|
-
(`PLAY0478`), remove a redundant pin (`PLAY0471`), or remove an inline identifier
|
|
269
|
-
copy (`PLAY0469`). The last **changes the event contract**, retires a property,
|
|
270
|
-
refuses affected consumers/opaque implementations and is not fix-all. It does
|
|
271
|
-
not establish that stored data is safe to migrate. Use
|
|
272
|
-
`cratis-screenplay-model-authoring` for discovery, preview, extraction and rename.
|
|
239
|
+
`produces event` introduces a new generation-1 event. Plain `produces X` without `for` does not infer the identifier:
|
|
240
|
+
state `for` explicitly on every production targeting it.
|
|
241
|
+
Read [references/inline-events.md](references/inline-events.md) when declaring an event inline in `produces event`,
|
|
242
|
+
choosing or omitting `for` on a production, or fixing `PLAY0469`-`PLAY0478`.
|
|
273
243
|
|
|
274
244
|
## `produces`
|
|
275
245
|
|
|
@@ -322,54 +292,12 @@ to the routed scope. This does not make command `reads` protected.
|
|
|
322
292
|
|
|
323
293
|
## Generated values and responses (ESM v7)
|
|
324
294
|
|
|
325
|
-
A `generated`
|
|
326
|
-
`
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
`cratis-screenplay-toolchain
|
|
331
|
-
|
|
332
|
-
```screenplay excerpt
|
|
333
|
-
command RegisterProject
|
|
334
|
-
projectId ProjectId generated identifier
|
|
335
|
-
receiptId ReceiptId generated
|
|
336
|
-
name ProjectName
|
|
337
|
-
returns
|
|
338
|
-
projectId = projectId
|
|
339
|
-
receiptId ReceiptId = receiptId
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
Rules (all read at `v4.68.0`):
|
|
343
|
-
|
|
344
|
-
- `generated` is command-only and needs a required, scalar concept backed by `Uuid` (not bare `Uuid`, not
|
|
345
|
-
optional, not a collection). Modifier order is `Type optional generated identifier`.
|
|
346
|
-
- A generated value is not a request input, form field, invocation argument or ordinary specification value.
|
|
347
|
-
The command runs authorization and validation first, then generates, then productions and the response, so
|
|
348
|
-
authorization policies (also inherited and the implicit `subject` of a generated identifier), property rules
|
|
349
|
-
and requirements cannot reference one (`PLAY0273`), and a concept with any validation rule cannot back a
|
|
350
|
-
generated property (`PLAY0268`). Reactions map request inputs only.
|
|
351
|
-
- `returns <property>` is a scalar response; bare `returns` opens an ordered record of `<name> [<Type>] = <property>`
|
|
352
|
-
fields over direct properties of this command. A type annotation must equal the source's type and
|
|
353
|
-
optionality. Collections, read aliases, arithmetic and whole read models are not supported. At most one
|
|
354
|
-
unconditional response, as a command sibling.
|
|
355
|
-
- A two-token `returns name` is a response when `name` is another property of this command; otherwise it is a
|
|
356
|
-
property named `returns`. `returns @name` forces a response, `@returns Type` a property.
|
|
357
|
-
- A response exists only on acceptance. Rejection, denial or an unsupported outcome has none; a later reaction or
|
|
358
|
-
scenario-query failure keeps the accepted facts and clears the response. A response-only command records no
|
|
359
|
-
facts. Field names are an external contract: renaming one changes the revision.
|
|
360
|
-
- A generated identifier is the implicit destination of inline productions. A plain `produces` without `for` keeps
|
|
361
|
-
its own allocation channel and a generation fixture never satisfies it.
|
|
362
|
-
- Generated values give no idempotency, retry or deduplication guarantee. Specifications supply fixtures and assert
|
|
363
|
-
the response: `cratis-screenplay-specifications`.
|
|
364
|
-
|
|
365
|
-
Other decision 0023 constructs are still **authorable, never executable** (binding reports `PLAY0268`, so
|
|
366
|
-
they stop a model at V1): operations, and named event sources and streams with command routes
|
|
367
|
-
(`eventsource`, `stream`, `streamId`). **No supported ESM version admits them**, and they have no version number
|
|
368
|
-
yet (decision 0025 numbers a version only at its release-ready admission). Syntax or MCP acceptance is not proof of
|
|
369
|
-
execution. A model using sources, streams or routes can be authored and validated, but
|
|
370
|
-
not bound, run or rendered; hand-write the code with the model as contract
|
|
371
|
-
(`cratis-screenplay-toolchain` `references/sources-and-streams.md`). `derive` and `provide` have no documented syntax at that tag; treat them as
|
|
372
|
-
planned and do not write them.
|
|
295
|
+
A `generated` property and a `returns` response need standalone `screenplay` 4.68.0; the cratis CLI reports
|
|
296
|
+
`PLAY0268` and Stage refuses them, so such a command is **not rendered yet**: hand-write it.
|
|
297
|
+
Read [references/generated-values-and-responses.md](references/generated-values-and-responses.md) when adding or
|
|
298
|
+
reviewing `generated` properties, `returns` responses, or decision 0023 constructs.
|
|
299
|
+
Read `cratis-screenplay-toolchain/references/generated-responses-example.md` when adding generated command values or response assertions and you need a complete compiled example.
|
|
300
|
+
Read `cratis-screenplay-toolchain/references/sources-and-streams.md` when authoring named event sources, streams or command routes that require hand-written realization.
|
|
373
301
|
|
|
374
302
|
## `constraint` — uniqueness at append time
|
|
375
303
|
|
|
@@ -407,95 +335,14 @@ hand-written Chronicle `IConstraint`, which can only declare uniqueness; it warn
|
|
|
407
335
|
belongs in `validate`/`require`. Use a constraint when two concurrent appends must
|
|
408
336
|
not both win — a `validate` rule cannot do that.
|
|
409
337
|
|
|
410
|
-
## `concept` and `type`
|
|
411
|
-
|
|
412
|
-
```screenplay
|
|
413
|
-
concept InvoiceId : Uuid
|
|
414
|
-
concept DiscountPercentage : Decimal
|
|
415
|
-
validate
|
|
416
|
-
>= 0 message "A discount cannot be negative"
|
|
417
|
-
<= 100 message "A discount cannot exceed 100 percent"
|
|
418
|
-
concept PersonName : String @pii
|
|
419
|
-
pii reason "Billing contact name; lawful basis: contract performance."
|
|
420
|
-
concept InvoiceStatus : Enum
|
|
421
|
-
draft
|
|
422
|
-
sent
|
|
423
|
-
paid
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
The seven primitives are `Uuid`, `String`, `Int`, `Decimal`, `Bool`, `Date` and
|
|
427
|
-
`DateTime`. `Enum` is **not** one of them — it is a separate concept kind, which
|
|
428
|
-
is why the compiler says *expected … or Enum* rather than listing it among them.
|
|
429
|
-
Attributes `@pii` and `@sensitive`, each with at most one `reason`; a
|
|
430
|
-
reason for an attribute the concept does not declare is an error. **Compliance is
|
|
431
|
-
inherited** — a property typed with a `@pii` concept is PII everywhere. The
|
|
432
|
-
executable model does not bind compliance attributes (`PLAY0268`, "compliance attributes
|
|
433
|
-
require portable data-subject semantics"), so a `@pii` model stops at authorable (V1);
|
|
434
|
-
keep the attribute, because the classification is the point, and never drop it to bind
|
|
435
|
-
or render.
|
|
436
|
-
|
|
437
|
-
⚠️ **Identifiers are not `@pii`.** `@pii` on a concept that types an identifier
|
|
438
|
-
compiles silently, but Chronicle rejects PII on an event source id (`CHR0034`). Keep
|
|
439
|
-
the stream identity a surrogate `Uuid` concept and carry the personal value (name,
|
|
440
|
-
email) as a separate `@pii` property. **`@sensitive` is unverified:** it has no
|
|
441
|
-
defined portable meaning (Screenplay#384). Stage 4.24.0's legacy syntax renderer maps
|
|
442
|
-
`@sensitive` to `[PII]` (`ConceptRenderer.cs:84`, Stage#197), while the current
|
|
443
|
-
`cratis render` path rejects the model with `PLAY0268`. Do not promise a behaviour for it; both issues are open.
|
|
444
|
-
|
|
445
|
-
⚠️ **Enum trap.** A value literally named `validate` is read as an empty validate
|
|
446
|
-
block. Write `@validate` for the value; the compiler warns when it sees the
|
|
447
|
-
ambiguity.
|
|
448
|
-
|
|
449
|
-
Use `type <Name>` for a composite shape (several properties) that events and
|
|
450
|
-
commands reference; use `concept` for a single wrapped primitive.
|
|
451
|
-
|
|
452
338
|
## `policy` and `persona`
|
|
453
339
|
|
|
454
|
-
|
|
455
|
-
policy
|
|
456
|
-
require authenticated
|
|
457
|
-
policy IsAccountant
|
|
458
|
-
require role "Accountant"
|
|
459
|
-
policy CanManageInvoice
|
|
460
|
-
require role "InvoiceManager"
|
|
461
|
-
or role "Accountant"
|
|
462
|
-
policy OwnsInvoice
|
|
463
|
-
require claim "sub" matches subject
|
|
464
|
-
policy IsAdultCustomer
|
|
465
|
-
file Policies/IsAdultCustomer.cs
|
|
466
|
-
|
|
467
|
-
persona Accountant
|
|
468
|
-
description "Handles invoicing and collections"
|
|
469
|
-
policy IsAccountant
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
Three condition forms: `authenticated`, `role "<name>"`, and
|
|
473
|
-
`claim "<name>" matches subject | "<value>" | <path>`. A policy has **exactly one**
|
|
474
|
-
`require` line — continue the condition on deeper-indented lines instead of adding
|
|
475
|
-
a second (`PLAY0441`) — **or** one implementation (a tagged ` ```csharp ` block or
|
|
476
|
-
`file`), never both (`PLAY0440`). Declarative policies run in the reference
|
|
477
|
-
runner; a code policy binds as opaque ESM v3 and needs a target to evaluate it.
|
|
478
|
-
A `persona` is authoring metadata: the binder reports it as information `PLAY0270`
|
|
479
|
-
(report-only) and it does not block binding; an unknown policy it lists is an error.
|
|
480
|
-
|
|
481
|
-
## `seed`
|
|
482
|
-
|
|
483
|
-
Excerpt: `CustomerRegistered` is declared in a slice.
|
|
484
|
-
|
|
485
|
-
```screenplay
|
|
486
|
-
seed
|
|
487
|
-
for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
488
|
-
CustomerRegistered
|
|
489
|
-
name = "Acme Corp"
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
Events append to that event source in declaration order, using the same mapping
|
|
493
|
-
expression grammar as `produces`. Several `seed` blocks accumulate. Seeding is
|
|
494
|
-
operational metadata, not part of executable behavior (`PLAY0270`).
|
|
340
|
+
A policy has **exactly one** `require` line (`PLAY0441`) **or** one implementation, never both (`PLAY0440`). Read [references/policy-persona-seed.md](references/policy-persona-seed.md) when
|
|
341
|
+
declaring a policy, a persona, or a `seed` block.
|
|
495
342
|
|
|
496
343
|
## `$context`
|
|
497
344
|
|
|
498
|
-
Four contexts, and **what each omits is load-bearing** — read
|
|
345
|
+
Four contexts, and **what each omits is load-bearing** — when writing a code body or a context/expression mapping, read
|
|
499
346
|
[context.md](references/context.md) for the full member lists, the declarative
|
|
500
347
|
`$context.` paths, and `$causedBy` / `$env` / `$strings`.
|
|
501
348
|
|
|
@@ -521,11 +368,13 @@ Four contexts, and **what each omits is load-bearing** — read
|
|
|
521
368
|
- [ ] Constraints are `unique` forms; no `file` constraint stands in for another rule.
|
|
522
369
|
- [ ] Each policy has one `require` or one implementation, not both.
|
|
523
370
|
- [ ] Personal data is `@pii` on the concept, with a reason; no identifier concept is `@pii`;
|
|
524
|
-
|
|
371
|
+
operational secrets are `@sensitive` (never `@pii`), and no identifier concept carries either.
|
|
525
372
|
- [ ] No `handler` where the model must bind, and no bodied construct described as
|
|
526
373
|
runnable or renderable without saying which tool admits it.
|
|
527
374
|
- [ ] No event carries an optional property covering two situations.
|
|
528
375
|
|
|
376
|
+
Read `cratis-screenplay-toolchain/references/versions.md` when selecting a compiler or determining which executable or renderable subset admits a construct.
|
|
377
|
+
|
|
529
378
|
Versions, tool capabilities and the executable and renderable subsets: `cratis-screenplay-toolchain` (`references/versions.md`). Where a construct sits in the
|
|
530
379
|
method: `cratis-screenplay-modeling-lifecycle` and `cratis-screenplay-slice-design`.
|
|
531
380
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Contexts and context expressions
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- The four contexts
|
|
6
|
+
- The values they carry
|
|
7
|
+
- Reaching the context declaratively
|
|
8
|
+
- Production metadata is not a context expression
|
|
9
|
+
- The other expression roots
|
|
10
|
+
- Templates and literals
|
|
11
|
+
- Escaping
|
|
12
|
+
|
|
3
13
|
Four contexts, one per job. What each **omits** is as deliberate as what it
|
|
4
14
|
carries: a validation rule cannot see the caller's roles, and a policy cannot see
|
|
5
15
|
the causation chain.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
## Generated values and responses (ESM v7)
|
|
2
|
+
|
|
3
|
+
A `generated` command property and a `returns` response bind and execute from the standalone
|
|
4
|
+
`screenplay` 4.68.0 (ESM v7, decision 0026; `commands.md` "Generated values and responses" at
|
|
5
|
+
`v4.68.0`). The cratis CLI 3.28.3 bundles 4.66.0 and reports `PLAY0268` for them, and Stage 4.24.2
|
|
6
|
+
refuses ESM v7 with `STAGE-ESM-016` (tracked in Stage#201), so a command that uses them is
|
|
7
|
+
**not rendered yet**: hand-write it (gap-fill) with the model as the contract. Complete compiled example:
|
|
8
|
+
`cratis-screenplay-toolchain` `references/generated-responses-example.md`.
|
|
9
|
+
|
|
10
|
+
```screenplay excerpt
|
|
11
|
+
command RegisterProject
|
|
12
|
+
projectId ProjectId generated identifier
|
|
13
|
+
receiptId ReceiptId generated
|
|
14
|
+
name ProjectName
|
|
15
|
+
returns
|
|
16
|
+
projectId = projectId
|
|
17
|
+
receiptId ReceiptId = receiptId
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Rules (all read at `v4.68.0`):
|
|
21
|
+
|
|
22
|
+
- `generated` is command-only and needs a required, scalar concept backed by `Uuid` (not bare `Uuid`, not
|
|
23
|
+
optional, not a collection). Modifier order is `Type optional generated identifier`.
|
|
24
|
+
- A generated value is not a request input, form field, invocation argument or ordinary specification value.
|
|
25
|
+
The command runs authorization and validation first, then generates, then productions and the response, so
|
|
26
|
+
authorization policies (also inherited and the implicit `subject` of a generated identifier), property rules
|
|
27
|
+
and requirements cannot reference one (`PLAY0273`), and a concept with any validation rule cannot back a
|
|
28
|
+
generated property (`PLAY0268`). Reactions map request inputs only.
|
|
29
|
+
- `returns <property>` is a scalar response; bare `returns` opens an ordered record of `<name> [<Type>] = <property>`
|
|
30
|
+
fields over direct properties of this command. A type annotation must equal the source's type and
|
|
31
|
+
optionality. Collections, read aliases, arithmetic and whole read models are not supported. At most one
|
|
32
|
+
unconditional response, as a command sibling.
|
|
33
|
+
- A two-token `returns name` is a response when `name` is another property of this command; otherwise it is a
|
|
34
|
+
property named `returns`. `returns @name` forces a response, `@returns Type` a property.
|
|
35
|
+
- A response exists only on acceptance. Rejection, denial or an unsupported outcome has none; a later reaction or
|
|
36
|
+
scenario-query failure keeps the accepted facts and clears the response. A response-only command records no
|
|
37
|
+
facts. Field names are an external contract: renaming one changes the revision.
|
|
38
|
+
- A generated identifier is the implicit destination of inline productions. A plain `produces` without `for` keeps
|
|
39
|
+
its own allocation channel and a generation fixture never satisfies it.
|
|
40
|
+
- Generated values give no idempotency, retry or deduplication guarantee. Specifications supply fixtures and assert
|
|
41
|
+
the response: `cratis-screenplay-specifications`.
|
|
42
|
+
|
|
43
|
+
Other decision 0023 constructs are still **authorable, never executable** (binding reports `PLAY0268`, so
|
|
44
|
+
they stop a model at V1): operations, and named event sources and streams with command routes
|
|
45
|
+
(`eventsource`, `stream`, `streamId`). **No supported ESM version admits them**, and they have no version number
|
|
46
|
+
yet (decision 0025 numbers a version only at its release-ready admission). Syntax or MCP acceptance is not proof of
|
|
47
|
+
execution. A model using sources, streams or routes can be authored and validated, but
|
|
48
|
+
not bound, run or rendered; hand-write the code with the model as contract
|
|
49
|
+
(`cratis-screenplay-toolchain` `references/sources-and-streams.md`). `derive` and `provide` have no documented syntax at that tag; treat them as
|
|
50
|
+
planned and do not write them.
|
|
51
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## Inline events and destinations
|
|
2
|
+
|
|
3
|
+
Use `produces event` when the command introduces a new, generation-1 event.
|
|
4
|
+
This complete example declares its payload and mappings together:
|
|
5
|
+
|
|
6
|
+
````screenplay
|
|
7
|
+
concept ProjectId : Uuid
|
|
8
|
+
concept ProjectName : String
|
|
9
|
+
module Projects
|
|
10
|
+
feature Naming
|
|
11
|
+
slice StateChange RenameProject
|
|
12
|
+
command RenameProject
|
|
13
|
+
projectId ProjectId identifier
|
|
14
|
+
name ProjectName
|
|
15
|
+
produces event ProjectRenamed
|
|
16
|
+
description "A project received a new name"
|
|
17
|
+
documentation
|
|
18
|
+
```markdown
|
|
19
|
+
Existing links retain the project's identity.
|
|
20
|
+
```
|
|
21
|
+
tag audit
|
|
22
|
+
name ProjectName = name
|
|
23
|
+
````
|
|
24
|
+
|
|
25
|
+
The omitted `for` means the command's required scalar identifier **only for
|
|
26
|
+
inline productions**, when every production targets that same source. Once a
|
|
27
|
+
production targets another source, every production must state `for`. Mixing
|
|
28
|
+
omitted inline and plain destinations also fails (`PLAY0470`); there is no
|
|
29
|
+
verified MCP repair for that diagnostic. Explicit syntax does not make cross-source
|
|
30
|
+
execution supported.
|
|
31
|
+
|
|
32
|
+
Plain `produces X` references a declared event; omitting `for` does not infer
|
|
33
|
+
the command's identifier. In ESM v2+, it inherits a sibling production's resolved
|
|
34
|
+
destination through the command destination default. An allocated identity is
|
|
35
|
+
used only when no production resolves a destination. State `for` explicitly on
|
|
36
|
+
every production targeting the identifier. `PLAY0478` offers advice and a
|
|
37
|
+
reviewed repair, not permission to silently retarget an append. Supply an
|
|
38
|
+
allocated identity to the executable model when allocation is intentional.
|
|
39
|
+
|
|
40
|
+
Inline declarations are slice-owned contracts, usable by other consumers.
|
|
41
|
+
Their `tag` lines are event-type tags; plain production tags apply at that one
|
|
42
|
+
append site. Both inline and standalone events accept a quoted description or
|
|
43
|
+
text/Markdown description fence, and one nonempty fenced Markdown `documentation`.
|
|
44
|
+
New events omit `id`. Only a rename preserving an old stored name needs
|
|
45
|
+
`id "<old name>"`; it does not replace the catalog's `EventContractId`.
|
|
46
|
+
|
|
47
|
+
| Diagnostic | What to change |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `PLAY0469` | Do not copy the same-source command identifier into payload. Inline copies warn; plain copies with explicit `for` are information. Review persistence before changing a contract. |
|
|
50
|
+
| `PLAY0471` / `PLAY0472` | Remove a redundant name-equal `id`; an id must be one nonempty quoted value. |
|
|
51
|
+
| `PLAY0473` / `PLAY0474` | Avoid declaration/import collisions; inline events belong only in commands, never reactions. |
|
|
52
|
+
| `PLAY0475` | Extract the inline event before adding generations. |
|
|
53
|
+
| `PLAY0476` | Inline `origin` and unescaped system-assigned production metadata are forbidden. |
|
|
54
|
+
| `PLAY0477` | Use one nonempty Markdown documentation fence. |
|
|
55
|
+
|
|
56
|
+
MCP can declare a missing produced event (`PLAY0166`), add explicit routing
|
|
57
|
+
(`PLAY0478`), remove a redundant pin (`PLAY0471`), or remove an inline identifier
|
|
58
|
+
copy (`PLAY0469`). The last **changes the event contract**, retires a property,
|
|
59
|
+
refuses affected consumers/opaque implementations and is not fix-all. It does
|
|
60
|
+
not establish that stored data is safe to migrate. Use
|
|
61
|
+
`cratis-screenplay-model-authoring` for discovery, preview, extraction and rename.
|
|
62
|
+
|
package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Policies, personas and seed
|
|
2
|
+
|
|
3
|
+
## `policy` and `persona`
|
|
4
|
+
|
|
5
|
+
```screenplay
|
|
6
|
+
policy IsAuthenticated
|
|
7
|
+
require authenticated
|
|
8
|
+
policy IsAccountant
|
|
9
|
+
require role "Accountant"
|
|
10
|
+
policy CanManageInvoice
|
|
11
|
+
require role "InvoiceManager"
|
|
12
|
+
or role "Accountant"
|
|
13
|
+
policy OwnsInvoice
|
|
14
|
+
require claim "sub" matches subject
|
|
15
|
+
policy IsAdultCustomer
|
|
16
|
+
file Policies/IsAdultCustomer.cs
|
|
17
|
+
|
|
18
|
+
persona Accountant
|
|
19
|
+
description "Handles invoicing and collections"
|
|
20
|
+
policy IsAccountant
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Three condition forms: `authenticated`, `role "<name>"`, and
|
|
24
|
+
`claim "<name>" matches subject | "<value>" | <path>`. A policy has **exactly one**
|
|
25
|
+
`require` line — continue the condition on deeper-indented lines instead of adding
|
|
26
|
+
a second (`PLAY0441`) — **or** one implementation (a tagged ` ```csharp ` block or
|
|
27
|
+
`file`), never both (`PLAY0440`). Declarative policies run in the reference
|
|
28
|
+
runner; a code policy binds as opaque ESM v3 and needs a target to evaluate it.
|
|
29
|
+
A `persona` is authoring metadata: the binder reports it as information `PLAY0270`
|
|
30
|
+
(report-only) and it does not block binding; an unknown policy it lists is an error.
|
|
31
|
+
|
|
32
|
+
## `seed`
|
|
33
|
+
|
|
34
|
+
Excerpt: `CustomerRegistered` is declared in a slice.
|
|
35
|
+
|
|
36
|
+
```screenplay
|
|
37
|
+
seed
|
|
38
|
+
for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
39
|
+
CustomerRegistered
|
|
40
|
+
name = "Acme Corp"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Events append to that event source in declaration order, using the same mapping
|
|
44
|
+
expression grammar as `produces`. Several `seed` blocks accumulate. Seeding is
|
|
45
|
+
operational metadata, not part of executable behavior (`PLAY0270`).
|
|
46
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Validation rule forms
|
|
2
|
+
|
|
3
|
+
## Rule vocabulary
|
|
4
|
+
|
|
5
|
+
| Rule | Example |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `not empty` | `name not empty` |
|
|
8
|
+
| `max <n>` / `min <n>` | `reason max 500` (length on text), `quantity min 1` (value on numbers) |
|
|
9
|
+
| `> <v>` / `>= <v>` / `< <v>` / `<= <v>` | `quantity > 0`, `discountPct <= 100` |
|
|
10
|
+
| `== <v>` / `!= <v>` | `currency == "NOK"`, `status != draft` |
|
|
11
|
+
| `length == <n>` | `currency length == 3` |
|
|
12
|
+
| `matches email` | the only named pattern; any other name is `PLAY0366` |
|
|
13
|
+
| `matches "<regex>"` | ECMAScript; matches **any substring** unless anchored with `^…$`; an invalid pattern is `PLAY0367` |
|
|
14
|
+
| `all > <v>` / `all >= <v>` | `lines.quantity all > 0` |
|
|
15
|
+
| `rule <Name>` | `orgNumber rule BeAValidOrganizationNumber` |
|
|
16
|
+
|
|
17
|
+
## Rules whose logic is code
|
|
18
|
+
|
|
19
|
+
**Rules whose logic is code.** A bare `rule <Name>` records that a rule exists but
|
|
20
|
+
has no portable meaning (`PLAY0268`). Give it a body when the logic can live in the
|
|
21
|
+
model — a `file` or a tagged ` ```csharp ` fence indented under the rule, or a
|
|
22
|
+
fenced `validate` block for cross-field rules. Excerpt, inside a command:
|
|
23
|
+
|
|
24
|
+
```screenplay
|
|
25
|
+
validate
|
|
26
|
+
orgNumber rule BeAValidOrganizationNumber message "Must be a valid organization number"
|
|
27
|
+
file Validations/BeAValidOrganizationNumber.cs
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A bodied rule or fenced block on a validation, rule or policy binds as opaque code
|
|
31
|
+
(ESM v3): the reference runner reports it unsupported, and a target must supply the
|
|
32
|
+
implementation. Two exceptions never bind: the command `handler`, and a `file`
|
|
33
|
+
constraint (the binder records the requirement, then rejects it with `PLAY0268`;
|
|
34
|
+
only `unique` constraints bind).
|
|
35
|
+
Stage 4.24 admits only pure reducer bodies, so such a body is gap-fill code there. Prefer a
|
|
36
|
+
declarative rule when one can say it.
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
6
|
{ "kind": "skill-contains", "value": "main `fd18129`" },
|
|
7
|
-
{ "kind": "skill-contains", "value": "produces event ProjectRenamed" },
|
|
8
|
-
{ "kind": "skill-contains", "value": "name ProjectName = name" },
|
|
9
|
-
{ "kind": "skill-contains", "value": "In ESM v2+, it inherits a sibling production's resolved\ndestination through the command destination default" },
|
|
10
|
-
{ "kind": "skill-contains", "value": "An allocated identity is\nused only when no production resolves a destination" },
|
|
11
|
-
{ "kind": "skill-contains", "value": "State `for` explicitly on\nevery production targeting the identifier" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "produces event ProjectRenamed", "file": "references/inline-events.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "name ProjectName = name", "file": "references/inline-events.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "In ESM v2+, it inherits a sibling production's resolved\ndestination through the command destination default", "file": "references/inline-events.md" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "An allocated identity is\nused only when no production resolves a destination", "file": "references/inline-events.md" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "State `for` explicitly on\nevery production targeting the identifier", "file": "references/inline-events.md" },
|
|
12
12
|
{ "kind": "skill-contains", "value": "PLAY0478" },
|
|
13
13
|
{ "kind": "skill-contains", "value": "PLAY0479" },
|
|
14
|
-
{ "kind": "skill-contains", "value": "changes the event contract" },
|
|
14
|
+
{ "kind": "skill-contains", "value": "changes the event contract", "file": "references/inline-events.md" },
|
|
15
15
|
{ "kind": "skill-contains", "value": "`reads X optional` is not supported yet" },
|
|
16
16
|
{
|
|
17
17
|
"kind": "skill-contains",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"kind": "skill-contains",
|
|
78
|
-
"value": "No supported ESM version admits them"
|
|
78
|
+
"value": "No supported ESM version admits them", "file": "references/generated-values-and-responses.md"
|
|
79
79
|
},
|
|
80
80
|
{ "kind": "skill-contains", "value": "Generated values and responses (ESM v7)" },
|
|
81
|
-
{ "kind": "skill-contains", "value": "A generated value is not a request input" },
|
|
82
|
-
{ "kind": "skill-contains", "value": "(`PLAY0273`), and a concept with any validation rule cannot back a\n generated property (`PLAY0268`)" },
|
|
83
|
-
{ "kind": "skill-contains", "value": "A response exists only on acceptance" },
|
|
84
|
-
{ "kind": "skill-contains", "value": "**not rendered yet**" },
|
|
81
|
+
{ "kind": "skill-contains", "value": "A generated value is not a request input", "file": "references/generated-values-and-responses.md" },
|
|
82
|
+
{ "kind": "skill-contains", "value": "(`PLAY0273`), and a concept with any validation rule cannot back a\n generated property (`PLAY0268`)", "file": "references/generated-values-and-responses.md" },
|
|
83
|
+
{ "kind": "skill-contains", "value": "A response exists only on acceptance", "file": "references/generated-values-and-responses.md" },
|
|
84
|
+
{ "kind": "skill-contains", "value": "**not rendered yet**", "file": "references/generated-values-and-responses.md" },
|
|
85
85
|
{ "kind": "skill-contains", "value": "4.68.0" }
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -33,6 +33,13 @@ syntax and tool commands in `cratis-screenplay-toolchain`.
|
|
|
33
33
|
entry-point session proposes a model, at most once per session; the master definition is in
|
|
34
34
|
`cratis-screenplay-modeling-lifecycle`. A direct request to model this scope is itself consent.
|
|
35
35
|
|
|
36
|
+
## Evidence and privacy
|
|
37
|
+
|
|
38
|
+
- Do not paste production data, customer records or personal data into hosted models or
|
|
39
|
+
sub-agents without the user's approval. Use invented examples in the model and in
|
|
40
|
+
specifications.
|
|
41
|
+
- Classify personal data on the concept as soon as it shows up.
|
|
42
|
+
|
|
36
43
|
## Verified product sources
|
|
37
44
|
|
|
38
45
|
Pins (Screenplay v4.66.0 `c89198b`, cratis CLI v3.28.3, Stage v4.24.2, Arc v22.50.5, Chronicle
|
|
@@ -221,10 +228,10 @@ and the report says which verdicts were not run (V2 to V5 are not run in discove
|
|
|
221
228
|
- `references/personas-and-causes.md` - role catalogue, Cannot resolved to executable gates.
|
|
222
229
|
- `references/divergent-sweep.md` - lenses for the wide pass.
|
|
223
230
|
- `references/plotting-and-handoff.md` - after / caused by / only if, plot format, whose turn it is, Storyline seed, handoff packet.
|
|
224
|
-
- `references/facilitation.md` - running sessions, disagreement, closing, unattended runs.
|
|
231
|
+
- `references/facilitation.md` - running sessions, disagreement, closing, unattended runs. Read when facilitating a group, handling disagreement, or closing an attended or unattended session.
|
|
225
232
|
- `references/human-workshop.md` - supporting a human workshop: preparation, run sheet, live scribing.
|
|
226
|
-
- `references/worked-session.md` - a short session end to end.
|
|
227
|
-
- `references/provenance.md` - sources and attribution.
|
|
233
|
+
- `references/worked-session.md` - a short session end to end. Read when you need an end-to-end example of discovery from thin input.
|
|
234
|
+
- `references/provenance.md` - sources and attribution. Read when checking source attribution or adaptation history.
|
|
228
235
|
|
|
229
236
|
## Lineage
|
|
230
237
|
|
|
@@ -42,12 +42,7 @@ that decision. If not, note the need as a view and move on.
|
|
|
42
42
|
- Prefer assumptions that keep the model honest (fewer, clearly named facts) over ones that
|
|
43
43
|
invent detail.
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- Do not paste production data, customer records or personal data into hosted models or
|
|
48
|
-
sub-agents without the user's approval. Use invented examples in the model and in
|
|
49
|
-
specifications.
|
|
50
|
-
- Classify personal data on the concept as soon as it shows up.
|
|
45
|
+
See "Evidence and privacy" in SKILL.md.
|
|
51
46
|
|
|
52
47
|
## Closing a session
|
|
53
48
|
|