@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
@@ -73,7 +73,7 @@ are, is `cratis-screenplay-modeling-lifecycle` ("Decide the level first").
73
73
  4. Existing code has no authority over the contract.
74
74
 
75
75
  Precedence inside the contract. Executable parts of the contract beat prose: specifications,
76
- mappings, constraints and authorization first; then the `description` and realization notes;
76
+ mappings, constraints and authorization first; then the `description`, `documentation` and realization notes;
77
77
  then issue text. If prose contradicts an executable part, that is a model defect: stop that
78
78
  scope, return an **edit request** (address, change, reason) and do not pick a side silently.
79
79
  Reading a question is not resolving it. Details: `references/contract-and-precedence.md`.
@@ -23,11 +23,11 @@ or the unmanaged extension code.
23
23
 
24
24
  ## Precedence (highest first)
25
25
  1. Executable parts: specifications, mappings, constraints, authorization, rules.
26
- 2. The slice `description` and realization notes: they explain intent and never license a
27
- contradiction or an undocumented default. Realization notes are the explicit realization
28
- requirements stated in a description: they bind adapters and fallback code, cannot contradict
29
- executable parts, and are never supplemented with inferred rules; other description prose is
30
- only a hint.
26
+ 2. The slice `description`, its fenced `documentation`, and realization notes: they explain intent
27
+ and never license a contradiction or an undocumented default. Realization notes are the explicit
28
+ realization requirements stated in the `description` or `documentation`: they bind adapters and
29
+ fallback code, cannot contradict executable parts, and are never supplemented with inferred
30
+ rules; other prose is only a hint.
31
31
  3. Issue or ticket text.
32
32
  4. Existing code: no authority.
33
33
 
@@ -3,6 +3,9 @@
3
3
  "input": "The marina berth model changed: RegisterBerth now rejects lengths over 25 metres and a new BerthRetired event removes a berth from the list. Re-deliver the slice code against the updated .play slice and tell me whether it is done.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ {
