@cratis/pi 7.160.0 → 7.160.2

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 (51) hide show
  1. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +1 -1
  2. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +23 -0
  3. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +4 -1
  4. package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +14 -0
  5. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +2 -1
  6. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +2 -2
  7. package/package/corpus/skills/cratis-screenplay-model-authoring/references/model-notes.md +28 -1
  8. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +2 -0
  9. package/package/corpus/skills/cratis-screenplay-model-review/references/mode-compliance.md +4 -0
  10. package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +1 -0
  11. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +2 -1
  12. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +15 -4
  13. package/package/corpus/skills/cratis-screenplay-projections/references/graphs.md +112 -0
  14. package/package/corpus/skills/cratis-screenplay-projections/references/secret-concepts.md +23 -0
  15. package/package/corpus/skills/cratis-screenplay-projections/verification.json +9 -1
  16. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -0
  17. package/package/corpus/skills/cratis-screenplay-read-surface/references/graph-queries.md +22 -0
  18. package/package/corpus/skills/cratis-screenplay-read-surface/references/screen-patterns.md +11 -2
  19. package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +4 -1
  20. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -1
  21. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +4 -1
  22. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +3 -1
  23. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +2 -1
  25. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +38 -0
  26. package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +2 -0
  27. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +9 -12
  28. package/package/corpus/skills/cratis-screenplay-specifications/references/date-comparisons.md +21 -0
  29. package/package/corpus/skills/cratis-screenplay-specifications/references/graph-steps.md +85 -2
  30. package/package/corpus/skills/cratis-screenplay-specifications/references/host-body-execution.md +29 -0
  31. package/package/corpus/skills/cratis-screenplay-specifications/references/producerless-events.md +63 -0
  32. package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +2 -1
  33. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +9 -1
  34. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +2 -0
  35. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +39 -0
  36. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +14 -8
  37. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +5 -0
  38. package/package/corpus/skills/cratis-screenplay-toolchain/references/read-model-property-order.md +26 -0
  39. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +22 -0
  40. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  41. package/package/corpus/skills/cratis-screenplay-toolchain/references/unknown-preserving-reader.md +57 -0
  42. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +16 -1
  43. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +5 -34
  44. package/package/corpus/skills/cratis-screenplay-ui-composition/references/action-subjects.md +27 -1
  45. package/package/corpus/skills/cratis-screenplay-ui-composition/references/deliverable-identity.md +41 -0
  46. package/package/corpus/skills/cratis-screenplay-ui-composition/references/guarded-interactions.md +2 -1
  47. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-visuals.md +43 -0
  48. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +8 -1
  49. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +3 -1
  50. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +2 -1
  51. package/package.json +1 -1
@@ -149,7 +149,7 @@ Read [references/capture-map-and-example.md](references/capture-map-and-example.
149
149
 
150
150
  ## `reaction`
151
151
 
152
- Read [reaction forms](references/reaction-forms.md) when choosing a trigger,
152
+ Read [reaction forms](references/reaction-forms.md) (including how a host provider runs a reaction body) when choosing a trigger,
153
153
  selecting occurrence values or mapping `produces` and `invokes`; complete documents
154
154
  remain in `references/complete-examples.md`.
155
155
 
@@ -57,3 +57,26 @@ refusals and reference unsupported outcomes remain separate checks.
57
57
  with `and`/`or`. Its source grammar includes `contains` and `starts with`, but the
58
58
  executable binder refuses those operators with PLAY0268. Use the literal property
59
59
  rules for validation, not as a way around condition admission.
60
+
61
+ ## Reaction bodies run through a host provider
62
+
63
+ Requires Screenplay 4.258.0 or later (`screenplay --version`). Source: Screenplay
64
+ `Documentation/screenplay/reactions.md`.
65
+
66
+ A reference run executes an attached reaction body only when the host supplies an
67
+ `ISemanticBodyExecutionProvider` and a resolved, content-verified attachment. The run calls
68
+ `ReactAsync` for a standalone body on a reaction with exactly one event trigger and no `produces`,
69
+ `invokes` or routing override, after `where` passes.
70
+
71
+ - `ReactAsync` returns exactly one of nothing, an ordered event batch or an ordered command batch
72
+ (`SemanticReactionBodyResult`). A missing, default or mixed result is Unsupported with the
73
+ Reaction capability, never an empty result.
74
+ - The run validates every target and payload of the whole batch before settling anything. Command
75
+ payloads cannot supply generated properties. Commands settled earlier are not rolled back when a
76
+ later one is refused, as with `invokes` without `on refused`.
77
+ - Every other shape stays Unsupported (Reaction): clock and application triggers, unverified
78
+ bodies, provider failure and a run with no provider.
79
+ - A body that also declares `reads` stays refused (`PLAY0268`); return or invoke a command and put
80
+ the protected decision there.
81
+ - `PerformAsync` is a provider contract only. Performer queries are not admitted to the executable
82
+ model, so never present a performer as runnable.
@@ -69,6 +69,9 @@
69
69
  {
70
70
  "kind": "skill-contains",
71
71
  "value": "[ExecuteCommandsAsSystem]"
72
- }
72
+ },
73
+ { "kind": "skill-contains", "value": "ISemanticBodyExecutionProvider", "file": "references/reaction-forms.md" },
74
+ { "kind": "skill-contains", "value": "`PerformAsync` is a provider contract only", "file": "references/reaction-forms.md" },
75
+ { "kind": "skill-contains", "value": "Requires Screenplay 4.258.0", "file": "references/reaction-forms.md" }
73
76
  ]
