@cratis/pi 7.29.0 → 7.30.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.
Files changed (64) hide show
  1. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +9 -4
  2. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +4 -2
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +3 -3
  4. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +5 -2
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +137 -0
  6. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +5 -1
  7. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +15 -16
  8. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/invocation-identity.md +4 -4
  9. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/product-sources.md +15 -0
  10. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +3 -1
  11. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +8 -9
  12. package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +1 -1
  13. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +4 -4
  14. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +2 -2
  15. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +1 -1
  16. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +2 -2
  17. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +4 -4
  18. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +7 -1
  19. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +7 -2
  20. package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +5 -3
  21. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +1 -1
  22. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +10 -11
  23. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-model-review/references/public-keys-and-routes.md +32 -0
  25. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +1 -0
  26. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +11 -0
  27. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +19 -16
  28. package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +122 -0
  29. package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +3 -0
  30. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +9 -6
  31. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +3 -3
  32. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +1 -1
  33. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +11 -0
  34. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +2 -2
  35. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +32 -9
  36. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +20 -13
  37. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +12 -10
  38. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +3 -2
  39. package/package/corpus/skills/cratis-screenplay-specifications/references/source-notes.md +16 -0
  40. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +2 -2
  41. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +2 -2
  42. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +2 -2
  43. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +1 -1
  44. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +19 -10
  45. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +12 -1
  46. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +55 -3
  47. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +7 -4
  48. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +30 -10
  49. package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +119 -0
  50. package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +8 -1
  51. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +11 -5
  52. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +813 -0
  53. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  54. package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +7 -5
  55. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +6 -6
  56. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +6 -5
  57. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +56 -28
  58. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +7 -1
  59. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +4 -3
  60. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +11 -12
  61. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +14 -3
  62. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +8 -6
  63. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +3 -1
  64. package/package.json +1 -1
