@cratis/pi 7.6.4 → 7.7.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 (212) hide show
  1. package/package/corpus/agents/backend-developer.md +14 -0
  2. package/package/corpus/agents/code-reviewer.md +16 -0
  3. package/package/corpus/agents/coordinator.md +17 -0
  4. package/package/corpus/agents/frontend-developer.md +17 -0
  5. package/package/corpus/agents/orchestrator.md +18 -0
  6. package/package/corpus/agents/planner.md +24 -0
  7. package/package/corpus/agents/screenplay-modeler.md +57 -0
  8. package/package/corpus/agents/screenplay-renderer.md +42 -0
  9. package/package/corpus/agents/screenplay-reviewer.md +45 -0
  10. package/package/corpus/agents/slice-implementer.md +32 -5
  11. package/package/corpus/agents/spec-writer.md +16 -3
  12. package/package/corpus/prompts/add-reactor.prompt.md +5 -3
  13. package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
  14. package/package/corpus/prompts/write-specs.prompt.md +12 -6
  15. package/package/corpus/rules/application-profile.md +7 -3
  16. package/package/corpus/rules/general.md +8 -3
  17. package/package/corpus/rules/glossary.md +1 -1
  18. package/package/corpus/rules/profiles.md +42 -4
  19. package/package/corpus/rules/reactors.md +30 -22
  20. package/package/corpus/rules/vertical-slices.md +3 -1
  21. package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
  22. package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
  23. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
  24. package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
  25. package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
  26. package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
  27. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
  28. package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
  29. package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
  30. package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
  31. package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
  32. package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
  33. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
  34. package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
  35. package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
  36. package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
  37. package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
  38. package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
  39. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
  40. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
  41. package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
  42. package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
  43. package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
  44. package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
  45. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
  46. package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
  47. package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
  48. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
  49. package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
  50. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
  51. package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
  52. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
  53. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
  54. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
  55. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
  56. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
  57. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
  58. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
  59. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
  60. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
  61. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
  62. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
  63. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
  64. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
  65. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
  66. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
  67. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
  68. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
  69. package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
  70. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
  71. package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
  72. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
  73. package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
  74. package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
  75. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
  76. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
  77. package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
  78. package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
  79. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
  80. package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
  81. package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
  82. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
  83. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
  84. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
  85. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
  86. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
  87. package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
  88. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
  89. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
  90. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
  91. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
  92. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
  93. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
  94. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
  95. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
  96. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
  97. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
  98. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
  99. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
  100. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
  101. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
  102. package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
  103. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +95 -54
  104. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
  105. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
  106. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +45 -5
  107. package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
  108. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -7
  109. package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
  110. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
  111. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
  112. package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
  113. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
  114. package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
  115. package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
  116. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
  117. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
  118. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
  119. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
  120. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
  121. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
  122. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
  123. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
  124. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
  125. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
  126. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
  127. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
  128. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
  129. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
  130. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
  131. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
  132. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
  133. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
  134. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
  135. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
  136. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
  137. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
  138. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
  139. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
  140. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
  141. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
  142. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
  143. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
  144. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
  145. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
  146. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
  147. package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
  148. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
  149. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
  150. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
  151. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
  152. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
  153. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
  154. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
  155. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
  156. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
  157. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
  158. package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
  159. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
  160. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
  161. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
  162. package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
  163. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
  164. package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
  165. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
  166. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
  167. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
  168. package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
  169. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
  170. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
  171. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
  172. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
  173. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
  174. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
  175. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
  176. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
  177. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
  178. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
  179. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
  180. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
  181. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
  182. package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
  183. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
  184. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
  185. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
  186. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
  187. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
  188. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
  189. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
  190. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
  191. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
  192. package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
  193. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
  194. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
  195. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
  196. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
  197. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
  198. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
  199. package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
  200. package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
  201. package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
  202. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
  203. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
  204. package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
  205. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
  206. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
  207. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
  208. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
  209. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
  210. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
  211. package/package/profile-catalog.json +11 -0
  212. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ # Screenplay cheat-sheet (tool versions: versions.md)
