@cratis/pi 7.51.3 → 7.51.5
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/generate-notes.md +12 -1
- 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
|
@@ -33,27 +33,7 @@ the decision behind each shown field, and how fresh each view must be. Otherwise
|
|
|
33
33
|
batch, only what is missing. Unattended: assume visibly, record each assumption in the phase
|
|
34
34
|
report and slice `documentation`, and continue.
|
|
35
35
|
|
|
36
|
-
1
|
|
37
|
-
started by a clock or outside system (schedule, webhook, feed)? Impact: separates screen
|
|
38
|
-
commands from automation (and a trusted path); clocks and outside records are designed in
|
|
39
|
-
`cratis-screenplay-automations-and-translations` (trigger, capture, reaction over imports).
|
|
40
|
-
Follow-up: if a mix, which user actions start automation, and what does it decide on its
|
|
41
|
-
own? If outside systems, which one and what data does it send?
|
|
42
|
-
2. **Critical fields.** Which data matters most on each screen, and what decision does the
|
|
43
|
-
person make from each field? Impact: fields with no decision behind them are questions, not
|
|
44
|
-
requirements. Follow-up: for a field nobody can justify, ask whether it is history worth
|
|
45
|
-
keeping or can go.
|
|
46
|
-
3. **Freshness and cost.** How stale may each view be, and what does a stale answer cost?
|
|
47
|
-
Impact: picks projection versus reducer, and one-shot versus `observable`. Follow-up: if a
|
|
48
|
-
wrong answer is expensive (a booking, a payment), that decision needs a protected read
|
|
49
|
-
(`references/rule-layers.md`), not a view. For every calculated or aggregated figure
|
|
50
|
-
(a total, a count, an average) ask whether it recalculates as source data changes ("so it
|
|
51
|
-
belongs in a view - does that match your expectation?") or whether someone agrees or
|
|
52
|
-
certifies a value (a fact, step 5).
|
|
53
|
-
4. **Granularity.** When someone changes these values, why? Impact: separates decisions from
|
|
54
|
-
forms. Follow-up: when a screen edits several values, ask for each who changes it and why.
|
|
55
|
-
5. **Existing UI or constraints.** Is there a screen or system to match? Impact: origins and
|
|
56
|
-
screen data. Follow-up: ask to see it; styling belongs to `cratis-screenplay-ui-composition`.
|
|
36
|
+
Ask the batch below only for what the request leaves open: (1) origin of each action - user, automated, mixed or clock/outside system; (2) which fields matter and what decision each supports; (3) freshness and cost of a stale answer, with each calculated figure confirmed as a view ("does that match your expectation?"); (4) granularity - why each value changes; (5) existing UI or constraints. Read [references/command-inventory.md](references/command-inventory.md) ("Interview batch for slice design") for the impact and follow-up of each.
|
|
57
37
|
|
|
58
38
|
## Procedure
|
|
59
39
|
|
|
@@ -99,11 +79,8 @@ report and slice `documentation`, and continue.
|
|
|
99
79
|
not a reason. An event-property `subject` may identify a different person from
|
|
100
80
|
the stream but is report-only, not runtime propagation. See command-surface
|
|
101
81
|
`references/compliance.md`.
|
|
102
|
-
Trace caller details to claims or a keyed single-result identity-source query
|
|
103
|
-
|
|
104
|
-
The `identity` block is authoring metadata; executable `$identity.<detail>` reads
|
|
105
|
-
remain PLAY0268. `scoped to` is opaque, not a detail reference; see command-surface
|
|
106
|
-
`references/context.md`.
|
|
82
|
+
Trace caller details to claims or a keyed single-result identity-source query; `$identity.<detail>` reads remain `PLAY0268` (details: `references/field-lineage.md`, "Tracing caller details").
|
|
83
|
+
|
|
107
84
|
5. **Events or views?** For each value someone needs: was it decided or supplied (event), or
|
|
108
85
|
can it be worked out from facts already recorded (view)? Test, anti-patterns and where the
|
|
109
86
|
outputs of an automation go: `references/read-model-design.md` *Events or views*. Decided calculations (a quoted
|
|
@@ -114,14 +91,8 @@ report and slice `documentation`, and continue.
|
|
|
114
91
|
slice is `read model -> screen -> command -> event`. Pick the builder (declarative projection first, reducer when
|
|
115
92
|
guards cannot be expressed). The query follows the business view: a list where people scan a
|
|
116
93
|
list, a keyed lookup where they open one thing. For **executable or renderable scope**, every
|
|
117
|
-
read model needs one unambiguous identity: explicit trailing `key` first,
|
|
118
|
-
|
|
119
|
-
only with an admitted list query and no single-instance identifier. Queryless views
|
|
120
|
-
need explicit `key`; read-surface `references/named-keys.md` gives the exact fallback.
|
|
121
|
-
The identifier equals the projection's effective key (decision table in
|
|
122
|
-
`references/read-model-design.md`; Stage rule in `references/admission.md` of
|
|
123
|
-
`cratis-stage-rendering-and-sandbox`). Collections and observable delivery bind;
|
|
124
|
-
check renderer admission separately.
|
|
94
|
+
read model needs one unambiguous identity: explicit trailing `key` first. Read `references/read-model-design.md` ("Executable identity of a read model") for the fallback order, the key decision table and the Stage rule.
|
|
95
|
+
|
|
125
96
|
Whose rows is part of the view; a caller-supplied filter is not access control.
|
|
126
97
|
7. **Screens, Level 1.** `data <RM> via query <Q>` plus `action <Command>` per thing the user
|
|
127
98
|
can do there. Build each slice as read model, screen, command, event. A screen acting on an
|
|
@@ -143,31 +114,20 @@ report and slice `documentation`, and continue.
|
|
|
143
114
|
the request names the next capability, build that; if the brief authorizes selecting one, use the heuristic there and state why (Not knowing the next capability is never a reason to stop); scope complete or no candidate left: close the turn.
|
|
144
115
|
10. **Validate** after the batch: V1 with warnings as errors, then V3 when the mode is
|
|
145
116
|
executable or renderable, with the tool and version named (`cratis-screenplay-toolchain`
|
|
146
|
-
`references/verdicts.md`). Hand off with
|
|
147
|
-
touched, and **one line per element** (command with origin classified [USER] or [AUTO]
|
|
148
|
-
and refusals, screen with `data`, read model with consumers, slice with events consumed),
|
|
149
|
-
not only problems; a new slice adds why it was chosen. Decided refusals go to
|
|
150
|
-
`cratis-screenplay-scenario-coverage`, never to open questions.
|
|
117
|
+
`references/verdicts.md`). Hand off with one line per element (command with origin classified [USER] or [AUTO] and refusals, screen `data`, read-model consumers, events consumed), not only problems; decided refusals go to `cratis-screenplay-scenario-coverage`, never to open questions. Full shape: `references/slicing.md` ("Handoff line per element").
|
|
151
118
|
|
|
152
119
|
## Rules
|
|
153
120
|
|
|
154
121
|
### Compiler contracts (the tool enforces these)
|
|
155
122
|
|
|
156
|
-
- At most one `identifier` per command; never on an event property
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- At most one builder (projection or reducer) per read model (`PLAY0191`).
|
|
161
|
-
- A query's `by` goes on its own body line. Optional keyed and collection queries
|
|
162
|
-
bind, including observable delivery. Caller-supplied equality filters on collections
|
|
163
|
-
bind as ESM v14; `by` ANDs with supplied filters. `from`, single-result
|
|
164
|
-
filters, scope, performer and composite `by` remain PLAY0268 for their respective
|
|
165
|
-
context/cardinality/opaque/multipart gaps. Read read-surface
|
|
166
|
-
[equality filters](../cratis-screenplay-read-surface/references/equality-filters.md).
|
|
123
|
+
- At most one `identifier` per command; never on an event property or read-model property (use `key`). At most one builder per read model (`PLAY0191`). Read `references/read-model-design.md` ("Identifier and key contract") for the exact rules.
|
|
124
|
+
|
|
125
|
+
- A query's `by` goes on its own body line; `from`, single-result filters, scope, performer and composite `by` remain `PLAY0268`; equality filters on collections bind as ESM v14. Read `references/read-model-design.md` ("Query binding") for the binding rules.
|
|
126
|
+
|
|
167
127
|
- A `unique` constraint names a property the event declares directly; the constraint name is
|
|
168
128
|
its identity (renaming starts an empty index).
|
|
169
129
|
- Unauthorized is `then denied`; a broken rule is `then error`; authorization runs first.
|
|
170
|
-
- A mapping to an undeclared target fails only at binding (V3, PLAY0273);
|
|
130
|
+
- A mapping to an undeclared target fails only at binding (V3, `PLAY0273`); trace unmapped declared properties by hand too (`references/read-model-design.md`, "Mappings to undeclared or unmapped properties").
|
|
171
131
|
|
|
172
132
|
### Modeling defaults (follow unless the domain gives a reason not to)
|
|
173
133
|
|
|
@@ -175,16 +135,9 @@ report and slice `documentation`, and continue.
|
|
|
175
135
|
- One business decision usually produces one event; a decision establishing several facts the
|
|
176
136
|
business recognises separately may produce several (say why in `documentation`).
|
|
177
137
|
- Copy an identity into an event payload only when a consumer needs it as a value.
|
|
178
|
-
- Keep the one-line summary in `description`,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
`documentation` on the module, feature, slice, command, event, read model or reaction, not `//` comments or disconnected notes. These are report-only, not
|
|
182
|
-
enforcement. Read [model reasoning](references/model-reasoning.md) for owners,
|
|
183
|
-
syntax, folder merge and PLAY0558/0559.
|
|
184
|
-
- Rule coverage: for each value carrying a rule, list every path that sets it
|
|
185
|
-
(`references/slicing.md`). A constraint on a claim covers every event setting that claim;
|
|
186
|
-
value invariants live in the concept so they travel; command-level conditions are reviewed
|
|
187
|
-
per path, not copied blindly.
|
|
138
|
+
- Keep the one-line summary in `description` (with markers such as **NOT enforced in the model today**); durable reasoning goes in fenced Markdown `documentation`, report-only. Read [model reasoning](references/model-reasoning.md) for owners, syntax, folder merge and PLAY0558/0559.
|
|
139
|
+
|
|
140
|
+
- Rule coverage: for each value carrying a rule, list every path that sets it (`references/slicing.md`, "Rule coverage"); value invariants live in the concept.
|
|
188
141
|
|
|
189
142
|
### Review questions
|
|
190
143
|
|
|
@@ -193,31 +146,11 @@ collections, invariants, who sees which rows); report a finding only with a doma
|
|
|
193
146
|
|
|
194
147
|
## Public boundaries and view identity
|
|
195
148
|
|
|
196
|
-
Translate crosses an application boundary
|
|
197
|
-
or data and produces private facts; outbound folds private facts into exactly one
|
|
198
|
-
local public event type. Commands never publish public events. Put direction in
|
|
199
|
-
the slice outline and trace every exported field; read automations-and-translations
|
|
200
|
-
`references/public-events-and-direction.md` for the released ESM v9 contract.
|
|
201
|
-
|
|
202
|
-
Mark view identity with trailing `key`. Use a composite key for independent view
|
|
203
|
-
coordinates (resource + period), a natural single id for one entity's state.
|
|
204
|
-
Supply every named part in single-instance queries and command/trigger reads;
|
|
205
|
-
see read-surface `references/named-keys.md`. Composite view keys remain
|
|
206
|
-
unadmitted (PLAY0268), unlike admitted composite stream routes.
|
|
207
|
-
Keep the true identity and report the gap rather than inventing a concatenated id.
|
|
149
|
+
Translate crosses an application boundary (inbound consumes foreign public events; outbound folds private facts into exactly one local public event type); commands never publish public events. Mark view identity with trailing `key`; composite view keys remain unadmitted (`PLAY0268`) - keep the true identity and report the gap. Read [references/public-boundaries-and-keys.md](references/public-boundaries-and-keys.md) when a slice crosses an application boundary or a view needs a composite identity.
|
|
208
150
|
|
|
209
151
|
## Identity-affecting edits on an existing model
|
|
210
152
|
|
|
211
|
-
|
|
212
|
-
exists, adding, removing or renaming an addressed element (declarations, properties of commands, events,
|
|
213
|
-
read models, composite types and triggers, queries, query arguments, specifications), moving
|
|
214
|
-
declarations between files, creating, deleting, renaming or moving a mapped `.play` document, and any
|
|
215
|
-
contract change to a persisted event go through MCP, performed by the identity owner
|
|
216
|
-
(`cratis-screenplay-modeling-lifecycle`, *Classify by catalog address*; evolution classes:
|
|
217
|
-
`cratis-screenplay-streams-and-consistency`). Bounded text edits are only for edits that
|
|
218
|
-
preserve addresses (descriptions, rule and expression bodies, mappings between existing
|
|
219
|
-
members). Without `identities.json`, plain text edits are fine. Never use a text edit to get
|
|
220
|
-
around a refusal from the typed tools.
|
|
153
|
+
When `.screenplay/identities.json` exists, adding, removing or renaming an addressed element, moving declarations or mapped documents, and any contract change to a persisted event go through MCP, performed by the identity owner (`cratis-screenplay-modeling-lifecycle`); a text edit never gets around a typed-tool refusal. Read [references/identity-edits.md](references/identity-edits.md) for which edits are bounded text edits.
|
|
221
154
|
|
|
222
155
|
## Gate
|
|
223
156
|
|
|
@@ -241,11 +174,7 @@ Slice design is done when these hold; otherwise report what is open.
|
|
|
241
174
|
|
|
242
175
|
## Product sources
|
|
243
176
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
Examples compile with `screenplay --warnaserror` and `cratis screenplay validate
|
|
247
|
-
--warnings-as-errors`; other tool versions: `cratis-screenplay-toolchain`
|
|
248
|
-
`SKILL.md`. Compiling proves syntax, not that the model is executable or renders.
|
|
177
|
+
Read [references/product-sources.md](references/product-sources.md) when checking a rule against the Screenplay sources and diagnostics (`PLAY0191`, `PLAY0268`, `PLAY0271`).
|
|
249
178
|
|
|
250
179
|
## Verify
|
|
251
180
|
|
|
@@ -255,12 +184,7 @@ Examples compile with `screenplay --warnaserror` and `cratis screenplay validate
|
|
|
255
184
|
|
|
256
185
|
## Route near misses
|
|
257
186
|
|
|
258
|
-
|
|
259
|
-
`cratis-screenplay-projections`; layout and forms: `cratis-screenplay-ui-composition`.
|
|
260
|
-
- Streams and invariants: `cratis-screenplay-streams-and-consistency`; automations and captures:
|
|
261
|
-
`cratis-screenplay-automations-and-translations`.
|
|
262
|
-
- Scenarios and specification forms: `cratis-screenplay-scenario-coverage`,
|
|
263
|
-
`cratis-screenplay-specifications`; audit: `cratis-screenplay-model-review`.
|
|
187
|
+
Read [references/neighbouring-skills.md](references/neighbouring-skills.md) when the work is grammar, layout, streams, automations, scenarios or audit rather than slice design.
|
|
264
188
|
|
|
265
189
|
## References (load on demand)
|
|
266
190
|
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
- The inventory
|
|
8
8
|
- Filled for `worked-example.md`
|
|
9
9
|
- Common mistakes
|
|
10
|
+
- Interview batch for slice design
|
|
10
11
|
|
|
11
12
|
For every command, record what it needs, where each input comes from, how it can succeed and
|
|
12
13
|
every way it can be refused. The inventory is the design output that
|
|
@@ -197,3 +198,27 @@ not been asked the refusal questions.
|
|
|
197
198
|
(retention can be configured in newer Chronicle; verify it, never audit secrets).
|
|
198
199
|
Mark concepts bare `pii` for personal data or `secret` for operational secrets,
|
|
199
200
|
never on the identifier; declare use/basis/retention in a purpose, not a reason.
|
|
201
|
+
|
|
202
|
+
## Interview batch for slice design
|
|
203
|
+
|
|
204
|
+
1. **Origin of each action.** Is it (A) user-initiated only, (B) automated, (C) a mix, or
|
|
205
|
+
started by a clock or outside system (schedule, webhook, feed)? Impact: separates screen
|
|
206
|
+
commands from automation (and a trusted path); clocks and outside records are designed in
|
|
207
|
+
`cratis-screenplay-automations-and-translations` (trigger, capture, reaction over imports).
|
|
208
|
+
Follow-up: if a mix, which user actions start automation, and what does it decide on its
|
|
209
|
+
own? If outside systems, which one and what data does it send?
|
|
210
|
+
2. **Critical fields.** Which data matters most on each screen, and what decision does the
|
|
211
|
+
person make from each field? Impact: fields with no decision behind them are questions, not
|
|
212
|
+
requirements. Follow-up: for a field nobody can justify, ask whether it is history worth
|
|
213
|
+
keeping or can go.
|
|
214
|
+
3. **Freshness and cost.** How stale may each view be, and what does a stale answer cost?
|
|
215
|
+
Impact: picks projection versus reducer, and one-shot versus `observable`. Follow-up: if a
|
|
216
|
+
wrong answer is expensive (a booking, a payment), that decision needs a protected read
|
|
217
|
+
(`references/rule-layers.md`), not a view. For every calculated or aggregated figure
|
|
218
|
+
(a total, a count, an average) ask whether it recalculates as source data changes ("so it
|
|
219
|
+
belongs in a view - does that match your expectation?") or whether someone agrees or
|
|
220
|
+
certifies a value (a fact, step 5).
|
|
221
|
+
4. **Granularity.** When someone changes these values, why? Impact: separates decisions from
|
|
222
|
+
forms. Follow-up: when a screen edits several values, ask for each who changes it and why.
|
|
223
|
+
5. **Existing UI or constraints.** Is there a screen or system to match? Impact: origins and
|
|
224
|
+
screen data. Follow-up: ask to see it; styling belongs to `cratis-screenplay-ui-composition`.
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- The reason line per contributing event
|
|
10
10
|
- Gap handling
|
|
11
11
|
- Adding or renaming a field along a chain (manual checklist)
|
|
12
|
+
- Tracing caller details
|
|
12
13
|
|
|
13
14
|
Every value in the model has a place it comes from and a place it goes. If you cannot say
|
|
14
15
|
where a field comes from, the model is missing an input, an event field or a decision. If an
|
|
@@ -170,3 +171,11 @@ go to the identity owner):
|
|
|
170
171
|
| 4 | command InstallLocker | `volume` | skipped: not part of this change |
|
|
171
172
|
| 5 | concept Litres | none | skipped: unchanged |
|
|
172
173
|
| 6 | specifications | read-model and query expectations only; LockerInstalled event expectations stay `volume` | updated |
|
|
174
|
+
|
|
175
|
+
## Tracing caller details
|
|
176
|
+
|
|
177
|
+
Trace caller details to claims or a keyed single-result identity-source query
|
|
178
|
+
(built-in/claim/literal key, detail-independent effective gate, compatible result).
|
|
179
|
+
The `identity` block is authoring metadata; executable `$identity.<detail>` reads
|
|
180
|
+
remain PLAY0268. `scoped to` is opaque, not a detail reference; see command-surface
|
|
181
|
+
`references/context.md`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Identity-affecting edits on an existing model
|
|
2
|
+
|
|
3
|
+
How to classify an edit against catalog addresses.
|
|
4
|
+
|
|
5
|
+
Classify an edit by whether it changes catalog addresses. When `.screenplay/identities.json`
|
|
6
|
+
exists, adding, removing or renaming an addressed element (declarations, properties of commands, events,
|
|
7
|
+
read models, composite types and triggers, queries, query arguments, specifications), moving
|
|
8
|
+
declarations between files, creating, deleting, renaming or moving a mapped `.play` document, and any
|
|
9
|
+
contract change to a persisted event go through MCP, performed by the identity owner
|
|
10
|
+
(`cratis-screenplay-modeling-lifecycle`, *Classify by catalog address*; evolution classes:
|
|
11
|
+
`cratis-screenplay-streams-and-consistency`). Bounded text edits are only for edits that
|
|
12
|
+
preserve addresses (descriptions, rule and expression bodies, mappings between existing
|
|
13
|
+
members). Without `identities.json`, plain text edits are fine. Never use a text edit to get
|
|
14
|
+
around a refusal from the typed tools.
|
|
@@ -82,3 +82,12 @@ PLAY0477. These diagnostics have no automatic repair; choose the owning text.
|
|
|
82
82
|
|
|
83
83
|
Authority: Screenplay v4.127.0 `slices.md` and `specifications.md`. The complete
|
|
84
84
|
model above validates and its specification passes on standalone 4.127.0.
|
|
85
|
+
|
|
86
|
+
## Summary versus documentation
|
|
87
|
+
|
|
88
|
+
- Keep the one-line summary in `description`, including short status markers such as
|
|
89
|
+
**NOT enforced in the model today** (with its target) or **ASSUMED**; record durable
|
|
90
|
+
reasoning, assumptions, causes and rejected alternatives in fenced Markdown
|
|
91
|
+
`documentation` on the module, feature, slice, command, event, read model or reaction, not `//` comments or disconnected notes. These are report-only, not
|
|
92
|
+
enforcement. The rest of this reference covers owners,
|
|
93
|
+
syntax, folder merge and PLAY0558/0559.
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/neighbouring-skills.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Neighbouring skills
|
|
2
|
+
|
|
3
|
+
Which skill owns each task next to slice design.
|
|
4
|
+
|
|
5
|
+
- Grammar: `cratis-screenplay-command-surface`, `cratis-screenplay-read-surface`,
|
|
6
|
+
`cratis-screenplay-projections`; layout and forms: `cratis-screenplay-ui-composition`.
|
|
7
|
+
- Streams and invariants: `cratis-screenplay-streams-and-consistency`; automations and captures:
|
|
8
|
+
`cratis-screenplay-automations-and-translations`.
|
|
9
|
+
- Scenarios and specification forms: `cratis-screenplay-scenario-coverage`,
|
|
10
|
+
`cratis-screenplay-specifications`; audit: `cratis-screenplay-model-review`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Product sources
|
|
2
|
+
|
|
3
|
+
Sources behind the slice-design rules.
|
|
4
|
+
|
|
5
|
+
Screenplay `commands.md`, `constraints.md`, `specifications.md`, `diagnostics.md` (`PLAY0191`, `PLAY0268`, `PLAY0271`, `PLAY0350`, `PLAY0381`, `PLAY0397`) and `projections/keys.md`.
|
|
6
|
+
|
|
7
|
+
Examples compile with `screenplay --warnaserror` and `cratis screenplay validate
|
|
8
|
+
--warnings-as-errors`; other tool versions: `cratis-screenplay-toolchain`
|
|
9
|
+
`SKILL.md`. Compiling proves syntax, not that the model is executable or renders.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Public boundaries and view identity
|
|
2
|
+
|
|
3
|
+
Public boundaries and view identity in slice design.
|
|
4
|
+
|
|
5
|
+
Translate crosses an application boundary: inbound consumes foreign public events
|
|
6
|
+
or data and produces private facts; outbound folds private facts into exactly one
|
|
7
|
+
local public event type. Commands never publish public events. Put direction in
|
|
8
|
+
the slice outline and trace every exported field; read automations-and-translations
|
|
9
|
+
`references/public-events-and-direction.md` for the released ESM v9 contract.
|
|
10
|
+
|
|
11
|
+
Mark view identity with trailing `key`. Use a composite key for independent view
|
|
12
|
+
coordinates (resource + period), a natural single id for one entity's state.
|
|
13
|
+
Supply every named part in single-instance queries and command/trigger reads;
|
|
14
|
+
see read-surface `references/named-keys.md`. Composite view keys remain
|
|
15
|
+
unadmitted (PLAY0268), unlike admitted composite stream routes.
|
|
16
|
+
Keep the true identity and report the gap rather than inventing a concatenated id.
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
- Building it
|
|
17
17
|
- Omissions are decisions
|
|
18
18
|
- Checks before handing off
|
|
19
|
+
- Query binding
|
|
20
|
+
- Executable identity of a read model
|
|
21
|
+
- Identifier and key contract
|
|
22
|
+
- Mappings to undeclared or unmapped properties
|
|
19
23
|
|
|
20
24
|
## Start from the consumer
|
|
21
25
|
|
|
@@ -317,3 +321,35 @@ module Berths
|
|
|
317
321
|
no single-instance identifier. Queryless views need explicit `key`. The identifier
|
|
318
322
|
equals the projection's key (table above); check target renderer admission separately.
|
|
319
323
|
- Each design-only shape (one the renderer does not admit) is listed with the V3 diagnostic code it causes.
|
|
324
|
+
|
|
325
|
+
## Query binding
|
|
326
|
+
|
|
327
|
+
- A query's `by` goes on its own body line. Optional keyed and collection queries
|
|
328
|
+
bind, including observable delivery. Caller-supplied equality filters on collections
|
|
329
|
+
bind as ESM v14; `by` ANDs with supplied filters. `from`, single-result
|
|
330
|
+
filters, scope, performer and composite `by` remain PLAY0268 for their respective
|
|
331
|
+
context/cardinality/opaque/multipart gaps. Read read-surface
|
|
332
|
+
[equality filters](../../cratis-screenplay-read-surface/references/equality-filters.md).
|
|
333
|
+
|
|
334
|
+
## Executable identity of a read model
|
|
335
|
+
|
|
336
|
+
read model needs one unambiguous identity: explicit trailing `key` first, else
|
|
337
|
+
single-instance queries agreeing on `by xId XId`, else conventional `*Id` inference
|
|
338
|
+
only with an admitted list query and no single-instance identifier. Queryless views
|
|
339
|
+
need explicit `key`; read-surface `references/named-keys.md` gives the exact fallback.
|
|
340
|
+
The identifier equals the projection's effective key (decision table in
|
|
341
|
+
`references/read-model-design.md`; Stage rule in `references/admission.md` of
|
|
342
|
+
`cratis-stage-rendering-and-sandbox`). Collections and observable delivery bind;
|
|
343
|
+
check renderer admission separately.
|
|
344
|
+
|
|
345
|
+
## Identifier and key contract
|
|
346
|
+
|
|
347
|
+
- At most one `identifier` per command; never on an event property; never on a read-model
|
|
348
|
+
property (use `key`; otherwise identity comes from single-instance `by`, or
|
|
349
|
+
conventional `*Id` only with an admitted list query and no single-instance identifier).
|
|
350
|
+
Queryless read models need explicit `key`.
|
|
351
|
+
- At most one builder (projection or reducer) per read model (`PLAY0191`).
|
|
352
|
+
|
|
353
|
+
## Mappings to undeclared or unmapped properties
|
|
354
|
+
|
|
355
|
+
- A mapping to an undeclared target fails only at binding (V3, PLAY0273); a declared property that nothing maps (for example after a one-sided rename that AutoMap relied on) is reported by `field-origins` only where coverage is known: trace by hand too.
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
- Rule coverage
|
|
11
11
|
- Slice audit
|
|
12
12
|
- The next slice
|
|
13
|
+
- Handoff line per element
|
|
14
|
+
- Rule coverage
|
|
13
15
|
|
|
14
16
|
## Slices are the authoring unit
|
|
15
17
|
|
|
@@ -269,3 +271,18 @@ at a time. In a modeling session, act: write
|
|
|
269
271
|
the slice, note the assumption that chose it, and ask for correction afterwards. A wrong guess
|
|
270
272
|
costs one edit; an empty turn costs a round-trip. Record why the slice was chosen in the
|
|
271
273
|
handoff.
|
|
274
|
+
|
|
275
|
+
## Handoff line per element
|
|
276
|
+
|
|
277
|
+
`references/verdicts.md`). Hand off with the model root and source revision, the slices
|
|
278
|
+
touched, and **one line per element** (command with origin classified [USER] or [AUTO]
|
|
279
|
+
and refusals, screen with `data`, read model with consumers, slice with events consumed),
|
|
280
|
+
not only problems; a new slice adds why it was chosen. Decided refusals go to
|
|
281
|
+
`cratis-screenplay-scenario-coverage`, never to open questions.
|
|
282
|
+
|
|
283
|
+
## Rule coverage
|
|
284
|
+
|
|
285
|
+
- Rule coverage: for each value carrying a rule, list every path that sets it
|
|
286
|
+
(`references/slicing.md`). A constraint on a claim covers every event setting that claim;
|
|
287
|
+
value invariants live in the concept so they travel; command-level conditions are reviewed
|
|
288
|
+
per path, not copied blindly.
|
|
@@ -92,40 +92,7 @@ for synthesis refusals, selection, provenance and a complete passing model.
|
|
|
92
92
|
|
|
93
93
|
## The vocabulary
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
| --- | --- |
|
|
97
|
-
| `given <EventType>` | prior state, established by replaying events before the action |
|
|
98
|
-
| `given readmodel <ReadModelType>` | prior read-model state, established directly — a **complete** instance including its identifier |
|
|
99
|
-
| `given caller` / `given caller as <Persona>` | explicit caller (`authenticated`, roles, claims; empty means anonymous), or an authenticated synthesized persona witness |
|
|
100
|
-
| `when <CommandType>` | run a command |
|
|
101
|
-
| `when append <EventType>` | append one event: constraints and projections run, the command does not; reactions run only from ESM v6, where `then` lists what followed |
|
|
102
|
-
| `when query <Query>` | perform a query with the argument values beneath it |
|
|
103
|
-
| `then result [exactly]` | one expected row of the performed query; repeat for several |
|
|
104
|
-
| `then no result` | the performed query returns nothing |
|
|
105
|
-
| `given clock "<instant>"` | the ISO 8601 instant the scenario happens at |
|
|
106
|
-
| `when clock "<instant>"` | the clock reaches an instant; scheduled reactions that are due run |
|
|
107
|
-
| `when trigger <Trigger>` | an application trigger fires with the values beneath it |
|
|
108
|
-
| `given capture` / `when capture <Capture>` | an earlier and the current record of a capture's source |
|
|
109
|
-
| `generated <name> = <value>` | beneath `when <Command>`: the fixture for a generated property other than the identifier (ESM v7); `for` beneath the `when` supplies the generated identifier |
|
|
110
|
-
| `then returns [<value>]` | the command's response (ESM v7): `then returns "<uuid>"` for a scalar, `then returns` with named `field = value` lines for a subset of a record |
|
|
111
|
-
| `then <EventType>` | an expected new event |
|
|
112
|
-
| `then events in any order` | compare the new events without regard to order |
|
|
113
|
-
| `then readmodel <ReadModelType> [exactly]` | read-model state afterwards — must state the identifier |
|
|
114
|
-
| `then no readmodel <ReadModelType> for <key>` | exactly that keyed instance is absent; the key is concrete and typed |
|
|
115
|
-
| `then query <Query> [exactly]` | query results for explicit `arguments` (none for an unkeyed list); one `result` per row, each stating the identifier; none means empty |
|
|
116
|
-
| `file <path>` | optional, once: the repository-relative file realizing the specification |
|
|
117
|
-
| `then error "<message>"` | a validation or constraint rejection, for that reason; a localized rule is pinned by its quoted key, `then error "$strings.<key>"` |
|
|
118
|
-
| `then error` | a validation or constraint rejection, reason unnamed |
|
|
119
|
-
| `then denied` | an authorization denial (`Unauthorized`) |
|
|
120
|
-
| `for <value>` | the event source of a `given`/`then` event, or of the `when` command or appended event |
|
|
121
|
-
| `<property> = <value>` | a literal, `null`, or a one-line JSON-shaped object or list: `lines = [{"sku":"A-1","quantity":2}]` |
|
|
122
|
-
|
|
123
|
-
An enumeration value binds whether it is written bare
|
|
124
|
-
(`status = sent`), qualified (`status = InvoiceStatus.sent`) or quoted, and a
|
|
125
|
-
`DateTime` value binds as a plain ISO 8601 instant (`"2026-10-05T08:00:00Z"`).
|
|
126
|
-
An older compiler binds only the quoted member and the full round-trip instant
|
|
127
|
-
(`"2026-10-05T08:00:00.0000000Z"`) although it accepts all forms - quote members when a
|
|
128
|
-
model must bind on older versions.
|
|
95
|
+
Read [references/vocabulary.md](references/vocabulary.md) when writing or reading a `given`, `when` or `then` line, to look up a construct such as `then events in any order`, `then no readmodel`, `generated`, `then returns`, `then error` or `then denied`, or an enumeration or `DateTime` literal.
|
|
129
96
|
|
|
130
97
|
Rules the binder enforces:
|
|
131
98
|
|
|
@@ -154,21 +121,8 @@ the one-rejection rule (`PLAY0273`) are reported only when the model binds, so
|
|
|
154
121
|
|
|
155
122
|
## How outcomes are compared
|
|
156
123
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`when append`, a model before ESM v6 expects the appended fact itself; from
|
|
160
|
-
ESM v6 the appended event is the action and `then` lists only what followed it.
|
|
161
|
-
- **Read models and query rows:** only the asserted properties must match
|
|
162
|
-
(subset); add `exactly` to require every property. Query row count is exact;
|
|
163
|
-
collection rows match by read model/key regardless of order. Ordering within a
|
|
164
|
-
collection-valued property is unchanged. A missing property does not match an asserted `null`.
|
|
165
|
-
- **Rejections:** `then error "<message>"` matches the message whatever the rule's
|
|
166
|
-
validation severity; no form asserts severity. Bare `then error` never matches
|
|
167
|
-
a denial. Quote a localized key: `then error "$strings.invoices.reasonRequired"`.
|
|
168
|
-
Besides a String `case.<parameter>`, the grammar takes only quoted messages here, never an unquoted `$strings` token
|
|
169
|
-
(unlike a rule's `message` operand). The reference runner compares the symbolic key
|
|
170
|
-
and requires the rejection to carry the string-key marker; it never loads
|
|
171
|
-
translated text; resolving the key is the realization's job.
|
|
124
|
+
Events compare as the complete new set in authored order (exact count). Read models and query rows: only the asserted properties must match (add `exactly` for all). Rejections: `then error "<message>"` matches the message, never severity. Bare `then error` never matches
|
|
125
|
+
a denial. Read [references/outcome-comparison.md](references/outcome-comparison.md) when asserting events, rows, ordering or a localized rejection key.
|
|
172
126
|
|
|
173
127
|
## Worked example
|
|
174
128
|
|
|
@@ -217,23 +171,11 @@ matching given occurrence with no undecided candidates (PLAY0543); redelivery
|
|
|
217
171
|
remains authoring-only. Event `stream`/`no stream` assertions bind as ESM v8; typed `for` and
|
|
218
172
|
stream ids are not guessed. Read [examples and routes](references/examples-and-routes.md).
|
|
219
173
|
|
|
220
|
-
`given operation
|
|
221
|
-
future external-work behavior. Reaction refusal branches, `when redelivered`
|
|
222
|
-
and `then no events` (PLAY0268) are also authoring-only: compile them, but report their
|
|
223
|
-
PLAY0268 binding refusal instead of an executed result. Preserve the contract; a read-model or
|
|
224
|
-
query assertion states a zero-fact outcome.
|
|
174
|
+
`given operation`, `then operation`, `then compensated`, reaction refusal branches, `when redelivered` and `then no events` are authoring-only (`PLAY0268`): compile them and report the refusal, never an executed result. Read [references/examples-and-routes.md](references/examples-and-routes.md) for the full wording.
|
|
225
175
|
|
|
226
176
|
## Rejections and denials say different things
|
|
227
177
|
|
|
228
|
-
`then error "<message>"`
|
|
229
|
-
message is the point. Bare `then error` says **rejected, for a reason this
|
|
230
|
-
specification does not name**; the reason lives in the specification's name.
|
|
231
|
-
`then denied` says **this caller may not do this**, which is decided before any
|
|
232
|
-
validation runs. Write the bare form rather than `then error ""`.
|
|
233
|
-
|
|
234
|
-
**Views cannot reject events.** A projection never refuses an event; there are no
|
|
235
|
-
error cases for one. (A `when append` can still be refused by an append-time
|
|
236
|
-
constraint — that is the constraint speaking, not the view.)
|
|
178
|
+
`then error "<message>"` pins the reason, bare `then error` leaves it unnamed, and `then denied` is an authorization denial decided first. Views cannot reject events. Read [references/outcome-comparison.md](references/outcome-comparison.md) when choosing among them.
|
|
237
179
|
|
|
238
180
|
## Business rule or concept rule?
|
|
239
181
|
|
package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md
CHANGED
|
@@ -216,3 +216,9 @@ acknowledgement and their whole-model refusal boundary are in
|
|
|
216
216
|
captures-and-reactions `references/refusals-and-redelivery.md`.
|
|
217
217
|
|
|
218
218
|
Authority: Screenplay `Documentation/screenplay/specifications.md`.
|
|
219
|
+
|
|
220
|
+
`given operation ... fails`, `then operation` and `then compensated` describe
|
|
221
|
+
future external-work behavior. Reaction refusal branches, `when redelivered`
|
|
222
|
+
and `then no events` (PLAY0268) are also authoring-only: compile them, but report their
|
|
223
|
+
PLAY0268 binding refusal instead of an executed result. Preserve the contract; a read-model or
|
|
224
|
+
query assertion states a zero-fact outcome.
|
package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# How outcomes are compared
|
|
2
|
+
|
|
3
|
+
This reference holds the comparison rules for events, read models, query rows and rejections.
|
|
4
|
+
|
|
5
|
+
## How outcomes are compared
|
|
6
|
+
|
|
7
|
+
- **Events:** the complete set of new events, in authored order, unless
|
|
8
|
+
`then events in any order` is stated. The count is always exact. After
|
|
9
|
+
`when append`, a model before ESM v6 expects the appended fact itself; from
|
|
10
|
+
ESM v6 the appended event is the action and `then` lists only what followed it.
|
|
11
|
+
- **Read models and query rows:** only the asserted properties must match
|
|
12
|
+
(subset); add `exactly` to require every property. Query row count is exact;
|
|
13
|
+
collection rows match by read model/key regardless of order. Ordering within a
|
|
14
|
+
collection-valued property is unchanged. A missing property does not match an asserted `null`.
|
|
15
|
+
- **Rejections:** `then error "<message>"` matches the message whatever the rule's
|
|
16
|
+
validation severity; no form asserts severity. Bare `then error` never matches
|
|
17
|
+
a denial. Quote a localized key: `then error "$strings.invoices.reasonRequired"`.
|
|
18
|
+
Besides a String `case.<parameter>`, the grammar takes only quoted messages here, never an unquoted `$strings` token
|
|
19
|
+
(unlike a rule's `message` operand). The reference runner compares the symbolic key
|
|
20
|
+
and requires the rejection to carry the string-key marker; it never loads
|
|
21
|
+
translated text; resolving the key is the realization's job.
|
|
22
|
+
|
|
23
|
+
## Rejections and denials say different things
|
|
24
|
+
|
|
25
|
+
`then error "<message>"` says **rejected, for this reason** — pin it when the
|
|
26
|
+
message is the point. Bare `then error` says **rejected, for a reason this
|
|
27
|
+
specification does not name**; the reason lives in the specification's name.
|
|
28
|
+
`then denied` says **this caller may not do this**, which is decided before any
|
|
29
|
+
validation runs. Write the bare form rather than `then error ""`.
|
|
30
|
+
|
|
31
|
+
**Views cannot reject events.** A projection never refuses an event; there are no
|
|
32
|
+
error cases for one. (A `when append` can still be refused by an append-time
|
|
33
|
+
constraint — that is the constraint speaking, not the view.)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# The specification vocabulary
|
|
2
|
+
|
|
3
|
+
This reference holds the given/when/then construct table and the enumeration and DateTime literal rules.
|
|
4
|
+
|
|
5
|
+
## The vocabulary
|
|
6
|
+
|
|
7
|
+
| Construct | Meaning |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `given <EventType>` | prior state, established by replaying events before the action |
|
|
10
|
+
| `given readmodel <ReadModelType>` | prior read-model state, established directly — a **complete** instance including its identifier |
|
|
11
|
+
| `given caller` / `given caller as <Persona>` | explicit caller (`authenticated`, roles, claims; empty means anonymous), or an authenticated synthesized persona witness |
|
|
12
|
+
| `when <CommandType>` | run a command |
|
|
13
|
+
| `when append <EventType>` | append one event: constraints and projections run, the command does not; reactions run only from ESM v6, where `then` lists what followed |
|
|
14
|
+
| `when query <Query>` | perform a query with the argument values beneath it |
|
|
15
|
+
| `then result [exactly]` | one expected row of the performed query; repeat for several |
|
|
16
|
+
| `then no result` | the performed query returns nothing |
|
|
17
|
+
| `given clock "<instant>"` | the ISO 8601 instant the scenario happens at |
|
|
18
|
+
| `when clock "<instant>"` | the clock reaches an instant; scheduled reactions that are due run |
|
|
19
|
+
| `when trigger <Trigger>` | an application trigger fires with the values beneath it |
|
|
20
|
+
| `given capture` / `when capture <Capture>` | an earlier and the current record of a capture's source |
|
|
21
|
+
| `generated <name> = <value>` | beneath `when <Command>`: the fixture for a generated property other than the identifier (ESM v7); `for` beneath the `when` supplies the generated identifier |
|
|
22
|
+
| `then returns [<value>]` | the command's response (ESM v7): `then returns "<uuid>"` for a scalar, `then returns` with named `field = value` lines for a subset of a record |
|
|
23
|
+
| `then <EventType>` | an expected new event |
|
|
24
|
+
| `then events in any order` | compare the new events without regard to order |
|
|
25
|
+
| `then readmodel <ReadModelType> [exactly]` | read-model state afterwards — must state the identifier |
|
|
26
|
+
| `then no readmodel <ReadModelType> for <key>` | exactly that keyed instance is absent; the key is concrete and typed |
|
|
27
|
+
| `then query <Query> [exactly]` | query results for explicit `arguments` (none for an unkeyed list); one `result` per row, each stating the identifier; none means empty |
|
|
28
|
+
| `file <path>` | optional, once: the repository-relative file realizing the specification |
|
|
29
|
+
| `then error "<message>"` | a validation or constraint rejection, for that reason; a localized rule is pinned by its quoted key, `then error "$strings.<key>"` |
|
|
30
|
+
| `then error` | a validation or constraint rejection, reason unnamed |
|
|
31
|
+
| `then denied` | an authorization denial (`Unauthorized`) |
|
|
32
|
+
| `for <value>` | the event source of a `given`/`then` event, or of the `when` command or appended event |
|
|
33
|
+
| `<property> = <value>` | a literal, `null`, or a one-line JSON-shaped object or list: `lines = [{"sku":"A-1","quantity":2}]` |
|
|
34
|
+
|
|
35
|
+
An enumeration value binds whether it is written bare
|
|
36
|
+
(`status = sent`), qualified (`status = InvoiceStatus.sent`) or quoted, and a
|
|
37
|
+
`DateTime` value binds as a plain ISO 8601 instant (`"2026-10-05T08:00:00Z"`).
|
|
38
|
+
An older compiler binds only the quoted member and the full round-trip instant
|
|
39
|
+
(`"2026-10-05T08:00:00.0000000Z"`) although it accepts all forms - quote members when a
|
|
40
|
+
model must bind on older versions.
|