@cratis/pi 7.20.0 → 7.22.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/rules/concepts.md +10 -2
- package/package/corpus/rules/vertical-slices.md +4 -2
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +58 -5
- package/package/corpus/skills/cratis-fundamentals-concept/verification.json +4 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +19 -12
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +4 -3
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +13 -15
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +4 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +21 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +4 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +7 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +4 -4
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +38 -36
- 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/invocation-identity.md +84 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/refusals-and-redelivery.md +102 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +4 -2
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +1 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +28 -16
- package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +9 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +15 -13
- package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +80 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +23 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +2 -2
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +9 -6
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +6 -5
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +7 -5
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +6 -5
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +39 -49
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +5 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +48 -8
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +44 -42
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +46 -9
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +35 -11
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +118 -13
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +3 -3
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +11 -6
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +11 -2
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +10 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/references/guarded-actions.md +79 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +9 -7
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +6 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +2 -2
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +3 -2
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +13 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +3 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +40 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +24 -16
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +103 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +5 -6
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +4 -4
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +4 -2
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +34 -32
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +57 -9
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +6 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +19 -10
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +4 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +8 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +90 -27
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +10 -6
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +29 -12
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +91 -136
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +7 -5
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +20 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +9 -5
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +8 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
# Declare the actor behind a reaction invocation
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Trusted system identity
|
|
9
|
+
- Checked example
|
|
10
|
+
- Diagnostics and target boundaries
|
|
11
|
+
|
|
12
|
+
## Trusted system identity
|
|
13
|
+
|
|
14
|
+
Screenplay 4.125.0 supports one reaction-level line
|
|
15
|
+
`runs as system [role "<Role>" and role "<Role>"]`. Roles are optional, nonempty,
|
|
16
|
+
distinct quoted literals; personas and expressions are not accepted. Put it
|
|
17
|
+
under the reaction, not its trigger or invocation. The declaration selects
|
|
18
|
+
**ESM v10**. Without it, invocations remain caller-less; `given caller` never
|
|
19
|
+
supplies an actor to a reaction.
|
|
20
|
+
|
|
21
|
+
The reference evaluator authenticates a system principal with exactly the stated
|
|
22
|
+
roles. Claim conditions remain unknown, including under not; a satisfied role
|
|
23
|
+
alternative may allow, but final unknown denies. This is not the caller's audit
|
|
24
|
+
identity and does not invent Arc's system subject claims. The identity covers
|
|
25
|
+
invoked/returned commands across that reaction's triggers, not imperative
|
|
26
|
+
pipeline calls in bodies, direct productions, reads, refusal productions or
|
|
27
|
+
causation. Record the actual least-privilege role, not a prose-only actor or an
|
|
28
|
+
ungated command substituted to make the scenario pass.
|
|
29
|
+
|
|
30
|
+
## Checked example
|
|
31
|
+
|
|
32
|
+
This complete model compiled with warnings as errors and its reference scenario
|
|
33
|
+
passed on standalone Screenplay 4.125.0:
|
|
34
|
+
|
|
35
|
+
```screenplay
|
|
36
|
+
policy Worker
|
|
37
|
+
require role "Worker"
|
|
38
|
+
module Work
|
|
39
|
+
feature Processing
|
|
40
|
+
slice StateChange RecordWork
|
|
41
|
+
command RecordWork
|
|
42
|
+
workId String identifier
|
|
43
|
+
authorize Worker
|
|
44
|
+
produces event WorkRecorded
|
|
45
|
+
slice Automation ProcessWork
|
|
46
|
+
event WorkRequested
|
|
47
|
+
workId String
|
|
48
|
+
reaction Processor
|
|
49
|
+
runs as system role "Worker"
|
|
50
|
+
when WorkRequested
|
|
51
|
+
workId
|
|
52
|
+
invokes RecordWork
|
|
53
|
+
workId = workId
|
|
54
|
+
specification ProcessingRequestedWork
|
|
55
|
+
when append WorkRequested
|
|
56
|
+
workId = "work-1"
|
|
57
|
+
then WorkRecorded
|
|
58
|
+
for "work-1"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Diagnostics and target boundaries
|
|
62
|
+
|
|
63
|
+
- PLAY0647: malformed, repeated or misplaced identity, including duplicate/empty roles.
|
|
64
|
+
- PLAY0648: gated invocation without declared identity and without an authorization
|
|
65
|
+
refusal branch. PLAY0557 instead warns on that refusal branch; it cannot turn
|
|
66
|
+
an always-denied caller-less invocation into a trusted path.
|
|
67
|
+
- PLAY0649: identity with neither invocations nor an implementation body.
|
|
68
|
+
- C# binding PLAY0650/0651 warns about unused roles or definite authorization
|
|
69
|
+
denial; opaque/unknown cases are not guessed. `--check privilege` (PLAY0652)
|
|
70
|
+
reviews whether event producers require every elevated role, not runtime safety.
|
|
71
|
+
|
|
72
|
+
CLI 3.41.0 bundles Screenplay 4.114.0, which does not parse `runs as`: the example's
|
|
73
|
+
`cratis screenplay validate --executable --warnings-as-errors` returns PLAY0137,
|
|
74
|
+
exit 5. It cannot render this source. Its render version gate separately admits
|
|
75
|
+
only through v7 (CLI-RENDER-004 for newer admitted compiler output), while Stage
|
|
76
|
+
4.51.3's direct planner audits through v7 and refuses v10 with STAGE-ESM-016.
|
|
77
|
+
Clock/application-trigger identities have no Stage Arc realization either.
|
|
78
|
+
Use authorized gap-fill with the model as contract; returned-command Arc identity
|
|
79
|
+
uses `[ExecuteCommandsAsSystem]`, never permission inferred from a model header.
|
|
80
|
+
Refusal/redelivery syntax remains unadmitted even when identity itself runs.
|
|
81
|
+
|
|
82
|
+
Authority: Screenplay v4.125.0 `reactions.md`, `ReactionIdentityParser.cs`,
|
|
83
|
+
`ReactionRefusalValidator.cs`, `SemanticModelBinder.cs`; CLI v3.41.0
|
|
84
|
+
`RenderedSemanticVersions.cs`; Stage v4.51.3 `SemanticCratisAdmission.cs`.
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
# Refusal handling and redelivery intent
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Select a refusal
|
|
9
|
+
- Branch values and acknowledgement
|
|
10
|
+
- Redeliver an existing occurrence
|
|
11
|
+
- Recovery boundaries
|
|
12
|
+
|
|
13
|
+
## Select a refusal
|
|
14
|
+
|
|
15
|
+
At Screenplay 4.125.0 these forms are authoring-only: binding refuses the whole
|
|
16
|
+
model with PLAY0268, even when the source is valid. Do not execute them as append
|
|
17
|
+
scenarios or silently drop branches. Sources: released `reactions.md`,
|
|
18
|
+
`specifications.md`, decision 0030.
|
|
19
|
+
|
|
20
|
+
Inside an `invokes` block, ordered selectors state intended recovery:
|
|
21
|
+
|
|
22
|
+
| Selector | Matches at future admission |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `on refused` | Validation or constraint, not authorization |
|
|
25
|
+
| `on refused by validation` | Input/concept/require rejection |
|
|
26
|
+
| `on refused by constraint` | Any constraint rejection |
|
|
27
|
+
| `on refused by constraint <Name>` | One unambiguously resolved applicable constraint |
|
|
28
|
+
| `on refused by authorization` | Unauthorized, never an opaque policy's Unsupported result |
|
|
29
|
+
|
|
30
|
+
The first matching selector wins. Repeated selectors or narrower branches after
|
|
31
|
+
covering branches report PLAY0540; bare refusal does not cover authorization.
|
|
32
|
+
Unknown named constraints report PLAY0542; known but inapplicable constraints
|
|
33
|
+
also report PLAY0540. Authorization recovery requires a deliberate trusted path,
|
|
34
|
+
not a fictional caller supplied by `given caller`. On current source a declared
|
|
35
|
+
reaction `runs as` affects identity diagnostics, but refusal branches themselves
|
|
36
|
+
remain unadmitted; do not infer their execution from that separate capability.
|
|
37
|
+
|
|
38
|
+
## Branch values and acknowledgement
|
|
39
|
+
|
|
40
|
+
A branch contains leaf `acknowledge` alone, or ordinary `produces <Event>` blocks
|
|
41
|
+
with mappings and optional `for`. Empty branches, repeated acknowledgement,
|
|
42
|
+
acknowledgement plus productions, operations, inline events and attachments refuse.
|
|
43
|
+
Acknowledgement states a terminal disposition, not a successful command or fact.
|
|
44
|
+
|
|
45
|
+
Branch event mappings may use String values `$refusal.reason` (validation,
|
|
46
|
+
constraint, authorization), `$refusal.message` (verbatim details, including symbolic
|
|
47
|
+
localization keys), and `$refusal.constraint` only in constraint selectors.
|
|
48
|
+
Unknown members, wrong scope or incompatible targets report PLAY0541. Messages
|
|
49
|
+
are display details, not stable identity; trigger inputs remain available, read
|
|
50
|
+
aliases do not become branch inputs.
|
|
51
|
+
|
|
52
|
+
The intended admitted behavior stops remaining invocations of that trigger after
|
|
53
|
+
handling a refusal, but lets other reactions/cascades from accepted facts settle.
|
|
54
|
+
The refused command adds no facts; branch appends obey normal constraints and
|
|
55
|
+
cannot catch their own refusal through another branch. Unhandled refusal retains
|
|
56
|
+
earlier accepted facts. This is a future contract, not passing runner behavior.
|
|
57
|
+
|
|
58
|
+
## Redeliver an existing occurrence
|
|
59
|
+
|
|
60
|
+
The complete authoring model below compiles without warnings on 4.125.0;
|
|
61
|
+
`screenplay test` intentionally returns 3/unbound with PLAY0268 for redelivery
|
|
62
|
+
and no-event assertion, not a recovery pass:
|
|
63
|
+
|
|
64
|
+
```screenplay
|
|
65
|
+
module Billing
|
|
66
|
+
feature Claims
|
|
67
|
+
slice Automation Recovery
|
|
68
|
+
event Approved
|
|
69
|
+
invoice String
|
|
70
|
+
reaction Claimer
|
|
71
|
+
when Approved
|
|
72
|
+
specification Recovery
|
|
73
|
+
given Approved
|
|
74
|
+
for "invoice-1"
|
|
75
|
+
invoice = "invoice-1"
|
|
76
|
+
when redelivered Approved to Claimer
|
|
77
|
+
for "invoice-1"
|
|
78
|
+
invoice = "invoice-1"
|
|
79
|
+
then no events
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`to <Reaction>` must resolve to one observer of the event (PLAY0544). Optional
|
|
83
|
+
`for`, payload values and stream/no-stream route narrow effective given occurrences;
|
|
84
|
+
exactly one definitely matching occurrence and no unknown candidates are required
|
|
85
|
+
(PLAY0543). Equal duplicate givens are still separate candidates. A locator with
|
|
86
|
+
no route is a wildcard; explicit stream ids compare canonically, and `no stream`
|
|
87
|
+
selects only unrouted givens. This is the sole action, not an extra action after
|
|
88
|
+
append. Intended delivery uses the existing occurrence, never appends it again.
|
|
89
|
+
|
|
90
|
+
Leaf `then no events` explicitly expects no new facts after a non-append action.
|
|
91
|
+
It may accompany view/query/response assertions, not events, any-order events,
|
|
92
|
+
error or denial. It is invalid after `when append` (PLAY0545), and remains
|
|
93
|
+
unadmitted even on a model without a refusal branch.
|
|
94
|
+
|
|
95
|
+
## Recovery boundaries
|
|
96
|
+
|
|
97
|
+
Exceptions, infrastructure/contract errors, Unsupported and concurrency conflicts
|
|
98
|
+
are not refusals. There is no `by concurrency`: transient contention fails/retries,
|
|
99
|
+
not acknowledgement. Ordinary redelivery is not replay. Neither these forms nor
|
|
100
|
+
an observer/occurrence locator prove runtime deduplication, a cascade-wide
|
|
101
|
+
transaction, once-only delivery or exactly-once external effects. Specify the
|
|
102
|
+
actual recovery owner and target enforcement before making those claims.
|
|
@@ -18,8 +18,10 @@ specification IssuingTheWeeklyDigest
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Under `cratis` before 3.28.2 these actions parsed and were checked against the application
|
|
21
|
-
but bound to nothing (`PLAY0268` names ESM v6, decision 0022); on 3.28.2 they bind.
|
|
22
|
-
|
|
21
|
+
but bound to nothing (`PLAY0268` names ESM v6, decision 0022); on 3.28.2 they bind.
|
|
22
|
+
Current standalone 4.125.0 executes admitted scenarios through `screenplay test`
|
|
23
|
+
or MCP `run-specifications`; source compilation alone is authored evidence.
|
|
24
|
+
Clock rules: the clock is UTC and exact; an
|
|
23
25
|
occurrence fires once when it is **due after `given clock` and at or before
|
|
24
26
|
`when clock`**, in time order; intervals count from the Unix epoch; `when clock`
|
|
25
27
|
needs `given clock`, so equal instants fire nothing. Limits: 10,000 occurrences per
|
|
@@ -31,16 +31,12 @@ source is the single flow model.
|
|
|
31
31
|
| `Cratis.Screenplay` | `4.31.0` | Original examples and executable boundaries |
|
|
32
32
|
| `Cratis.Screenplay` | main `fd18129` | Inline events, repairs and canonical `optional`; changed examples compiled |
|
|
33
33
|
| `Cratis.Screenplay` | `4.66.0` (`c89198b`) | Binding behaviour of `handler`, code attachments, `persona` and compliance attributes: `Semantics/SemanticModelBinder*.cs`, `Diagnostics/DiagnosticCodes.cs` |
|
|
34
|
-
| `Cratis.Screenplay` | `4.68.0` (`79801bf`) |
|
|
34
|
+
| `Cratis.Screenplay` | `4.68.0` (`79801bf`) | Historical generated-value/response rule probes (ESM v7) |
|
|
35
|
+
| `Cratis.Screenplay` | `4.125.0` | Current source guidance: routes, operations, negation, protected identifiers and pre-generation contexts; released `commands.md`, `operations.md`, `policies.md`, `context.md`, `diagnostics.md` |
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Checked against the Screenplay repository at tag `v4.31.0` (commit `355dffb`):
|
|
41
|
-
`Documentation/screenplay/{commands,constraints,policies,context,concepts,diagnostics}.md`
|
|
42
|
-
and decisions 0001 and 0003 established the original baseline. Changed examples
|
|
43
|
-
use the newer main commit above; do not attribute their verification to the old tag.
|
|
37
|
+
Historical examples/probes retain the table's original versions; current source
|
|
38
|
+
guidance is not a relabeled old execution result. Compilation checks syntax and
|
|
39
|
+
model consistency, not reference execution. Pins: toolchain `references/versions.md`.
|
|
44
40
|
|
|
45
41
|
"Parses" and "runs" are different claims. The executable profile, and what
|
|
46
42
|
each construct binds to, is in the `cratis-screenplay-model-authoring` language
|
|
@@ -84,7 +80,10 @@ renders this from v4.29.0. The executable model still stops at `PLAY0268` for ei
|
|
|
84
80
|
event source id (`CHR0034`) and `[Encrypted]` on one (`CHR0052`); Screenplay reports
|
|
85
81
|
`PLAY0515` for `@pii` from Screenplay 4.69.1 and for `@sensitive` from 4.84.1, on a
|
|
86
82
|
command identifier, an explicit `for` destination or an event source identifier; earlier
|
|
87
|
-
versions compile it silently and only Chronicle catches it.
|
|
83
|
+
versions compile it silently and only Chronicle catches it. Current PLAY0515
|
|
84
|
+
also covers scalar stream-id types, composite parts and nested route mapping
|
|
85
|
+
sources. It is a source error, including typed destinations, not a binding-only
|
|
86
|
+
warning. Keep the stream identity a surrogate `Uuid`
|
|
88
87
|
concept and carry the personal value (name, email) as a separate `@pii` property and a
|
|
89
88
|
secret as a `@sensitive` property.
|
|
90
89
|
|
|
@@ -271,6 +270,19 @@ produces when isProForma == true
|
|
|
271
270
|
for invoiceId
|
|
272
271
|
```
|
|
273
272
|
|
|
273
|
+
## Routes and external operations
|
|
274
|
+
|
|
275
|
+
Named event sources/streams and command routes bind as ESM v8 at 4.125.0;
|
|
276
|
+
CLI 3.41.0 render rejects models above v7. The complete checked route example
|
|
277
|
+
and nested `streamId =` form are in `cratis-screenplay-toolchain`
|
|
278
|
+
`references/sources-and-streams.md`.
|
|
279
|
+
|
|
280
|
+
Use `system`, `uses` and inline/standalone `operation` declarations to state
|
|
281
|
+
external work in the authored production sequence, with execute/compensate phase
|
|
282
|
+
intent. These remain unadmitted (PLAY0268), not post-commit reactions. Read
|
|
283
|
+
[operation intent](references/operations.md) for forms, boundaries and checked
|
|
284
|
+
failure/compensation specification syntax.
|
|
285
|
+
|
|
274
286
|
## `concurrency`
|
|
275
287
|
|
|
276
288
|
Five dimensions, each at most once, and at most one `concurrency` block per
|
|
@@ -292,8 +304,9 @@ to the routed scope. This does not make command `reads` protected.
|
|
|
292
304
|
|
|
293
305
|
## Generated values and responses (ESM v7)
|
|
294
306
|
|
|
295
|
-
|
|
296
|
-
|
|
307
|
+
Generated values/responses bind as ESM v7, including in the current CLI bundle.
|
|
308
|
+
CLI 3.41.0 admits v7 to Stage planning; its canonical corpus gets generated-value
|
|
309
|
+
and response refusals STAGE-ESM-028/029. Binding is not a render claim.
|
|
297
310
|
Read [references/generated-values-and-responses.md](references/generated-values-and-responses.md) when adding or
|
|
298
311
|
reviewing `generated` properties, `returns` responses, or decision 0023 constructs.
|
|
299
312
|
Read `cratis-screenplay-toolchain/references/generated-responses-example.md` when adding generated command values or response assertions and you need a complete compiled example.
|
|
@@ -355,10 +368,9 @@ Four contexts, and **what each omits is load-bearing** — when writing a code b
|
|
|
355
368
|
|
|
356
369
|
## Verify
|
|
357
370
|
|
|
358
|
-
- [ ]
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
or lower). Name which tool produced the result.
|
|
371
|
+
- [ ] Validate the complete model root with warnings as errors; name the tool,
|
|
372
|
+
version and result. Current pins: standalone 4.125.0 / CLI 3.41.0; bundle
|
|
373
|
+
compatibility and execution are separate checks.
|
|
362
374
|
- [ ] No unintended `PLAY0478` or `PLAY0479` information remains.
|
|
363
375
|
- [ ] At most one command property carries `identifier`, and no event property does.
|
|
364
376
|
- [ ] Format rules live on the `concept`; state-dependent rules are specifications.
|
|
@@ -50,6 +50,15 @@ time: `CommandAs<T>()`, `ArgumentsAs<T>()`, `ArtifactAs<T>()`, `ValueAs<T>()`, a
|
|
|
50
50
|
`StateAs<T>()`/`EventAs<T>()` on the reducer context. A payload of another type
|
|
51
51
|
throws `ContextPayloadTypeMismatch`.
|
|
52
52
|
|
|
53
|
+
At Screenplay 4.125.0, typed contexts before generation (`CommandValidation`,
|
|
54
|
+
`ConceptValidation`, `RulePredicate`, `PolicyPredicate`) expose **input properties
|
|
55
|
+
only**. Generated values exist only after authorization/validation, so they are
|
|
56
|
+
absent from those shapes. A generated identifier's policy subject is `unavailable`,
|
|
57
|
+
not the eventual id; never authorize against it. The handler CommandContext retains
|
|
58
|
+
the full command shape, including generated properties. Sidecars belong to the same
|
|
59
|
+
compilation/revision as their requirements, not a shape borrowed from another model.
|
|
60
|
+
Source: `v4.125.0:Documentation/screenplay/context.md`.
|
|
61
|
+
|
|
53
62
|
## The values they carry
|
|
54
63
|
|
|
55
64
|
| Type | Members |
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
## Generated values and responses (ESM v7)
|
|
2
2
|
|
|
3
|
-
A `generated` command property and
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
A `generated` command property and `returns` response bind and reference-execute
|
|
4
|
+
as ESM v7. Current pins are standalone Screenplay 4.125.0 and CLI 3.41.0
|
|
5
|
+
(bundled Screenplay 4.114.0/Stage 4.51.3); `cratis-screenplay-toolchain`
|
|
6
|
+
`references/versions.md` owns the table. CLI#261 is closed: CLI now admits v7
|
|
7
|
+
to Stage planning, but its v7 canonical corpus receives Stage generated-value
|
|
8
|
+
and response refusals STAGE-ESM-028/029. Do not turn this into a blanket compiler
|
|
9
|
+
refusal or promise a render from binding alone. Preserve the contract for gap-fill
|
|
10
|
+
where admission refuses. Historical rules below were read at 4.68.0. Complete compiled example:
|
|
8
11
|
`cratis-screenplay-toolchain` `references/generated-responses-example.md`.
|
|
9
12
|
|
|
10
13
|
```screenplay excerpt
|
|
@@ -40,12 +43,11 @@ Rules (all read at `v4.68.0`):
|
|
|
40
43
|
- Generated values give no idempotency, retry or deduplication guarantee. Specifications supply fixtures and assert
|
|
41
44
|
the response: `cratis-screenplay-specifications`.
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
planned and do not write them.
|
|
46
|
+
Operations remain authorable/unadmitted (PLAY0268). Named event sources,
|
|
47
|
+
streams and command/specification routes instead bind and reference-execute as
|
|
48
|
+
ESM v8 at 4.125.0; CLI 3.41.0 render refuses versions above v7 before planning
|
|
49
|
+
(CLI-RENDER-004). Syntax/MCP acceptance alone is not execution. Source/stream
|
|
50
|
+
forms and realization boundary: `cratis-screenplay-toolchain`
|
|
51
|
+
`references/sources-and-streams.md`. Do not infer further syntax or provider
|
|
52
|
+
admission from decision numbers.
|
|
51
53
|
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
# Systems and operation intent
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Declare and produce
|
|
9
|
+
- Phases and ordered work
|
|
10
|
+
- Specification intent
|
|
11
|
+
|
|
12
|
+
## Declare and produce
|
|
13
|
+
|
|
14
|
+
A top-level `system` names an external business system. A slice-owned `operation`
|
|
15
|
+
declares exactly one `uses <System>`, typed inputs, optional description and
|
|
16
|
+
execute/compensate phases. Operations and their specification steps are
|
|
17
|
+
**authoring-only** at Screenplay 4.125.0: compile acceptance is not execution;
|
|
18
|
+
binding refuses the whole model with PLAY0268. Source: released `operations.md`.
|
|
19
|
+
|
|
20
|
+
`produces operation <Name>` declares an inline slice-owned operation with typed
|
|
21
|
+
input mappings. Plain `produces <Name>` references an existing event or operation;
|
|
22
|
+
it never creates one from a typo. Event and operation names share resolution:
|
|
23
|
+
collisions/ambiguity refuse, not event-first guessing. Standalone operation
|
|
24
|
+
references can be qualified across slices; that does not broaden event-production
|
|
25
|
+
grammar. Operations are produced by commands, not reactions, and take no `for`,
|
|
26
|
+
tags or event routing metadata. Inputs cannot be identifier/generated properties.
|
|
27
|
+
|
|
28
|
+
## Phases and ordered work
|
|
29
|
+
|
|
30
|
+
Keep mixed event/operation productions in their authored sequence. The intended
|
|
31
|
+
future transaction contract enrolls events first, executes operations in authored
|
|
32
|
+
order before commit, and compensates according to commit disposition. It does
|
|
33
|
+
not promise reverse compensation order, rollback or post-commit delivery.
|
|
34
|
+
|
|
35
|
+
Each phase accepts a description and one direct file/tagged body or an
|
|
36
|
+
`implementation` wrapper with ordered nonblank hints and optional source.
|
|
37
|
+
Direct/wrapped sources cannot mix; duplicate phases/payloads refuse.
|
|
38
|
+
Description-only/hints-only phases are pending intent, not executable code.
|
|
39
|
+
Typed `execute Type` remains an input; bare `execute` opens a phase. Escape an
|
|
40
|
+
input named uses as `@uses`, and event-metadata input names where needed.
|
|
41
|
+
No automatic operation extraction ships: moving an inline declaration manually
|
|
42
|
+
must preserve its production sequence, mappings, comments and attachment paths.
|
|
43
|
+
|
|
44
|
+
## Specification intent
|
|
45
|
+
|
|
46
|
+
This complete authoring-only model compiles with `--warnaserror` at 4.125.0.
|
|
47
|
+
`screenplay test` intentionally returns exit 3/unbound with PLAY0268; it proves
|
|
48
|
+
no failure/compensation behavior today:
|
|
49
|
+
|
|
50
|
+
```screenplay
|
|
51
|
+
system Accounting
|
|
52
|
+
concept ProjectId : Uuid
|
|
53
|
+
module Projects
|
|
54
|
+
feature Registration
|
|
55
|
+
slice StateChange Register
|
|
56
|
+
operation OpenCostCenter
|
|
57
|
+
uses Accounting
|
|
58
|
+
projectId ProjectId
|
|
59
|
+
execute
|
|
60
|
+
description "Open a provisional cost center"
|
|
61
|
+
compensate
|
|
62
|
+
description "Close it if registration does not commit"
|
|
63
|
+
command RegisterProject
|
|
64
|
+
projectId ProjectId identifier
|
|
65
|
+
produces OpenCostCenter
|
|
66
|
+
projectId = projectId
|
|
67
|
+
specification Compensating
|
|
68
|
+
given operation OpenCostCenter fails
|
|
69
|
+
when RegisterProject
|
|
70
|
+
projectId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
71
|
+
then operation OpenCostCenter
|
|
72
|
+
projectId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
73
|
+
then compensated OpenCostCenter
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`given operation ... fails` and `then compensated ...` are leaves. A requested
|
|
77
|
+
`then operation` can state a partial input subset, with unique fields and
|
|
78
|
+
compatible concrete values. References resolve against declared operations;
|
|
79
|
+
compensation intent needs a declared compensate phase. Provider execution is a
|
|
80
|
+
separate future admission, never implied by a source fixture.
|
package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md
CHANGED
|
@@ -20,7 +20,7 @@ persona Accountant
|
|
|
20
20
|
policy IsAccountant
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Condition atoms: `authenticated`, `role "<name>"`, and
|
|
24
24
|
`claim "<name>" matches subject | "<value>" | <path>`. A policy has **exactly one**
|
|
25
25
|
`require` line — continue the condition on deeper-indented lines instead of adding
|
|
26
26
|
a second (`PLAY0441`) — **or** one implementation (a tagged ` ```csharp ` block or
|
|
@@ -29,6 +29,28 @@ runner; a code policy binds as opaque ESM v3 and needs a target to evaluate it.
|
|
|
29
29
|
A `persona` is authoring metadata: the binder reports it as information `PLAY0270`
|
|
30
30
|
(report-only) and it does not block binding; an unknown policy it lists is an error.
|
|
31
31
|
|
|
32
|
+
## Policy negation
|
|
33
|
+
|
|
34
|
+
At Screenplay 4.125.0, `not <condition>` is a portable ESM v7 policy-condition
|
|
35
|
+
form (decision 0027), not a named-policy operator in `authorize`. It can negate
|
|
36
|
+
atoms/groups, not an opaque inline/file implementation. Precedence is `not`,
|
|
37
|
+
then `and`, then `or`; parentheses override grouping. Double negation restores
|
|
38
|
+
a known value, not an unknown target.
|
|
39
|
+
|
|
40
|
+
Missing caller claims compared to a known text target have no match (false),
|
|
41
|
+
so their negation is true. A missing/null/non-text comparison target or absent
|
|
42
|
+
subject is instead **unknown**. `not unknown` stays unknown; final unknown denies.
|
|
43
|
+
Kleene combinations preserve known decisive values: true OR unknown is true,
|
|
44
|
+
false AND unknown is false; false OR unknown and true AND unknown stay unknown.
|
|
45
|
+
`not role "Service"` alone does not require authentication: retain an explicit
|
|
46
|
+
`authenticated` condition when a signed-in caller is required.
|
|
47
|
+
|
|
48
|
+
Opaque predicates reached in authored short-circuit order return unsupported,
|
|
49
|
+
never false or permission under negation. Binding warns with PLAY0546 when a
|
|
50
|
+
negated claim's target is optional, non-string, or a subject without a command
|
|
51
|
+
identifier. This C# semantic check does not come from ordinary editor validation.
|
|
52
|
+
Source: `v4.125.0:Documentation/screenplay/policies.md`.
|
|
53
|
+
|
|
32
54
|
## `seed`
|
|
33
55
|
|
|
34
56
|
Excerpt: `CustomerRegistered` is declared in a slice.
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"kind": "skill-contains",
|
|
78
|
-
"value": "
|
|
78
|
+
"value": "streams and command/specification routes instead bind and reference-execute as", "file": "references/generated-values-and-responses.md"
|
|
79
79
|
},
|
|
80
80
|
{ "kind": "skill-contains", "value": "Generated values and responses (ESM v7)" },
|
|
81
81
|
{ "kind": "skill-contains", "value": "A generated value is not a request input", "file": "references/generated-values-and-responses.md" },
|
|
82
82
|
{ "kind": "skill-contains", "value": "(`PLAY0273`), and a concept with any validation rule cannot back a\n generated property (`PLAY0268`)", "file": "references/generated-values-and-responses.md" },
|
|
83
83
|
{ "kind": "skill-contains", "value": "A response exists only on acceptance", "file": "references/generated-values-and-responses.md" },
|
|
84
|
-
{ "kind": "skill-contains", "value": "
|
|
84
|
+
{ "kind": "skill-contains", "value": "STAGE-ESM-028/029", "file": "references/generated-values-and-responses.md" },
|
|
85
85
|
{ "kind": "skill-contains", "value": "4.68.0" }
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -48,7 +48,8 @@ Statements here were checked at those tags:
|
|
|
48
48
|
|
|
49
49
|
| Fact used here | Source |
|
|
50
50
|
| --- | --- |
|
|
51
|
-
| Persona syntax, report-only, policies must be declared
|
|
51
|
+
| Persona syntax, report-only, policies must be declared | Screenplay `v4.66.0:Documentation/screenplay/personas.md` |
|
|
52
|
+
| Description order; authored/import board order and order-preserving MCP layouts | Screenplay `v4.125.0:Documentation/screenplay/grammar.md`, `folders.md`, `imports.md` |
|
|
52
53
|
| Single-line and fenced `description` (`FencedText`) | `v4.66.0:Documentation/screenplay/slices.md#descriptions`, `grammar.md:1084-1088` |
|
|
53
54
|
| `<Type>[]`, shapes must be declared; `@pii` and `reason` on concepts | `v4.66.0:Documentation/screenplay/events.md`, `concepts.md` |
|
|
54
55
|
| `then denied`, `given caller`, `then error` | `v4.66.0:Documentation/screenplay/specifications.md` |
|
|
@@ -136,12 +137,14 @@ decided apart from what you assumed. Never guess silently.
|
|
|
136
137
|
- Slice types are a closed set: `StateChange`, `StateView`, `Automation`, `Translate`. In
|
|
137
138
|
discovery an event lives in the `StateChange` slice that will produce it, named after the
|
|
138
139
|
probable command; a slice with only an `event` compiles.
|
|
139
|
-
- A `persona` names declared policies only (unknown policy = error); `description`
|
|
140
|
-
|
|
140
|
+
- A `persona` names declared policies only (unknown policy = error); `description` appears
|
|
141
|
+
at most once, anywhere in its body.
|
|
141
142
|
- Declare each event once in the whole application; other slices refer to it by name.
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
- Boards keep authored declaration and import order: imports expand depth-first, glob
|
|
144
|
+
matches alphabetically. Unimported folder files remain visible after ranked siblings.
|
|
145
|
+
MCP `expand-layout` preserves this order with import barrels; an import-less
|
|
146
|
+
`PlayFileWriter.Expand` layout falls back to path order. Order is presentation, not
|
|
147
|
+
execution or identity. Keep causes and branches in the feature `description` and STATE.md.
|
|
145
148
|
- A misspelt keyword inside a slice is only warning PLAY0029 and the block disappears: always
|
|
146
149
|
validate with warnings as errors.
|
|
147
150
|
|
|
@@ -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 | update the feature `description`/STATE.md
|
|
32
|
+
| reorder | the story order changed | change declaration/import order for the board; update the feature `description`/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
|
|
|
@@ -65,10 +65,11 @@ open, start the sweep (`divergent-sweep.md`).
|
|
|
65
65
|
## A discovery skeleton
|
|
66
66
|
|
|
67
67
|
What a model looks like after the first workflow has been stormed: no commands, read models
|
|
68
|
-
or screens yet. Slices are named after the command expected to produce each event
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
or screens yet. Slices are named after the command expected to produce each event. At
|
|
69
|
+
Screenplay 4.125.0, boards use authored declaration/import order, and MCP `expand-layout`
|
|
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.
|
|
72
|
+
Persona `description` text holds Does / Reads / Cannot on one quoted line here; the multi-line fenced
|
|
72
73
|
form is in `personas-and-causes.md`.
|
|
73
74
|
|
|
74
75
|
```screenplay
|
|
@@ -134,11 +134,13 @@ What binds depends on **which tool** you ask, so name the tool and its version:
|
|
|
134
134
|
- `persona` declarations are report-only and never block; `@pii` and `@sensitive`
|
|
135
135
|
concepts do block binding (`PLAY0268`). Keep them anyway: the classification is
|
|
136
136
|
part of the model. Report the block.
|
|
137
|
-
- Generated values
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
- Generated values/responses bind and reference-execute as v7; sources, streams
|
|
138
|
+
and command/specification routes as v8; reaction `runs as` identity as v10 on
|
|
139
|
+
standalone 4.125.0. Use `screenplay test` or MCP `run-specifications` for V4.
|
|
140
|
+
Operations/systems, exact numbers and refusal/redelivery remain unadmitted.
|
|
141
|
+
CLI 3.41.0 bundles older syntax and renders through v7 only: its parser rejects
|
|
142
|
+
`runs as`, and Stage refuses generated values/responses with STAGE-ESM-028/029.
|
|
143
|
+
Source/binding admission and target realization are separate gates.
|
|
142
144
|
|
|
143
145
|
The ESM versions, the full disposition table and the Step 7 clock example's binding
|
|
144
146
|
result are in [references/parsed-not-runnable.md](references/parsed-not-runnable.md)
|
|
@@ -32,8 +32,8 @@ module Invoicing
|
|
|
32
32
|
description "Registering and managing the lifecycle of invoices"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
`description` is
|
|
36
|
-
|
|
35
|
+
`description` is optional on a module, feature, slice, persona or command;
|
|
36
|
+
at most one, anywhere in its body. Use a fenced block tagged ` ```text ` when one line
|
|
37
37
|
is not enough (a bare fence warns with `PLAY0397`).
|
|
38
38
|
|
|
39
39
|
## Step 2 — Brainstorm events
|
|
@@ -59,9 +59,10 @@ Phase skill: `cratis-screenplay-discovery`.
|
|
|
59
59
|
Arrange into the timeline — the plot. *"What happens first? And then what
|
|
60
60
|
happens?"* Identify the happy path **and** the alternative and error paths.
|
|
61
61
|
|
|
62
|
-
**Output:** the
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
**Output:** the authored declaration/import order for the board, with causes
|
|
63
|
+
and branches documented. Screenplay 4.125.0 MCP layouts preserve this presentation
|
|
64
|
+
order with imports; an import-less `PlayFileWriter.Expand` layout uses path order.
|
|
65
|
+
Timeline position does not impose execution order or change identities.
|
|
65
66
|
|
|
66
67
|
## Step 4 — Create wireframes
|
|
67
68
|
|