@cratis/pi 7.21.0 → 7.23.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 (81) hide show
  1. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +31 -15
  2. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +4 -3
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +13 -15
  4. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +4 -4
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +21 -0
  6. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +4 -2
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +7 -4
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +4 -4
  9. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +41 -38
  10. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +1 -1
  11. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/invocation-identity.md +84 -0
  12. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/refusals-and-redelivery.md +102 -0
  13. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +4 -2
  14. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +1 -1
  15. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +57 -44
  16. package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +154 -0
  17. package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +57 -0
  18. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +15 -13
  19. package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +80 -0
  20. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +23 -1
  21. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +8 -2
  22. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +19 -9
  23. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +6 -5
  25. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +10 -8
  26. package/package/corpus/skills/cratis-screenplay-event-modeling/references/naming-primitives.md +5 -3
  27. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +6 -5
  28. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +41 -49
  29. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +15 -5
  30. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +48 -8
  31. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +47 -42
  32. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +79 -15
  33. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +49 -11
  34. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +155 -14
  35. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +3 -3
  36. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +19 -7
  37. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
  38. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +11 -2
  39. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +3 -3
  40. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/completeness-self-check.md +1 -1
  41. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +1 -1
  42. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +17 -0
  43. package/package/corpus/skills/cratis-screenplay-read-surface/references/guarded-actions.md +79 -0
  44. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +11 -9
  45. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +6 -3
  46. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
  47. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +2 -2
  48. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +3 -2
  49. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +13 -2
  50. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +13 -3
  51. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +5 -3
  52. package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +2 -1
  53. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -3
  54. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +40 -0
  55. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +24 -16
  56. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +111 -0
  57. package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +5 -6
  58. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +22 -8
  59. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +8 -4
  60. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +10 -0
  61. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +13 -2
  62. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +3 -3
  63. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +2 -2
  64. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +44 -35
  65. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -3
  66. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +58 -2
  67. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +128 -10
  68. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +13 -1
  69. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +37 -13
  70. package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +10 -2
  71. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +23 -1
  72. package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +111 -27
  73. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +27 -6
  74. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +34 -16
  75. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +98 -136
  76. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +13 -5
  77. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +20 -0
  78. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +10 -6
  79. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +8 -1
  80. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +2 -2
  81. package/package.json +1 -1
@@ -37,14 +37,14 @@
37
37
  },
38
38
  {
39
39
  "kind": "skill-contains",
40
- "value": "case A or C today"
40
+ "value": "case A or C for rendering"
41
41
  },
42
42
  {
43
43
  "kind": "skill-contains",
44
44
  "value": "STAGE-ESM-026"
45
45
  },
46
46
  { "kind": "skill-contains", "value": "Generated command values and `returns` responses (ESM v7) bind and run" },
47
- { "kind": "skill-contains", "value": "tracked in Stage#201" },
47
+ { "kind": "skill-contains", "value": "STAGE-ESM-028`/`STAGE-ESM-029" },
48
48
  { "kind": "skill-contains", "value": "authored-UI parity" },
49
49
  { "kind": "skill-contains", "value": "responsible tool version" }
50
50
  ]
@@ -183,8 +183,9 @@ scope is reported as explicitly incomplete); V1 passes with the tool named in
183
183
  populated-then-removed spec.
184
184
  - V1 passes (standalone `screenplay` required when cascades are specified); report tool and
185
185
  version.
186
- - V4 is "not run: no route" unless a Screenplay reference route was actually executed (Stage's spec runner is target-engine evidence, never V4); V1/V3 do not prove specs
187
- pass. V5 is "not run" unless rendering was attempted; report admission, publication, build and
186
+ - Run V4 through standalone `screenplay test` or MCP `run-specifications`;
187
+ if not executed, report the actual host/input reason, not a blanket no-route
188
+ claim. Stage's runner is target-engine evidence, never V4; V1/V3 do not prove pass. V5 is "not run" unless rendering was attempted; report admission, publication, build and
188
189
  tests separately.
189
190
  - Match guarantees to evidence: `.play` outcomes, in-process Chronicle scenarios and real-kernel
190
191
  tests are not interchangeable (`references/chronicle-verification.md`).
@@ -3,7 +3,11 @@
3
3
  The subsets themselves (what binds, what renders) are owned by `cratis-screenplay-toolchain`
4
4
  (its executable and renderable subset references); version facts by its `references/versions.md`. This file
5
5
  says what that means for writing specs. A form outside the chosen mode is never deleted from a
6
- design model: keep it and record the gap.
6
+ design model: keep it and record the gap. The detailed Stage 4.24.x rows below
7
+ retain historical admission evidence; current pins are Screenplay 4.127.0 / CLI
8
+ 3.41.0. Run actual target admission instead of assuming old restrictions carry over.
9
+ Typed example/override forms: `cratis-screenplay-specifications`
10
+ `references/examples-and-routes.md`.
7
11
 
8
12
  | Form | design | executable | renderable |
9
13
  |---|---|---|---|
@@ -19,6 +23,10 @@ design model: keep it and record the gap.
19
23
  | Command spec listing reaction cascade events | yes (v6 semantics) | false PLAY0285 on a cratis before 3.28.2 bundle only; see SKILL.md "Version skew" | no (no reactions) |
20
24
  | `generated <name> = <value>` under `when`, `then returns` (ESM v7) | yes | yes on standalone Screenplay 4.68.0 or later; not on the 4.66.0 bundled in cratis 3.28.x (`PLAY0268`) | no (Stage does not render ESM v7) |
21
25
  | `then events in any order` | yes | yes | yes |
26
+ | Event `stream` / `no stream`, typed `for` and stream ids | yes | ESM v8 at 4.125.0 | CLI 3.41.0 refuses models above v7 before planning |
27
+ | Typed examples and overrides | yes | expanded and type-checked before binding; required fields remain required | depends on expanded contract, not fixture reuse |
28
+ | `given operation ... fails`, `then operation`, `then compensated` | yes | unadmitted PLAY0268 | gap-fill |
29
+ | Refusal branches, `when redelivered`, `then no events` | yes | unadmitted PLAY0268 | gap-fill |
22
30
  | Composite (JSON) values in specs | yes | yes | no |
23
31
  | Rules over dates or `today`, nested paths | spec them in design | rule does not bind: `recorded` | `recorded` |
24
32
  | Bodied rules, code policies | spec them | spec reported **unsupported**, never passed | no |
@@ -36,7 +44,10 @@ bundle is available). Mark each such spec in the coverage matrix as
36
44
  the projection's effective key (`cratis-screenplay-slice-design` `references/read-model-design.md`
