@cratis/pi 7.51.3 → 7.51.4
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/harnesses/copilot/instructions/authoring-skills.instructions.md +1 -1
- package/package/corpus/rules/authoring-skills.md +1 -1
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +4 -55
- package/package/corpus/skills/cratis-application-slice-specifications/references/command-result-assertions.md +36 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/reading-play-specifications.md +30 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +4 -69
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +8 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +9 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +19 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/identity-endpoints.md +40 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/local-development.md +7 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +8 -99
- package/package/corpus/skills/cratis-arc-command/references/causation-details.md +26 -0
- package/package/corpus/skills/cratis-arc-command/references/client-contract.md +16 -0
- package/package/corpus/skills/cratis-arc-command/references/event-source-id-details.md +13 -0
- package/package/corpus/skills/cratis-arc-command/references/generation-boundaries.md +8 -0
- package/package/corpus/skills/cratis-arc-command/references/product-sources.md +16 -0
- package/package/corpus/skills/cratis-arc-command/references/provide-example.md +19 -0
- package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +8 -0
- package/package/corpus/skills/cratis-arc-command/references/return-shape-examples.md +24 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/SKILL.md +3 -61
- package/package/corpus/skills/cratis-arc-command-kotlin/references/artifacts.md +16 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/references/authorization-override-example.md +17 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/references/project-setup.md +40 -0
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +4 -105
- package/package/corpus/skills/cratis-arc-command-typescript/references/parameter-binding.md +26 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/project-setup.md +89 -0
- package/package/corpus/skills/cratis-arc-query-typescript/SKILL.md +3 -74
- package/package/corpus/skills/cratis-arc-query-typescript/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-arc-query-typescript/references/scenario-example.md +23 -0
- package/package/corpus/skills/cratis-arc-query-typescript/references/storage-examples.md +52 -0
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +3 -63
- package/package/corpus/skills/cratis-arc-react-page/references/data-page.md +28 -0
- package/package/corpus/skills/cratis-arc-react-page/references/dialogs.md +47 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +3 -80
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/connection-options.md +61 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/lifecycle.md +30 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +8 -101
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/client-options.md +43 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/idioms-and-inspection.md +35 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/product-sources.md +10 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/reactor-example.md +33 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +7 -88
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/annotations-and-handlers.md +32 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/append-concurrency.md +9 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-string.md +27 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/event-type-annotations.md +9 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/product-sources.md +13 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/read-models-and-projections.md +29 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +3 -103
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/connection-options.md +52 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/lifecycle.md +31 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/project-setup.md +36 -0
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +1 -21
- package/package/corpus/skills/cratis-chronicle-projection/references/definition-changes.md +27 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +5 -110
- package/package/corpus/skills/cratis-chronicle-reactor/references/cross-service-events.md +13 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/filtering.md +34 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/read-model-injection.md +29 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/return-event-metadata.md +51 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +7 -92
- package/package/corpus/skills/cratis-chronicle-reducer/references/filtering.md +36 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/instance-reducer-example.md +20 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/product-sources.md +8 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/replay-hooks-and-definition-changes.md +35 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/specification-example.md +15 -0
- package/package/corpus/skills/cratis-components-styling/SKILL.md +1 -15
- package/package/corpus/skills/cratis-components-styling/references/renderer-adapters.md +21 -0
- package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +1 -24
- package/package/corpus/skills/cratis-governed-release-methodology/references/lifecycle-phases.md +30 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +2 -15
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +3 -93
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +37 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-declaration.md +48 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-reads-example.md +16 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +5 -97
- package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +9 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +89 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/routes-and-external-operations.md +21 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +5 -38
- package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +14 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/neighbouring-skills.md +14 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +9 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/product-sources.md +16 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +6 -74
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/facilitation-stance.md +12 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/file-layout.md +19 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/modeling-reasoning.md +13 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/neighbouring-skills.md +16 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +33 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +6 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -17
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +18 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -89
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +6 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/layout.md +30 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/repairs.md +42 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/state-and-recovery.md +30 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +10 -42
- package/package/corpus/skills/cratis-screenplay-model-review/references/baseline-comparison.md +7 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +11 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/interview-batch.md +14 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/model-inventory-report.md +8 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +21 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +15 -68
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/completeness-self-check.md +12 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +15 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/independent-review.md +10 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/per-turn-protocol.md +5 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/product-sources.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +12 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +25 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +8 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +3 -67
- package/package/corpus/skills/cratis-screenplay-projections/references/joins.md +41 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/variants.md +41 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -31
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +9 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/neighbouring-skills.md +11 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/product-sources.md +23 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +11 -75
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/interview-batch.md +16 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +12 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/quality-checklist.md +17 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/review-questions.md +9 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +28 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/version-skew.md +14 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +18 -94
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +25 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/identity-edits.md +14 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/product-sources.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/public-boundaries-and-keys.md +16 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +36 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +17 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +5 -63
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +6 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md +33 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +40 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +11 -77
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +21 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +18 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/interview-batch.md +20 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/product-sources.md +12 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/review-questions.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +15 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -8
- package/package/corpus/skills/cratis-screenplay-toolchain/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +6 -99
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +38 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/layout-arrangement.md +31 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/localized-strings.md +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +6 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +34 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +1 -10
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/neighbouring-skills.md +14 -0
- package/package.json +1 -1
|
@@ -70,13 +70,7 @@ even when it blocks binding. Never record bearer tokens, magic links or signed U
|
|
|
70
70
|
(a keyed hash or reference at most), and never put PII on the event-source id.
|
|
71
71
|
|
|
72
72
|
## Product sources
|
|
73
|
-
|
|
74
|
-
`Documentation/screenplay/{reactions,captures,triggers,specifications,diagnostics}.md`;
|
|
75
|
-
renderer claims from Stage `Documentation/reference/reaction-rendering.md`: supported
|
|
76
|
-
event-triggered Automation renders; Translate/captures and refused reactions stay gap-fill.
|
|
77
|
-
Runtime facts: Arc `ExecuteCommandsAsSystemAttribute` and mixed events-and-commands reactor
|
|
78
|
-
returns; Chronicle `OnceOnlyAttribute`, `ReactorDelivery`, `Documentation/code-analysis/CHR0022.mdx`
|
|
79
|
-
and `Documentation/reactors/delivery-identity.mdx`.
|
|
73
|
+
Read [references/product-sources.md](references/product-sources.md) when checking a claim against the Screenplay, Stage, Arc or Chronicle sources.
|
|
80
74
|
|
|
81
75
|
Requires Screenplay 4.125.0 or later (`screenplay --version`) for reaction `runs as system role` (ESM v10).
|
|
82
76
|
|
|
@@ -215,14 +209,7 @@ Never report a verdict without the tool and version that produced it.
|
|
|
215
209
|
- Every complete example compiles. Read `references/todo-list-example.md` when modeling a pending-work automation (its design-only excerpts insert into `assets/pending-certificates.play` and `assets/retry-sweep.play`), and `references/translate-example.md` when modeling capture plus translator reactions.
|
|
216
210
|
|
|
217
211
|
## Route near misses
|
|
218
|
-
|
|
219
|
-
triggers versus UI interactions: `cratis-screenplay-ui-composition`.
|
|
220
|
-
- Stream identity, constraints, races: `cratis-screenplay-streams-and-consistency`.
|
|
221
|
-
- Specifications for these slices: `cratis-screenplay-scenario-coverage`, then `cratis-screenplay-specifications`.
|
|
222
|
-
- Rendering, gap-fill and delivery route: `cratis-screenplay-render-and-gap-fill`.
|
|
223
|
-
- Legacy database-only writes: `cratis-screenplay-legacy-extraction` classifies them first; not
|
|
224
|
-
automatically Translate.
|
|
225
|
-
- Hand-written reactors and replay semantics: `cratis-chronicle-reactor`.
|
|
212
|
+
Read [references/neighbouring-skills.md](references/neighbouring-skills.md) when the work is grammar, streams, specifications, rendering, legacy writes or hand-written reactors.
|
|
226
213
|
|
|
227
214
|
## Lineage
|
|
228
215
|
Read `references/provenance.md` when checking sources, adaptations, attribution, or approaches deliberately not adopted.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Neighbouring skills
|
|
2
|
+
|
|
3
|
+
Which skill owns each task next to automations and translations.
|
|
4
|
+
|
|
5
|
+
- Grammar: `cratis-screenplay-captures-and-reactions`; invoked commands: `cratis-screenplay-command-surface`;
|
|
6
|
+
triggers versus UI interactions: `cratis-screenplay-ui-composition`.
|
|
7
|
+
- Stream identity, constraints, races: `cratis-screenplay-streams-and-consistency`.
|
|
8
|
+
- Specifications for these slices: `cratis-screenplay-scenario-coverage`, then `cratis-screenplay-specifications`.
|
|
9
|
+
- Rendering, gap-fill and delivery route: `cratis-screenplay-render-and-gap-fill`.
|
|
10
|
+
- Legacy database-only writes: `cratis-screenplay-legacy-extraction` classifies them first; not
|
|
11
|
+
automatically Translate.
|
|
12
|
+
- Hand-written reactors and replay semantics: `cratis-chronicle-reactor`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Product sources
|
|
2
|
+
|
|
3
|
+
Sources behind the automation and translation claims.
|
|
4
|
+
|
|
5
|
+
Tool versions: toolchain `SKILL.md`. Language claims come from Screenplay
|
|
6
|
+
`Documentation/screenplay/{reactions,captures,triggers,specifications,diagnostics}.md`;
|
|
7
|
+
renderer claims from Stage `Documentation/reference/reaction-rendering.md`: supported
|
|
8
|
+
event-triggered Automation renders; Translate/captures and refused reactions stay gap-fill.
|
|
9
|
+
Runtime facts: Arc `ExecuteCommandsAsSystemAttribute` and mixed events-and-commands reactor
|
|
10
|
+
returns; Chronicle `OnceOnlyAttribute`, `ReactorDelivery`, `Documentation/code-analysis/CHR0022.mdx`
|
|
11
|
+
and `Documentation/reactors/delivery-identity.mdx`.
|
|
@@ -118,42 +118,7 @@ The full capture excerpt (`source`, `key`, `map` with `translate`, two `append`
|
|
|
118
118
|
|
|
119
119
|
Read [references/capture-map-and-example.md](references/capture-map-and-example.md) when writing a capture's `map` block, or when you need the excerpt of a capture with `append` and `children`.
|
|
120
120
|
|
|
121
|
-
**`source <kind>`**
|
|
122
|
-
`api` (`api`, `route`, `poll`), `webhook` (`path`) and `message` (`topic`).
|
|
123
|
-
⚠️ The grammar is **open** — the parser accepts any kind and any setting name as
|
|
124
|
-
free-form name/value pairs, so a typo is not caught. The three kinds are
|
|
125
|
-
convention, not enforcement. `source events` (`from <Event>` lines, ESM v9) is the exception, with
|
|
126
|
-
its own closed grammar (PLAY0610/0612/0616/0619/0620).
|
|
127
|
-
|
|
128
|
-
**`key <property>`** names the source property identifying an instance. From ESM v6
|
|
129
|
-
a capture without a `key` does not bind (`PLAY0268`). In a specification the
|
|
130
|
-
reference is handed records (`given capture`, `when capture`) and never contacts a
|
|
131
|
-
`source`, which stays realization metadata; events append to the event source the
|
|
132
|
-
record's `key` names, and `$context.occurred` is the scenario's `given clock`.
|
|
133
|
-
|
|
134
|
-
An event's external origin is declared on the `event` itself with `event X from "<origin>"` (ESM v9);
|
|
135
|
-
outside records still enter through a `capture` in a `Translate` slice
|
|
136
|
-
(`cratis-screenplay-automations-and-translations` `references/public-events-and-direction.md`).
|
|
137
|
-
|
|
138
|
-
**`map`** reshapes properties before events are appended (rename, template, `translate`, `split`; mapping sources are `$.`, `$context.` and `$env.`); syntax is in the reference file linked above.
|
|
139
|
-
|
|
140
|
-
**`append <Event>`** with optional `tag` lines and one `when` clause:
|
|
141
|
-
|
|
142
|
-
| `when` form | Appends when |
|
|
143
|
-
| --- | --- |
|
|
144
|
-
| `when added` | an item appears in the source |
|
|
145
|
-
| `when removed` | an item disappears from the source |
|
|
146
|
-
| `when <Path>` | that property changes |
|
|
147
|
-
| `when <Path> from <v> to <v>` | that property makes that exact transition |
|
|
148
|
-
| `when <a> or <b> [or <c>]` | any of those properties change |
|
|
149
|
-
| `when <a> and <b> [and <c>]` | all of those properties change |
|
|
150
|
-
| ``when `<expression>` `` | a raw template expression is true (captured verbatim; from ESM v6 the reference evaluates fields, literals, `==`, `!=`, the ordering operators, `&&`, `||`, `!` and parentheses, and an expression outside that grammar does not bind) |
|
|
151
|
-
|
|
152
|
-
⚠️ **`or` and `and` cannot be mixed in one clause** — `when a or b and c` is a
|
|
153
|
-
compile error. Split it into two `append` blocks.
|
|
154
|
-
|
|
155
|
-
**`children <collection> identified by <path>`** and **`nested <path>`** each take
|
|
156
|
-
an optional `map` and any number of `append` blocks.
|
|
121
|
+
**`source <kind>`** takes free-form settings, so a typo is not caught; **`key <property>`** is required to bind (`PLAY0268`); **`append <Event>`** takes one `when` clause, and `or` and `and` cannot be mixed in one clause (split into two `append` blocks). Read [references/capture-map-and-example.md](references/capture-map-and-example.md) for source kinds, `key` and specification behavior, the `when` forms table, `children` and `nested`.
|
|
157
122
|
|
|
158
123
|
## `reaction`
|
|
159
124
|
|
|
@@ -259,68 +224,13 @@ The excerpt of a reaction with `reads` on an event and on the clock is in the re
|
|
|
259
224
|
|
|
260
225
|
Read [references/trigger-reads-example.md](references/trigger-reads-example.md) when writing a trigger `reads` with `by` or an alias, or a clock trigger that reads a whole view.
|
|
261
226
|
|
|
262
|
-
- `reads`
|
|
263
|
-
Each trigger declares its own.
|
|
264
|
-
- **`by` names a value that trigger takes** (`invoiceId` above). Naming anything
|
|
265
|
-
else is warning `PLAY0442`.
|
|
266
|
-
- **Clock triggers read whole views.** `every` and `at` take no values, so
|
|
267
|
-
`reads <View>` works under them but `by` is error `PLAY0443`.
|
|
268
|
-
- **Aliases follow the command rules.** A view read more than once needs an
|
|
269
|
-
alias on every read (`PLAY0410`), aliases are unique per trigger (`PLAY0411`),
|
|
270
|
-
and an alias must not match a trigger value (`PLAY0412`). A view no projection
|
|
271
|
-
in the document produces is warning `PLAY0177`.
|
|
272
|
-
- **`reads` is a directive in a trigger body.** A trigger value named `reads` is
|
|
273
|
-
written `@reads`. A bare `reads` line is error `PLAY0175`, and
|
|
274
|
-
`reads <PrimitiveType>` is warning `PLAY0444`; both messages name the escape.
|
|
275
|
-
- `for each <View>` is reserved for a future view-driven trigger. It is not a
|
|
276
|
-
trigger in the verified Screenplay versions (`PLAY0137`).
|
|
227
|
+
- `reads` goes under a trigger; `by` names a value that trigger takes (else `PLAY0442`); **Clock triggers read whole views.** `by` under them is `PLAY0443`. Read [references/trigger-reads-example.md](references/trigger-reads-example.md) for alias rules (`PLAY0410`–`PLAY0412`, `PLAY0177`), the `@reads` escape (`PLAY0175`, `PLAY0444`) and the reserved `for each`.
|
|
277
228
|
|
|
278
229
|
⚠️ **Declared, not enforced.** See *Caller-less invokes and unprotected reads* above.
|
|
279
230
|
|
|
280
231
|
## `trigger`
|
|
281
232
|
|
|
282
|
-
|
|
283
|
-
concept Repository : String
|
|
284
|
-
|
|
285
|
-
trigger BuildFinished
|
|
286
|
-
description "CI reported a finished build on a watched repository"
|
|
287
|
-
repository Repository
|
|
288
|
-
outcome String
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
A trigger declares two things: **that the name exists**, and **what an occurrence
|
|
292
|
-
hands the reaction**. It deliberately declares nothing about what makes one occur —
|
|
293
|
-
that belongs to whatever produces it, and keeping it out is what lets the set stay
|
|
294
|
-
open. The type on a value is optional; a bare name is already a useful statement.
|
|
295
|
-
|
|
296
|
-
**Name resolution, in order:** events the document declares or imports → triggers
|
|
297
|
-
the document declares → triggers registered with the compiler, plus the built-in
|
|
298
|
-
host signals. A registration wins over a built-in of the same name. Only when all
|
|
299
|
-
three miss is the name reported unknown — a **warning** (`PLAY0248`), because the
|
|
300
|
-
name may be known outside the document. A malformed reaction body is an error. If an event
|
|
301
|
-
and a trigger share a name, the event wins for value validation and binding.
|
|
302
|
-
|
|
303
|
-
**Built-in triggers:** `Startup` and `Shutdown`. The clock is built in too, but
|
|
304
|
-
with its own syntax rather than a name.
|
|
305
|
-
|
|
306
|
-
⚠️ **An application trigger is not a UI event.** What a button click, a form
|
|
307
|
-
submit or entering a screen does is an *interaction*: an `on click` / `on submit`
|
|
308
|
-
/ `on enter` clause or a named `behavior`, never a declared `trigger` (see
|
|
309
|
-
`cratis-screenplay-ui-composition`). The two meet in two places: an interaction
|
|
310
|
-
can observe a declared trigger with `on <Trigger>` and fire one with
|
|
311
|
-
`raise <Trigger>`. A trigger named after a built-in interaction kind (`click`,
|
|
312
|
-
`submit`, `enter`, …) is an error (`PLAY0326`).
|
|
313
|
-
|
|
314
|
-
⚠️ Under a reaction trigger, `description`, `file`, `produces`, `invokes` and
|
|
315
|
-
`reads` are directives, so a value with one of those names is written with `@`
|
|
316
|
-
(`@file`, `@reads`).
|
|
317
|
-
|
|
318
|
-
**Registration** (for a name only an integration knows) happens through the
|
|
319
|
-
compiler's language registry, either name-only or with a shape. ⚠️ Stating **no**
|
|
320
|
-
values and stating **none** are different claims: a definition with no value list
|
|
321
|
-
says the registration does not describe the shape, so what a reaction takes is left
|
|
322
|
-
alone; one with an **empty** list says an occurrence carries nothing, so taking
|
|
323
|
-
something is reported. `Startup` and `Shutdown` are registered the second way.
|
|
233
|
+
A `trigger` declares that a name exists and what an occurrence hands the reaction, never what makes it occur. Built-ins are `Startup` and `Shutdown`. An unknown name warns `PLAY0248`; **An application trigger is not a UI event** (`PLAY0326`); under a reaction trigger, values named `description`, `file`, `produces`, `invokes` or `reads` are written with `@`. Read [references/trigger-declaration.md](references/trigger-declaration.md) when declaring or registering a trigger or resolving a trigger name.
|
|
324
234
|
|
|
325
235
|
## Guidance, verbatim
|
|
326
236
|
|
|
@@ -40,3 +40,40 @@ properties.
|
|
|
40
40
|
|
|
41
41
|
**Mapping sources:** `$.` for a value from the current source item, `$context.` for
|
|
42
42
|
capture context, `$env.` for an environment variable, plus literals and templates.
|
|
43
|
+
|
|
44
|
+
**`source <kind>`** with indented settings. The documented kinds and settings are
|
|
45
|
+
`api` (`api`, `route`, `poll`), `webhook` (`path`) and `message` (`topic`).
|
|
46
|
+
⚠️ The grammar is **open** — the parser accepts any kind and any setting name as
|
|
47
|
+
free-form name/value pairs, so a typo is not caught. The three kinds are
|
|
48
|
+
convention, not enforcement. `source events` (`from <Event>` lines, ESM v9) is the exception, with
|
|
49
|
+
its own closed grammar (PLAY0610/0612/0616/0619/0620).
|
|
50
|
+
|
|
51
|
+
**`key <property>`** names the source property identifying an instance. From ESM v6
|
|
52
|
+
a capture without a `key` does not bind (`PLAY0268`). In a specification the
|
|
53
|
+
reference is handed records (`given capture`, `when capture`) and never contacts a
|
|
54
|
+
`source`, which stays realization metadata; events append to the event source the
|
|
55
|
+
record's `key` names, and `$context.occurred` is the scenario's `given clock`.
|
|
56
|
+
|
|
57
|
+
An event's external origin is declared on the `event` itself with `event X from "<origin>"` (ESM v9);
|
|
58
|
+
outside records still enter through a `capture` in a `Translate` slice
|
|
59
|
+
(`cratis-screenplay-automations-and-translations` `references/public-events-and-direction.md`).
|
|
60
|
+
|
|
61
|
+
**`map`** reshapes properties before events are appended (rename, template, `translate`, `split`; mapping sources are `$.`, `$context.` and `$env.`); syntax is in the reference file linked above.
|
|
62
|
+
|
|
63
|
+
**`append <Event>`** with optional `tag` lines and one `when` clause:
|
|
64
|
+
|
|
65
|
+
| `when` form | Appends when |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `when added` | an item appears in the source |
|
|
68
|
+
| `when removed` | an item disappears from the source |
|
|
69
|
+
| `when <Path>` | that property changes |
|
|
70
|
+
| `when <Path> from <v> to <v>` | that property makes that exact transition |
|
|
71
|
+
| `when <a> or <b> [or <c>]` | any of those properties change |
|
|
72
|
+
| `when <a> and <b> [and <c>]` | all of those properties change |
|
|
73
|
+
| ``when `<expression>` `` | a raw template expression is true (captured verbatim; from ESM v6 the reference evaluates fields, literals, `==`, `!=`, the ordering operators, `&&`, `||`, `!` and parentheses, and an expression outside that grammar does not bind) |
|
|
74
|
+
|
|
75
|
+
⚠️ **`or` and `and` cannot be mixed in one clause** — `when a or b and c` is a
|
|
76
|
+
compile error. Split it into two `append` blocks.
|
|
77
|
+
|
|
78
|
+
**`children <collection> identified by <path>`** and **`nested <path>`** each take
|
|
79
|
+
an optional `map` and any number of `append` blocks.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Declaring a trigger
|
|
2
|
+
|
|
3
|
+
This reference holds the `trigger` declaration, its name resolution, built-in triggers and registration.
|
|
4
|
+
|
|
5
|
+
## `trigger`
|
|
6
|
+
|
|
7
|
+
```screenplay
|
|
8
|
+
concept Repository : String
|
|
9
|
+
|
|
10
|
+
trigger BuildFinished
|
|
11
|
+
description "CI reported a finished build on a watched repository"
|
|
12
|
+
repository Repository
|
|
13
|
+
outcome String
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
A trigger declares two things: **that the name exists**, and **what an occurrence
|
|
17
|
+
hands the reaction**. It deliberately declares nothing about what makes one occur —
|
|
18
|
+
that belongs to whatever produces it, and keeping it out is what lets the set stay
|
|
19
|
+
open. The type on a value is optional; a bare name is already a useful statement.
|
|
20
|
+
|
|
21
|
+
**Name resolution, in order:** events the document declares or imports → triggers
|
|
22
|
+
the document declares → triggers registered with the compiler, plus the built-in
|
|
23
|
+
host signals. A registration wins over a built-in of the same name. Only when all
|
|
24
|
+
three miss is the name reported unknown — a **warning** (`PLAY0248`), because the
|
|
25
|
+
name may be known outside the document. A malformed reaction body is an error. If an event
|
|
26
|
+
and a trigger share a name, the event wins for value validation and binding.
|
|
27
|
+
|
|
28
|
+
**Built-in triggers:** `Startup` and `Shutdown`. The clock is built in too, but
|
|
29
|
+
with its own syntax rather than a name.
|
|
30
|
+
|
|
31
|
+
⚠️ **An application trigger is not a UI event.** What a button click, a form
|
|
32
|
+
submit or entering a screen does is an *interaction*: an `on click` / `on submit`
|
|
33
|
+
/ `on enter` clause or a named `behavior`, never a declared `trigger` (see
|
|
34
|
+
`cratis-screenplay-ui-composition`). The two meet in two places: an interaction
|
|
35
|
+
can observe a declared trigger with `on <Trigger>` and fire one with
|
|
36
|
+
`raise <Trigger>`. A trigger named after a built-in interaction kind (`click`,
|
|
37
|
+
`submit`, `enter`, …) is an error (`PLAY0326`).
|
|
38
|
+
|
|
39
|
+
⚠️ Under a reaction trigger, `description`, `file`, `produces`, `invokes` and
|
|
40
|
+
`reads` are directives, so a value with one of those names is written with `@`
|
|
41
|
+
(`@file`, `@reads`).
|
|
42
|
+
|
|
43
|
+
**Registration** (for a name only an integration knows) happens through the
|
|
44
|
+
compiler's language registry, either name-only or with a shape. ⚠️ Stating **no**
|
|
45
|
+
values and stating **none** are different claims: a definition with no value list
|
|
46
|
+
says the registration does not describe the shape, so what a reaction takes is left
|
|
47
|
+
alone; one with an **empty** list says an occurrence carries nothing, so taking
|
|
48
|
+
something is reported. `Startup` and `Shutdown` are registered the second way.
|
|
@@ -19,3 +19,19 @@ slice Automation ChaseOverdueInvoices
|
|
|
19
19
|
reads OverdueInvoice
|
|
20
20
|
file Reactions/SweepOverdueInvoices.cs
|
|
21
21
|
```
|
|
22
|
+
|
|
23
|
+
- `reads` sits **under a trigger**, beside the values it takes and its effects.
|
|
24
|
+
Each trigger declares its own.
|
|
25
|
+
- **`by` names a value that trigger takes** (`invoiceId` above). Naming anything
|
|
26
|
+
else is warning `PLAY0442`.
|
|
27
|
+
- **Clock triggers read whole views.** `every` and `at` take no values, so
|
|
28
|
+
`reads <View>` works under them but `by` is error `PLAY0443`.
|
|
29
|
+
- **Aliases follow the command rules.** A view read more than once needs an
|
|
30
|
+
alias on every read (`PLAY0410`), aliases are unique per trigger (`PLAY0411`),
|
|
31
|
+
and an alias must not match a trigger value (`PLAY0412`). A view no projection
|
|
32
|
+
in the document produces is warning `PLAY0177`.
|
|
33
|
+
- **`reads` is a directive in a trigger body.** A trigger value named `reads` is
|
|
34
|
+
written `@reads`. A bare `reads` line is error `PLAY0175`, and
|
|
35
|
+
`reads <PrimitiveType>` is warning `PLAY0444`; both messages name the escape.
|
|
36
|
+
- `for each <View>` is reserved for a future view-driven trigger. It is not a
|
|
37
|
+
trigger in the verified Screenplay versions (`PLAY0137`).
|
|
@@ -227,70 +227,15 @@ choosing or omitting `for` on a production, or fixing `PLAY0469`-`PLAY0478`.
|
|
|
227
227
|
|
|
228
228
|
## `produces`
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
(`= invoiceNumber`), a literal (`= "draft"`, `= 0`), `$context.occurred`, and
|
|
232
|
-
the caller's audit identity (`$identity.id`/`.name`/`.userName`, also supported
|
|
233
|
-
as `$context.identity.id`/`.name`/`.userName`, the same values as `$context.causedBy.*`). The last two select ESM v2.
|
|
234
|
-
`$context.tenant`, claims, roles, causation, `$env.` values, templates and
|
|
235
|
-
computed expressions parse but block binding (`PLAY0268`).
|
|
236
|
-
- **`for <identifier>`** on an indented line names the event source the event is
|
|
237
|
-
appended to. At most one per `produces`. To bind, it must name the command's
|
|
238
|
-
`identifier` property (`PLAY0273` otherwise; a `generated identifier` command, ESM v7, may name another required scalar property); fanning out to another event
|
|
239
|
-
source parses but does not run today.
|
|
240
|
-
- **`tag`** lines apply literal tags to this append. Tags also exist on the
|
|
241
|
-
`event` declaration, where they apply to every append of that type.
|
|
242
|
-
- **Several unconditional `produces` blocks** are allowed — that is co-production,
|
|
243
|
-
and it is what an automation is *not*.
|
|
244
|
-
- **`produces when <condition>`** takes the event name on the next indented line.
|
|
245
|
-
Conditions over command properties and constants bind; each is evaluated
|
|
246
|
-
independently, and when all are false the command is accepted with no events.
|
|
247
|
-
Compare an enumeration with a member bare (`status == sent`) or quoted
|
|
248
|
-
(`status == "sent"`); the bare form binds, so quote it when a model
|
|
249
|
-
must bind on an older version.
|
|
250
|
-
Excerpt:
|
|
251
|
-
|
|
252
|
-
```screenplay excerpt
|
|
253
|
-
produces when isProForma == true
|
|
254
|
-
ProFormaInvoiceIssued
|
|
255
|
-
for invoiceId
|
|
256
|
-
```
|
|
230
|
+
Mapping sources that bind: a command property, a literal, `$context.occurred` and `$identity.*`; `for` must name the command `identifier` (`PLAY0273`); several unconditional `produces` are co-production. Read [references/constraints-produces-concurrency.md](references/constraints-produces-concurrency.md) when writing mappings, `tag`, or `produces when`.
|
|
257
231
|
|
|
258
232
|
## Routes and external operations
|
|
259
233
|
|
|
260
|
-
|
|
261
|
-
select v10. Read toolchain [routes](../cratis-screenplay-toolchain/references/production-routes-and-filters.md)
|
|
262
|
-
and [source/stream declarations](../cratis-screenplay-toolchain/references/sources-and-streams.md).
|
|
263
|
-
A stored stream `All` / `id "All"` refuses PLAY0273;
|
|
264
|
-
rename and history-migration guidance is in that reference.
|
|
265
|
-
`public event X` is a local export; `event X from "store"` is a locally declared,
|
|
266
|
-
unverified foreign shape. Commands never produce public events. Read
|
|
267
|
-
[translation direction](../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md)
|
|
268
|
-
for the released ESM v9 boundary and quoted opaque origins.
|
|
269
|
-
|
|
270
|
-
Use `system`, `uses` and inline/standalone `operation` declarations to state
|
|
271
|
-
external work in the authored production sequence, with execute/compensate phase
|
|
272
|
-
intent. These remain unadmitted (PLAY0268), not post-commit reactions. Read
|
|
273
|
-
[operation intent](references/operations.md) for forms, boundaries and checked
|
|
274
|
-
failure/compensation specification syntax.
|
|
234
|
+
Commands never produce public events; external work stays unadmitted (`PLAY0268`). Read [references/routes-and-external-operations.md](references/routes-and-external-operations.md) when choosing routes, `stream` overrides, public or foreign events, or `system`/`uses`/`operation` declarations (see also [operation intent](references/operations.md)).
|
|
275
235
|
|
|
276
236
|
## `concurrency`
|
|
277
237
|
|
|
278
|
-
|
|
279
|
-
command. It mirrors Chronicle's `ConcurrencyScope` for a target implementation;
|
|
280
|
-
the executable model does not bind it (`PLAY0271`), and it does not protect a
|
|
281
|
-
`reads` decision.
|
|
282
|
-
|
|
283
|
-
| Dimension | Scopes the check to |
|
|
284
|
-
| --- | --- |
|
|
285
|
-
| `eventSource` | the command's own event source id |
|
|
286
|
-
| `sourceType <Name>` | an event source type |
|
|
287
|
-
| `streamType <Name>` | an event stream type |
|
|
288
|
-
| `streamId <Name>` | an event stream id |
|
|
289
|
-
| `events <A>, <B>` | the listed event types |
|
|
290
|
-
|
|
291
|
-
An empty block or an unknown dimension is an error. Omitting `concurrency` does
|
|
292
|
-
not mean unchecked appends: Chronicle's default optimistic concurrency applies
|
|
293
|
-
to the routed scope. This does not make command `reads` protected.
|
|
238
|
+
One `concurrency` block per command; it is not bound (`PLAY0271`) and does not protect a `reads` decision. Read [references/constraints-produces-concurrency.md](references/constraints-produces-concurrency.md) for the dimensions.
|
|
294
239
|
|
|
295
240
|
## Generated values and responses (ESM v7 and v15)
|
|
296
241
|
|
|
@@ -307,40 +252,7 @@ Routes and realization: `cratis-screenplay-toolchain/references/sources-and-stre
|
|
|
307
252
|
|
|
308
253
|
## `constraint` — uniqueness at append time
|
|
309
254
|
|
|
310
|
-
Chronicle's constraints enforce **uniqueness only
|
|
311
|
-
declared in the same model.
|
|
312
|
-
|
|
313
|
-
```screenplay excerpt
|
|
314
|
-
constraint UniqueInvoiceNumber
|
|
315
|
-
unique invoiceNumber on InvoiceRegistered
|
|
316
|
-
released by InvoiceCancelled
|
|
317
|
-
ignore casing
|
|
318
|
-
message "That invoice number is already in use"
|
|
319
|
-
|
|
320
|
-
constraint OneRegistrationPerInvoice
|
|
321
|
-
unique event InvoiceRegistered
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
- `unique <p>[, <p>…] on <Event>` — a value (or composite value, in order) held by
|
|
325
|
-
one event source is unavailable to every other. Repeat the line for other
|
|
326
|
-
events sharing the claim. The same event source may re-claim its own value; a
|
|
327
|
-
null value claims nothing. The property must be declared directly on the event
|
|
328
|
-
(`PLAY0391`).
|
|
329
|
-
- `unique event <Event>` — the event occurs at most once per event source.
|
|
330
|
-
- `released by <Event>` (repeatable) frees the claim; `ignore casing` applies to
|
|
331
|
-
property rules only (`PLAY0393`); `message` replaces the default violation text —
|
|
332
|
-
never put the colliding value in it.
|
|
333
|
-
- **The name is the identity.** It is unique across the application (`PLAY0392`),
|
|
334
|
-
and renaming a constraint starts a new, empty index.
|
|
335
|
-
- Chronicle updates the uniqueness index after the append commits; do not describe
|
|
336
|
-
it as an atomic index-and-append guarantee.
|
|
337
|
-
|
|
338
|
-
⚠️ **Do not use `constraint … file <Path>` for other rules.** It can only name a
|
|
339
|
-
hand-written Chronicle `IConstraint`, which can only declare uniqueness; it warns
|
|
340
|
-
(`PLAY0396`) and the executable model rejects it. A state transition rule
|
|
341
|
-
belongs in `validate`/`require`. Use a constraint when two concurrent appends must
|
|
342
|
-
not both win — a `validate` rule cannot do that. Stage renders only single-text-property and
|
|
343
|
-
`unique event` constraints (`STAGE-ESM-014`; `cratis-stage-rendering-and-sandbox` `references/admission.md`).
|
|
255
|
+
Chronicle's constraints enforce **uniqueness only**; use one when two concurrent appends must not both win. Do not use `constraint … file <Path>` for other rules (`PLAY0396`). Read [references/constraints-produces-concurrency.md](references/constraints-produces-concurrency.md) when writing a `unique` constraint, `released by`, or `unique event`.
|
|
344
256
|
|
|
345
257
|
## `policy` and `persona`
|
|
346
258
|
|
|
@@ -349,11 +261,7 @@ declaring a policy, a persona, or a `seed` block.
|
|
|
349
261
|
|
|
350
262
|
## Event data subject
|
|
351
263
|
|
|
352
|
-
|
|
353
|
-
data the event holds, not the stream identity. Only unprotected required scalar
|
|
354
|
-
String/Uuid or String/Uuid/Int-backed concepts are allowed. The mark is report-only
|
|
355
|
-
(PLAY0270), changes no ESM bytes and emits no C# `[Subject]` yet; read models are
|
|
356
|
-
not supported. See [subject lineage](references/compliance.md#identify-the-person-not-the-stream).
|
|
264
|
+
A trailing `subject` on an event property is report-only (`PLAY0270`); see [compliance](references/compliance.md#event-data-subject).
|
|
357
265
|
|
|
358
266
|
## `$context` and `$identity`
|
|
359
267
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- Recover classification from C#
|
|
10
10
|
- Declare the use separately
|
|
11
11
|
- Identify the person, not the stream
|
|
12
|
+
- Event data subject
|
|
12
13
|
|
|
13
14
|
Authority: Screenplay `concepts.md`, `events.md`,
|
|
14
15
|
`Semantics/SemanticModelBinder.Compliance.cs` and `SemanticModelValidator.Compliance.cs`;
|
|
@@ -225,3 +226,11 @@ event summaries' `subject.source` (`eventSource` or `property`).
|
|
|
225
226
|
The event data subject, `secret scope subject` (encryption scope), and policy
|
|
226
227
|
`matches subject` (the thing acted on, not the caller) are three different roles.
|
|
227
228
|
For actual Chronicle erasure and attributes, use `cratis-chronicle-compliance`.
|
|
229
|
+
|
|
230
|
+
## Event data subject
|
|
231
|
+
|
|
232
|
+
One event property may carry trailing `subject`; it identifies the person whose
|
|
233
|
+
data the event holds, not the stream identity. Only unprotected required scalar
|
|
234
|
+
String/Uuid or String/Uuid/Int-backed concepts are allowed. The mark is report-only
|
|
235
|
+
(PLAY0270), changes no ESM bytes and emits no C# `[Subject]` yet; read models are
|
|
236
|
+
not supported. See [subject lineage](#identify-the-person-not-the-stream).
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Constraints, produces mappings and concurrency
|
|
2
|
+
|
|
3
|
+
This reference holds the detailed forms for append-time `constraint` uniqueness, `produces` mapping sources and conditions, and the `concurrency` block.
|
|
4
|
+
|
|
5
|
+
## `constraint` — uniqueness at append time
|
|
6
|
+
|
|
7
|
+
Chronicle's constraints enforce **uniqueness only**. Excerpt: the events are
|
|
8
|
+
declared in the same model.
|
|
9
|
+
|
|
10
|
+
```screenplay excerpt
|
|
11
|
+
constraint UniqueInvoiceNumber
|
|
12
|
+
unique invoiceNumber on InvoiceRegistered
|
|
13
|
+
released by InvoiceCancelled
|
|
14
|
+
ignore casing
|
|
15
|
+
message "That invoice number is already in use"
|
|
16
|
+
|
|
17
|
+
constraint OneRegistrationPerInvoice
|
|
18
|
+
unique event InvoiceRegistered
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- `unique <p>[, <p>…] on <Event>` — a value (or composite value, in order) held by
|
|
22
|
+
one event source is unavailable to every other. Repeat the line for other
|
|
23
|
+
events sharing the claim. The same event source may re-claim its own value; a
|
|
24
|
+
null value claims nothing. The property must be declared directly on the event
|
|
25
|
+
(`PLAY0391`).
|
|
26
|
+
- `unique event <Event>` — the event occurs at most once per event source.
|
|
27
|
+
- `released by <Event>` (repeatable) frees the claim; `ignore casing` applies to
|
|
28
|
+
property rules only (`PLAY0393`); `message` replaces the default violation text —
|
|
29
|
+
never put the colliding value in it.
|
|
30
|
+
- **The name is the identity.** It is unique across the application (`PLAY0392`),
|
|
31
|
+
and renaming a constraint starts a new, empty index.
|
|
32
|
+
- Chronicle updates the uniqueness index after the append commits; do not describe
|
|
33
|
+
it as an atomic index-and-append guarantee.
|
|
34
|
+
|
|
35
|
+
⚠️ **Do not use `constraint … file <Path>` for other rules.** It can only name a
|
|
36
|
+
hand-written Chronicle `IConstraint`, which can only declare uniqueness; it warns
|
|
37
|
+
(`PLAY0396`) and the executable model rejects it. A state transition rule
|
|
38
|
+
belongs in `validate`/`require`. Use a constraint when two concurrent appends must
|
|
39
|
+
not both win — a `validate` rule cannot do that. Stage renders only single-text-property and
|
|
40
|
+
`unique event` constraints (`STAGE-ESM-014`; `cratis-stage-rendering-and-sandbox` `references/admission.md`).
|
|
41
|
+
|
|
42
|
+
## `concurrency`
|
|
43
|
+
|
|
44
|
+
Five dimensions, each at most once, and at most one `concurrency` block per
|
|
45
|
+
command. It mirrors Chronicle's `ConcurrencyScope` for a target implementation;
|
|
46
|
+
the executable model does not bind it (`PLAY0271`), and it does not protect a
|
|
47
|
+
`reads` decision.
|
|
48
|
+
|
|
49
|
+
| Dimension | Scopes the check to |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `eventSource` | the command's own event source id |
|
|
52
|
+
| `sourceType <Name>` | an event source type |
|
|
53
|
+
| `streamType <Name>` | an event stream type |
|
|
54
|
+
| `streamId <Name>` | an event stream id |
|
|
55
|
+
| `events <A>, <B>` | the listed event types |
|
|
56
|
+
|
|
57
|
+
An empty block or an unknown dimension is an error. Omitting `concurrency` does
|
|
58
|
+
not mean unchecked appends: Chronicle's default optimistic concurrency applies
|
|
59
|
+
to the routed scope. This does not make command `reads` protected.
|
|
60
|
+
|
|
61
|
+
## `produces`
|
|
62
|
+
|
|
63
|
+
- **Mapping sources** that bind to the executable model: a command property
|
|
64
|
+
(`= invoiceNumber`), a literal (`= "draft"`, `= 0`), `$context.occurred`, and
|
|
65
|
+
the caller's audit identity (`$identity.id`/`.name`/`.userName`, also supported
|
|
66
|
+
as `$context.identity.id`/`.name`/`.userName`, the same values as `$context.causedBy.*`). The last two select ESM v2.
|
|
67
|
+
`$context.tenant`, claims, roles, causation, `$env.` values, templates and
|
|
68
|
+
computed expressions parse but block binding (`PLAY0268`).
|
|
69
|
+
- **`for <identifier>`** on an indented line names the event source the event is
|
|
70
|
+
appended to. At most one per `produces`. To bind, it must name the command's
|
|
71
|
+
`identifier` property (`PLAY0273` otherwise; a `generated identifier` command, ESM v7, may name another required scalar property); fanning out to another event
|
|
72
|
+
source parses but does not run today.
|
|
73
|
+
- **`tag`** lines apply literal tags to this append. Tags also exist on the
|
|
74
|
+
`event` declaration, where they apply to every append of that type.
|
|
75
|
+
- **Several unconditional `produces` blocks** are allowed — that is co-production,
|
|
76
|
+
and it is what an automation is *not*.
|
|
77
|
+
- **`produces when <condition>`** takes the event name on the next indented line.
|
|
78
|
+
Conditions over command properties and constants bind; each is evaluated
|
|
79
|
+
independently, and when all are false the command is accepted with no events.
|
|
80
|
+
Compare an enumeration with a member bare (`status == sent`) or quoted
|
|
81
|
+
(`status == "sent"`); the bare form binds, so quote it when a model
|
|
82
|
+
must bind on an older version.
|
|
83
|
+
Excerpt:
|
|
84
|
+
|
|
85
|
+
```screenplay excerpt
|
|
86
|
+
produces when isProForma == true
|
|
87
|
+
ProFormaInvoiceIssued
|
|
88
|
+
for invoiceId
|
|
89
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Routes and external operations
|
|
2
|
+
|
|
3
|
+
This reference holds the route, public-event and external-operation guidance for command productions.
|
|
4
|
+
|
|
5
|
+
## Routes and external operations
|
|
6
|
+
|
|
7
|
+
Routes bind as ESM v8; production `stream Source.Stream` overrides
|
|
8
|
+
select v10. Read toolchain [routes](../../cratis-screenplay-toolchain/references/production-routes-and-filters.md)
|
|
9
|
+
and [source/stream declarations](../../cratis-screenplay-toolchain/references/sources-and-streams.md).
|
|
10
|
+
A stored stream `All` / `id "All"` refuses PLAY0273;
|
|
11
|
+
rename and history-migration guidance is in that reference.
|
|
12
|
+
`public event X` is a local export; `event X from "store"` is a locally declared,
|
|
13
|
+
unverified foreign shape. Commands never produce public events. Read
|
|
14
|
+
[translation direction](../../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md)
|
|
15
|
+
for the released ESM v9 boundary and quoted opaque origins.
|
|
16
|
+
|
|
17
|
+
Use `system`, `uses` and inline/standalone `operation` declarations to state
|
|
18
|
+
external work in the authored production sequence, with execute/compensate phase
|
|
19
|
+
intent. These remain unadmitted (PLAY0268), not post-commit reactions. Read
|
|
20
|
+
[operation intent](operations.md) for forms, boundaries and checked
|
|
21
|
+
failure/compensation specification syntax.
|
|
@@ -50,18 +50,7 @@ Model notes use Screenplay `Documentation/screenplay/model-notes.md`;
|
|
|
50
50
|
tool sources: model-authoring `references/model-notes.md`.
|
|
51
51
|
Requires Screenplay 4.144.0 or later (`screenplay --version`) for model notes.
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| Persona syntax, report-only, policies must be declared | Screenplay `Documentation/screenplay/personas.md` |
|
|
56
|
-
| Description order; authored/import board order and order-preserving MCP layouts | Screenplay `Documentation/screenplay/grammar.md`, `folders.md`, `imports.md` |
|
|
57
|
-
| Single-line and fenced `description` (`FencedText`) | `Documentation/screenplay/slices.md#descriptions`, `grammar.md` |
|
|
58
|
-
| `<Type>[]`, shapes must be declared; `pii` and `reason` on concepts | `Documentation/screenplay/events.md`, `concepts.md` |
|
|
59
|
-
| `then denied`, `given caller`, `then error` | `Documentation/screenplay/specifications.md` |
|
|
60
|
-
| PII on an event-source id is rejected by Chronicle (CHR0034); nullable event properties warn (CHR0012) | Chronicle `Source/Clients/DotNET.CodeAnalysis/DiagnosticIds.cs` |
|
|
61
|
-
| Bare `pii` and `secret` on a concept bind as ESM v13; legacy `@`-prefixed markers are deprecated (PLAY0565); enum/identity compliance fails binding (PLAY0268); current markers are in `cratis-screenplay-command-surface` | `Source/DotNET/Screenplay/Semantics/SemanticModelBinder.Concepts.cs` |
|
|
62
|
-
|
|
63
|
-
Every complete `screenplay` fence in this skill compiles with the standalone compiler
|
|
64
|
-
(`--warnaserror`).
|
|
53
|
+
Read [references/product-sources.md](references/product-sources.md) when checking a discovery fact against the Screenplay, Chronicle or compiler sources.
|
|
65
54
|
|
|
66
55
|
## Interview phase
|
|
67
56
|
|
|
@@ -75,17 +64,7 @@ feed plotting and the handoff. Full menu with follow-up triggers: `references/in
|
|
|
75
64
|
|
|
76
65
|
Critical questions:
|
|
77
66
|
|
|
78
|
-
1. **How complete is the input?**
|
|
79
|
-
mouth / running system). Thin input means a heavier step 4. Follow up: for a rough list or
|
|
80
|
-
word of mouth, probe for missing scenarios and ask the rules to be stated.
|
|
81
|
-
2. **Who has the final word on business meaning?** Follow up: only engineers present means
|
|
82
|
-
every meaning is an assumption to confirm; recommend inviting the domain expert.
|
|
83
|
-
3. **Where is it complex, disputed or fragile today?** (the hotspots). Follow up, per hotspot:
|
|
84
|
-
what goes wrong there, what happened the last time.
|
|
85
|
-
4. **Which rules must always or never hold?** Follow up, per rule: what does the person see
|
|
86
|
-
when refused, and must the business remember the breach (a fact only if so)?
|
|
87
|
-
5. **Who takes part, and what may each role not do?** Follow up: for each Cannot, is it an
|
|
88
|
-
authority limit or a rule for everyone?
|
|
67
|
+
1. **How complete is the input?** Then: who has the final word on business meaning; where it is complex, disputed or fragile; which rules must always or never hold; who takes part and what each role may not do. Read [references/interview-questions.md](references/interview-questions.md) ("Critical questions") for each question's follow-ups.
|
|
89
68
|
|
|
90
69
|
With no input at all, open with: "Describe the starting situation, then the steps people take
|
|
91
70
|
to reach the intended result." With a brief, restate domain and goal in two sentences and confirm.
|
|
@@ -155,11 +134,8 @@ Never put secrets or personal data in note text; `.screenplay/notes.json` is com
|
|
|
155
134
|
- A `persona` names declared policies only (unknown policy = error); `description` appears
|
|
156
135
|
at most once, anywhere in its body.
|
|
157
136
|
- Declare each event once in the whole application; other slices refer to it by name.
|
|
158
|
-
- Boards keep authored declaration and import order
|
|
159
|
-
|
|
160
|
-
MCP `expand-layout` preserves this order with import barrels; an import-less
|
|
161
|
-
`PlayFileWriter.Expand` layout falls back to path order. Order is presentation, not
|
|
162
|
-
execution or identity. Keep causes and branches in the feature `documentation` and STATE.md.
|
|
137
|
+
- Boards keep authored declaration and import order (order is presentation, not execution or identity); `references/plotting-and-handoff.md` ("Board order") has the import-expansion, glob and MCP `expand-layout` rules. Keep causes and branches in the feature `documentation` and STATE.md.
|
|
138
|
+
|
|
163
139
|
- A misspelt keyword inside a slice is only warning PLAY0029 and the block disappears: always
|
|
164
140
|
validate with warnings as errors.
|
|
165
141
|
|
|
@@ -224,16 +200,7 @@ and the report says which verdicts were not run (V2 to V5 are not run in discove
|
|
|
224
200
|
|
|
225
201
|
## Route near misses
|
|
226
202
|
|
|
227
|
-
-
|
|
228
|
-
- Streams, constraints, protected decisions: `cratis-screenplay-streams-and-consistency`.
|
|
229
|
-
- Clocks, reactions, outside data: `cratis-screenplay-automations-and-translations`.
|
|
230
|
-
- Specs for Cannot, competition, duplicates: `cratis-screenplay-scenario-coverage`.
|
|
231
|
-
- Grammar for event, persona and concept: `cratis-screenplay-command-surface`; the nine-step
|
|
232
|
-
facilitation questions: `cratis-screenplay-event-modeling`.
|
|
233
|
-
- Audit of a finished model: `cratis-screenplay-model-review`.
|
|
234
|
-
- Existing code or database as the source: `cratis-screenplay-legacy-extraction`.
|
|
235
|
-
- Diagram of the result: `cratis-event-model-diagram`.
|
|
236
|
-
- Syntax, diagnostics and tools: `cratis-screenplay-toolchain`.
|
|
203
|
+
Read [references/neighbouring-skills.md](references/neighbouring-skills.md) when the work is commands, streams, reactions, specifications, grammar, review, extraction, diagrams or tooling rather than discovery.
|
|
237
204
|
|
|
238
205
|
## References (load on demand)
|
|
239
206
|
|
|
@@ -64,3 +64,17 @@ reviewer should challenge.
|
|
|
64
64
|
- An event nobody can say the cause of.
|
|
65
65
|
- A workflow with no terminal fact or no failure path.
|
|
66
66
|
- Answers that describe screens or tables instead of what happened.
|
|
67
|
+
|
|
68
|
+
## Critical questions
|
|
69
|
+
|
|
70
|
+
1. **How complete is the input?** (written spec / documented rules / rough list / word of
|
|
71
|
+
mouth / running system). Thin input means a heavier step 4. Follow up: for a rough list or
|
|
72
|
+
word of mouth, probe for missing scenarios and ask the rules to be stated.
|
|
73
|
+
2. **Who has the final word on business meaning?** Follow up: only engineers present means
|
|
74
|
+
every meaning is an assumption to confirm; recommend inviting the domain expert.
|
|
75
|
+
3. **Where is it complex, disputed or fragile today?** (the hotspots). Follow up, per hotspot:
|
|
76
|
+
what goes wrong there, what happened the last time.
|
|
77
|
+
4. **Which rules must always or never hold?** Follow up, per rule: what does the person see
|
|
78
|
+
when refused, and must the business remember the breach (a fact only if so)?
|
|
79
|
+
5. **Who takes part, and what may each role not do?** Follow up: for each Cannot, is it an
|
|
80
|
+
authority limit or a rule for everyone?
|