7
+ "kind": "play-compiles"
8
+ },
6
9
  {
7
10
  "kind": "skill-contains",
8
11
  "value": "Executable parts of the contract beat prose"
@@ -0,0 +1,14 @@
1
+ {
2
+ "skill": "cratis-arc-react-page",
3
+ "input": "Build a list page with an Add command dialog for a .play screen.",
4
+ "fixtures": [],
5
+ "assertions": [
6
+ {
7
+ "kind": "play-compiles"
8
+ },
9
+ {
10
+ "kind": "skill-contains",
11
+ "value": "DataPage"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,10 @@
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
+ // Minimal parent for the queue query excerpt; the complete behavior remains in todo-list-example.md.
5
+ module Certificates
6
+ feature Sending
7
+ slice StateView CertificatesToSend
8
+ readmodel PendingCertificate
9
+ enrolmentId Uuid
10
+ // @excerpt
@@ -0,0 +1,11 @@
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
+ // Minimal parent for the retry sweep excerpt; it checks source, not opaque code execution.
5
+ module Certificates
6
+ feature Sending
7
+ slice StateView CertificatesToSend
8
+ readmodel PendingCertificate
9
+ enrolmentId Uuid
10
+ slice Automation SendCertificates
11
+ // @excerpt
@@ -56,7 +56,7 @@ Outcomes:
56
56
 
57
57
  When a todo list is not needed: the effect is immediate, internal and cannot fail (a direct
58
58
  `produces` or co-production), and nobody needs to see pending work. Say why in the slice
59
- `description`; do not add a list just to follow a pattern.
59
+ `documentation`; do not add a list just to follow a pattern.
60
60
 
61
61
  ## 3. Effects: `produces` vs `invokes`
62
62
  | | `produces <Fact>` | `invokes <Command>` |
@@ -80,8 +80,8 @@ not identity inferred from prose or an imperative pipeline call.
80
80
  Decide and record one of:
81
81
  1. **Internal ungated command** - only if the security design supports it: not reachable by
82
82
  outside callers in the target (verify; the model cannot show exposure), safe to repeat
83
- (guarded by `unique event`), and touching one stream. State the reasons in the module
84
- `description` (as `todo-list-example.md` does) and list "not externally exposed" as a target
83
+ (guarded by `unique event`), and touching one stream. State the reasons in module
84
+ `documentation` (the historical `todo-list-example.md` used a description) and list "not externally exposed" as a target
85
85
  requirement in `STATE.md`.
86
86
  2. **Direct `produces`** - when no decision is left (the fact is already decided) and nothing
87
87
  should refuse it.
@@ -38,7 +38,7 @@ One spec in the slice does not cover the others.
38
38
  | invalid | unknown code, wrong type | `translate` has no entry -> decide and specify |
39
39
  | changed / corrected | outside value changes after our fact | correction fact or open decision (`translation-patterns.md` §6) |
40
40
  | mis-correlated | reference points at the wrong stream | property constraint on the external reference, or an expert review case |
41
- | personal data | field we must not keep | excluded from the append mappings; note in `description`; the source record may still carry it |
41
+ | personal data | field we must not keep | excluded from the append mappings; record the reason in `documentation`; the source record may still carry it |
42
42
  | authenticity / ownership | wrong source, tenant or entity reference | specify the rejection and name where it is enforced; capture metadata does not verify it |
43
43
  | each mapping branch | every recognized code has its intended local meaning | concrete payload and exact translated values; unknown code is a separate case |
44
44
  | same object, different occurrence | two legitimate events share a provider object id | both stay representable; dedup hits only the repeated occurrence |
@@ -70,7 +70,7 @@ See "Effect guarantees and recovery traps" in SKILL.md.
70
70
  the target's replay behaviour before relying on it, and record the answer.
71
71
  See "Effect guarantees and recovery traps" in SKILL.md.
72
72
 
73
- ## What to write down (slice `description` + `STATE.md`)
73
+ ## What to write down (slice `documentation` + `STATE.md`)
74
74
  - Effect placement (1-4) and why. Placement 4 is syntax-only: say the model then has no
75
75
  executable form.
76
76
  - The idempotency key, and whether the outside system honours it.
@@ -1,7 +1,7 @@
1
1
  # Integration contracts
2
2
 
3
3
  Use before completing a new or changed translation. Keep accepted decisions in the relevant
4
- `.play` descriptions and specs; open questions and target requirements go to `STATE.md`. Do
4
+ `.play` `documentation` and specs; open questions and target requirements go to `STATE.md`. Do
5
5
  not create a second canonical model.
6
6
 
7
7
  ## Resolve only the unknowns
@@ -17,14 +17,16 @@ with `cratis-screenplay-render-and-gap-fill`.
17
17
  | Model element | Realization | Skill |
18
18
  |---|---|---|
19
19
  | reaction `when <Event>` with `invokes` or `produces` | Chronicle reactor returning commands or events | `cratis-chronicle-reactor` |
20
- | trusted actor for `invokes` | `[ExecuteCommandsAsSystem("<role>")]` on the reactor plus a policy requiring the role (Arc, since v20.56.0; available in a rendered app's Arc 22.25.0) | `cratis-chronicle-reactor` |
20
+ | trusted actor for `invokes` | `[ExecuteCommandsAsSystem("<role>")]` on the reactor plus a policy requiring the role (Arc, since v20.56.0; available in Stage 4.51.3's rendered Arc 22.50.5) | `cratis-chronicle-reactor` |
21
21
  | clock trigger, application trigger | scheduler or host signal that raises the occurrence | `cratis-engineering-effect-boundaries` |
22
22
  | call to an outside system | adapter behind an effect boundary, keyed by the idempotency key in the model | `cratis-engineering-effect-boundaries` |
23
23
  | capture source (webhook, poll, topic) | adapter that authenticates, parses and appends | `cratis-engineering-effect-boundaries` |
24
24
  | replay versus recovery redelivery | `[OnceOnly]` for replay; a receipt keyed by `ReactorDelivery.Id` for recovery | `cratis-chronicle-reactor` |
25
25
 
26
- `[ProtectedDecision]` (Arc v22.39.0 and later) is not available in a Stage-rendered app (Arc
27
- 22.25.0), and `Directory.Packages.props` there is Stage-managed: do not edit it to get a newer Arc.
26
+ Stage 4.51.3 rendered apps pin Arc 22.50.5/Chronicle 19.32.0, so
27
+ `[ProtectedDecision]` and `DecisionRead<T>` are available to gap-fill, not
28
+ Stage-emitted enforcement. Admit the projection/key and enroll the read in the
29
+ active unit of work; never edit managed `Directory.Packages.props`.
28
30
 
29
31
  ## Faithful realization
30
32
  A realization may choose the reactor, scheduler or queue mechanism. It may not: drop pending
@@ -28,7 +28,7 @@ What the model proves and what it does not:
28
28
  `runs as system role` on 4.125.0 (ESM v10), with separate CLI/Stage refusal.
29
29
  - Report reference outcomes only after executing the selected scenarios.
30
30
 
31
- ```screenplay
31
+ ```screenplay expect PLAY0469,PLAY0516
32
32
  // Todo-list automation. Shape: CoursePassed opens an item -> CertificateSender invokes
33
33
  // SendCertificate -> CertificateSent closes the item. The once-only FACT is
34
34
  // `unique event CertificateSent`; the external send is NOT proven once-only by this model.
@@ -196,12 +196,12 @@ above: a list query (the visible queue) and a retry sweep that reads the whole v
196
196
  (Screenplay#286). Keep them in the model only when the document is the deliverable and say so
197
197
  in the verdict.
198
198
 
199
- ```screenplay excerpt
199
+ ```screenplay excerpt parent=assets/pending-certificates.play
200
200
  // Parent: the complete document above, slice StateView CertificatesToSend.
201
201
  query PendingCertificates => PendingCertificate[]
202
202
  ```
203
203
 
204
- ```screenplay excerpt
204
+ ```screenplay excerpt parent=assets/retry-sweep.play
205
205
  // Parent: the complete document above, slice Automation SendCertificates, after CertificateSender.
206
206
  // The sweep reads the whole view (a clock trigger takes no `by`); iterating items needs code.
207
207
  reaction CertificateRetrySweep
@@ -33,7 +33,7 @@ thing by it. Keep it as a property when it is needed to correlate or deduplicate
33
33
  `<X>WebhookReceived` are smells; a business fact such as `PaymentReceived` is fine).
34
34
 
35
35
  ## 4. Per-field disposition
36
- For every field of the outside record, decide and write in the slice `description`:
36
+ For every field of the outside record, decide and write in slice `documentation`:
37
37
  | Disposition | Meaning | Screenplay |
38
38
  |---|---|---|
39
39
  | **map** | carried into our fact as is or translated | `map` + mapping `x = $.x`; `translate` for codes |
@@ -3,6 +3,7 @@
3
3
  "input": "Our payment provider sends webhooks when invoices are paid or refunded, and we must email a receipt afterwards. Model the integration and the follow-up in the Screenplay model.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "`[ExecuteCommandsAsSystem(\"<role>\")]`" },
7
8
  { "kind": "skill-contains", "value": "ESM v10" },
8
9
  { "kind": "skill-contains", "value": "STAGE-ESM-024" },
@@ -197,7 +197,7 @@ event, on a trigger (with `where` and `invokes`), on a view read and on the cloc
197
197
  a capture with its specifications. The excerpts later in this skill have their own
198
198
  complete parent documents in `references/complete-examples.md`.
199
199
 
200
- ```screenplay
200
+ ```screenplay expect PLAY0469
201
201
  concept InvoiceId : Uuid
202
202
  trigger PaymentFileArrived
203
203
  description "The bank's payment file listed a payment for an invoice"
@@ -61,7 +61,7 @@ The complete authoring model below compiles without warnings on 4.125.0;
61
61
  `screenplay test` intentionally returns 3/unbound with PLAY0268 for redelivery
62
62
  and no-event assertion, not a recovery pass:
63
63
 
64
- ```screenplay
64
+ ```screenplay test=unbound
65
65
  module Billing
66
66
  feature Claims
67
67
  slice Automation Recovery
@@ -3,6 +3,7 @@
3
3
  "input": "Translate external data into events and declare a reaction.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  {
7
8
  "kind": "skill-contains",
8
9
  "value": "main `fd18129`"
@@ -87,7 +87,7 @@ commands reference; use `concept` for a single wrapped primitive.
87
87
  Excerpt: the concepts, the `InvoiceLine` type, the policy and the event are
88
88
  declared elsewhere in the model.
89
89
 
90
- ```screenplay
90
+ ```screenplay excerpt
91
91
  command RegisterInvoice
92
92
  description "Registers a new invoice with its lines and payment terms"
93
93
  invoiceId InvoiceId identifier
@@ -138,7 +138,7 @@ something whose identity the caller does not supply).
138
138
  Excerpt: the `Account` read model, its projection and its keyed query are
139
139
  declared elsewhere.
140
140
 
141
- ```screenplay
141
+ ```screenplay excerpt
142
142
  command TransferFunds
143
143
  sourceId AccountId
144
144
  destinationId AccountId
@@ -200,7 +200,7 @@ a rule that travels is worth more than one that is repeated.
200
200
 
201
201
  Excerpt: the policies are declared at the top of the model.
202
202
 
203
- ```screenplay
203
+ ```screenplay excerpt
204
204
  authorize IsAccountant
205
205
  or IsCustomerSelf
206
206
 
@@ -252,7 +252,7 @@ choosing or omitting `for` on a production, or fixing `PLAY0469`-`PLAY0478`.
252
252
  must bind on an older version.
253
253
  Excerpt:
254
254
 
255
- ```screenplay
255
+ ```screenplay excerpt
256
256
  produces when isProForma == true
257
257
  ProFormaInvoiceIssued
258
258
  for invoiceId
@@ -309,7 +309,7 @@ Read `cratis-screenplay-toolchain/references/sources-and-streams.md` when author
309
309
  Chronicle's constraints enforce **uniqueness only**. Excerpt: the events are
310
310
  declared in the same model.
311
311
 
312
- ```screenplay
312
+ ```screenplay excerpt
313
313
  constraint UniqueInvoiceNumber
314
314
  unique invoiceNumber on InvoiceRegistered
315
315
  released by InvoiceCancelled
@@ -172,7 +172,7 @@ A template is backticked with `${}` substitutions. It parses in mappings but doe
172
172
  not bind to the executable model in `produces` or projections. Excerpt, one
173
173
  mapping line inside a `produces` block:
174
174
 
175
- ```screenplay
175
+ ```screenplay excerpt
176
176
  fullName = `${firstName} ${lastName}`
177
177
  ```
178
178
 
@@ -181,7 +181,7 @@ Literals are `true` / `false`, `"quoted text"`, numbers (`42`, `-3.14`), and
181
181
  rather than a property path — that is how a constant key is written. Excerpt,
182
182
  inside a `projection`:
183
183
 
184
- ```screenplay
184
+ ```screenplay excerpt
185
185
  from UserLoggedIn key literal "site-stats"
186
186
  count totalLogins
187
187
  ```
@@ -47,7 +47,7 @@ This complete authoring-only model compiles with `--warnaserror` at 4.125.0.
47
47
  `screenplay test` intentionally returns exit 3/unbound with PLAY0268; it proves
48
48
  no failure/compensation behavior today:
49
49
 
50
- ```screenplay
50
+ ```screenplay test=unbound
51
51
  system Accounting
52
52
  concept ProjectId : Uuid
53
53
  module Projects
@@ -55,7 +55,7 @@ Source: `v4.125.0:Documentation/screenplay/policies.md`.
55
55
 
56
56
  Excerpt: `CustomerRegistered` is declared in a slice.
57
57
 
58
- ```screenplay
58
+ ```screenplay excerpt
59
59
  seed
60
60
  for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
61
61
  CustomerRegistered
@@ -21,7 +21,7 @@ has no portable meaning (`PLAY0268`). Give it a body when the logic can live in
21
21
  model — a `file` or a tagged ` ```csharp ` fence indented under the rule, or a
22
22
  fenced `validate` block for cross-field rules. Excerpt, inside a command:
23
23
 
24
- ```screenplay
24
+ ```screenplay excerpt
25
25
  validate
26
26
  orgNumber rule BeAValidOrganizationNumber message "Must be a valid organization number"
27
27
  file Validations/BeAValidOrganizationNumber.cs
@@ -3,6 +3,7 @@
3
3
  "input": "Declare a Screenplay command with validation, authorization, a uniqueness constraint and a state-dependent rule.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "PLAY0653" },
7
8
  { "kind": "skill-contains", "value": "personal` is an alias of `pii", "file": "references/compliance.md" },
8
9
  { "kind": "skill-contains", "value": "report-only (PLAY0270)", "file": "references/compliance.md" },
@@ -88,7 +88,8 @@ to reach the intended result." With a brief, restate domain and goal in two sent
88
88
 
89
89
  **Unattended: assume visibly.** Never stop to ask. Take the most reasonable assumption,
90
90
  record it with its reason in the session STATE.md (`.ai-work/screenplay/<model-slug>/STATE.md`,
91
- untracked) and, when it shapes the model, in the feature `description`. Keep what the user
91
+ untracked) and, when it shapes the model, in the feature's fenced `documentation` (a short
92
+ **ASSUMED** marker may stay in its `description`). Keep what the user
92
93
  decided apart from what you assumed. Never guess silently.
93
94
 
94
95
  ## Procedure
@@ -111,7 +112,7 @@ decided apart from what you assumed. Never guess silently.
111
112
  a set-aside, an open question, or "does not apply, because ...". Unattended: model a lens
112
113
  fact only when the input implies it; otherwise record an open question.
113
114
  5. **Plot: order and branch** (`references/plotting-and-handoff.md`). Walk from the first
114
- trigger to every end. In each event's slice `description` record what it comes **after**,
115
+ trigger to every end. In each event's slice `documentation` record what it comes **after**,
115
116
  what **causes** it (persona, schedule, outside party, other fact) and what it is **only
116
117
  allowed under** (intent). At every event ask what can happen next *instead*, including
117
118
  nothing, and which next steps may happen in any order. Classify forks: *outcome branch* (one
@@ -151,7 +152,7 @@ decided apart from what you assumed. Never guess silently.
151
152
  matches alphabetically. Unimported folder files remain visible after ranked siblings.
152
153
  MCP `expand-layout` preserves this order with import barrels; an import-less
153
154
  `PlayFileWriter.Expand` layout falls back to path order. Order is presentation, not
154
- execution or identity. Keep causes and branches in the feature `description` and STATE.md.
155
+ execution or identity. Keep causes and branches in the feature `documentation` and STATE.md.
155
156
  - A misspelt keyword inside a slice is only warning PLAY0029 and the block disappears: always
156
157
  validate with warnings as errors.
157
158
 
@@ -159,7 +160,7 @@ decided apart from what you assumed. Never guess silently.
159
160
  - An event is a fact the business wants to remember: past tense, business verb, two to four
160
161
  words, specific (`BerthAssigned`, not `BerthUpdated`). No generic edit events.
161
162
  - One business decision usually yields one event; several facts recognised separately may
162
- yield several, with the reason in the slice `description`.
163
+ yield several, with the reason in slice `documentation`.
163
164
  - Calculated values are views, not events, unless the calculation is itself a decision the
164
165
  business must be able to show later (a quoted price, a fee set for the season).
165
166
  - Personas are roles with a purpose. A read-only persona is legitimate; a role that neither
@@ -169,7 +170,7 @@ decided apart from what you assumed. Never guess silently.
169
170
  - A hand-over from an outside party is named as the fact we learn from it
170
171
  (`MooringPermitGranted`). If most of a story is the outside party's steps, model only what
171
172
  crosses to us.
172
- - A rule that depends on stored state goes into the `description` of the slice it constrains
173
+ - A rule that depends on stored state is recorded in `documentation` on the slice it constrains
173
174
  (`only if ...`), marked as stated intent not enforced in the model today, with its target
174
175
  enforcement named for `cratis-screenplay-streams-and-consistency` and
175
176
  `cratis-screenplay-slice-design`. Never state copies, attestation booleans or rules living
@@ -56,7 +56,7 @@
56
56
  - Optional event properties: the default is none. Chronicle warns on nullable event
57
57
  properties (CHR0012) and a specification cannot state `null` for an event value (PLAY0350).
58
58
  Make the value required, or record the second situation as its own event. Keep `optional`
59
- only for a detail the business genuinely may not have, with the reason in the `description`.
59
+ only for a detail the business genuinely may not have, with the reason in event `documentation`.
60
60
  - Does the event restate the creation event's fields (a generic edit in disguise)? Ask which
61
61
  business change it records; if none, name the specific correction or drop it.
62
62
  - Never put personal data in the event-source id; one data subject per event.
@@ -38,7 +38,7 @@ that decision. If not, note the need as a view and move on.
38
38
  ## Unattended runs
39
39
 
40
40
  - Never block on a question. Take the most reasonable assumption, record it in STATE.md with
41
- why, and mark it in the feature `description` when it shapes the model.
41
+ why, and record it in feature `documentation` when it shapes the model.
42
42
  - Prefer assumptions that keep the model honest (fewer, clearly named facts) over ones that
43
43
  invent detail.
44
44
 
@@ -52,6 +52,7 @@ See "Evidence and privacy" in SKILL.md.
52
52
  4. List assumptions taken.
53
53
  5. Per workflow give the happy path, the decision points and the terminal facts in a few lines.
54
54
  6. Propose the next step: the next workflow, or `cratis-screenplay-slice-design` for this one.
55
- 7. Update STATE.md (phase, status, carry-forward); keep durable rationale in model
56
- `description` text, which is rendered and queryable; `//` comments survive printing at
57
- Screenplay v4.66.0, but check the dropped-comments report after any edit that cannot retain them.
55
+ 7. Update STATE.md (phase, status, carry-forward); keep durable rationale in fenced Markdown
56
+ `documentation`, summaries in `description`. At 4.127.0 canonical printing retains
57
+ documentation on its owner; MCP exposes it, but it changes no `modelRevision` and
58
+ reaches no rendered code. Inspect dropped comments after canonicalizing edits.
@@ -142,7 +142,7 @@ lists non-human causes (schedules, outside parties) separately.
142
142
  - Ask everywhere: "What happens next instead, including nothing?"
143
143
 
144
144
  Do not get stuck on exact timing; the point is the logical flow. The agent keeps the feature
145
- `description` story line and after / caused by / only if in the slices current
145
+ `documentation` story line and after / caused by / only if in the slices current
146
146
  (`plotting-and-handoff.md`).
147
147
 
148
148
  ### 6. Sweep and close (15 to 20 minutes)
@@ -28,7 +28,7 @@ assumption you take instead of asking.
28
28
  | Hotspots | Where does this go wrong, get disputed or need workarounds today? | Focuses depth | per hotspot: what happened the last time? |
29
29
  | Competition | Can two parties want the same thing at the same moment? | Uniqueness rules, competing claims | yes: who wins, and what does the other see? |
30
30
  | On behalf | Does anyone do this for someone else, or override it? | Authority and denial | yes: may they, and must we record who acted? |
31
- | In any order | After this, which next steps must wait for each other and which need not? | Ordering, later automations | they need not: say so in the feature description |
31
+ | In any order | After this, which next steps must wait for each other and which need not? | Ordering, later automations | they need not: say so in the feature `documentation` |
32
32
  | Instead | At this point, what else could happen instead, including nothing? | Branches and endings | "nothing": does it expire or wait forever? |
33
33
 
34
34
  ## Interview flow
@@ -61,8 +61,8 @@ into exactly one of these:
61
61
 
62
62
  1. **Executable.** An `authorize` gate with a role, claim or authenticated policy the persona
63
63
  does not satisfy, or an ownership policy (`claim "x" matches subject|<command property>`),
64
- plus a `then denied` specification whose `given caller` carries the roles and claims that
65
- stand for that persona (`cratis-screenplay-scenario-coverage`). Every command and query
64
+ plus a `then denied` specification using `given caller as <Persona>` for a
65
+ synthesized witness, or an explicit effective-gate caller (`cratis-screenplay-scenario-coverage`). Every command and query
66
66
  under an inherited module or feature `authorize` gets its own denial spec. Ownership
67
67
  against a Uuid-backed identifier is not renderable today (STAGE-ESM-015): note it.
68
68
  2. **Gap or target requirement.** The check depends on stored state ("only the requester may
@@ -74,8 +74,11 @@ into exactly one of these:
74
74
  Anything not yet resolved is an open question. Do not write Cannot lines for rules that bind
75
75
  everyone (business rules, not authority).
76
76
 
77
- A spec that passes is not a persona check by itself: it proves the gate refuses a caller with
78
- those roles and claims. Say which fixture stands for which persona.
77
+ A passing spec proves the gate refuses that caller, not every caller fitting a
78
+ persona. `given caller as <Persona>` chooses one authenticated policy witness;
79
+ inspect its `or` choice. Use explicit fixtures for anonymous callers, ownership
80
+ claims, missing gate conjuncts or refused synthesis. Name which witness stands
81
+ for which persona.
79
82
 
80
83
  ## Cannot resolved to an executable gate
81
84
 
@@ -13,8 +13,9 @@
13
13
 
14
14
  Plotting arranges the discovered events as a narrative: what happens first, what depends on
15
15
  what, what can happen instead, where it ends. In Screenplay the plot is written into the
16
- model (slice and feature `description` text) and into STATE.md; files sort by name, so story
17
- order is never carried by structure.
16
+ model (fenced `documentation` on slices and features) and into STATE.md. Board order is the
17
+ authored declaration and import order; it is presentation, not causation, so write causes and
18
+ dependencies down.
18
19
 
19
20
  ## 1. Sequence
20
21
 
@@ -23,7 +24,7 @@ what came before it, what made it happen, what is it only allowed under?
23
24
 
24
25
  ## 2. Record after / caused by / only if
25
26
 
26
- Write these three into the `description` of the `StateChange` slice that produces the event:
27
+ Write these three into the `documentation` of the `StateChange` slice that produces the event:
27
28
 
28
29
  ```text
29
30
  After: BerthRequested
@@ -48,7 +49,7 @@ At every event, not only at forks someone mentions:
48
49
 
49
50
  - What can happen next *instead*, including nothing? Does "nothing" expire, or wait forever?
50
51
  - Which next steps may happen in any order, and which must wait for each other? Unordered
51
- successors become automations or ordering specs later; say so in the feature description.
52
+ successors become automations or ordering specs later; say so in the feature `documentation`.
52
53
  - On failure or refusal, what compensates, and is the refusal itself a fact the business must
53
54
  remember (a decision) or just a rejection (a scenario later)?
54
55
 
@@ -62,7 +63,7 @@ thing from the views that listed it).
62
63
 
63
64
  ## 4. Plot output format
64
65
 
65
- Put a compact story line in the feature `description` and report the plot per workflow:
66
+ Put a compact story line in the feature `documentation` and report the plot per workflow:
66
67
 
67
68
  ```text
68
69
  The plot: SeasonalBerths
@@ -92,7 +93,7 @@ Switch only at a genuine handoff (a boat owner requests a berth, then the Harbou
92
93
  act on it) or as a deliberate cutaway to show what another persona sees. A change to another
93
94
  persona's read model is not automatically a new beat; it earns one only when that persona
94
95
  would look at it as the next step. Do not alternate personas for symmetry. Carry each real
95
- handoff into the feature `description` and the slice-design handoff packet; a cutaway is
96
+ handoff into the feature `documentation` and the slice-design handoff packet; a cutaway is
96
97
  marked as such there.
97
98
 
98
99
  ```text
@@ -105,7 +106,7 @@ Alternating: Harbourmaster, BoatOwner, Harbourmaster, BoatOwner with no handoff
105
106
  When the story is about a *view* rather than a stream (a waiting list, a work queue, a berth
106
107
  board), a set of isolated before/after pairs hides what the user cares about: the same read
107
108
  model changing over time. Note it as one narrated walkthrough in STATE.md and the feature
108
- `description`: empty, then an item added, then the item done or failed, then removed, naming
109
+ `documentation`: empty, then an item added, then the item done or failed, then removed, naming
109
110
  the event that causes each step. It is a seed only; discovery writes no specification.
110
111
  `cratis-screenplay-scenario-coverage` turns it into cumulative lifecycle specifications on
111
112
  the read model, and `cratis-screenplay-automations-and-translations` owns the work-queue
@@ -29,7 +29,7 @@ then reports what changed and asks one question. The user should always be able
29
29
  | rename | better business name for an existing fact | identity-affecting once persisted: see SKILL.md |
30
30
  | split | one name was covering two facts | keep the original if it is persisted; add the second |
31
31
  | merge | two names for one fact | only when they truly mean the same thing |
32
- | reorder | the story order changed | change declaration/import order for the board; update the feature `description`/STATE.md for causes and branches |
32
+ | reorder | the story order changed | change declaration/import order for the board; update the feature `documentation`/STATE.md for causes and branches |
33
33
  | drop | not a fact after all | record why in STATE.md |
34
34
  | none | already modeled | say so briefly |
35
35
 
@@ -68,7 +68,7 @@ What a model looks like after the first workflow has been stormed: no commands,
68
68
  or screens yet. Slices are named after the command expected to produce each event. At
69
69
  Screenplay 4.125.0, boards use authored declaration/import order, and MCP `expand-layout`
70
70
  preserves it with imports. An import-less `PlayFileWriter.Expand` layout still falls back to
71
- path order. Order is presentation only; the feature `description` records causes and branches.
71
+ path order. Order is presentation only; the feature `documentation` records causes and branches.
72
72
  Persona `description` text holds Does / Reads / Cannot on one quoted line here; the multi-line fenced
73
73
  form is in `personas-and-causes.md`.
74
74
 
@@ -3,6 +3,7 @@
3
3
  "input": "We are starting a new model for a marina that hands out seasonal berths. Here are rough notes from the harbourmaster. Find the events, the roles and the story, and put them straight into the .play model.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  { "kind": "skill-contains", "value": "## Interview phase" },
7
8
  { "kind": "skill-contains", "value": "Unattended: assume visibly" },
8
9
  { "kind": "skill-contains", "value": "Does / Reads / Cannot" },
@@ -191,6 +191,16 @@ do not assume; it lands as `module`, `persona` and `import`; protocol in
191
191
  `cratis-screenplay-discovery`). Phase 2 designs one workflow at a time through all nine steps
192
192
  ([nine-steps.md](references/nine-steps.md): activities, Screenplay output, questions).
193
193
 
194
+ ## Keep modeling reasoning with its declaration
195
+
196
+ Use `description` for summaries and fenced Markdown `documentation` on modules,
197
+ features, slices, commands, read models and reactions (also events) for assumptions,
198
+ boundaries and rejected alternatives. Do not leave that reasoning only in comments
199
+ or disconnected notes. Both are report-only (PLAY0270), never executable rules.
200
+ Specifications use `description` to name the witnessed behavior; longer reasoning
201
+ belongs to their slice. Syntax, merge rules and diagnostics:
202
+ [model reasoning](../cratis-screenplay-slice-design/references/model-reasoning.md).
203
+
194
204
  ## The prime directive: do not lose information
195
205
 
196
206
  Store what happened (events), not just current state. Events are immutable
@@ -113,7 +113,7 @@ identity), `authorize`, and `produces`. Excerpt: the complete document is
113
113
  fact, and fenced Markdown `documentation` when its meaning needs elaboration.
114
114
  Alternatively, declare it in the command with `produces event` and typed mappings.
115
115
 
116
- ```screenplay excerpt
116
+ ```screenplay excerpt parent=references/invoicing-example.md#1
117
117
  // Parent: references/invoicing-example.md (complete document), slice RegisterInvoice
118
118
  slice StateChange RegisterInvoice
119
119
  command RegisterInvoice
@@ -164,7 +164,7 @@ A `from` without a key never inherits another `from`'s key, and a projection-lev
164
164
  `key` routes nothing (`PLAY0381`). Excerpt: the complete document is
165
165
  [invoicing-example.md](invoicing-example.md); both events target the invoice's event source.
166
166
 
167
- ```screenplay excerpt
167
+ ```screenplay excerpt parent=references/invoicing-example.md#1
168
168
  // Parent: references/invoicing-example.md (complete document), slice InvoiceList
169
169
  slice StateView InvoiceList
170
170
  readmodel InvoiceListReadModel
@@ -215,8 +215,7 @@ reaction's `reads UnpaidInvoice` is report-only metadata at 4.66.0 (information
215
215
  it does not make the model consult the view. Binding therefore admits only a scheduled
216
216
  invocation that records a timestamp. Choosing which invoices are overdue (due date before the
217
217
  clock instant) is a target-side decision: record it as gap-fill with the model as the
218
- contract (`cratis-screenplay-render-and-gap-fill`), and say so in the slice description as
219
- the example does. Do not claim the specification proves the overdue decision.
218
+ contract (`cratis-screenplay-render-and-gap-fill`), and say so in the slice `documentation`. Do not claim the specification proves the overdue decision.
220
219
 
221
220
  ```screenplay
222
221
  domain Acme.Invoicing
@@ -3,6 +3,7 @@
3
3
  "input": "Facilitate an event modeling session and land the model as .play source.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "play-compiles" },
6
7
  {
7
8
  "kind": "skill-contains",
8
9
  "value": "main `fd18129`"
@@ -148,7 +148,7 @@ chain per slice before handoff (evidence template); never manufacture references
148
148
  `<Noun>Updated`): split by intent;
149
149
  - refusals: input or constraint rejection is `validate` / `require` / constraint plus
150
150
  `then error` with the exact message from code; authorization refusal is `authorize` plus
151
- `then denied`. Legacy HTTP codes and check order go in the description;
151
+ `then denied`. Legacy HTTP codes and check order go in the slice `documentation`;
152
152
  - a state-dependent rule is `reads <View>` + `require ... message "..."`, marked **NOT enforced
153
153
  in the model today**, target named; a unique index with business meaning becomes
154
154
  `unique ... on <every event that sets it>` with `released by`
@@ -20,7 +20,7 @@ What to notice:
20
20
  - The nightly hook reset (E4) is unexplained, so it is not modeled; it stays an open question
21
21
  (Q5) in the loss report.
22
22
 
23
- ```screenplay
23
+ ```screenplay test=unbound
24
24
  // An intentional candidate re-sliced from as-is evidence. DESIGN MODE.
25
25
  // Evidence ids refer to rows like those in evidence-table-template.md: the legacy
26
26
  // POST /api/checkins inserted Checkins and updated Hooks (E1); here that becomes one