@@ -0,0 +1,32 @@
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
+ # Public contracts, lookup keys and observer routes
5
+
6
+ Add these to the element sweep, with evidence pinned to the declaration:
7
+
8
+ - Does a command publish a public event, a foreign event get produced locally,
9
+ or a local public event get produced outside an explicit outbound Translate?
10
+ Check for unintended personal/secret fields in the exported contract. An outbound
11
+ slice owns exactly one local public event type and consumes private local facts.
12
+ - Is direction explicit when public metadata is used? Does an inbound translation
13
+ accept public foreign events and emit private local facts? A quoted origin is
14
+ an opaque store name with an unverified local shape, not proof of interoperability.
15
+ Read automations-and-translations `references/public-events-and-direction.md`.
16
+ - Is the view identity explicitly marked `key` or unambiguously inferred? Does each
17
+ single-instance query/read supply every part exactly once, with compatible types,
18
+ and do state fixtures contain all parts? Do PDL keys align with the view's key?
19
+ Composite view keys still refuse binding at 4.135.0 (PLAY0268, #599); compilation
20
+ is not executable evidence. Read read-surface `references/named-keys.md`.
21
+ - Does a production override replace the whole source/stream/id route, rather than
22
+ assume partial inheritance? Is its `for` destination still explicit and compatible?
23
+ Are skipped production routes valid, so eager resolution cannot fail unexpectedly?
24
+ - Does a reaction/reducer `from Source[.Stream]` include the intended producers'
25
+ effective routes? Unrouted facts never match, including capture, reaction-direct
26
+ facts and public publication. PLAY0666 is a C# warning about all *known* producers,
27
+ not proof that a handler/foreign source will deliver. Filters have no stream-id
28
+ predicate and are not projection filters. Read toolchain
29
+ `references/production-routes-and-filters.md`.
30
+
31
+ Report binding, reference execution and Stage admission separately. Never remove
32
+ public metadata, key parts or filters to make a review's mode gate pass.
@@ -3,6 +3,7 @@
3
3
  "input": "Review the marina berth .play model before we accept it: check the model and report findings, do not change anything.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "skill-contains", "value": "all *known* producers", "file": "references/public-keys-and-routes.md" },
6
7
  { "kind": "play-compiles" },
7
8
  { "kind": "skill-contains", "value": "PASS WITH WARNINGS" },
8
9
  { "kind": "skill-contains", "value": "Every finding is pinned to one declaration" },
@@ -75,6 +75,17 @@ build a read model** — two builders is error `PLAY0191`: *a projection or a
75
75
  reducer builds it, and only one of them*. A slice may still declare several
76
76
  projections, each building a **different** read model.
77
77
 
78
+ ## Public-event targets and observer filters
79
+
80
+ In an explicitly outbound Translate slice, `projection P => PublicEvent` or
81
+ `reducer P => PublicEvent` targets the slice's one local public event (ESM v9).
82
+ The projection folds one instance per event source id; opaque reducers remain
83
+ Unsupported in reference execution. Read
84
+ [public-event folds](../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md)
85
+ for publication rules and the `when append`/`then PublicEvent` specification.
86
+ A reducer can filter `from Source[.Stream]` (ESM v10); a projection cannot.
87
+ Read [observer filters](../cratis-screenplay-toolchain/references/production-routes-and-filters.md).
88
+
78
89
  ## Projection-level directives
79
90
 
80
91
  `no automap`, `sequence <name>`, `file <path>`. `sequence` is a realization
@@ -55,16 +55,19 @@ A read model declares what it **is** — nothing about what builds it. Whatever
55
55
  builds it points at it with `=>`, and **exactly one thing may**: two builders is
56
56
  error `PLAY0191`. See `cratis-screenplay-projections` for the builder side.
57
57
 
58
- Do not mark a read-model property `identifier`. The executable model infers the
59
- instance identifier from the `by` property of the keyed queries that return the
60
- read model in its own slice
61
- (`query InvoiceById => InvoiceSummary optional`, then `by invoiceId InvoiceId`
62
- on its own body line). Several queries
63
- over the same `by` property are fine; each must still have the shape the
64
- executable model admits, `=> <ReadModel> optional` with one caller-supplied `by`. A read
65
- model with no keyed query, or with keyed queries over different `by` properties,
66
- has no unambiguous identifier and does not bind (`PLAY0268`), and specifications
67
- cannot select an instance of it.
58
+ Use trailing `key` on top-level read-model properties, never `identifier`.
59
+ Explicit marks replace inference; otherwise a single-instance query's `by` supplies
60
+ identity (all such queries must agree). Only with no single-instance identifier
61
+ and an admitted list query does the binder infer an unambiguous `*Id`; queryless
62
+ read models need an explicit `key`. See named keys below for collection-key exclusions.
63
+ One explicit key binds byte-identically to equivalent inference. Several marks
64
+ form a composite key, supplied by name in query/read
65
+ `by` blocks. At Screenplay 4.135.0 composite keys and block queries remain
66
+ **authoring-only** (PLAY0268, #599); the scalar optional snapshot shape binds.
67
+ Read [named keys](references/named-keys.md) for complete examples, trigger/command
68
+ reads, all-parts fixtures, PLAY0660–0662 and command-read-only PLAY0661 repair.
69
+ A `=>` target resolving to an event is an event-target builder, not a read model;
70
+ keep event and read-model names distinct (see projections' public-event targets).
68
71
 
69
72
  ## `query`
70
73
 
@@ -79,12 +82,12 @@ query ListInvoices => InvoiceListReadModel[]
79
82
  authorize IsAuthenticated
80
83
  ```
81
84
 
82
- ⚠️ **A list query is design-only.** `=> RM[]`, `observable`, `filter`, `scoped to` and
83
- `performer` are valid model language, but neither the executable model nor Stage
84
- 4.24.0 binds or renders them (`PLAY0268`). Model them when the application needs them,
85
- and keep a list the domain needs. A keyed `XById => RM optional` query with one `by` is
86
- the shape that binds, runs in specifications and renders, but adding it beside a list
87
- does not unblock anything: while a list remains, the whole application stays unbound.
85
+ **Name the compiler and renderer.** At Screenplay 4.135.0, optional keyed queries
86
+ and collection queries bind, including `observable`, with caller-supplied `by`
87
+ or no `by` on a collection. Filters, scope, performer and context-derived `by`
88
+ remain PLAY0268. The old Stage 4.24.0 list refusal is not a current compiler
89
+ limitation; check the target renderer's admission separately. Keep a list the
90
+ domain needs rather than inventing a keyed query solely to infer identity.
88
91
 
89
92
  Return-type forms after `=>`: `ReadModel`, `ReadModel optional`, `ReadModel[]`,
90
93
  each optionally prefixed `observable`. `ReadModel[] optional` permits an absent
@@ -0,0 +1,122 @@
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
+ # Named read-model keys and complete lookups
5
+
6
+ ## Contents
7
+
8
+ - Declare identity
9
+ - Supply every part
10
+ - Specifications and executable boundary
11
+ - Repairs and evidence
12
+
13
+ ## Declare identity
14
+
15
+ A trailing `key` on a top-level read-model property declares instance identity.
16
+ One explicit mark replaces inference and binds byte-identically to the equivalent
17
+ inferred identifier. Several marks declare a composite key. At 4.135.0, identity
18
+ selection is:
19
+
20
+ 1. Explicit `key` marks take precedence over inference.
21
+ 2. Without marks, single-instance queries in the owning slice supply identity from
22
+ their `by` property; their distinct `by` names must identify one property.
23
+ 3. Only when no single-instance query supplies an identifier **and** an admitted
24
+ collection/list query exists does the binder consider conventional `*Id` names
25
+ (case-sensitive). It first excludes collection-query `by` properties: if exactly
26
+ one candidate remains, that is the identifier; otherwise it uses all `*Id`
27
+ candidates and requires exactly one. An admitted list query here is a collection
28
+ query without context-derived `by`, filters, scope or performer.
29
+
30
+ A projection-only/queryless read model needs an explicit `key`: a lone `*Id`
31
+ property alone does not infer identity. Never use the command's `identifier`
32
+ modifier on a read model.
33
+
34
+ A key part is required and noncollection; it cannot also be `optional`, `generated`,
35
+ `identifier` or `subject`. A single key may have a composite type, but parts of a
36
+ multipart key must be scalar. Declaration order is display order, not identity:
37
+ Chronicle's object keys are not ordered, encoded event stream ids.
38
+
39
+ Choose a composite key when independent coordinates identify the business view,
40
+ such as resource and reporting period. Prefer the natural single id when the view
41
+ is one entity's state. Do not concatenate parts into an invented string id merely
42
+ to pass binding; keep the truthful model and report the capability gap. Read-model
43
+ keys do not supply projection routes: align each PDL `from ... key` mapping with
44
+ the declared view identity (projection keys are a separate contract).
45
+
46
+ ## Supply every part
47
+
48
+ A scalar query keeps `by name Type` on its own body line. A composite query has a
49
+ bare `by` header and at least two distinct `name Type [from source]` children.
50
+ Do not combine scalar and block forms. A single-instance lookup must supply every
51
+ key part exactly once, with the declared types; collection queries may narrow by
52
+ a subset but still have their separate executable-query limitations.
53
+
54
+ A command or reaction trigger read uses a child `by` block of `part = source`.
55
+ Sources are required, noncollection property paths with compatible nominal types,
56
+ not literals. Trigger reads map from the trigger's declared values. The historical
57
+ single `reads View by value` form remains available for a single key.
58
+
59
+ This complete authoring-only example declares all lookup parts:
60
+
61
+ ```screenplay
62
+ concept ResourceId : Uuid
63
+ concept Period : String
64
+ module Reporting
65
+ feature Months
66
+ slice StateView Totals
67
+ readmodel ResourceMonth
68
+ resourceId ResourceId key
69
+ period Period key
70
+ hours Decimal
71
+ query FindMonth => ResourceMonth optional
72
+ by
73
+ resourceId ResourceId
74
+ period Period
75
+ slice StateChange CloseMonth
76
+ command CloseMonth
77
+ resourceId ResourceId identifier
78
+ period Period
79
+ reads ResourceMonth as totals
80
+ by
81
+ resourceId = resourceId
82
+ period = period
83
+ produces event MonthClosed
84
+ for resourceId
85
+ period Period = period
86
+ ```
87
+
88
+ Screen `data ... via query ... by value`, forms and navigation remain scalar
89
+ lookups: they cannot supply a composite single-instance key (PLAY0661). Do not
90
+ invent UI tuple syntax. Context-derived query parts do not become caller inputs;
91
+ keep tenant/subject ownership at the runtime boundary, not in editable UI filters.
92
+
93
+ ## Specifications and executable boundary
94
+
95
+ `given readmodel` and `then readmodel` state every key part (PLAY0351 if missing).
96
+ A composite absence fixture uses an object with every named part. Query result
97
+ assertions may omit keys when arguments already select the instance.
98
+
99
+ At Screenplay 4.135.0, composite read-model keys, query `by` blocks and fixtures
100
+ over those views remain authoring-only: binding reports PLAY0268 citing
101
+ Screenplay#599 (still open). They do not reference-execute or render. This is not
102
+ ESM v10 admission; v10 covers reaction identity, production routes and observer
103
+ filters. Command reads independently remain unprotected/unadmitted (PLAY0271).
104
+ A single explicit key does bind; Stage admission still depends on the complete
105
+ model and projection/query shape, not just the key modifier.
106
+
107
+ ## Repairs and evidence
108
+
109
+ - PLAY0660: fix key owner, modifier or type; no automatic repair.
110
+ - PLAY0661: supply missing parts. The typed repair covers **command reads only**
111
+ when each missing part has one same-named compatible source. It preserves
112
+ authored mappings and refuses ambiguity; queries/trigger reads are not repaired.
113
+ - PLAY0662: fix shape, duplicate/unknown parts or incompatible sources; no repair.
114
+ - Read-model property rename remains unsupported until its mapping chain can be
115
+ preserved. Use the model-authoring proposal/preview/apply contract, not a text
116
+ shortcut around an identity-preserving refusal.
117
+
118
+ Source: Screenplay `v4.135.0:Documentation/screenplay/{readmodels,queries,commands,reactions,specifications}.md`,
119
+ `fixtures/named-read-model-keys.play`, decision 0060, and
120
+ `Source/DotNET/Screenplay/Semantics/SemanticModelBinder.ReadModels.cs` (identity inference).
121
+ Its authoring delivery shipped
122
+ in 4.129.0; that release did not deliver #599's executable composite-key contract.
@@ -3,6 +3,9 @@
3
3
  "input": "Declare a Screenplay query and the screen that binds to it.",
4
4
  "fixtures": [],
5
5
  "assertions": [
6
+ { "kind": "skill-contains", "value": "query FindMonth", "file": "references/named-keys.md" },
7
+ { "kind": "skill-contains", "value": "command reads only", "file": "references/named-keys.md" },
8
+ { "kind": "skill-contains", "value": "remain authoring-only", "file": "references/named-keys.md" },
6
9
  { "kind": "play-compiles" },
7
10
  { "kind": "skill-contains", "value": "main `fd18129`" },
8
11
  { "kind": "skill-contains", "value": "filter status InvoiceStatus optional" },
@@ -25,9 +25,9 @@ Version pins live once in `cratis-screenplay-toolchain` `references/versions.md`
25
25
 
26
26
  | Source | Pin | Used for |
27
27
  | --- | --- | --- |
28
- | cratis CLI | `3.46.1` (`v3.46.1`) | Source-checked `Directory.Packages.props`: Stage 4.52.0, Screenplay 4.130.0, `Cratis.Arc.Screenplay` 22.54.0, Chronicle 19.32.0, Fundamentals 7.22.8; default runtime image `cratis/stage:4.52.0`. No new render/browser probe. UI-profile rejection (`CLI-RENDER-007` to `CLI-RENDER-010`) and render-then-recover shipped in 3.41.0 (Cratis/cli#301). Historical screens release vector: 3.40.7 (`af9f18e`) with `cratis/stage:4.51.1`. Reading baselines: 3.40.3, 3.39.0 and 3.28.3 (`8b43fef`) |
29
- | Stage | `4.52.0` (CLI 3.46.1 default) | Executed on CLI 3.43.0. Admission (`STAGE-ESM-*`, and `PLAY0268` render refusals surfaced by the CLI), ownership manifest, `Customizations/` seams, Debug-only specifications, guarded actions (`STAGE-SCENE-ACTION-001`) and interactions (`STAGE-SCENE-INTERACTION-001`) were source-checked at 4.51.3. Older baselines: 4.49.5, 4.43.0 and `v4.24.2` (`32dcac4`) |
30
- | Screenplay | bundled `4.130.0`; standalone `4.131.0` | Standalone compiler for V1 to V3; binding codes `PLAY0268` and code-attachment rules were read at `v4.66.0`. Historical CLI 3.41.0 probes used bundled 4.114.0; current `cratis` compiler claims require checking 4.130.0 |
28
+ | cratis CLI | `3.50.0` (`v3.50.0`) | Source-checked `Directory.Packages.props`: Stage 4.67.0, Screenplay 4.131.0, `Cratis.Arc.Screenplay` 22.54.0, Chronicle 19.32.0, Fundamentals 7.22.8; default runtime image `cratis/stage:4.67.0`. Previous CLI 3.46.1 used Stage 4.52.0/Screenplay 4.130.0. No new render/browser probe. UI-profile rejection (`CLI-RENDER-007` to `CLI-RENDER-010`) and render-then-recover shipped in 3.41.0 (Cratis/cli#301). Historical screens release vector: 3.40.7 (`af9f18e`) with `cratis/stage:4.51.1`. Reading baselines: 3.40.3, 3.39.0 and 3.28.3 (`8b43fef`) |
29
+ | Stage | `4.67.0` (CLI 3.50.0 default) | Source-checked, not executed as a new vector. Previous Stage 4.52.0 was executed on CLI 3.43.0. Admission (`STAGE-ESM-*`, and `PLAY0268` render refusals surfaced by the CLI), ownership manifest, `Customizations/` seams, Debug-only specifications, guarded actions (`STAGE-SCENE-ACTION-001`) and interactions (`STAGE-SCENE-INTERACTION-001`) were source-checked at 4.51.3. Older baselines: 4.49.5, 4.43.0 and `v4.24.2` (`32dcac4`) |
30
+ | Screenplay | bundled `4.131.0`; standalone `4.135.0` | Standalone compiler for V1 to V3; binding codes `PLAY0268` and code-attachment rules were read at `v4.66.0`. Historical CLI 3.41.0 probes used bundled 4.114.0; current `cratis` compiler claims require checking 4.131.0 |
31
31
  | Rendered apps (historical check) | Arc `22.50.5`, Chronicle `19.32.0`, Scene packages | Stage 4.51.3 scaffold; `[ProtectedDecision]` / `DecisionRead<T>` available to gap-fill, not emitted enforcement. Embedded reverse extraction disabled; verify generated packages before claiming exact Scene runtime parity |
32
32
 
33
33
  Historical facts retain their checked tags; current pins are source-checked, not new runtime probes.
@@ -77,9 +77,12 @@ the model, hand-write the command and its response with the model (and its fixtu
77
77
  specifications) as the contract, and report V3 from the standalone tool and V5 as `not run: no render`.
78
78
 
79
79
  Models with event sources, streams or command routes bind and reference-execute as ESM v8 on standalone
80
- Screenplay 4.125.0, so report V3 and V4 from that tool. They are still case A or C for rendering: current CLI 3.46.1
81
- refuses models above ESM v7 with `CLI-RENDER-004`, so hand-write the code with the model as the
82
- contract (`cratis-screenplay-toolchain` `references/sources-and-streams.md`).
80
+ Screenplay 4.125.0, so report V3 and V4 from that tool. Previous CLI 3.46.1 refused above v7 with CLI-RENDER-004. Current CLI 3.50.0/Stage
81
+ 4.67.0 reaches v8 route checks and construct admission through v10. Public publication,
82
+ foreign events/event captures and v10 reaction identity/filters/production overrides
83
+ still receive typed refusals; reducer filters render. Keep refused scope as case A/C,
84
+ never infer target support from binding. Read Stage's `references/admission.md` and
85
+ toolchain `references/sources-and-streams.md`.
83
86
 
84
87
  Two rules hold in every case: a customization never makes a rejected model renderable, and
85
88
  a whole-application V5 is never claimed from a subset. The CLI renders whole applications
@@ -77,9 +77,9 @@ not bind a modeled reaction or capture. Case C (no generated application): there
77
77
  composition conventions (`rules/vertical-slices.md`, `cratis-chronicle-reactor`).
78
78
  Declare the trusted actor with reaction `runs as system role "<Role>"`
79
79
  (standalone 4.125.0, ESM v10); `given caller` is not an invocation actor.
80
- Historical CLI 3.41.0's older compiler rejected the syntax. Current CLI 3.46.1
81
- bundles Screenplay 4.130.0 / Stage 4.52.0 but still admits through v7 only
82
- (CLI-RENDER-004 for v10). Gap-fill retains the declared role and uses Arc
80
+ Historical CLI 3.41.0's older compiler rejected the syntax. CLI 3.50.0/Stage 4.67.0
81
+ reaches v10 construct admission but still refuses reaction identity
82
+ (STAGE-ESM-034); previous CLI 3.46.1 admitted through v7 only. Gap-fill retains the declared role and uses Arc
83
83
  `[ExecuteCommandsAsSystem]` for returned commands. Checked model and diagnostics:
84
84
  captures-and-reactions `references/invocation-identity.md`.
85
85
 
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "kind": "skill-contains",
41
- "value": "case A or C for rendering"
41
+ "value": "Keep refused scope as case A/C"
42
42
  },
43
43
  {
44
44
  "kind": "skill-contains",
@@ -175,6 +175,17 @@ target requirements.
175
175
  - After a correction or backdated fact, does the view still say something true?
176
176
  - Cross-context views: are the real source contracts resolved, or is missing evidence a gap?
177
177
 
178
+ ## Public-event coverage (ESM v9)
179
+
180
+ Outbound publication needs `when append <private>` and `then <PublicEvent>`:
181
+ complete state, incomplete state, unchanged repeat, changed instance, separate
182
+ source ids and the exported field boundary. Reference publication is executable;
183
+ source-event captures and reached opaque event-target reducers are typed
184
+ Unsupported. Read automations-and-translations `references/public-events-and-direction.md`.
185
+ For routed producers/observers, cover override versus inherited route, skipped
186
+ production route failure, matching/wrong source/stream and unrouted facts;
187
+ see toolchain `references/production-routes-and-filters.md`.
188
+
178
189
  ## Version skew: reaction cascades and false PLAY0285
179
190
  Under ESM v6 a command spec's `then` lists the events reactions cascade from it. The compiler
180
191
  bundled in `cratis` before 3.28.2 (Screenplay 4.60.1) reported a **false PLAY0285** for such
@@ -5,7 +5,7 @@ The subsets themselves (what binds, what renders) are owned by `cratis-screenpla
5
5
  says what that means for writing specs. A form outside the chosen mode is never deleted from a
6
6
  design model: keep it and record the gap. The detailed Stage 4.24.x rows below
7
7
  retain historical admission evidence; current pins are standalone Screenplay
8
- 4.131.0 / CLI 3.46.1 (Screenplay 4.130.0 / Stage 4.52.0). Run actual target admission instead of assuming old restrictions carry over.
8
+ 4.135.0 / CLI 3.50.0 (Screenplay 4.131.0 / Stage 4.67.0). Run actual target admission instead of assuming old restrictions carry over.
9
9
  Typed example/override forms: `cratis-screenplay-specifications`
10
10
  `references/examples-and-routes.md`.
11
11
 
@@ -23,7 +23,7 @@ Typed example/override forms: `cratis-screenplay-specifications`
23
23
  | Command spec listing reaction cascade events | yes (v6 semantics) | false PLAY0285 on a cratis before 3.28.2 bundle only; see SKILL.md "Version skew" | no (no reactions) |
24
24
  | `generated <name> = <value>` under `when`, `then returns` (ESM v7) | yes | yes on standalone Screenplay 4.68.0 or later; not on the 4.66.0 bundled in cratis 3.28.x (`PLAY0268`) | historically no at Stage 4.24.x; check current target admission |
25
25
  | `then events in any order` | yes | yes | yes |
26
- | Event `stream` / `no stream`, typed `for` and stream ids | yes | ESM v8 at 4.125.0 | CLI 3.46.1 refuses models above v7 before planning |
26
+ | Event `stream` / `no stream`, typed `for` and stream ids | yes | ESM v8 at 4.125.0 | CLI 3.50.0 reaches Stage route checks; routed read-model/query replay can still refuse STAGE-ESM-030 |
27
27
  | Typed examples and overrides | yes | expanded and type-checked before binding; required fields remain required | depends on expanded contract, not fixture reuse |
28
28
  | `given operation ... fails`, `then operation`, `then compensated` | yes | unadmitted PLAY0268 | gap-fill |
29
29
  | Refusal branches, `when redelivered`, `then no events` | yes | unadmitted PLAY0268 | gap-fill |
@@ -113,10 +113,14 @@ report and slice `documentation`, and continue.
113
113
  slice is `read model -> screen -> command -> event`. Pick the builder (declarative projection first, reducer when
114
114
  guards cannot be expressed). The query follows the business view: a list where people scan a
115
115
  list, a keyed lookup where they open one thing. For **executable or renderable scope**, every
116
- read model also needs one unambiguous key: keyed queries `query XById => RM optional` all
117
- using the same `by xId XId`. The identifier always equals the projection's effective key;
118
- the decision table is in `references/read-model-design.md` and the full rule in
119
- `cratis-stage-rendering-and-sandbox` `references/admission.md`. Keep the list query in design mode and record that it blocks V3.
116
+ read model needs one unambiguous identity: explicit trailing `key` first, else
117
+ single-instance queries agreeing on `by xId XId`, else conventional `*Id` inference
118
+ only with an admitted list query and no single-instance identifier. Queryless views
119
+ need explicit `key`; read-surface `references/named-keys.md` gives the exact fallback.
120
+ The identifier equals the projection's effective key (decision table in
121
+ `references/read-model-design.md`; Stage rule in `references/admission.md` of
122
+ `cratis-stage-rendering-and-sandbox`). Collections and observable delivery bind at
123
+ 4.135.0; check renderer admission separately.
120
124
  Whose rows is part of the view; a caller-supplied filter is not access control.
121
125
  7. **Screens, Level 1.** `data <RM> via query <Q>` plus `action <Command>` per thing the user
122
126
  can do there. Build each slice as read model, screen, command, event. A screen acting on an
@@ -149,11 +153,13 @@ report and slice `documentation`, and continue.
149
153
  ### Compiler contracts (the tool enforces these)
150
154
 
151
155
  - At most one `identifier` per command; never on an event property; never on a read-model
152
- property (identity comes from the keyed query's `by`).
156
+ property (use `key`; otherwise identity comes from single-instance `by`, or
157
+ conventional `*Id` only with an admitted list query and no single-instance identifier).
158
+ Queryless read models need explicit `key`.
153
159
  - At most one builder (projection or reducer) per read model (`PLAY0191`).
154
- - A query's `by` goes on its own body line. Only `=> RM optional` with one caller-supplied `by`
155
- binds in the executable model; list, observable, filtered or scoped queries are `PLAY0268` at
156
- binding but compile.
160
+ - A query's `by` goes on its own body line. At 4.135.0, optional keyed and collection
161
+ queries bind, including observable delivery; scalar `by` must be caller-supplied.
162
+ Filtered, scoped, performer-backed and composite-block queries remain `PLAY0268`.
157
163
  - A `unique` constraint names a property the event declares directly; the constraint name is
158
164
  its identity (renaming starts an empty index).
159
165
  - Unauthorized is `then denied`; a broken rule is `then error`; authorization runs first.
@@ -181,6 +187,21 @@ report and slice `documentation`, and continue.
181
187
  Ask `references/review-questions.md` (reachability, forms in disguise, secrets, fan-in,
182
188
  collections, invariants, who sees which rows); report a finding only with a domain consequence.
183
189
 
190
+ ## Public boundaries and view identity
191
+
192
+ Translate crosses an application boundary: inbound consumes foreign public events
193
+ or data and produces private facts; outbound folds private facts into exactly one
194
+ local public event type. Commands never publish public events. Put direction in
195
+ the slice outline and trace every exported field; read automations-and-translations
196
+ `references/public-events-and-direction.md` for the released ESM v9 contract.
197
+
198
+ Mark view identity with trailing `key`. Use a composite key for independent view
199
+ coordinates (resource + period), a natural single id for one entity's state.
200
+ Supply every named part in single-instance queries and command/trigger reads;
201
+ see read-surface `references/named-keys.md`. Composite view keys remain
202
+ unadmitted at 4.135.0 (PLAY0268, #599), unlike admitted composite stream routes.
203
+ Keep the true identity and report the gap rather than inventing a concatenated id.
204
+
184
205
  ## Identity-affecting edits on an existing model
185
206
 
186
207
  Classify an edit by whether it changes catalog addresses. When `.screenplay/identities.json`
@@ -203,7 +224,9 @@ Slice design is done when these hold; otherwise report what is open.
203
224
  - [ ] Every command has a refusal inventory (success, each refusal with layer and message,
204
225
  denied persona); every gated command and query has a `then denied` row.
205
226
  - [ ] Every event is past tense, a specific change, and consumed or justified.
206
- - [ ] Every read model has a consumer and, when the scope is executable, one unambiguous key (keyed queries all using the same `by` property).
227
+ - [ ] Every read model has a consumer and, for executable scope, one identity: explicit
228
+ `key`, else agreeing single-instance `by`, else unambiguous `*Id` only with an
229
+ admitted list query and no single-instance identifier. Queryless views use `key`.
207
230
  - [ ] Every StateView's `documentation` gives a reason per contributing event; every read-model
208
231
  field and screen field is traced; every `from` event sets a field.
209
232
  - [ ] No `screen` without `data` or `action`; every acting screen has `data` or a stated
@@ -118,21 +118,27 @@ it stays.
118
118
 
119
119
  | The person... | Design-mode query | Executable/renderable scope |
120
120
  |---|---|---|
121
- | opens one thing | `XById => RM optional` + `by xId XId` | same (the only shape that binds today) |
122
- | scans a list | `ListX => RM[]` (optionally `observable`, `filter`) | keep the list for design; add the keyed query; record V3 blocked by the list |
123
- | sees their own rows | list with scope/`from` on the caller | as above; access rules are part of the view, enforced by the target |
121
+ | opens one thing | `XById => RM optional` + `by xId XId` | binds at 4.135.0 with caller-supplied `by`; check target renderer |
122
+ | scans a list | `ListX => RM[]` (optionally `observable`, `filter`) | collection and observable delivery bind at 4.135.0; filters remain PLAY0268; check target renderer |
123
+ | sees their own rows | list with scope/`from` on the caller | scope and context-derived `by` remain PLAY0268; access rules are part of the view, enforced by the target |
124
124
  | sees a site-wide figure | singleton read model, `from <Event> key literal "global"` on every `from` (a projection-level `key` routes nothing, PLAY0381; example in Screenplay `projections/keys.md`, "Literal keys") | check the binding (V3, `cratis-screenplay-toolchain`) |
125
125
 
126
126
  - `observable` when people are expected to see others' or automation's changes while looking
127
- (worklists, status awaiting an outside answer); one-shot otherwise. Design mode only
128
- (PLAY0268). If access can be revoked mid-session, record that the target re-checks per emission.
127
+ (worklists, status awaiting an outside answer); one-shot otherwise. Observable delivery
128
+ binds at 4.135.0; renderer support is separate. If access can be revoked mid-session,
129
+ record that the target re-checks per emission.
129
130
  - Never model paging or page size (no syntax, Screenplay#140). State the order in the query
130
131
  `description` ("oldest first"; queries do not accept `documentation`); an unbounded list is a review question.
131
132
  - A gated keyed query needs its own denial spec.
132
133
 
133
- Never drop a list query from a design model just to make it bind; record the capability gap.
134
- The keyed query also defines the read model's identity: its `by` property must be a read-model
135
- property. The identifier always equals the projection's effective key:
134
+ Never drop a business-required list query to satisfy an old compiler or renderer;
135
+ record any actual capability gap. At 4.135.0, explicit trailing `key` takes precedence
136
+ for read-model identity. Otherwise single-instance queries in the owning slice must
137
+ agree on one `by` property declared on the read model. Only with no single-instance
138
+ identifier and an admitted collection/list query does conventional `*Id` inference
139
+ run; queryless views need explicit `key`. The fallback excludes collection-query key
140
+ candidates when that leaves one identifier (full algorithm: read-surface
141
+ `references/named-keys.md`). The identifier equals the projection's effective key:
136
142
 
137
143
  | Effective key | Executable model | Renderable model (Stage) |
138
144
  |---|---|---|
@@ -182,8 +188,8 @@ has children, not a single value.
182
188
  If a view must stop showing cancelled items, use `remove with <Event>` and pin it with
183
189
  `then no readmodel <RM> for "<key>"`. If it keeps them, map a status literal from that event
184
190
  instead. The slice `description`, the projection and every spec of the view must agree.
185
- A complete example (marina berths; the `then no readmodel` assertion needs the keyed
186
- query, which is why the view has one):
191
+ A complete example (marina berths; the keyed query supplies the view's identity
192
+ for the `then no readmodel` assertion; explicit `key` could supply it instead):
187
193
 
188
194
  ```screenplay
189
195
  domain Harbourlight.Berths
@@ -277,7 +283,8 @@ module Berths
277
283
  - Every consumer that needs state has its read model (a blank creation form and a direct reaction
278
284
  with a documented no-pending-work reason need none); every read model has a consumer.
279
285
  - Every field traced (`field-lineage.md`).
280
- - Executable/renderable scope: one unambiguous key per read model (one or more keyed queries,
281
- all with the same `by` property), identifier equal to the projection's key (table above);
282
- no list queries.
286
+ - Executable scope: one identity per read model: explicit `key`, else agreeing
287
+ single-instance `by`, else unambiguous `*Id` only with an admitted list query and
288
+ no single-instance identifier. Queryless views need explicit `key`. The identifier
289
+ equals the projection's key (table above); check target renderer admission separately.
283
290
  - Design-only shapes listed with the V3 code they cause.
@@ -26,16 +26,9 @@ source is the single flow model.
26
26
 
27
27
  ## Verified product sources
28
28
 
29
- | Package | Version | Purpose |
30
- | --- | --- | --- |
31
- | `Cratis.Screenplay` | `4.31.0` | Original parser, binder and reference execution evidence |
32
- | `Cratis.Screenplay` | main `fd18129` | Inline facts, `optional` and clock spelling; changed examples compiled |
33
- | `Cratis.Screenplay` | `4.68.0` (`79801bf`) | ESM v7 generated fixtures and `then returns` (decision 0026, `specifications.md` "Generated fixtures and return expectations"): the excerpt matches the compiled example in `cratis-screenplay-toolchain`, whose specifications run in the reference runner |
34
- | `Cratis.Screenplay` | `4.66.0` (`c89198b`) | ESM v6 specification actions and reaction cascades, `then no readmodel`, `$strings` rejections, `invokes` caller rule; probed with the standalone tool and its MCP server |
29
+ Retained inline-fact update evidence: [source notes](references/source-notes.md).
35
30
 
36
- The update follows `commands.md`, `events.md`, `types.md` and
37
- `specifications.md` at that main commit (after v4.52.0). This pass compiles the
38
- changed examples; it does not rerun the reference runner.
31
+ The historical parser/binder/reference-runner version table is in the source notes.
39
32
 
40
33
  Specification syntax was checked against Screenplay v4.127.0 `specifications.md`;
41
34
  older probes in the table remain historical. Pins: `cratis-screenplay-toolchain`
@@ -207,6 +200,15 @@ Read [references/actions-beyond-commands.md](references/actions-beyond-commands.
207
200
  From ESM v6 every action sets reactions off and `then` events compare every new fact, the action's and the reactions'. A specification whose action is a command goes in the slice that declares the command. A false `PLAY0285` on a cascade under `cratis` before 3.28.2 is tool skew, not a modeling error: never delete the `then` line to silence it.
208
201
  Read [references/reactions-and-cascades.md](references/reactions-and-cascades.md) when a specification's expected events include what a reaction appends, when a cascade, clock tick or invoked command is involved, or when `cratis` reports `PLAY0285` on a model that `screenplay` accepts (it holds the "Version skew: cascades and the false `PLAY0285` (cratis before 3.28.2)" section).
209
202
 
203
+ ## Published-event specifications (released ESM v9)
204
+
205
+ Use `when append <PrivateEvent>` then `then <PublicEvent>` for outbound publication,
206
+ not `then readmodel`. The follow-up event list is exhaustive and ordered. Read
207
+ [publication example and fold cases](../cratis-screenplay-automations-and-translations/references/public-events-and-direction.md).
208
+ Events-source captures and reached opaque event-target reducers return typed
209
+ Unsupported, not a pass. Composite view fixtures need every key part but remain
210
+ unadmitted (PLAY0268, #599); see read-surface `references/named-keys.md`.
211
+
210
212
  ## Reusable fixtures, routes and recovery intent
211
213
 
212
214
  Use typed `example` declarations for repeated event/command/read-model values;
@@ -278,7 +280,7 @@ For view specifications:
278
280
  ## Verify
279
281
 
280
282
  - [ ] Validate the complete root with warnings as errors, naming tool/version.
281
- Current standalone pin: 4.131.0. Run specification examples through
283
+ Current standalone pin: 4.135.0. Run specification examples through
282
284
  `screenplay test`; expected unadmitted syntax reports unbound, not passed.
283
285
  - [ ] Executable diagnostics are clean too: `PLAY0350`, `PLAY0352`, `PLAY0388`,
284
286
  `PLAY0389` and `PLAY0273` are only reported at binding.
@@ -94,8 +94,9 @@ so UUID casing is immaterial. Composite mappings supply each named part once,
94
94
  using literals only; encoding escapes `%`/`|` and preserves declaration order.
95
95
  Source: v4.127.0 `event-sources.md`, `specifications.md`, `diagnostics.md`.
96
96
 
97
- CLI 3.46.1 rendering rejects versions above v7 before planning, even though
98
- source compilation and reference routing pass.
97
+ Previous CLI 3.46.1 refused above v7; CLI 3.50.0/Stage 4.67.0 reaches route
98
+ checks through v10. Routed read-model/query replay can still refuse
99
+ STAGE-ESM-030. Source/reference success never establishes target parity.
99
100
 
100
101
  Command and read-model examples refuse routes (PLAY0526). Effective role and
101
102
  `for` checks use the inherited or replaced route: inherited `no stream` on a
@@ -0,0 +1,16 @@
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
+ # Retained source notes
5
+
6
+ | Package | Version | Purpose |
7
+ | --- | --- | --- |
8
+ | `Cratis.Screenplay` | `4.31.0` | Original parser, binder and reference execution evidence |
9
+ | `Cratis.Screenplay` | main `fd18129` | Inline facts, `optional` and clock spelling; changed examples compiled |
10
+ | `Cratis.Screenplay` | `4.68.0` (`79801bf`) | ESM v7 generated fixtures and `then returns` (decision 0026, `specifications.md` "Generated fixtures and return expectations"): the excerpt matches the compiled example in `cratis-screenplay-toolchain`, whose specifications run in the reference runner |
11
+ | `Cratis.Screenplay` | `4.66.0` (`c89198b`) | ESM v6 specification actions and reaction cascades, `then no readmodel`, `$strings` rejections, `invokes` caller rule; probed with the standalone tool and its MCP server |
12
+
13
+ The inline-facts update followed `commands.md`, `events.md`, `types.md` and
14
+ `specifications.md` at main `fd18129` (after v4.52.0). That pass compiled the
15
+ changed examples; it did not rerun the reference runner. Keep this historical
16
+ source evidence distinct from the current source-check gate and V4 execution.
@@ -6,12 +6,12 @@
6
6
  { "kind": "play-compiles" },
7
7
  {
8
8
  "kind": "skill-contains",
9
- "value": "main `fd18129`"
9
+ "value": "main `fd18129`", "file": "references/source-notes.md"
10
10
  },
11
11
  { "kind": "skill-contains", "value": "Generated fixtures and return expectations (ESM v7)" },
12
12
  { "kind": "skill-contains", "value": "`then returns` counts as a success outcome but does not relax event comparison", "file": "references/generated-fixtures.md" },
13
13
  { "kind": "skill-contains", "value": "`Unsupported(IdentityAllocation)`", "file": "references/generated-fixtures.md" },
14
- { "kind": "skill-contains", "value": "4.68.0" },
14
+ { "kind": "skill-contains", "value": "4.68.0", "file": "references/source-notes.md" },
15
15
  {
16
16
  "kind": "skill-contains",
17
17
  "value": "Inline events are ordinary named facts", "file": "references/worked-example.md"
@@ -88,8 +88,8 @@ option, mark it `ASSUMED` in the slice or module `documentation` and in the sess
88
88
  namespace, process-stream routing and concurrency scope apart
89
89
  (`references/chronicle-boundaries.md`). Declared `eventsource`/`stream`/`streamId` and
90
90
  command/specification routes bind and reference-execute as ESM v8 on 4.125.0.
91
- CLI 3.46.1 rendering admits through v7 only (CLI-RENDER-004); keep the routing
92
- contract and gap-fill its target realization. Forms/boundaries:
91
+ CLI 3.50.0 reaches Stage construct checks through v10; keep the routing
92
+ contract when target admission requires gap-fill. Forms/boundaries:
93
93
  toolchain `references/sources-and-streams.md`. A `generated identifier` (ESM v7, standalone 4.68.0; not rendered by Stage yet) is
94
94
  generated fresh on every acceptance: it is not a retry identity, and generated values give no
95
95
  idempotency, retry or deduplication guarantee. When a retry must find the same stream, the caller
@@ -216,8 +216,8 @@ Some event stores decide consistency by a query over tagged events instead of on
216
216
  check to event types, source type or stream (`concurrency` block, Screenplay
217
217
  `commands.md`). Legacy concurrency metadata still fails binding (PLAY0271),
218
218
  but sources/streams/routes bind and reference-execute as ESM v8 on 4.125.0.
219
- Route admission does not make a view read protected. CLI 3.46.1's render boundary
220
- is v7; see toolchain `references/versions.md`. Model the stream by business
219
+ Route admission does not make a view read protected. CLI 3.50.0 reaches Stage construct checks
220
+ through v10; see toolchain `references/versions.md`. Model the stream by business
221
221
  identity; when a rule truly needs a cross-stream decision, record it (see
222
222
  `consistency-and-concurrency.md`) rather than inventing a construct.
223
223
 
@@ -16,6 +16,6 @@
16
16
  { "kind": "skill-contains", "value": "bind and reference-execute as ESM v8" },
17
17
  { "kind": "skill-contains", "value": "STAGE-ESM-026" },
18
18
  { "kind": "skill-contains", "value": "generated values give no\n idempotency, retry or deduplication guarantee" },
19
- { "kind": "skill-contains", "value": "CLI-RENDER-004" }
19
+ { "kind": "skill-contains", "value": "Stage construct checks through v10" }
20
20
  ]
21
21
  }