@cratis/pi 7.47.1 → 7.48.2

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.
Files changed (30) hide show
  1. package/package/corpus/harnesses/copilot/instructions/application-profile.instructions.md +1 -1
  2. package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +6 -2
  3. package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +1 -1
  4. package/package/corpus/hooks/README.md +11 -5
  5. package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +44 -4
  6. package/package/corpus/prompts/ship-changes.prompt.md +4 -1
  7. package/package/corpus/rules/application-profile.md +1 -1
  8. package/package/corpus/rules/local-work-artifacts.md +6 -2
  9. package/package/corpus/rules/vertical-slices.md +1 -1
  10. package/package/corpus/skills/cratis-arc-command/SKILL.md +7 -6
  11. package/package/corpus/skills/cratis-arc-command/references/decisions-and-routing.md +41 -11
  12. package/package/corpus/skills/cratis-arc-command/references/read-model-injection.md +2 -1
  13. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +18 -4
  14. package/package/corpus/skills/cratis-chronicle-decision-reads/SKILL.md +41 -6
  15. package/package/corpus/skills/cratis-chronicle-decision-reads/references/choosing-how-a-rule-holds.md +213 -0
  16. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +17 -4
  17. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +3 -1
  18. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +12 -3
  19. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +6 -2
  20. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +2 -1
  21. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +110 -167
  22. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +74 -170
  23. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +15 -35
  24. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +4 -6
  25. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +23 -27
  26. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +21 -33
  27. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +61 -92
  28. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/scene-runtime.md +4 -12
  29. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +10 -14
  30. package/package.json +1 -1
@@ -1,57 +1,27 @@
1
- # Stage admission: codes, specification rules and observed refusals
1
+ # Stage admission: codes, specification rules and refusals
2
2
 
3
3
  ## Contents
4
4
 
5
- - Event-reaction boundary at Stage 4.89.1
5
+ - How a refusal arrives
6
+ - Event-reaction boundary
6
7
  - Diagnostic codes
7
8
  - Projections
8
9
  - Pure reducer bodies
9
10
  - Specification rules (`STAGE-ESM-011`)
10
- - Observed refusals
11
- - Source disagreements (trust the code)
12
- - Historical Stage 4.24 admission
11
+ - Refusals seen while drafting a model
13
12
 
14
- Current pins: `cratis-screenplay-toolchain/references/versions.md`. The current statements here
15
- were read at Stage `v4.89.1` (`Documentation/reference/generated-values-rendering.md:62-146`,
16
- `reaction-rendering.md:57-98`, `Source/Rendering.Cratis/Semantics/SemanticVersionFeatures.cs:105`,
17
- `SemanticVersionFeatureAdmission.cs:25-46`, `SemanticCratisAdmission*.cs`) and cli
18
- `v3.57.0` (`Directory.Packages.props:8-10`,
19
- `Source/Cli/Commands/Render/RenderedSemanticVersions.cs:33-47`); the rows and
20
- sections marked *historical* or naming Stage 4.24 or cratis 3.27/3.28 are earlier probes kept as
21
- history. Stage 4.89.1 and CLI 3.57.0 admit ESM v1 to v15 to construct planning.
22
- The bundled Screenplay 4.147.1 binds v14 collection filters and v15 generation;
23
- supported filters, strategy factories, freshness scopes and scalar/named responses render.
24
- Binding with the bundled compiler remains a separate prerequisite.
25
- The pinned Stage's `SemanticVersionFeatures`/`SemanticVersionFeatureAdmission` refuse
26
- public publication (STAGE-ESM-032), foreign events/events-source captures (033),
27
- production overrides (036). Reaction identity renders for role/authenticated gates;
28
- claim-reading/opaque gates retain 034. Reaction and reducer filters render on the semantic path;
29
- legacy paths retain 034/035. Non-text secrets refuse 041. ESM v8 routed read-model/query companion replay now renders, seeding source/stream
30
- metadata through `ReadModelScenario`; reserved names and unformattable routed fixtures
31
- remain STAGE-ESM-030. Source: Stage
32
- `v4.89.1:Documentation/reference/event-source-routing.md:62-72`. Case tables and whole numbers as long apply to
33
- the default; see `case-tables-and-whole-numbers.md`. Previous CLI 3.46.1's Stage
34
- 4.52.0 audited only through v7 and applied neither new rule. Current version
35
- checks are CLI `RenderedSemanticVersions.Newest` and Stage
36
- `SemanticVersionFeatures.Supports`. The historical CLI 3.41.0/Screenplay 4.114.0
37
- parser rejected `runs as` with PLAY0137; that is not a current parser refusal.
38
- The historical CLI 3.41.0 v7 canonical-corpus planning spec received
39
- STAGE-ESM-028/029 for generated values/responses.
40
- The detailed 4.24.x source/probe rows below are historical unless a row says 4.89.1; run
41
- admission on the actual bundled renderer.
13
+ Stage admits ESM v1 to v15 to construct planning; a newer model reports `CLI-RENDER-004`
14
+ (direct Stage: `STAGE-ESM-016`). Binding with the CLI's bundled compiler is a separate
15
+ prerequisite. The exhaustive construct table is `references/renderable-subset.md` in
16
+ `cratis-screenplay-toolchain`; run the real render before claiming anything is admitted.
42
17
 
43
- Read at Stage `v4.24.0`, re-read at `v4.24.1` and `v4.24.2` (`SemanticCratisAdmission.EventRevisions.cs`, `SemanticEventLineageAdmission.cs`, ESM v4 section of `Documentation/guides/build-renderer-target.md`) (`Source/Rendering.Cratis/Semantics/SemanticSurfaceLedger.cs`, `Documentation/guides/build-renderer-target.md`; 4.24.1 changed only the ledger, dependency pins and the Dockerfile) (`Source/Rendering.Cratis/CratisArtifactRenderPlanner.cs`,
44
- `Semantics/SemanticCratisAdmission*.cs`, `SemanticSpecificationAdmission*.cs`,
45
- `PureTransitionAdmission.cs`, `SemanticImplementationAdmission.cs`) and cli `v3.28.2`
46
- (`Commands/Render/ScreenplayPlanning.cs`, unchanged since `v3.27.1`). Items marked *observed* were reproduced with
47
- `cratis render` 3.27.1 while building [render-example.md](render-example.md). Anything else
48
- is a reading of source: render the model before claiming it.
18
+ ## How a refusal arrives
49
19
 
50
20
  One blocking diagnostic fails the **whole** plan and nothing is published (exit 5).
51
21
  Informational diagnostics (`PLAY0270` authoring metadata, `PLAY0469`, `STAGE-ESM-023`) do not.
52
22
 
53
23
  A refusal can come from four layers, and the code tells you which: compilation and binding
