@cratis/pi 7.23.0 → 7.25.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 (116) hide show
  1. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
  2. package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +5 -5
  3. package/package/corpus/skills/cratis-application-slice-conformance/verification.json +3 -0
  4. package/package/corpus/skills/cratis-arc-react-page/verification.json +14 -0
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/assets/pending-certificates.play +10 -0
  6. package/package/corpus/skills/cratis-screenplay-automations-and-translations/assets/retry-sweep.play +11 -0
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +3 -3
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +1 -1
  9. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +1 -1
  10. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +1 -1
  11. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -3
  12. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +3 -3
  13. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +1 -1
  14. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +1 -0
  15. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +1 -1
  16. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/refusals-and-redelivery.md +1 -1
  17. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +1 -0
  18. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +5 -5
  19. package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +2 -2
  20. package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +1 -1
  21. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +1 -1
  22. package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +1 -1
  23. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +1 -0
  24. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +6 -5
  25. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +1 -1
  26. package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +5 -4
  27. package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +1 -1
  28. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +1 -1
  29. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +7 -4
  30. package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +8 -7
  31. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +2 -2
  32. package/package/corpus/skills/cratis-screenplay-discovery/verification.json +1 -0
  33. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +10 -0
  34. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +3 -4
  35. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +1 -0
  36. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +1 -1
  37. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +1 -1
  38. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +1 -1
  39. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +4 -4
  40. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
  41. package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +1 -0
  42. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -4
  43. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +14 -6
  44. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +71 -8
  45. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +1 -0
  46. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +15 -6
  47. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
  48. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +10 -9
  49. package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +5 -1
  50. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +2 -1
  51. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +2 -2
  52. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +7 -5
  53. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +4 -4
  54. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +1 -1
  55. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +24 -19
  56. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +1 -1
  57. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +4 -2
  58. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  59. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +15 -9
  60. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +1 -0
  61. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +6 -6
  62. package/package/corpus/skills/cratis-screenplay-projections/references/pdl-grammar.md +7 -7
  63. package/package/corpus/skills/cratis-screenplay-projections/verification.json +1 -0
  64. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +10 -7
  65. package/package/corpus/skills/cratis-screenplay-read-surface/references/guarded-actions.md +4 -0
  66. package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +1 -0
  67. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +4 -3
  68. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +1 -1
  69. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +3 -3
  70. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +1 -0
  71. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +25 -9
  72. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +1 -1
  73. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +1 -1
  74. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +6 -1
  75. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +7 -4
  76. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +7 -7
  77. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +1 -1
  78. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +1 -1
  79. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +2 -1
  80. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +12 -7
  81. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -3
  82. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -2
  83. package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +87 -0
  84. package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +1 -1
  85. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -2
  86. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +8 -8
  87. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -4
  88. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +10 -4
  89. package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +1 -0
  90. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +22 -5
  91. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +59 -1
  92. package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +117 -0
  93. package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +1 -1
  94. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +2 -1
  95. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +14 -13
  96. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +3 -3
  97. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +3 -2
  98. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +14 -11
  99. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +2 -2
  100. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +1 -1
  101. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +1 -0
  102. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +1 -1
  103. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +49 -0
  104. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +6 -3
  105. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +4 -4
  106. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +10 -0
  107. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -0
  108. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +11 -9
  109. package/package/corpus/skills/cratis-screenplay-ui-composition/references/guarded-interactions.md +71 -0
  110. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +6 -6
  111. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +1 -0
  112. package/package/corpus/skills/cratis-specification-by-example/verification.json +14 -0
  113. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +5 -2
  114. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +17 -6
  115. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +2 -1
  116. package/package.json +1 -1
@@ -1,16 +1,21 @@
1
- # Feature reasoning descriptions
1
+ # Feature reasoning documentation
2
2
 
3
- Durable rationale goes in `description` text (it survives canonical printing; `//` comments do
4
- not), only for a real "why". Written as the last step of P3, once the feature's model and
5
- specifications are complete, describing the finished shape, for features with real decisions. A
6
- simple feature needs one or two sentences or nothing. P4 only checks that they exist; if one is
7
- missing, or the self-check forces a model change, return to a modeling batch, author it, and
8
- rerun V1 on the changed revision.
3
+ Use `description` for a short summary; durable rationale goes in a nonempty fenced
4
+ Markdown `documentation` block, only for a real "why". Write feature reasoning as
5
+ the last step of P3, once the model and specifications are complete, describing the
6
+ finished shape. A simple feature needs one or two sentences or nothing. P4 checks
7
+ that substantive decisions have their reasoning; if missing, or a self-check forces
8
+ a model change, return to a modeling batch, author it and rerun V1 on that revision.
9
9
 