74
77
  }
@@ -103,6 +103,20 @@ validate
103
103
  file Validations/BeAValidOrganizationNumber.cs
104
104
  ```
105
105
 
106
+ A concept or command-property imperative `validate` body can also live in a file instead of a fence
107
+ (compiled with the pinned 6.26.0 tool; the shipped version is not tag-verified, so no minimum is
108
+ stated). The path is relative to the model root and stays inside it; the file holds the body that
109
+ would sit inside the fence, including its `yield return` lines:
110
+
111
+ ```text
112
+ concept EmailAddress : String pii
113
+ validate
114
+ file Validations/AllowedEmailDomain.cs
115
+ ```
116
+
117
+ A missing or refused path reports the attachment diagnostics `PLAY0432` or `PLAY0430`; consumers
118
+ see the same opaque requirement with file provenance instead of an inline span.
119
+
106
120
  A bodied rule or fenced block on a validation, rule or policy binds as opaque code
107
121
  (ESM v3): the reference runner reports it unsupported, and a target must supply the
108
122
  implementation. Attached command handlers bind beside unconditional `produces` with a
@@ -113,6 +113,7 @@
113
113
  { "kind": "skill-contains", "value": "`Concurrency`", "file": "references/generated-values-and-responses.md" },
114
114
  { "kind": "skill-contains", "value": "PLAY0682", "file": "references/generated-values-and-responses.md" },
115
115
  { "kind": "skill-contains", "value": "zero trailing bits", "file": "references/generated-values-and-responses.md" },
116
- { "kind": "skill-contains", "value": "STAGE-ESM-038", "file": "references/generated-values-and-responses.md" }
116
+ { "kind": "skill-contains", "value": "STAGE-ESM-038", "file": "references/generated-values-and-responses.md" },
117
+ { "kind": "skill-contains", "value": "file Validations/AllowedEmailDomain.cs", "file": "references/validate-rules.md" }
117
118
  ]
118
119
  }
@@ -279,8 +279,8 @@ canonical bytes. Event `description`, `documentation` and rename-only `id` are
279
279
  authoring metadata, not new ESM bytes or replacements for catalog identity.
280
280
 
281
281
  Binding is not the last gate before the reference runner. The runner needs an
282
- execution plan. An application-level refused construct blocks the whole plan, so no
283
- specification in the model runs. An unadmitted projection (for example
282
+ execution plan. Under strict binding an application-level refused construct blocks the whole plan, so no
283
+ specification in the model runs (a host using `CompileAdmissible` excludes it instead). An unadmitted projection (for example
284
284
  `UnsupportedEventContext` or `UnsupportedProjectionBlock`) is scoped per specification:
285
285
  only specifications whose given, appended, produced or cascaded events reach it, or that
286
286
  supply, read, query or assert its read model, report unsupported; the others run and
@@ -7,6 +7,7 @@
7
7
 
8
8
  - Choose the artifact
9
9
  - Anchors and independent state
10
+ - Link elements to issues
10
11
  - List with bounded, pinned reads
11
12
  - Propose, review, apply
12
13
  - Resolve by evidence, then carry the answer into the model
@@ -121,6 +122,32 @@ The file header uses `schema: "cratis.screenplay.notes"`, `schemaVersion: 1` and
121
122
  key order, LF plus a trailing newline, and one note object per line sorted by ID.
122
123
  Commit it with the model; never hand-author a sidecar to bypass proposals.
123
124
 
125
+ ## Link elements to issues
126
+
127
+ An `issue` note links its anchored element (a slice, command or screen) to one or more issues in an
128
+ external tracker. Requires Screenplay 6.7.0 or later (`screenplay --version`).
129
+
130
+ ```json
131
+ {
132
+ "kind": "issue",
133
+ "text": "Build the cancellation flow",
134
+ "anchor": { "semanticId": "..." },
135
+ "refs": [
136
+ { "tracker": "github", "id": "Cratis/Shop#412", "url": "https://github.com/Cratis/Shop/issues/412" },
137
+ { "tracker": "jira", "id": "SHOP-77" }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ - `tracker` is `github`, `jira`, `linear` or `other`; `id` is the issue key as the tracker shows
143
+ it; `url` is optional. An issue note needs at least one reference, and a reference without a
144
+ tracker is refused.
145
+ - The note is anchored by stable identity, so the link survives renames and moves.
146
+ - `list-model-notes` with `kind: "issue"` lists every link; `ref: "SHOP-77"` finds the elements an
147
+ issue covers.
148
+ - The server never calls the tracker. Keeping the issue's status current is the tracker's job;
149
+ resolving the note records that the link no longer needs attention.
150
+
124
151
  ## List with bounded, pinned reads
125
152
 
126
153
  Open the workspace, inspect `notes` status and retain workspace/catalog revisions.
@@ -131,7 +158,7 @@ Open the workspace, inspect `notes` status and retain workspace/catalog revision
131
158
  | --- | --- |
132
159
  | `anchor` | `{ semanticId }`, including an orphan ID, or `{ address, kind }` |
133
160
  | `scope` | Dotted module/feature/slice; descendants and ancestor notes |
134
- | `kind` | `question`, `task`, `note`; omitted selects all |
161
+ | `kind` | `question`, `task`, `note`, `issue`; omitted selects all |
135
162
  | `state` | `open` by default; `resolved`, `orphaned`, `all` |
136
163
  | `ref` | Exact identifier in `refs` or `resolution.ref`, e.g. `D123` |
137
164
  | `view` | `items` by default, or `findings` |
@@ -34,6 +34,8 @@
34
34
  { "kind": "skill-contains", "value": "A renderer admits only the ESM versions it bundles", "file": "references/mcp-tools.md", "file": "references/mcp-tools.md" },
35
35
  { "kind": "skill-contains", "value": "Existing `All` history reads as", "file": "references/mcp-tools.md" },
36
36
  { "kind": "play-compiles" },
37
+ { "kind": "skill-contains", "value": "## Link elements to issues", "file": "references/model-notes.md" },
38
+ { "kind": "skill-contains", "value": "`question`, `task`, `note`, `issue`", "file": "references/model-notes.md" },
37
39
  { "kind": "skill-contains", "value": "Edit through MCP proposals, not hand-edited text" },
38
40
  { "kind": "skill-contains", "value": "The CLI-bundled MCP can be older than the standalone tool" },
39
41
  { "kind": "skill-contains", "value": "`previewArguments`", "file": "references/mcp-tools.md" },
@@ -3,3 +3,7 @@
3
3
  Apply with procedure step 11.
4
4
 
5
5
  Check bare `pii`/`secret`, special/criminal qualifiers and purpose coverage (`--check purposes`); reasons are value notes, not legal declarations. Event `subject` is report-only, unprotected and scalar; never claim runtime lineage or erasure from it. Trace identity details to valid sources and preserve the executable-read gap. Elevated reaction paths also need `--check privilege` and least-privilege roles; unknown/opaque findings are not proven safe. Syntax/limits: command-surface context/compliance references.
6
+
7
+ Check that no read model exposes a `secret` concept: the model is `PLAY1142` clean and no AutoMap fills a read-model property from a same-named secret event property.
8
+
9
+ Requires Screenplay 6.28.0 or later (`screenplay --version`) for the `PLAY1142` check.
@@ -18,4 +18,5 @@ About ten minutes, before the independent review.
18
18
  summaries in `description`, open questions as anchored `question` notes,
19
19
  with note IDs in session state, never only chat or description text.
20
20
  11. Every Automation has a pending-work view or a stated reason it needs none (F8-F13).
21
+ 12. No read model exposes a `secret` concept: PLAY1142 clean, and AutoMap does not leak one.
21
22
  Any "no" is fixed or explained before P5.
@@ -23,6 +23,7 @@
23
23
  { "kind": "skill-contains", "value": "eleven phases, 90 checks" },
24
24
  { "kind": "skill-contains", "value": "could a non-technical product owner read it and immediately understand" },
25
25
  { "kind": "skill-contains", "value": "a \"simple relay\" is not exempt from having pending work" },
26
- { "kind": "skill-contains", "value": "| H5 | Sinks: every declared `sink` is used by a read model or graph (`PLAY0938`), names differ ignoring case (`PLAY0932`)", "file": "references/checklist.md" }
26
+ { "kind": "skill-contains", "value": "| H5 | Sinks: every declared `sink` is used by a read model or graph (`PLAY0938`), names differ ignoring case (`PLAY0932`)", "file": "references/checklist.md" },
27
+ { "kind": "skill-contains", "value": "no read model exposes a `secret` concept", "file": "references/mode-compliance.md" }
27
28
  ]
28
29
  }