2
+
3
+ The syntax lives in compiled example files next to this one (each is a Markdown file holding
4
+ one complete `screenplay` fence). Copy shapes from them; do not write a form that none of
5
+ them (or a compiled documentation example) shows. This file holds the prose rules; the
6
+ examples belong to `cheat-sheet-example.md` and its siblings.
7
+
8
+ | File | Mode | V1, warnings as errors | V3 (binds) |
9
+ | --- | --- | --- | --- |
10
+ | `cheat-sheet-example.md` | design: every construct family | 0 diagnostics on the standalone tool; cratis 3.27.1 (4.60.1) reports a false PLAY0285 on the `RecordingAPayment` cascade spec, so the fence carries the marker below and skips cratis | not ready by design (its header lists why; fewer blockers on the standalone tool) |
11
+ | `executable-example.md` | executable, StateChange and StateView | 0 diagnostics, both tools | ready, both tools |
12
+ | `pdl-example.md` | executable projections | 0 diagnostics, both tools | ready, both tools |
13
+ | `automation-translate-example.md` | executable Automation and Translate (ESM v6) | standalone tool only (first line `// Needs the standalone screenplay compiler (ESM v6)`) | ready on the standalone tool only |
14
+
15
+ Screenplay sources: `Documentation/screenplay/grammar.md` (EBNF; checked against the parsers
16
+ by `for_Documentation/when_comparing_the_grammar_against_the_parsers.cs`),
17
+ `projections/grammar.md`, `captures/grammar.md`. Documentation examples compile in
18
+ Screenplay CI (`when_compiling_every_example.cs`) against repository main: the standalone
19
+ compiler, not necessarily the cratis-bundled one (`versions.md`).
20
+
21
+ ## Lexical and structural rules
22
+ - Spaces only, 2 per level (tabs: PLAY0006 W). Offside rule.
23
+ - Comments: `//` only. `#` is not a comment (PLAY0058 E in a projection) despite doc examples.
24
+ - Order is free (forward references fine) except `domain` first in the file and `description`
25
+ first in a body.
26
+ - Strings: `"..."`, escapes `\" \\ \n \r \t`; other backslashes kept (regex `"^INV-\d{6}$"` works).
27
+ - Structured values: single-line JSON, quoted keys (`[{"sku": "A-1", "quantity": 2}]`).
28
+ - One condition grammar (policy `require`, `produces when`, `require`, reaction `where`): `and`
29
+ binds tighter than `or`; operators `== != > >= < <= contains`, `starts with`; claims use
30
+ `claim "x" matches "v"` (not `==`: PLAY0120).
31
+ - Keyword escape `@name` for properties named `tag`, `authorize`, `produces`, `reads`, `file`,
32
+ `validate` (enum value), `sequence`, `occurred`, `causedBy`, `namespace`, `correlation`,
33
+ `causation`, and projection `key`/`parent`/`with`.
34
+ - `type` and `concept` are top level only (inside a slice: PLAY0029, silently dropped).
35
+ - Concept rules have no subject: `not empty`, `min 3`, `max 10`, `length == 10`,
36
+ `matches email`, `matches "regex"` (`length 3 to 10` / `length >= 3`: PLAY0141).
37
+ - Property modifiers: `Type[]`, `Type optional`, `Type[] optional`; order `Type optional
38
+ generated identifier` (PLAY0484); legacy `?` is PLAY0479 (information).
39
+ - Ownership policies: `require claim "ownerId" matches subject` (subject = command identifier
40
+ or keyed query argument) or `matches <commandProperty>`; executable; renderable only for
41
+ text-backed targets (Uuid-backed: STAGE-ESM-015).
42
+
43
+ ## Clause order inside a command (canonical)
44
+ description, properties, `reads`, `authorize`, `validate`, `produces`/`handler`, `concurrency`.
45
+
46
+ ## Slice contents (typical)
47
+ - `slice StateChange <Cmd>`: command, its events, constraints, dialog screen, success/rejection/denial specs.
48
+ - `slice StateView <View>`: readmodel, keyed query (+ design-mode list query), projection or reducer, screen, view specs.
49
+ - `slice Automation <Behaviour>`: reaction(s) + events they produce + specs.
50
+ - `slice Translate <Behaviour>`: capture and/or translator reaction + both vocabularies' events.
51
+ - Declare each event once, in the slice that produces it; reference it by name elsewhere.
52
+
53
+ ## `$context.` paths (command `produces`)
54
+ `occurred`, `tenant`, `command.<p>`, `arguments.<p>`, `causedBy.subject|name|userName`,
55
+ `causation.type`, `identity.id|name|userName|isAuthenticated|roles|claims.<n>`.
56
+ Binder-supported (`BindOccurrence`, v4.64.0): `occurred`, `identity.id` (= `causedBy.subject`),
57
+ `identity.name` (= `causedBy.name`), `identity.userName` (= `causedBy.userName`). `tenant`,
58
+ roles, claims, causation, `command.<p>`, `arguments.<p>`: PLAY0268. Binding is not execution:
59
+ a reference scenario that supplies only a clock carries no caller audit identity, so check the
60
+ reference runner before relying on identity paths in a specification. Renderable:
61
+ `$context.occurred` only.
62
+
63
+ ## `$eventContext.` (projections)
64
+ `eventType{.id,.generation,.tombstone}`, `eventSourceType`, `eventSourceId`, `eventStreamType`,
65
+ `eventStreamId`, `sequenceNumber`, `occurred`, `occurred.Week`, `eventStore`, `namespace`,
66
+ `correlationId`, `causedBy{.subject,.name,.userName,.onBehalfOf}`, `hash`, `subject`,
67
+ `subjectIsEventSourceId`, `observationState` (unstable on replay). `causation` and `tags` are
68
+ collections (path below them: PLAY0297 E). Unknown member: PLAY0295/0296 W.
69
+ `$eventSourceId` is the short form used in mappings. `occurred.Week` compiles but does not bind
70
+ (PLAY0273: derived value). Any `$eventContext` path other than `eventSourceId` binds, but the execution plan refuses it ("An event-context value other than the event source identity needs occurrence context that ESM v1 facts do not carry"), so a model that must run uses `$context.occurred` in the command `produces` instead (it executes when the scenario has `given clock`). Catalogue: `Documentation/screenplay/projections/event-context.md`.
71
+
72
+ ## PDL quick reference (most forms are compiled in `pdl-example.md` or `cheat-sheet-example.md`; `remove via join` and `$eventContext.occurred` are not)
73
+ - Header `projection Name => ReadModel`; variant group `projection Name` + `variant RM` /
74
+ `enters on Event [key k]`.
75
+ - Directives: `no automap` (AutoMap is on by default; scoped projections match names case-insensitively for the same type, flat-bound ones exact names only), `every`
76
+ (mappings applied for every event), `all` (per event source, never global), `from Event [key k]`.
77
+ - Mappings: `target = source`, `"literal"`, `$eventSourceId`, `$eventContext.occurred` (binds, but blocks the execution plan),
78
+ `increment n`, `decrement n`, `count n` (in `all`), `add t by x`, `subtract t by x`,
79
+ `set t to "v"`, `clear t`.
80
+ - `join Label on rmProperty` + `with Event` (matches the joined event's source id against the
81
+ property; the label is decoration; joins never create instances).
82
+ - `children prop identified by k` + `from E key k` + `remove with E key k`; `nested prop` +
83
+ `from` + `clear with E`.
84
+ - Removal: `remove with Event`; `remove via join on Event` is compile-only and bind-only: at projection level it blocks the whole reference execution plan (`UnsupportedProjectionBlock`), so no specification runs.
85
+ - Keys: only on `from` (a projection-level `key` routes nothing: PLAY0381 W).
86
+ - One `every`/`all` block per level for the executable model (else PLAY0268).
87
+ - Templates (`` `${a}` ``) and `$causedBy` parse but do not bind (PLAY0268).
88
+
89
+ ## Specification forms
90
+ Full list with semantics: `Documentation/screenplay/specifications.md`. Compiled in the
91
+ examples: `given caller` (+`authenticated`, `role`), `given clock`, `given <Event> for`,
92
+ `when <Command>`, `when append <Event> for`, `then <Event> for`, `then error "msg"`,
93
+ `then denied`, `then query ... arguments ... result`, `then no readmodel RM for "key"`.
94
+ `then` events are exhaustive and ordered; after `when append` (ESM v6) they list only what
95
+ followed it. Duplicate and competing-claim checks use `when <Command>` with the earlier fact
96
+ as `given`. Specification construct depth: `cratis-screenplay-specifications`.
@@ -0,0 +1,107 @@
1
+ # Diagnostics: meaning -> fix
2
+
3
+ Authority: Screenplay `Documentation/screenplay/diagnostics.md` and
4
+ `Source/DotNET/Screenplay/Diagnostics/DiagnosticCodes.cs`. Codes are permanent; match the code,
5
+ never the message. Severities: E (does not compile), W (compiles; usually an unresolved name),
6
+ I (never fails, even with `--warnings-as-errors`). `PLAY` = compiler, `SP` = Arc generator,
7
+ `STAGE-*`/`CLI-RENDER-*` = renderer.
8
+
9
+ Where each layer appears: `screenplay <folder>` / `cratis screenplay validate` = syntax and
10
+ consistency (V1). MCP `executable-diagnostics` = binding (V2 reads them, V3 needs none:
11
+ PLAY0268-0274, 0350-0352, 0389, 0449). `cratis render` = binding with the bundled compiler,
12
+ then STAGE (V5 admission). Tool differences: `versions.md`.
13
+
14
+ ## Warnings that hide defects (always validate with `--warnings-as-errors`)
15
+ | Code | Meaning | Fix |
16
+ |---|---|---|
17
+ | PLAY0029 | unknown word in a slice body: the construct is **skipped** | fix the keyword; `type`/`concept` belong at top level |
18
+ | PLAY0165/0166/0167 | unknown type / event / policy (0167 is E inside a persona) | declare it, or validate the **folder** (cratis file mode ignores imports) |
19
+ | PLAY0177 | `reads` a read model no projection builds | add the builder or fix the name |
20
+ | PLAY0248 | reaction `when` names no event/trigger | declare it |
21
+ | PLAY0195 | `invokes` an unknown command | declare it |
22
+ | PLAY0381 | projection-level `key` routes nothing | put `key` on each `from` |
23
+ | PLAY0455 | quoted import glob matches no file | fix the glob |
24
+ | PLAY0196/0197/0198 | unknown query/screen; ambiguous bare name | declare or qualify `Slice.Name` |
25
+
26
+ ## Not caught at V1 (fail binding: V2/V3, PLAY0273)
27
+ - Projection mapping to a property the read model does not declare.
28
+ - Undeclared event in `remove with` or in a capture `append`.
29
+ (Screenplay v4.64.0 `SemanticModelBinder` `BindMapping`, `LevelEvent`, `BindCaptureAppends`.)
30
+
31
+ ## Silent at every level
32
+ - A declared read-model property that nothing maps (it stays empty): walk field lineage by hand.
33
+
34
+ ## Consistency errors (V1: the model contradicts itself)
35
+ | Code | Meaning |
36
+ |---|---|
37
+ | PLAY0282 | `validate` rule targets a field absent from the command |
38
+ | PLAY0283 | `reads View by field` type matches no `by` param of the view's queries |
39
+ | PLAY0284 | `children`/`nested` never populates a declared element field |
40
+ | PLAY0285 | a spec's `then` event contradicts every possible declared producer of its `when` command (decidable literals, property copies, equality conditions). Fix the model or the spec deliberately. **False positive** on reaction cascades with the cratis-bundled compiler 4.60.1 (cli#242, open; reachability through reactions and `invokes` was added later): confirm with the standalone tool, record a tool gap, do not "fix" a correct model |
41
+ | PLAY0286 | spec value is not a member of the enum |
42
+ | PLAY0287 | producer/capture/spec assigns a field the event lacks |
43
+ | PLAY0291-0294 | bad single-line JSON / unknown key / wrong shape / duplicate key |
44
+
45
+ ## Binding (V2 and V3) - see `executable-subset.md` for the full table
46
+ | Code | Meaning | Fix |
47
+ |---|---|---|
48
+ | PLAY0268 | construct the ESM cannot represent; read the message for the construct (`executable-subset.md` lists the common ones: handler, list or observable query, `@pii`, `produces when` over read models, v6 constructs on cratis 3.27.1) | stay in design mode, or change the construct if the domain allows; never strip `@pii`/authorization |
49
+ | PLAY0269 / 0270 | UI deferred / authoring metadata (I) | none |
50
+ | PLAY0271 | legacy `reads` or a `concurrency` block keeps its legacy meaning and cannot bind (error) | design gap; a constraint for uniqueness; protected decisions are a target requirement |
51
+ | PLAY0273 | incoherent: ambiguous `for`, property not on event revision, operand type mismatch, derived `$eventContext` path | fix the reference |
52
+ | PLAY0350 | `null` in command/event value | Chronicle semantics (nullable event properties are CHR0012; an optional fact is a separate event), not only a binder limitation: specs cannot state an absent command/event value. Omit the value or record a capability gap; whether the optional detail is really a separate fact is a review question, not this code's fix |
53
+ | PLAY0351 | given/then readmodel lacks the key property | add the keyed query's `by` property |
54
+ | PLAY0352 | when-less spec asserting events/errors | add a `when` or assert readmodel/query |
55
+ | PLAY0389 | gated command/query exercised without `given caller` | add `given caller` (empty block = anonymous) |
56
+
57
+ ## Frequent errors
58
+ | Code | Meaning / fix |
59
+ |---|---|
60
+ | PLAY0001 | unknown top-level word (e.g. `slice` at top level of an un-imported file; `numbers` on a compiler older than 4.64.0) |
61
+ | PLAY0007 | a `concept` line is not `concept <Name> : <Type>` |
62
+ | PLAY0042 | a `produces` line is neither `produces <EventType>` nor `produces when <condition>` (the event goes on its own line and `for` on the line below) |
63
+ | PLAY0048 | a query body line opens with a word a query does not declare by (for example `observable` as a body line; it belongs in the return position) |
64
+ | PLAY0295/0297 | `$eventContext` path starts with an unknown member (W) / continues below `causation` or `tags` (E) |
65
+ | PLAY0357 | a `$strings.` message without a valid dotted key (blocks binding) |
66
+ | PLAY0508-0513 | `numbers exact` preamble errors (syntax only; a valid exact document still cannot bind, PLAY0268) |
67
+ | PLAY0006 | tab indentation (W) |
68
+ | PLAY0017/0019 | `identifier` outside a command / on an event property |
69
+ | PLAY0058 | unexpected token in projection (often a `#` comment) |
70
+ | PLAY0114/0117/0120 | policy without `require`; claim needs `claim "x" matches "v"` |
71
+ | PLAY0141 | unreadable rule (e.g. `length 3 to 10`; use `min`/`max`/`length ==`) |
72
+ | PLAY0191 | more than one builder for a read model |
73
+ | PLAY0193 | more than one `for` in a production |
74
+ | PLAY0358/0097 | more than one `when` action |
75
+ | PLAY0386-0389 | `given caller` shape / duplicates / `then denied` mixed / missing |
76
+ | PLAY0390-0393 | constraint: unknown event, property not on event, duplicate name, `ignore casing` on `unique event` |
77
+ | PLAY0410/0411/0412 | same view read twice / duplicate alias / alias collision |
78
+ | PLAY0453 | `then no readmodel` needs `RM for "<key>"` |
79
+ | PLAY0461 | clock instant not ISO 8601 with `Z`/offset |
80
+ | PLAY0468 | `when query` argument is not a `by`/`filter` param |
81
+ | PLAY0474 | `produces event` (inline) outside a command, e.g. in a reaction |
82
+ | PLAY0478 (I) | plain `produces` without `for`: add `for <identifier>` |
83
+ | PLAY0469 (I/W) | command identifier copied into the payload while targeting it |
84
+ | PLAY0479 (I) | legacy `?` optional |
85
+ | PLAY0480/0484 | modifier order `Type optional generated identifier` |
86
+ | PLAY0289 | (binding) no documents: empty root |
87
+
88
+ Fix order: E at V1 -> W at V1 -> silent-gap check -> V2 codes (if the mode needs V3).
89
+ Report each as `code file:line one-line meaning`; never paste more than about 30 lines.
90
+
91
+ ## Render admission (V5): `STAGE-*`, `CLI-RENDER-*`, `STAGE-CRATIS-*`
92
+ Full table with causes: `renderable-subset.md`. Codes you meet most:
93
+ | Code | Meaning |
94
+ |---|---|
95
+ | STAGE-ESM-016 | model above ESM schema v3 (or v4 generations, v5 absence, v6 constructs): whole model refused |
96
+ | CLI-RENDER-003 | the CLI pre-check for ESM v4 generations |
97
+ | STAGE-ESM-001 | slice kind is not `StateChange`/`StateView` (Automation, Translate: Stage#79) |
98
+ | STAGE-ESM-004 / 006 / 013 | more than one command per `StateChange`; conditional or value-expression production; other context value |
99
+ | STAGE-ESM-005 / 015 | code rule or code validation; opaque policy or an ownership claim against a Uuid-backed target |
100
+ | STAGE-ESM-007 / 009 / 010 / 017 | projection shape (one per read model, cardinality, query delivery, keys, `all`, event-context values) |
101
+ | STAGE-ESM-011 | specification shape not rendered (`when append`, `then no readmodel`, composite values) |
102
+ | STAGE-ESM-014 | constraint shape (multi-claim in one command, intra-command multi-event change) |
103
+ | STAGE-ESM-019/022 | reducer body outside the pure allowlist |
104
+ | STAGE-ESM-020 | a body the model requires is missing or changed (content hash check); blocks publication |
105
+ | STAGE-CRATIS-005 | a modeled artifact would render into `Customizations/` |
106
+ Fix by changing the model only where the domain allows it; otherwise the slice is gap-fill
107
+ with the model as its contract (`cratis-screenplay-render-and-gap-fill`).
@@ -0,0 +1,48 @@
1
+ # Documentation contradictions and which side to trust
2
+
3
+ `D/` is Screenplay `Documentation/screenplay/` at **v4.64.0**; line numbers were re-read at
4
+ that tag. Rule: the compiler you ran decides what the tool accepts today; the documentation
5
+ and the domain decide what the model should mean. When they disagree, follow the compiler
6
+ for syntax, keep the intended semantics in the model, and record the gap (an issue).
7
+ Tool names mean the standalone `screenplay` 4.64.0 and `cratis` 3.27.1 (bundled Screenplay
8
+ 4.60.1); see `versions.md`. [probed] marks a row re-checked by running a tool; the rest are
9
+ read from source or documentation.
10
+
11
+ | # | Topic | Conflict | Trust |
12
+ | --- | --- | --- | --- |
13
+ | 0 | ESM v6 | `D/specifications.md` and `D/reactions.md` describe clocks, triggers, captures and reactions as admitted and executed | the standalone tool admits them (ESM v6); cratis 3.27.1 (4.60.1) rejects them with PLAY0268 [probed] |
14
+ | 1 | `#` comments | PDL docs use `#` (`D/projections/auto-map.mdx:125,147,153`, `D/forms.md:10`) | compiler: PLAY0058 in a projection; use `//` [probed] |
15
+ | 2 | projection `automap` | `D/projections/grammar.md:70,77` now allow `automap` for children and nested; the projection-level `ProjDirective` (`:38`) still lists only `no automap` | compiler accepts bare `automap`; keep `no automap` at projection level |
16
+ | 3 | AutoMap inside `from` | `D/projections/auto-map.mdx:49` "cannot be toggled" vs `:226` "apply `no automap` per event" | ambiguous; use `no automap` at the projection, children or nested level |
17
+ | 4 | child id syntax | `D/projections/keys.md:110` says `id userId` | `identified by` (compiled) |
18
+ | 5 | root `remove via join` | `D/projections/removal.md` promises instance removal | `D/projections/semantic-model.md:59,94`: the engine wires it as a child pull and the evaluator does not execute it. Unverified at runtime |
19
+ | 6 | `$strings` in authentication | `D/internationalization.md:30` allows it wherever a value expression is accepted | PLAY0183: no provider configuration lines |
20
+ | 7 | interaction examples | `D/interactions.md:33` uses `button` | PLAY0103; `on double click` on `table` compiles though not in the EBNF |
21
+ | 8 | where screens live | `D/screens.md:3` "inside `StateView` slices" | samples also put dialogs in `StateChange` |
22
+ | 9 | where reducers live | `D/slices.md:74` and `D/glossary.md:21` call a reducer an `Automation` thing vs `D/slices.md:87` (`StateView`) | `StateView` (samples) |
23
+ | 10 | `then` after `when append` | `D/specifications.md:67` "must match exactly the appended fact" vs `:232` and `:282` (v6: what followed it) | v6 text on the standalone tool; before v6, `:67` |
24
+ | 11 | constraint collision across sources | `D/constraints.md:118` "cannot yet show" vs `D/specifications.md:77` (`for` lets a spec claim a value on another source) | `specifications.md` (newer) |
25
+ | 12 | capture backtick `when` | opaque (`D/captures/grammar.md:321`) vs small portable grammar (`D/captures.md:94`) | both: storage versus binder |
26
+ | 13 | clock boundary | resolved: an occurrence fires if due **after** the given clock and **at or before** the when clock (`D/specifications.md:282-284`; `Semantics/Execution/SemanticClock.cs`, `at > from && at <= to`). Given equal to when fires nothing, so the Screenplay sample `Samples/Commerce/Fulfillment/Shipping/ReleasePickingWave.play:20-22` (06:00 to 06:00, expecting `PickingWaveReleased`) is wrong | the code; never write given equal to when. A Screenplay issue for the sample is a candidate |
27
+ | 14 | `$causedBy` | not evaluable (#4119), not ESM | showcase only |
28
+ | 15 | literal keys | `key literal "global"` vs `key "global"` | both compile; prefer `literal` |
29
+ | 16 | query admission | `D/queries.md:74` now says live, filtered, scoped and performer queries are not admitted | the binder also rejects collection queries and a missing `by`, which stay undocumented [probed] |
30
+ | 17 | `@pii` | `D/concepts.md:3,33` "Chronicle applies `@pii` and `@sensitive` rules automatically" | the binder rejects any compliance attribute (PLAY0268); keep it, report V3 blocked. `@sensitive` has no verified portable meaning (Screenplay#384); `@pii` on an event-source identifier is CHR0034 in Chronicle |
31
+ | 18 | read-model identity | `D/readmodels.md:32` "from the keyed query" | the `by` name must also equal a read-model property (the doc still omits it) |
32
+ | 19 | `$strings` constraint messages | `D/constraints.md:31` vs `D/internationalization.md:55` | the compiler keeps the key; realization localizes |
33
+ | 20 | composite key braces | optional in the EBNF; both forms in docs | both fine |
34
+ | 21 | counters list | `D/projections/index.md:54` lists only increment and decrement | `count` exists too [probed] |
35
+ | 22 | ESM version allocation | `numbers exact` is **ESM v7** (decision 0024, proposed); decision reads are **v11** (decision 0023) | the decisions (`decisions/0023`, `0024`) |
36
+ | 23 | claim conditions | the condition grammar lists `==` | claims need `matches` (PLAY0120) [probed] |
37
+ | 24 | `numbers exact` | released in 4.64.0 as syntax only, but absent from `D/grammar.md`; documented only in `D/diagnostics.md` (PLAY0508 to PLAY0513) | the compiler: it parses, never binds (PLAY0268), PLAY0001 on older compilers [probed] |
38
+ | 25 | command `concurrency` | `D/commands.md:609` says the executable model "does not bind the `concurrency` block yet" | the binder reports PLAY0271 as an **error**, not a silent skip (`SemanticModelBinder.Commands.cs:32-38`) |
39
+ | 26 | MCP approval policy | `D/mcp/reference.md:37` "Keep client approval enabled for both" vs the server instructions (`McpConnection.cs:14`) "hosts need not confirm them each time" | keep approval on; this skill's rule is explicit user approval before `apply` |
40
+ | 27 | decision index | `decisions/README.md` row 0020 shows stage `none` while v5 is implemented | the code: v5 `then no readmodel` binds |
41
+ | 28 | `visualize-model` kind | the tool filters on the kind "Reactor" (`McpVisualization.cs:21`) although the construct is a Reaction; its added/removed summary never counts reactions (Screenplay#379, open) | the model, not the summary |
42
+ | 29 | bodied reducers in Stage | cli `Documentation/reference/screenplay.md:38` says bodied reducers are unsupported (STAGE-ESM-019) | Stage 4.24 code admits pure allowlisted reducer bodies (`PureTransitionAdmission.cs`); trust the code |
43
+ | 30 | `cratis screenplay validate <file>` | the command reads as a document validator | file mode ignores the file's imports and reports false unknown-name warnings (cli#244, open): validate the folder [probed] |
44
+ | 31 | cli false PLAY0285 | `D/diagnostics.md:640` defines PLAY0285 as a contradiction against every possible producer | cratis 3.27.1 reports it falsely on reaction cascades (cli#242, open): confirm with the standalone tool [probed] |
45
+
46
+ Rows 0 to 12, 14 to 21 and 23 were re-read at the v4.64.0 line numbers above; rows 14, 15,
47
+ 19, 20 and 23 are properties of the language rather than documentation defects and were
48
+ not re-probed on 4.64.0.
@@ -0,0 +1,113 @@
1
+ # Executable example (StateChange and StateView)
2
+
3
+ A small model that compiles with 0 diagnostics and binds executable (`authoringAccepted` true, `executableReady` true, 0 executable diagnostics) on both tools when opened through MCP with a fixed root (see [mcp-loop.md](../../cratis-screenplay-model-authoring/references/mcp-loop.md) and [versions.md](versions.md)). Prose: [executable-subset.md](executable-subset.md).
4
+
5
+ ```screenplay
6
+ // Executable example: StateChange + StateView, command and query protection, reference specifications.
7
+ concept ArtworkId : Uuid
8
+ concept ArtworkTitle : String
9
+ validate
10
+ not empty message "An artwork needs a title"
11
+
12
+ policy IsCurator
13
+ require role "Curator"
14
+
15
+ module Gallery
16
+ feature Registration
17
+ slice StateChange RegisterArtwork
18
+ command RegisterArtwork
19
+ artworkId ArtworkId identifier
20
+ title ArtworkTitle
21
+ insuredValue Decimal
22
+ authorize IsCurator
23
+ validate
24
+ insuredValue > 0 message "An insured value must be positive"
25
+ produces ArtworkRegistered
26
+ for artworkId
27
+ title = title
28
+ insuredValue = insuredValue
29
+ produces when insuredValue > 100000
30
+ HighValueArtworkFlagged
31
+ for artworkId
32
+ insuredValue = insuredValue
33
+ event ArtworkRegistered
34
+ title ArtworkTitle
35
+ insuredValue Decimal
36
+ event HighValueArtworkFlagged
37
+ insuredValue Decimal
38
+ constraint UniqueArtworkTitle
39
+ unique title on ArtworkRegistered
40
+ specification RegisteringAnArtwork
41
+ given caller
42
+ authenticated
43
+ role "Curator"
44
+ when RegisterArtwork
45
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
46
+ title = "Starry Night"
47
+ insuredValue = 500
48
+ then ArtworkRegistered
49
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
50
+ title = "Starry Night"
51
+ insuredValue = 500
52
+ specification RejectingAZeroValue
53
+ given caller
54
+ authenticated
55
+ role "Curator"
56
+ when RegisterArtwork
57
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
58
+ title = "Starry Night"
59
+ insuredValue = 0
60
+ then error "An insured value must be positive"
61
+ specification RejectingAnEmptyTitle // one concept rejection spec, through this command
62
+ given caller
63
+ authenticated
64
+ role "Curator"
65
+ when RegisterArtwork
66
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
67
+ title = ""
68
+ insuredValue = 500
69
+ then error "An artwork needs a title"
70
+ specification RefusingAnOutsider
71
+ given caller
72
+ authenticated
73
+ role "Guest"
74
+ when RegisterArtwork
75
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
76
+ title = "Starry Night"
77
+ insuredValue = 500
78
+ then denied
79
+ slice StateView ArtworkDetails
80
+ readmodel ArtworkSummary
81
+ artworkId ArtworkId
82
+ title ArtworkTitle
83
+ insuredValue Decimal
84
+ query ArtworkById => ArtworkSummary optional
85
+ by artworkId ArtworkId
86
+ authorize IsCurator
87
+ projection Artworks => ArtworkSummary
88
+ from ArtworkRegistered
89
+ artworkId = $eventSourceId
90
+ title = title
91
+ insuredValue = insuredValue
92
+ specification RefusingAnOutsiderLookup
93
+ given caller
94
+ authenticated
95
+ role "Guest"
96
+ then query ArtworkById
97
+ arguments
98
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
99
+ then denied
100
+ specification SeeingARegisteredArtwork
101
+ given caller
102
+ authenticated
103
+ role "Curator"
104
+ given ArtworkRegistered
105
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
106
+ title = "Starry Night"
107
+ insuredValue = 500
108
+ then query ArtworkById
109
+ arguments
110
+ artworkId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
111
+ result
112
+ title = "Starry Night"
113
+ ```
@@ -0,0 +1,148 @@
1
+ # Executable subset (what binds: V2 and V3)
2
+
3
+ What the binder admits, and what it refuses with which code. The answer depends on the
4
+ compiler: the standalone tool (4.64.0) admits ESM v1 to v6; the cratis-bundled compiler
5
+ (4.60.1) admits v1 to v5. Tool facts and the exact v6 messages: `versions.md`. Always name
6
+ the tool with a V2 or V3 result. When tool and documentation disagree, the tool decides
7
+ current capability; the documentation and the domain decide intended correctness. Record
8
+ the gap, never strip the model to pass.
9
+
10
+ Binding is observed only through MCP (`read-workspace view=executable-diagnostics`) or a
11
+ render. `screenplay <folder>` and `cratis screenplay validate` never bind (`verdicts.md`).
12
+
13
+ Complete examples that bind live in `executable-example.md` (both compilers),
14
+ `pdl-example.md` (projections, both compilers) and `automation-translate-example.md`
15
+ (ESM v6, standalone tool only).
16
+
17
+ ## Admitted on both compilers
18
+
19
+ - `StateChange` and `StateView` slices.
20
+ - A command with one `identifier`; `produces <Event>` with `for <identifier>` on every
21
+ production.
22
+ - `produces when` with `==`/`!=` on scalar text, enum, number or boolean, and ordering on
23
+ numbers.
24
+ - Mappings from command properties, string and number literals, `$context.occurred`,
25
+ `$context.identity.id`, `.name` and `.userName` (aliases `causedBy.subject`, `.name`,
26
+ `.userName`). Binding is not execution: a clock-only reference scenario supplies no caller
27
+ audit identity.
28
+ - Concept and command rules: `not empty`, `min`, `max`, `length ==`, `matches`, numeric
29
+ comparisons, `all >`/`all >=` on numeric collections, `require <command-property
30
+ condition>`, `severity`. The operand is a literal, never a property reference.
31
+ - Declarative policies (`require role`, `authenticated`, `claim ... matches`) on module,
32
+ feature, command and query. Ownership policies `claim "x" matches subject` or `matches
33
+ <commandProperty>`.
34
+ - `constraint ... unique <prop> on <Event>`. Admission is separate from the open Chronicle
35
+ durability defects (`versions.md`): never treat admission as proof of uniqueness.
36
+ - A `readmodel` with one unambiguous key: one or more keyed queries `query XById => RM optional`
37
+ in its slice, all using the same `by xId XId` property, whose name equals a read-model
38
+ property (each with optional `authorize`). Two different `by` properties on one read model are
39
+ PLAY0268; a list query (`=> RM[]`) is a separate blocker.
40
+ - One projection per read model: `from`, `every`, `all` (one block per level), `join`,
41
+ `children`, `nested`, `remove with`, `remove via join` (binds; blocks the execution plan at the projection level, see below), `clear with`, counters, `add`,
42
+ `subtract`, `set`, `clear`, variants, and the identifier mapped from the projection's key (`xId = $eventSourceId` only for an event-source key).
43
+ - Specifications: `given caller`, `given <Event> for`, `when <Command>`, `when append
44
+ <Event> for`, `then <Event> for`, `then error "msg"`, `then denied`, `then query ...
45
+ arguments ... result`, `then no readmodel RM for "key"` (ESM v5), and when-less view
46
+ specifications ending in `then query` or `then readmodel`.
47
+ - `seed`. Personas, screens and descriptions are PLAY0270/PLAY0269 information, not
48
+ blocking.
49
+
50
+ ## Admitted on the standalone tool only (ESM v6)
51
+
52
+ - `slice Automation` with `reaction`: `when <Event>` (with values) then `produces` (no
53
+ `for` means the trigger's event source) or `invokes <Command>`; `where`; clock `at ... on
54
+ ...` with an explicit `for`. The invoked command runs its full pipeline with **no caller**
55
+ (Screenplay#383, open): a gated command rejects and the rejection ends the scenario.
56
+ Keep the gate and record the capability gap; never strip authorization.
57
+ - Application `trigger` declarations and `when trigger` specifications.
58
+ - `slice Translate` with `capture` (`key`, `map ... translate`, `append ... when x from "a"
59
+ to "b"`), and `given capture` / `when capture` specifications.
60
+ - `given clock` and `when clock`. The clock is UTC and exact; an occurrence fires if it is
61
+ due **after** the given clock and **at or before** the when clock, once each, in time
62
+ order. `when clock` needs `given clock`. Limits: 10,000 occurrences per advance, 1,000
63
+ facts per scenario. A scenario with given equal to when fires nothing.
64
+ - Command specifications that list reaction cascades (no false PLAY0285).
65
+ - In a `then` list after `when append`, only what followed the appended event.
66
+
67
+ ## Code attachments (what binds, what never does)
68
+
69
+ Inline fences (`csharp`, `typescript`, `react`, `html`, `sql`) and `file <path>` attach
70
+ code to an owner. Three kinds block binding (PLAY0268, V3 blocked, no specification runs):
71
+ the command `handler`, the `file` constraint (see below) and a query `performer`
72
+ ("uses delivery, filtering, scope, or implementation behavior outside the first ESM v1
73
+ vertical"). Everything else binds as an **opaque requirement** that needs a target to
74
+ execute: reducer transitions, rule predicates, command and concept code validation, policy
75
+ predicates and reaction effects. Reaction effects bind only when the trigger has no
76
+ `reads`; a trigger with `reads` plus a `file` or inline effect fails binding. Reaction
77
+ bodies still leave their owner non-executable.
78
+
79
+ - A `file` constraint **never binds**: PLAY0268 "file implementation is not admitted by
80
+ the executable model" (`SemanticModelBinder.Constraints.cs`). Chronicle file constraints
81
+ can only declare uniqueness: declare it with `unique ...`, and put other rules in command
82
+ validation or a `require` condition.
83
+
84
+ - A command `handler` **never binds**: PLAY0268 "Command '<n>' handler requires a
85
+ constrained implementation attachment." This holds with a `file`, with a fence, and with
86
+ `implementation` or `hint` (including a pending intent with no payload). `implementation`
87
+ and `hint` are valid only on command handlers and are authoring intent: no execution, lock
88
+ or confirmation.
89
+ - A handler therefore makes the slice non-executable and non-renderable: it is gap-fill
90
+ with the model as the contract.
91
+ - Stage 4.24 admits only pure reducer bodies (Roslyn allowlist, STAGE-ESM-019 and 022);
92
+ code validation (STAGE-ESM-005) and opaque policies (STAGE-ESM-015) are refused.
93
+ - The reference runner returns Unsupported for the opaque bodies that do bind (rule and
94
+ policy predicates, code validation, reducer transitions); a specification that needs one
95
+ never passes. Handlers, file constraints and query performers (and reaction effects on a trigger with
96
+ `reads`) are different: they leave the whole model unbound, so no specification runs at
97
+ all.
98
+
99
+ ## Refused (code, reason): fix, or record as a mode gap
100
+
101
+ | Construct | Code | Note |
102
+ | --- | --- | --- |
103
+ | `Automation` or `Translate` slice, `reaction`, `capture`, `trigger`; `given clock`, `when clock`, `when trigger`, `when capture` | PLAY0268 | **cratis-bundled compiler only**; messages in `versions.md` |
104
+ | Unquoted `import Other.Contract` | PLAY0268 | external contract import is not bound |
105
+ | `@pii` or `@sensitive` on any concept | PLAY0268 | "Concept '<n>' compliance attributes require portable data-subject semantics." Same message at 4.60.1 and 4.64.0. `@sensitive` has no verified portable meaning (Screenplay#384, open) |
106
+ | `query` returning a collection (`RM[]`), or without exactly one caller-supplied `by` | PLAY0268 | "must declare one caller-supplied 'by' argument" or "must return one optional read model" |
107
+ | `observable`, `filter`, `scoped to`, `performer` queries | PLAY0268 | "uses delivery, filtering, scope, or implementation behavior outside the first ESM v1 vertical." `observable` goes in the return position (`=> observable RM optional`); as a body line it is PLAY0048 |
108
+ | `contains` or `starts with` in conditions | PLAY0268 | equality and numeric ordering only |
109
+ | Date or DateTime comparison, `today` | PLAY0268 | no runtime date value |
110
+ | Rule on a nested path (`lines.qty all > 0`) | PLAY0268 | put the rule on the nested value's concept |
111
+ | `require` or `produces when` over a read-model path | PLAY0268 | needs decision-consistent reads (Screenplay#129) |
112
+ | `reads <View> ...` on a command | PLAY0271 (error) | legacy, cannot imply decision consistency |
113
+ | `concurrency` block on a command | PLAY0271 (error) | "concurrency metadata keeps its legacy meaning and cannot bind to ESM v1" |
114
+ | `handler` (see above) | PLAY0268 | gap-fill |
115
+ | `$context.tenant`, roles, claims, causation | PLAY0268 | no portable scalar counterpart |
116
+ | Arithmetic or raw expression in a `produces` mapping | PLAY0268 | |
117
+ | Template `` `${x}` `` or `$causedBy` in a projection | PLAY0268 | |
118
+ | More than one `every`/`all` on one projection level | PLAY0268 | Chronicle keeps only the last |
119
+ | `$eventContext.<path>` other than `eventSourceId` | blocked plan | binds, but execution refuses: "An event-context value other than the event source identity needs occurrence context that ESM v1 facts do not carry". `$context.occurred` in command `produces` is different and executes when the scenario has `given clock` |
120
+ | Projection-level `remove via join` | blocked plan | binds, but `UnsupportedProjectionBlock` blocks the whole reference execution plan: no specification in the application runs |
121
+ | `all` beside removals, children or nested on one level | blocked plan | binds; `UnsupportedProjectionBlock` |
122
+ | `join`, `children` or `remove via join` inside `nested` | blocked plan | binds; `UnsupportedProjectionBlock` |
123
+ | `$eventContext.occurred.Week` | PLAY0273 | derived value |
124
+ | Projection `parent p` where `p` is not on the child event | PLAY0273 | "Event property not found" |
125
+ | `generated` or `returns` (v8), operations or systems (v9), eventsource or stream (v10), `numbers exact` (v7) | PLAY0268 | syntax only; one such construct leaves the **whole** application without an executable model |
126
+ | Spec of a gated command or query without `given caller` | PLAY0389 | module and feature gates count |
127
+ | `given` or `then readmodel` missing the key property | PLAY0351 | key is the keyed query's `by` |
128
+ | When-less spec asserting events or errors | PLAY0352 | |
129
+ | `null` in command or event values | PLAY0350 | Chronicle semantics, not only a binder limit: an optional fact is a separate event (nullable event properties are CHR0012) |
130
+ | `for` with no unambiguous destination type | PLAY0273 | |
131
+
132
+ ## Not refused, but do not rely on it
133
+
134
+ - Plain `produces` without `for` binds (PLAY0478, information) but means allocation in the
135
+ ESM and "the identifier" in rendered Arc code. Always write `for`.
136
+ - A projection-level (root) `remove via join` binds, but the reference execution plan refuses it (`UnsupportedProjectionBlock`), so no specification in the application runs; Chronicle wires it as a child pull. See the blocked-plan rows above.
137
+ - A projection mapping to a property the read model does not declare, and an undeclared
138
+ event in `remove with` or a capture `append`: V1 does not report them; binding (V3) does,
139
+ with PLAY0273 (Screenplay v4.64.0 `BindMapping`, `LevelEvent`, `BindCaptureAppends`). A
140
+ declared read-model property that nothing maps is different: no tool reports it, so check
141
+ field lineage by hand.
142
+
143
+ ## Never do this to reach V3
144
+
145
+ Do not remove `@pii`, `@sensitive`, `authorize` or policies, list queries, automations or
146
+ rules a domain needs just to make binding pass. Report `V3 blocked: <codes>` and record the
147
+ slice in the gap list. A `@pii` or `@sensitive` attribute blocks V3 and rendering, and
148
+ `@pii` on an event-source identifier is rejected by Chronicle (CHR0034) in addition.