@cratis/pi 7.62.0 → 7.63.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/product-sync.json +9 -9
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-command/references/generated-values.md +27 -12
- package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +17 -6
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +10 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +49 -6
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +43 -41
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +11 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-interview.md +24 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +76 -10
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +39 -23
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +35 -12
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +51 -81
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +83 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +14 -4
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +59 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md +60 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +5 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +26 -28
- package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +82 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +82 -28
- package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +113 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +45 -12
- package/package/corpus/skills/cratis-screenplay-command-surface/references/text-and-match-rules.md +119 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +14 -4
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +10 -3
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +12 -12
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +5 -3
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +5 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +1 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +51 -14
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +5 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +2 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +6 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +22 -28
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/choosing-generation.md +20 -7
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +12 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +9 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +58 -10
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -2
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -5
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +2 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +3 -2
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +3 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +8 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -4
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +36 -29
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +15 -4
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +25 -20
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +14 -3
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +9 -3
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +7 -3
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -4
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -3
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +8 -8
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +49 -47
- package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +11 -1
- package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +48 -17
- package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +14 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +25 -21
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +2 -2
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +9 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +4 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +7 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +30 -22
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +60 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +65 -5
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +50 -22
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-checks.md +93 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +117 -35
- package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +46 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +3 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +25 -10
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +1800 -50
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +5 -3
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -1
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +8 -53
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +2 -2
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/interaction-example.md +54 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +6 -3
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -29
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +36 -9
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +28 -8
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/publication-and-recovery.md +31 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +8 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +4 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- Structural completeness and timeline checks
|
|
15
15
|
- Editor versus C# verdicts
|
|
16
16
|
- Consistency errors (V1: the model contradicts itself)
|
|
17
|
+
- Batches, described handlers, text rules and protected reads
|
|
17
18
|
- Binding (V2 and V3) - see `executable-subset.md` for the full table
|
|
18
19
|
- Frequent errors
|
|
19
20
|
- Render admission (V5): `STAGE-*`, `CLI-RENDER-*`, `STAGE-CRATIS-*`
|
|
@@ -55,7 +56,7 @@ Legacy compliance spellings (`@pii`/`@sensitive`) do not evade PLAY0515.
|
|
|
55
56
|
|
|
56
57
|
## Public events and translation direction
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
PLAY0607–0620 are errors. These constructs bind as ESM v9, except public/foreign imports without local shapes (PLAY0268).
|
|
59
60
|
|
|
60
61
|
| Code | Meaning / fix |
|
|
61
62
|
| --- | --- |
|
|
@@ -80,6 +81,18 @@ or non-Translate direction. Repair discovery uses `repair-capabilities`, workspa
|
|
|
80
81
|
`repairs`, then revision-checked `propose-repair`; do not guess a direction.
|
|
81
82
|
See automations-and-translations `references/public-events-and-direction.md`.
|
|
82
83
|
|
|
84
|
+
| Code | Severity | Meaning / fix |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| PLAY0694 | W | An unrouted reaction in a directionless Translate consumes an event its own capture appends (root, children or nested). Keep the capture here and move the reaction to a separate Automation slice with its specs. No automatic repair; `--warnaserror` fails. Other slices' captures and reactions with a `from` route do not trigger this check; explicit inbound local-event consumption is PLAY0616. |
|
|
87
|
+
| PLAY0700 | E | Event-capture `key` is not required on every `from` event, or uses a `$` context key. Choose a required content property or deliberately change the source contracts; no repair. |
|
|
88
|
+
| PLAY0701 | E | `given capture` / `when capture` names a capture over events. Present `given <FromEvent>` / `when append <FromEvent>`. A compiler-authored repair exists only for exactly one `from` event; several are ambiguous. Review the specification repair individually; no fix-all or pinned evidence. |
|
|
89
|
+
|
|
90
|
+
Requires Screenplay 4.171.0 or later (`screenplay --version`) for PLAY0700/0701
|
|
91
|
+
and event delivery to captures; older runners do not execute that delivery.
|
|
92
|
+
Requires Screenplay 4.176.0 or later for PLAY0694; older compilers leave the
|
|
93
|
+
legacy directionless co-location unchecked. Full capture execution and ordering:
|
|
94
|
+
automations-and-translations `references/public-events-and-direction.md`.
|
|
95
|
+
|
|
83
96
|
## Explicit enum member numbers
|
|
84
97
|
|
|
85
98
|
Source errors; the pins bind as ESM v12:
|
|
@@ -290,12 +303,43 @@ or V4 execution. Run the CLI or MCP for those verdicts.
|
|
|
290
303
|
| PLAY0287 | producer/capture/spec assigns a field the event lacks |
|
|
291
304
|
| PLAY0291-0294 | bad single-line JSON / unknown key / wrong shape / duplicate key |
|
|
292
305
|
|
|
306
|
+
## Batches, described handlers, text rules and protected reads
|
|
307
|
+
|
|
308
|
+
Use code and typed subjects from [diagnostic arguments](diagnostic-arguments.md), not
|
|
309
|
+
message parsing, for codes that declare arguments. Other messages still explain
|
|
310
|
+
refusal reasons. Read [language admission](language-admission.md) before changing modes.
|
|
311
|
+
|
|
312
|
+
| Code | Meaning / fix |
|
|
313
|
+
| --- | --- |
|
|
314
|
+
| PLAY0693 | Duplicate/conflicting/invalid atomic batch declaration; keep one application-root declaration, do not remove intended atomicity |
|
|
315
|
+
| PLAY0695 (I) | Described handler admitted; a target must supply its payload body |
|
|
316
|
+
| PLAY0696 | Pending handler without productions, including response-only; declare unconditional productions |
|
|
317
|
+
| PLAY0697 | Conditional productions under pending intent; result v1 needs unconditional events |
|
|
318
|
+
| PLAY0698 | Pending intent plus another handler; retain one |
|
|
319
|
+
| PLAY0699 | Pattern outside portable dialect or over 1,000 UTF-16 units / 3,000 expanded nodes; rewrite the refused construct |
|
|
320
|
+
| PLAY0780 | Invalid placement/repetition of `command reads protected`; declare once at root |
|
|
321
|
+
| PLAY0781 | Protected read shape/key refused; inspect the closed reason, never downgrade to an unguarded read |
|
|
322
|
+
| PLAY0782 | Omitted `by` without command identifier; declare the lookup input |
|
|
323
|
+
| PLAY0783 | Command combines reads and concurrency; choose the intended boundary |
|
|
324
|
+
| PLAY0784 | Unknown read/property path; reference a declared read or alias |
|
|
325
|
+
| PLAY0785 | Ambiguous view path; use distinct aliases on repeated reads |
|
|
326
|
+
| PLAY0786 (I) | Eligible legacy model; preview typed preamble repair, individually review absence/conflict semantics |
|
|
327
|
+
| PLAY0787 (W) | Exact deprecated Studio text-rule pattern; repair to literal rule or equality, preserving message/severity |
|
|
328
|
+
| STAGE-ESM-043 | Atomic mode not realized, even in admitted v23–v25; retain declaration and gap-fill |
|
|
329
|
+
| STAGE-ESM-044 | Protected reads not realized despite v25 version admission; keep protection and gap-fill |
|
|
330
|
+
| STAGE-IMPL-002 | Described handler body not realized by Stage, even Stub mode; no stubs emitted |
|
|
331
|
+
|
|
332
|
+
Invalid match syntax remains PLAY0367. Property/concept text rules bind v24;
|
|
333
|
+
`contains`/`starts with` in conditions only still fail PLAY0268. Stage rejects
|
|
334
|
+
v22/v26 and mixed pairs with STAGE-ESM-016; v23–v25 admission does not implement
|
|
335
|
+
bodies, batches or protected reads (STAGE-ESM-044).
|
|
336
|
+
|
|
293
337
|
## Binding (V2 and V3) - see `executable-subset.md` for the full table
|
|
294
338
|
| Code | Meaning | Fix |
|
|
295
339
|
|---|---|---|
|
|
296
|
-
| PLAY0268 | construct the ESM cannot represent; read the message for the construct (`executable-subset.md` lists
|
|
340
|
+
| PLAY0268 | construct the ESM cannot represent; read the message for the construct (`executable-subset.md` lists attached handlers, unsupported query shapes, protected enum/identity concepts, read paths without opt-in or in conditions, and older bundled-compiler limits) | stay in design mode, or change the construct if the domain allows; never strip `pii`/authorization |
|
|
297
341
|
| PLAY0269 / 0270 | UI deferred / authoring metadata (I) | none |
|
|
298
|
-
| PLAY0271 | legacy `reads` or a `concurrency` block keeps its legacy meaning and cannot bind (error) |
|
|
342
|
+
| PLAY0271 | legacy `reads` or a `concurrency` block keeps its legacy meaning and cannot bind (error) | opt eligible command reads into v25 with reviewed preamble repair; `concurrency` remains unbound; uniqueness uses a constraint, target realization stays separate |
|
|
299
343
|
| PLAY0273 | incoherent: ambiguous `for`, property not on event revision, operand type mismatch, derived `$eventContext` path | fix the reference |
|
|
300
344
|
| PLAY0350 | `null` in command/event value | Chronicle semantics (nullable event properties are CHR0012; an optional fact is a separate event), not only a binder limitation: specs cannot state an absent command/event value. Omit the value or record a capability gap; whether the optional detail is really a separate fact is a review question, not this code's fix |
|
|
301
345
|
| PLAY0351 | given/then readmodel lacks the key property | add the keyed query's `by` property |
|
|
@@ -336,10 +380,26 @@ or V4 execution. Run the CLI or MCP for those verdicts.
|
|
|
336
380
|
| PLAY0683/0684 | PLAY0683: generated non-identifier below 64 random bits warns (a single-property unique constraint suppresses it); PLAY0684: generated identifier below 64 random bits is an error |
|
|
337
381
|
| PLAY0687 | capture `source events` spans multiple origins; split into one capture per origin (event store) |
|
|
338
382
|
| PLAY0688 | generated strategy refutes a concept rule; read its violating example, align the rule/strategy or review the derived-`matches` repair |
|
|
339
|
-
| PLAY0689 (W) | generated-concept rule proof is undecided; reason names regex fragment/budget/opaque limits.
|
|
383
|
+
| PLAY0689 (W) | generated-concept rule proof is undecided; reason names regex fragment/budget/opaque limits or ambiguity. Only deterministic matches patterns prove containment; passing samples prove nothing |
|
|
384
|
+
| PLAY0691 | finite pattern support cannot be counted within the generation budget; simplify the strategy, never treat it as an Unproven rule warning or redraw |
|
|
385
|
+
| PLAY0692 | pattern support is empty for some valid UTC date in the compiler's next-100-year horizon; repair the pattern/checksum contract, never sample around it |
|
|
340
386
|
| PLAY0685 | own response name used under execute failure; outer successful responses remain available. UI composition `references/response-continuations.md` |
|
|
341
387
|
| PLAY0289 | (binding) no documents: empty root |
|
|
342
388
|
|
|
389
|
+
Requires Screenplay 4.164.0 (`screenplay --version`) for PLAY0688/0689 (ESM v20),
|
|
390
|
+
4.172.0 for finite generation PLAY0691/0692 and checksum validation (v21); older
|
|
391
|
+
compilers refuse those constructs with PLAY0268. A refuted rule's PLAY0688 repair
|
|
392
|
+
uses the strategy-derived matches pattern (and declared checksum validation if
|
|
393
|
+
absent). Inspect MCP `rules[]` for status/witness/reason and only use a repair
|
|
394
|
+
when diagnosticCode/repair is reported. Pattern/random/rule no longer refuse
|
|
395
|
+
PLAY0268; generated secrets still do. Requires Stage 4.109.0 for v20, 4.115.0
|
|
396
|
+
for v21 admission/all-Proven unpinned specs, 4.117.0 for warning/info rules,
|
|
397
|
+
4.118.0 for checksum validation and 4.119.0 for pattern/random. Older renderers
|
|
398
|
+
refuse those constructs or require pins even for Proven rules. Bad pins fail
|
|
399
|
+
STAGE-ESM-011; unpinned Unproven/Refuted rules fail -038; opaque rules fail -005
|
|
400
|
+
before pin evaluation. `generate rule` remains -028; checksum remains -042 only
|
|
401
|
+
on legacy syntax paths. Tool-author checks: [generation checks](generation-checks.md).
|
|
402
|
+
|
|
343
403
|
Fix order: E at V1 -> W at V1 -> silent-gap check -> V2 codes (if the mode needs V3).
|
|
344
404
|
Report each as `code file:line one-line meaning`; never paste more than about 30 lines.
|
|
345
405
|
|
|
@@ -358,7 +418,7 @@ Publication STAGE-ESM-032, foreign facts/event captures 033, claim-reading/opaqu
|
|
|
358
418
|
| STAGE-ESM-004 / 006 / 013 | a `StateChange` without commands; `produces` that cannot render (expression/enum conditions, literal or computed mappings, duplicate tags); event-context value other than `$context.occurred` (reactions: `$context.causedBy.*`, `$context.eventSourceId`) |
|
|
359
419
|
| STAGE-ESM-005 / 015 | code rule or code validation bodies; authorization Stage cannot render exactly (role-claim URIs, nested or unresolved opaque policies, opaque-policy subjects that are not text, Uuid, Date or DateTime). Role-only, authenticated, opaque pure policies and Uuid/Date/DateTime/text claim targets render |
|
|
360
420
|
| STAGE-ESM-007 / 009 / 010 / 017 | projection shape (one projection or reducer per read model, affected-instance key, unsupported query shapes, keys, unsupported `all` mappings, event-context values) |
|
|
361
|
-
| STAGE-ESM-011 | specification shape not rendered (`when append` outside the single-hop reaction subset, command specifications that cascade into reactions, composite values, an unauthenticated caller carrying roles or claims,
|
|
421
|
+
| STAGE-ESM-011 | specification shape not rendered (`when append` outside the single-hop reaction subset, command specifications that cascade into reactions, composite values, an unauthenticated caller carrying roles or claims, generated fixtures that do not match their strategy shape or concept rules). Command scenarios and single-hop reaction appends render |
|
|
362
422
|
| STAGE-ESM-014 | constraint shape (multi-claim in one command, optional or composite targets) |
|
|
363
423
|
| STAGE-ESM-019/022 | reducer or opaque pure policy body outside the pure allowlist |
|
|
364
424
|
| STAGE-ESM-024 | interval, schedule, application, startup and shutdown triggers, opaque reaction bodies, captures, Translate, clock/trigger/capture specifications |
|
|
@@ -24,7 +24,8 @@ non-route Double literals (exact lowering of Double-mode literals) as v11, non-p
|
|
|
24
24
|
numbers as v12, concept compliance as v13, caller-supplied collection equality filters as v14,
|
|
25
25
|
concept generation strategies and freshness as v15, stored event names as v16,
|
|
26
26
|
no-event assertions/redelivery as v17, query-error specifications as v18,
|
|
27
|
-
invocation refusal branches as v19
|
|
27
|
+
invocation refusal branches as v19, generated-concept rules as v20, and finite
|
|
28
|
+
pattern/random/rule generation plus checksum validation as v21. Always name
|
|
28
29
|
the tool with a V2 or V3 result. When tool and documentation disagree, the tool decides
|
|
29
30
|
current capability; the documentation and the domain decide intended correctness. Record
|
|
30
31
|
the gap, never strip the model to pass. Use the actual binder before promoting an older
|
|
@@ -38,6 +39,10 @@ never bind (`verdicts.md`).
|
|
|
38
39
|
Complete examples that bind live in `executable-example.md`, `pdl-example.md` (projections),
|
|
39
40
|
`automation-translate-example.md` (ESM v6) and `generated-responses-example.md` (ESM v7).
|
|
40
41
|
|
|
42
|
+
For atomic batches (v22), described handlers (v23), ordinal text rules (v24) and
|
|
43
|
+
protected reads (v25), read [language admission](language-admission.md). A later
|
|
44
|
+
version alone does not enable either application opt-in.
|
|
45
|
+
|
|
41
46
|
## Caller and compliance boundary
|
|
42
47
|
|
|
43
48
|
`$identity.id`/`.name`/`.userName` are aliases of the admitted
|
|
@@ -168,11 +173,14 @@ fixtures and `then returns`. Unsupported generated types (`-028`) and result com
|
|
|
168
173
|
`references/generated-values-and-responses.md`.
|
|
169
174
|
Complete examples: `generated-responses-example.md`, `generation-strategies-example.md`.
|
|
170
175
|
|
|
171
|
-
- A generated property is command-only, required, scalar and a generatable concept backed by Uuid
|
|
172
|
-
|
|
176
|
+
- A generated property is command-only, required, scalar and a generatable concept backed by Uuid/String,
|
|
177
|
+
or Int with `random` (v21). Bare primitives, optional and collection types are invalid.
|
|
178
|
+
Uuid has implicit `uuid`; String needs a strategy. Generated identifiers remain Uuid/String only.
|
|
173
179
|
Explicit serialized generation selects v15, with strict fixture encoding and whole-source freshness for all
|
|
174
|
-
generated destinations.
|
|
175
|
-
|
|
180
|
+
generated destinations. Sequence and generated secrets remain refused.
|
|
181
|
+
Generated-concept rules bind as v20 with proof diagnostics PLAY0688/0689;
|
|
182
|
+
pattern/random/rule and checksum validation bind as v21. PLAY0691 is uncountable
|
|
183
|
+
support within budget; PLAY0692 is empty support on a scanned UTC date.
|
|
176
184
|
See command-surface `references/generated-values-and-responses.md` and `generation-strategies-example.md`. Modifier order is `Type optional generated identifier`.
|
|
177
185
|
- Generated values are not request inputs, form fields, invocation arguments or ordinary `when` values. Generation
|
|
178
186
|
runs after authorization and validation and before productions, so a denial or a validation failure never
|
|
@@ -180,7 +188,10 @@ Complete examples: `generated-responses-example.md`, `generation-strategies-exam
|
|
|
180
188
|
- A policy (including inherited or composed ones and the implicit `subject` of a generated identifier), a property
|
|
181
189
|
rule or a requirement that references a generated value reports `PLAY0273`; reference input properties only. A
|
|
182
190
|
generated property whose concept declares rules selects v20; refuted rules report
|
|
183
|
-
PLAY0688 and
|
|
191
|
+
PLAY0688 with a witness and Unproven rules warn PLAY0689 with a reason. Proven
|
|
192
|
+
rules bind silently; matches containment requires deterministic patterns, not
|
|
193
|
+
passing samples. Opaque validation needs a target. Opaque generation rules use
|
|
194
|
+
pinned String results without executing their bodies.
|
|
184
195
|
A reaction mapping into a generated property is invalid.
|
|
185
196
|
- Responses: `returns <property>` is scalar; bare `returns` opens an ordered record of `<name> [<Type>] = <property>` fields
|
|
186
197
|
over direct properties of the same command (collections, read aliases, arithmetic and whole read models are not
|
|
@@ -198,14 +209,25 @@ Complete examples: `generated-responses-example.md`, `generation-strategies-exam
|
|
|
198
209
|
- A reaction-invoked command that reaches generation is `Unsupported(IdentityAllocation)`; response-only commands run
|
|
199
210
|
and discard the response. Generated values give no idempotency, retry or deduplication guarantee.
|
|
200
211
|
|
|
201
|
-
Requires Screenplay 4.68.0 or later (`screenplay --version`) for generated values and responses (ESM v7),
|
|
212
|
+
Requires Screenplay 4.68.0 or later (`screenplay --version`) for generated values and responses (ESM v7), 4.147.0 for strategies/freshness (v15), 4.164.0 for generated-concept rules (v20), and 4.172.0 for pattern/random/rule/checksum (v21); older compilers refuse the respective constructs with PLAY0268.
|
|
213
|
+
|
|
214
|
+
Pins satisfy both strategy shape and concept rules; failure is Rejected(Contract),
|
|
215
|
+
not an input error or redraw. Pin date segments with `given clock`; without it the
|
|
216
|
+
runner checks digit widths only. Generation checksum does not add validation:
|
|
217
|
+
author `validate checksum` for arithmetic. Requires Stage 4.109.0 for v20,
|
|
218
|
+
4.115.0 for v21 admission/all-Proven unpinned specs, 4.117.0 for warning/info rules,
|
|
219
|
+
4.118.0 for checksum validation and 4.119.0 for pattern/random rendering; older
|
|
220
|
+
renderers refuse those constructs or require rule-bearing pins even when Proven.
|
|
221
|
+
Unproven/Refuted rules still need pins (-038), bad pins fail -011, and
|
|
222
|
+
`generate rule` remains -028. Do not remove rules or classification to render.
|
|
202
223
|
|
|
203
224
|
## Released public boundaries and observer routes
|
|
204
225
|
|
|
205
226
|
Public/origin events, explicit Translate direction, event-target builders and
|
|
206
|
-
`source events` captures bind as ESM v9. Publication folds execute
|
|
207
|
-
|
|
208
|
-
|
|
227
|
+
`source events` captures bind as ESM v9. Publication folds execute, and so do
|
|
228
|
+
captures over events (Requires Screenplay 4.171.0; a specification presents the
|
|
229
|
+
consumed event with `given <Event>` / `when append <Event>`); reached opaque
|
|
230
|
+
event-target reducers return typed Unsupported. Public/foreign imports still lack a local shape and refuse PLAY0268.
|
|
209
231
|
See automations-and-translations `references/public-events-and-direction.md`.
|
|
210
232
|
Production overrides and reaction/reducer filters bind and select v10;
|
|
211
233
|
filters match routed source/stream names only. Read
|
|
@@ -231,9 +253,15 @@ Requires Screenplay 4.117.0 or later (`screenplay --version`) for ESM v9, 4.129.
|
|
|
231
253
|
|
|
232
254
|
## Code attachments (what binds, what never does)
|
|
233
255
|
|
|
256
|
+
Pending `handler implementation` beside unconditional `produces` binds as a described
|
|
257
|
+
command (v23). Its payload-only body returns Unsupported ImplementationBody when reached;
|
|
258
|
+
denial/validation specs still run. Read [language admission](language-admission.md) for
|
|
259
|
+
v22–v25 and [described handlers](../../cratis-screenplay-command-surface/references/described-handlers.md)
|
|
260
|
+
for the result contract. Attached handlers remain unbound.
|
|
261
|
+
|
|
234
262
|
Inline fences (`csharp`, `typescript`, `react`, `html`, `sql`) and `file <path>` attach
|
|
235
263
|
code to an owner. Three kinds block binding (PLAY0268, V3 blocked, no specification runs):
|
|
236
|
-
the command `handler`, the `file` constraint (see below) and a query `performer`
|
|
264
|
+
the attached command `handler`, the `file` constraint (see below) and a query `performer`
|
|
237
265
|
("uses delivery, filtering, scope, or implementation behavior outside the first ESM v1
|
|
238
266
|
vertical"). Everything else binds as an **opaque requirement** that needs a target to
|
|
239
267
|
execute: reducer transitions, rule predicates, command and concept code validation, policy
|
|
@@ -246,22 +274,22 @@ bodies still leave their owner non-executable.
|
|
|
246
274
|
can only declare uniqueness: declare it with `unique ...`, and put other rules in command
|
|
247
275
|
validation or a `require` condition.
|
|
248
276
|
|
|
249
|
-
- A command `handler`
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
277
|
+
- A file/fenced command `handler` remains PLAY0268, wrapped or direct. A pending
|
|
278
|
+
intent instead selects v23 with unconditional productions (PLAY0695 information).
|
|
279
|
+
Missing productions use PLAY0696, conditional ones PLAY0697, duplicate handlers PLAY0698.
|
|
280
|
+
Hints are not executable code, locks or confirmation.
|
|
253
281
|
- A command property named rule also accepts an `implementation` block (ordered
|
|
254
282
|
`hint` lines, at most one `file` or tagged fence). With a source attached it binds like a
|
|
255
283
|
direct source; hints-only or empty is pending intent: valid source, PLAY0268 at binding.
|
|
256
284
|
The block is rejected on concept rules, built-in property rules and whole-command
|
|
257
285
|
`require`/`validate` bodies.
|
|
258
|
-
- A
|
|
259
|
-
with
|
|
286
|
+
- A reached described body is Unsupported, not a passing specification; Stage refuses
|
|
287
|
+
it with STAGE-IMPL-002, even in Stub mode. Deliver its body as authorized gap-fill.
|
|
260
288
|
- Stage admits only pure reducer bodies (Roslyn allowlist, STAGE-ESM-019 and 022);
|
|
261
289
|
code validation is refused (STAGE-ESM-005). Opaque pure policies render.
|
|
262
290
|
- The reference runner returns Unsupported for the opaque bodies that do bind (rule and
|
|
263
291
|
policy predicates, code validation, reducer transitions); a specification that needs one
|
|
264
|
-
never passes.
|
|
292
|
+
never passes. Attached handlers, file constraints and query performers (and reaction effects on a trigger with
|
|
265
293
|
`reads`) are different: they leave the whole model unbound, so no specification runs at
|
|
266
294
|
all.
|
|
267
295
|
|
|
@@ -274,13 +302,13 @@ bodies still leave their owner non-executable.
|
|
|
274
302
|
| `pii` or `secret` on a concept | PLAY0268 | Older compilers refuse it outright. Current compilers admit v13 except enum/identity compliance and events mixing personal or explicitly subject-scoped secret values with explicit subject marks; see `compliance.md` in command-surface references |
|
|
275
303
|
| `query` with a composite `by` block, or `by ... from` context-derived arguments | PLAY0268 | composite `by` blocks remain unadmitted. An optional scalar snapshot lookup, an unfiltered list (`RM[]`) and a list narrowed by one caller-supplied `by` key bind, in their `observable` form too |
|
|
276
304
|
| Context `from`, single-result filters, `scoped to`, `performer` queries | PLAY0268 | Typed query context, filtering of single results, opaque scope and query implementation remain unadmitted; each refusal names its reason. Caller-supplied collection equality filters bind as v14. `observable` goes in the return position (`=> observable RM[]`); as a body line it is PLAY0048 |
|
|
277
|
-
| `contains` or `starts with` in conditions | PLAY0268 | equality and numeric ordering only |
|
|
305
|
+
| `contains` or `starts with` in conditions only | PLAY0268 | `require`/`produces when` conditions admit equality and numeric ordering only; property/concept text rules bind as v24 |
|
|
278
306
|
| Date or DateTime comparison, `today` | PLAY0268 | no runtime date value |
|
|
279
307
|
| Rule on a nested path (`lines.qty all > 0`) | PLAY0268 | put the rule on the nested value's concept |
|
|
280
|
-
|
|
|
281
|
-
| `reads <View> ...` on a command | PLAY0271 (error) |
|
|
308
|
+
| Read paths without protected opt-in, or in `produces when` | PLAY0268 | v25 admits single-level paths only in `require` and produced-event mappings |
|
|
309
|
+
| Legacy `reads <View> ...` on a command | PLAY0271 (error) | `command reads protected` opts eligible views into v25; see command-surface protected reads |
|
|
282
310
|
| `concurrency` block on a command | PLAY0271 (error) | "concurrency metadata keeps its legacy meaning and cannot bind to ESM v1" |
|
|
283
|
-
| `handler` (see above) | PLAY0268 |
|
|
311
|
+
| File/inline `handler` (see above) | PLAY0268 | pending described handlers instead bind v23; body execution and rendering remain gaps |
|
|
284
312
|
| `$context.tenant`, roles, claims, causation | PLAY0268 | no portable scalar counterpart |
|
|
285
313
|
| Arithmetic or raw expression in a `produces` mapping | PLAY0268 | |
|
|
286
314
|
| Template `` `${x}` `` or `$causedBy` in a projection | PLAY0268 | |
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
# Generation checks for tool and renderer authors
|
|
5
|
+
|
|
6
|
+
Use the language-owned APIs instead of copying option tables, rule evaluators or
|
|
7
|
+
proof logic. These are .NET APIs of Screenplay, not Cratis C# target contracts.
|
|
8
|
+
They never generate a value or execute an attached body.
|
|
9
|
+
|
|
10
|
+
## Choose the check
|
|
11
|
+
|
|
12
|
+
| Need | API | Result and boundary |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Populate strategy/option controls | `GenerationStrategyCatalog.All`, `Find(string name)` in `Cratis.Screenplay.Semantics` | Exact case-sensitive source spelling; unknown names return null. Descriptors expose ESM kind, source primitives, introducing version, admission/executability, fixed bits and options with placement, kinds, bounds, choices, defaults and conditions. `rule` serializes as `implementation`; reserved `sequence` is not admitted. Metadata alone is not validation. |
|
|
15
|
+
| Check one concept declaration | `SemanticConceptCheck.Check(concept, utcAssessmentYear: 2026)` in `Cratis.Screenplay.Semantics` | Accepts `ConceptSyntax` or `SemanticConcept`; returns `Concept`, `Findings`, `Proofs`, `Support`, `RequiredVersion`. No enclosing application is invented. |
|
|
16
|
+
| Check a concrete value | `SemanticValidationRules.Check(concept, value)` in `Cratis.Screenplay.Semantics` | Rule results in declaration order; also single-rule and application/type/value overloads. Not a declaration check or a general type validator. |
|
|
17
|
+
| Prove every generated-concept rule | `RuleConsistency.Check(concept, utcAssessmentYear: 2026)` in `Cratis.Screenplay.Semantics.Generation` | Results parallel `concept.Validations`: Proven, Refuted with witness, Unproven with reason. Status is not serialized in ESM. |
|
|
18
|
+
|
|
19
|
+
Requires Screenplay 4.174.0 (`screenplay --version`) for `RuleConsistency.Check`;
|
|
20
|
+
older consumers must not infer proof from missing serialized status.
|
|
21
|
+
Requires Screenplay 4.185.0 for `SemanticValidationRules.Check`; older consumers
|
|
22
|
+
lack the standalone value-check API.
|
|
23
|
+
Requires Screenplay 4.191.0 for `GenerationStrategyCatalog` and
|
|
24
|
+
`SemanticConceptCheck.Check`; older tools must use whole-model binding, not a
|
|
25
|
+
hand-maintained imitation of admission.
|
|
26
|
+
|
|
27
|
+
## Check a declaration, not a sample
|
|
28
|
+
|
|
29
|
+
```csharp
|
|
30
|
+
using Cratis.Screenplay.Diagnostics;
|
|
31
|
+
using Cratis.Screenplay.Semantics;
|
|
32
|
+
using Cratis.Screenplay.Syntax;
|
|
33
|
+
|
|
34
|
+
var concept = new ConceptSyntax("InviteCode", "String", [], [], SourceLocation.Start)
|
|
35
|
+
{
|
|
36
|
+
Generation = new("nanoid", SourceLocation.Start) { Size = 8, Alphabet = "ab" }
|
|
37
|
+
};
|
|
38
|
+
var check = SemanticConceptCheck.Check(concept, utcAssessmentYear: 2026);
|
|
39
|
+
Console.WriteLine(check.Support!.Count); // 256
|
|
40
|
+
Console.WriteLine(check.Support.MeetsIdentifierMinimum); // False
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The assessment year is nullable (null uses the current UTC year); pass it explicitly
|
|
44
|
+
for reproducible date support and witnesses. Valid years are 1–9899; invalid years
|
|
45
|
+
return PLAY0673 without an assessment. Both overloads accept optional
|
|
46
|
+
`assumeGenerated: false`: set true only for an implicit Uuid concept actually used
|
|
47
|
+
by a generated property, never to invent generation for String/Int.
|
|
48
|
+
|
|
49
|
+
Findings carry compiler code, severity, message and construct `Target`, not source
|
|
50
|
+
coordinates: a generation-wide finding, an option named by `Option`, or a rule
|
|
51
|
+
named by zero-based `RuleIndex`. Syntax indices count authored rules even when
|
|
52
|
+
some fail binding; proofs follow the inspected semantic validation array.
|
|
53
|
+
Unknown targets are not successful checks. A partial `Concept` is not admission.
|
|
54
|
+
|
|
55
|
+
Keep `Support.Count` as `BigInteger`; `Bits` is display data and
|
|
56
|
+
`MeetsIdentifierMinimum` can be null for unknown support. Unknown entropy is not
|
|
57
|
+
zero or proof of sufficient entropy. `RequiredVersion` describes this concept
|
|
58
|
+
only. PLAY0683/0684 depend on command-property use and uniqueness, so a concept
|
|
59
|
+
check cannot replace whole-application binding. It also proves no authorization,
|
|
60
|
+
implementation linkage, uniqueness or runtime readiness.
|
|
61
|
+
|
|
62
|
+
## Check values and interpret proofs
|
|
63
|
+
|
|
64
|
+
`SemanticValidationRules.Check` overloads accept `(SemanticValidationRule,
|
|
65
|
+
SemanticValue)`, `(SemanticConcept, SemanticValue)` or `(SemanticApplication,
|
|
66
|
+
SemanticTypeReference, SemanticValue)`. The last walks supplied composite and
|
|
67
|
+
collection values. Pass contract-validated inputs; incompatible rule/value kinds
|
|
68
|
+
throw `InvalidSemanticContract` rather than becoming ordinary failed rules.
|
|
69
|
+
|
|
70
|
+
A `SemanticRuleCheck` carries `Status`, `Rule`, `Message`, optional `Concept` and
|
|
71
|
+
`Pattern`. Status is Satisfied, Failed or NotEvaluable: never treat NotEvaluable
|
|
72
|
+
as a pass. Absent values satisfy evaluable rules except NotEmpty; opaque rules
|
|
73
|
+
remain NotEvaluable. Text compares ordinally, length counts UTF-16 code units,
|
|
74
|
+
and numbers compare as exact decimals. Severity does not waive a failed rule.
|
|
75
|
+
The API allocates nothing and executes no opaque predicate.
|
|
76
|
+
|
|
77
|
+
All-Proven rules permit unpinned generation only on targets that support it.
|
|
78
|
+
Unproven/Refuted rules need deterministic pins; refuted source contracts must
|
|
79
|
+
first be repaired. Passing samples do not prove containment. Stage supports the
|
|
80
|
+
all-Proven case from 4.115.0; Screenplay's reference runner and Stage's independent
|
|
81
|
+
specification executor still require every reached generated value to be pinned.
|
|
82
|
+
A strategy-shape fixture check is separate from checksum arithmetic: author
|
|
83
|
+
`validate checksum` to enforce arithmetic on pins too.
|
|
84
|
+
|
|
85
|
+
## References and verification
|
|
86
|
+
|
|
87
|
+
Read the product references for complete overload/result contracts:
|
|
88
|
+
[concept checks](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/concept-checks.md),
|
|
89
|
+
[value-rule checks](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/value-rule-checks.md),
|
|
90
|
+
and [strategy catalog and proofs](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/generated-values/strategies.md).
|
|
91
|
+
Build a tool against the required Screenplay library; the example's observable
|
|
92
|
+
result is count 256 and identifier minimum False. Then bind and verify the whole
|
|
93
|
+
model: a declaration check is not an executable-model verdict.
|
|
@@ -1,42 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
# Shop generation strategies example (ESM v21)
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Choosing a strategy
|
|
9
|
+
- Pinned creation and freshness
|
|
10
|
+
- Attached generation rule
|
|
11
|
+
- When not to
|
|
12
|
+
- Verify
|
|
13
|
+
|
|
14
|
+
## Choosing a strategy
|
|
15
|
+
|
|
16
|
+
Requires Screenplay 4.172.0 or later (`screenplay --version`) for pattern/random
|
|
17
|
+
and checksum validation; older compilers refuse PLAY0268.
|
|
18
|
+
Requires Stage 4.118.0 for checksum validation and 4.119.0 for pattern/random
|
|
19
|
+
rendering; older renderers refuse them with STAGE-ESM-042/-028. The attached rule
|
|
20
|
+
below still refuses STAGE-ESM-028. The reference runner uses whole-value fixtures,
|
|
21
|
+
never random seeds.
|
|
22
|
+
|
|
23
|
+
OrderId stays the high-entropy source identity. InvoiceNumber is a readable
|
|
24
|
+
reference, not a gapless/sequential invoice allocator or secret; its check digit
|
|
25
|
+
catches typos, not forgery. The Int pickup ticket is a value, not an identifier.
|
|
26
|
+
Unique constraints protect short payload codes, while serialized generation
|
|
27
|
+
activates freshness for the whole generated source. Dates/check digits add no
|
|
28
|
+
entropy. The clock fixes every UTC pattern segment, not the random digits.
|
|
29
|
+
|
|
30
|
+
## Pinned creation and freshness
|
|
6
31
|
|
|
7
32
|
```screenplay
|
|
8
|
-
concept
|
|
9
|
-
generate
|
|
10
|
-
concept
|
|
11
|
-
generate
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
concept OrderId : String
|
|
34
|
+
generate typeid "order"
|
|
35
|
+
concept InvoiceNumber : String
|
|
36
|
+
generate pattern "INV-{yyyy}{MM}-#{7}" checksum luhn
|
|
37
|
+
validate checksum luhn
|
|
38
|
+
concept TicketNumber : Int
|
|
39
|
+
generate random 100000..999999
|
|
40
|
+
module Shop
|
|
41
|
+
feature Orders
|
|
42
|
+
slice StateChange Place
|
|
43
|
+
constraint UniqueInvoiceNumber
|
|
44
|
+
unique invoiceNumber on OrderPlaced
|
|
45
|
+
constraint UniquePickupTicket
|
|
46
|
+
unique pickupTicket on OrderPlaced
|
|
47
|
+
command PlaceOrder
|
|
48
|
+
orderId OrderId generated identifier
|
|
49
|
+
invoiceNumber InvoiceNumber generated
|
|
50
|
+
pickupTicket TicketNumber generated
|
|
51
|
+
produces event OrderPlaced
|
|
52
|
+
invoiceNumber InvoiceNumber = invoiceNumber
|
|
53
|
+
pickupTicket TicketNumber = pickupTicket
|
|
54
|
+
returns orderId
|
|
55
|
+
specification PlacesWithPinnedValues
|
|
56
|
+
given clock "2026-10-02T09:00:00Z"
|
|
57
|
+
when PlaceOrder
|
|
58
|
+
for "order_0000000000e008000000000000"
|
|
59
|
+
generated invoiceNumber = "INV-202610-00000004"
|
|
60
|
+
generated pickupTicket = 123456
|
|
61
|
+
then OrderPlaced
|
|
62
|
+
for "order_0000000000e008000000000000"
|
|
63
|
+
invoiceNumber = "INV-202610-00000004"
|
|
64
|
+
pickupTicket = 123456
|
|
65
|
+
then returns "order_0000000000e008000000000000"
|
|
29
66
|
specification RejectsAUsedGeneratedSource
|
|
30
|
-
given
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
given clock "2026-10-02T09:00:00Z"
|
|
68
|
+
given OrderPlaced
|
|
69
|
+
for "order_0000000000e008000000000000"
|
|
70
|
+
invoiceNumber = "INV-202610-00000004"
|
|
71
|
+
pickupTicket = 123456
|
|
72
|
+
when PlaceOrder
|
|
73
|
+
for "order_0000000000e008000000000000"
|
|
74
|
+
generated invoiceNumber = "INV-202610-00000004"
|
|
75
|
+
generated pickupTicket = 123456
|
|
36
76
|
then error "A generated event source already has facts; retry the command with a fresh generated value."
|
|
37
77
|
```
|
|
38
78
|
|
|
39
|
-
The rejection appends no new facts and returns no response.
|
|
40
|
-
source even if
|
|
41
|
-
serialized
|
|
42
|
-
|
|
79
|
+
The rejection appends no new facts and returns no response. Freshness guards the
|
|
80
|
+
whole source even if its old facts use another stream or event type. Without a
|
|
81
|
+
serialized strategy the model is Unguarded, even if generated-concept rules
|
|
82
|
+
select v20; removing strategies is not a way to repair stale-source behavior.
|
|
83
|
+
Pin failure against shape or authored rules is a server Contract rejection,
|
|
84
|
+
never a client validation failure or a reason to redraw. Without `validate
|
|
85
|
+
checksum`, a fixture checks suffix shape only, not arithmetic. Without `given
|
|
86
|
+
clock`, date segments check digit widths only, never today's date.
|
|
87
|
+
|
|
88
|
+
## Attached generation rule
|
|
89
|
+
|
|
90
|
+
An implementation-specific tenant-bearing reference can instead attach one
|
|
91
|
+
generation rule; its entropy is unknown, not zero. The body gets only Now and
|
|
92
|
+
Tenant. The reference evaluator consumes a String fixture without running code:
|
|
93
|
+
|
|
94
|
+
````screenplay
|
|
95
|
+
concept TenantOrderReference : String
|
|
96
|
+
generate rule TenantOrder
|
|
97
|
+
```csharp
|
|
98
|
+
return $"{context.Tenant}:order_{context.Now:yyyyMMdd}-{Guid.NewGuid():N}";
|
|
99
|
+
```
|
|
100
|
+
module Shop
|
|
101
|
+
feature Orders
|
|
102
|
+
slice StateChange ReserveReference
|
|
103
|
+
command ReserveReference
|
|
104
|
+
reference TenantOrderReference generated
|
|
105
|
+
returns reference
|
|
106
|
+
specification UsesThePinnedReference
|
|
107
|
+
when ReserveReference
|
|
108
|
+
generated reference = "shop-eu:order_example"
|
|
109
|
+
then returns "shop-eu:order_example"
|
|
110
|
+
````
|
|
111
|
+
|
|
112
|
+
## When not to
|
|
113
|
+
|
|
114
|
+
Keep client-minted values as inputs. Generation is neither idempotency nor
|
|
115
|
+
authorization. Use an allocator for gapless numbering, and preserve secret
|
|
116
|
+
classification rather than trying to bind generated credentials. A short code's
|
|
117
|
+
uniqueness constraint protects its payload claim, not source freshness or retry
|
|
118
|
+
safety after an unknown append outcome.
|
|
119
|
+
|
|
120
|
+
## Verify
|
|
121
|
+
|
|
122
|
+
Compile with `screenplay <file> --warnaserror`; then `screenplay test <file>` must report
|
|
123
|
+
all selected specifications passed, none failed or unsupported. Passing reference
|
|
124
|
+
specifications do not prove target support or that attached generation code runs.
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
# Language admission: batches, described bodies, text and reads
|
|
5
|
+
|
|
6
|
+
Select the highest version required by constructs in the model. A newer version
|
|
7
|
+
alone never opts into either application mode. Consumers must explicitly admit
|
|
8
|
+
exact language/semantic pairs; binding, reference execution and rendering are separate.
|
|
9
|
+
|
|
10
|
+
| ESM | Selecting construct | Binding/reference behavior | Stage boundary |
|
|
11
|
+
| --- | --- | --- | --- |
|
|
12
|
+
| v22 | Application-root `reaction batches atomic` | Direct productions per trigger occurrence and each selected refusal branch are separate atomic batches; commands remain independent | v22 refused STAGE-ESM-016; mode in admitted v23–v25 refused STAGE-ESM-043 |
|
|
13
|
+
| v23 | Pending `handler implementation` beside unconditional `produces` | Payload-only body; PLAY0695 information; reaching body gives Unsupported ImplementationBody | v23 admitted, body refused STAGE-IMPL-002 in renderer/Host/executor, even Stub mode |
|
|
14
|
+
| v24 | `contains`, `not contains`, `starts with`, `ends with` property/concept rules | Ordinal UTF-16, absent optional passes; not text-condition operators | v24 admitted; semantic Host/executor and generated ordinal comparisons preserve rules |
|
|
15
|
+
| v25 | Application-root `command reads protected` | Admitted reads in requirements/mappings, absence Validation, matching decide/commit changes Conflict | v25 admitted; protected reads refused STAGE-ESM-044 in renderer/Host/executor |
|
|
16
|
+
|
|
17
|
+
Requires Screenplay 4.181.0 or later (`screenplay --version`) for atomic batches; older compilers cannot admit the preamble.
|
|
18
|
+
|
|
19
|
+
Requires Screenplay 4.182.0 or later (`screenplay --version`) for described handlers; older binders report PLAY0268.
|
|
20
|
+
|
|
21
|
+
Requires Screenplay 4.184.0 or later (`screenplay --version`) for literal text rules; older binders do not admit those rules.
|
|
22
|
+
|
|
23
|
+
Requires Screenplay 4.193.0 or later (`screenplay --version`) for protected reads; older binders retain PLAY0271/PLAY0268.
|
|
24
|
+
|
|
25
|
+
Requires Stage 4.124.0 for v24 text-rule admission (`cratis --version` identifies the CLI bundle); older renderers refuse v24 with STAGE-ESM-016. V23 admission alone does not implement described bodies.
|
|
26
|
+
|
|
27
|
+
Requires Stage 4.127.0 for v25 version admission; older renderers refuse v25 with STAGE-ESM-016. Protected reads still refuse STAGE-ESM-044, including on legacy paths; no artifacts are emitted.
|
|
28
|
+
|
|
29
|
+
Read [atomic batches and event-source invocation mappings](../../cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md)
|
|
30
|
+
for atomic boundaries and the source-identity mapping prerequisite. Start new models
|
|
31
|
+
with atomic mode; explicitly review opt-in for legacy models. Keep protection when
|
|
32
|
+
Stage refuses: do not remove the declaration or promise a target release date.
|
|
33
|
+
|
|
34
|
+
Read [described handlers](../../cratis-screenplay-command-surface/references/described-handlers.md)
|
|
35
|
+
for the payload result contract and [protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
36
|
+
for finite event-source-keyed view admission, single-level paths and repair guards.
|
|
37
|
+
Text comparisons and matching are in [text and match rules](../../cratis-screenplay-command-surface/references/text-and-match-rules.md).
|
|
38
|
+
`matches` uses the portable linear dialect without selecting a new ESM version;
|
|
39
|
+
PLAY0699 refuses nonportable constructs, PLAY0367 invalid syntax, PLAY0787 warns
|
|
40
|
+
on exact Studio text-rule patterns and offers a literal-rule repair.
|
|
41
|
+
|
|
42
|
+
Stage's semantic engines admit exact v1–v21 and v23–v25 pairs. V22/v26 and mixed
|
|
43
|
+
pairs refuse STAGE-ESM-016. Admission of v23–v25 is not admission of described bodies,
|
|
44
|
+
atomic mode or protected reads. A CLI may bundle an older compiler/Stage pair: run no-write render
|
|
45
|
+
admission rather than transferring a standalone verdict. Pattern diagnostics arise
|
|
46
|
+
in Screenplay before rendering; diagnostic arguments add no ESM version or new tool.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Use these forms when writing or reviewing `.play`. Acceptance of an older
|
|
7
7
|
spelling is not a recommendation to teach it. Information diagnostics do not
|
|
8
|
-
fail `--warnaserror`; the corpus verification gate rejects the
|
|
8
|
+
fail `--warnaserror`; the corpus verification gate rejects the eleven style codes
|
|
9
9
|
below even when a fence declares `expect`, unless an exact, reasoned migration
|
|
10
10
|
exception exists in the verifier's preferred-syntax allowlist. That allowlist also
|
|
11
11
|
covers deliberate legacy explanations in prose; stale entries fail.
|
|
@@ -23,6 +23,8 @@ covers deliberate legacy explanations in prose; stale entries fail.
|
|
|
23
23
|
| Imports | Import only declarations not already declared by the application | Importing the application's own names | PLAY0290 (warning) |
|
|
24
24
|
| Interaction guard | Block-form `when` alternatives | Opaque interaction `where` on click, double click or select | PLAY0564 (warning or information) |
|
|
25
25
|
| Projection transition cardinality | Source binding emits `One` | Constructed/deserialized ESM v1–v3 `ZeroOrOne` / `Many` | PLAY0445 (warning; ESM-only, not a source spelling) |
|
|
26
|
+
| Command decision reads | `command reads protected` after reviewing every read's admission, absence and conflict semantics | Eligible legacy command reads without the application-root preamble | PLAY0786 (information; individual typed repair review, never fix-all) |
|
|
27
|
+
| Literal text rules | `starts with`, `ends with`, `contains`, `not contains` or equality, preserving message and severity | Exact deprecated Studio `matches` shapes | PLAY0787 (warning; not arbitrary regex rewriting) |
|
|
26
28
|
|
|
27
29
|
`query Q => observable?` is not a legacy optional type suffix and has no keyword
|
|
28
30
|
replacement. Reaction/Translate `where` is current syntax, not an interaction
|