@cratis/pi 7.24.0 → 7.26.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.
- package/package/corpus/skills/cratis-application-slice-conformance/verification.json +3 -0
- package/package/corpus/skills/cratis-arc-react-page/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/assets/pending-certificates.play +10 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/assets/retry-sweep.play +11 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +3 -3
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +1 -1
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/refusals-and-redelivery.md +1 -1
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +2 -2
- package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +1 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +1 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +1 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-discovery/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +2 -2
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-model-review/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +6 -6
- package/package/corpus/skills/cratis-screenplay-projections/references/pdl-grammar.md +7 -7
- package/package/corpus/skills/cratis-screenplay-projections/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +6 -6
- package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +1 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +1 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +6 -6
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +1 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +1 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract-exceptions.json +44 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +20246 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +7 -7
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +6 -6
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +1 -0
- package/package/corpus/skills/cratis-specification-by-example/verification.json +14 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +1 -0
- package/package.json +1 -1
|
@@ -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
|
package/package/corpus/skills/cratis-screenplay-automations-and-translations/assets/retry-sweep.play
ADDED
|
@@ -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
|
|
@@ -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
|
package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json
CHANGED
|
@@ -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
|
|
@@ -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
|
package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md
CHANGED
|
@@ -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" },
|
|
@@ -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" },
|
|
@@ -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
|
|
@@ -24,7 +24,7 @@ then hands off to review (P5) and acceptance (P6).
|
|
|
24
24
|
## When to use / when not
|
|
25
25
|
|
|
26
26
|
- Use: understanding an inherited system, planning a modernization or migration, documenting
|
|
27
|
-
behaviour as Screenplay, reconciling `screenplay generate` or Prologue output, planning a
|
|
27
|
+
behaviour as Screenplay, reconciling `cratis screenplay generate` or Prologue output, planning a
|
|
28
28
|
side-car next to a frozen system (`references/side-car-migration.md`).
|
|
29
29
|
- Not for: greenfield modeling, reviewing the candidate, diagnosing a running Chronicle system,
|
|
30
30
|
rendering or delivering code, or changing code-first application code (routes below).
|
package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md
CHANGED
|
@@ -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
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"input": "We inherited a legacy ASP.NET application with a SQL Server database and no documentation. Help us turn it into a Screenplay model before we modernize it.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "play-compiles" },
|
|
6
7
|
{
|
|
7
8
|
"kind": "skill-contains",
|
|
8
9
|
"value": "loss report"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"input": "Review the marina berth .play model before we accept it: check the model and report findings, do not change anything.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "play-compiles" },
|
|
6
7
|
{ "kind": "skill-contains", "value": "PASS WITH WARNINGS" },
|
|
7
8
|
{ "kind": "skill-contains", "value": "Every finding is pinned to one declaration" },
|
|
8
9
|
{ "kind": "skill-contains", "value": "edit request" },
|
|
@@ -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
|
|
@@ -263,7 +263,7 @@ real application declares 76 queries under 37 distinct names, with `All` appeari
|
|
|
263
263
|
Reach across slices by qualifying with **any trailing part** of the scope.
|
|
264
264
|
Excerpt: `Queue` and `Deviations` are sibling slices that each declare `All`.
|
|
265
265
|
|
|
266
|
-
```screenplay
|
|
266
|
+
```screenplay excerpt
|
|
267
267
|
screen OverviewScreen
|
|
268
268
|
data QueueReadModel[] via query Queue.All
|
|
269
269
|
data DeviationReadModel[] via query Preparation.Deviations.All
|
|
@@ -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?" },
|
|
@@ -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"
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md
CHANGED
|
@@ -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,
|
|
@@ -18,7 +18,7 @@ scaffold. Stage 4.51.3 pins Arc 22.50.5/Chronicle 19.32.0: protected-read APIs a
|
|
|
18
18
|
available to gap-fill, not emitted protection or `.play` rule admission. The
|
|
19
19
|
original compiled source is retained unchanged.
|
|
20
20
|
|
|
21
|
-
```screenplay
|
|
21
|
+
```screenplay expect PLAY0516 test=unbound
|
|
22
22
|
// Scenario coverage design-mode example: stored-state rules of invoicing club dues (complete document).
|
|
23
23
|
// Design mode: `reads` is PLAY0271 and `require` over a view is PLAY0268 at binding (the only
|
|
24
24
|
// blockers), so this model compiles but is not executable; the specifications below do not run. The runnable counterpart
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md
CHANGED
|
@@ -33,7 +33,7 @@ Screenplay specifications.
|
|
|
33
33
|
|
|
34
34
|
## 1. Command: success, rule rejection and denial
|
|
35
35
|
One spec for the success, one per rule (varying only the value the rule checks), one denial.
|
|
36
|
-
```screenplay excerpt
|
|
36
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
37
37
|
specification IssuingAnInvoice
|
|
38
38
|
given caller
|
|
39
39
|
authenticated
|
|
@@ -71,7 +71,7 @@ specification RefusingACallerWithoutTheAccountsRole
|
|
|
71
71
|
After which earlier facts must the command be refused? Establish the wrong state with its real
|
|
72
72
|
facts, not a description of it. Settling a voided invoice and voiding a settled one are different
|
|
73
73
|
questions: one spec each.
|
|
74
|
-
```screenplay excerpt
|
|
74
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
75
75
|
specification RejectingSettlementOfAVoidedInvoice
|
|
76
76
|
given caller
|
|
77
77
|
authenticated
|
|
@@ -103,7 +103,7 @@ in `invoicing-dues-design.md`; it is never prose and never a spec that pretends
|
|
|
103
103
|
Two separate obligations. First, the **capture specification**: concrete external input in, our
|
|
104
104
|
facts out. The provider's refusal is a fact (never a `then error`), kept in the provider's
|
|
105
105
|
vocabulary and then translated.
|
|
106
|
-
```screenplay excerpt
|
|
106
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
107
107
|
specification TranslatingADeclinedCardResult
|
|
108
108
|
when capture PaymentGatewayResults
|
|
109
109
|
reference = "9c1f0a52-6a4e-4b1c-9f55-0d2c7b8e1a01"
|
|
@@ -121,7 +121,7 @@ Second, the **retry**. `PaymentRequested` only says we asked the gateway; it is
|
|
|
121
121
|
After the decline, requesting again is an ordinary accepted command, and its exact declared
|
|
122
122
|
outcome is `PaymentRequested`, not `PaymentReceived`: the eventual success is a later external
|
|
123
123
|
fact that arrives through the capture, not something this command produces.
|
|
124
|
-
```screenplay excerpt
|
|
124
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
125
125
|
specification RetryingPaymentAfterADecline
|
|
126
126
|
given caller
|
|
127
127
|
authenticated
|
|
@@ -149,7 +149,7 @@ lists the declared consequence (`RefundRequested`); the reaction is also specifi
|
|
|
149
149
|
`RefundRequested` is a recorded request, not proof that money moved, and there is no
|
|
150
150
|
`then <Command>` form. What the target must do to deliver the refund is a requirement, not a spec.
|
|
151
151
|
From `invoicing-dues-design.md` (design mode; the specs do not run at 4.66.0):
|
|
152
|
-
```screenplay excerpt
|
|
152
|
+
```screenplay excerpt parent=references/invoicing-dues-design.md#1 expect PLAY0516 test=unbound
|
|
153
153
|
specification ReversingAReceivedPayment
|
|
154
154
|
given caller
|
|
155
155
|
authenticated
|
|
@@ -185,7 +185,7 @@ ask. Voiding an issued invoice that is not yet paid is the other compensation (t
|
|
|
185
185
|
A repeated event type can matter as much as a multi-event lifecycle. Two top-ups of 40 and 70
|
|
186
186
|
walk a balance to 110; give the second occurrence as the action so the accumulation is what is
|
|
187
187
|
tested.
|
|
188
|
-
```screenplay excerpt
|
|
188
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
189
189
|
specification MemberCreditAccumulatesTopUps
|
|
190
190
|
given caller
|
|
191
191
|
authenticated
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md
CHANGED
|
@@ -62,7 +62,7 @@ both that the stored row is gone and that the keyed query returns nothing. The w
|
|
|
62
62
|
(no key) is a design-mode expectation here: a list-query collection check does not run on the
|
|
63
63
|
reference route, so record it in the matrix rather than asserting it.
|
|
64
64
|
The source document also asserts the other terminal outcomes (`InvoiceVoided`, `InvoiceSettled`) the same way; they are not copied here.
|
|
65
|
-
```screenplay excerpt
|
|
65
|
+
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
66
66
|
specification OpenInvoicesLifecycle1Empty
|
|
67
67
|
given caller
|
|
68
68
|
authenticated
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"input": "Write the specifications for a ReserveBerth command and its read model, and tell me what coverage is missing.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "play-compiles" },
|
|
6
7
|
{ "kind": "skill-contains", "value": "Coverage matrix before any spec" },
|
|
7
8
|
{ "kind": "skill-contains", "value": "Once, idempotent, exactly once are different claims" },
|
|
8
9
|
{ "kind": "skill-contains", "value": "Unauthorized is never `then error`" },
|
|
@@ -89,7 +89,7 @@ Example: Payroll declares Timesheets; its Handover feature declares
|
|
|
89
89
|
Timesheets.Approval and sibling Runs. These are dependency inventories, not
|
|
90
90
|
actual references or execution dependencies:
|
|
91
91
|
|
|
92
|
-
```screenplay
|
|
92
|
+
```screenplay expect PLAY0553
|
|
93
93
|
module Payroll
|
|
94
94
|
depends on Timesheets
|
|
95
95
|
feature Handover
|
|
@@ -23,7 +23,7 @@ Stage 4.51.3 pins Arc 22.50.5/Chronicle 19.32.0, so protected-read APIs are avai
|
|
|
23
23
|
to gap-fill; this neither admits these `.play` rules nor proves target protection.
|
|
24
24
|
The original compiled excerpt is retained unchanged.
|
|
25
25
|
|
|
26
|
-
```screenplay
|
|
26
|
+
```screenplay expect PLAY0516 test=unbound
|
|
27
27
|
domain Parcelpoint.Lockers
|
|
28
28
|
|
|
29
29
|
concept LockerId : Uuid
|
package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md
CHANGED
|
@@ -120,7 +120,7 @@ is optional but typed against the routed source when present.
|
|
|
120
120
|
This complete syntax-only model validates on 4.127.0; `screenplay test` reports
|
|
121
121
|
PLAY0268 for redelivery, not a passing scenario:
|
|
122
122
|
|
|
123
|
-
```screenplay
|
|
123
|
+
```screenplay test=unbound
|
|
124
124
|
eventsource Account
|
|
125
125
|
identifier String
|
|
126
126
|
stream Transactions
|