@cratis/pi 7.179.0 → 7.179.1
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-screenplay-command-surface/SKILL.md +5 -3
- package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +13 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +139 -17
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +10 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +20 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/references/performer-bodies.md +32 -5
- package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +5 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +6 -5
- package/package/corpus/skills/cratis-screenplay-specifications/references/host-body-execution.md +25 -5
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +6 -4
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +2 -0
- package/package.json +1 -1
|
@@ -74,11 +74,12 @@ Keep to it.
|
|
|
74
74
|
A file/code `handler` beside unconditional `produces`, with a resolved nonempty body,
|
|
75
75
|
binds as the v23 result contract: `produces` fixes the
|
|
76
76
|
events and the body owns their property values. Without `produces` or a `may produce` block
|
|
77
|
-
(ESM v35:
|
|
77
|
+
(result v2, ESM v35: an ordered subset/multiset, source binding from 5.4.0), with `produces ... when`,
|
|
78
78
|
or with an unresolved body (even with `may produce`) it fails binding with PLAY0800. A pending
|
|
79
79
|
`handler implementation` beside unconditional `produces` is a described command (ESM v23).
|
|
80
80
|
Prefer plain `produces` for declarative logic. Read [described handlers](references/described-handlers.md)
|
|
81
|
-
for
|
|
81
|
+
for contracts, version gates and refusals. The standalone runner has no provider; a host can
|
|
82
|
+
execute verified policy/handler bodies. Binding or a descriptor is not execution evidence.
|
|
82
83
|
|
|
83
84
|
## `identifier` — the stream boundary decision
|
|
84
85
|
|
|
@@ -191,7 +192,8 @@ A continuation line extends the clause.
|
|
|
191
192
|
- Several `authorize` lines on one command or query combine with AND, in authored
|
|
192
193
|
order; a `module` or `feature` gate is ANDed too, so an `or` never bypasses another gate.
|
|
193
194
|
- Evaluation short-circuits left to right, module → feature → command. A policy implemented
|
|
194
|
-
in code
|
|
195
|
+
in code is Unsupported without a host provider (always on standalone); a configured host can
|
|
196
|
+
return Allow/Deny. Read [host body execution](../cratis-screenplay-specifications/references/host-body-execution.md).
|
|
195
197
|
|
|
196
198
|
## Inline events and destinations
|
|
197
199
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- The four contexts
|
|
6
|
+
- Discovering a handler's result contract
|
|
6
7
|
- The values they carry
|
|
7
8
|
- Reaching the context declaratively
|
|
8
9
|
- Caller paths and identity details
|
|
@@ -60,6 +61,18 @@ the full command shape, including generated properties. Sidecars belong to the s
|
|
|
60
61
|
compilation/revision as their requirements, not a shape borrowed from another model.
|
|
61
62
|
Source: `Documentation/screenplay/context.md`.
|
|
62
63
|
|
|
64
|
+
## Discovering a handler's result contract
|
|
65
|
+
|
|
66
|
+
Use `read-workspace` or `read-proposal` with `view: "typed-contexts"`, alongside
|
|
67
|
+
`implementation-requirements` from the same compilation/revision. Since Screenplay 4.257.0,
|
|
68
|
+
handler descriptors add optional `resultVersion` and `result` (with its own `resultVersion` and
|
|
69
|
+
`entries`). Inspect `result.entries`: each entry carries `eventContract`, `eventName`,
|
|
70
|
+
`eventRevision`, `payload`, `destinationKind`, `destinationProperty` and `destinationType`.
|
|
71
|
+
These identify the declared event/payload shape and scalar or one-of destination contract;
|
|
72
|
+
do not infer types from names or invent wrapper signatures. Older/legacy descriptors omit both
|
|
73
|
+
additions; absence is not a guessed result contract. Typed descriptors and attachment hashes
|
|
74
|
+
are inspection evidence, not execution or proof that a renderer admits the wrapper.
|
|
75
|
+
|
|
63
76
|
## The values they carry
|
|
64
77
|
|
|
65
78
|
| Type | Members |
|
package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md
CHANGED
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
7
7
|
|
|
8
|
+
- Body-decided events: `may produce`
|
|
8
9
|
- Result contract v1
|
|
9
10
|
- Execution and realization
|
|
10
11
|
|
|
11
12
|
Requires Screenplay 4.182.0 or later (`screenplay --version`); older compilers refuse pending handlers with PLAY0268.
|
|
12
13
|
|
|
13
14
|
Use a described command when payload computation needs words rather than an invented
|
|
14
|
-
expression. Prefer ordinary `produces` when the logic is declarative.
|
|
15
|
-
|
|
15
|
+
expression. Prefer ordinary `produces` when the logic is declarative. A body cannot reject a
|
|
16
|
+
command. Fixed v1 productions cannot vary event count; use v2 possible events below for that.
|
|
16
17
|
|
|
17
18
|
Complete model:
|
|
18
19
|
|
|
@@ -43,19 +44,139 @@ One wrapper and at most one payload are permitted. Attaching a file or fence mak
|
|
|
43
44
|
an attached handler. Beside unconditional `produces`, with a resolved, nonempty,
|
|
44
45
|
language-tagged body, it binds with the same v23 result contract (Screenplay 4.250.0,
|
|
45
46
|
decision 0117): the productions fix event types, count, order and destinations, and
|
|
46
|
-
the body owns property values.
|
|
47
|
-
(`ImplementationBody`) and appends nothing.
|
|
47
|
+
the body owns property values. The standalone runner has no provider: reaching the body is
|
|
48
|
+
Unsupported (`ImplementationBody`) and appends nothing. A host may execute verified result-v1
|
|
49
|
+
or result-v2 bodies through `HandleAsync`; see
|
|
50
|
+
[host body execution](../../cratis-screenplay-specifications/references/host-body-execution.md).
|
|
51
|
+
An attached handler with neither unconditional
|
|
48
52
|
`produces` nor a `may produce` block, with `produces ... when`, or with an empty or
|
|
49
53
|
unresolved body fails binding with PLAY0800 (`CommandHandlerRequiresAttachment`): declare
|
|
50
54
|
unconditional `produces`, declare a `may produce` block, split variable outcomes into
|
|
51
55
|
separate commands, or attach a resolved body.
|
|
52
56
|
|
|
53
|
-
A resolved, nonempty, language-tagged handler can instead declare a `may produce` block
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
A resolved, nonempty, language-tagged handler can instead declare a `may produce` block:
|
|
58
|
+
result v2, ESM v35. The syntax requires Screenplay 4.256.0, the provider seam requires 4.257.0,
|
|
59
|
+
and source binding requires 5.4.0 (`screenplay --version`). These are separate gates, not
|
|
60
|
+
proof that a target executes the body. A pending `handler implementation` remains a described command.
|
|
61
|
+
|
|
62
|
+
## Body-decided events: `may produce`
|
|
63
|
+
|
|
64
|
+
Inside `handler`, the block lists permitted events and destinations. The body returns an ordered
|
|
65
|
+
subset or multiset, including an empty result; repetitions and returned order are meaningful.
|
|
66
|
+
A scalar `for batchId` uses that command property; `for one of parcelIds` requires an explicit
|
|
67
|
+
returned destination belonging to that command collection. Destinations must be required:
|
|
68
|
+
scalar properties may be generated only when they are the identifier; one-of collections cannot
|
|
69
|
+
be generated. Omitting `for` requires exactly one identifier. Declare each event identity once;
|
|
70
|
+
this does not prohibit repeated returned items. Invalid sets/destinations are PLAY0823.
|
|
71
|
+
The block cannot coexist with `produces` (PLAY0822/PLAY0823). An attached empty/unresolved body
|
|
72
|
+
still fails PLAY0800; with no body or implementation declaration at all, the set is invalid
|
|
73
|
+
(PLAY0823). Pending `implementation` is described intent, not execution permission.
|
|
74
|
+
Conditional `produces` is not an alternative. A handler cannot read views: put state-dependent
|
|
75
|
+
decisions in declarative `require`, not an invented read API.
|
|
76
|
+
|
|
77
|
+
````screenplay test=unbound
|
|
78
|
+
domain Dispatching
|
|
79
|
+
|
|
80
|
+
module Parcels
|
|
81
|
+
feature Shipping
|
|
82
|
+
slice StateChange Dispatch
|
|
83
|
+
command DispatchParcels
|
|
84
|
+
batchId String identifier
|
|
85
|
+
parcelIds String[]
|
|
86
|
+
dispatch Bool
|
|
87
|
+
handler
|
|
88
|
+
may produce
|
|
89
|
+
BatchDispatched for batchId
|
|
90
|
+
ParcelDispatched for one of parcelIds
|
|
91
|
+
```csharp
|
|
92
|
+
if (Dispatch)
|
|
93
|
+
{
|
|
94
|
+
result.Add(new BatchDispatched(context.Occurred));
|
|
95
|
+
foreach (var id in ParcelIds)
|
|
96
|
+
result.Add(id, new ParcelDispatched(context.Occurred));
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
event BatchDispatched
|
|
101
|
+
dispatchedAt DateTime
|
|
102
|
+
|
|
103
|
+
event ParcelDispatched
|
|
104
|
+
dispatchedAt DateTime
|
|
105
|
+
|
|
106
|
+
screen DispatchParcels
|
|
107
|
+
action DispatchParcels for screen
|
|
108
|
+
|
|
109
|
+
specification DispatchRequiresAHost
|
|
110
|
+
when DispatchParcels
|
|
111
|
+
batchId = "B1"
|
|
112
|
+
parcelIds
|
|
113
|
+
item "P1"
|
|
114
|
+
dispatch = false
|
|
115
|
+
then no events
|
|
116
|
+
````
|
|
117
|
+
|
|
118
|
+
All three models are source-valid; `test=unbound` pins the standalone verdict, not a passing
|
|
119
|
+
execution. The first binds but needs a provider. The next two fail executable binding with PLAY0800
|
|
120
|
+
(the focused spec checks the structured diagnostics). Conditional productions cannot replace
|
|
121
|
+
possible events:
|
|
122
|
+
|
|
123
|
+
````screenplay test=unbound
|
|
124
|
+
domain ConditionalDispatch
|
|
125
|
+
|
|
126
|
+
module Parcels
|
|
127
|
+
feature Shipping
|
|
128
|
+
slice StateChange Dispatch
|
|
129
|
+
command DispatchParcels
|
|
130
|
+
batchId String identifier
|
|
131
|
+
enabled Bool
|
|
132
|
+
produces when enabled == true
|
|
133
|
+
BatchDispatched
|
|
134
|
+
for batchId
|
|
135
|
+
handler
|
|
136
|
+
```csharp
|
|
137
|
+
return new BatchDispatched(context.Occurred);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
event BatchDispatched
|
|
141
|
+
dispatchedAt DateTime
|
|
142
|
+
|
|
143
|
+
screen DispatchParcels
|
|
144
|
+
action DispatchParcels for screen
|
|
145
|
+
|
|
146
|
+
specification ConditionalHandlerIsUnbound
|
|
147
|
+
when DispatchParcels
|
|
148
|
+
batchId = "B1"
|
|
149
|
+
enabled = false
|
|
150
|
+
then no events
|
|
151
|
+
````
|
|
152
|
+
|
|
153
|
+
An attached empty body does not establish an executable handler (PLAY0800):
|
|
154
|
+
|
|
155
|
+
````screenplay test=unbound
|
|
156
|
+
domain EmptyDispatchBody
|
|
157
|
+
|
|
158
|
+
module Parcels
|
|
159
|
+
feature Shipping
|
|
160
|
+
slice StateChange Dispatch
|
|
161
|
+
command DispatchParcels
|
|
162
|
+
batchId String identifier
|
|
163
|
+
handler
|
|
164
|
+
may produce
|
|
165
|
+
BatchDispatched for batchId
|
|
166
|
+
```csharp
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
event BatchDispatched
|
|
170
|
+
dispatchedAt DateTime
|
|
171
|
+
|
|
172
|
+
screen DispatchParcels
|
|
173
|
+
action DispatchParcels for screen
|
|
174
|
+
|
|
175
|
+
specification EmptyHandlerIsUnbound
|
|
176
|
+
when DispatchParcels
|
|
177
|
+
batchId = "B1"
|
|
178
|
+
then no events
|
|
179
|
+
````
|
|
59
180
|
|
|
60
181
|
Requires Screenplay 4.250.0 (`screenplay --version`) for attached handlers beside `produces` to bind; 4.210.0 to 4.249.x refuse every attached handler with PLAY0800, and older binders use PLAY0268. Hosts switch on the code and read `arguments.subject`, never parse the message.
|
|
61
182
|
|
|
@@ -82,18 +203,19 @@ explicitly admit this version, never silently drop the body.
|
|
|
82
203
|
| --- | --- |
|
|
83
204
|
| PLAY0800 (error) | File/inline handler with neither unconditional `produces` nor a `may produce` block, or without a resolved, nonempty body; `subject` identifies the command |
|
|
84
205
|
| PLAY0695 (information) | Described command admitted; command and RequirementId name the missing body |
|
|
85
|
-
| PLAY0696 (error) |
|
|
206
|
+
| PLAY0696 (error) | Pending v1 without productions, including response-only; add unconditional productions or declare v2 possible events |
|
|
86
207
|
| PLAY0697 (error) | Conditional productions; result v1 needs unconditional events |
|
|
87
208
|
| PLAY0698 (error) | Pending intent plus another handler; keep one handler |
|
|
88
209
|
| PLAY0492–0494 | Invalid wrapper, hint or payload composition; fix the source shape |
|
|
89
210
|
|
|
90
211
|
## Execution and realization
|
|
91
212
|
|
|
92
|
-
|
|
93
|
-
returns Unsupported (`ImplementationBody`) on reaching the body,
|
|
94
|
-
RequirementId. This also applies through an invoking reaction. No payload
|
|
95
|
-
and no event is emitted. Denial and validation specifications still execute.
|
|
96
|
-
specifications are counted separately; an all-Unsupported run is never green.
|
|
213
|
+
Without both a resolved body and a host provider, reference execution runs the gates, routing and
|
|
214
|
+
generation in ordinary order, then returns Unsupported (`ImplementationBody`) on reaching the body,
|
|
215
|
+
naming command and RequirementId. This also applies through an invoking reaction. No payload
|
|
216
|
+
mapping runs and no event is emitted. Denial and validation specifications still execute.
|
|
217
|
+
Unsupported specifications are counted separately; an all-Unsupported run is never green.
|
|
218
|
+
Host execution does not authorize invented context values or domain logic.
|
|
97
219
|
|
|
98
220
|
Stage admits v23 but refuses described handlers with STAGE-IMPL-002 in the renderer,
|
|
99
221
|
Host and specification executor, including Stub mode: it emits no stubs. Hand-write
|
|
@@ -107,4 +229,4 @@ still refuses a pending body or one resolved in another language with STAGE-IMPL
|
|
|
107
229
|
|
|
108
230
|
Validate the model root with `screenplay <root> --warnaserror`; expect no errors or
|
|
109
231
|
warnings and PLAY0695 information. Run `screenplay test <root>` separately: body-reaching
|
|
110
|
-
specifications must be reported Unsupported, not passed. Target tests are separate.
|
|
232
|
+
specifications on the standalone runner must be reported Unsupported, not passed. Target tests are separate.
|
|
@@ -3,6 +3,10 @@
|
|
|
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": "skill-contains", "value": "result v2, ESM v35", "file": "references/described-handlers.md" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "for one of parcelIds", "file": "references/described-handlers.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "source binding requires 5.4.0", "file": "references/described-handlers.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "result.entries", "file": "references/context.md" },
|
|
6
10
|
{ "kind": "skill-contains", "value": "same concept", "file": "references/uuid-equality.md" },
|
|
7
11
|
{ "kind": "skill-contains", "value": "lowercase hyphenated Uuid", "file": "references/uuid-equality.md" },
|
|
8
12
|
{ "kind": "play-compiles" },
|
|
@@ -846,6 +846,16 @@ Untouched files remain byte-identical.
|
|
|
846
846
|
|
|
847
847
|
## Code attachments
|
|
848
848
|
|
|
849
|
+
`read-workspace` and `read-proposal` also accept `view: "typed-contexts"`. Inspect this beside
|
|
850
|
+
`implementation-requirements` from the same compilation/revision before building a wrapper.
|
|
851
|
+
Since Screenplay 4.257.0, handler descriptors add optional `resultVersion` and `result`
|
|
852
|
+
(with its own `resultVersion` and `entries`). Each `result.entries` item exposes `eventContract`,
|
|
853
|
+
`eventName`, `eventRevision`, `payload`, `destinationKind`, `destinationProperty` and
|
|
854
|
+
`destinationType`: use declared event identities, payload shapes and scalar/one-of destinations,
|
|
855
|
+
not guessed names or invented wrapper signatures. Older/legacy descriptors omit both additions;
|
|
856
|
+
absence is not permission to infer a result contract. `isWrapperReady`, types and hashes are
|
|
857
|
+
inspection evidence, not execution or target admission.
|
|
858
|
+
|
|
849
859
|
`read-workspace` and `read-proposal` accept `view: "implementation-requirements"`.
|
|
850
860
|
Each entry names the role, owner, requirement id, required capability,
|
|
851
861
|
attachment resolution and content hash, plus `bodySpan` and `bodyLines`: a source
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"input": "Author and organize a Screenplay model in a repository.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "view: \"typed-contexts\"", "file": "references/mcp-tools.md" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "result.entries", "file": "references/mcp-tools.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "destinationType", "file": "references/mcp-tools.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "legacy descriptors omit both additions", "file": "references/mcp-tools.md" },
|
|
6
10
|
{ "kind": "skill-contains", "value": "Monaco shows it as a code action", "file": "references/repairs.md" },
|
|
7
11
|
{ "kind": "skill-contains", "value": "reviewed saved-file code action", "file": "references/repairs.md" },
|
|
8
12
|
{ "kind": "skill-contains", "value": "an empty fixed root named `data` cannot rebind", "file": "references/mcp-tools.md" },
|
|
@@ -43,6 +43,24 @@ readmodel AccountBalance
|
|
|
43
43
|
A read model declares what it **is**, not what builds it. The builder points at it
|
|
44
44
|
with `=>`, and **exactly one thing may** (two builders: `PLAY0191`). See `cratis-screenplay-projections` for the builder side.
|
|
45
45
|
|
|
46
|
+
Since Screenplay 4.256.0, each member must be a primitive, concept or top-level reusable `type`
|
|
47
|
+
(including optional/collection forms), not another read-model identity or a slice-local type
|
|
48
|
+
(PLAY0273). Extract an embeddable value shape:
|
|
49
|
+
|
|
50
|
+
```screenplay
|
|
51
|
+
domain DeliveryViews
|
|
52
|
+
|
|
53
|
+
type DeliveryAddress
|
|
54
|
+
street String
|
|
55
|
+
|
|
56
|
+
module Deliveries
|
|
57
|
+
feature Tracking
|
|
58
|
+
slice StateView List
|
|
59
|
+
readmodel DeliverySummary
|
|
60
|
+
id String key
|
|
61
|
+
address DeliveryAddress
|
|
62
|
+
```
|
|
63
|
+
|
|
46
64
|
Use trailing `key` on top-level read-model properties, never `identifier`.
|
|
47
65
|
Explicit marks replace inference; otherwise a single-instance query's `by` supplies
|
|
48
66
|
identity (all such queries must agree). Only with no single-instance identifier
|
|
@@ -184,7 +202,8 @@ arguments and `then result` - see `cratis-screenplay-specifications`.
|
|
|
184
202
|
|
|
185
203
|
#### Performer bodies are rendered
|
|
186
204
|
|
|
187
|
-
Read [performer bodies](references/performer-bodies.md)
|
|
205
|
+
Read [performer bodies](references/performer-bodies.md) for snapshot/live collection contracts,
|
|
206
|
+
lifecycle and context, or rendering versus gap-fill. Screenplay's live contract is not Stage support.
|
|
188
207
|
|
|
189
208
|
|
|
190
209
|
A query's key goes on its own `by` line in the body. `query X => RM optional by id Type`
|
|
@@ -12,11 +12,33 @@ query FiguresInRegion => InvoiceFigures[]
|
|
|
12
12
|
file Queries/FiguresInRegion.cs
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
15
|
+
## Snapshot contract
|
|
16
|
+
|
|
17
|
+
The body returns the read-model instance (or null) for a single query, or
|
|
18
|
+
`IEnumerable<ReadModel>` for a collection. Its `readModels` is the current collection of only
|
|
19
|
+
the declared read model. It sees caller arguments by camelCase name and on `context.Arguments`,
|
|
20
|
+
and `context.Tenant`, `context.Identity` and `context.ReceivedAt`, for example
|
|
19
21
|
`return readModels.Where(figures => figures.Total > 0);`.
|
|
22
|
+
Screenplay's Snapshot Many provider seam `PerformAsync` is not invoked by reference execution:
|
|
23
|
+
performer queries remain outside its executable model, not empty successful results.
|
|
24
|
+
|
|
25
|
+
## Live collection contract
|
|
26
|
+
|
|
27
|
+
Requires Screenplay 4.256.0 for the live collection typed contract.
|
|
28
|
+
|
|
29
|
+
An `observable ReadModel[]` performer has `ContextVersion` 1 and `ResultVersion` 2.
|
|
30
|
+
Its host-defined `LiveReadModels<T>` exposes only `IObservable<IEnumerable<T>>`, where T is the
|
|
31
|
+
declared read model: the initial/current collection and later emissions are complete snapshots, not deltas.
|
|
32
|
+
It does not permit reads of other models or guarantee that changes occur. The body returns
|
|
33
|
+
`IObservable<IEnumerable<ReadModel>>`. An observable single or optional result has no live contract;
|
|
34
|
+
do not extrapolate this collection shape to either.
|
|
35
|
+
|
|
36
|
+
Use one subscription per client; dispose on unsubscribe, disconnect or shutdown. `OnError` and
|
|
37
|
+
`OnCompleted` terminate it; the contract does not resubscribe. Arguments and context are captured
|
|
38
|
+
once per invocation, `ReceivedAt` stays fixed, and context has no cancellation member.
|
|
39
|
+
The host owns subscription lifetime and resource limits, not a fictional context token.
|
|
40
|
+
|
|
41
|
+
## Stage target gate
|
|
20
42
|
|
|
21
43
|
Stage renders the read model record and the query method with its route, parameters (filters in
|
|
22
44
|
declaration order, optional ones defaulted) and the modeled `[Authorize]` policy, and embeds the
|
|
@@ -26,4 +48,9 @@ performer, a non-C# body, a missing, changed or hash-invalid body, or a body tha
|
|
|
26
48
|
becomes an explicit implementation gap instead, with a not-fully-runnable marker (see
|
|
27
49
|
[bodies and implementation gaps](../../cratis-stage-rendering-and-sandbox/references/current-boundaries.md#bodies-and-implementation-gaps)).
|
|
28
50
|
|
|
29
|
-
Requires Stage 4.197.0
|
|
51
|
+
Requires Stage 4.197.0 for supported snapshot performers (`cratis --version`; CLI 3.100.0 bundles Stage 4.196.0).
|
|
52
|
+
Older versions keep gap-fill.
|
|
53
|
+
Screenplay's live type/contract binding is not evidence that this Stage baseline executes live bodies.
|
|
54
|
+
|
|
55
|
+
Source: Screenplay v6.32.0 `Documentation/screenplay/queries.md`, `context.md` and
|
|
56
|
+
`ISemanticBodyExecutionProvider`; Stage renderer behavior is a separate target contract.
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
"input": "Declare a Screenplay query and the screen that binds to it.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "address DeliveryAddress" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "PLAY0273" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "LiveReadModels<T>", "file": "references/performer-bodies.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "complete snapshots, not deltas", "file": "references/performer-bodies.md" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "does not resubscribe", "file": "references/performer-bodies.md" },
|
|
6
11
|
{ "kind": "skill-contains", "value": "query Total => PaymentTotals optional", "file": "references/named-keys.md" },
|
|
7
12
|
{ "kind": "skill-contains", "value": "command reads only", "file": "references/named-keys.md" },
|
|
8
13
|
{ "kind": "skill-contains", "value": "Requires Screenplay 4.204.0 (ESM v27", "file": "references/named-keys.md" },
|
|
@@ -85,9 +85,9 @@ or target tests; name engine, version and expected/discovered selection.
|
|
|
85
85
|
not only `then error`. `then no events` is acceptance and cannot accompany an error. Earlier
|
|
86
86
|
accepted batches/invoked commands remain; legacy absence retains per-fact appends.
|
|
87
87
|
Read [atomic boundaries](../cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md).
|
|
88
|
-
- A described handler binds v23
|
|
89
|
-
|
|
90
|
-
validation cases still run; an all-Unsupported run is never green. Read
|
|
88
|
+
- A pending described handler binds v23 but remains Unsupported ImplementationBody.
|
|
89
|
+
An attached handler (v1 or `may produce` v2) executes only with a host provider; standalone
|
|
90
|
+
has none. Denial/validation cases still run; an all-Unsupported run is never green. Read
|
|
91
91
|
[described handlers](../cratis-screenplay-command-surface/references/described-handlers.md).
|
|
92
92
|
- Protected command reads opt into v25. Test present/absent state and rule refusal;
|
|
93
93
|
matching decide/commit changes are Conflict / DecisionStateChanged, not validation
|
|
@@ -98,8 +98,9 @@ or target tests; name engine, version and expected/discovered selection.
|
|
|
98
98
|
UnsupportedValidation, not a successful check. Read
|
|
99
99
|
[text and match rules](../cratis-screenplay-command-surface/references/text-and-match-rules.md)
|
|
100
100
|
for boundary values and PLAY0699/0787. Reference success is not Stage admission.
|
|
101
|
-
- Opaque rule, validation and reducer bodies
|
|
102
|
-
|
|
101
|
+
- Opaque rule, validation, policy, handler and reducer bodies need a host provider; standalone
|
|
102
|
+
has none. Policy denial, Unsupported admission and typed handler faults are distinct; validate
|
|
103
|
+
a whole v2 result before appending anything. Read
|
|
103
104
|
[host body execution](references/host-body-execution.md).
|
|
104
105
|
|
|
105
106
|
## Chronological command date comparisons
|
package/package/corpus/skills/cratis-screenplay-specifications/references/host-body-execution.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
# Host execution of
|
|
1
|
+
# Host execution of verified bodies
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Requires Screenplay 4.256.0 for policies and v1 handlers, 4.257.0 for the v2 provider seam and 5.4.0 for v2 source binding.
|
|
4
|
+
|
|
5
|
+
Rule, `validate`, policy, handler and reducer bodies are opaque code. The standalone `screenplay`
|
|
6
|
+
tool supplies no provider, so a specification that reaches one is Unsupported, never passing.
|
|
7
|
+
A host program can opt in to running resolved, content-verified bodies. Reaction bodies are covered in
|
|
6
8
|
[reaction bodies](../../cratis-screenplay-captures-and-reactions/references/reaction-forms.md#reaction-bodies-run-through-a-host-provider);
|
|
7
9
|
this page does not repeat them.
|
|
8
10
|
|
|
@@ -16,6 +18,20 @@ this page does not repeat them.
|
|
|
16
18
|
per message. Command blocks and concept blocks both run, in the documented order, and every
|
|
17
19
|
reached block runs once; the first Unsupported block stops execution. Execution the host cannot
|
|
18
20
|
perform stays Unsupported, never a rejection.
|
|
21
|
+
- **Policies.** `AuthorizeAsync` returns Allow, Deny or Unsupported. Existing short-circuit
|
|
22
|
+
gate order still applies; missing, unsupported or faulting execution fails closed, never as allow.
|
|
23
|
+
A denial is an authorization outcome, not handler rejection or an execution fault.
|
|
24
|
+
- **Command handlers.** `HandleAsync` v1 returns ordered payloads matching the fixed,
|
|
25
|
+
unconditional productions. The v2 contract (ESM v35) returns items
|
|
26
|
+
matching `may produce`: validate declared event identities, payload shapes and destinations,
|
|
27
|
+
including `for one of` collection membership. Validate the whole result before any append:
|
|
28
|
+
an invalid later item makes the result Unsupported and commits nothing, even if earlier items
|
|
29
|
+
were valid. Malformed output or admission refusal is Unsupported, not command rejection.
|
|
30
|
+
- **Handler faults and cancellation.** An admitted handler failure propagates
|
|
31
|
+
`SemanticCommandBodyFaultException` with a typed fault kind (including host time/memory limits),
|
|
32
|
+
not a domain denial/rejection. Unrequested cancellation is a typed Cancelled fault; cancellation
|
|
33
|
+
requested through the supplied run token propagates the original `OperationCanceledException`.
|
|
34
|
+
These fault semantics are specific to handlers, not a promise for other provider roles.
|
|
19
35
|
- **Reducers.** `ReduceAsync` receives the prior state, the event and `Occurred` from the fact (the
|
|
20
36
|
clock is never read) and returns `Next(composite)` or `Delete()`. History folds in order, per
|
|
21
37
|
read model and event-source identity; any Unsupported reducer returns the original world.
|
|
@@ -25,5 +41,9 @@ this page does not repeat them.
|
|
|
25
41
|
- **Limits.** Screenplay ships no C# executor; the host enforces API admission, isolation and
|
|
26
42
|
resource limits, and capability `pure` is not a sandbox. Do not claim a target such as Stage
|
|
27
43
|
executes these bodies: what Stage renders is stated in `cratis-stage-rendering-and-sandbox`.
|
|
44
|
+
Bodies see only supplied command/context/caller values; do not invent missing timestamps,
|
|
45
|
+
identity, reads or host services. Policy contexts omit audit causation; handler contexts do not
|
|
46
|
+
provide view reads. Use typed-context discovery, not an invented wrapper API.
|
|
28
47
|
|
|
29
|
-
Source:
|
|
48
|
+
Source: Screenplay v6.32.0 `commands.md`, `readmodels.md`,
|
|
49
|
+
`ISemanticBodyExecutionProvider`, `SemanticCommandBodyExecution` and `SemanticHandlerResultValidation`.
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"input": "Write given/when/then specifications for a Screenplay slice.",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "AuthorizeAsync", "file": "references/host-body-execution.md" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "Validate the whole result before any append", "file": "references/host-body-execution.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "SemanticCommandBodyFaultException", "file": "references/host-body-execution.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "OperationCanceledException", "file": "references/host-body-execution.md" },
|
|
6
10
|
{ "kind": "play-compiles" },
|
|
7
11
|
{ "kind": "skill-contains", "value": "Whitespace-acceptance specs fail." },
|
|
8
12
|
{ "kind": "skill-contains", "value": "specification RejectingWhitespaceOnAConcept", "file": "references/whitespace-rules.md" },
|
|
@@ -389,10 +389,12 @@ standalone single-event reaction body (Requires Screenplay 4.258.0; see
|
|
|
389
389
|
tool uses) they leave the whole model unbound, so no specification runs at all.
|
|
390
390
|
- **Admissible compilation is narrower than that.** `CompileAdmissible` (the opt-in host API
|
|
391
391
|
`IAdmissibleSemanticModelCompiler`; Requires Screenplay 4.254.0 or later) binds the supported
|
|
392
|
-
subset of a source-valid application and lists
|
|
393
|
-
specifications, slices, imports and policies
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
subset of a source-valid application, not a whole-model pass, and lists removals in `Exclusions`:
|
|
393
|
+
refused specifications, slices, imports and policies. `Diagnostics` preserves original binder errors.
|
|
394
|
+
Typed provenance (4.256.0) adds `Cause` (`Root` or `Dependent`) and `DependsOn`: immediate
|
|
395
|
+
exclusion references, ordered like `Exclusions`, empty for `Root`, not transitive ancestry or
|
|
396
|
+
message-derived edges. Security dependencies fail closed: a refused policy or protected read
|
|
397
|
+
removes everything it protects. It does not establish runtime identity safety. A top-level `trigger` that fails to bind is excluded
|
|
396
398
|
(kind `Trigger`, cause `Root`, carrying the original binder diagnostic; it has no code of its own).
|
|
397
399
|
The reactions and specifications it sets off stop binding and are excluded on later passes as
|
|
398
400
|
`Dependent` exclusions whose `DependsOn` names the trigger. Independent slices stay in the
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
"input": "Check a Screenplay model folder: which compiler should I run, what do V1 to V3 mean, and what does the cratis CLI do with my Automation slice?",
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "Diagnostics` preserves original binder errors", "file": "references/executable-subset.md" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "empty for `Root`, not transitive ancestry", "file": "references/executable-subset.md" },
|
|
6
8
|
{ "kind": "skill-contains", "value": "| v33 |", "file": "references/language-admission.md" },
|
|
7
9
|
{ "kind": "skill-contains", "value": "`keyIsEventSource` beside `sourceEvents`", "file": "references/language-admission.md" },
|
|
8
10
|
{ "kind": "skill-contains", "value": "| PLAY0809 | E |", "file": "references/diagnostics.md" },
|