@cratis/pi 7.62.0 → 7.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/product-sync.json +9 -9
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-command/references/generated-values.md +27 -12
- package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +17 -6
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +10 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +49 -6
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +43 -41
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +11 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-interview.md +24 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +76 -10
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +39 -23
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +35 -12
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +51 -81
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +83 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +14 -4
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +59 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md +60 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +5 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +37 -30
- package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +100 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +82 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +82 -28
- package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +113 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +45 -12
- package/package/corpus/skills/cratis-screenplay-command-surface/references/text-and-match-rules.md +119 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +26 -6
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +13 -3
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +12 -12
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +5 -3
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +5 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +1 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +51 -14
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +5 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +2 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +6 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +22 -28
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/choosing-generation.md +20 -7
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +13 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +9 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +58 -10
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -2
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -5
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +2 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +3 -2
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +3 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +8 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -4
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +48 -30
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +10 -4
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +15 -4
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +25 -20
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +14 -3
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +9 -3
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +9 -4
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -4
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -3
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +8 -8
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +69 -47
- package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +11 -1
- package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +48 -17
- package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md +6 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +14 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +25 -21
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +2 -2
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +9 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +4 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +7 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +32 -22
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +60 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +66 -6
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +67 -23
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-checks.md +93 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +117 -35
- package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +61 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +3 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +27 -10
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +3489 -335
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +5 -3
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -1
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +8 -53
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +2 -2
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/interaction-example.md +54 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +6 -3
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -29
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +39 -9
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +28 -8
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/publication-and-recovery.md +31 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +8 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +4 -1
- package/package.json +1 -1
|
@@ -97,14 +97,15 @@ module Moorings
|
|
|
97
97
|
Record, per slice, the events it consumes and which slice produces each. This is for
|
|
98
98
|
orientation, not a build order: view specifications use synthetic `given` events, so slices
|
|
99
99
|
are built and checked independently. A command or reaction may consult another slice's view
|
|
100
|
-
(`reads`;
|
|
100
|
+
(`reads`; eligible command reads can opt into v25 protection, trigger reads cannot;
|
|
101
|
+
see `rule-layers.md` for target gaps). A slice never calls another slice's
|
|
101
102
|
command except through `invokes`. Dependencies run in one direction; a cycle through events
|
|
102
103
|
means the story is a feedback loop that belongs in an `Automation` slice.
|
|
103
104
|
|
|
104
105
|
The contract between slices is events: slice B depends on slice A because B's command, rule
|
|
105
106
|
or view needs an event A produces. Two other edges are supported and recorded explicitly, never
|
|
106
|
-
implied: `reads <View>` from another slice (
|
|
107
|
-
|
|
107
|
+
implied: `reads <View>` from another slice (declare protected-command opt-in and
|
|
108
|
+
admission, or mark the legacy/refused shape and target gap, `rule-layers.md`) and `invokes <Command>` from a reaction. No shared state or
|
|
108
109
|
other direct call. Name each
|
|
109
110
|
slice after its element (the command, the view, the automation, the translation (capture or translator reaction)), not a broader feature name
|
|
110
111
|
that spans several. Per slice, record:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Worked example: parcel lockers (design mode)
|
|
2
2
|
|
|
3
|
-
One complete
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
and
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
One complete legacy design-mode control for `cratis-screenplay-slice-design`, without
|
|
4
|
+
`command reads protected`. Its reads and read paths retain PLAY0271/PLAY0268, so no
|
|
5
|
+
specification runs here. List queries and clock fixtures bind on an admitting compiler;
|
|
6
|
+
they are not the remaining blocker. Personas and screens are informational.
|
|
7
|
+
Eligible command reads can opt into v25; inspect every projection/key/removal before
|
|
8
|
+
migration and retain Stage's separate refusal (STAGE-ESM-044; the v25 pair itself is admitted). Read
|
|
9
|
+
[protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md).
|
|
10
|
+
The unenforced descriptions below refer to this legacy control, not all command reads.
|
|
11
11
|
The specifications still seed every read-model source (`LockerInstalled`, `LockerRequested`,
|
|
12
12
|
complete givens) so they are the right form once binding is possible.
|
|
13
13
|
Lineage matrix: `field-lineage.md`. State-transition table and rule coverage: `slicing.md`.
|
|
@@ -40,41 +40,61 @@ Screenplay's reference runner executes specifications against an immutable
|
|
|
40
40
|
in-memory world: no Arc, no Chronicle, no database, no network. Every downstream
|
|
41
41
|
target has one normalized behavior to match.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- A
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
43
|
+
Binding is not plan admission. Read model-authoring's
|
|
44
|
+
[language reference](../cratis-screenplay-model-authoring/references/language-reference.md)
|
|
45
|
+
when distinguishing executable declarations, refused projection shapes and opaque
|
|
46
|
+
code. Reached opaque code is **unsupported**, never passed; portable denial may
|
|
47
|
+
still execute before it. Unsupported declarative constructs block the whole plan,
|
|
48
|
+
not just the specifications that touch them.
|
|
49
|
+
|
|
50
|
+
Read [reactions and cascades](references/reactions-and-cascades.md) when testing
|
|
51
|
+
ESM v6 actions; older compilers fail reaction/capture binding with PLAY0268.
|
|
52
|
+
Read [child ordering](references/child-ordering.md) for deferral;
|
|
53
|
+
an ambiguous parent still fails closed.
|
|
54
|
+
Requires Screenplay 4.149.1 or later (`screenplay --version`) for child deferral; older runners do not defer.
|
|
55
|
+
|
|
56
|
+
A rejected command/append leaves the world unchanged; an accepted one commits
|
|
57
|
+
before comparing views. V6 has no scenario-wide transaction: later cascade
|
|
58
|
+
failure does not roll back earlier accepted facts. Atomic mode boundaries are below.
|
|
59
|
+
|
|
60
|
+
Unsupported is not passed. Name a target. Run CLI/MCP reference execution
|
|
61
|
+
or target tests; name engine, version and expected/discovered selection.
|
|
62
|
+
|
|
63
|
+
## Batches, described bodies, protected reads and text rules
|
|
64
|
+
|
|
65
|
+
- With `reaction batches atomic`, assert no facts from a failed direct-production or
|
|
66
|
+
selected refusal-branch batch and unchanged views through evaluator world assertions,
|
|
67
|
+
not only `then error`. `then no events` is acceptance and cannot accompany an error. Earlier
|
|
68
|
+
accepted batches/invoked commands remain; legacy absence retains per-fact appends.
|
|
69
|
+
Read [atomic boundaries](../cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md).
|
|
70
|
+
- A described handler binds v23, but reaching its body returns Unsupported
|
|
71
|
+
ImplementationBody, naming command/RequirementId and emitting no events. Denial and
|
|
72
|
+
validation cases still run; an all-Unsupported run is never green. Read
|
|
73
|
+
[described handlers](../cratis-screenplay-command-surface/references/described-handlers.md).
|
|
74
|
+
- Protected command reads opt into v25. Test present/absent state and rule refusal;
|
|
75
|
+
matching decide/commit changes are Conflict / DecisionStateChanged, not validation
|
|
76
|
+
refusal. Race vectors are not new specification syntax. Read
|
|
77
|
+
[protected reads](../cratis-screenplay-command-surface/references/protected-reads.md).
|
|
78
|
+
- Literal text rules use ordinal UTF-16 comparison (v24); matches uses a portable
|
|
79
|
+
linear matcher, not platform regex. Old invalid/refused patterns plan as
|
|
80
|
+
UnsupportedValidation, not a successful check. Read
|
|
81
|
+
[text and match rules](../cratis-screenplay-command-surface/references/text-and-match-rules.md)
|
|
82
|
+
for boundary values and PLAY0699/0787. Reference success is not Stage admission.
|
|
83
|
+
|
|
84
|
+
## Chronological command date comparisons
|
|
85
|
+
|
|
86
|
+
Requires Screenplay 4.199.0 (ESM v26; `screenplay --version`); older binders refuse
|
|
87
|
+
these comparisons with PLAY0268. DateTime conditions compare UTC instants at tick
|
|
88
|
+
precision: cover equal instants with different offsets, increasing endpoints,
|
|
89
|
+
an inverted interval and a one-tick boundary. Every participating DateTime input
|
|
90
|
+
without an offset or `Z` rejects with Validation before rules, even when its
|
|
91
|
+
comparison is skipped; add a missing-offset rejection, not a clock fixture workaround.
|
|
92
|
+
`then` matching stays ordinal: expected event values keep the exact produced text,
|
|
93
|
+
not an equivalent offset. Read the complete [retention-window specifications](../cratis-screenplay-command-surface/references/date-comparisons.md)
|
|
94
|
+
for `require to >= from`, PLAY0268/0273 and Stage's v26 refusal. The missing-offset
|
|
95
|
+
runtime case needs an evaluator-request or target input test: putting the invalid
|
|
96
|
+
value in a typed `.play` fixture instead fails binding with PLAY0273; `then error`
|
|
97
|
+
does not exercise runtime validation.
|
|
78
98
|
|
|
79
99
|
## Descriptions, persona callers and case tables
|
|
80
100
|
|
|
@@ -102,8 +122,7 @@ Rules the binder enforces:
|
|
|
102
122
|
- **`then result` and `then no result` need `when query`**, and `when query`
|
|
103
123
|
needs one of them, `then denied` or a sole validation `then error` (`PLAY0465`). Each argument is a `by` or
|
|
104
124
|
`filter` parameter of the query (`PLAY0468`).
|
|
105
|
-
- **A clock instant is ISO 8601 with an offset or `Z
|
|
106
|
-
`"2026-10-05T08:00:00Z"` (`PLAY0461`); `given clock` appears at most once.
|
|
125
|
+
- **A clock instant is ISO 8601 with an offset or `Z`** (PLAY0461); one `given clock` maximum.
|
|
107
126
|
- **`then` contains either events or an error — never both.** A rejection
|
|
108
127
|
specification has exactly one rejection and no success outcome.
|
|
109
128
|
- **`then denied` stands alone**: not with events, errors or state assertions
|
|
@@ -114,10 +133,8 @@ Rules the binder enforces:
|
|
|
114
133
|
- **`null` only in optional read-model values.** A `null` in a command or event
|
|
115
134
|
value is `PLAY0350`: an optional fact is a separate event.
|
|
116
135
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
`screenplay --warnaserror` does not show them. Check executable diagnostics
|
|
120
|
-
(the MCP authoring tools) as well.
|
|
136
|
+
V1 does not report binding-only outcome errors; read `references/vocabulary.md`
|
|
137
|
+
for parse-versus-bind diagnostics and check executable diagnostics too.
|
|
121
138
|
|
|
122
139
|
## How outcomes are compared
|
|
123
140
|
|
|
@@ -154,12 +171,12 @@ Read [references/reactions-and-cascades.md](references/reactions-and-cascades.md
|
|
|
154
171
|
|
|
155
172
|
## Published-event specifications (released ESM v9)
|
|
156
173
|
|
|
157
|
-
Use `when append <PrivateEvent>` then `then <PublicEvent
|
|
158
|
-
|
|
159
|
-
[publication
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
unadmitted
|
|
174
|
+
Use `when append <PrivateEvent>` then `then <PublicEvent>`, not `then readmodel`;
|
|
175
|
+
follow-up events are exhaustive and ordered. Read
|
|
176
|
+
[publication and fold cases](../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md)
|
|
177
|
+
when specifying outbound facts or event-source captures: it owns the minimum
|
|
178
|
+
compiler, PLAY0700/0701, key folding and Unsupported boundaries. Composite view
|
|
179
|
+
fixtures remain unadmitted; see read-surface `references/named-keys.md`.
|
|
163
180
|
|
|
164
181
|
## Reusable fixtures, routes and recovery intent
|
|
165
182
|
|
|
@@ -194,6 +211,9 @@ Whitespace-acceptance specs fail. This applies to every ESM version.
|
|
|
194
211
|
|
|
195
212
|
Requires Screenplay 4.151.0 or later (`screenplay --version`) for the Unicode `not empty` correction.
|
|
196
213
|
|
|
214
|
+
Date/DateTime comparisons are the command-only exception: do not move them onto
|
|
215
|
+
concept rules to follow the general format-rule convention.
|
|
216
|
+
|
|
197
217
|
## Application-boundary coverage
|
|
198
218
|
|
|
199
219
|
Every slice should carry at least one specification whose action is what a real
|
|
@@ -221,6 +241,8 @@ For command specifications:
|
|
|
221
241
|
- [ ] Error cases test business rules; each concept rule has one rejection
|
|
222
242
|
specification through one command, not one per use.
|
|
223
243
|
- [ ] A localized rejection is pinned by its quoted `$strings` key.
|
|
244
|
+
- [ ] DateTime comparisons cover offset-less input rejection before rules, equal
|
|
245
|
+
instants across offsets and tick boundaries; `then` keeps ordinal payload values.
|
|
224
246
|
|
|
225
247
|
For view specifications:
|
|
226
248
|
|
package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md
CHANGED
|
@@ -7,7 +7,17 @@ A slice is not always set off by a command. Name what does:
|
|
|
7
7
|
| A view no event builds - its query has a `performer` | `given readmodel` …, `when query <Query>`, `then result` / `then no result` |
|
|
8
8
|
| An automation driven by the clock | `given clock "<instant>"`, `when clock "<later instant>"` |
|
|
9
9
|
| An automation driven by an application trigger | `when trigger <Trigger>` with the values it carries |
|
|
10
|
-
| A translation driven by a capture | `given capture <Capture>` (the record as it was), `when capture <Capture>` (as it is now) |
|
|
10
|
+
| A translation driven by a record capture | `given capture <Capture>` (the record as it was), `when capture <Capture>` (as it is now) |
|
|
11
|
+
| A capture with `source events` | `given <FromEvent>`, `when append <FromEvent>`; capture-record fixtures are PLAY0701 |
|
|
12
|
+
|
|
13
|
+
A first record is `added` only, including child and nested records; field-change,
|
|
14
|
+
`and`/`or` and transition guards need earlier state for the same key. For first sight
|
|
15
|
+
add a separate `when added` append; for an update seed `given capture`. Requires
|
|
16
|
+
Screenplay 4.175.0 or later (`screenplay --version`); older record evaluators treat
|
|
17
|
+
first-record fields as changed. Complete cases: captures-and-reactions
|
|
18
|
+
[record capture specifications](../../cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md).
|
|
19
|
+
Event captures use the typed event fixtures and overlay rules in
|
|
20
|
+
[public event captures](../../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md).
|
|
11
21
|
|
|
12
22
|
Use `given clock`, never `given time`, to state the scenario occurrence time and
|
|
13
23
|
assert a value mapped from `$context.occurred`. In a command's `produces`, that
|
package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md
CHANGED
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
# Generated fixtures and return expectations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Choosing a strategy
|
|
6
|
+
- When not to
|
|
7
|
+
- Fixtures and outcomes
|
|
8
|
+
|
|
9
|
+
## Choosing a strategy
|
|
4
10
|
|
|
5
11
|
Use the [shop example](../../cratis-screenplay-command-surface/references/shop-generation.md):
|
|
6
12
|
pin CustomerId (`cus_` + ULID), OrderId (TypeID) and InviteCode (NanoID) as
|
|
7
13
|
whole values. ApiKey stays secret with no executable generation; do not write a
|
|
8
14
|
passing issuance spec that invents its .NET Bytes(32) factory in Screenplay.
|
|
9
|
-
|
|
15
|
+
Pin InvoiceNumber's whole date/checksum reference and TicketNumber's integral
|
|
16
|
+
pickup-ticket value too; do not use numeric text for Int fixtures.
|
|
10
17
|
|
|
11
18
|
Choose the concept's strategy for the job, then pin a whole value matching it:
|
|
12
19
|
`for` for its generated identifier, named `generated` fixtures for other values.
|
|
13
20
|
Use the shared [strategy reference](../../cratis-screenplay-command-surface/references/generated-values-and-responses.md)
|
|
14
|
-
for UUID, time-ordered, typed/opaque text
|
|
15
|
-
|
|
21
|
+
for UUID, time-ordered, typed/opaque text, byte budgets, finite patterns and Int
|
|
22
|
+
range choices and exact shapes.
|
|
23
|
+
`given clock` supplies `$context.occurred` and pattern UTC date segments, not a generated time-ordered ID;
|
|
16
24
|
a seed is not a portable fixture.
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
## When not to
|
|
19
27
|
|
|
20
28
|
Pins do not prove randomness, authorization, idempotency, storage freshness or
|
|
21
29
|
secret safety. Client-minted IDs stay inputs; gapless invoice numbering needs an
|
|
22
|
-
allocator, not a random fixture.
|
|
23
|
-
|
|
30
|
+
allocator, not a random fixture or pattern. Check digits catch typos, not forgery;
|
|
31
|
+
short payload codes need uniqueness enforcement separate from source freshness.
|
|
32
|
+
Pattern/random/rule and checksum validation bind as v21. Stage renders
|
|
33
|
+
pattern/random/checksum under the version gates below; `generate rule` remains
|
|
34
|
+
STAGE-ESM-028. Generated secrets remain refused. Source: Screenplay
|
|
24
35
|
`Documentation/screenplay/generated-values/choosing.md`.
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
## Fixtures and outcomes
|
|
27
38
|
|
|
28
|
-
A compiler that admits ESM v7 binds and runs these; Stage renders supported UUID/String generation strategies,
|
|
39
|
+
A compiler that admits ESM v7 binds and runs these; Stage renders supported UUID/String and Int random generation strategies,
|
|
29
40
|
scalar/named responses, fixtures and `then returns`. Unsupported types/result combinations
|
|
30
41
|
remain `STAGE-ESM-028`/`-038`; preserve refused specifications as gap-fill contracts. The model and rules are in `cratis-screenplay-command-surface`; the
|
|
31
42
|
complete threaded model is the linked shop example. The excerpt below belongs
|
|
@@ -62,17 +73,37 @@ specification RegistersWithPinnedValues
|
|
|
62
73
|
own destinations. For commands without a generated identifier `when ... for` keeps the destination assertion.
|
|
63
74
|
UUID fixtures require canonical lowercase hyphenated form. From v15, pins must also match
|
|
64
75
|
exact strategy size, case, UUID version/variant and zero trailing encoding bits; invalid pins are
|
|
65
|
-
Contract rejections.
|
|
76
|
+
Contract rejections. A generated concept with rules selects v20 and checks pins
|
|
77
|
+
against both shape and rules, including implicit UUID. Rule failures are
|
|
78
|
+
`Rejected(Contract)` with `Generated fixture '<property>' fails concept '<Concept>' rules`,
|
|
79
|
+
never client validation failures or redraws. Earlier rule-free implicit-UUID
|
|
80
|
+
models check canonical UUID type, not its version.
|
|
66
81
|
- A serialized concept generation strategy selects v15 and Guarded whole-source freshness for all
|
|
67
82
|
generated destinations, including implicit UUIDs. Reusing a generated source with existing facts
|
|
68
|
-
rejects the entire command with Concurrency, without append, response or silent retry.
|
|
69
|
-
|
|
83
|
+
rejects the entire command with Concurrency, without append, response or silent retry.
|
|
84
|
+
Models without a serialized strategy retain legacy reuse even when rules select v20. See the complete [strategy example](../../cratis-screenplay-toolchain/references/generation-strategies-example.md)
|
|
70
85
|
and command-surface `references/generated-values-and-responses.md` for tagged sources.
|
|
71
|
-
- `given clock` supplies `$context.occurred
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
- `given clock` supplies `$context.occurred` and requires all pattern date segments
|
|
87
|
+
to match the same UTC instant, including offset rollover and leap days. Without
|
|
88
|
+
a clock the reference runner checks digit widths, never today's wall clock.
|
|
89
|
+
Checksum pins check arithmetic only with an authored `validate checksum` rule;
|
|
90
|
+
a generation modifier alone checks suffix shape. It does not synthesize UUIDv7,
|
|
91
|
+
ULID or TypeID: pin the whole identifier, never a seed. Stage time-ordered
|
|
92
|
+
factories use receipt time; admitted command clock specs render. Sources: Screenplay
|
|
75
93
|
`Documentation/screenplay/generated-values/choosing.md`; Stage
|
|
76
94
|
`Documentation/reference/generated-values-rendering.md`.
|
|
95
|
+
- Attached generation bodies are not run: pin the resulting String;
|
|
96
|
+
an opaque validator still yields Unsupported. Stage allows unpinned rendered
|
|
97
|
+
generation only when every concept rule is Proven and the expectations support
|
|
98
|
+
relational captures. Unproven/Refuted rules need pins (-038); invalid pins fail
|
|
99
|
+
STAGE-ESM-011. Opaque/unsupported rules refuse -005 before pin evaluation.
|
|
100
|
+
Screenplay's reference runner and Stage's independent executor always need pins.
|
|
77
101
|
- A reaction-invoked command that reaches generation is `Unsupported(IdentityAllocation)` (no fixture channel); a
|
|
78
102
|
response-only command runs and its response is discarded.
|
|
103
|
+
|
|
104
|
+
Requires Screenplay 4.164.0 (`screenplay --version`) for v20 rule-bearing generated pins, 4.172.0 for v21 finite/rule strategies; older compilers refuse PLAY0268.
|
|
105
|
+
Requires Stage 4.95.0 for command clock specs and 4.109.0 for v20 rule-bearing pins; older renderers refuse those shapes.
|
|
106
|
+
Requires Stage 4.115.0 for v21 admission/all-Proven unpinned rendering, 4.117.0
|
|
107
|
+
for warning/info generated-concept rules, 4.118.0 for checksum validation and
|
|
108
|
+
4.119.0 for pattern/random. Older renderers require rule-bearing pins or refuse
|
|
109
|
+
the respective rules/strategies with -038/-042/-028. `generate rule` remains -028.
|
package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md
CHANGED
|
@@ -20,6 +20,12 @@ This reference holds the comparison rules for events, read models, query rows an
|
|
|
20
20
|
and requires the rejection to carry the string-key marker; it never loads
|
|
21
21
|
translated text; resolving the key is the realization's job.
|
|
22
22
|
|
|
23
|
+
Date/DateTime `then` matching stays ordinal: different offsets naming one instant
|
|
24
|
+
do not match merely because a v26 command comparison considers them equal. Keep
|
|
25
|
+
the exact produced payload text in the expectation. Keys, constraints and freshness
|
|
26
|
+
also retain ordinal equality. For UTC-tick comparisons and pre-rule missing-offset
|
|
27
|
+
Validation rejections, read the [retention-window specifications](../../cratis-screenplay-command-surface/references/date-comparisons.md).
|
|
28
|
+
|
|
23
29
|
## Rejections and denials say different things
|
|
24
30
|
|
|
25
31
|
`then error "<message>"` says **rejected, for this reason** — pin it when the
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
1
4
|
# The specification vocabulary
|
|
2
5
|
|
|
3
6
|
This reference holds the given/when/then construct table and the enumeration and DateTime literal rules.
|
|
@@ -17,7 +20,7 @@ This reference holds the given/when/then construct table and the enumeration and
|
|
|
17
20
|
| `given clock "<instant>"` | the ISO 8601 instant the scenario happens at |
|
|
18
21
|
| `when clock "<instant>"` | the clock reaches an instant; scheduled reactions that are due run |
|
|
19
22
|
| `when trigger <Trigger>` | an application trigger fires with the values beneath it |
|
|
20
|
-
| `given capture` / `when capture <Capture>` |
|
|
23
|
+
| `given capture` / `when capture <Capture>` | earlier/current records for non-event sources; for `source events` use typed `given <Event>` / `when append <Event>` (PLAY0701) |
|
|
21
24
|
| `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
25
|
| `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
26
|
| `then <EventType>` | an expected new event |
|
|
@@ -32,6 +35,16 @@ This reference holds the given/when/then construct table and the enumeration and
|
|
|
32
35
|
| `for <value>` | the event source of a `given`/`then` event, or of the `when` command or appended event |
|
|
33
36
|
| `<property> = <value>` | a literal, `null`, or a one-line JSON-shaped object or list: `lines = [{"sku":"A-1","quantity":2}]` |
|
|
34
37
|
|
|
38
|
+
## Parse and binding diagnostics
|
|
39
|
+
|
|
40
|
+
PLAY0358 is a syntax error; PLAY0388 also occurs at parse time for extra text
|
|
41
|
+
after `then denied`. PLAY0350, PLAY0352, PLAY0388 for mixed outcomes, PLAY0389 and
|
|
42
|
+
the one-rejection rule PLAY0273 occur only at binding. Source validation alone
|
|
43
|
+
will not report them: check executable diagnostics as well. Clock instants need
|
|
44
|
+
an ISO 8601 offset or `Z`, for example `"2026-10-05T08:00:00Z"` (PLAY0461).
|
|
45
|
+
|
|
46
|
+
## Literal spellings
|
|
47
|
+
|
|
35
48
|
An enumeration value binds whether it is written bare
|
|
36
49
|
(`status = sent`), qualified (`status = InvoiceStatus.sent`) or quoted, and a
|
|
37
50
|
`DateTime` value binds as a plain ISO 8601 instant (`"2026-10-05T08:00:00Z"`).
|
|
@@ -26,17 +26,15 @@ Read [references/product-sources.md](references/product-sources.md) when checkin
|
|
|
26
26
|
- Not for: projection and query syntax, reactions and captures, writing the specifications
|
|
27
27
|
themselves (`cratis-screenplay-scenario-coverage`), Chronicle C# mechanics
|
|
28
28
|
(`cratis-chronicle-event-modeling`). See Route near misses.
|
|
29
|
-
-
|
|
30
|
-
|
|
29
|
+
- Apply model-first per `cratis-screenplay-modeling-lifecycle`; never weaken
|
|
30
|
+
authorization, `pii` or rules to compile.
|
|
31
31
|
|
|
32
32
|
## Interview phase
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Ask only what is missing: (1) instance - what real-world thing the stream is about; (2) competition - what must never happen when two people act at once; (3) retry - what a repeated request should see; (4) ownership; (5) growth; (6) change - whether the event was ever stored in a running system. Read [references/interview-batch.md](references/interview-batch.md) for each question's follow-up; ownership options are in `references/boundaries.md`.
|
|
33
|
+
Read [interview prompts](references/interview-batch.md) when identity, competition,
|
|
34
|
+
retry, ownership, growth or stored-event history is unsettled. Ask only missing
|
|
35
|
+
questions, one at a time; ownership options are in `references/boundaries.md`.
|
|
36
|
+
Unattended work takes the conservative option and marks it `ASSUMED` in model
|
|
37
|
+
`documentation` and `.ai-work/screenplay/<model-slug>/STATE.md`.
|
|
40
38
|
|
|
41
39
|
## Procedure
|
|
42
40
|
1. **Establish identity and membership.** For every `concept XId` used as an `identifier`, write
|
|
@@ -87,14 +85,10 @@ Ask only what is missing: (1) instance - what real-world thing the stream is abo
|
|
|
87
85
|
(PLAY0270), not runtime propagation or generated C# `[Subject]`. Without a
|
|
88
86
|
supplied subject, the runtime defaults to the event source; see command-surface
|
|
89
87
|
`references/compliance.md` for allowed types and the policy/encryption distinction.
|
|
90
|
-
5. **Plan evolution
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Pin persisted/public enum member numbers before reordering or removing members (`references/evolution.md`, "Enum member numbers").
|
|
95
|
-
|
|
96
|
-
Renames and other identity-affecting edits are made by the identity owner (the
|
|
97
|
-
identity procedure in `cratis-screenplay-modeling-lifecycle`).
|
|
88
|
+
5. **Plan evolution**: read `references/evolution.md` before editing stored contracts
|
|
89
|
+
for change classification, compatibility scenarios and enum-number safety.
|
|
90
|
+
After release-baseline admission, revisions need `newGeneration`. Identity-affecting edits belong to the
|
|
91
|
+
identity owner (`cratis-screenplay-modeling-lifecycle`).
|
|
98
92
|
6. **Test ownership and interfaces** with `references/boundaries.md`: ownership interview,
|
|
99
93
|
interface and processor inventory, one real interaction walked across each boundary, coupling
|
|
100
94
|
check. Keep team, module, stream and deployment boundaries distinct; inbound facts via
|
|
@@ -108,15 +102,19 @@ Ask only what is missing: (1) instance - what real-world thing the stream is abo
|
|
|
108
102
|
- `identifier` on an event property is PLAY0019; the source id is never payload by declaration.
|
|
109
103
|
Copying it as a payload value is PLAY0469 (information, warning for inline events).
|
|
110
104
|
- In the executable model a production's `for` must resolve to the command's scalar identifier:
|
|
111
|
-
one command writes one stream declaratively
|
|
105
|
+
one command writes one stream declaratively; described handlers bind v23 but
|
|
106
|
+
their payload-only contract does not grant arbitrary destinations.
|
|
112
107
|
- Constraint names are application-wide identities (PLAY0392); properties must be declared
|
|
113
108
|
directly on the event (PLAY0391); never mix event and property rules under one name (PLAY0135);
|
|
114
109
|
`ignore casing` is not allowed on `unique event` (PLAY0393).
|
|
115
110
|
- Generations are declared in full, numbered 1..N without gaps, in the same slice (PLAY0446-0448); `id` pins are shared by all generations and unique application-wide (PLAY0472); `storedName` needs ESM v16. See `references/evolution.md` ("Generations, pins and storedName diagnostics").
|
|
116
111
|
|
|
117
|
-
- `reads`
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
- Application-root `command reads protected` admits eligible reads and single-level
|
|
113
|
+
requirement/mapping paths (v25). Absence rejects, matching decide/commit changes
|
|
114
|
+
conflict. Legacy reads remain PLAY0271/PLAY0268; `concurrency` remains unbound and
|
|
115
|
+
combining it with protected reads is PLAY0783. Read
|
|
116
|
+
[protected reads](../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
117
|
+
for admission and Stage's STAGE-ESM-044 protected-read refusal (the v25 pair itself is admitted). `description` text never reaches rendered code: a rule that lives only in prose is
|
|
120
118
|
unenforced there.
|
|
121
119
|
- `pii` and `secret` bind as ESM v13;
|
|
122
120
|
enum/identity compliance and protected events with explicit subject marks still
|
|
@@ -144,6 +142,12 @@ Requires Chronicle 19.59.6 or later (19.59.3 for the InMemory provider) for the
|
|
|
144
142
|
- Give each invariant an authoritative atomic decision point and inspect every path that could
|
|
145
143
|
violate it. A constraint violation rejects that command's whole append set; a reaction cascade
|
|
146
144
|
is not one transaction. Declared semantics are not a passed concurrency test.
|
|
145
|
+
- New models declare `reaction batches atomic`: direct productions per trigger
|
|
146
|
+
occurrence and each selected refusal branch are separate batches; invoked commands
|
|
147
|
+
stay independent. Legacy absence retains per-fact appends. Stage refuses v22
|
|
148
|
+
with STAGE-ESM-016 and atomic mode in admitted v23–v25 with STAGE-ESM-043. Read
|
|
149
|
+
[atomic boundaries](../cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md)
|
|
150
|
+
when defining failure rollback; batching is not redelivery deduplication.
|
|
147
151
|
- Match duplicate protection to scope. A property constraint lets a source re-claim its own
|
|
148
152
|
value; use `unique event` for a fact that is genuinely once-only in its lifecycle, without
|
|
149
153
|
blocking legitimate repeated operations just to make retries safe.
|
package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md
CHANGED
|
@@ -80,8 +80,8 @@ For each affected boundary, identify:
|
|
|
80
80
|
|
|
81
81
|
Use declaration addresses, not copies of payloads. Per slice, also record the events it consumes
|
|
82
82
|
and which slice produces them, for orientation, not as a build order. A command or reaction may
|
|
83
|
-
consult another slice's view (`reads`;
|
|
84
|
-
section 3); a slice calls another slice's command only through `invokes`.
|
|
83
|
+
consult another slice's view (`reads`; eligible commands opt into v25 protection,
|
|
84
|
+
trigger reads cannot; see `consistency-and-concurrency.md` section 3 for target gaps); a slice calls another slice's command only through `invokes`.
|
|
85
85
|
|
|
86
86
|
### Responsibility matrix and ownership timeline
|
|
87
87
|
One compact matrix per feature shows who owns what; the timeline shows where a fact crosses.
|
|
@@ -57,8 +57,8 @@ observed legacy check from verified atomic protection.
|
|
|
57
57
|
| several command properties / constants | `require` | runs after property rules, before production |
|
|
58
58
|
| a value across all sources | `unique <prop> on <Event>` | value owned by one source; same source may re-claim |
|
|
59
59
|
| a fact at most once per source; mutually exclusive facts | `unique event` (+ `released by`) | covers simple lifecycle transitions |
|
|
60
|
-
| state-dependent rule
|
|
61
|
-
| a view (read model) |
|
|
60
|
+
| state-dependent rule (balance, capacity, "only if approved") | eligible `reads` + `require` under `command reads protected` (v25) | required absence rejects; matching intervening facts conflict. Payload-key fan-in, joins, reducers and other refused shapes remain target gaps |
|
|
61
|
+
| a view (read model) | unguarded materialized reads are not protection | legacy command and trigger reads remain unprotected; Stage refuses protected reads (STAGE-ESM-044), so reference protection is not target realization |
|
|
62
62
|
|
|
63
63
|
## 3. Record each state-dependent rule that the model cannot enforce
|
|
64
64
|
Never accept the caller's copy of the state: `currentStatus Status` on the command with
|
|
@@ -67,7 +67,13 @@ input (`confirmsX == true`) standing in for the rule. Never move the rule into `
|
|
|
67
67
|
`implementation hint` prose; a description renders only as an XML doc comment (Stage#178), so prose alone leaves
|
|
68
68
|
the rule unenforced in rendered scope.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
First inspect [protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md):
|
|
71
|
+
opt eligible command reads into v25, retain absence/conflict specifications and verify
|
|
72
|
+
target consistency separately. Stage admits v25 but refuses protected reads (STAGE-ESM-044). A payload-keyed
|
|
73
|
+
fan-in such as the course-capacity example remains refused; the preamble is not a
|
|
74
|
+
blanket admission of arbitrary projections.
|
|
75
|
+
|
|
76
|
+
For legacy models without opt-in or refused shapes, write stated intent and mark it unenforced.
|
|
71
77
|
- `reads <View> as x by …` plus `require <expr over x> message "…"` on the command (the
|
|
72
78
|
`StateChange` slice in `streams-example.md`). Binding reports PLAY0271 / PLAY0268; that is
|
|
73
79
|
expected in design mode, so keep the lines. Do not remove them to pass a tool.
|
|
@@ -115,9 +115,10 @@ module Billing
|
|
|
115
115
|
another reason each service has its own folder.
|
|
116
116
|
- A capture keys on the incoming content, so the contract carries the identity
|
|
117
117
|
the consumer keys on.
|
|
118
|
-
-
|
|
119
|
-
consumer's capture over events
|
|
120
|
-
the
|
|
118
|
+
- Both sides run in the reference evaluator: the producer's publication
|
|
119
|
+
specification, and the consumer's capture over events, which a specification
|
|
120
|
+
drives by presenting the consumed public event (`when append <Event>`;
|
|
121
|
+
Requires Screenplay 4.171.0).
|
|
121
122
|
- Syntax, publication semantics and the full rules: read
|
|
122
123
|
`cratis-screenplay-automations-and-translations`
|
|
123
124
|
`references/public-events-and-direction.md`.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Example: streams, constraints and a recorded rule
|
|
2
2
|
|
|
3
|
+
Legacy control: no `command reads protected` preamble is declared. The course-capacity
|
|
4
|
+
payload-key fan-in remains refused even with opt-in; eligible active-enrolment reads
|
|
5
|
+
can protect under v25, but reads plus concurrency cannot combine (PLAY0783). Read
|
|
6
|
+
[protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
7
|
+
for admission and Stage's protected-read refusal (STAGE-ESM-044). The legacy diagnostics below describe this
|
|
8
|
+
control, not a blanket refusal of command reads.
|
|
9
|
+
|
|
3
10
|
A complete design-mode model for course enrolment. It shows one business identity per stream,
|
|
4
11
|
cross-stream references as payload, three kinds of uniqueness constraint, a state-dependent
|
|
5
12
|
rule recorded as **NOT enforced in the model today**, a declared `concurrency` scope, and an
|