@@ -146,6 +146,9 @@ nested and variant block starts fresh sets. See [event scope](references/pdl-gra
146
146
 
147
147
  ## Property mapping and AutoMap
148
148
 
149
+ The order of a read model's properties is not a projection input; only a C# host's opt-in ESM 37.1
150
+ metadata records it ([property order](../cratis-screenplay-toolchain/references/read-model-property-order.md)).
151
+
149
152
  ⚠️ **AutoMap is on by default.** Matching property names are copied before your
150
153
  explicit mappings run, and explicit mappings win. Turn it off with `no automap` at
151
154
  **projection**, `every`/`all`, `join`, `children` or `nested` level — it
@@ -157,8 +160,11 @@ Requires Screenplay 4.212.4 (`screenplay --version`) for joined-event auto-map
157
160
  overrides in executable binding; older binders replace the setting with the level's.
158
161
 
159
162
  Mapping sources are a property path, a literal, `$eventSourceId` and `$eventContext.<path>`.
160
- ⚠️ Only the event source identity runs in the reference runner; any other `$eventContext`
161
- path (such as `occurred` in the shape above) binds but its specifications cannot run there.
163
+ `$eventContext.occurred` in a property assignment of `from`, `every` (including `all`) and
164
+ `children` runs in the reference runner as UTC text. Keys, joins, arithmetic, `every` with joins,
165
+ nested-object scopes and other paths (`sequenceNumber`, `correlationId`) still bind but their
166
+ specifications cannot run there. A missing occurrence fails the projection with no partial state:
167
+ supply it with `given clock` or an explicit fact timestamp.
162
168
  `clear <property>` removes a value; prefer it to `= null`. Read
163
169
  [mapping sources](references/mapping-sources.md) for the catalog, `PLAY0295` and `clear` paths.
164
170
 
@@ -225,7 +231,7 @@ Choose a graph for traversals and a document read model for lookups by key. Desi
225
231
  **reading the graph backwards**: write each question as a path, make every hop an edge type
226
232
  and every stop a node label, then name the event that creates and removes each. Read
227
233
  [references/graphs.md](references/graphs.md) for syntax, operations, a graph in a named sink
228
- (`sink People for graphs`) and `PLAY0862`–`PLAY0877`.
234
+ (`sink People for graphs`), graph queries (`match`/`return`), `foreach` over an event's list and `PLAY0862`–`PLAY0886`.
229
235
 
230
236
  ## When PDL is not enough — the reducer
231
237
 
@@ -267,6 +273,11 @@ of a document a reader cannot check at a glance.
267
273
 
268
274
  Read [pdl-grammar.md](references/pdl-grammar.md) when checking exact syntax, interpreting a projection diagnostic code, or needing a worked example.
269
275
 
276
+ ## Secret concepts and read models
277
+
278
+ A `secret` concept copied into a read-model property (explicit mapping, AutoMap or reducer) raises warning
279
+ `PLAY1142`. Read [secret concepts](references/secret-concepts.md) before projecting a protected event value.
280
+
270
281
  ## `STAGE-ESM-017` passes `validate` and fails at `render`
271
282
 
272
283
  `validate --executable` binds only Screenplay's model; Stage's admission runs only in `render`.
@@ -288,7 +299,7 @@ with `STAGE-ESM-017` after `validate` exits 0.
288
299
  - [ ] Every `children` block's `from` declares `parent`.
289
300
  - [ ] Every `nested` block contains at least one `from`.
290
301
  - [ ] Where the model must run: no `$causedBy`, template or `sequence`; no `$eventContext`
291
- path other than `eventSourceId`, no projection-level `remove via join`, no
302
+ path other than `eventSourceId` or an `occurred` property assignment, no projection-level `remove via join`, no
292
303
  `all` beside removals, `children` or `nested`, and no `join`, `children` or
293
304
  `remove via join` inside `nested`.
294
305
  - [ ] Variant entering events use the event source identity as the entity's
@@ -4,8 +4,10 @@
4
4
 
5
5
  - Declaring a graph
6
6
  - Projecting events onto it
7
+ - One element per item of a collection (`foreach`)
7
8
  - Storing a graph in a named sink
8
9
  - Reading the graph backwards
10
+ - Reading a graph with a query
9
11
  - The five operations
10
12
  - What a graph projection cannot say
11
13
  - Diagnostics
@@ -104,6 +106,49 @@ module Organization
104
106
  edge before the events that create its nodes arrive. A projection owns the edges
105
107
  and node properties it declares and never deletes a node it did not declare.
106
108
 
109
+ ## One element per item of a collection (`foreach`)
110
+
111
+ An event that carries a list can draw one node or edge per item. Write `foreach <collection>` after
112
+ the event name in `from` or `remove with` (`from <Event> foreach <collection> key ...`, `from <Event>
113
+ foreach <collection> source ... target ...`). Requires Screenplay 5.10.0 or later
114
+ (`screenplay --version`); a model that uses it selects ESM version 41.
115
+
116
+ ```screenplay
117
+ type ModelSlot
118
+ slot String
119
+ series Uuid
120
+
121
+ module Scoring
122
+ feature Models
123
+ slice StateView ModelScores
124
+ event ModelDefined
125
+ slots ModelSlot[]
126
+
127
+ event ModelRetired
128
+ slots ModelSlot[]
129
+
130
+ graph Scoring
131
+ node Model
132
+ modelId Uuid key
133
+ node Series
134
+ seriesId Uuid key
135
+ edge SCORES source Model target Series identified by slot
136
+ slot String
137
+
138
+ projection ModelScores => graph Scoring
139
+ edge SCORES
140
+ from ModelDefined foreach slots source $eventSourceId target slots.series identified by slots.slot
141
+ slot = slots.slot
142
+ remove with ModelRetired foreach slots source $eventSourceId target slots.series identified by slots.slot
143
+ ```
144
+
145
+ - The handler runs once per item. An item's properties are written `<collection>.<property>`
146
+ (`slots.series`); every other expression is the event's (`$eventSourceId`).
147
+ - The collection is a property of the event that is a list of a composite type; anything else, and
148
+ a collection inside another (`foreach slots.parts`), is `PLAY0886`. Iteration goes one level deep.
149
+ - An absent or empty list does nothing.
150
+ - Chronicle runs the handler once per item (Chronicle 19.134 and later).
151
+
107
152
  ## Storing a graph in a named sink
108
153
 
109
154
  A graph names no sink by default and is stored in the application's default graph sink. To keep one
@@ -169,6 +214,64 @@ full `PLAY0931`–`PLAY0939` table are in the read surface's
169
214
  to the graph.
170
215
  5. Add `detach` to any node removal whose label has attached edges.
171
216
  6. A question that is a lookup by key, not a path, belongs in a document read model.
217
+ 7. Write each path question as a `query` ending in `graph <Graph>`; see
218
+ [Reading a graph with a query](#reading-a-graph-with-a-query).
219
+
220
+ ## Reading a graph with a query
221
+
222
+ A query that ends in `graph <Graph>` follows a path over the graph's declared nodes and edges and
223
+ returns an ordinary read model. Requires Screenplay 5.8.0 or later (`screenplay --version`).
224
+
225
+ ```screenplay
226
+ concept PersonId : Uuid
227
+ concept GroupId : Uuid
228
+ concept Name : String
229
+
230
+ module Organization
231
+ feature Chart
232
+ slice StateView OrganizationChart
233
+ graph Organization
234
+ node Person
235
+ personId PersonId key
236
+ name Name
237
+ node Group
238
+ groupId GroupId key
239
+ title Name
240
+ edge MEMBER_OF source Person target Group
241
+ since DateTime optional
242
+
243
+ readmodel Membership
244
+ personId PersonId key
245
+ person Name
246
+ since DateTime optional
247
+
248
+ query MembersOf => Membership[] graph Organization
249
+ filter groupId GroupId
250
+ match person:Person -link:MEMBER_OF-> group:Group
251
+ where group.groupId = $groupId
252
+ return
253
+ personId = person.personId
254
+ person = person.name
255
+ since = link.since
256
+ ```
257
+
258
+ - `match` is a path of `alias:Label`, `-alias:TYPE->` (outgoing) and `<-alias:TYPE-` (incoming)
259
+ steps; an alias is needed only where `where` or `return` names it.
260
+ - `optional match` follows a path that may be absent, so what it returns must go to optional
261
+ read-model properties (`PLAY0883`).
262
+ - `where` joins equality tests with `and`; each compares a node or edge property with a
263
+ `$argument` the query declares or a literal.
264
+ - `return` assigns exactly the read model's required properties, each from a node or edge
265
+ property of the pattern with the same type (`PLAY0881`).
266
+ - Variable-length paths, `or`, ranges, functions and aggregates do not exist (`PLAY0885`); there
267
+ is no engine-native query text.
268
+ - A hop must use an edge that connects those two labels in that direction (`PLAY0880`); an
269
+ alias is used once (`PLAY0884`).
270
+
271
+ The read-surface side is in
272
+ [graph queries](../../cratis-screenplay-read-surface/references/graph-queries.md); assert a graph
273
+ query in a specification with `then query`
274
+ ([graph steps](../../cratis-screenplay-specifications/references/graph-steps.md)).
172
275
 
173
276
  ## The five operations
174
277
 
@@ -204,3 +307,12 @@ an event leaves a graph projection reported as unknown.
204
307
  | `PLAY0875` | Malformed `given graph` / `then graph` step |
205
308
  | `PLAY0876` | Specification names an undeclared graph, label or edge type |
206
309
  | `PLAY0877` | Graph projection declared outside a slice |
310
+ | `PLAY0878` | Malformed graph query: header, `match` pattern, `where` condition or `return` block |
311
+ | `PLAY0879` | Graph query names an undeclared graph, node label, edge type, alias or property |
312
+ | `PLAY0880` | Graph query hop uses an edge that does not connect those labels in that direction |
313
+ | `PLAY0881` | Graph query does not return exactly the read model's required properties, or returns the wrong type |
314
+ | `PLAY0882` | Graph query condition uses an undeclared argument or compares different types |
315
+ | `PLAY0883` | Optional-match value assigned to a read-model property that is not optional |
316
+ | `PLAY0884` | Graph query uses the same alias twice |
317
+ | `PLAY0885` | Graph query uses variable-length paths, `or`, ranges, functions or aggregates |
318
+ | `PLAY0886` | `foreach` names a collection inside another, or something that is not a list of a composite type of the event |
@@ -0,0 +1,23 @@
1
+ # Secret concepts in read models (`PLAY1142`)
2
+
3
+ Read this when a projection or reducer builds a read model from events that carry a `secret` (or `pii secret`) concept.
4
+ Requires Screenplay 6.28.0 or later (`screenplay --version`).
5
+
6
+ A `secret` value belongs on the event, not in a read model. Copying it into a read-model property makes it part of the read model and of every query result over it, so the compiler warns with `PLAY1142` (`SecretConceptProjected`).
7
+
8
+ ## What is reported
9
+
10
+ - An explicit mapping whose target property or source event property has a secret concept.
11
+ - A property that AutoMap fills from a same-named secret event property, including `children` and `nested` scopes that inherit AutoMap from the root.
12
+ - A reducer that builds a read-model property with a secret concept.
13
+
14
+ Metadata, literal and aggregate sources are not reported. The message names the projection or reducer, the concept and the read-model property path.
15
+
16
+ ## Fix
17
+
18
+ There is no automatic repair; decide whether the read model needs the value at all.
19
+
20
+ - Leave the property out of the read model (and use `no automap` or a differently named property where AutoMap would fill it).
21
+ - Or map a non-secret derived value, for example a flag that the value is set, or a masked form computed elsewhere.
22
+
23
+ The code is a warning, so `--warnings-as-errors` turns it into a failure. See the toolchain diagnostics reference for the full warning list.
@@ -30,6 +30,14 @@
30
30
  { "kind": "skill-contains", "value": "PLAY0690", "file": "references/reducer-identity.md" },
31
31
  { "kind": "skill-contains", "value": "**A builder never names a sink.**" },
32
32
  { "kind": "skill-contains", "value": "sink People for graphs", "file": "references/graphs.md" },
33
- { "kind": "skill-contains", "value": "every `sink` line in it is the directive", "file": "references/graphs.md" }
33
+ { "kind": "skill-contains", "value": "every `sink` line in it is the directive", "file": "references/graphs.md" },
34
+ { "kind": "skill-contains", "value": "read-model-property-order.md" },
35
+ { "kind": "skill-contains", "value": "## Reading a graph with a query", "file": "references/graphs.md" },
36
+ { "kind": "skill-contains", "value": "`PLAY0885` | Graph query uses variable-length paths", "file": "references/graphs.md" },
37
+ { "kind": "skill-contains", "value": "from ModelDefined foreach slots source", "file": "references/graphs.md" },
38
+ { "kind": "skill-contains", "value": "Requires Screenplay 5.10.0 or later", "file": "references/graphs.md" },
39
+ { "kind": "skill-contains", "value": "runs in the reference runner as UTC text" },
40
+ { "kind": "skill-contains", "value": "`PLAY1142` (`SecretConceptProjected`)", "file": "references/secret-concepts.md" },
41
+ { "kind": "skill-contains", "value": "references/secret-concepts.md" }
34
42
  ]
35
43
  }