37
45
  decision table). View specs assert through a keyed query.
38
46
  - Run V3 (binding-ready, per `cratis-screenplay-toolchain`); binding-only codes (PLAY0273/0350/0352/0388/0389) appear only there.
39
- - V4 (reference specs run) needs a runner route; otherwise report "V4 not run: no route". Unsupported is not passed.
47
+ - V4 runs through `screenplay test` or MCP `run-specifications`; record expected,
48
+ discovered/selected and passed/failed/unsupported counts. Unbound/unsupported
49
+ is not passed. Authoring-only refusal/redelivery/operation specs remain recorded
50
+ contracts; test them at the owning target after authorized gap-fill.
40
51
 
41
52
  ## Renderable mode
42
53
  - Specs use given events, a command `when`, and then events / readmodel / query / error /
@@ -65,8 +65,9 @@ report and the slice `description`, and continue.
65
65
  origin must be **reachable** (some screen, form, reaction or integration leads to the
66
66
  command) and **authorized** (the persona's policies satisfy every gate on module, feature
67
67
  and command). A command may have several origins; each must be real. A reaction's `invokes`
68
- has no caller, so a gated command it invokes is refused: design the trusted path, never
69
- delete the gate.
68
+ has no caller unless the reaction declares `runs as system role "<Role>"` (ESM v10), so a
69
+ gated command it invokes is refused: declare that trusted path with the role the gate
70
+ admits, never delete the gate.
70
71
  3. **Design the command** (`references/command-inventory.md`). Imperative business name for
71
72
  **one** decision (`ReassignLocker`, `CorrectLockerVolume`). A form verb (`Update`, `Edit`,
72
73
  `Save`, `Set`, `Change`, `Manage` + noun) means several decisions share a form: ask which
@@ -92,7 +93,16 @@ report and the slice `description`, and continue.
92
93
  `$context.occurred` or caller identity. No event-source id in the payload (it is the `for`);
93
94
  references to other instances are payload. No nullable property by default (a required value
94
95
  or a separate event). No PII on the identifier; one data subject per stream. Add a field only
95
- when something downstream needs it.
96
+ when something downstream needs it. At 4.127.0 personal values use bare `pii`,
97
+ operational secrets `secret`; declare processing use/basis/retention in `purpose`,
98
+ not a reason. An event-property `subject` may identify a different person from
99
+ the stream but is report-only, not runtime propagation. See command-surface
100
+ `references/compliance.md`.
101
+ Trace caller details to claims or a keyed single-result identity-source query
102
+ (built-in/claim/literal key, detail-independent effective gate, compatible result).
103
+ The `identity` block is authoring metadata; executable `$identity.<detail>` reads
104
+ remain PLAY0268. `scoped to` is opaque, not a detail reference; see command-surface
105
+ `references/context.md`.
96
106
  5. **Events or views?** For each value someone needs: was it decided or supplied (event), or
97
107
  can it be worked out from facts already recorded (view)? Test, anti-patterns and where the