54
- (`PLAY*`, from the CLI's bundled Screenplay: 4.66.0 in cratis 3.28.3), execution planning (`PLAN-*`), Stage
24
+ (`PLAY*`, from the CLI's bundled Screenplay), execution planning (`PLAN-*`), Stage
55
25
  admission (`STAGE-*`) and the CLI itself (`CLI-RENDER-*`). A publication conflict (a
56
26
  modified managed file, an unmanaged file at a planned path, a manifest from another
57
27
  target or renderer) is a plain ownership error with no code. Keep the actual diagnostic or
@@ -64,11 +34,8 @@ the capability gap, and route that scope to authorized gap-fill or a fully hand-
64
34
  delivery (`cratis-screenplay-render-and-gap-fill`). Changing the requirement itself is the
65
35
  model owner's decision.
66
36
 
67
- ## Event-reaction boundary at Stage 4.89.1
37
+ ## Event-reaction boundary
68
38
 
69
- Source: Stage `v4.89.1:Documentation/reference/reaction-rendering.md:6-98`,
70
- `Source/Rendering.Cratis/Semantics/SemanticCratisAdmission.Automation.cs:15-123`,
71
- `SemanticCratisAdmission.ReactionIdentity.cs:11-28`.
72
39
  Supported event reactions emit stable-id `[Reactor]` classes with `[OnceOnly]`,
73
40
  event guards, returned commands or explicit `EventForEventSourceId` envelopes.
74
41
  Required invocation inputs must be mapped; unmapped optional inputs become null.
@@ -86,72 +53,68 @@ Screenplay system claims are unknown, while Arc supplies system subject claims.
86
53
  `from Source` emits `[EventSourceType]`; `from Source.Stream` emits `[FromEventSource<T>]`.
87
54
  Produced events remain unrouted; reserved stored filter names refuse 030.
88
55
 
89
- Single-hop `when append` specifications now render through `ReactorScenario`, with one
56
+ Single-hop `when append` specifications render through `ReactorScenario`, with one
90
57
  invoked `CommandScenario` using the reactor attribute identity, not `given caller`.
91
58
  The fixture must select exactly one active trigger after `from`/`where`. Fan-out, deeper
92
59
  cascades, multiple invocations, `$context`, read-model/query expectations and constraint-target
93
- appends/products still refuse 011. Commands producing any subscribed reaction event still refuse
60
+ appends/products refuse 011. Commands producing any subscribed reaction event also refuse
94
61
  011 because generated `CommandScenario` does not settle reactions. Keep refused specifications.
95
62
 
63
+ Reaction, reducer and observer filters render on the semantic path; legacy syntax paths
64
+ keep refusing them (034/035). ESM v8 routed read-model/query companion replay renders,
65
+ seeding source and stream metadata through `ReadModelScenario`; reserved names and
66
+ unformattable routed fixtures remain `STAGE-ESM-030`.
67
+
96
68
  ## Diagnostic codes
97
69
 
98
70
  | Code | Meaning | Usual fix |
99
71
  | --- | --- | --- |
100
- | `STAGE-ESM-001` | Unsupported slice kind; `StateChange`, `StateView` and supported event-triggered `Automation` slices render at 4.89.1; Translate remains `-024` | Keep the model; gap-fill refused scope |
72
+ | `STAGE-ESM-001` | Unsupported slice kind; `StateChange`, `StateView` and supported event-triggered `Automation` slices render; Translate is `-024` | Keep the model; gap-fill refused scope |
101
73
  | `STAGE-ESM-002`, `-003` | Concept values or validation Stage cannot express; unresolved property type | Simplify the concept; fix the type |
102
74
  | `STAGE-ESM-004` | A `StateChange` slice without exactly one command | One command per slice |
103
75
  | `STAGE-ESM-005` | Code validation or rule predicate bodies; or a command beyond the first capability (optional event property, event revision other than the first, validation or requirement that cannot be rendered, neither `produces` nor a response) | Use declarative validation; non-initial event generations are not rendered |
104
76
  | `STAGE-ESM-006` | `produces` that cannot render without changing its destination or mappings (`produces when`, literal or computed mappings, `for` not a command identifier, mappings not one-to-one with event properties, duplicate tags) | Map properties one to one; conditional outcomes (`produces when`) are a different behavior, so gap-fill unless the owner accepts splitting them into commands |
105
77
  | `STAGE-ESM-007`, `-008`, `-009` | Projection count per read model (exactly one projection or reducer each); unresolvable properties or no single read-model transition (**flat** projections only); affected instance not one, not keyed by an event property, or not the event-source identity (flat projections only) | One projection per read model; see "Projections" below |
106
- | `STAGE-ESM-010` | A query is neither an optional snapshot lookup by the read-model identifier nor an observable collection query (for example a snapshot list); each query is checked on its own. Observable list queries (keyed or unkeyed) render since Stage 4.49.0. Historical Stage through 4.79.0 refused a validated key; Stage 4.89.1 (since 4.79.1) renders a scalar validated key, in keyed lookups and filtered observable collections, as its primitive and converts it inside the query, so an out-of-rule key finds no instance instead of failing validation, and still refuses a validated concept inside a composite or collection argument (Stage `v4.89.1` `Source/Rendering.Cratis/Semantics/SemanticCratisAdmission.StateView.cs:139-178,180-199`) | Keyed `XById => X optional` queries or `observable` lists; a snapshot list is gap-fill. v14 equality filters render on observable collections; DateTime filters, required filters after optional ones, nested validated arguments and snapshot lists refuse 010. Filter-name collisions refuse 012. Context/single-result filters, opaque scope/performer and composite `by` remain PLAY0268 |
78
+ | `STAGE-ESM-010` | A query is neither an optional snapshot lookup by the read-model identifier nor an observable collection query (for example a snapshot list); each query is checked on its own. Observable list queries (keyed or unkeyed) render. A scalar validated key renders as its primitive and is converted inside the query, so an out-of-rule key finds no instance instead of failing validation; a validated concept inside a composite or collection argument is refused | Keyed `XById => X optional` queries or `observable` lists; a snapshot list is gap-fill. Equality filters render on observable collections; DateTime filters, required filters after optional ones, nested validated arguments and snapshot lists refuse 010. Filter-name collisions refuse 012. Context/single-result filters, opaque scope/performer and composite `by` remain PLAY0268 |
107
79
  | `STAGE-ESM-011` | A specification cannot render (see the rules below) | Reshape it only if the assertion keeps its meaning; otherwise keep the specification, record the gap, and gap-fill with the specification as the oracle. Never weaken or delete it to get a render |
108
80
  | `STAGE-ESM-012` | Generated C# names collide (properties, types, namespaces, constraints) | Rename |
109
81
  | `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 |
110
82
  | `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 |
111
- | `STAGE-ESM-015` | Authorization Stage cannot render exactly (4.73.1): a role-claim URI, an opaque policy nested inside a condition, an unresolved or non-portable policy, no single identifier, an opaque-policy subject that is not text, Uuid, Date or DateTime (Stage 4.73.1 `IsTextualSubject`; a restriction on opaque-policy subjects, separate from declarative claim targets), an unsupported claim artifact. Role-only, authenticated, opaque pure policies, claim conditions with Uuid, Date, DateTime or text targets (numeric and Boolean claim matches render as always false; Stage 4.73.1 `IsSupportedClaimPath`) and `not`/and/or render; roles are read through the identity's `RoleClaimType` | Reshape the policy to a portable condition; otherwise gap-fill. *Historical (4.24/3.27.1):* a role alone, an opaque policy or a Uuid-backed claim were refused here |
112
- | `STAGE-ESM-016` | Model language/semantic pair is not an audited v1 to v15 pair at Stage 4.89.1; CLI 3.57.0 reports `CLI-RENDER-004` above v15 first. v14 filters and v15 generation join v11 numbers, v12 enum numbers and v13 compliance, not blanket construct support. *Historical:* Stage 4.24.2 admitted v1 to v4 and 4.24.1 and earlier v1 to v3 | Not fixable by editing: the model needs a newer renderer. Keep the model, record the gap, gap-fill |
83
+ | `STAGE-ESM-015` | Authorization Stage cannot render exactly: a role-claim URI, an opaque policy nested inside a condition, an unresolved or non-portable policy, no single identifier, an opaque-policy subject that is not text, Uuid, Date or DateTime (a restriction on opaque-policy subjects, separate from declarative claim targets), an unsupported claim artifact. Role-only, authenticated, opaque pure policies, claim conditions with Uuid, Date, DateTime or text targets (numeric and Boolean claim matches render as always false) and `not`/and/or render; roles are read through the identity's `RoleClaimType` | Reshape the policy to a portable condition; otherwise gap-fill |
84
+ | `STAGE-ESM-016` | Model language/semantic pair is not an audited ESM v1 to v15 pair; the CLI reports `CLI-RENDER-004` above v15 first. v14 filters and v15 generation join v11 numbers, v12 enum numbers and v13 compliance as supported constructs, not blanket construct support | Not fixable by editing: the model needs a newer renderer. Keep the model, record the gap, gap-fill |
113
85
  | `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 |
114
86
  | `STAGE-ESM-018` | `$strings.` key missing in the default locale or containing formatting characters | Fix the strings |
115
87
  | `STAGE-ESM-019` | Reducer structure or body not admitted (outside a `StateView`, impure, does not compile) | An equivalent pure body, or gap-fill |
116
88
  | `STAGE-ESM-020` | Implementation body missing, changed (hash differs) or refused by the loader | Provide the body inside the model root |
117
89
  | `STAGE-ESM-021`, `-022` | Reducer typed-context or analysis failure; a construct outside the pure allowlist, or a generated name shadowing a reducer type | An equivalent pure body, or gap-fill |
118
- | `STAGE-ESM-025` | Typed context references a historical event revision or a historical property identity (Stage 4.24.2); checked before `-026` | Reference the current revision; a historical reference is not renderable, so gap-fill |
119
- | `STAGE-ESM-026` | A selected event, or an event a selected slice depends on (producing command, observing projection or reducer, specification, constraint target), is above its initial revision (still refused at Stage 4.89.1): `Event 'X' has evolved to revision N; Stage does not render event migrations yet.` The whole selection is refused, nothing is emitted | Not fixable by editing without dropping the evolution. Stage#204 (needs Screenplay#71) tracks migration rendering; gap-fill the evolved events and hand-write the migrations (`cratis-chronicle-event-type-migration`). A scoped slice of initial events that depends on no evolved event still renders |
120
- | `STAGE-ESM-024` | Stage 4.89.1 still refuses interval, schedule, application, startup and shutdown triggers, opaque reaction bodies, captures, Translate (including directed Translate), and clock/trigger/capture specifications. Event-triggered Automation slices now render as Chronicle reactors, subject to `-013`, `-034` to `-040` below | Keep refused scope as gap-fill; do not confuse semantic Host settlement with live reactor delivery |
121
- | `STAGE-ESM-027` | A specification asserting a read model is absent (`then no readmodel`, ESM v5) is not rendered by the renderer (the semantic specification engine executes keyed absence) | Keep the specification; verify absence another way and record the gap |
122
- | `STAGE-ESM-028`, `-029` | Historical blanket v7 refusals. CLI 3.57.0 / Stage 4.89.1 render supported scalar UUID/String-concept strategies and Guarded v15 freshness, generation fixtures, scalar/named responses and `then returns`; unsupported generated types still report `-028` | Probe the supported form; preserve refused combinations as gap-fill |
123
- | `STAGE-ESM-038` | Generated/response results combined with routes, generated-property/concept rules, legacy allocation, generated unique-constraint mappings, non-scalar/non-command response sources or generated-name collisions (Stage `v4.89.1:Documentation/reference/generated-values-rendering.md:123-138`) | Keep the model; gap-fill that command |
124
- | `STAGE-ESM-039`, `-040` | Reaction conditions, destinations or mappings outside the faithful target subset; protected identity uses (including reaction destinations) and protected enum concepts | See the event-reaction boundary below; never declassify protected values |
125
- | `STAGE-ESM-030` | Named event-source or stream definition with a reserved stored name; unformattable routed fixtures or command replay routes. Routed read-model/query replay now renders. The default sandbox engine also reports it for every routed model | Rename the reserved name; render the model with `cratis render`, not `cratis run` |
90
+ | `STAGE-ESM-025` | Typed context references an earlier event revision or an earlier property identity; checked before `-026` | Reference the current revision; an earlier reference is not renderable, so gap-fill |
91
+ | `STAGE-ESM-026` | A selected event, or an event a selected slice depends on (producing command, observing projection or reducer, specification, constraint target), is above its initial revision: `Event 'X' has evolved to revision N; Stage does not render event migrations yet.` The whole selection is refused, nothing is emitted | Not fixable by editing without dropping the evolution. Gap-fill the evolved events and hand-write the migrations (`cratis-chronicle-event-type-migration`). A scoped slice of initial events that depends on no evolved event still renders |
92
+ | `STAGE-ESM-024` | Interval, schedule, application, startup and shutdown triggers, opaque reaction bodies, captures, Translate (including directed Translate), and clock/trigger/capture specifications. Event-triggered Automation slices render as Chronicle reactors, subject to `-013` and `-034` to `-040` below | Keep refused scope as gap-fill; do not confuse semantic Host settlement with live reactor delivery |
93
+ | `STAGE-ESM-027` | A specification asserting a read model is absent (`then no readmodel`) is not rendered (the semantic specification engine executes keyed absence) | Keep the specification; verify absence another way and record the gap |
94
+ | `STAGE-ESM-028`, `-029` | Generated values or responses Stage cannot render. Supported scalar UUID/String-concept strategies, v15 freshness, generation fixtures, scalar/named responses and `then returns` render; unsupported generated types report `-028` | Probe the supported form; preserve refused combinations as gap-fill |
95
+ | `STAGE-ESM-038` | Generated/response results combined with routes, generated-property/concept rules, legacy allocation, generated unique-constraint mappings, non-scalar/non-command response sources or generated-name collisions | Keep the model; gap-fill that command |
96
+ | `STAGE-ESM-039`, `-040` | Reaction conditions, destinations or mappings outside the faithful target subset; protected identity uses (including reaction destinations) and protected enum concepts | See the event-reaction boundary above; never declassify protected values |
97
+ | `STAGE-ESM-030` | Named event-source or stream definition with a reserved stored name; unformattable routed fixtures or command replay routes. The default sandbox engine also reports it for every routed model | Rename the reserved name; render the model with `cratis render`, not `cratis run` |
126
98
  | `STAGE-ESM-031` | Whole-number literal outside the C# `int` range below ESM v8 (v8 and later render `long`) | Raise the model to v8 constructs or gap-fill |
127
99
  | `STAGE-ESM-032`, `-033` | Public events and event-target projections or reducers (ESM v9); foreign event origins and event-source captures | Gap-fill |
128
100
  | `STAGE-ESM-034` | Reaction `runs as` invoking claim-reading or opaque authorization; every `runs as` on legacy syntax paths | Keep the gate; gap-fill |
129
101
  | `STAGE-ESM-035` | Observer filters on legacy syntax paths; semantic reaction/reducer filters render | Use semantic admission |
130
102
  | `STAGE-ESM-036` | Per-production route overrides | Gap-fill |
131
103
  | `STAGE-ESM-041` | Non-text secret concepts (Int/Decimal/Bool/Date/DateTime/Uuid), not `pii secret` | Keep classification; text backing only if it preserves the contract |
132
- | `STAGE-ESM-037` | Events and commands from one handler, even across separate triggers on the same event in one reaction. The scaffold's Arc supports mixed results, but appends events before commands; a refused command causes redelivery and duplicate events (Stage `v4.89.1:Documentation/reference/reaction-rendering.md:98`) | **Do not split the modeled reaction or drop an effect.** Gap-fill only with a proven retry-safe implementation; `[OnceOnly]` excludes replay, not retry |
104
+ | `STAGE-ESM-037` | Events and commands from one handler, even across separate triggers on the same event in one reaction. The scaffold's Arc supports mixed results, but appends events before commands; a refused command causes redelivery and duplicate events | **Do not split the modeled reaction or drop an effect.** Gap-fill only with a proven retry-safe implementation; `[OnceOnly]` excludes replay, not retry |
133
105
  | `STAGE-ESM-023` | Information: transition bodies analysed | none |
134
- | `STAGE-CRATIS-001` to `-005` | Profile or `scene.json` not the package-owned shape; unrecognized or missing scaffold input; artifact path collision; a modeled module or feature that would render into the reserved `Customizations/` | Rename the module or feature (005) |
106
+ | `STAGE-CRATIS-001` to `-005` | Profile or `scene.json` not the package-owned shape; unrecognized or missing scaffold input; artifact path collision (`-004`, for example case names that normalize to one path); a modeled module or feature that would render into the reserved `Customizations/` (`-005`) | Rename the module, feature or case |
135
107
  | `STAGE-AUTH-001` | Authorization cannot be rendered faithfully | As `STAGE-ESM-015` |
136
- | `CLI-RENDER-001`, `-002` | Unknown target; invalid rendering name (`CLI-RENDER-003`, event generations, was reported by cratis 3.28.2 only) | Fix the option, or the model |
137
- | `CLI-RENDER-004` | The bound model is newer than ESM v15 (CLI 3.57.0) | Not fixable by editing: keep the model, gap-fill |
108
+ | `CLI-RENDER-001`, `-002` | Unknown target; invalid rendering name | Fix the option, or the model |
109
+ | `CLI-RENDER-004` | The bound model is newer than ESM v15 | Not fixable by editing: keep the model, gap-fill |
138
110
  | `CLI-RENDER-005`, `-006` | Authored metadata with characters invalid in XML blocks rendering of XML doc comments; a document set that cannot be read as a workspace renders without comments (warning) | Remove the invalid characters |
139
111
  | `CLI-RENDER-007` to `-010` | `ui profile` refusals (package set, profile shape) | See `--package-set` |
140
112
  | `CLI-RENDER-011` to `-014` | `--scope`: unknown address; ambiguous feature and slice name; aggregate or unrecognized policy layout (render the whole application once); a dependency not in the manifest or the scope | Fix the address or add the owning scope |
141
113
 
142
- `CLI-RENDER-015` (navigation properties) is retired since Stage 4.73.1.
143
-
144
114
  `STAGE-CRATIS-FILE-001`, `-INLINE-001`, `-QUERY-001`, `-KEY-001`, `-KEY-002`,
145
115
  `-PROJECTION-001` and `STAGE-EVENT-001` come from the legacy syntax renderer and the direct
146
116
  runtime route, not from `cratis render`.
147
117
 
148
- **Legacy direct-write paths.** The syntax-based `IRenderer` and the optional
149
- `Cratis.Stage.Rendering.Cratis.Scaffolding` package write straight to disk. Stage's README
150
- states that direct rendering has no managed staging or safe stale-file removal and that a
151
- failure can leave the target **unsafe and incomplete**. They are legacy compatibility
152
- only; new rendering goes through `CratisRendering` and `cratis render`, whose managed
153
- publication is journaled and recoverable.
154
-
155
118
  ## Projections
156
119
 
157
120
  Stage renders two projection forms; the restrictions differ.
@@ -161,83 +124,65 @@ Stage renders two projection forms; the restrictions differ.
161
124
  `from` block `key`, else the event source. An event-source key (default or
162
125
  `key $eventSourceId`) makes the identifier the event source; an event-property or literal
163
126
  key makes it that key. Stage refuses a literal key (`STAGE-ESM-017`; scoped keys are an
164
- event property or the event source, `SemanticScopedProjectionSupport.KeySupported`). Never map `$eventSourceId` onto the identifier when the key is
127
+ event property or the event source). Never map `$eventSourceId` onto the identifier when the key is
165
128
  something else (`from PaymentRecorded key invoiceId`): the runtime fails with "affected key
166
- disagrees with read-model identifier" (Screenplay v4.66.0
167
- `SemanticScopedProjection.State.cs:182-184`, `SemanticEvaluator.cs:733-736`).
129
+ disagrees with read-model identifier".
168
130
  2. Executable model. A flat-bound projection must map the identifier like any required
169
131
  property (the flat evaluator does not seed it): `xId = <keyProperty>`. A scoped projection
170
- needs no mapping: `RootDocument` seeds the identifier from the key when it creates the
171
- instance (`SemanticScopedProjection.cs:279-290`). Mapping it from its key (`xId =
172
- $eventSourceId` for an event-source key, `xId = <keyProperty>` for an event-property key)
173
- is also valid.
174
- 3. Renderable model (Stage v4.24.0). Binding flat (Screenplay `SemanticModelBinder.Projections.cs`
175
- `IsFlat`: every block is a `from` - no `remove`, join, children, nested, `every` or `all` -
176
- none has a parent key, every `from` is keyed by a top-level event property, and every
177
- mapping is a plain set to a declared top-level read-model property from a top-level event
178
- property or a non-null literal; `IsFlatSource`, `IsFlatProperty`) is not Stage admission.
179
- Every other shape binds scoped, including a `= null` clear or a dotted target.
180
- - **Flat admission** (`SemanticCratisAdmission.StateView.cs:94-114`) holds only when all of these
181
- are true: one `from` naming one event (`STAGE-ESM-008`); every read-model property, optional
182
- ones included, is mapped from an event property (auto-map counts, and flat auto-map matches exact names only; a literal is refused,
183
- `STAGE-ESM-009`, `SemanticFlatProjectionSupport.MappingsMatch`); and the key property is an
184
- identifier concept that every producing command's `for` fills (`UsesEventSourceIdentity`).
185
- Anything else that binds flat is refused. When the key is the event source, drop the explicit
186
- key and the projection is scoped, which admits literals.
187
- - **Scoped** (`SemanticScopedProjectionSupport.cs`, fixture `when_rendering_scoped_projections`):
188
- every other projection, including a plain single `from E` with the default or
132
+ needs no mapping: the root document seeds the identifier from the key when it creates the
133
+ instance. Mapping it from its key (`xId = $eventSourceId` for an event-source key,
134
+ `xId = <keyProperty>` for an event-property key) is also valid.
135
+ 3. Renderable model. A projection binds flat when every block is a `from` (no `remove`,
136
+ join, children, nested, `every` or `all`), none has a parent key, every `from` is keyed by
137
+ a top-level event property, and every mapping is a plain set to a declared top-level
138
+ read-model property from a top-level event property or a non-null literal. Binding flat
139
+ is not Stage admission. Every other shape binds scoped, including a `= null` clear or a
140
+ dotted target.
141
+ - **Flat admission** holds only when all of these are true: one `from` naming one event
142
+ (`STAGE-ESM-008`); every read-model property, optional ones included, is mapped from an
143
+ event property (auto-map counts, and flat auto-map matches exact names only; a literal is
144
+ refused, `STAGE-ESM-009`); and the key property is an identifier concept that every
145
+ producing command's `for` fills. Anything else that binds flat is refused. When the key is
146
+ the event source, drop the explicit key and the projection is scoped, which admits literals.
147
+ - **Scoped:** every other projection, including a plain single `from E` with the default or
189
148
  `$eventSourceId` key. Forms: several distinct `from` blocks, `remove with`, root
190
149
  `join ... on`, `children` with an identified element (one level, no children or joins
191
- inside a child; `remove with` and `remove via join` inside a child are admitted, fixture
192
- `when_executing_re_admitted_scoped_projections`, `children.RemovedWithJoin`), `nested` over
193
- an optional composite property, and `every` with set-from-event-source mappings. Keys are
194
- an event property or the event source. The key establishes the identifier, so it must end up
195
- unmapped: `Rejection` refuses a mapping onto it unless it copies the key's own event property
196
- (`MatchesKey`, `SemanticScopedProjectionSupport.cs:104-110, 360-363`), so an event-source key
197
- admits no mapping at all (`STAGE-ESM-017`). Auto-map counts as a mapping
198
- (Screenplay `SemanticModelBinder.ProjectionValues.cs` `AutoMapped`, which does not skip the
199
- identifier): if the event carries a property with the identifier's name and type, declare
200
- `no automap` and map the other properties explicitly. `from E` and `from E key
201
- $eventSourceId` render when the identifier ends up unmapped, whether or not the event repeats
202
- the identifier.
150
+ inside a child; `remove with` and `remove via join` inside a child are admitted), `nested`
151
+ over an optional composite property, and `every` with set-from-event-source mappings. Keys
152
+ are an event property or the event source. The key establishes the identifier, so it must
153
+ end up unmapped: a mapping onto it is refused unless it copies the key's own event
154
+ property, so an event-source key admits no mapping at all (`STAGE-ESM-017`). Auto-map
155
+ counts as a mapping: if the event carries a property with the identifier's name and type,
156
+ declare `no automap` and map the other properties explicitly. `from E` and
157
+ `from E key $eventSourceId` render when the identifier ends up unmapped, whether or not
158
+ the event repeats the identifier.
203
159
  - Refused in a scope (`STAGE-ESM-017`): composite keys; `all` (FromAll); `every` with
204
160
  children included beside children or nested blocks; root `remove via join`; joins,
205
161
  children or join removals inside `nested`; a `clear` inside `nested`; recursive children
206
162
  and joins inside a child; duplicate event contracts among `from`, join or
207
163
  removal blocks; event or read-model property names that collide with Chronicle syntax.
208
- Several of these are tracked upstream (Chronicle#4125, #4166).
209
164
  - A scope cannot also carry flat transitions.
210
165
 
211
166
  The example in [render-example.md](render-example.md) uses a scope (`from` plus `remove with`).
212
- Read-only reading of the source: a projection shape outside both forms is gap-fill, but
213
- render it before saying so.
167
+ A projection shape outside both forms is gap-fill, but render it before saying so.
214
168
 
215
169
  ## Pure reducer bodies
216
170
 
217
- Stage 4.24 renders a reducer only when each transition body passes a Roslyn analysis
171
+ Stage renders a reducer only when each transition body passes a Roslyn analysis
218
172
  against an audited allowlist: a complete statement block, pure operations over the typed
219
173
  context, no directives, no writes to statics, `throw` limited to
220
174
  `InvalidOperationException(string)` or `ArgumentException(string)`, LINQ lambdas that are
221
175
  pure expressions, and no generated type shadowing a referenced one. Anything else is
222
176
  `STAGE-ESM-019`, `-021` or `-022`. A reducer needs a `StateView` slice, its read model in the
223
177
  same slice, a required Guid or text identifier and a matching keyed query. Code validation
224
- (`STAGE-ESM-005`) is refused outright (opaque pure policies render at 4.73.1), and a command
225
- `handler` never binds (`PLAY0268`). Reducer rendering was read, not run, for this skill.
178
+ (`STAGE-ESM-005`) is refused outright (opaque pure policies render), and a command
179
+ `handler` never binds (`PLAY0268`).
226
180
 
227
181
  ## Specification rules (`STAGE-ESM-011`)
228
182
 
229
- The following detailed rules retain the 4.24-era observations; current additions
230
- are generated fixtures/return assertions, routed companion replay and supported single-hop
231
- reaction appends (above). Other appends and commands cascading into reactions retain `-011`.
232
- Sources: Stage `v4.89.1:Documentation/reference/generated-values-rendering.md:97-111`,
233
- `Documentation/reference/event-source-routing.md:72`,
234
- `Documentation/reference/reaction-rendering.md:63-75`.
235
-
236
- From historical `SemanticSpecificationAdmission*.cs`; the first rule was also observed.
237
-
238
183
  - A specification needs a `when <Command>` of its own slice (`PLAY0273` otherwise), and
239
- its `then` events must be as many as the command `produces` (observed: a `then query`
240
- spec failed until it also asserted the event).
184
+ its `then` events must be as many as the command `produces` (a `then query`
185
+ spec fails until it also asserts the event).
241
186
  - A `given caller` with a role-claim URI is refused; `role "X"` is accepted. `then denied`
242
187
  needs an authorized command and a `given caller`; a `then query` on a protected query
243
188
  needs a `given caller`.
@@ -245,61 +190,20 @@ From historical `SemanticSpecificationAdmission*.cs`; the first rule was also ob
245
190
  order are admitted for command-only assertions with compatible destinations, but not
246
191
  when a read-model or reducer expectation must replay them, which needs distinct
247
192
  contracts), `then readmodel`, `then query` (one result, scalar key), `then error` naming a
248
- rendered constraint or an authored message, `then denied`.
249
- - Refused: `then no readmodel` (`STAGE-ESM-027`), an unauthenticated caller carrying roles or claims (`STAGE-ESM-011`), `when append`, composite values, `given readmodel` beside a
193
+ rendered constraint or an authored message, `then denied`. Generated fixtures and
194
+ `then returns` assertions render, as do routed companion replay and supported
195
+ single-hop reaction appends.
196
+ - Refused: `then no readmodel` (`STAGE-ESM-027`), an unauthenticated caller carrying roles or claims (`STAGE-ESM-011`), other `when append` forms, composite values, `given readmodel` beside a
250
197
  command, error codes that name no rendered constraint, a `$context.occurred` mapping
251
198
  asserted without a supplied time, a query on a reducer-built read model, a protected
252
199
  query whose fixtures use streams other than the queried key.
253
200
  - A when-less specification is admitted only as `then denied` on an authorized keyed
254
201
  query, or `given readmodel` plus `then query` on an unprotected query.
255
- - Descriptions and event documentation render only as XML doc comments (Stage 4.73.1); comments are never rendered; neither is behavior.
256
-
257
- ## Observed refusals
202
+ - Descriptions and event documentation render only as XML doc comments; comments are never rendered, and neither is behavior.
258
203
 
259
- Each came from the first draft of the example model, rendered with cratis 3.27.1 (the marina model still renders on 3.28.2 with 30 artifacts):
204
+ ## Refusals seen while drafting a model
260
205
 
261
206
  | Draft | Diagnostic | Fix that rendered |
262
207
  | --- | --- | --- |
263
- | `policy` with only `require role "HarbourMaster"` | `STAGE-ESM-015` | `require authenticated and role "HarbourMaster"` (two `require` lines are `PLAY0441`) |
264
- | Projection `from BerthReserved` with `berthId = $eventSourceId` (mapping the identifier) | `STAGE-ESM-017`: mappings cannot overwrite the key | Do not map the identifier; the key establishes it, so map only the other properties. `from E key $eventSourceId` plus the same mapping was also refused |
208
+ | Projection `from BerthReserved` with `berthId = $eventSourceId` (mapping the identifier) | `STAGE-ESM-017`: mappings cannot overwrite the key | Do not map the identifier; the key establishes it, so map only the other properties. `from E key $eventSourceId` plus the same mapping is also refused |
265
209
  | A `then query` spec in the view slice, then one without `then <Event>` | `PLAY0273`, then `STAGE-ESM-011` | Put the spec in the command slice with `given caller`, `when`, the `then` event and `then query` |
266
-
267
- ## Source disagreements (trust the code)
268
-
269
- | Source says | Code at the tag says |
270
- | --- | --- |
271
- | Stage README: application scope adds "exactly eight" backend files | The scaffold creates nine (adds `GeneratedPolicyRegistration.cs`), plus the frontend scaffold |
272
- | cli reference: bodied reducers are unsupported (`STAGE-ESM-019`) | `PureTransitionAdmission` admits pure allowlisted bodies |
273
- | Stage customization guide: an Automation slice blocks with `STAGE-ESM-001`; Stage pins Screenplay 4.35.0 | With cli 3.27.1 an Automation or Translate slice failed binding (`PLAY0268`) first; with cli 3.28.2 it binds and Stage refuses the whole model with `STAGE-ESM-016` (probed). Stage 4.24.0 pinned Screenplay 4.60.0 (4.24.1: 4.66.0) |
274
- | An earlier version of this skill: Stage has no authorization contract for queries | Query authorization is admitted and rendered; an unauthorized query renders `[AllowAnonymous]` (observed) |
275
-
276
- ## Historical Stage 4.24 admission
277
-
278
- Kept as history. Not a statement about the current Stage (see the 4.89.1 summary in `SKILL.md` and the diagnostic codes above).
279
-
280
- Whole-model admission needs ESM schema v1 to v4; v5 and v6 are `STAGE-ESM-016`. Stage 4.24.2 admits ESM v4 (Screenplay compiles a model with evolved events to v4): an event at its initial revision renders exactly as before, but any selected event above the initial revision, and every scope depending on it (a command producing it, a projection or reducer observing it, a specification using it), is refused with `STAGE-ESM-026` and nothing is emitted. A typed-context reference to a historical revision or property identity is refused with `STAGE-ESM-025`. Stage cannot render Chronicle event-type migrations yet (Cratis/Stage#204, which depends on Cratis/Screenplay#71), and Stage's runtime (`cratis run`, the Host) still refuses evolved events, so deliver evolved events as gap-fill. Stage 4.24.1 also lists the ESM v6 members (reactions, captures, application triggers, clock and capture specifications) as rejected `STAGE-ESM-024` in its surface ledger, but the version gate refuses the model first, so a v6 model reports `STAGE-ESM-016` only. The bundled Stage 4.24.2 (cratis 3.28.3) reports an evolved event with `STAGE-ESM-026` only (probed); cratis 3.28.2 bundled Stage 4.24.1 (3.28.1 and earlier: 4.24.0), refused a v4 model with `STAGE-ESM-016` and also reported `CLI-RENDER-003`. The admitted vertical:
281
-
282
- - concepts, composite types, collections and optional values;
283
- - `StateChange` slices with exactly one command and an unconditional `produces` whose
284
- `for` is the command identifier, with portable validation;
285
- - `StateView` slices with exactly one projection (or reducer) per read model: a flat
286
- `from` block, or a scoped projection (several `from`, `remove with`, root `join`,
287
- one-level `children`, `nested`), keyed by the event source or an event property; and
288
- any number of optional snapshot queries by the read-model identifier;
289
- - declarative authorization (including query authorization) that requires authentication;
290
- - unique constraints, and modeled specifications that fit the shapes in the reference;
291
- - reducers whose bodies pass the **pure** allowlist (Roslyn analysis).
292
-
293
- Not rendered: `Automation` and `Translate` slices (Stage#79, open: the whole automation
294
- is gap-fill), reactions and captures, list, observable, filtered and scoped queries,
295
- `produces when`, command `handler`s, code validation and opaque policies (they refuse),
296
- composite-key projections, `all`, and compliance markers (`pii`, `secret`, which
297
- already fail binding with `PLAY0268`). Any one blocking diagnostic fails the whole plan.
298
- A refusal is not a licence to weaken the model: drop no specification, event generation
299
- or protection to get a render; keep the model, record the capability gap and gap-fill.
300
- The code table, the projection and specification rules and the refusals reproduced while
301
- building the example are in the sections above; the exhaustive ledger
302
- is `references/renderable-subset.md` in `cratis-screenplay-toolchain`.
303
- Read `cratis-screenplay-toolchain/references/renderable-subset.md` when you need the exhaustive surface ledger beyond the admission summary.
304
-
305
- (At 4.24 descriptions and documentation were not rendered at all; since Stage#178 they render as XML doc comments only. Prose is still never enforced behavior.)
@@ -1,31 +1,24 @@
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
- # Case tables and whole numbers: check the Stage version
1
+ # Case tables and whole numbers
5
2
 
6
3
  ## Contents
7
4
 
8
- - CLI default versus Stage release
9
- - One specification per case (Stage 4.59.0+)
10
- - Whole numbers as long (Stage 4.61.0+)
11
- - Released source evidence
5
+ - Renderer and sandbox image
6
+ - One specification per case
7
+ - Whole numbers as long
12
8
 
13
- ## CLI default versus Stage release
9
+ ## Renderer and sandbox image
14
10
 
15
- Current CLI/compiler/Stage pins: `cratis-screenplay-toolchain/references/versions.md`.
16
- The pinned default renderer applies case-table support introduced in Stage 4.59.0 and the whole-number rule
17
- introduced in 4.61.0: v8+ whole numbers use `long`, earlier versions keep `int`.
18
- CLI and Stage admit through v10 to construct checks; newer versions receive
19
- CLI-RENDER-004 before planning (direct Stage: STAGE-ESM-016).
20
- Previous CLI 3.46.1 bundled Screenplay 4.130.0/Stage 4.52.0, applied neither rule,
21
- and refused above v7. A standalone compiler does not upgrade the bundled renderer.
11
+ The CLI's bundled renderer expands case tables into one specification per case and
12
+ renders whole numbers as `long` from ESM v8 (earlier versions keep `int`). Models above
13
+ the newest admitted ESM version receive `CLI-RENDER-004` before planning (direct Stage:
14
+ `STAGE-ESM-016`). A standalone compiler does not upgrade the bundled renderer.
22
15
 
23
- `cratis run ./model --tag 4.63.2` selects a newer **sandbox image**; it does not
16
+ `cratis run ./model --tag <stage-version>` selects a different **sandbox image**; it does not
24
17
  change `cratis render`. The renderer is statically bundled and has no Stage
25
- package/image override. A newer renderer needs a CLI release that pins it.
18
+ package/image override. A newer renderer needs a CLI release that bundles it.
26
19
  Sandbox execution is not generated-application verification.
27
20
 
28
- ## One specification per case (Stage 4.59.0+)
21
+ ## One specification per case
29
22
 
30
23
  Case tables expand before rendering. The effective specification names are
31
24
  `<Specification>_<Case>`; Stage emits one Debug specification class per case,
@@ -69,7 +62,7 @@ fixtures: …`. Read the failure details and each case outcome; SpecRunner exit
69
62
  alone is not a pass. Map generated Debug test classes back to effective cases,
70
63
  not just to the authored table or a total count.
71
64
 
72
- ## Whole numbers as long (Stage 4.61.0+)
65
+ ## Whole numbers as long
73
66
 
74
67
  The **model's ESM version**, not the Stage package version alone, selects the
75
68
  C# whole-number type: v8 and later use `long`; v1–v7 retain `int` for stored-schema
@@ -79,7 +72,7 @@ frontend types separately; this C# admission rule does not establish their mappi
79
72
  Screenplay's Double-mode whole-number range is
80
73
  ±(2^53−1), not the entire C# `long` range; `numbers exact` remains unadmitted.
81
74
 
82
- This routed model selects ESM v8. On Stage 4.61.0+, `Quantity` wraps `long` and
75
+ This routed model selects ESM v8. `Quantity` wraps `long` and
83
76
  the fixture renders as `2147483648L`:
84
77
 
85
78
  ```screenplay
@@ -109,21 +102,8 @@ module Inventory
109
102
  ```
110
103
 
111
104
  Without the `eventsource` declaration and command `stream` clause, the model is
112
- below v8. On Stage 4.61.0+, that out-of-`int` fixture is refused with
105
+ below v8. That out-of-`int` fixture is refused with
113
106
  `STAGE-ESM-031`; literals within −2147483648…2147483647 still render as `int`.
114
107
  Do not remove the fixture, narrow its value or patch generated C# to pass.
115
108
  Widening an already persisted event property from `int` to `long` requires a new
116
109
  Chronicle event generation; changing model version is not a safe schema migration.
117
-
118
- ## Released source evidence
119
-
120
- - Stage `v4.59.0`: `Source/Rendering.Cratis/for_CratisArtifactRenderPlanner/given/a_specification_case_table.cs`,
121
- `when_executing_generated_case_table_specifications.cs`, `when_refusing_colliding_case_names.cs`,
122
- `CratisArtifactRenderPlanner.cs`; `Source/Specifications/SemanticSpecificationExecutor.cs`
123
- and `Source/SpecRunner/for_Program/when_running_semantic_case_tables.cs`.
124
- - Stage `v4.61.0`: `Source/Rendering.Cratis/Semantics/SemanticTypeSystem.cs`,
125
- `SemanticCratisAdmission.WholeNumbers.cs` and
126
- `Source/Rendering.Cratis/Semantics/for_SemanticCratisAdmission/when_admitting_whole_number_literals/with_a_pre_v8_model.cs`.
127
- - CLI `v3.50.0` (previous bundle `v3.46.1`): `Directory.Packages.props`,
128
- `Source/Cli/Commands/Render/{RenderSettings,CratisRenderTarget,RenderedSemanticVersions}.cs`,
129
- `Source/Cli/Commands/Run/{RunSettings,StageContainer}.cs`.
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Choosing a strategy
7
7
 
8
- Render only the released part of the [shared shop model](../../cratis-screenplay-command-surface/references/shop-generation.md):
8
+ Render only the supported part of the [shared shop model](../../cratis-screenplay-command-surface/references/shop-generation.md):
9
9
  CustomerId (`cus_` + ULID), TypeID OrderId and NanoID InviteCode. ApiKey remains
10
10
  secret with no generated property; do not turn .NET Bytes(32) credential generation
11
11
  into a promise of Stage secret generation. The Arc context-aware OrderId is not
@@ -19,12 +19,10 @@ for exact shapes and refusals. Time-ordered factories use wall clock, not
19
19
  receipt-time `GenerationContext`; neither strict millisecond order nor `given clock`
20
20
  ID synthesis is promised.
21
21
 
22
- ## When not to
22
+ ## Pitfalls
23
23
 
24
24
  Do not generate client-owned inputs, idempotency keys, gapless invoice numbers or
25
25
  secrets. Generation is not authorization, projection readiness or external-effect
26
26
  success. Pattern/random/rule execution, sequences and clock specs remain unsupported.
27
- At v15, Stage 4.89.1 emits explicit whole-source concurrency scopes; below v15 it
28
- keeps unguarded handlers. This is not delivery of Arc#3129's future freshness API.
29
- Sources: Stage `v4.89.1:Documentation/reference/generated-values-rendering.md:62-83,138-146`;
30
- Screenplay `v4.151.0:Documentation/screenplay/generated-values/choosing.md:8-29`.
27
+ At ESM v15, Stage emits explicit whole-source concurrency scopes; below v15 it
28
+ keeps unguarded handlers. This is not a general freshness API.
@@ -1,19 +1,19 @@
1
- # Example: a model inside the Stage 4.24 renderable subset
1
+ # Example: a renderable model
2
2
 
3
3
  ## Contents
4
4
 
5
- - What was run
5
+ - Check it
6
6
  - What came out
7
7
 
8
- A complete marina-berth model that `cratis render` 3.28.2 and 3.28.3 accept, followed by what the
9
- render produced and how each claim was checked. Use it as a shape to stay inside when a
8
+ A complete marina-berth model that `cratis render` accepts, followed by what the
9
+ render produces and how to check it. Use it as a shape to stay inside when a
10
10
  model must be renderable; it is not a template for richer slices (see `admission.md`).
11
11
 
12
12
  ```screenplay
13
- // cratis-stage-rendering-and-sandbox: a complete model inside the Stage 4.24 renderable subset.
13
+ // cratis-stage-rendering-and-sandbox: a complete renderable model.
14
14
  // Two commands with one event each, one projection with a removal, one keyed snapshot query,
15
15
  // declarative authorization and three reference specifications. Compiles with warnings as errors
16
- // and renders with `cratis render`; no code attachments, no ESM v4+ constructs.
16
+ // and renders with `cratis render`; no code attachments, no evolved events.
17
17
 
18
18
  domain Harbour.Marina
19
19
 
@@ -98,7 +98,7 @@ module Berths
98
98
  Why it is shaped this way:
99
99
 
100
100
  - Each command has one unconditional `produces`, with a typed `for` on the identifier.
101
- - The policy requires authentication as well as the role. (On cratis 3.27.1 a role alone was refused with `STAGE-ESM-015`; Stage 4.73.1 renders a role-only policy, reading roles through the identity's `RoleClaimType`. The authenticated form still renders.)
101
+ - The policy requires authentication as well as the role. A role-only policy also renders, reading roles through the identity's `RoleClaimType`. Two `require` lines in one policy are `PLAY0441`: combine them with `and`.
102
102
  - The projection has a `from` and a `remove with`, so Stage renders it as a scoped
103
103
  projection keyed by the event source. The identifier is never mapped: the key
104
104
  establishes it, and mapping it is `STAGE-ESM-017`.
@@ -106,33 +106,29 @@ Why it is shaped this way:
106
106
  identifier. It has no `authorize`, so it renders as `[AllowAnonymous]`.
107
107
  - The specifications that assert a query sit in the **command** slice: a `then query`
108
108
  needs the `when` command of its own slice and the `then` event as well.
109
- - No `handler`, no code attachments, no reactions, no ESM v4 or newer constructs.
109
+ - No `handler`, no code attachments, no reactions, no evolved events.
110
110
 
111
- ## What was run
111
+ ## Check it
112
112
 
113
- **Re-probed on cratis 3.53.1 (Stage 4.73.1; admission and publication only, build and tests not re-run):** the model compiles with the standalone 4.139.0 tool, its 3 specifications pass in the reference runner, and `cratis render` exits 0 with 56 artifacts written to a scratch destination (the plan grew with the scaffold). The counts and results in the table below are the cratis 3.28.2 observations.
114
-
115
- All with cratis 3.28.2 (re-run end to end from 3.27.1: same counts; admission and publication re-run on 3.28.3 with Stage 4.24.2: the same 30 artifacts) on a folder holding only `berths.play`:
116
-
117
- | Step | Command | Result |
113
+ | Step | Command | A pass looks like |
118
114
  | --- | --- | --- |
119
- | Compile | `screenplay <folder> --warnaserror` (4.66.0) and `cratis screenplay validate <folder> --warnings-as-errors` | 0 errors, 0 warnings |
120
- | Admission and publication | `cratis render <folder> --name Marina --destination out -o json` | exit 0, 30 artifacts written, `recovered: false` |
121
- | Re-render | the same command | `written: 0`, `unchanged: 30` |
115
+ | Compile | `cratis screenplay validate <folder> --warnings-as-errors` | 0 errors, 0 warnings |
116
+ | Admission and publication | `cratis render <folder> --name Marina --destination out -o json` | exit 0, artifacts written, `recovered: false` |
117
+ | Re-render | the same command | `written: 0`, `unchanged` equals the artifact count |
122
118
  | Local edit | append a line to `out/Program.cs`, render again | exit 5: `Managed artifact 'Program.cs' was modified by the user; pass --force to replace it.` |
123
- | Forced | the same with `--force` | `written: 1`, `unchanged: 29` |
119
+ | Forced | the same with `--force` | `written: 1`, the rest `unchanged` |
124
120
  | Missing name | render without `--name` | exit 5: `A valid --name is required and must be a C# identifier` |
125
- | Debug build | `dotnet build out/Marina.csproj -c Debug` | succeeded, 0 warnings, 0 errors |
126
- | Debug tests | `dotnet test out/Marina.csproj -c Debug` | 7 passed, 0 failed |
121
+ | Debug build | `dotnet build out/Marina.csproj -c Debug` | succeeds, 0 warnings, 0 errors |
122
+ | Debug tests | `dotnet test out/Marina.csproj -c Debug` | all specification classes pass |
127
123
 
128
- Runtime (`docker compose up`, `/healthz`) and the frontend build were **not run**.
124
+ Runtime (`docker compose up`, `/healthz`) and the frontend build are separate results.
129
125
 
130
- **Admission is not a passing test.** An earlier draft of the query specification also
131
- asserted `berthId` in the `result`. It was admitted and built, and its rendered Debug
132
- test failed (`should_return_the_expected_read_model`): the scoped projection does not set
133
- the identifier property in that scenario. Dropping the identifier from the `result` made
134
- all 7 tests pass. That removes an assertion about the key, so it is an accepted
135
- trade-off only when the model's owner agrees; otherwise record it as a capability gap.
126
+ **Admission is not a passing test.** A query specification that also asserts `berthId` in the
127
+ `result` is admitted and builds, but its rendered Debug test fails
128
+ (`should_return_the_expected_read_model`): the scoped projection does not set the
129
+ identifier property in that scenario. Dropping the identifier from the `result` makes the
130
+ tests pass. That removes an assertion about the key, so it is an accepted trade-off only
131
+ when the model's owner agrees; otherwise record it as a capability gap.
136
132
 
137
133
  ## What came out
138
134