@@ -74,6 +74,8 @@ It is never inferred, and a query or screen that consumes it is error `PLAY0859`
74
74
 
75
75
  ## `query`
76
76
 
77
+ A query that ends in `graph <Graph>` reads a graph: see [graph queries](references/graph-queries.md).
78
+
77
79
  Excerpt: the concepts, the read model and the policy are declared elsewhere.
78
80
 
79
81
  ```screenplay excerpt
@@ -0,0 +1,22 @@
1
+ # Graph queries
2
+
3
+ A graph query is a query: it has a name, filters, and returns a read model. Only its header and
4
+ body differ.
5
+
6
+ Requires Screenplay 5.8.0 or later (`screenplay --version`).
7
+
8
+ - The header ends in `graph <Graph>` instead of reading a stored read model:
9
+ `query MembersOf => Membership[] graph Organization`.
10
+ - `filter <name> <Type>` lines declare the arguments; `where` compares a node or edge property
11
+ with `$<name>` or a literal.
12
+ - `match` / `optional match` give the path and `return` fills the read model, one assignment per
13
+ required property.
14
+ - The result read model is an ordinary `readmodel`; it is not a node or an edge, and no
15
+ projection builds it. A screen's `data` line binds the query like any other.
16
+
17
+ Do not restate the grammar here. The complete model, the rules and `PLAY0878`–`PLAY0885` are in
18
+ [reading a graph with a query](../../cratis-screenplay-projections/references/graphs.md#reading-a-graph-with-a-query);
19
+ the specification step is in
20
+ [graph steps](../../cratis-screenplay-specifications/references/graph-steps.md#asserting-a-graph-query).
21
+ Choose a graph query for a path question; a lookup by key stays a document read model with a
22
+ projection.
@@ -121,7 +121,14 @@ module Berths
121
121
  State what an action acts on: `action CancelBooking for item` acts on the selected row or the record the screen shows,
122
122
  `action BookBerth for screen` does not depend on a selection. An omitted subject is inferred from the declared data
123
123
  and identifier types and reported as `PLAY0818` (and `PLAY0819` when the row binding differs from legacy name matching),
124
- so write the clause. Source: Screenplay v5.1.0 `Documentation/screenplay/action-subjects.md`.
124
+ so write the clause. With a header record beside one table of rows, `for item` acts on that table's collection
125
+ (Requires Screenplay 6.18.0 or later; see the UI composition skill's
126
+ [table narrowing](../../cratis-screenplay-ui-composition/references/action-subjects.md#table-narrowing)).
127
+ Source: Screenplay `Documentation/screenplay/action-subjects.md`.
128
+
129
+ Property declaration order is not preserved by default; a C# host can opt in to ESM 37.1 metadata,
130
+ but it does not let a model control a generated constructor (see
131
+ [read-model property order](../../cratis-screenplay-toolchain/references/read-model-property-order.md)).
125
132
 
126
133
  ## What a screen pattern is not
127
134
 
@@ -129,6 +136,8 @@ so write the clause. Source: Screenplay v5.1.0 `Documentation/screenplay/action-
129
136
  One screen per step is not a rule; a screen hosts every action the person can reasonably take
