@cratis/pi 7.11.3 → 7.11.5
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/agents/planner.md +1 -1
- package/package/corpus/agents/slice-implementer.md +3 -3
- package/package/corpus/agents/spec-writer.md +10 -8
- package/package/corpus/prompts/add-reactor.prompt.md +1 -1
- package/package/corpus/prompts/new-vertical-slice.prompt.md +1 -1
- package/package/corpus/prompts/write-specs.prompt.md +2 -2
- package/package/corpus/rules/application-profile.md +1 -1
- package/package/corpus/rules/framework.md +1 -1
- package/package/corpus/rules/local-work-artifacts.md +13 -0
- package/package/corpus/rules/reactors.md +2 -2
- package/package/corpus/rules/specs.csharp.md +1 -1
- package/package/corpus/rules/specs.scenarios.csharp.md +34 -14
- package/package/corpus/rules/vertical-slices.md +1 -1
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +4 -2
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +24 -15
- package/package/corpus/skills/cratis-arc-command-operation/references/testing.md +4 -2
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +10 -2
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +4 -2
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +5 -2
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +8 -3
- package/package/corpus/skills/cratis-chronicle-event-specifications/SKILL.md +5 -3
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +8 -5
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +12 -6
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +5 -2
- package/package/corpus/skills/cratis-code-review/SKILL.md +7 -2
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +1 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +49 -7
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +8 -2
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +11 -7
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +11 -6
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +7 -5
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +19 -12
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +3 -3
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +12 -4
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +1 -1
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -2
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +3 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +3 -2
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +8 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +1 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +1 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +47 -4
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +7 -3
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +2 -2
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +3 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +13 -12
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +3 -3
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +41 -4
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +59 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +1 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +6 -6
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +3 -3
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +2 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +17 -15
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +4 -3
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +3 -3
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +13 -7
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +7 -4
- package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +14 -7
- package/package/corpus/skills/cratis-specifications-csharp/references/csharp-patterns.md +3 -2
- package/package/corpus/skills/cratis-specifications-typescript/references/typescript-patterns.md +3 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ Every other Screenplay skill and reference points here instead of repeating a ve
|
|
|
4
4
|
or a tool capability. When a tool changes, update this file first, then re-run the
|
|
5
5
|
example compile gate with both tools (see `verdicts.md`, "Example gate").
|
|
6
6
|
|
|
7
|
-
Pinned and re-verified against product source on 2026-10-
|
|
7
|
+
Pinned and re-verified against product source on 2026-10-07 (standalone Screenplay 4.68.0); the cratis CLI rows were
|
|
8
8
|
re-probed on cratis 3.28.2 and 3.28.3 (Screenplay 4.66.0 bundled in both). Facts marked
|
|
9
9
|
*source* were read with `git show <tag>:<path>`; facts marked *probed* were run against the
|
|
10
10
|
installed tool.
|
|
@@ -13,9 +13,9 @@ installed tool.
|
|
|
13
13
|
|
|
14
14
|
| Source | Pin | Notes |
|
|
15
15
|
| --- | --- | --- |
|
|
16
|
-
| Screenplay (language, compiler, standalone tool, MCP server) | **v4.
|
|
17
|
-
| cratis CLI | **v3.28.3** (`8b43fef`, Cratis/cli#260) | Bundles **Screenplay 4.66.0** (ESM v1 to v6), **Stage 4.24.2**, `Cratis.Arc.Screenplay` 22.50.5, Chronicle 19.32.0, Fundamentals 7.22.8, Generation 0.18.0 (`Directory.Packages.props` at the tag): otherwise as v3.28.2, so Screenplay behaviour is identical. `cratis render` no longer emits `CLI-RENDER-003`; an evolved event is reported with Stage's `STAGE-ESM-026` (`ScreenplayPlanning.cs` at the tag; probed). v3.28.2 (`141c499`, Cratis/cli#257, closes #253) bundled Stage 4.24.1 and the same Screenplay.
|
|
18
|
-
| Stage | **v4.24.2** (`32dcac4`, Cratis/Stage#205, closes #165) | Admits ESM v4: initial-revision events render as before, any evolved event and its dependent scope is refused with `STAGE-ESM-026`, historical typed-context references with `STAGE-ESM-025`; migration rendering is Stage#204 (needs Screenplay#71); v5 and
|
|
16
|
+
| Screenplay (language, compiler, standalone tool, MCP server) | **v4.68.0** (`79801bf`), published as `Cratis.Screenplay.Tool` 4.68.0 | 4.67.0 changed only the MCP model-root defaults (no project: `Documents/Screenplay`; with a project root: the folder holding the `.play` files, else `Source` or `src`, else `Screenplay`). 4.68.0 admits **ESM v7**: generated command values and responses bind and execute (decision 0026, `Semantics/Versions.cs`; `generated-responses-example.md`); the existing compiled examples were recompiled on 4.68.0 with the same results as on 4.66.0. Most other behaviour below was probed on 4.63.1 (`7769dc4`) and re-checked on 4.66.0. 4.63.1 to 4.64.0 added only the `numbers exact` syntax (binding refuses it), the MCP roots fix from 4.63.2 and fence-registry plumbing. 4.65.0 adds the command named-rule `implementation` block and rejects `implementation` on concept rules, built-in property rules and whole-command `require`/`validate` bodies (a hints-only block binds as PLAY0268). 4.66.0 adds only an experimental VS Code repair bridge. `Semantics/Execution` was unchanged from 4.63.1 through 4.66.0 (historical; 4.68.0 adds generated-value execution). Example compile and the toolchain commands in this skill were run on 4.66.0 |
|
|
17
|
+
| cratis CLI | **v3.28.3** (`8b43fef`, Cratis/cli#260) | Bundles **Screenplay 4.66.0** (ESM v1 to v6; it does not bind ESM v7, so `generated` and `returns` report `PLAY0268` there), **Stage 4.24.2**, `Cratis.Arc.Screenplay` 22.50.5, Chronicle 19.32.0, Fundamentals 7.22.8, Generation 0.18.0 (`Directory.Packages.props` at the tag): otherwise as v3.28.2, so Screenplay behaviour is identical. `cratis render` no longer emits `CLI-RENDER-003`; an evolved event is reported with Stage's `STAGE-ESM-026` (`ScreenplayPlanning.cs` at the tag; probed). v3.28.2 (`141c499`, Cratis/cli#257, closes #253) bundled Stage 4.24.1 and the same Screenplay. The bundled 4.66.0 compiler agrees with standalone 4.66.0 on binding and diagnostics for ESM v1 to v6 but not with standalone 4.68.0 (ESM v7); the two also differ on file-mode imports. v3.28.1 and earlier (including v3.28.0 and the probed v3.27.1) bundled Screenplay 4.60.1 and Stage 4.24.0 (ESM v1 to v5, MCP roots bug, false PLAY0285, Automation/Translate refused at binding) |
|
|
18
|
+
| Stage | **v4.24.2** (`32dcac4`, Cratis/Stage#205, closes #165) | Admits ESM v4: initial-revision events render as before, any evolved event and its dependent scope is refused with `STAGE-ESM-026`, historical typed-context references with `STAGE-ESM-025`; migration rendering is Stage#204 (needs Screenplay#71); v5 and later, including v7 (generated values and responses; tracked in Stage#201), stay `STAGE-ESM-016`; the Host runtime still refuses evolved events. The cratis CLI bundles it since 3.28.3; 3.28.2 bundled 4.24.1 (v4.24.1, `2cadf59`: below). Pins Screenplay 4.66.0, Arc 22.50.5 and Chronicle 19.32.0 for its own build and the sandbox host image (`cratis/chronicle:19.32.0-development`); admits ESM schema v1 to v3 at 4.24.1 (v4.24.0, `fa48546`, pinned Screenplay 4.60.0); bundled by cratis 3.28.2. 4.24.1 adds `STAGE-ESM-024` to the surface ledger only; no admission change. The scaffold profile is unchanged at 4.24.1: rendered apps use .NET 10, **Arc 22.25.0**, **Chronicle 19.8.1** and a React/Vite frontend scaffold (Components 4.14.0, Scene 4.2.0) |
|
|
19
19
|
| Arc | **v22.50.5** (`eefd098`) | `[ExecuteCommandsAsSystem]` since v20.56.0; `[ProtectedDecision]` and `DecisionRead<T>` since v22.39.0. A Stage-rendered application is on 22.25.0, so `[ProtectedDecision]` is **not** available there |
|
|
20
20
|
| Chronicle | **v19.32.0** (`f17a2ff`) | CHR0012 (`EventTypeShouldAvoidNullableProperties`) and CHR0034 (`PiiOnEventSourceId`) exist. Open runtime defects at v19.32.0: #3744 (unique claims not settled by the store on SQL and InMemory), #4123 (constraint index updates run after commit and fail silently), #4131 (composite unique constraints collide when a component contains the separator) |
|
|
21
21
|
|
|
@@ -29,15 +29,15 @@ global `dotnet` tool) shadows a newer one; confirm with `which -a cratis`.
|
|
|
29
29
|
|
|
30
30
|
| | Standalone `screenplay` | `cratis screenplay ...` |
|
|
31
31
|
| --- | --- | --- |
|
|
32
|
-
| Version | 4.
|
|
33
|
-
| ESM admitted by the binder | v1 to
|
|
32
|
+
| Version | 4.68.0 (this pin) | 3.28.3 or 3.28.2, bundling Screenplay 4.66.0 (3.28.1 and earlier bundled 4.60.1) |
|
|
33
|
+
| ESM admitted by the binder | v1 to v7 (v6: clocks, application triggers, captures, reactions, Automation and Translate slices; v7: generated command values and responses) | v1 to v6 (3.28.3 bundles 4.66.0, so `generated` and `returns` fail binding with `PLAY0268`), the binder of 4.66.0 (probed on 3.28.2: the Automation, Translate and capture examples of this corpus are `executableReady` over `cratis screenplay mcp`) |
|
|
34
34
|
| `numbers exact` | syntax parses; binding refuses (PLAY0268, `executableReady: false`). Absent from the grammar page; documented only in `diagnostics.md` (PLAY0508 to PLAY0513) | same (probed on 3.28.2; 3.27.1 reported PLAY0001 "Unexpected 'numbers'") |
|
|
35
35
|
| Cascade specs (a command spec listing events a reaction appends) | compiles | compiles on 3.28.2 (probed); before 3.28.2 reported a **false PLAY0285** (cli#242, still open on GitHub at the time of writing) |
|
|
36
36
|
| Imports in file mode | follows imports | still ignores imports, reports false unknown-name warnings (PLAY0165, cli#244, open; probed on 3.28.2): validate the folder |
|
|
37
|
-
| Used for | V1, V2, V3; MCP | `render`, `screenplay generate`, `prologue`, `run`; V1, V2 and V3 as well,
|
|
37
|
+
| Used for | V1, V2, V3; MCP | `render`, `screenplay generate`, `prologue`, `run`; V1, V2 and V3 as well, with its bundled 4.66.0 compiler (cratis 3.28.3), which lacks ESM v7 that standalone 4.68.0 admits |
|
|
38
38
|
|
|
39
|
-
**Routing rule.** With cratis 3.28.2 or later both tools compile and bind
|
|
40
|
-
4.66.0, so either gives V1 to V3. Prefer the standalone tool when it is installed (file mode
|
|
39
|
+
**Routing rule.** With cratis 3.28.2 or later both tools compile and bind the same
|
|
40
|
+
models up to ESM v6 (the cratis bundle is Screenplay 4.66.0, the standalone pin 4.68.0), so either gives V1 to V3 for models up to v6; a model with generated values or responses (ESM v7) binds only with the standalone tool. Prefer the standalone tool when it is installed (file mode
|
|
41
41
|
follows imports); `cratis` is the route for rendering (V5), generation and Prologue. Projects
|
|
42
42
|
set up by `cratis ai install` register `cratis screenplay mcp`, which runs the bundled
|
|
43
43
|
compiler: on cratis 3.28.1 or earlier (all releases before 3.28.2) that is 4.60.1 and lags (ESM v5, false PLAY0285,
|
|
@@ -51,11 +51,12 @@ Only binding (MCP or `render`) prints these; neither `screenplay <folder>` nor
|
|
|
51
51
|
`SemanticModelBinder.Structure.cs`, `SemanticModelBinder.SliceMembers.cs`,
|
|
52
52
|
`SemanticModelBinder.Specifications.cs`.
|
|
53
53
|
|
|
54
|
-
| Construct | cratis before 3.28.2 (Screenplay 4.60.1) reported (PLAY0268) | 4.66.0, standalone and cratis 3.28.2 |
|
|
54
|
+
| Construct | cratis before 3.28.2 (Screenplay 4.60.1) reported (PLAY0268) | 4.66.0 to 4.68.0, standalone and cratis 3.28.2 |
|
|
55
55
|
| --- | --- | --- |
|
|
56
56
|
| Automation or Translate slice | `Slice '<name>' of type '<type>' is not admitted by ESM v1.` | binds as ESM v6 |
|
|
57
57
|
| Reaction | `Reaction '<n>' requires portable occurrence and effect semantics.` | binds |
|
|
58
58
|
| Capture | `Capture '<n>' requires a portable compiled CDL plan.` | binds |
|
|
59
|
+
| Generated property, `returns` response, generated fixture or `then returns` | `PLAY0268` | `PLAY0268` on 4.66.0 and 4.67.0 (so on every cratis 3.28.x bundle); binds as ESM v7 from 4.68.0 (standalone only) |
|
|
59
60
|
| Clock, trigger or capture specification | `... which the executable model does not admit yet - clocks, application triggers and capture records are proposed for ESM v6 in decision 0022.` | binds |
|
|
60
61
|
|
|
61
62
|
The substring "is not admitted by ESM v1" still appears on 4.66.0 for constraints,
|
|
@@ -64,7 +65,7 @@ not prove an older compiler: read the construct it names. A v6 model that still
|
|
|
64
65
|
on 4.66.0 names a different construct, for example a reaction that reads a view before
|
|
65
66
|
producing directly (decision 0006).
|
|
66
67
|
|
|
67
|
-
## Standalone `screenplay` 4.
|
|
68
|
+
## Standalone `screenplay` 4.68.0
|
|
68
69
|
|
|
69
70
|
| Fact | Value | Evidence |
|
|
70
71
|
| --- | --- | --- |
|
|
@@ -90,9 +91,10 @@ producing directly (decision 0006).
|
|
|
90
91
|
|
|
91
92
|
## Event sources and streams
|
|
92
93
|
|
|
93
|
-
Declared since Screenplay v4.62.0 but not bound: PLAY0268,
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
Declared since Screenplay v4.62.0 but not bound: PLAY0268, "not admitted by any supported
|
|
95
|
+
executable model (ESM) version yet" (Screenplay 4.68.0, `SemanticModelBinder.CommandProductions.cs`; the
|
|
96
|
+
highest admitted version is v7). Stage 4.24.0 and 4.24.1 admit ESM v1 to v3 and refuse with
|
|
97
|
+
STAGE-ESM-016; Stage 4.24.2 admits v4 and refuses v5 and later (v6 reactions and clocks, v7 generated values and responses) with STAGE-ESM-016 (4.24.1 also records the v6 members as rejected `STAGE-ESM-024` in its ledger; users still see STAGE-ESM-016). Details and trackers: `sources-and-streams.md`.
|
|
96
98
|
|
|
97
99
|
## MCP roots bug (4.63.1 and earlier; fixed in 4.63.2; not present in cratis 3.28.2)
|
|
98
100
|
|
|
@@ -136,7 +138,7 @@ meaning), #379 (`visualize-model` counts reactions); Stage#79 (render Automation
|
|
|
136
138
|
Translate slices), Stage#165 (admit ESM v4), Stage#197 (`@pii` identifier renders as
|
|
137
139
|
`[PII]` event source id); cli#242 (false PLAY0285 on the 4.60.1 bundle; fixed in effect by the 4.66.0 bundle but still open on GitHub), cli#243 (`validate --executable`),
|
|
138
140
|
cli#244 (file mode ignores imports), cli#245 (`render --check`). The standalone tool at
|
|
139
|
-
4.
|
|
141
|
+
4.68.0 has only the compile command and `mcp` (no `test`; `screenplay --help` checked); the reference runner is library
|
|
140
142
|
only. Until these land, "specifications written" or "bound" is never "specifications
|
|
141
143
|
pass".
|
|
142
144
|
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
{ "kind": "skill-contains", "value": "references/versions.md" },
|
|
7
7
|
{ "kind": "skill-contains", "value": "PLAY0029" },
|
|
8
8
|
{ "kind": "skill-contains", "value": "--warnaserror" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "4.68.0" },
|
|
9
10
|
{ "kind": "skill-contains", "value": "4.66.0" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "references/generated-responses-example.md" },
|
|
12
|
+
{ "kind": "skill-contains", "value": "not admitted by any supported ESM version" },
|
|
13
|
+
{ "kind": "skill-contains", "value": "generated values and responses (ESM v7: Stage refuses it with `STAGE-ESM-016`, tracked in Stage#201)" },
|
|
10
14
|
{ "kind": "skill-contains", "value": "cratis screenplay validate" },
|
|
11
15
|
{ "kind": "skill-contains", "value": "cli#244" },
|
|
12
16
|
{ "kind": "skill-contains", "value": "`notifications/initialized`" },
|
|
@@ -269,9 +269,10 @@ module Invoicing
|
|
|
269
269
|
```
|
|
270
270
|
|
|
271
271
|
The inline event targets `invoiceId` without copying it into payload; the
|
|
272
|
-
projection obtains it from event context.
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
projection obtains it from event context. A command `returns` clause (scalar or
|
|
273
|
+
record) binds and executes from standalone Screenplay 4.68.0 (ESM v7, `commands.md`,
|
|
274
|
+
"Generated values and responses"); the 4.66.0 bundled in `cratis` 3.28.x reports `PLAY0268`, and
|
|
275
|
+
Stage 4.24.2 does not render ESM v7 (`STAGE-ESM-016`, tracked in Stage#201). Form `on submit` and
|
|
275
276
|
interaction `on success` response-name scopes, failure clearing and response
|
|
276
277
|
execution remain unavailable.
|
|
277
278
|
An existing success continuation does not imply a response contract.
|
|
@@ -58,8 +58,8 @@ payload field the event never declares, so the event payload line matters.
|
|
|
58
58
|
- `identifier` marks which property names the event source. It neither generates the value nor
|
|
59
59
|
fills it. Here the user supplies the berth. Other sources are a prefill (`populate via query`
|
|
60
60
|
or `populate from item` when the user chose a berth on the previous screen) or a modeled
|
|
61
|
-
selection. `generated identifier` is
|
|
62
|
-
|
|
61
|
+
selection. `generated identifier` is ESM v7: it binds on standalone Screenplay 4.68.0 and reports `PLAY0268`
|
|
62
|
+
on the 4.66.0 bundled in `cratis` 3.28.x; Stage 4.24.2 does not render it.
|
|
63
63
|
- The form is found through `action BookBerth`; neither screen names it.
|
|
64
|
-
- Compiled with `screenplay` 4.
|
|
64
|
+
- Compiled with `screenplay` 4.68.0 `--warnaserror` and `cratis screenplay validate
|
|
65
65
|
--warnings-as-errors` 3.28.2.
|
|
@@ -169,16 +169,21 @@ getter, not a behavior. Delete it rather than maintaining it.
|
|
|
169
169
|
|
|
170
170
|
A specification is only as good as the signal it reads.
|
|
171
171
|
|
|
172
|
-
- **Assert on the outcome
|
|
172
|
+
- **Assert on the outcome by default.** A presentation string is copy;
|
|
173
173
|
it changes for reasons that have nothing to do with the behavior. Assert on
|
|
174
174
|
the identity of what failed — an error code, a constraint name, a typed
|
|
175
|
-
result —
|
|
176
|
-
|
|
175
|
+
result — rather than the sentence shown to a user, unless exact wording is
|
|
176
|
+
the specified behavior.
|
|
177
|
+
- **In code (C#, TypeScript):** do not assert message strings by default;
|
|
178
|
+
assert exact text only when that wording is the specified behavior, and
|
|
179
|
+
name that behavior in the fact.
|
|
177
180
|
- **In a `.play` model:** a rejection specification pins the message, or
|
|
178
181
|
its localization key, with `then error "<message>"` or
|
|
179
182
|
`then error "$strings.<key>"`, because the model has no reason codes. Bare
|
|
180
|
-
`then error` leaves the reason to the specification's name. The
|
|
181
|
-
|
|
183
|
+
`then error` leaves the reason to the specification's name. The code
|
|
184
|
+
specification pins the kind by default; assert the model's exact message
|
|
185
|
+
too only when its wording is
|
|
186
|
+
the specified behavior, and name that behavior in the fact.
|
|
182
187
|
|
|
183
188
|
```screenplay
|
|
184
189
|
concept InvoiceId : Uuid
|
|
@@ -225,7 +230,8 @@ edge someone chose is a different thing from one nobody saw.
|
|
|
225
230
|
- One specification per file; one outcome per specification.
|
|
226
231
|
- No action and no assertion sits on a `given/` context.
|
|
227
232
|
- Nothing trivial, delegated, or compiler-verified is specified.
|
|
228
|
-
-
|
|
229
|
-
|
|
233
|
+
- Code assertions do not pin presentation messages by default. Exact wording
|
|
234
|
+
is asserted only when it is the specified behavior, named in the fact; a
|
|
235
|
+
`.play` rejection pins its message or key deliberately.
|
|
230
236
|
- No sleep, bare delay, or poll loop stands in for a completion signal.
|
|
231
237
|
- The suite runs green, and the report names what was not covered.
|
|
@@ -50,6 +50,7 @@ another version. Never translate an assertion or helper name from memory.
|
|
|
50
50
|
|
|
51
51
|
| Situation | Surface |
|
|
52
52
|
| --- | --- |
|
|
53
|
+
| Pure `Handle()` / `Handle(providedValue)`, reducer logic or reactor decision (default) | Plain method call with `Specification` |
|
|
53
54
|
| Isolated class, collaborators can be substituted | `Specification` + NSubstitute |
|
|
54
55
|
| Arc command pipeline (validators, `Provide()`, `Handle()`, appended events) | `CommandScenario<TCommand>` |
|
|
55
56
|
| Chronicle append semantics, constraints, concurrency | `EventScenario` |
|
|
@@ -59,8 +60,9 @@ another version. Never translate an assertion or helper name from memory.
|
|
|
59
60
|
| Setup shared by many specifications | Reusable context under `given/` |
|
|
60
61
|
|
|
61
62
|
The plain `Specification` base is the universal foundation and the dominant mode
|
|
62
|
-
in library and framework code.
|
|
63
|
-
|
|
63
|
+
in library and framework code. In applications, start pure decisions with a
|
|
64
|
+
plain call and add the scenario helpers where the pipeline, validation,
|
|
65
|
+
constraints or declarative projections contribute proof; read
|
|
64
66
|
[application-scenarios.md](references/application-scenarios.md) before using
|
|
65
67
|
one. Out-of-process integration specifications are an advanced case reserved for
|
|
66
68
|
boundaries the scenario helpers cannot reach — see
|
|
@@ -234,8 +236,9 @@ between collaborators. That is where defects hide.
|
|
|
234
236
|
- Field access modifiers and `_camelCase` naming match the surface.
|
|
235
237
|
- No `Thread.Sleep`, bare `Task.Delay`, or poll loop stands in for a signal; any
|
|
236
238
|
remaining delay carries a comment naming which allowed case it is.
|
|
237
|
-
- Assertions use the `ShouldXxx` extension methods
|
|
238
|
-
|
|
239
|
+
- Assertions use the `ShouldXxx` extension methods. Do not assert on presentation
|
|
240
|
+
message strings by default; assert exact text only when it is the specified
|
|
241
|
+
behavior, and name that requirement in the fact.
|
|
239
242
|
- Nothing trivial or compiler-verified is specified.
|
|
240
243
|
- The file carries the repository license header.
|
|
241
244
|
- The specification project builds and its specifications pass against the
|
package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# In-process scenario specifications
|
|
2
2
|
|
|
3
3
|
The four scenario helpers exercise the real Arc and Chronicle pipelines
|
|
4
|
-
in-process.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
in-process. Use them for event-sourced *application* behavior where the pipeline,
|
|
5
|
+
validation, constraints or projections matter; a pure decision (`Handle()`,
|
|
6
|
+
`Handle(providedValue)`, reducer or reactor logic) is specified first as a plain
|
|
7
|
+
call. A library or framework repository reaches for a scenario only to test the
|
|
8
|
+
very engine it provides.
|
|
7
9
|
|
|
8
10
|
Verified against `Cratis.Arc.Testing` `22.16.0` and `Cratis.Chronicle.Testing`
|
|
9
11
|
`18.3.0`.
|
|
@@ -15,8 +17,10 @@ Verified against `Cratis.Arc.Testing` `22.16.0` and `Cratis.Chronicle.Testing`
|
|
|
15
17
|
| `ReadModelScenario<TReadModel>` | Projection or reducer state from a sequence of events | State View behavior |
|
|
16
18
|
| `ReactorScenario<TReactor>` | Reactor invocation and its side effects | Automation and Translation behavior |
|
|
17
19
|
|
|
18
|
-
Wrap
|
|
19
|
-
code
|
|
20
|
+
Wrap scenario specification files in `#if DEBUG … #endif` only when they compile
|
|
21
|
+
into the application assembly, so specification code ships only in Debug.
|
|
22
|
+
Dedicated spec projects need no wrapper. The example below uses the application
|
|
23
|
+
assembly convention.
|
|
20
24
|
|
|
21
25
|
## `CommandScenario<TCommand>`
|
|
22
26
|
|
|
@@ -88,7 +92,9 @@ different: an unauthorized result carries **no** validation errors, so assert
|
|
|
88
92
|
existing command therefore breaks both its happy-path and its validation-failure
|
|
89
93
|
specifications — switch those assertions rather than patching around them.
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
Do not assert on message strings by default — they are presentation text.
|
|
96
|
+
Assert exact text only when that wording is the specified behavior, and name
|
|
97
|
+
that behavior in the fact.
|
|
92
98
|
|
|
93
99
|
> **Validator state can be order-sensitive.** The command-scenario pipeline can
|
|
94
100
|
> cache enough state that injected-validator branches depend on execution order
|
|
@@ -121,7 +127,8 @@ async Task Because() =>
|
|
|
121
127
|
and `ShouldNotHaveConstraintViolations()`,
|
|
122
128
|
`ShouldHaveConstraintViolationFor(name)`,
|
|
123
129
|
`ShouldHaveConcurrencyViolations()` and its negation, `ShouldHaveErrors()` and
|
|
124
|
-
its negation. Assert the constraint **name
|
|
130
|
+
its negation. Assert the constraint **name** by default. Assert exact message
|
|
131
|
+
text only when that wording is the specified behavior, and name it in the fact.
|
|
125
132
|
|
|
126
133
|
⚠️ `EventScenario` wires a strategy that always answers `ConcurrencyScope.None`,
|
|
127
134
|
which the validator skips, so an append that lets the strategy choose the scope
|
|
@@ -94,8 +94,9 @@ From `Cratis.Specifications`:
|
|
|
94
94
|
| `.ShouldBeOfExactType<T>()` | `_event.ShouldBeOfExactType<<EventType>>()` |
|
|
95
95
|
| `.ShouldBeGreaterThan(n)` / `.ShouldBeLessThan(n)` | `_count.ShouldBeGreaterThan(0)` |
|
|
96
96
|
|
|
97
|
-
Assert on values and types.
|
|
98
|
-
|
|
97
|
+
Assert on values and types. Do not assert on presentation message strings by
|
|
98
|
+
default; assert exact text only when that wording is the specified behavior,
|
|
99
|
+
and name that behavior in the fact.
|
|
99
100
|
|
|
100
101
|
## Catching exceptions
|
|
101
102
|
|
package/package/corpus/skills/cratis-specifications-typescript/references/typescript-patterns.md
CHANGED
|
@@ -46,7 +46,9 @@ value.should.be.instanceOf(<Type>);
|
|
|
46
46
|
(() => <throwingCall>()).should.throw(<ErrorType>);
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Assert on values and types
|
|
49
|
+
Assert on values and types. Do not assert on presentation message strings by
|
|
50
|
+
default; assert exact text only when that wording is the specified behavior,
|
|
51
|
+
and name that behavior in the fact.
|
|
50
52
|
|
|
51
53
|
## Sinon stubbing
|
|
52
54
|
|
|
@@ -40,7 +40,7 @@ model owner's decision.
|
|
|
40
40
|
| `STAGE-ESM-013` | An event-context value other than `$context.occurred` mapped in `produces` | Map a command property when that preserves the meaning; otherwise gap-fill |
|
|
41
41
|
| `STAGE-ESM-014` | A constraint Chronicle cannot reproduce (kind, scope, message; multi-claim in one command; optional or composite targets) | A different constraint is a requirement change for the model owner; otherwise gap-fill |
|
|
42
42
|
| `STAGE-ESM-015` | Authorization Stage cannot render exactly: opaque (code) policy, role-claim URI, expression not requiring authentication, claim compared with a non-text value, authorized command without exactly one identifier | `require authenticated and ...`; text-backed claim targets |
|
|
43
|
-
| `STAGE-ESM-016` | Model language or semantic version is not ESM v1 to v4 (Stage 4.24.2; 4.24.1 and earlier: v1 to v3, so a v4 model was refused here); v5 and
|
|
43
|
+
| `STAGE-ESM-016` | Model language or semantic version is not ESM v1 to v4 (Stage 4.24.2; 4.24.1 and earlier: v1 to v3, so a v4 model was refused here); v5 and later constructs raise the version (v6 reactions and clocks; v7 generated values and responses, tracked in Stage#201) | Not fixable by editing: the model needs a newer renderer. Keep the model, record the gap, gap-fill |
|
|
44
44
|
| `STAGE-ESM-017` | Read model or projection cannot render (property names that collide with Chronicle paths or expression syntax, mappings that overwrite the key or child identity, composite keys, `all`, the refused scope shapes below) | Reshape the projection without changing what it records, or record the gap |
|
|
45
45
|
| `STAGE-ESM-018` | `$strings.` key missing in the default locale or containing formatting characters | Fix the strings |
|
|
46
46
|
| `STAGE-ESM-019` | Reducer structure or body not admitted (outside a `StateView`, impure, does not compile) | An equivalent pure body, or gap-fill |
|