@cratis/pi 7.62.0 → 7.64.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 +37 -30
- package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +100 -0
- 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 +26 -6
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +13 -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 +13 -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 +48 -30
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +10 -4
- 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 +9 -4
- 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 +69 -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/outcome-comparison.md +6 -0
- 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 +32 -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 +66 -6
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +67 -23
- 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 +61 -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 +27 -10
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +3489 -335
- 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 +39 -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
|
@@ -11,7 +11,7 @@ instruction for the work, not background reading. Skills that restate one cite i
|
|
|
11
11
|
6. **Keep semantic identity independent of names, paths, layout and generated symbols.** Commit the identity catalog with the model.
|
|
12
12
|
7. **Keep unsupported intent visible.** Return a precise gap and its owning issue; never weaken the model so rendering passes.
|
|
13
13
|
8. **Write specifications with intent, including rejection and denial.** Never report an unexecuted or unsupported scenario as passed.
|
|
14
|
-
9. **Treat state reads as a correctness boundary.**
|
|
14
|
+
9. **Treat state reads as a correctness boundary.** Eligible command reads opt into `command reads protected` (v25); legacy/trigger reads remain unprotected. Stage refuses protected reads (STAGE-ESM-044), not the v25 pair: reference absence/conflict guarantees and verified target realization are different claims.
|
|
15
15
|
10. **Separate event-source identity from event payload and choose destinations explicitly.**
|
|
16
16
|
11. **Persisted event shape changes are evolution, never cleanup.** Keep historical generations.
|
|
17
17
|
12. **Model external work as business intent.** Provider interfaces and transport mechanics stay out of the language.
|
package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md
CHANGED
|
@@ -21,7 +21,7 @@ speaks in them; never model board mechanics (lanes, node ids, positions).
|
|
|
21
21
|
| Storyline (ordered beats) | a **family** of specifications sharing example data, each one transition (no storyline syntax) | several spec classes | specifications |
|
|
22
22
|
| Field validation | concept `validate` (every use) / command `validate`, `require` | `ConceptValidator<T>` / `CommandValidator<T>` | command validation |
|
|
23
23
|
| Role permission ("Cannot") | `policy` + `authorize` + `then denied` spec; ownership via `claim ... matches subject` | `[Authorize(Policy)]`, generated policies | authorization |
|
|
24
|
-
| Precondition on stream state | `reads` + `require`
|
|
24
|
+
| Precondition on stream state | `command reads protected` + eligible `reads`/`require` (v25 reference protection); legacy/refused reads remain stated intent. Stage refuses protected reads (STAGE-ESM-044); target Arc `[ProtectedDecision]` + `DecisionRead<T>` or Chronicle DCB needs separate verification | decision over a guarded read | command validation |
|
|
25
25
|
| Generated id (`derived:uuid4()`) | `generated` (authorable, not executable) | id supplied before `Handle()` | commands |
|
|
26
26
|
| External system / outbound call | `Translate` slice (inbound); `system`/`operation` (authorable, not executable) or Automation (outbound) | `ICommandOperation` / reactor | operations, reactors |
|
|
27
27
|
| HTML mockup | `screen` Level 1 + board (`visualize-model`) | default Scene composition | ui composition |
|
|
@@ -263,9 +263,8 @@ choosing a whole action list rather than one labeled command, use block-form
|
|
|
263
263
|
**Inside out:** the slice, then the enclosing feature, then the module, then the
|
|
264
264
|
document. The innermost match wins.
|
|
265
265
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
21 times. Two sibling slices can each declare `All`, and each screen gets its own.
|
|
266
|
+
Sibling slices may each declare `All`; each screen resolves its own query.
|
|
267
|
+
Read `references/named-keys.md` when query scope affects identity inference.
|
|
269
268
|
|
|
270
269
|
Reach across slices by qualifying with **any trailing part** of the scope.
|
|
271
270
|
Excerpt: `Queue` and `Deviations` are sibling slices that each declare `All`.
|
|
@@ -100,7 +100,9 @@ Composite read-model keys, query `by` blocks and fixtures
|
|
|
100
100
|
over those views remain authoring-only: binding reports PLAY0268 citing
|
|
101
101
|
Screenplay#599 (still open). They do not reference-execute or render. This is not
|
|
102
102
|
ESM v10 admission; v10 covers reaction identity, production routes and observer
|
|
103
|
-
filters.
|
|
103
|
+
filters. Eligible command reads separately opt into v25 with `command reads protected`;
|
|
104
|
+
legacy reads remain PLAY0271, and composite keys are still refused (PLAY0781 ByParts).
|
|
105
|
+
See command-surface [protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md).
|
|
104
106
|
A single explicit key does bind; Stage admission still depends on the complete
|
|
105
107
|
model and projection/query shape, not just the key modifier.
|
|
106
108
|
|
|
@@ -32,6 +32,12 @@ Tool versions are covered in `cratis-screenplay-toolchain` `SKILL.md`; read it b
|
|
|
32
32
|
(the user); Stage internals and the sandbox (`cratis-stage-rendering-and-sandbox`); judging
|
|
33
33
|
hand-written code against its slice (`cratis-application-slice-conformance`).
|
|
34
34
|
|
|
35
|
+
## Language modes that block target delivery
|
|
36
|
+
|
|
37
|
+
Read [language admission](../cratis-screenplay-toolchain/references/language-admission.md)
|
|
38
|
+
for v22–v25: Stage refuses atomic batches, described bodies (even Stub mode) and
|
|
39
|
+
protected reads. Preserve contracts; reference success is not target realization.
|
|
40
|
+
|
|
35
41
|
## Interview phase
|
|
36
42
|
**Skip if** the request names the model root, the application name, the destination and the
|
|
37
43
|
decision on non-renderable scope. Otherwise ask only what is missing:
|
|
@@ -143,9 +149,8 @@ Adapters and non-renderable scope follow the contract rules of `cratis-applicati
|
|
|
143
149
|
the Arc/Chronicle set in `cratis-stage-rendering-and-sandbox` `references/rendered-application.md`; API availability alone is not verified enforcement.
|
|
144
150
|
- Adapters that call outside systems follow `cratis-engineering-effect-boundaries`; slice
|
|
145
151
|
specifications follow `cratis-application-slice-specifications`.
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
Executable parts (specifications, mappings, constraints) win over prose, and a contradicting description is a model defect to report.
|
|
152
|
+
- Read conformance's `references/contract-and-precedence.md` for realization-note
|
|
153
|
+
authority. Executable contract wins over prose; report contradictions.
|
|
149
154
|
|
|
150
155
|
## Rules
|
|
151
156
|
|
package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md
CHANGED
|
@@ -105,6 +105,14 @@ stable array or list. The Stage scaffold pins an older Arc, so raise the version
|
|
|
105
105
|
`Customizations/Dependencies.props` only after a restore and build proves it. Never split the
|
|
106
106
|
reaction or drop an effect to dodge rendering.
|
|
107
107
|
|
|
108
|
+
Preserve declared `reaction batches atomic` boundaries: each trigger occurrence's
|
|
109
|
+
direct productions and each selected refusal branch are separate batches, with
|
|
110
|
+
invoked commands independent. Stage refuses v22 (STAGE-ESM-016) and atomic mode
|
|
111
|
+
in admitted v23–v25 (STAGE-ESM-043); the declaration is not external-effect deduplication.
|
|
112
|
+
For described handlers, hand off only payload computation under the v23 result
|
|
113
|
+
contract; Stage STAGE-IMPL-002 means no stubs, even Stub mode. Protected v25 reads
|
|
114
|
+
refuse STAGE-ESM-044 despite version admission and need target admission/enrollment tests; ordinary injection never supplies protection.
|
|
115
|
+
|
|
108
116
|
## Re-delivery
|
|
109
117
|
The work list is the full in-scope contract delta since the fallback record's last verified source
|
|
110
118
|
identity (specifications, rules, mappings, realization notes), then the whole contract is
|
package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md
CHANGED
|
@@ -14,8 +14,10 @@ probe reports and choosing what to do. Do not copy the code table here.
|
|
|
14
14
|
2. Execution planning builds the plan and can emit `PLAN-*` diagnostics before Stage runs.
|
|
15
15
|
3. Stage plans the target and admits or rejects each member: `STAGE-ESM-0xx`; profile and path
|
|
16
16
|
problems `STAGE-CRATIS-0xx`. An evolved event is reported with Stage's own `STAGE-ESM-026`
|
|
17
|
-
(still refused); the CLI adds nothing.
|
|
18
|
-
|
|
17
|
+
(still refused); the CLI adds nothing. Read the owning Stage admission table and
|
|
18
|
+
toolchain `references/renderable-subset.md` for exact pairs and version minimums;
|
|
19
|
+
CLI admission remains bounded by its bundled renderer. Each unsupported construct
|
|
20
|
+
has its own code; version admission is not construct support.
|
|
19
21
|
4. Any error in the selected scope publishes nothing: the run ends with exit 5 and the diagnostics.
|
|
20
22
|
Without `--scope` the scope is the whole application. With `--scope`, `PLAN-*` problems in
|
|
21
23
|
unselected slices are warnings and `STAGE-ESM-*` refusals in unselected slices do not block;
|
|
@@ -28,8 +30,8 @@ ESM). Only the probe answers renderability. `PLAY0270` entries are information,
|
|
|
28
30
|
|
|
29
31
|
| Class | Meaning | Typical examples (each verified in `admission.md`) | Action |
|
|
30
32
|
| --- | --- | --- | --- |
|
|
31
|
-
| **Model fix (in mode)** | the model is in, or the user chose, renderable mode and breaks its own subset in a way that has a renderable equivalent with the same meaning | a `produces` whose `for` is not the command identifier;
|
|
32
|
-
| **Capability gap** | the intended meaning needs a construct Stage does not render yet |
|
|
33
|
+
| **Model fix (in mode)** | the model is in, or the user chose, renderable mode and breaks its own subset in a way that has a renderable equivalent with the same meaning | a `produces` whose `for` is not the command identifier; two projections for one read model (`-007`); a policy Stage cannot express portably (`-015`; role-only and opaque pure policies render) | edit request to the modeler session with address, change and rationale |
|
|
34
|
+
| **Capability gap** | the intended meaning needs a construct Stage does not render yet | DateTime equality filters and required parameters after optional filters (`-010`); context/single-result filters, opaque `scoped to`/`performer` and composite `by` remain PLAY0268; Translate, clocks, captures, non-event triggers and opaque reaction bodies (`-024`); claim-reading/opaque `runs as` gates (`-034`), legacy `from` (`-035`), mixed effects in one handler (`-037`, retries can duplicate events; keep it whole), unsupported reaction mappings (`-039`); unsupported generated types/result combinations (`-028`/`-038`); `then no readmodel` (`-027`); evolved events (`STAGE-ESM-026`); unsupported expression/enum production conditions (`-006`; supported conditional productions render); legacy reads (`PLAY0271`), protected reads (STAGE-ESM-044 despite v25 admission); code validation (`-005`); protected identities/enums (`-040`) or unadmitted explicit subject lineage (`PLAY0268`); attached command handlers (PLAY0268), described handlers (v23, STAGE-IMPL-002 even Stub mode), atomic mode (STAGE-ESM-016 for v22, STAGE-ESM-043 in admitted v23–v25) | keep the model; fallback record entry; options a to c in `SKILL.md`; link the Stage issue |
|
|
33
35
|
| **Tool skew** | the bundled compiler disagrees with documented semantics | the false `PLAY0285` on reaction cascades from an older bundle; codes the standalone compiler does not raise | record in the session state and the fallback record; never "fix" a correct model |
|
|
34
36
|
| **Environment** | not the model | restore failures, missing SDK, a destination that is not writable | fix the environment or report blocked |
|
|
35
37
|
|
|
@@ -7,11 +7,10 @@ license: MIT
|
|
|
7
7
|
# Screenplay scenario coverage
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`cratis-screenplay-specifications`; this skill owns coverage and method.
|
|
10
|
+
Decide **which** situations need specifications in a coverage matrix, then use
|
|
11
|
+
consistent example data and mode-admitted forms. Record inexpressible cases; never
|
|
12
|
+
fake them. This skill owns coverage; `cratis-screenplay-specifications` owns grammar
|
|
13
|
+
and outcome comparison.
|
|
15
14
|
|
|
16
15
|
## When / when not
|
|
17
16
|
- Use: the scenario phase of `cratis-screenplay-modeling-lifecycle`; adding or changing a
|
|
@@ -33,11 +32,9 @@ Use it to seed, never replace, the matrix. Multi-step storylines remain unavaila
|
|
|
33
32
|
lifecycle families emulate them.
|
|
34
33
|
|
|
35
34
|
## Interview phase
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Critical questions, one at a time, with follow-ups:
|
|
40
|
-
Ask only what is missing: depth, known rules and edge cases (one allowed and the nearest refused request per rule), intended use (decides admitted forms), and who validates. Read [references/interview-batch.md](references/interview-batch.md) for the four questions and follow-ups.
|
|
35
|
+
Ask only what is missing: coverage depth, allowed/refused rule examples, intended
|
|
36
|
+
execution mode and who validates. Read [interview prompts](references/interview-batch.md)
|
|
37
|
+
when these inputs are unsettled; skip answered questions.
|
|
41
38
|
|
|
42
39
|
**Unattended:** assume visibly, never invent a rule, and record who actually answered; an agent asking itself four kinds of question is not four approvals.
|
|
43
40
|
|
|
@@ -64,23 +61,22 @@ Ask only what is missing: depth, known rules and edge cases (one allowed and the
|
|
|
64
61
|
existing intentional fixtures (`references/scenario-catalogue.md` "Example data"). Shared
|
|
65
62
|
fixtures may live as typed `example`s in another document beside the declarations they type
|
|
66
63
|
(`cratis-screenplay-specifications` `references/examples-and-routes.md`).
|
|
67
|
-
7. **Draft commands
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
cases
|
|
72
|
-
authenticated policy witness for success/denial; use explicit callers for
|
|
73
|
-
anonymous/ownership or unsynthesizable personas. Syntax and complete model:
|
|
74
|
-
`cratis-screenplay-specifications` `references/persona-callers-and-cases.md`.
|
|
64
|
+
7. **Draft commands** for each applicable scenario type below. Vary only the value
|
|
65
|
+
under test in a rejection. Read specifications'
|
|
66
|
+
[persona callers and cases](../cratis-screenplay-specifications/references/persona-callers-and-cases.md)
|
|
67
|
+
when sharing a validation matrix or choosing synthesized versus explicit callers;
|
|
68
|
+
cases are not fixture examples and do not group unrelated behaviors.
|
|
75
69
|
8. **Separate view pass**: population, each update, accumulation, removal (with a surviving
|
|
76
70
|
row), absence, ordering. Mark lifecycle branches. Views combining sources must
|
|
77
71
|
tolerate any arrival order. Pin a child before its parent (Requires Screenplay 4.149.1 or later):
|
|
78
72
|
given child, then parent, then read model; "parent never arrives" leaves the
|
|
79
73
|
child absent. Evidence/example: `references/view-and-story-specs.md`.
|
|
80
|
-
9. **State-dependent rules**: `reads
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
9. **State-dependent rules**: use `reads` plus `require` over authoritative state;
|
|
75
|
+
eligible views opt into `command reads protected` (v25). Cover present/absent reads,
|
|
76
|
+
refusal and denial; matching decide/commit changes are conflicts, not refusals.
|
|
77
|
+
Read [protected reads](../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
78
|
+
for admission and Stage refusal; legacy/refused shapes remain marked unenforced
|
|
79
|
+
with a named target mechanism. Forbidden:
|
|
84
80
|
caller-supplied copies of state in `require`, boolean attestation inputs (`confirmsX ==
|
|
85
81
|
true`) and rules hidden in `handler`/hint prose. Never drop an unresolved given or assertion
|
|
86
82
|
to make a spec compile: record the blocked case and continue.
|
|
@@ -91,6 +87,16 @@ Ask only what is missing: depth, known rules and edge cases (one allowed and the
|
|
|
91
87
|
## Scenario types (decide each per command; detail in `references/scenario-catalogue.md`)
|
|
92
88
|
Decide each of these per command: happy path; rule rejection (one spec per rule, exact pinned `then error`); denial (`given caller` without the policy, `then denied`, one per gated command and query); state violation; duplicate or retry; competing claim; alternative path; ordering; external failure; compensation; evolution; and the view pass. Read [references/scenario-catalogue.md](references/scenario-catalogue.md) ("Scenario types at a glance") for each type's question and usual shape.
|
|
93
89
|
|
|
90
|
+
For command Date/DateTime ordering, cover increasing and inverted intervals,
|
|
91
|
+
equality across offsets, a one-tick boundary and **each participating DateTime
|
|
92
|
+
input without an offset or Z**. That last case rejects with Validation before rules,
|
|
93
|
+
even if a condition short-circuits or a production is skipped. `then` stays ordinal;
|
|
94
|
+
never replace payload text with an equivalent instant. Read the complete
|
|
95
|
+
[retention-window specifications](../cratis-screenplay-command-surface/references/date-comparisons.md)
|
|
96
|
+
for the compiler prerequisite, admitted positions, refused `today` and Stage's v26
|
|
97
|
+
refusal. Missing-offset runtime coverage needs an evaluator-request or target input
|
|
98
|
+
test: a typed `.play` fixture rejects that value at binding with PLAY0273, before runtime.
|
|
99
|
+
|
|
94
100
|
For recovery, `when redelivered <Event> to <Reaction>` must select one definitely
|
|
95
101
|
matching effective given and no undecided candidate. It delivers only to the named
|
|
96
102
|
reaction without re-appending the input; `then no events` explicitly checks no
|
|
@@ -101,11 +107,10 @@ when specifying malformed keys/filters versus valid absence (ESM v18).
|
|
|
101
107
|
Requires Screenplay 4.157.0 (`screenplay --version`) for v17, 4.161.0 for query
|
|
102
108
|
validation/error assertions; older tools do not execute these contracts.
|
|
103
109
|
|
|
104
|
-
**Once, idempotent, exactly once are different claims.**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
target requirements.
|
|
110
|
+
**Once, idempotent, exactly once are different claims.** `unique event` proves a once-only fact,
|
|
111
|
+
not successful retry handling or an exactly-once external effect. Name the claim
|
|
112
|
+
proved and keep other guarantees as target requirements; recovery cases are in
|
|
113
|
+
`references/scenario-catalogue.md`.
|
|
109
114
|
|
|
110
115
|
## Rules
|
|
111
116
|
### Compiler contracts
|
|
@@ -116,7 +121,8 @@ target requirements.
|
|
|
116
121
|
or query spec needs `given caller` or `given caller as <Persona>` (module and feature gates count); an authorized scenario
|
|
117
122
|
gets no inferred fixture (PLAY0389). Unauthorized is never `then error`.
|
|
118
123
|
- Duplicate and competing specs use `when <Command>`; `when append` is for projection and
|
|
119
|
-
automation triggers,
|
|
124
|
+
automation triggers, consumed public events driving captures, and for a
|
|
125
|
+
constraint the command's own validation would reject first.
|
|
120
126
|
- `null` only for optional read-model properties; constraint messages are copied verbatim.
|
|
121
127
|
- Executable-only binding checks (PLAY0350/0352/0388/0389/0273) do not show in V1: run V3.
|
|
122
128
|
|
|
@@ -126,9 +132,12 @@ target requirements.
|
|
|
126
132
|
(denial), `<View>LifecycleN<State>` for families.
|
|
127
133
|
- `for` on every given, appended and expected event (plain `produces <Name>` too; inline `produces event` omits it), and on the `when` command where the
|
|
128
134
|
destination matters. A competing-claim given needs a *different* `for`.
|
|
135
|
+
Foreign event fixtures feeding a capture may omit `for`; supplied `for` is
|
|
136
|
+
opaque source text, not the capture's content key.
|
|
129
137
|
- Format rules belong on a `concept`: give each concept rule representative acceptance,
|
|
130
138
|
rejection and boundary specs once (through one command that carries it), not on every use;
|
|
131
|
-
never `n/a` automatically.
|
|
139
|
+
never `n/a` automatically. Date/DateTime comparisons are command-only, not concept rules.
|
|
140
|
+
Include a whitespace-only rejection for text `not empty`:
|
|
132
141
|
this changes outcomes in every ESM version (Requires Screenplay 4.151.0 or later). Unicode/identity boundaries
|
|
133
142
|
and evidence: command-surface `references/validate-rules.md`.
|
|
134
143
|
A business rule gets one rejection spec if an expert could recognize it from its message;
|
|
@@ -149,7 +158,16 @@ Read [references/review-questions.md](references/review-questions.md) for the ra
|
|
|
149
158
|
|
|
150
159
|
## Public-event coverage (ESM v9)
|
|
151
160
|
|
|
152
|
-
Outbound publication needs `when append <private>` and `then <PublicEvent>`.
|
|
161
|
+
Outbound publication needs `when append <private>` and `then <PublicEvent>`.
|
|
162
|
+
Captures over public events use `given <FromEvent>` / `when append <FromEvent>`,
|
|
163
|
+
not capture records (PLAY0701). Read [references/public-event-coverage.md](references/public-event-coverage.md)
|
|
164
|
+
when specifying public events or routed producers and observers.
|
|
165
|
+
|
|
166
|
+
Record captures distinguish first sight from updates: first root/child/nested
|
|
167
|
+
records are added only, so field guards need `given capture` for the same key.
|
|
168
|
+
Use a separate `when added` append when initial observations should produce a fact.
|
|
169
|
+
Read captures-and-reactions `references/record-capture-specifications.md` for the
|
|
170
|
+
prerequisite and runnable cases. Include first, changed and unchanged rows in the matrix.
|
|
153
171
|
|
|
154
172
|
## Version skew: reaction cascades and false PLAY0285
|
|
155
173
|
Under ESM v6 a command spec's `then` lists the events reactions cascade from it; an older `cratis` bundle reports a **false PLAY0285** for it. Never delete the reaction. Read [references/version-skew.md](references/version-skew.md) when a spec with cascade events reports PLAY0285 or the bundled compiler is older than the standalone tool.
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Berth reservations: worked example
|
|
2
2
|
|
|
3
|
+
This is a legacy control without `command reads protected`; the unprotected-read
|
|
4
|
+
markers below describe that control, not all command reads. Eligible views can opt
|
|
5
|
+
into v25; the date-rule blocker still remains. Read
|
|
6
|
+
[protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
7
|
+
for admission and Stage's protected-read refusal (STAGE-ESM-044).
|
|
8
|
+
|
|
3
9
|
Complete, compiled design-mode model (marina guest berths) showing a coverage matrix turned into specifications: happy path, one rejection per rule, authorization denial, duplicate and retry, competing claim, state violation, alternative branches, compensation and a view lifecycle family. The matrix for it is in `coverage-matrix.md`; the catalogue (`scenario-catalogue.md`) names its specifications.
|
|
4
10
|
|
|
5
11
|
```screenplay test=unbound
|
|
@@ -12,8 +18,8 @@ Complete, compiled design-mode model (marina guest berths) showing a coverage ma
|
|
|
12
18
|
// + `require ... message` and marked NOT enforced in the slice descriptions, with their target
|
|
13
19
|
// named. Binding reports PLAY0271/PLAY0268 for them (expected; Screenplay#129): such a model
|
|
14
20
|
// is design-complete but not binding-ready, and that is reported, never "fixed" by deleting the
|
|
15
|
-
// rules. The past-date rule (`night >= today`) is declarative too:
|
|
16
|
-
// so binding reports PLAY0268 on it (recorded as blocked, not moved into prose); the rule and its rejection
|
|
21
|
+
// rules. The past-date rule (`night >= today`) is declarative too: `today` has no runtime date
|
|
22
|
+
// value, so binding reports PLAY0268 on it (recorded as blocked, not moved into prose); the rule and its rejection
|
|
17
23
|
// specification stay so the intent executes once a date value exists.
|
|
18
24
|
// Verified: V1 (warnings as errors). V3 binding is blocked by the stored-state and date rules.
|
|
19
25
|
|
|
@@ -30,7 +36,7 @@ module Berths
|
|
|
30
36
|
authorize IsHarbourOffice
|
|
31
37
|
|
|
32
38
|
slice StateChange ReserveBerth
|
|
33
|
-
description "One guest boat per berth per night. OneBoatPerBerthNight declares that two event sources cannot hold the same berth-night; the competing-claim specification pins the loser's rejection after an earlier holder. It neither runs two commands at once nor proves the runtime's index-and-append behaviour under failure: that needs target-level verification. A retried ReserveBerth with the same reservation id is refused by ReserveOnce: the fact occurs once, but the retry is NOT answered with success, so a client that lost the first acknowledgement must treat this rejection as 'already reserved' (idempotent handling is a target decision, recorded as an open question). The night must not be in the past: declared in `validate` (`night >= today`) with its rejection specification. Binding reports PLAY0268 for
|
|
39
|
+
description "One guest boat per berth per night. OneBoatPerBerthNight declares that two event sources cannot hold the same berth-night; the competing-claim specification pins the loser's rejection after an earlier holder. It neither runs two commands at once nor proves the runtime's index-and-append behaviour under failure: that needs target-level verification. A retried ReserveBerth with the same reservation id is refused by ReserveOnce: the fact occurs once, but the retry is NOT answered with success, so a client that lost the first acknowledgement must treat this rejection as 'already reserved' (idempotent handling is a target decision, recorded as an open question). The night must not be in the past: declared in `validate` (`night >= today`) with its rejection specification. Binding reports PLAY0268 for the `today` operand, which has no runtime date value (comparisons between Date or DateTime command properties, or against literals, bind), so this rule is design-complete but blocks V3 until Screenplay supports `today`."
|
|
34
40
|
command ReserveBerth
|
|
35
41
|
reservationId ReservationId identifier
|
|
36
42
|
berth BerthCode
|
|
@@ -93,7 +99,7 @@ module Berths
|
|
|
93
99
|
boatLength = 31
|
|
94
100
|
then error "Guest berths take boats up to 24 metres"
|
|
95
101
|
|
|
96
|
-
// Declarative past-date rule; binding is blocked for
|
|
102
|
+
// Declarative past-date rule; binding is blocked for the `today` operand (see header).
|
|
97
103
|
specification RejectingANightInThePast
|
|
98
104
|
given caller
|
|
99
105
|
authenticated
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Invoicing and dues: design-mode document for the stored-state rules
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Legacy control without `command reads protected`, not binding-ready by design.**
|
|
4
|
+
Read [protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
5
|
+
for the opt-in alternative. Do not insert the preamble blindly: every read must meet
|
|
6
|
+
finite event-source-keyed admission with removals. A v25 reference pass still does not
|
|
7
|
+
render protected reads: Stage admits v25 but refuses them with STAGE-ESM-044. The comments and unenforced markers below describe
|
|
8
|
+
this legacy control, not a general limit on command reads.
|
|
9
|
+
|
|
10
|
+
**Design mode.** This document states the stored-state rules of the
|
|
4
11
|
invoicing example as the skill requires (`reads <View>` + `require ... message`, marked NOT
|
|
5
12
|
enforced in the slice `description`, target named). It compiles (V1, warnings as errors) but
|
|
6
13
|
does not bind, and the only blockers are `reads` (PLAY0271) and `require` over
|
|
@@ -17,7 +24,7 @@ The excerpt's Stage API-availability comment describes the historical Stage 4.24
|
|
|
17
24
|
scaffold. Stage 4.73.1's scaffold pins an Arc/Chronicle set (see the Stage skill's `references/rendered-application.md`): protected-read APIs are
|
|
18
25
|
available to gap-fill (the "not in a Stage-rendered application" comment in the source is
|
|
19
26
|
superseded), not emitted protection or `.play` rule admission. The
|
|
20
|
-
|
|
27
|
+
capture uses separate first-sight/update appends, with its local-event follow-up in Automation.
|
|
21
28
|
|
|
22
29
|
```screenplay expect PLAY0516 test=unbound
|
|
23
30
|
// Scenario coverage design-mode example: stored-state rules of invoicing club dues (complete document).
|
|
@@ -89,6 +96,10 @@ module Invoicing
|
|
|
89
96
|
outcome = outcome translate
|
|
90
97
|
"C" => captured
|
|
91
98
|
"D" => declined
|
|
99
|
+
append PaymentGatewayResultReceived
|
|
100
|
+
when added
|
|
101
|
+
outcome = $.outcome
|
|
102
|
+
reason = $.reason
|
|
92
103
|
append PaymentGatewayResultReceived
|
|
93
104
|
when outcome
|
|
94
105
|
outcome = $.outcome
|
|
@@ -96,15 +107,15 @@ module Invoicing
|
|
|
96
107
|
event PaymentGatewayResultReceived
|
|
97
108
|
outcome GatewayOutcome
|
|
98
109
|
reason String
|
|
99
|
-
event PaymentReceived
|
|
100
110
|
|
|
101
|
-
slice Automation
|
|
111
|
+
slice Automation RecordPaymentOutcome
|
|
102
112
|
description "Gives PaymentReceived its producer: the translator reacts to the provider's external fact"
|
|
103
113
|
reaction ReceivedTranslator
|
|
104
114
|
when PaymentGatewayResultReceived
|
|
105
115
|
outcome
|
|
106
116
|
produces PaymentReceived
|
|
107
117
|
where outcome == "captured"
|
|
118
|
+
event PaymentReceived
|
|
108
119
|
|
|
109
120
|
slice StateChange SettleOrVoidInvoice
|
|
110
121
|
description "An invoice ends either settled or voided, never both (SettleOrVoid, enforced at append). NOT enforced in the model today: that the invoice exists and is still open (settling) and that only an open, unpaid invoice may be voided. Stated as `reads OpenInvoice` + `require` (PLAY0271/PLAY0268 at binding; Screenplay#129). Target: Arc [ProtectedDecision] with DecisionRead, or a Chronicle DCB. Requirements to test in the target: settling an unknown invoice is rejected; voiding a paid invoice is rejected; voiding an open invoice succeeds."
|
|
@@ -13,8 +13,10 @@ destination-type information; a reaction can also consume events from a capture
|
|
|
13
13
|
|
|
14
14
|
**Scope.** This document is the runnable demonstration only. It deliberately holds no rule that
|
|
15
15
|
depends on stored state (the invoice must exist, only an open invoice may be voided, a reversal
|
|
16
|
-
needs a received payment, `reads` + `require`):
|
|
17
|
-
|
|
16
|
+
needs a received payment, `reads` + `require`): the legacy design control lacks
|
|
17
|
+
`command reads protected` and retains PLAY0271/PLAY0268. Eligible reads can opt into
|
|
18
|
+
v25; see command-surface protected-read admission and Stage refusal. The rules stay
|
|
19
|
+
in the design-mode document `invoicing-dues-design.md`,
|
|
18
20
|
never in prose here. It shows the category shapes; for a coverage example see `berth-reservations.md`.
|
|
19
21
|
|
|
20
22
|
```screenplay
|
|
@@ -208,27 +210,13 @@ module Invoicing
|
|
|
208
210
|
when added
|
|
209
211
|
outcome = $.outcome
|
|
210
212
|
reason = $.reason
|
|
213
|
+
append PaymentGatewayResultReceived
|
|
214
|
+
when outcome
|
|
215
|
+
outcome = $.outcome
|
|
216
|
+
reason = $.reason
|
|
211
217
|
event PaymentGatewayResultReceived
|
|
212
218
|
outcome GatewayOutcome
|
|
213
219
|
reason String
|
|
214
|
-
event PaymentReceived
|
|
215
|
-
event PaymentDeclined
|
|
216
|
-
reason String
|
|
217
|
-
|
|
218
|
-
slice Automation TranslatePaymentGatewayResults
|
|
219
|
-
description "Our facts from the provider's: the translators react to the external fact the Translate slice records"
|
|
220
|
-
reaction ReceivedTranslator
|
|
221
|
-
when PaymentGatewayResultReceived
|
|
222
|
-
outcome
|
|
223
|
-
produces PaymentReceived
|
|
224
|
-
where outcome == "captured"
|
|
225
|
-
reaction DeclinedTranslator
|
|
226
|
-
when PaymentGatewayResultReceived
|
|
227
|
-
outcome
|
|
228
|
-
reason
|
|
229
|
-
produces PaymentDeclined
|
|
230
|
-
reason = reason
|
|
231
|
-
where outcome == "declined"
|
|
232
220
|
|
|
233
221
|
specification TranslatingADeclinedCardResult
|
|
234
222
|
when capture PaymentGatewayResults
|
|
@@ -243,6 +231,23 @@ module Invoicing
|
|
|
243
231
|
for "9c1f0a52-6a4e-4b1c-9f55-0d2c7b8e1a01"
|
|
244
232
|
reason = "Card declined"
|
|
245
233
|
|
|
234
|
+
slice Automation RecordPaymentOutcome
|
|
235
|
+
reaction ReceivedTranslator
|
|
236
|
+
when PaymentGatewayResultReceived
|
|
237
|
+
outcome
|
|
238
|
+
produces PaymentReceived
|
|
239
|
+
where outcome == "captured"
|
|
240
|
+
reaction DeclinedTranslator
|
|
241
|
+
when PaymentGatewayResultReceived
|
|
242
|
+
outcome
|
|
243
|
+
reason
|
|
244
|
+
produces PaymentDeclined
|
|
245
|
+
reason = reason
|
|
246
|
+
where outcome == "declined"
|
|
247
|
+
event PaymentReceived
|
|
248
|
+
event PaymentDeclined
|
|
249
|
+
reason String
|
|
250
|
+
|
|
246
251
|
slice StateView OpenInvoices
|
|
247
252
|
description "Todo list: membership means 'still to collect'; there is no status flag."
|
|
248
253
|
readmodel OpenInvoice
|
|
@@ -4,9 +4,20 @@ Coverage for public events and routed producers.
|
|
|
4
4
|
|
|
5
5
|
Outbound publication needs `when append <private>` and `then <PublicEvent>`:
|
|
6
6
|
complete state, incomplete state, unchanged repeat, changed instance, separate
|
|
7
|
-
source ids and the exported field boundary. Reference publication
|
|
8
|
-
source-event captures
|
|
9
|
-
Unsupported. Read automations-and-translations `references/public-events-and-direction.md
|
|
7
|
+
source ids and the exported field boundary. Reference publication and admitted
|
|
8
|
+
source-event captures execute; reached opaque event-target reducers remain typed
|
|
9
|
+
Unsupported. Read automations-and-translations `references/public-events-and-direction.md`
|
|
10
|
+
for the prerequisite and complete typed capture specifications.
|
|
11
|
+
|
|
12
|
+
For `source events`, use `given <FromEvent>` / `when append <FromEvent>`, not
|
|
13
|
+
`given capture` / `when capture` (PLAY0701). Cover first added, unchanged overlays,
|
|
14
|
+
updates after ordered givens, properties retained across different event types,
|
|
15
|
+
and independent keys. The key must be required on every source event, not a
|
|
16
|
+
context key (PLAY0700); optional foreign fixture `for` is not that key.
|
|
17
|
+
Assertions list all follow-up facts, never the input append itself. Mixed capture
|
|
18
|
+
and reaction expectations may need `then events in any order`; this is not proof
|
|
19
|
+
of observer order or redelivery deduplication. Children/nested over events and
|
|
20
|
+
context members other than `occurred` are not admitted execution.
|
|
10
21
|
For routed producers/observers, cover override versus inherited route, skipped
|
|
11
22
|
production route failure, matching/wrong source/stream and unrouted facts;
|
|
12
23
|
see toolchain `references/production-routes-and-filters.md`.
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md
CHANGED
|
@@ -15,8 +15,10 @@ easily. Every excerpt below is copied verbatim from the complete document in
|
|
|
15
15
|
`invoicing-dues-example.md`, which compiles with warnings as errors and whose 23 specifications
|
|
16
16
|
pass in the reference evaluator; it also holds the declarations the excerpts depend on. The two
|
|
17
17
|
compensation excerpts in section 4 come from `invoicing-dues-design.md` instead: that document
|
|
18
|
-
holds
|
|
19
|
-
PLAY0268)
|
|
18
|
+
holds stored-state rules as a legacy control without `command reads protected`, so
|
|
19
|
+
it compiles but does not bind (PLAY0271/PLAY0268) and its design specs do not run.
|
|
20
|
+
Eligible reads can instead opt into v25; inspect admission and keep Stage refusal
|
|
21
|
+
separate (command-surface [protected reads](../../cratis-screenplay-command-surface/references/protected-reads.md)). A second
|
|
20
22
|
complete example, with competing claims and denial fixtures, is `berth-reservations.md`. The category structure and the good/bad contrast follow the worked
|
|
21
23
|
examples in `eventmodeling-elaborating-scenarios` by TrogonStack and by Martin Dilger and Nebulit GmbH (`provenance.md`), translated to
|
|
22
24
|
Screenplay specifications.
|
|
@@ -104,7 +106,11 @@ in `invoicing-dues-design.md`; it is never prose and never a spec that pretends
|
|
|
104
106
|
## 3. External failure: the capture, then the retry
|
|
105
107
|
Two separate obligations. First, the **capture specification**: concrete external input in, our
|
|
106
108
|
facts out. The provider's refusal is a fact (never a `then error`), kept in the provider's
|
|
107
|
-
vocabulary
|
|
109
|
+
vocabulary; a separate Automation records the local outcome. The capture uses
|
|
110
|
+
`when added` for first sight and a separate `when outcome` for updates. An update
|
|
111
|
+
spec needs `given capture` with the same key's earlier record; the first record's
|
|
112
|
+
fields are not modifications (root, child or nested). See captures-and-reactions
|
|
113
|
+
`references/record-capture-specifications.md` for runnable first/update/repeat cases.
|
|
108
114
|
```screenplay excerpt parent=references/invoicing-dues-example.md#1
|
|
109
115
|
specification TranslatingADeclinedCardResult
|
|
110
116
|
when capture PaymentGatewayResults
|
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md
CHANGED
|
@@ -21,7 +21,8 @@ Typed example/override forms: `cratis-screenplay-specifications`
|
|
|
21
21
|
| Context `from`, single-result filters, `scoped to`, `performer` or composite `by` | yes | PLAY0268: query context, collection-only filtering, opaque scope/implementation or multipart lookup are unadmitted | no |
|
|
22
22
|
| `then no readmodel <RM> for "<key>"` | yes | yes | no |
|
|
23
23
|
| `when query` -> `then result` / `then no result` | yes | yes | same as `then query`: only the query-only cases below |
|
|
24
|
-
| `given clock` / `when clock`, `when trigger`, `given`/`when capture` | yes | yes (standalone and any cratis whose compiler admits v6; an older bundle does not, see toolchain `references/executable-subset.md`) | no |
|
|
24
|
+
| `given clock` / `when clock`, `when trigger`, record-source `given`/`when capture` | yes | yes (standalone and any cratis whose compiler admits v6; an older bundle does not, see toolchain `references/executable-subset.md`) | no |
|
|
25
|
+
| Event-source capture fixtures | `given <FromEvent>` / `when append <FromEvent>`, not capture records (PLAY0701) | admitted root capture behavior executes; see `public-event-coverage.md` for prerequisites and limits | separate target admission |
|
|
25
26
|
| Command spec listing reaction cascade events | yes (v6 semantics) | false PLAY0285 on an older cratis bundle only; see SKILL.md "Version skew" | no: STAGE-ESM-011; generated CommandScenario does not settle reactions |
|
|
26
27
|
| `generated <name> = <value>` under `when`, `then returns` (ESM v7) | yes | yes on a compiler that admits v7 (PLAY0268 on an older bundle) | yes on Stage for supported UUID/String strategies and v15 freshness and scalar/named responses; unsupported types/combinations remain -028/-038 |
|
|
27
28
|
| v15 generation strategy fixtures and used-source rejection | yes | strict encoding/size/case/version/variant; Contract for invalid pins, Concurrency for reused source | supported strategies/freshness render; invalid pins refuse -011, unpinned unordered/projected assertions -038; source: command-surface `references/generated-values-and-responses.md` |
|
|
@@ -33,9 +34,13 @@ Typed example/override forms: `cratis-screenplay-specifications`
|
|
|
33
34
|
| Refusal branches, `$refusal` | yes | ESM v19; first matching branch wins | Stage supported subset; -039 for unfaithful refusal details/trigger groups, -011 for specification limits |
|
|
34
35
|
| Query `then error` | yes | ESM v18; one query/one error, no result/denial | requires target v18 admission; a v19-capable renderer does not necessarily admit v18 |
|
|
35
36
|
| Composite (JSON) values in specs | yes | yes | no |
|
|
36
|
-
|
|
|
37
|
+
| Same-primitive `Date`/`DateTime` comparisons in `require`, `produces when` and command or property validation rules (v26; Requires Screenplay 4.199.0; see [date comparisons](../../cratis-screenplay-command-surface/references/date-comparisons.md)) | spec them | binds and executes; a `DateTime` input without an offset is a Validation rejection | v26 STAGE-ESM-016: gap-fill |
|
|
38
|
+
| Date rules using `today`, `$context`, mixed `Date`/`DateTime`, concept or reaction-`where` positions; nested paths | spec them in design | rule does not bind: `recorded` | `recorded` |
|
|
37
39
|
| Bodied rules, code policies | spec them | spec reported **unsupported**, never passed | no |
|
|
38
|
-
|
|
|
40
|
+
| Pending described command handlers (v23) | specify intent | binds; denial/validation execute, body-reaching specs Unsupported ImplementationBody; all-Unsupported is not green | STAGE-IMPL-002 even Stub mode |
|
|
41
|
+
| Attached command handlers, `file` constraints, query `performer`s | spec them in design | blocked: PLAY0268 at binding, no spec runs (V3 blocked) | no |
|
|
42
|
+
| Atomic reaction mode (v22) | declare for new models | failed batch adds no facts or view changes; earlier batches/commands remain; `then error` alone is insufficient | v22 STAGE-ESM-016; mode in admitted v23–v25 STAGE-ESM-043 |
|
|
43
|
+
| Protected command reads (v25) | declare opt-in for eligible reads | absence Validation; matching intervening facts Conflict; race vectors are not a new spec construct | protected reads STAGE-ESM-044; v25 pair admitted |
|
|
39
44
|
|
|
40
45
|
Requires Screenplay 4.105.0 or later (`screenplay --version`) for list-query specifications, and 4.143.0 or later for collection equality filters (ESM v14).
|
|
41
46
|
|
|
@@ -49,7 +54,7 @@ older cratis bundle is available). Mark each such spec in the coverage matrix as
|
|
|
49
54
|
`gap: <reason>` for the narrower modes so the verification and render phases know what will not execute.
|
|
50
55
|
|
|
51
56
|
## Executable mode
|
|
52
|
-
- Every gated spec has `given caller`;
|
|
57
|
+
- Every gated spec has `given caller`; local given/expected events have `for`, and so does every plain `produces <Name>` (inline `produces event` omits it and defaults to the identifier). Foreign event fixtures driving captures may omit `for`; a supplied value is opaque source text, not the capture key.
|
|
53
58
|
- Each read model has one key shared by its keyed `=> RM optional` queries; the identifier equals
|
|
54
59
|
the projection's effective key (`cratis-screenplay-slice-design` `references/read-model-design.md`
|
|
55
60
|
decision table). View specs assert through a keyed query.
|
|
@@ -157,7 +157,9 @@ When `.screenplay/identities.json` exists, adding, removing or renaming an addre
|
|
|
157
157
|
Slice design is done when these hold; otherwise report what is open.
|
|
158
158
|
|
|
159
159
|
- [ ] Every command: origin reachable and authorized; every input traced; rules placed by
|
|
160
|
-
layer; stored-state rules
|
|
160
|
+
layer; stored-state rules use admitted protected reads, or name the refused shape
|
|
161
|
+
and target gap; no form-verb name. Read [protected reads](../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
162
|
+
for opt-in and Stage refusal; reference protection is not target realization.
|
|
161
163
|
- [ ] Every command has a refusal inventory (success, each refusal with layer and message,
|
|
162
164
|
denied persona); every gated command and query has a `then denied` row.
|
|
163
165
|
- [ ] Every event is past tense, a specific change, and consumed or justified.
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md
CHANGED
|
@@ -171,13 +171,13 @@ Rules for filling it:
|
|
|
171
171
|
| AssignLocker | caller is not an attendant | `authorize IsAttendant` | denied: Customer | RefusingACustomerAssigningALocker |
|
|
172
172
|
| AssignLocker | locker already has a request | constraint `OneRequestPerLocker` | "The locker is already assigned" | AppendingASecondAssignmentOfALocker (`when append`: the command's own `require` would reject first) |
|
|
173
173
|
| AssignLocker | request already has a locker | constraint `OneLockerPerRequest` | "The request already has a locker" | gap |
|
|
174
|
-
| AssignLocker | locker is not free |
|
|
175
|
-
| AssignLocker | request is not waiting |
|
|
174
|
+
| AssignLocker | locker is not free | Legacy example lacks protected-read opt-in; inspect v25 admission and Stage gap | "The locker is not free"; target: `[ProtectedDecision]` (Arc 22.39.0+; available to Stage 4.73.1 gap-fill, not emitted protection) or DCB on the locker stream | RejectingASecondAssignmentOfALocker (pins the message; blocked until the target exists) |
|
|
175
|
+
| AssignLocker | request is not waiting | Legacy example lacks protected-read opt-in; inspect v25 admission and Stage gap | "The request is not waiting for a locker" | gap (same) |
|
|
176
176
|
| LockerById, ListLockers | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | RefusingAnAnonymousLockerLookup, RefusingAnAnonymousLockerList |
|
|
177
177
|
| RequestById | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | RefusingAnAnonymousRequestLookup |
|
|
178
178
|
|
|
179
|
-
The gaps are the hand-off: most are cheap rejection specs, and two
|
|
180
|
-
|
|
179
|
+
The gaps are the hand-off: most are cheap rejection specs, and two need protected-read admission plus separately verified target realization;
|
|
180
|
+
the legacy example has not opted into v25. A model whose inventory shows no gaps at design time has probably
|
|
181
181
|
not been asked the refusal questions.
|
|
182
182
|
|
|
183
183
|
## Common mistakes
|
|
@@ -11,14 +11,16 @@ code only as XML doc comments (Stage#178): a rule that exists only in prose is u
|
|
|
11
11
|
| who may ask | `authorize` with a policy (role, claim, authenticated) | enclosing gates combine with AND and run first. Gates every command and query in a feature shares go on the feature or module so a new path inherits them |
|
|
12
12
|
| whose instance | policy `claim "x" matches subject` (the command identifier) or `matches <command property>` | executable; renders for text, Uuid, Date and DateTime subjects; an authorized command needs exactly one identifier (STAGE-ESM-015 otherwise) |
|
|
13
13
|
| uniqueness, once-only facts | `constraint` (`unique ... on`, `unique event`) | append-time; the constraint name is its identity |
|
|
14
|
-
| stored state (record exists, balance, current status) | `reads <View>` + `require
|
|
14
|
+
| stored state (record exists, balance, current status) | `reads <View>` + `require` with an indented message | opt eligible reads into `command reads protected` (v25); absence Validation, matching intervening facts Conflict. Legacy/refused shapes stay stated intent with a named target mechanism |
|
|
15
15
|
|
|
16
16
|
An unguarded materialized read is unsafe for a protected decision; a guarded read is the
|
|
17
17
|
supported route. Availability: `[ProtectedDecision]` and `DecisionRead<T>` exist in
|
|
18
18
|
the Arc/Chronicle package set Stage scaffolds (see the Stage skill's `references/rendered-application.md`), but Stage does not emit
|
|
19
19
|
protected decisions. Gap-fill must use an admitted projection/key shape and active
|
|
20
20
|
unit-of-work enrollment; do not edit managed dependencies. Keep the `.play` rule
|
|
21
|
-
|
|
21
|
+
target enforcement separate from reference semantics until target tests verify it.
|
|
22
|
+
Read [protected command reads](../../cratis-screenplay-command-surface/references/protected-reads.md)
|
|
23
|
+
for admission and Stage's protected-read refusal (STAGE-ESM-044); never remove protection to obtain rendering. Forbidden: caller-supplied copies of state in `require`, boolean attestation
|
|
22
24
|
inputs (`confirmsX == true`), rules in `handler` / implementation-hint prose.
|
|
23
25
|
|
|
24
26
|
## Authorization is executable
|