@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.
Files changed (105) hide show
  1. package/package/corpus/product-sync.json +9 -9
  2. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
  3. package/package/corpus/skills/cratis-arc-command/references/generated-values.md +27 -12
  4. package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +17 -6
  5. package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +10 -2
  6. package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +49 -6
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +43 -41
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +11 -2
  9. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-interview.md +24 -0
  10. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +76 -10
  11. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -0
  12. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +1 -1
  13. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +39 -23
  14. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +35 -12
  15. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +51 -81
  16. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +83 -0
  17. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +14 -4
  18. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +59 -0
  19. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md +60 -0
  20. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +5 -1
  21. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +37 -30
  22. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +100 -0
  23. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +82 -0
  24. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +82 -28
  25. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +113 -0
  26. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +45 -12
  27. package/package/corpus/skills/cratis-screenplay-command-surface/references/text-and-match-rules.md +119 -0
  28. package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +26 -6
  29. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +13 -3
  30. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +12 -12
  31. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +5 -3
  32. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +5 -1
  33. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -2
  34. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +1 -1
  35. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +51 -14
  36. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +5 -0
  37. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +2 -1
  38. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +6 -3
  39. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
  40. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +22 -28
  41. package/package/corpus/skills/cratis-screenplay-model-authoring/references/choosing-generation.md +20 -7
  42. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +13 -6
  43. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +9 -1
  44. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +58 -10
  45. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -2
  46. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -5
  47. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +2 -2
  48. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +2 -2
  49. package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +2 -1
  50. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +3 -2
  51. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
  52. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  53. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -3
  54. package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +3 -1
  55. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -3
  56. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +8 -0
  57. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -4
  58. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +48 -30
  59. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +10 -4
  60. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +15 -4
  61. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +25 -20
  62. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +14 -3
  63. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +9 -3
  64. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +9 -4
  65. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -1
  66. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -4
  67. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -2
  68. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -3
  69. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +8 -8
  70. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +69 -47
  71. package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +11 -1
  72. package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +48 -17
  73. package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md +6 -0
  74. package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +14 -1
  75. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +25 -21
  76. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +2 -2
  77. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +9 -3
  78. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +4 -3
  79. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +7 -0
  80. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +32 -22
  81. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -1
  82. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
  83. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +60 -0
  84. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +66 -6
  85. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +67 -23
  86. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-checks.md +93 -0
  87. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +117 -35
  88. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +61 -0
  89. package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +3 -1
  90. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +27 -10
  91. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +3489 -335
  92. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  93. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +5 -3
  94. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -1
  95. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +8 -53
  96. package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +2 -2
  97. package/package/corpus/skills/cratis-screenplay-ui-composition/references/interaction-example.md +54 -0
  98. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +6 -3
  99. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -29
  100. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +39 -9
  101. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +28 -8
  102. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/publication-and-recovery.md +31 -0
  103. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +8 -0
  104. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +4 -1
  105. 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`; unprotected in `.play`, see `rule-layers.md`). A slice never calls another slice's
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 (unprotected, so a stored-state rule over it stays
107
- NOT enforced, `rule-layers.md`) and `invokes <Command>` from a reaction. No shared state or
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 model for `cratis-screenplay-slice-design`. It is in **design mode**: V1 clean
4
- (compiles with warnings as errors); V3 is blocked on purpose by the `ListLockers` list query
5
- (`PLAY0268` at binding); `given clock` also failed binding on a cratis before 3.28.2 bundle (3.28.2 binds it)
6
- (`cratis-screenplay-toolchain` `SKILL.md`). Personas and screens are informational.
7
- The stored-state rules in `AssignLocker` (`reads` + `require`) are intent, not enforced today,
8
- and they also fail binding on their own: `PLAY0271` on each `reads`, and `PLAY0268` because the
9
- `require` operands (`locker.assigned`, `request.state`) must be command properties. So this
10
- document is design mode as a whole: V3 is blocked twice over and no specification runs here.
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
- - It runs the capabilities the execution plan admits: declarative validation
44
- and `require` over command properties, conditional production, literal tags,
45
- declarative policies, `unique` constraints, and projections as Chronicle
46
- lowers them. The `cratis-screenplay-model-authoring` language reference lists
47
- what binds and what the plan admits.
48
- - Binding is not admission. These projection constructs bind, but the plan
49
- refuses them: a projection-level `remove via join`; `all` beside removals,
50
- `children` or `nested`; a `join`, `children` or `remove via join` inside
51
- `nested`; and any `$eventContext.<path>` other than `eventSourceId`, such as
52
- `$eventContext.occurred`. The limits apply at every ESM version.
53
- - A specification that needs **opaque code** — a bodied reducer, a rule with a
54
- body, a fenced `validate` block, a code policy, or (ESM v6) a reached reaction
55
- body — returns **unsupported** and
56
- never passes. Authorization is evaluated first, so a `then denied` case still
57
- runs when a portable policy decides it. Other specifications in the model run
58
- normally.
59
- - Unsupported reachable declarative constructs block the whole execution plan
60
- rather than running partially: no specification in the model runs, including
61
- the ones that never touch the refused construct.
62
- - Reactions: before ESM v6 they never run, not even after `when append`. From ESM
63
- v6 they run after every action, as in "Reactions and
64
- cascades" ([references/reactions-and-cascades.md](references/reactions-and-cascades.md)). A compiler that stops before ESM v6 fails `when clock`, `when trigger`
65
- and `when capture` binding with `PLAY0268`, and so reactions and captures.
66
- - Children defer until their parent exists; an ambiguous parent still fails closed.
67
- [Child ordering](references/child-ordering.md): specs and routing caveat.
68
-
69
- Requires Screenplay 4.149.1 or later (`screenplay --version`) for child deferral.
70
- - A rejected individual command or append leaves the world unchanged; an accepted
71
- one commits once, then the read models and queries are compared. There is no
72
- scenario-wide transaction in v6: when a later effect of a cascade or capture
73
- rejects, the earlier accepted facts and their projections remain.
74
-
75
- Unsupported is not passed. Report it as "needs a target", not as green. "Specified"
76
- and "bound" are never "passing": run the reference CLI/MCP route or the owning
77
- target tests, and name the engine, version and expected/discovered selection.
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`**, such as
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
- `PLAY0358` is a syntax error (`PLAY0388` also at parse time for extra text after `then denied`). `PLAY0350`, `PLAY0352`, `PLAY0388` (mixed with another outcome), `PLAY0389` and
118
- the one-rejection rule (`PLAY0273`) are reported only when the model binds, so
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>` for outbound publication,
158
- not `then readmodel`. The follow-up event list is exhaustive and ordered. Read
159
- [publication example and fold cases](../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md).
160
- Events-source captures and reached opaque event-target reducers return typed
161
- Unsupported, not a pass. Composite view fixtures need every key part but remain
162
- unadmitted (PLAY0268); see read-surface `references/named-keys.md`.
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
 
@@ -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
@@ -1,31 +1,42 @@
1
- ## Generated fixtures and return expectations (ESM v7 and v15)
1
+ # Generated fixtures and return expectations
2
2
 
3
- ### Choosing a strategy
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
- OrderId pins do not realize Arc's received-time/tenant context either.
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 and byte-budget choices and exact shapes.
15
- `given clock` supplies `$context.occurred`, not a generated time-ordered ID;
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
- ### When not to
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. Pattern/random/rule and secret generation remain
23
- unadmitted. Source: Screenplay
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
- ### Fixtures and outcomes
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. Earlier models check canonical UUID type, not its version.
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. Below v15
69
- fixtures retain legacy reuse. See the complete [strategy example](../../cratis-screenplay-toolchain/references/generation-strategies-example.md)
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`; it does not synthesize UUIDv7, ULID or
72
- TypeID from that instant. Pin the whole identifier, never a seed. Stage's
73
- time-ordered factories use wall clock, not command-receipt time, and its clock
74
- specifications remain unsupported. Sources: Screenplay
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.
@@ -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>` | an earlier and the current record of a capture's source |
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
- - Model-first applies: when an accepted model covers the scope, change the model and its
30
- specifications, not code. Do not weaken authorization, `pii` or rules to make a model compile.
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
- **Skip if** the user or the model already states the stream identities, who owns each module, how
34
- much autonomy each side has, the external systems, and rough growth. Otherwise ask only what is
35
- missing, one question at a time, with options. **Unattended:** assume the most conservative
36
- option, mark it `ASSUMED` in the slice or module `documentation` and in the session `STATE.md`
37
- (`.ai-work/screenplay/<model-slug>/STATE.md`), and continue.
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** with `references/evolution.md`: classify each event change (additive,
91
- meaning change, rename, removal, split or merge) and write its compatibility scenarios before
92
- editing. Admit the **release baseline** in the release job; admitted
93
- revisions need `newGeneration`. Modes/CLI/MCP: `references/evolution.md`.
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 (a handler is never admitted).
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` is PLAY0271 and `require` over read-model paths is PLAY0268 at binding. A `concurrency`
118
- block compiles but is PLAY0271 at binding. Keep both when they state real intent; they are not
119
- protection. `description` text never reaches rendered code: a rule that lives only in prose is
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.
@@ -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`; unprotected in `.play`, see `consistency-and-concurrency.md`
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 not reducible to the supported uniqueness/release semantics (a balance, capacity, "only if approved") | no protected decision read in `.play` today | state it as `reads` + `require … message`, mark NOT enforced, name the target enforcement (below) |
61
- | a view (read model) | an unguarded materialized read is not protection | views lag; `reads` is PLAY0271, `require` over views PLAY0268 at binding (expected in design mode) |
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
- Right: write the rule as stated intent and mark it unenforced.
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
- - The producer's publication specification runs in the reference evaluator; the
119
- consumer's capture over events binds but evaluates as typed Unsupported. Specify
120
- the consumer's private behavior downstream of the capture.
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