130
137
  there, and an action may be reachable from several screens.
131
138
  - Not a mockup: a drawn page is never evidence for the model, and a Level 1 screen is a data and
132
- action contract that a renderer or a person fills in (`cratis-screenplay-ui-composition`).
139
+ action contract that a renderer or a person fills in (`cratis-screenplay-ui-composition`). A
140
+ sketch, mockup or screenshot may still travel with the screen as `sketch`, `mockup` or `image`
141
+ lines, which are authoring metadata ([screen visuals](../../cratis-screenplay-ui-composition/references/screen-visuals.md)).
133
142
  - Not mandatory to render: a screen that stays design-only is still a contract for lineage and
134
143
  review.
@@ -32,8 +32,11 @@
32
32
  { "kind": "skill-contains", "value": "| `PLAY0935` | Error | A `passive` read model names a sink |", "file": "references/sinks.md" },
33
33
  { "kind": "skill-contains", "value": "The model never names a database", "file": "references/sinks.md" },
34
34
  { "kind": "skill-contains", "value": "Read [sinks](references/sinks.md) before naming a sink." },
35
+ { "kind": "skill-contains", "value": "acts on that table's collection", "file": "references/screen-patterns.md" },
36
+ { "kind": "skill-contains", "value": "Property declaration order is not preserved by default", "file": "references/screen-patterns.md" },
35
37
  { "kind": "skill-contains", "value": "[passive read models](references/passive.md) before declaring one" },