98
108
  outputs of an automation go: `references/read-model-design.md` *Events or views*. Decided calculations (a quoted
@@ -118,9 +118,11 @@ not been asked the refusal questions.
118
118
  - Copying state into the command so `require` can read it, instead of `reads <View>`.
119
119
  - An origin that is neither reachable (no screen, form or reaction leads there) nor authorized
120
120
  for the persona who should act.
121
- - A reaction invoking a gated command: the invocation has no caller and is refused; design the
122
- trusted path (`cratis-screenplay-automations-and-translations`), never delete the gate.
121
+ - A reaction invoking a gated command without `runs as system role "<Role>"`: the invocation has
122
+ no caller and is refused; declare the trusted path with the role the gate admits
123
+ (`cratis-screenplay-automations-and-translations`), never delete the gate.
123
124
  - Refusals recorded as prose in the `description` with no layer and no spec row.
124
125
  - Personal data or secrets as command input: values are by default recorded in the causation chain, so treat them as permanent
125
126
  (retention can be configured in newer Chronicle; verify it, never audit secrets).
126
- Mark the concept `@pii` or record the need; never put `@pii` on the identifier's concept.
127
+ Mark concepts bare `pii` for personal data or `secret` for operational secrets,
128
+ never on the identifier; declare use/basis/retention in a purpose, not a reason.
@@ -9,7 +9,8 @@ domain consequence.
9
9
  - Does this command apply in every state and set most of the entity's fields? That is a form:
10
10
  which business reasons hide behind it? What does a person decide with each field?
11
11
  - Does a command input carry a secret or personal value (by default the causation chain keeps it; retention is configurable, verify it)?
12
- Mark the concept `@pii` or record the need for a not-audited marking.
12
+ Mark the concept bare `pii` for personal data or `secret` for an operational
13
+ secret; inspect declared purpose coverage, not just the reason. Never protect an identifier.
13
14
  - Does this optional event property hide two situations, or is it an optional detail?
14
15
  - Does an event exist for a derived condition? Only when a domain expert names it and something
15
16
  reacts to it; merge causes only when they mean the same to the business.
@@ -35,7 +35,8 @@ Command property values are, by default, recorded in the causation chain of the
35
35
  produce, so treat them as permanent. Newer Chronicle versions can omit causation properties
36
36
  (`CausationPropertyRetention.Omit`, Chronicle v19.32.0); rendered apps pin Chronicle 19.8.1.
37
37
  Verify the actual auditing and retention configuration before relying on omission, and never
38
- audit secrets. Never mark the identifier's
39
- concept `@pii`; use a surrogate `Uuid` identity and carry the personal value as a `@pii`
40
- property. Bearer tokens, magic links and signed URLs are never facts (record a keyed hash or
38
+ audit secrets. Classify personal values as bare `pii` and operational secrets as
39
+ `secret` on their concepts, never the identifier concept. Use a surrogate identity
40
+ and protected payload (PLAY0515). Processing use/basis/retention is a `purpose`,
41
+ not a reason; see command-surface `references/compliance.md`. Bearer tokens, magic links and signed URLs are never facts (record a keyed hash or
41
42
  reference).
@@ -62,6 +62,46 @@ For `worked-example.md`:
62
62
  | LockerBoard | LockerInstalled, LockerAssigned | InstallLocker, AssignLocker | |
63
63
  | RequestProgress | LockerRequested, LockerAssigned | RequestLocker, AssignLocker | |
64
64
 
65
+ ### Declare container dependencies
66
+
67
+ At Screenplay 4.125.0, modules and features may declare `depends on <Name>`, one
68
+ target per line. Use a bare sibling name or a qualified module/feature address.
69
+ Bare names resolve inside out: siblings, ancestor siblings, then root modules;
70
+ qualified names match an unambiguous trailing address. Ambiguity is `PLAY0198`.
71
+ Self, ancestor, descendant and unresolved targets warn with `PLAY0554`; repeats
72
+ keep the first resolved target and warn with `PLAY0555`.
73
+
74
+ Declarations accumulate on the same owner in ordinal file-path order, independent
75
+ of board import order. Layout expansion writes them only in the owner's file.
76
+ They are authoring metadata: no execution rule, implementation order, identity
77
+ or executable-model revision change.
78
+
79
+ Once a container declares dependencies, its own inventory must cover counted
80
+ explicit references leaving it, including descendants. Parent and child lists
81
+ are independent. Module targets cover all their features; feature targets cover
82
+ their descendants. `usesFactsFrom`, `reactsTo`, `decidesFrom`, `asks` and `shows`
83
+ count; specification-only and outside-context edges do not. `PLAY0552` warns on
84
+ uncovered producer modules; `PLAY0553` marks unused declarations and `PLAY0556`
85
+ mutual declarations as information. Ambiguous ownership is provisional, not proof
86
+ of an undeclared dependency. Inspect MCP `dependency-graph`'s `declarations` view.
87
+
88
+ Example: Payroll declares Timesheets; its Handover feature declares
89
+ Timesheets.Approval and sibling Runs. These are dependency inventories, not
90
+ actual references or execution dependencies:
91
+
92
+ ```screenplay
93
+ module Payroll
94
+ depends on Timesheets
95
+ feature Handover
96
+ depends on Timesheets.Approval
97
+ depends on Runs
98
+ feature Runs
99
+ module Timesheets
100
+ feature Approval
101
+ ```
102
+
103
+ Source: Screenplay `v4.125.0:Documentation/screenplay/slices.md` and `folders.md`.
104
+
65
105
  ## State-transition table (per entity)
66
106
 
67
107
  Rows are states (named after the fact that put the entity there); columns are commands. Each
@@ -37,15 +37,12 @@ The update follows `commands.md`, `events.md`, `types.md` and
37
37
  `specifications.md` at that main commit (after v4.52.0). This pass compiles the
38
38
  changed examples; it does not rerun the reference runner.
39
39
 
40
- **Which tool says what.** The standalone `screenplay` tool 4.68.0 admits ESM v1-v7.
41
- The `cratis` CLI 3.28.2 and 3.28.3 bundle Screenplay 4.66.0 (ESM v1-v6: generated fixtures and `then returns` report `PLAY0268`). Before `cratis` 3.28.2 the
42
- bundle was Screenplay 4.60.1, which admitted ESM v1-v5 only and reported a false
43
- `PLAY0285` on reaction cascades (see "Version skew" in [references/reactions-and-cascades.md](references/reactions-and-cascades.md)). Facts below marked **ESM v6**
44
- hold for Screenplay 4.61.0 and later: the standalone tool and `cratis` 3.28.2 or later. The full table is in `cratis-screenplay-toolchain`
45
- (`references/versions.md`; read it before choosing a compiler or interpreting version-dependent binding diagnostics). Neither tool runs specifications: `screenplay` and
46
- `cratis screenplay validate` parse and check consistency, the MCP server also binds,
47
- and spec outcomes come only from the reference runner as a library, Stage's
48
- specification runner or a rendered application's tests.
40
+ Current specification syntax follows Screenplay v4.125.0 `specifications.md`;
41
+ older probes in the table remain historical. Pins: `cratis-screenplay-toolchain`
42
+ `references/versions.md`. Compile commands check source, not reference execution.
43
+ Use `screenplay test` or MCP `run-specifications` for V4; Stage/target tests are
44
+ separate evidence. Unsupported/unbound is never a pass. Typed examples and
45
+ route assertions are in [examples and routes](references/examples-and-routes.md).
49
46
 
50
47
  Checked against the Screenplay repository at tag `v4.31.0` (commit `355dffb`):
51
48
  `Documentation/screenplay/{specifications,policies,constraints,readmodels,diagnostics}.md`.
@@ -95,9 +92,8 @@ target has one normalized behavior to match.
95
92
  rejects, the earlier accepted facts and their projections remain.
96
93
 
97
94
  Unsupported is not passed. Report it as "needs a target", not as green. "Specified"
98
- and "bound" are never "passing": no command-line tool runs these specifications, so a
99
- pass is claimed only from the reference runner, Stage's specification runner or a
100
- rendered application's tests, and named as such.
95
+ and "bound" are never "passing": run the reference CLI/MCP route or the owning
96
+ target tests, and name the engine, version and expected/discovered selection.
101
97
 
102
98
  ## The vocabulary
103
99
 
@@ -184,7 +180,7 @@ Read [references/worked-example.md](references/worked-example.md) when writing o
184
180
 
185
181
  ## Generated fixtures and return expectations (ESM v7)
186
182
 
187
- Standalone `screenplay` 4.68.0 or later binds and runs generated fixtures (`generated <name> = <value>`, `for` beneath `when`) and `then returns`; the cratis CLI 3.28.3 does not. If execution reaches generation without every generated value supplied, the run is unsupported and never passes.
183
+ Current standalone and bundled compilers bind generated fixtures (`generated <name> = <value>`, `for` beneath `when`) and `then returns` as ESM v7. If execution reaches generation without every generated value supplied, the run is unsupported and never passes.
188
184
  Read [references/generated-fixtures.md](references/generated-fixtures.md) when writing generated-value fixtures or scalar and record return expectations for a command.
189
185
 
190
186
  ## Actions beyond commands
@@ -197,6 +193,18 @@ Read [references/actions-beyond-commands.md](references/actions-beyond-commands.
197
193
  From ESM v6 every action sets reactions off and `then` events compare every new fact, the action's and the reactions'. A specification whose action is a command goes in the slice that declares the command. A false `PLAY0285` on a cascade under `cratis` before 3.28.2 is tool skew, not a modeling error: never delete the `then` line to silence it.
198
194
  Read [references/reactions-and-cascades.md](references/reactions-and-cascades.md) when a specification's expected events include what a reaction appends, when a cascade, clock tick or invoked command is involved, or when `cratis` reports `PLAY0285` on a model that `screenplay` accepts (it holds the "Version skew: cascades and the false `PLAY0285` (cratis before 3.28.2)" section).
199
195
 
196
+ ## Reusable fixtures, routes and recovery intent
197
+
198
+ Use typed `example` declarations for repeated event/command/read-model values;
199
+ step overrides keep the action/outcome visible and carry authored/example/override
200
+ provenance. Event `stream`/`no stream` assertions bind as ESM v8; typed `for` and
201
+ stream ids are not guessed. Read [examples and routes](references/examples-and-routes.md).
202
+
203
+ `given operation ... fails`, `then operation` and `then compensated` describe
204
+ future external-work behavior. Reaction refusal branches, `when redelivered`
205
+ and `then no events` are also authoring-only: compile them, but report their
206
+ PLAY0268 binding refusal instead of an executed result. Preserve the contract.
207
+
200
208
  ## Rejections and denials say different things
201
209
 
202
210
  `then error "<message>"` says **rejected, for this reason** — pin it when the
@@ -252,9 +260,9 @@ For view specifications:
252
260
 
253
261
  ## Verify
254
262
 
255
- - [ ] `screenplay <model> --warnaserror` reports zero errors and zero warnings
256
- (standalone 4.68.0 or `cratis` 3.28.2 or later, bundling 4.66.0; under `cratis` before 3.28.2 expect the false
257
- `PLAY0285` on reaction cascades and record that it is skew).
263
+ - [ ] Validate the complete root with warnings as errors, naming tool/version.
264
+ Current standalone pin: 4.127.0. Run specification examples through
265
+ `screenplay test`; expected unadmitted syntax reports unbound, not passed.
258
266
  - [ ] Executable diagnostics are clean too: `PLAY0350`, `PLAY0352`, `PLAY0388`,
259
267
  `PLAY0389` and `PLAY0273` are only reported at binding.
260
268
  - [ ] Every slice has at least one boundary specification.
@@ -0,0 +1,111 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Typed examples, overrides and event routes
5
+
6
+ ## Contents
7
+
8
+ - Typed examples
9
+ - Effective values
10
+ - Event routes
11
+ - Operation and recovery intent
12
+
13
+ ## Typed examples
14
+
15
+ `example <Name> : <EventOrCommandOrReadModel>` declares a possibly partial typed
16
+ fixture at document/module/feature/slice scope. Its underlying type resolves in
17
+ the declaration scope, not the use scope. It can state properties, description,
18
+ `for` and command generated fixtures, not callers/clocks or a whole scenario.
19
+ Examples share the type namespace and use the current event generation. They
20
+ cannot inherit from examples or serve as query results/returns/trigger/capture
21
+ fixtures. They are specification data, not operational `seed` events.
22
+
23
+ This complete example compiled and its two reference scenarios passed on 4.125.0:
24
+
25
+ ```screenplay
26
+ concept ProjectId : Uuid
27
+ module Projects
28
+ feature Registration
29
+ example DefaultProject : RegisterProject
30
+ name = "Default"
31
+ slice StateChange Register
32
+ command RegisterProject
33
+ projectId ProjectId identifier
34
+ name String
35
+ produces event ProjectRegistered
36
+ name String = name
37
+ specification RegisteringTheDefault
38
+ when DefaultProject
39
+ projectId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
40
+ then ProjectRegistered
41
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
42
+ name = "Default"
43
+ specification OverridingTheName
44
+ when DefaultProject name = "Override"
45
+ projectId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
46
+ then ProjectRegistered
47
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
48
+ name = "Override"
49
+ ```
50
+
51
+ ## Effective values
52
+
53
+ An example occupies the ordinary name slot in given/event, given readmodel,
54
+ when command, when append, then event or then readmodel. One assignment may be
55
+ inline after the name; more stay indented. There is **no with keyword**.
56
+ Step values override example values by property name; objects/lists replace
57
+ whole values, never recursively merge. Indented `for` replaces its destination;
58
+ generated fixtures merge by name. A new step-only value is authored, not an
59
+ override. Each step/declaration assigns a property once (PLAY0519); malformed
60
+ headers are PLAY0518.
61
+
62
+ After expansion, required given-event/read-model, command, append and expected
63
+ event fields must be complete (binding PLAY0524); examples can remain partial.
64
+ Read-model assertions retain subset matching unless `exactly` is authored.
65
+ Even unused example values or values overridden at every use are type-checked.
66
+ No default fixture values are invented. A command action must belong to the
67
+ specification's own slice even when a qualified example resolves elsewhere.
68
+
69
+ MCP `find-fixtures` reports effective authored/example/override origins and
70
+ replaced values. Source-bound runner failures retain that provenance; canonical
71
+ ESM contains merged values only, equivalent to hand-expansion. ESM-only runners
72
+ cannot reconstruct source origins.
73
+
74
+ ## Event routes
75
+
76
+ Event occurrences in `given`, `when append` and `then` accept `stream Source.Stream`
77
+ with nested scalar `streamId = <literal>` or a complete composite part block.
78
+ These select ESM v8 and reference-execute at 4.125.0; the complete checked model
79
+ is in toolchain `references/sources-and-streams.md`. Command actions take their
80
+ route from the command declaration, never the fixture.
81
+
82
+ Routed history/appends need typed concrete `for`; routed expectations may omit
83
+ it. `then ... no stream` expects no route; no route in a then is a wildcard.
84
+ `no stream` is invalid on given/appends. Event examples can supply routes, but
85
+ steps replace the entire route, independently of `for`; an inherited route
86
+ cannot be changed back to a wildcard. Literal compatibility/route contradiction
87
+ checks use resolved source/stream types, not guessed text (PLAY0547–PLAY0551).
88
+ At Screenplay 4.127.0, route literals must be nonempty, well-formed NFC text
89
+ (refused, not normalized); Double integer ids are within ±(2^53−1), while Exact
90
+ has no such bound but remains unadmitted. Invalid specification routes report
91
+ PLAY0549. Contradictions compare canonical scalar ids and every composite part,
92
+ so UUID casing is immaterial. Composite mappings supply each named part once,
93
+ using literals only; encoding escapes `%`/`|` and preserves declaration order.
94
+ Source: v4.127.0 `event-sources.md`, `specifications.md`, `diagnostics.md`.
95
+
96
+ CLI 3.41.0 rendering rejects versions above v7 before planning, even though
97
+ source compilation and reference routing pass.
98
+
99
+ ## Operation and recovery intent
100
+
101
+ Operation failure/request/compensation forms are authoring-only (PLAY0268):
102
+ `given operation <Name> fails`, `then operation <Name>` with a partial input
103
+ subset, and leaf `then compensated <Name>`. See command-surface
104
+ `references/operations.md` for the complete checked authoring fixture.
105
+
106
+ Refusal selectors, redelivery to one observer and `then no events` likewise
107
+ remain unadmitted; they are not executed append scenarios. Forms, matching,
108
+ acknowledgement and their whole-model refusal boundary are in
109
+ captures-and-reactions `references/refusals-and-redelivery.md`.
110
+
111
+ Authority: Screenplay `v4.125.0:Documentation/screenplay/specifications.md`.
@@ -42,12 +42,11 @@ module Collections
42
42
  - A specification whose action is a command goes in the slice that declares that
43
43
  command, here `SendInvoice`, not in the `Automation` slice that reacts: a command
44
44
  from another slice is `PLAY0273` "command is unresolved in its slice" at binding.
45
- - A command a reaction `invokes` runs through its full pipeline **with no caller**.
46
- A command that needs one rejects, and that rejection ends the scenario. Each
47
- invoked command is atomic; the cascade is not, so earlier accepted facts stay.
48
- There is no syntax for an identity (Screenplay#383). See
49
- `cratis-screenplay-automations-and-translations` and
50
- `cratis-screenplay-captures-and-reactions`.
45
+ - A reaction invocation without a declared actor has no caller and a gated
46
+ command denies. At 4.125.0 reaction `runs as system role "<Role>"` supplies the
47
+ authenticated system actor (ESM v10); `given caller` does not. Each command is
48
+ atomic, not the cascade. Checked actor scenario and CLI/Stage limitations:
49
+ captures-and-reactions `references/invocation-identity.md`.
51
50
  - The clock is UTC and exact. An `every` or `at` occurrence fires once when it is
52
51
  due after `given clock` and at or before `when clock`; `when clock` needs
53
52
  `given clock`, so the same instant twice fires nothing.
@@ -52,7 +52,7 @@ Chronicle issues before relying on a constraint in a later release.
52
52
  themselves (`cratis-screenplay-scenario-coverage`), Chronicle C# mechanics
53
53
  (`cratis-chronicle-event-modeling`). See Route near misses.
54
54
  - Model-first applies: when an accepted model covers the scope, change the model and its
55
- specifications, not code. Do not weaken authorization, `@pii` or rules to make a model compile.
55
+ specifications, not code. Do not weaken authorization, `pii` or rules to make a model compile.
56
56
 
57
57
  ## Interview phase
58
58
  **Skip if** the user or the model already states the stream identities, who owns each module, how
@@ -87,10 +87,10 @@ option, mark it `ASSUMED` in the slice or module `description` and in the sessio
87
87
  invariant consequences, not names or length. For Chronicle keep event-source identity,
88
88
  namespace, process-stream routing and concurrency scope apart
89
89
  (`references/chronicle-boundaries.md`). Declared `eventsource`/`stream`/`streamId` and
90
- command routes can be authored and validated but not bound, run or rendered today
91
- (`PLAY0268`, `STAGE-ESM-016`): keep them as intent and hand-write the routing
92
- (`cratis-screenplay-toolchain` `references/sources-and-streams.md`); no supported ESM version
93
- admits them. A `generated identifier` (ESM v7, standalone 4.68.0; not rendered by Stage yet) is
90
+ command/specification routes bind and reference-execute as ESM v8 on 4.125.0.
91
+ CLI 3.41.0 rendering admits through v7 only (CLI-RENDER-004); keep the routing
92
+ contract and gap-fill its target realization. Forms/boundaries:
93
+ toolchain `references/sources-and-streams.md`. A `generated identifier` (ESM v7, standalone 4.68.0; not rendered by Stage yet) is
94
94
  generated fresh on every acceptance: it is not a retry identity, and generated values give no
95
95
  idempotency, retry or deduplication guarantee. When a retry must find the same stream, the caller
96
96
  supplies the identifier before the first attempt.
@@ -119,8 +119,13 @@ option, mark it `ASSUMED` in the slice or module `description` and in the sessio
119
119
  is a fact the business recognises. Different meanings get different events, not a flag with
120
120
  nullable siblings. Event properties are required by default (CHR0012, PLAY0350): an optional
121
121
  detail is a separate event, and any deviation is justified in the description. One data
122
- subject per event and stream; never personal data, a secret, or a `@pii` or `@sensitive` concept as the identifier (CHR0034, CHR0052):
123
- use a surrogate `Uuid` and a `@pii` or `@sensitive` property.
122
+ subject per event; never personal data, a secret, or a `pii`/`secret` concept as
123
+ identifier or subject (CHR0034, CHR0052, PLAY0515/0592). Use a surrogate identity
124
+ and protected payload. A stream identity and an event's data subject may differ:
125
+ trailing event-property `subject` records that lineage but is report-only
126
+ (PLAY0270), not runtime propagation or generated C# `[Subject]`. Without a
127
+ supplied subject, the runtime defaults to the event source; see command-surface
128
+ `references/compliance.md` for allowed types and the policy/encryption distinction.
124
129
  5. **Plan evolution** with `references/evolution.md`: classify each event change (additive,
125
130
  meaning change, rename, removal, split or merge) and write its compatibility scenarios before
126
131
  editing. Renames and other identity-affecting edits are made by the identity owner (the
@@ -148,7 +153,16 @@ option, mark it `ASSUMED` in the slice or module `description` and in the sessio
148
153
  block compiles but is PLAY0271 at binding. Keep both when they state real intent; they are not
149
154
  protection. `description` text never reaches rendered code: a rule that lives only in prose is
150
155
  unenforced there.
151
- - `@pii` and `@sensitive` block binding (PLAY0268). Never remove them to pass a tool.
156
+ - `pii` and `secret` block binding (PLAY0268); legacy markers are deprecated
157
+ (PLAY0565). Never remove protection to pass a tool. PLAY0515 also refuses
158
+ scalar/composite stream-id types and route mapping sources, including nested paths.
159
+ - At 4.127.0 stream-id literals must be nonempty, well-formed NFC text (refused,
160
+ not normalized); integer ids in Double mode stay within ±(2^53−1). Exact mode
161
+ has no such bound but is unadmitted. PLAY0504 is an error for route/destination
162
+ nominal type mismatch. Composite ids use at least two named scalar parts,
163
+ complete named mappings and canonical comparison, not guessed legacy splits.
164
+ Stored key-schema changes require a new stream identity or migration; see
165
+ toolchain `references/sources-and-streams.md`.
152
166
  - Chronicle (open at v19.32.0): the SQL and InMemory providers do not settle unique claims
153
167
  (#3744); index updates run after commit and may fail silently (#4123); composite values can
154
168
  collide on the separator (#4131). A declared constraint is a declaration, not a runtime test.
@@ -42,10 +42,14 @@ protection: keep the invariant and its race outcome as explicit target requireme
42
42
  A namespace scopes event positions, claims, observer progress and encryption keys. State
43
43
  whether uniqueness and completion are per tenant or genuinely cross-tenant.
44
44
 
45
- Decide the data subject before the event and view shape. One data subject per event and per
46
- stream; one per read-model instance. Never put PII on the event-source id and never mark the
47
- identifier's concept `@pii` or `@sensitive`: Chronicle cannot encrypt a source id (analyzers CHR0034 and CHR0052; Screenplay PLAY0515 reports it from 4.69.1 for `@pii` and 4.84.1 for `@sensitive`, not on the pinned tools). Use a surrogate `Uuid`
48
- identity and carry the value as a `@pii` property (personal data) or a `@sensitive` property (operational secret). Bearer tokens, magic links and
45
+ Decide the data subject before the event/view shape: one person per event or
46
+ read-model instance, not necessarily the stream's identity. At Screenplay 4.127.0
47
+ trailing event `subject` is report-only lineage, not runtime propagation or C#
48
+ `[Subject]`; read-model marks remain unsupported. Use bare `pii` for personal
49
+ values and `secret` for operational secrets on concepts, never on identities or
50
+ subjects. Current PLAY0515 is a source error, including destinations, stream-id
51
+ parts and nested route sources (Chronicle CHR0034/0052 likewise reject protected
52
+ source ids). Use a surrogate identity and protected payload. Bearer tokens, magic links and
49
53
  signed URLs are never facts; record a keyed hash or a reference.
50
54
 
51
55
  Redaction (payload replacement keeping the sequence slot) and crypto-erasure serve compliance
@@ -16,6 +16,16 @@
16
16
  Pins: Screenplay v4.66.0, Chronicle v19.32.0, Arc v22.50.5, Stage v4.24.2 (table in `versions.md` of
17
17
  `cratis-screenplay-toolchain`).
18
18
 
19
+ Current routing identity checks (4.127.0): PLAY0515 refuses personal/secret
20
+ concepts in stream-id types, composite parts and route sources, including nested
21
+ paths. Composite keys require every named scalar part, not a legacy separator
22
+ split. Text must be well-formed, nonempty NFC and Double integer ids bounded by
23
+ ±(2^53−1); PLAY0504 is an error for routed nominal destination-type mismatch.
24
+ Canonical specification comparisons preserve part order and treat UUID case
25
+ variants as equal. Key-schema evolution for stored events requires a new stream
26
+ identity or migration. These checks do not protect command decision reads.
27
+ Details: toolchain `references/sources-and-streams.md`.
28
+
19
29
  ## 1. Invariant table (fill before writing constraints)
20
30
  | # | Rule (business words) | Data it needs | Decided atomically where | Screenplay construct | Status | Race / retry outcome |
21
31
  |---|---|---|---|---|---|---|
@@ -20,6 +20,15 @@ A stream in Screenplay is the event source a production lands on: `identifier` o
20
20
  command, `for <identifier>` on each `produces`, `$eventSourceId` in projections, `for "<id>"`
21
21
  in specifications. Choosing the identifier *is* choosing the stream.
22
22
 
23
+ Composite stream keys (Screenplay 4.127.0) declare `streamId` with two or more
24
+ named scalar parts and map every part on routes (specification parts are literals).
25
+ Scalar forms remain valid. Text is nonempty, well-formed NFC; Double integer ids
26
+ stay within ±(2^53−1). Protected concepts cannot be key types/parts or mapping
27
+ sources (PLAY0515); choose surrogate keys and keep protection in payloads.
28
+ Canonical encoding formats parts, escapes `%`/`|`, and joins in declaration order;
29
+ never split hand-joined legacy text by guesswork. A stored key-schema change needs
30
+ a new stream identity or migration. See toolchain `references/sources-and-streams.md`.
31
+
23
32
  ## Identity and event-membership review
24
33
  Start from the business instance, then choose its representation. A generated id can name a
25
34
  real instance; a readable constant can hide a collection. Write one sentence per identity
@@ -205,8 +214,10 @@ Ask for each stream:
205
214
  Some event stores decide consistency by a query over tagged events instead of one stream
206
215
  (often called dynamic consistency boundaries). Chronicle's concurrency scopes can narrow a
207
216
  check to event types, source type or stream (`concurrency` block, Screenplay
208
- `commands.md`), and Screenplay has syntax-only event-source/stream declarations (not admitted by any supported ESM version;
209
- `event-sources.md`). None of this binds on either compiler (`versions.md` in `cratis-screenplay-toolchain`). Model the stream by business
217
+ `commands.md`). Legacy concurrency metadata still fails binding (PLAY0271),
218
+ but sources/streams/routes bind and reference-execute as ESM v8 on 4.125.0.
219
+ Route admission does not make a view read protected. CLI 3.41.0's render boundary
220
+ is v7; see toolchain `references/versions.md`. Model the stream by business
210
221
  identity; when a rule truly needs a cross-stream decision, record it (see
211
222
  `consistency-and-concurrency.md`) rather than inventing a construct.
212
223
 
@@ -5,7 +5,7 @@ cross-stream references as payload, three kinds of uniqueness constraint, a stat
5
5
  rule recorded as **NOT enforced in the model today**, a declared `concurrency` scope, and an
6
6
  active-state view with removal. Read it with `consistency-and-concurrency.md` (sections 1-4).
7
7
 
8
- The model compiles (V1, warnings as errors) but is not binding-ready by design: the `@pii`
8
+ The model compiles at 4.127.0 (V1, warnings as errors) but is not binding-ready by design: the `pii`
9
9
  concept fails binding (PLAY0268), `reads` and the `concurrency` block are PLAY0271, and
10
10
  `require` over a view is PLAY0268. Keep those lines: they state real intent.
11
11
 
@@ -14,7 +14,7 @@ concept fails binding (PLAY0268), `reads` and the `concurrency` block are PLAY02
14
14
  // Shows: one business identity per stream, cross-stream references as payload, uniqueness
15
15
  // constraints (single, composite with release, unique event), a recorded state-dependent rule
16
16
  // that Screenplay cannot enforce, a declared concurrency scope, and an active-state view with removal.
17
- // Not executable on either tool (probed): the @pii concept fails binding (PLAY0268), the
17
+ // Historical binding probes refused compliance; the pii concept still fails binding (PLAY0268), the
18
18
  // concurrency block and `reads` are PLAY0271, `require` over a view is PLAY0268. Keep them: they state
19
19
  // real intent. The capacity rule is NOT enforced in the model today (see the slice description).
20
20
 
@@ -23,7 +23,7 @@ domain Acme.Academy
23
23
  concept MemberId : Uuid // event source id of one member stream
24
24
  concept CourseId : Uuid // event source id of one course stream
25
25
  concept EnrolmentId : Uuid // event source id of one enrolment stream
26
- concept Email : String @pii
26
+ concept Email : String pii
27
27
  pii reason "Identifies a person"
28
28
  validate
29
29
  not empty message "An email is required"
@@ -12,9 +12,9 @@
12
12
  { "kind": "skill-contains", "value": "CHR0034" },
13
13
  { "kind": "skill-contains", "value": "No calculated events" },
14
14
  { "kind": "skill-contains", "value": "decision tree and red flags" },
15
- { "kind": "skill-contains", "value": "not bound, run or rendered" },
15
+ { "kind": "skill-contains", "value": "bind and reference-execute as ESM v8" },
16
16
  { "kind": "skill-contains", "value": "STAGE-ESM-026" },
17
17
  { "kind": "skill-contains", "value": "generated values give no\n idempotency, retry or deduplication guarantee" },
18
- { "kind": "skill-contains", "value": "no supported ESM version\n admits them" }
18
+ { "kind": "skill-contains", "value": "CLI-RENDER-004" }
19
19
  ]
20
20
  }