10
- Descriptions never reach rendered code (Stage#178) and are not part of the canonical semantic
11
- revision (`modelRevision`), so editing one does not change it; they do change the source identity
12
- (`verdicts-and-modes.md`). Model the rule first: a rule
13
- that exists only in a description is unenforced in rendered scope.
10
+ Screenplay v4.127.0 `slices.md` accepts one `documentation` block directly on a
11
+ module, feature, slice, command, event, read model or reaction (not under its trigger).
12
+ Use a `markdown` fence; empty, malformed or repeated blocks report PLAY0558, with
13
+ PLAY0477 retained for events. Specifications accept `description`, not documentation;
14
+ put their longer reasoning on the owning slice. Projections/screens do not accept it.
15
+ Canonical printing retains documentation on its owner. It is report-only (PLAY0270),
16
+ absent from executable bytes and `modelRevision`; edits change source identity
17
+ (`verdicts-and-modes.md`). Neither description nor documentation is rendered as code
18
+ (Stage#178): model the rule first, never treat prose as enforcement.
14
19
 
15
20
  Cover, briefly and only where real:
16
21
  1. Scope: the business process and the identities its streams are keyed by.
@@ -24,22 +29,22 @@ Cover, briefly and only where real:
24
29
  6. Integration and capability gaps, each substantive one (outside facts, cross-feature or
25
30
  cross-module dependencies, mode gaps) as: the finding, the viable resolutions, and the
26
31
  open question or decision that records the choice (`Qn <address>`, or the decision in
27
- STATE.md), so the description and the question agree.
32
+ STATE.md), so the documentation and the question agree.
28
33
  7. A closing line for a feature with real decisions: what is covered (declaration kinds and
29
34
  the specification matrix in words, not a counter that goes stale). Review results and
30
- verdicts are never written into a description (it is authored before review and would change
35
+ verdicts are never written into documentation (it is authored before review and would change
31
36
  the reviewed source identity); they live in STATE.md and the packet.
32
37
 
33
38
  Write for the next person or session who opens the model cold, not for whoever just built it.
34
39
  Add a note **at any phase**, at the element it applies to, when an assumption fills a gap the
35
40
  brief left open, an alternative was rejected, or a constraint is not obvious; never as routine
36
- narration of what a step did. If a feature's story is genuinely simple, say so briefly rather
37
- than padding; where real design decisions sit behind it, the description is how they survive
38
- the session that made them.
41
+ narration of what a step did. Complete the feature's reasoning at the end of P3.
42
+ If a feature's story is genuinely simple, say so briefly rather than padding; where real
43
+ decisions sit behind it, documentation preserves why they were made.
39
44
 
40
- Slice, command, event and read-model descriptions: one sentence per genuine decision at that
41
- element. Counts, verdicts and session notes belong in STATE.md, never in the model.
45
+ Slice, command, event, read-model and reaction documentation: one sentence per genuine
46
+ decision at that element. Counts, verdicts and session notes belong in STATE.md, never in the model.
42
47
 
43
48
  ## Worked example
44
- `worked-example.md` shows a feature description carrying items 1-3, a constraint instead of a
49
+ `worked-example.md` shows feature documentation carrying items 1-3, a constraint instead of a
45
50
  second event type, and a decided rejection as a specification.
@@ -58,5 +58,5 @@ given for a named target. Approval is not repeated for the same scope.
58
58
 
59
59
  ## Unblocking
60
60
  A scope leaves `blocked` only when its question is answered; record the answer as a decision in
61
- STATE.md and, when durable, in the model `description`. Re-blocking a blocked scope is a no-op.
61
+ STATE.md and, when durable, in the model's fenced `documentation`. Re-blocking a blocked scope is a no-op.
62
62
  Blocked delivery scopes are reported in the packet; the main session creates any issue.
@@ -210,5 +210,7 @@ skill):
210
210
  - Never remove `pii`, `secret`, authorization, date or state-dependent rules to reach V3 or
211
211
  V5. Report blocked execution.
212
212
  - Narrowing the mode is the user's decision; widening back to design is always allowed.
213
- - Roadmap items that would change verdicts (a spec runner in the compiler tool, a lineage and
214
- completeness report) stay "not available" until the toolchain skill lists them as released.
213
+ - Never assume a roadmap item shipped. Current `screenplay test`, MCP
214
+ `run-specifications`, obligations/smells and opt-in completeness are released
215
+ at the toolchain pin; they do not prove full field lineage or target behavior.
216
+ Check `cratis-screenplay-toolchain` before changing a verdict.
@@ -21,7 +21,7 @@ speaks in them; never model board mechanics (lanes, node ids, positions).
21
21
  | Storyline (ordered beats) | a **family** of specifications sharing example data, each one transition (no storyline syntax at the verified Screenplay v4.66.0) | several spec classes | specifications |
22
22
  | Field validation | concept `validate` (every use) / command `validate`, `require` | `ConceptValidator<T>` / `CommandValidator<T>` | command validation |
23
23
  | Role permission ("Cannot") | `policy` + `authorize` + `then denied` spec; ownership via `claim ... matches subject` | `[Authorize(Policy)]`, generated policies | authorization |
24
- | Precondition on stream state | `reads` + `require` as stated intent, not enforced at the verified Screenplay v4.66.0 (target: Arc `[ProtectedDecision]` + `DecisionRead<T>`, or Chronicle DCB; `[ProtectedDecision]` is not available in Stage-rendered apps) | decision over a guarded read | command validation |
24
+ | Precondition on stream state | `reads` + `require` as stated intent, not enforced at the verified Screenplay v4.66.0 (target: Arc `[ProtectedDecision]` + `DecisionRead<T>`, or Chronicle DCB; APIs available to gap-fill in Stage 4.51.3's Arc 22.50.5/Chronicle 19.32.0, not emitted protection) | decision over a guarded read | command validation |
25
25
  | Generated id (`derived:uuid4()`) | `generated` (authorable, not executable) | id supplied before `Handle()` | commands |
26
26
  | External system / outbound call | `Translate` slice (inbound); `system`/`operation` (authorable, not executable) or Automation (outbound) | `ICommandOperation` / reactor | operations, reactors |
27
27
  | HTML mockup | `screen` Level 1 + board (`visualize-model`) | default Scene composition | ui composition |
@@ -1,12 +1,12 @@
1
- # Worked example: reasoning description, constraint, decided rejection
1
+ # Worked example: reasoning documentation, constraint, decided rejection
2
2
 
3
- A marina berth allocation feature. The feature `description` carries the reasoning (scope, an
3
+ A marina berth allocation feature. The feature `documentation` carries the reasoning (scope, an
4
4
  assumption tied to Q1, a rule kept as a constraint). The refusal for a boat that already holds a
5
- berth is a specification, not a note. Complete and compiling with the standalone compiler and with
6
- `cratis screenplay validate`.
5
+ berth is a specification, not a note. The complete model validates and its three specifications pass on standalone
6
+ Screenplay 4.127.0; these are reference-runner checks, not rendered-code evidence.
7
7
 
8
8
 
9
- ```screenplay
9
+ ````screenplay
10
10
  domain Marina.Berths
11
11
 
12
12
  concept BerthId : Uuid
@@ -21,7 +21,13 @@ persona HarbourMaster
21
21
 
22
22
  module Berths
23
23
  feature Allocation
24
- description "Allocating a berth to a boat. A boat holds one berth at a time; that rule is the OneBerthPerBoat constraint, not a second event type. Assumption Q1: allocation is always manual, so no automation is modeled."
24
+ description "Allocating a berth to a boat"
25
+ documentation
26
+ ```markdown
27
+ A boat holds one berth at a time; that rule is the OneBerthPerBoat
28
+ constraint, not a second event type. Assumption Q1: allocation is
29
+ always manual, so no automation is modeled.
30
+ ```
25
31
  authorize HarbourOffice
26
32
 
27
33
  slice StateChange AllocateBerth
@@ -70,7 +76,7 @@ module Berths
70
76
  berthId = "5d3c2a52-27c4-4d2b-a0ee-0a6a8a9f7b11"
71
77
  boat = "Sea Wren"
72
78
  then denied
73
- ```
79
+ ````
74
80
 
75
81
 
76
82
  ## Why it is shaped this way
@@ -78,9 +84,9 @@ module Berths
78
84
  specification can state the exact rejection. No `BerthReassigned` event was added to carry it.
79
85
  - The `Cannot` line in the persona resolves to the `HarbourOffice` policy and a `then denied`
80
86
  specification whose caller fixture carries a non-matching role.
81
- - Assumption Q1 lives in the feature description and in STATE.md (Open questions) with its address,
87
+ - Assumption Q1 lives in the feature documentation and in STATE.md (Open questions) with its address,
82
88
  `Berths.Allocation`.
83
- - The description is rationale only: the rules themselves are enforced by the constraint, the policy
89
+ - The documentation is rationale only: the rules themselves are enforced by the constraint, the policy
84
90
  and the specifications, not by the prose.
85
91
  - The constraint does not say a berth holds one boat at a time: a berth source may replace its
86
92
  claimed boat. If berth occupancy must be unique too, model and specify that as its own invariant.
@@ -3,6 +3,7 @@
3
3
  "input": "Add a berth allocation feature to this Cratis application that already has a Screenplay model. How should the work be done and verified?",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "Model first" },
7
8
  { "kind": "skill-contains", "value": "`Outcome:`" },
8
9
  { "kind": "skill-contains", "value": "V3 binding-ready" },
@@ -51,7 +51,7 @@ compiles can still mean something other than it seems: read the warnings.
51
51
  Excerpt: the concepts and the three events (each carrying `invoiceId`) are
52
52
  declared elsewhere in the model.
53
53
 
54
- ```screenplay
54
+ ```screenplay excerpt
55
55
  readmodel InvoiceDetailsReadModel
56
56
  invoiceId InvoiceId
57
57
  invoiceNumber InvoiceNumber
@@ -182,7 +182,7 @@ must be numeric.
182
182
  Excerpt, inside a `projection` whose read model has `customerId` and
183
183
  `customerName`:
184
184
 
185
- ```screenplay
185
+ ```screenplay excerpt
186
186
  join customer on customerId
187
187
  with CustomerCreated
188
188
  customerName = name
@@ -206,7 +206,7 @@ A join cannot declare its own key or trigger removal — that is
206
206
 
207
207
  Excerpt, inside a `projection`:
208
208
 
209
- ```screenplay
209
+ ```screenplay excerpt
210
210
  children lineItems identified by lineNumber
211
211
  from InvoiceLineItemAdded key lineNumber
212
212
  parent invoiceId
@@ -232,7 +232,7 @@ nested billingContact
232
232
 
233
233
  Excerpt, inside a `projection`:
234
234
 
235
- ```screenplay
235
+ ```screenplay excerpt
236
236
  remove with InvoiceCancelled key invoiceId
237
237
  remove via join on CustomerAccountClosed
238
238
  ```
@@ -252,7 +252,7 @@ Excerpt: the events and the three read models (each with a keyed query) are
252
252
  declared elsewhere. Every event about an issue is appended with the issue's
253
253
  identifier as its event source.
254
254
 
255
- ```screenplay
255
+ ```screenplay excerpt
256
256
  projection WorkItem
257
257
  from TitleChanged
258
258
  title = title
@@ -288,7 +288,7 @@ a single `status` field.
288
288
 
289
289
  Excerpt: the events and the `AccountBalance` read model are declared elsewhere.
290
290
 
291
- ````screenplay
291
+ ````screenplay excerpt
292
292
  reducer Balance => AccountBalance
293
293
  on AmountDeposited
294
294
  ```csharp
@@ -181,7 +181,7 @@ that contains them; a target must run their specifications.
181
181
 
182
182
  ### Composite key with event context
183
183
 
184
- ```screenplay
184
+ ```screenplay excerpt
185
185
  projection LineItems => LineItemReadModel
186
186
  from LineItemAdded
187
187
  key LineItemKey
@@ -194,7 +194,7 @@ projection LineItems => LineItemReadModel
194
194
 
195
195
  ### Global counter with a literal key
196
196
 
197
- ```screenplay
197
+ ```screenplay excerpt
198
198
  projection SiteStats => SiteStatsReadModel
199
199
  from UserLoggedIn key literal "site-stats"
200
200
  count totalLogins
@@ -205,7 +205,7 @@ Every `UserLoggedIn` updates the same instance, whatever its event source.
205
205
 
206
206
  ### System-wide audit with `all` alongside `from`
207
207
 
208
- ```screenplay
208
+ ```screenplay excerpt
209
209
  projection ActivityFeed => ActivityFeedModel
210
210
  all
211
211
  count totalSystemEvents
@@ -221,7 +221,7 @@ and its own count; `all` takes no key of its own.
221
221
 
222
222
  ### Children with a join and scoped removal
223
223
 
224
- ```screenplay
224
+ ```screenplay excerpt
225
225
  projection Group => GroupReadModel
226
226
  from GroupCreated
227
227
  name = name
@@ -238,7 +238,7 @@ projection Group => GroupReadModel
238
238
 
239
239
  ### `every` that ignores child activity
240
240
 
241
- ```screenplay
241
+ ```screenplay excerpt
242
242
  projection Group => GroupReadModel
243
243
  every
244
244
  lastActivity = $eventContext.occurred
@@ -255,7 +255,7 @@ Group-level events bump `lastActivity`; member events do not.
255
255
 
256
256
  ### Nested nullable object
257
257
 
258
- ```screenplay
258
+ ```screenplay excerpt
259
259
  projection Slice => SliceReadModel
260
260
  from SliceCreated
261
261
  name = name
@@ -273,7 +273,7 @@ projection Slice => SliceReadModel
273
273
 
274
274
  ### Several projections in one slice
275
275
 
276
- ```screenplay
276
+ ```screenplay excerpt
277
277
  slice StateView CustomerPortalReport
278
278
  readmodel PortalReportReadModel
279
279
  invitedAt DateTime
@@ -3,6 +3,7 @@
3
3
  "input": "Build a read model from events with the Projection Declaration Language.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "main `fd18129`" },
7
8
  { "kind": "skill-contains", "value": "it changes no projection contract" },
8
9
  { "kind": "skill-contains", "value": "map the read-model identity from `$eventSourceId`" },
@@ -43,7 +43,7 @@ newer main commit above; do not attribute their verification to the old tag.
43
43
 
44
44
  Excerpt, inside a `StateView` slice:
45
45
 
46
- ```screenplay
46
+ ```screenplay excerpt
47
47
  readmodel AccountBalance
48
48
  description "What the account is worth right now"
49
49
  balance Decimal
@@ -70,7 +70,7 @@ cannot select an instance of it.
70
70
 
71
71
  Excerpt: the concepts, the read model and the policy are declared elsewhere.
72
72
 
73
- ```screenplay
73
+ ```screenplay excerpt
74
74
  query ListInvoices => InvoiceListReadModel[]
75
75
  description "Every invoice the caller may see, narrowed by status and customer"
76
76
  filter status InvoiceStatus optional
@@ -114,7 +114,7 @@ query enforces it. A compiling query is not evidence that access control works.
114
114
 
115
115
  Excerpt, inside a `StateView` slice:
116
116
 
117
- ```screenplay
117
+ ```screenplay excerpt
118
118
  query Mine => Timesheet[]
119
119
  scoped to identity
120
120
  query Everyones => Timesheet[]
@@ -186,7 +186,7 @@ commands and screens it names are declared elsewhere.
186
186
 
187
187
  **Level 1 — intent.** Data and actions; the tool generates the component.
188
188
 
189
- ```screenplay
189
+ ```screenplay excerpt
190
190
  screen InvoiceList
191
191
  data InvoiceListReadModel[] via query ListInvoices
192
192
  action RegisterInvoice
@@ -197,7 +197,7 @@ screen InvoiceList
197
197
  **Level 2 — structure.** Named sections, tables and summaries filling a template's
198
198
  slots.
199
199
 
200
- ```screenplay
200
+ ```screenplay excerpt
201
201
  screen InvoiceDetails
202
202
  template MasterDetail
203
203
  sidebar
@@ -246,7 +246,10 @@ One labeled user decision can choose among commands using ordered
246
246
  without an execute fallback hides it. Inputs use typed `with ... from ...`
247
247
  bindings; the selected command still enforces its own gate/rules/constraints.
248
248
  Read [guarded actions](references/guarded-actions.md) for the checked model,
249
- missing-versus-null behavior and source-versus-renderer boundary.
249
+ missing-versus-null behavior and source-versus-renderer boundary. For a gesture
250
+ choosing a whole action list rather than one labeled command, use block-form
251
+ `when`/`otherwise` on click/double click/select:
252
+ [guarded interactions](../cratis-screenplay-ui-composition/references/guarded-interactions.md).
250
253
 
251
254
  ## How a bare name resolves
252
255
 
@@ -260,7 +263,7 @@ real application declares 76 queries under 37 distinct names, with `All` appeari
260
263
  Reach across slices by qualifying with **any trailing part** of the scope.
261
264
  Excerpt: `Queue` and `Deviations` are sibling slices that each declare `All`.
262
265
 
263
- ```screenplay
266
+ ```screenplay excerpt
264
267
  screen OverviewScreen
265
268
  data QueueReadModel[] via query Queue.All
266
269
  data DeviationReadModel[] via query Preparation.Deviations.All
@@ -3,6 +3,10 @@
3
3
 
4
4
  # Guarded screen actions
5
5
 
6
+ For a gesture choosing a whole action list, rather than a labeled action choosing
7
+ one command, use [guarded interactions](../../cratis-screenplay-ui-composition/references/guarded-interactions.md).
8
+ They share item conditions/subject rules but run once without a click-time refetch.
9
+
6
10
  ## Contents
7
11
 
8
12
  - State one user decision
@@ -3,6 +3,7 @@
3
3
  "input": "Declare a Screenplay query and the screen that binds to it.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "main `fd18129`" },
7
8
  { "kind": "skill-contains", "value": "filter status InvoiceStatus optional" },
8
9
  { "kind": "skill-contains", "value": "query Q => observable?" },
@@ -28,7 +28,7 @@ Version pins live once in `cratis-screenplay-toolchain` `references/versions.md`
28
28
  | cratis CLI | `3.41.0` (`v3.41.0`) | `cratis render` options, exit codes, publication receipt, UI-profile rejection (`CLI-RENDER-007` to `CLI-RENDER-010`); tag pins Stage 4.51.3, Screenplay 4.114.0 and `Cratis.Arc.Screenplay` 22.54.0, with `cratis/stage:4.51.3` as the runtime image. UI-profile rejection and render-then-recover shipped in 3.41.0 (Cratis/cli#301). The screens release vector was verified on 3.40.7 (`af9f18e`) with `cratis/stage:4.51.1`. Reading baselines: 3.40.3, 3.39.0 and 3.28.3 (`8b43fef`) |
29
29
  | Stage | `4.51.3` (CLI 3.41.0 default) | admission (`STAGE-ESM-*`, and `PLAY0268` render refusals surfaced by the CLI), ownership manifest, `Customizations/` seams, Debug-only specifications, fail-closed guarded actions (`STAGE-SCENE-ACTION-001`) and interactions (`STAGE-SCENE-INTERACTION-001`). Older baselines: 4.49.5, 4.43.0 and `v4.24.2` (`32dcac4`) |
30
30
  | Screenplay | bundled `4.114.0`; standalone `4.127.0` | standalone compiler for V1 to V3; binding codes `PLAY0268` and the code-attachment rules, read at `v4.66.0`; claims made through `cratis` are 4.114.0 claims |
31
- | Rendered apps | Arc `22.25.0`, Chronicle `19.8.1`, Scene packages | `[ProtectedDecision]` (Arc 22.39.0 and later) is not available in code written into one; verify the generated package set before claiming exact Scene 4.14.0 runtime parity |
31
+ | Rendered apps | Arc `22.50.5`, Chronicle `19.32.0`, Scene packages | Stage 4.51.3 scaffold; `[ProtectedDecision]` / `DecisionRead<T>` available to gap-fill, not emitted enforcement. Embedded reverse extraction disabled; verify generated packages before claiming exact Scene runtime parity |
32
32
 
33
33
  Facts were read at those tags and `cratis render` was run at 3.28.2 and 3.28.3 for the worked example
34
34
  (`references/worked-example.md`); with public CLI 3.40.7 it was run over the canonical
@@ -135,10 +135,11 @@ Adapters and non-renderable scope follow the contract rules of `cratis-applicati
135
135
  (`cratis-application-slice-conformance` `references/build-prompts.md`).
136
136
  - One ledger scope per `slice-implementer` brief; the brief carries addresses and paths, not contents.
137
137
  - Model-enforced rules realized in code (state-dependent rules) need a protected read or
138
- concurrency scope; never claim them from prose. In a Stage-rendered app, Arc is 22.25.0.
138
+ concurrency scope; never claim them from prose. Stage 4.51.3 rendered apps have
139
+ Arc 22.50.5/Chronicle 19.32.0; API availability alone is not verified enforcement.
139
140
  - Adapters that call outside systems follow `cratis-engineering-effect-boundaries`; slice
140
141
  specifications follow `cratis-application-slice-specifications`.
141
- - Realization notes are the explicit realization requirements stated in a slice `description`
142
+ - Realization notes are the explicit realization requirements stated in a slice `description` or `documentation`
142
143
  (definition: `cratis-application-slice-conformance`, `references/contract-and-precedence.md`).
143
144
  Executable parts (specifications, mappings, constraints) win over prose, and a contradicting description is a model defect to report.
144
145
 
@@ -57,7 +57,7 @@ non-renderable scope:
57
57
  | fallback location | project and folder of the hand-written code |
58
58
  | spec mapping | `.play` specification to test name, one line each; missing tests listed |
59
59
  | field inventory | `n/n` command, event and read-model properties mapped; extras: none, or listed with reason |
60
- | realization requirements applied | explicit realization notes from slice descriptions applied, one line each; other description prose used as a hint is listed separately |
60
+ | realization requirements applied | explicit realization notes from slice `description` or `documentation` applied, one line each; other description prose used as a hint is listed separately |
61
61
  | spec delta | at re-delivery: specifications added, changed or removed since `last verified`, each with test status |
62
62
  | divergences | where the code deliberately differs from the model, with reason and approver |
63
63
  | revisit trigger | issue and condition (for example "Stage#58 ships list queries") |
@@ -27,7 +27,7 @@ paths and addresses, not pasted contents:
27
27
  with the same name; never weaken, skip or delete one to pass. Do not edit managed files.
28
28
  Return a field inventory (command, event and read-model properties mapped to code locations)
29
29
  and list anything you added that the model does not state (expected: none). Explicit
30
- realization requirements in the slice description bind adapters and fallback code, cannot
30
+ realization requirements in the slice `description` or `documentation` bind adapters and fallback code, cannot
31
31
  contradict executable parts and are never supplemented with inferred rules; descriptive prose
32
32
  that is not an explicit requirement is a hint. The repository's pattern wins over a
33
33
  generic template; report the mismatch. Stop on a contradiction and return an edit request.*
@@ -61,8 +61,8 @@ ambiguous addresses; contracts are never inferred from names.
61
61
  A rule that exists only in a description, or a state-dependent rule the model marks as not
62
62
  enforced, is unenforced in generated scope. List it in the ledger as a target requirement. In
63
63
  hand-written code it needs an atomic enforcement point: a protected read or a concurrency scope
64
- (in a Stage-rendered application Arc is 22.25.0, which has no `[ProtectedDecision]`; a
65
- hand-written application on a newer Arc may use it), or a Chronicle constraint. A stale view or
64
+ (Stage 4.51.3 rendered apps have Arc 22.50.5/Chronicle 19.32.0: protected-read APIs
65
+ are available to gap-fill, with projection/key admission and active enrollment), or a Chronicle constraint. A stale view or
66
66
  a caller-supplied status is not enforcement.
67
67
 
68
68
  ## Automation and Translate scope
@@ -3,6 +3,7 @@
3
3
  "input": "The marina .play model is accepted. Render it with cratis render, tell me whether it builds and its generated specs pass, and say what to do about anything Stage cannot render.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  {
7
8
  "kind": "skill-contains",
8
9
  "value": "A. Admission failure"
@@ -27,9 +27,11 @@ language cannot express today are recorded, not faked. Grammar and outcome compa
27
27
  Screenplay v4.66.0 (`c89198b`) and v4.68.0 (`79801bf`, ESM v7 fixtures and `then returns`):
28
28
  `Documentation/screenplay/specifications.md` and the standalone compiler; `cratis` 3.28.2 and
29
29
  3.28.3 bundle Screenplay 4.66.0 (before 3.28.2 it bundled 4.60.1). The full pin table and the probes are in
30
- `cratis-screenplay-toolchain` `references/versions.md`. Specification obligations reported by
31
- the MCP (Screenplay#390) and multi-step storylines (Screenplay#394) are **not available**: the
32
- coverage matrix is built by hand and lifecycle families emulate storylines.
30
+ `cratis-screenplay-toolchain` `references/versions.md`. At Screenplay v4.127.0,
31
+ MCP `find-specification-obligations` derives SPEC001–SPEC008 from declarations;
32
+ met means matching authored presence, not full coverage or passing execution.
33
+ Use it to seed, never replace, the matrix. Multi-step storylines remain unavailable;
34
+ lifecycle families emulate them.
33
35
 
34
36
  ## Interview phase
35
37
  **Skip if** the brief already states the coverage depth (rules, denials, state violations,
@@ -56,7 +58,9 @@ question is not four approvals.
56
58
  (Cannot lines, "only if", refusals, competition candidates, endings) as coverage seeds.
57
59
  3. **Inventory before drafting**: read commands, effective gates (own, feature, module), rules,
58
60
  constraints, productions, reactions, captures, read models and queries in scope; derive the
59
- obligations from those declarations, not from specs already present.
61
+ obligations from those declarations, not from specs already present. Use scoped
62
+ `find-specification-obligations` and inspect unmet/message-specific obligations;
63
+ ambiguous references and opaque code are not inferred coverage.
60
64
  4. **Coverage matrix before any spec** (`references/coverage-matrix.md`). Rows: every command,
61
65
  reaction, capture, read model and gated query. Columns: the scenario types below. Each cell
62
66
  is `spec <Name>`, `n/a: <domain reason>`, `recorded: <why not expressible>`,
@@ -70,7 +74,12 @@ question is not four approvals.
70
74
  existing intentional fixtures (`references/scenario-catalogue.md` "Example data").
71
75
  7. **Draft commands**: happy path, each rule, denial, duplicates and retries, competing claims,
72
76
  state violations, alternative branches, compensation, external failure, evolution. In each
73
- rejection vary only the value under test.
77
+ rejection vary only the value under test. Use typed `parameter`/named `case`
78
+ tables for a shared validation matrix, not for unrelated behaviors; rows are
79
+ cases, not typed fixture `example`s. `given caller as <Persona>` supplies one
80
+ authenticated policy witness for success/denial; use explicit callers for
81
+ anonymous/ownership or unsynthesizable personas. Syntax and complete model:
82
+ `cratis-screenplay-specifications` `references/persona-callers-and-cases.md`.
74
83
  8. **Separate view pass**: population, each update, accumulation, removal (with a surviving
75
84
  row), absence, ordering. Mark lifecycle branches as branches.
76
85
  9. **State-dependent rules**: `reads <View>` + `require <expr> message "..."` as stated intent,
@@ -97,9 +106,16 @@ question is not four approvals.
97
106
  | Ordering | Facts late or out of order? | view family with reordered givens; translation specs; else `recorded` |
98
107
  | External failure | The other system refuses, times out or answers twice? | outcome as a recorded fact (capture/translation), never a fake rejection |
99
108
  | Compensation | How is this undone, what does undoing free? | reversal command + spec showing the released claim or removed row |
100
- | Evolution | Do old facts still mean the same after a contract change? | spec on the new generation; compatibility note in `description` |
109
+ | Evolution | Do old facts still mean the same after a contract change? | spec on the new generation; compatibility reasoning in `documentation` |
101
110
  | View | What does each screen show after each fact? | `given` events (`for`) -> `then query`; `when append` -> update/removal |
102
111
 
112
+ For recovery intent, `when redelivered <Event> to <Reaction>` must select one
113
+ definitely matching effective given and no undecided candidate. Name `stream`
114
+ (with a complete id) or `no stream` when givens differ only by route; omitting it
115
+ is a wildcard, not an unrouted selector. Redelivery remains authoring-only
116
+ (PLAY0268), never evidence of an executed retry. Details:
117
+ `cratis-screenplay-specifications` `references/examples-and-routes.md`.
118
+
103
119
  **Once, idempotent, exactly once are different claims.** A `unique event` constraint proves the
104
120
  *fact* occurs once per event source; it does not make *command handling* idempotent (a retry is
105
121
  rejected, not answered with success), and nothing in the model proves an *external effect* (an
@@ -112,7 +128,7 @@ target requirements.
112
128
  - `then` events are exact in count and order (`then events in any order` relaxes order only).
113
129
  - Command denial: `then denied` with no success or error outcome. Read-only query denial:
114
130
  `then query <Query>` with `arguments` and no `result`, then `then denied`. Every gated command
115
- or query spec needs `given caller` (module and feature gates count); an authorized scenario
131
+ or query spec needs `given caller` or `given caller as <Persona>` (module and feature gates count); an authorized scenario
116
132
  gets no inferred fixture (PLAY0389). Unauthorized is never `then error`.
117
133
  - Duplicate and competing specs use `when <Command>`; `when append` is for projection and
118
134
  automation triggers, and for a constraint the command's own validation would reject first.
@@ -130,7 +146,7 @@ target requirements.
130
146
  never `n/a` automatically. This matches `cratis-screenplay-specifications`, which also
131
147
  requires one rejection spec per concept rule. Business rules get one rejection spec each.
132
148
  - Persona Cannot lines are intent: each needs an executable gate plus a `then denied` spec whose
133
- caller carries that persona's roles and claims, else record a gap.
149
+ caller is a synthesized persona witness or an explicit gate fixture, else record a gap.
134
150
  - Descriptions are not rendered: a rule only in prose is unenforced in rendered scope; turn it
135
151
  into a rule layer, a spec or a recorded target requirement.
136
152
  - Prove projections with events (`given`/`when append`), not `given readmodel`; seed read models
@@ -149,7 +165,7 @@ target requirements.
149
165
  - Read models are a separate, equally mandatory pass: a model with dozens of command specs and no
150
166
  read-model spec is not scenario-complete. Population, then update or removal where an event
151
167
  supersedes a row.
152
- - The why behind each business rule is written down (slice `description`), not only the what.
168
+ - The why behind each business rule is written down (slice `documentation`), not only the what.
153
169
  - Good and bad forms of givens, outcomes and rejections: `references/scenario-examples.md`.
154
170
 
155
171
  ### Review questions
@@ -2,7 +2,7 @@
2
2
 
3
3
  Complete, compiled design-mode model (marina guest berths) showing a coverage matrix turned into specifications: happy path, one rejection per rule, authorization denial, duplicate and retry, competing claim, state violation, alternative branches, compensation and a view lifecycle family. The matrix for it is in `coverage-matrix.md`; the catalogue (`scenario-catalogue.md`) names its specifications.
4
4
 
5
- ```screenplay
5
+ ```screenplay test=unbound
6
6
  // Scenario coverage worked example: guest berths at a marina (complete document).
7
7
  // Shows a coverage matrix turned into specifications: happy path, one rejection per rule,
8
8
  // authorization denial, duplicate/retry, concurrent claim, state violation, alternative branches,
@@ -9,7 +9,7 @@
9
9
  - Worked example (`berth-reservations.md`, design mode)
10
10
 
11
11
  Write it **before** drafting specs, keep it in `.ai-work/screenplay/<model-slug>/coverage.md` (or the
12
- `STATE.md` beside it), and update it with the specs. Reviewers check it against the model. The Screenplay MCP does not yet report which specifications a command, read model, policy or constraint still lacks (Screenplay#390, open, not available): the matrix is that report, built by hand from the declarations.
12
+ `STATE.md` beside it), and update it with the specs. Reviewers check it against the model. Screenplay 4.127.0 MCP `find-specification-obligations` seeds the inventory (SPEC001–SPEC008), for command success, requirements, command/concept validation, effective authorization gates, value constraints, read models, projection removals and reaction outcomes. A met row proves matching authored presence, not full coverage or passing execution: the matrix still records domain judgments and scenario types the heuristic cannot infer.
13
13
 
14
14
  ## Cell values
15
15
  - `spec <Name>` - written; the name exists in the model.
@@ -13,7 +13,12 @@ Keep those lines: they state real intent and are never
13
13
  replaced by prose. The runnable counterpart, which holds no stored-state rule, is
14
14
  `invoicing-dues-example.md`; `scenario-examples.md` copies `ReversingAReceivedPayment` from here.
15
15
 
16
- ```screenplay
16
+ The excerpt's Stage API-availability comment describes the historical Stage 4.24.x
17
+ scaffold. Stage 4.51.3 pins Arc 22.50.5/Chronicle 19.32.0: protected-read APIs are
18
+ available to gap-fill, not emitted protection or `.play` rule admission. The
19
+ original compiled source is retained unchanged.
20
+
21
+ ```screenplay expect PLAY0516 test=unbound
17
22
  // Scenario coverage design-mode example: stored-state rules of invoicing club dues (complete document).
18
23
  // Design mode: `reads` is PLAY0271 and `require` over a view is PLAY0268 at binding (the only
19
24
  // blockers), so this model compiles but is not executable; the specifications below do not run. The runnable counterpart
@@ -80,9 +80,12 @@ name them as unfinished.
80
80
  (commands: no other outcome; read-only queries: `then query <Query>` with `arguments`, no
81
81
  `result`, then `then denied`; or `when query` + `then denied`). See `RefusingASkipper`.
82
82
  An empty `given caller` block is the anonymous caller.
83
- - Specs cannot name a persona: write the caller as the roles and claims that persona's
84
- policies grant and name the spec after the persona. One denial per persona that can reach the
85
- screen but may not act. Derive fixtures from the effective Boolean gate: AND - isolate each
83
+ - Use `given caller as <Persona>` for one authenticated witness synthesized from
84
+ that persona's policies (4.127.0). Inspect the leftmost buildable `or` choice;
85
+ it does not represent every possible caller. Use explicit roles/claims for
86
+ anonymous or ownership fixtures, missing conjuncts, or refused synthesis.
87
+ One denial per persona that can reach the screen but may not act. Derive
88
+ fixtures from the effective Boolean gate: AND - isolate each
86
89
  missing conjunct; OR - a caller meeting any permitted alternative must succeed (a success
87
90
  spec, not `then denied`); denial only when the whole gate is false.
88
91
  - Ownership policies (`claim ... matches subject|<property>`): the denial gives the right role
@@ -184,7 +187,7 @@ name them as unfinished.
184
187
  ## 11. Evolution compatibility
185
188
  - Ask (when an event's contract changes): "Do facts already stored still mean the same?"
186
189
  - Compatible change (added property with a defined default): declare the new generation;
187
- specify behaviour on the new generation; write the default for old facts in `description`
190
+ specify behaviour on the new generation; write the default and its reason for old facts in `documentation`
188
191
  (Screenplay does not express upcasters). Change of meaning: a new event, with its own specs.
189
192
  - Renaming a stored event keeps an `id "<OldName>"` pin. A rename the brief requests is done in
190
193
  this pass by the identity owner (`cratis-screenplay-modeling-lifecycle`); never leave it silently unapplied.