36
38
  { "kind": "skill-contains", "value": "| `PLAY0859` | Error | A `query` returns a passive read model", "file": "references/passive.md" },
37
- { "kind": "skill-contains", "value": "Requires Screenplay 5.3.0", "file": "references/passive.md" }
39
+ { "kind": "skill-contains", "value": "Requires Screenplay 5.3.0", "file": "references/passive.md" },
40
+ { "kind": "skill-contains", "value": "[graph queries](references/graph-queries.md)" }
38
41
  ]
39
42
  }
@@ -35,7 +35,9 @@ Tool versions are covered in `cratis-screenplay-toolchain` `SKILL.md`; read it b
35
35
  ## Language modes that block target delivery
36
36
 
37
37
  Read [language admission](../cratis-screenplay-toolchain/references/language-admission.md)
38
- for version selection, and [current Stage boundaries](../cratis-stage-rendering-and-sandbox/references/current-boundaries.md)
38
+ for version selection ([unknown-preserving reads](../cratis-screenplay-toolchain/references/unknown-preserving-reader.md)
39
+ are not render admission; read-model [property order](../cratis-screenplay-toolchain/references/read-model-property-order.md)
40
+ is opt-in 37.1 metadata, not a constructor-order promise), and [current Stage boundaries](../cratis-stage-rendering-and-sandbox/references/current-boundaries.md)
39
41
  for realization. Bounded atomic batches, source-event Translate captures/publication and resolved
40
42
  C# validation bodies now render. Described handlers still refuse even in Stub
41
43
  mode; query-performer gaps are a separate contract, not completed behavior. Protected reads still need an admitted shape. Semantic Host/executor
@@ -8,7 +8,10 @@ probe reports and choosing what to do. Do not copy the code table here.
8
8
 
9
9
  ## Pipeline that produces the codes
10
10
  1. The CLI compiles and binds the **whole** model with its **bundled** Screenplay (the ESM level it renders is bounded by the bundle; older bundles bound less). Binding is never scoped:
11
- any binding error blocks even a `--scope` render. Binding errors are `PLAY0268` (outside the admitted vertical), `PLAY0269`
11
+ any binding error blocks even a `--scope` render. That is strict `Compile` and the standalone tool;
12
+ a host that opts in to `CompileAdmissible` (Requires Screenplay 4.254.0) excludes the refused
13
+ specifications, slices, imports and policies and reports them instead, which does not establish
14
+ runtime identity safety. Binding errors are `PLAY0268` (outside the admitted vertical), `PLAY0269`
12
15
  (deferred), `PLAY0270` (report-only information), `PLAY0271` (legacy semantics) and `PLAY0273`
13
16
  (a specification shape). A file/inline command handler without unconditional `produces`
14
17
  or a resolved body instead reports PLAY0800 (`CommandHandlerRequiresAttachment`); beside
@@ -50,6 +50,8 @@
50
50
  { "kind": "skill-contains", "value": "Unsupported generated\ntypes (`STAGE-ESM-028`) and result combinations (`-038`)" },
51
51
  { "kind": "skill-contains", "value": "authored-UI parity" },
52
52
  { "kind": "skill-contains", "value": "responsible tool version" },
53
- { "kind": "skill-contains", "value": "`GraphSinks` into its render input, or a changed `sink` line never triggers a re-render" }
53
+ { "kind": "skill-contains", "value": "`GraphSinks` into its render input, or a changed `sink` line never triggers a re-render" },
54
+ { "kind": "skill-contains", "value": "unknown-preserving-reader.md" },
55
+ { "kind": "skill-contains", "value": "not a constructor-order promise" }
54
56
  ]
55
57
  }
@@ -18,7 +18,7 @@ Typed example/override forms: `cratis-screenplay-specifications`
18
18
  | Form | design | executable | renderable |
19
19
  |---|---|---|---|
20
20
  | `when <Cmd>` -> `then <Event>` / `then error` / `then denied` | yes | yes | yes |
21
- | `given <Event>` with `for` | yes | yes (needed for keyed views) | yes |
21
+ | `given <Event>` with `for` | yes | yes (needed for keyed views); no producing command needed when a root projection supplies the identity type, see `cratis-screenplay-specifications` `references/producerless-events.md` | yes |
22
22
  | `given readmodel` | yes | yes (complete instance with key) | only as the query-only lookup below |
23
23
  | `when append <Event>` | yes | yes | supported single-hop reaction effects/invocation only; fan-out, deeper cascades and other refused assertions retain STAGE-ESM-011 |
24
24
  | `then readmodel` / `then query` (keyed `ById`, `arguments`, `result`) | yes | yes | yes |
@@ -14,6 +14,7 @@
14
14
  { "kind": "skill-contains", "value": "One behaviour per spec" },
15
15
  { "kind": "skill-contains", "value": "No command has only two specs" },
16
16
  { "kind": "skill-contains", "value": "not scenario-complete" },
17
- { "kind": "skill-contains", "value": "per-view judgment was skipped" }
17
+ { "kind": "skill-contains", "value": "per-view judgment was skipped" },
18
+ { "kind": "skill-contains", "value": "references/producerless-events.md", "file": "references/spec-forms-by-mode.md" }
18
19
  ]
19
20
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  - Slices are the authoring unit
6
6
  - Declare in story order
7
+ - Showing an element in another slice
7
8
  - Slice dependencies
8
9
  - State-transition table (per entity)
9
10
  - Generic edits
@@ -94,6 +95,43 @@ module Moorings
94
95
  berthNumber BerthNumber = berthNumber
95
96
  ```
96
97
 
98
+ ## Showing an element in another slice
99
+
100
+ An event or read model often belongs on the timeline twice: where it is produced, and again where
101
+ a later slice reads it. Declare it once and place it with `shows event <Name>` or
102
+ `shows readmodel <Name>`. Never declare it a second time: a copied declaration is a second
103
+ declaration, with its own identity and no link to the first. Requires Screenplay 6.7.0 or later
104
+ (`screenplay --version`).
105
+
106
+ ```screenplay
107
+ concept OrderId : Uuid
108
+ concept Item : String
109
+
110
+ module Ordering
111
+ feature Orders
112
+ slice StateChange PlaceOrder
113
+ event OrderPlaced
114
+ orderId OrderId
115
+ item Item
116
+
117
+ slice StateView OpenOrdersView
118
+ readmodel OpenOrders
119
+ orderId OrderId key
120
+ item Item
121
+
122
+ slice StateView ShipOrder
123
+ shows event OrderPlaced
124
+ shows readmodel OpenOrders
125
+ ```
126
+
127
+ - A placement is a linked copy: a board draws both occurrences as one element, editing either
128
+ edits the one declaration, and renaming the declaration renames every placement.
129
+ - It is presentation only. It adds nothing to the executable model and changes no behavior, so it
130
+ does not make the slice produce the event or build the read model.
131
+ - `PLAY0953` (error) is a line that is not `shows event <Name>` or `shows readmodel <Name>`;
132
+ `PLAY0954` (warning) names no declared event or read model; `PLAY0955` (warning) shows an
133
+ element the slice declares itself, or shows it twice.
134
+
97
135
  ## Slice dependencies
98
136
 
99
137
  Record, per slice, the events it consumes and which slice produces each. This is for
@@ -4,6 +4,8 @@
4
4
  "fixtures": [],
5
5
  "assertions": [
6
6
  { "kind": "play-compiles" },
7
+ { "kind": "skill-contains", "value": "shows readmodel OpenOrders", "file": "references/slicing.md" },
8
+ { "kind": "skill-contains", "value": "Requires Screenplay 6.7.0 or later", "file": "references/slicing.md" },
7
9
  {
8
10
  "kind": "skill-contains",
9
11
  "value": "NOT enforced in the model today"