@cratis/pi 7.64.0 → 7.66.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 (47) hide show
  1. package/package/corpus/product-sync.json +4 -4
  2. package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +16 -3
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +2 -1
  4. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +3 -1
  5. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +2 -1
  6. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +30 -0
  7. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +15 -5
  8. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +2 -2
  9. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +1 -1
  10. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +14 -2
  11. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +1 -1
  12. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +2 -2
  13. package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +13 -0
  14. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
  15. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +1 -1
  16. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
  17. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  18. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -2
  19. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +3 -1
  20. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -1
  21. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +1 -1
  22. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +1 -1
  23. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +1 -1
  25. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +1 -1
  26. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +1 -1
  27. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +3 -2
  28. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +1 -1
  29. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +7 -0
  30. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +26 -2
  31. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +5 -3
  32. package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +2 -1
  33. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +4 -2
  34. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +308 -0
  35. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  36. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +1 -1
  37. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +4 -3
  38. package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md +1 -1
  39. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +1 -1
  40. package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +124 -2
  41. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +25 -0
  42. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +12 -4
  43. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +5 -3
  44. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +41 -1
  45. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +32 -1
  46. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/scene-runtime.md +10 -0
  47. package/package.json +1 -1
@@ -21,7 +21,8 @@ Requires cratis CLI ≥ 3.57 (`cratis --version`) to render ESM v14 and v15 mode
21
21
 
22
22
  Read [language admission](../cratis-screenplay-toolchain/references/language-admission.md)
23
23
  for v22–v25: text rules render, atomic batches/protected reads/described bodies do
24
- not. Stub mode emits no described-body stubs. Keep protection and report refusal.
24
+ not. The semantic Host and specification runner execute admitted protected reads;
25
+ that is not rendering. Stub mode emits no described-body stubs. Keep protection and report refusal.
25
26
 
26
27
  ## When to use
27
28
 
@@ -128,7 +129,7 @@ One blocker publishes nothing. Codes, limits and fixes: [references/admission.md
128
129
  (`-032`/`-033`), claim-reading/opaque `runs as` gates (`-034`), legacy filters (`-035`), production
129
130
  overrides (`-036`), code validation (`-005`), DateTime filters (`-010`),
130
131
  unsupported conditional productions, composite projection keys and unsupported `all` shapes.
131
- Protected reads refuse `STAGE-ESM-044`, described handlers `STAGE-IMPL-002`
132
+ The Cratis C# renderer refuses protected reads with `STAGE-ESM-044`, described handlers `STAGE-IMPL-002`
132
133
  (even Stub mode), and atomic mode in admitted pairs `STAGE-ESM-043`.
133
134
  - **Binding refusals (`PLAY0268`/`PLAY0271`):** legacy reads, `concurrency`, attached
134
135
  handlers, context/single-result filters, opaque scope/performer, composite `by`,
@@ -159,7 +160,8 @@ files, a policy registration and generated policies, `Common/<Concept>.cs`, one
159
160
  the `[EventType]` event, the validator and the `[ReadModel]` with its query, `scene.json`,
160
161
  and a React/Vite frontend scaffold (`.frontend/`, `package.json`, `tsconfig.json`,
161
162
  `.gitignore`). Per-file detail, the scaffold's dependency set and the `Customizations/`
162
- contract: [references/rendered-application.md](references/rendered-application.md). Scene
163
+ contract, including the opt-in self-reducing layout for confirmed new Cratis C# applications:
164
+ [references/rendered-application.md](references/rendered-application.md). Scene
163
165
  package ids, host capabilities and the boundary from hand-built Components pages:
164
166
  [references/scene-runtime.md](references/scene-runtime.md). A complete renderable model:
165
167
  [references/render-example.md](references/render-example.md).
@@ -190,7 +192,13 @@ disposable runtime**, not a generated application. The default engine appends mo
190
192
  simple literal `validate` rules on top-level properties, but enforces no other rule, no
191
193
  constraint and no command or query authorization; `Stage__Runtime__Engine=semantic` opts
192
194
  in to an engine that does, and refuses what it cannot execute (HTTP 501). The default engine
193
- also refuses routed models (`STAGE-ESM-030`). Callers are built from unsigned headers, so
195
+ also refuses routed models (`STAGE-ESM-030`) and protected reads (`STAGE-ESM-044`).
196
+ Requires Stage 4.129.0 for semantic Host/runner protected reads; older engines refuse
197
+ `STAGE-ESM-044`. Required absence rejects before requirements/generation, read properties
198
+ feed requirements and productions, and non-Error protected requirements refuse
199
+ `STAGE-ESM-045`, including reaction invocations. The Host faults on any outside append,
200
+ even unrelated facts; this is stricter than reference dependency-scoped conflicts.
201
+ Callers are built from unsigned headers, so
194
202
  authorization there is not a security boundary.
195
203
 
196
204
  `cratis/stage-specrunner` checks modeled specifications and writes a results file. The
@@ -29,10 +29,11 @@ Requires Stage 4.119.0 for pattern/random rendering, Host generation and indepen
29
29
  opaque/unsupported rules refuse -005 before pin evaluation. Independent execution
30
30
  always needs pins.
31
31
  Requires Stage 4.124.0 for v24 text-rule admission (`cratis --version` identifies the CLI bundle); older renderers refuse v24 with STAGE-ESM-016.
32
- Requires Stage 4.127.0 for v25 version admission; older renderers refuse v25 with STAGE-ESM-016. Protected reads still refuse STAGE-ESM-044.
32
+ Requires Stage 4.127.0 for v25 version admission; older renderers refuse v25 with STAGE-ESM-016. The Cratis C# renderer still refuses protected reads with STAGE-ESM-044.
33
+ Requires Stage 4.129.0 for semantic Host/executor protected reads; older engines refuse STAGE-ESM-044. Required absence rejects before requirements or generation; read-backed requirements and produced-event mappings execute. Non-Error protected requirements refuse STAGE-ESM-045, including reaction invocations. See [sandbox boundaries](sandbox-and-specrunner.md#protected-command-reads) for ordering and the Host's stricter outside-append fault boundary.
33
34
  Described handlers refuse STAGE-IMPL-002, even Stub mode; atomic mode in an
34
35
  admitted pair refuses STAGE-ESM-043. Version admission never implements a body,
35
- batch or protected decision. Chronological Date/DateTime command comparisons
36
+ batch or rendered protected decision. Chronological Date/DateTime command comparisons
36
37
  select v26 in Screenplay but still refuse STAGE-ESM-016 here; standalone reference
37
38
  success is not rendering or Host/executor admission. Keep the date rule and use
38
39
  authorized gap-fill rather than downgrading to ordinal text or millisecond precision.
@@ -162,7 +163,8 @@ Requires Stage 4.90.0 for snapshot/live lists, 4.96.0 for non-text secrets and 4
162
163
  | `STAGE-ESM-041` | Older renderers refuse non-text secrets; supported renderers keep their original types | Keep classification; upgrade the renderer, never declassify |
163
164
  | `STAGE-ESM-042` | Unknown validation rule kinds; checksum on the legacy syntax path (semantic checksum renders) | Keep the rule; use an admitting semantic renderer or gap-fill |
164
165
  | `STAGE-ESM-043` | `reaction batches atomic` in an admitted version pair | Keep the batch boundary; gap-fill without splitting it |
165
- | `STAGE-ESM-044` | Protected-read preamble, command reads or read-backed conditions/mappings in renderer, Host or specification executor | Keep protection; gap-fill with independently verified target enforcement |
166
+ | `STAGE-ESM-044` | Protected-read preamble, command reads or read-backed conditions/mappings in the Cratis C# renderer; legacy Host/structural runner also refuse the preamble | Keep protection; semantic Host/executor support is separate from generated-app enforcement |
167
+ | `STAGE-ESM-045` | Non-Error requirement on a protected command, including reaction-invoked commands; semantic admission refuses before reads, requirements or facts | Keep the severity contract; record the execution gap, never silently promote or drop the requirement |
166
168
  | `STAGE-IMPL-002` | Described command handler, naming command and RequirementId; also refused in Stub mode | Supply authorized implementation outside rendering; no generated stub is emitted |
167
169
  | `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 |
168
170
  | `STAGE-ESM-023` | Information: transition bodies analysed | none |
@@ -3,6 +3,7 @@
3
3
  ## Contents
4
4
 
5
5
  - Scaffold
6
+ - Reducer layout for new applications
6
7
  - What is managed
7
8
  - `Customizations/` (unmanaged)
8
9
  - Re-render checklist
@@ -35,13 +36,52 @@ Consequences: `[ProtectedDecision]` (`Cratis.Arc.Chronicle.ReadModels`) and
35
36
  in the scaffold's package set, as is `[ExecuteCommandsAsSystem]`. This is API
36
37
  availability, not Stage emission or runtime protection: gap-fill must opt into
37
38
  the protected command profile and enroll an admitted projection/key read in the
38
- active unit of work. Stage does not turn `.play` `reads`/`require` into protected decisions.
39
+ active unit of work. The Cratis C# renderer does not turn `.play` `reads`/`require` into protected decisions;
40
+ semantic Host/executor support is separate from generated-application protection.
39
41
  Hand-written scope that needs a newer dependency can raise its version through
40
42
  `Customizations/Dependencies.props` (explicit `Version`, imported last; central management
41
43
  is off), but any override must be proven with a restore and build. The compose file binds local ports `27017` and
42
44
  `35000`, keeps data in the named volumes `chronicle-data` and `chronicle-config`, and
43
45
  `docker compose down --volumes` is the only thing that deletes them.
44
46
 
47
+ ## Reducer layout for new applications
48
+
49
+ Requires Stage 4.128.0 for the Cratis C# self-reducing profile; older renderers emit
50
+ separate `IReducerFor<T>` classes. Existing `CreateProfile` callers remain classic;
51
+ a missing destination/configuration file does not identify a new application.
52
+ For a **confirmed new application**, artifact-planning hosts opt in explicitly:
53
+
54
+ ```csharp excerpt
55
+ var profile = CratisRendering.CreateNewApplicationProfile(
56
+ "Shop", new("Shop.Backend", "Acme.Shop"));
57
+ ```
58
+
59
+ This API is in `Cratis.Stage.Rendering.Cratis`. Pass the profile to scaffold and
60
+ artifact planning through `CratisPlanOptions.Profile`. The scaffold persists
61
+ `.cratis/stage/rendering.json` with exactly
62
+ `{"version":1,"application":"Shop","reducerConvention":"self"}`. On later renders,
63
+ the host reads that file and restores the input; Stage does not search the destination:
64
+
65
+ ```csharp excerpt
66
+ var input = ReducerConventionInput.Read("Shop", configurationJson);
67
+ var profile = CratisRendering.WithReducerConvention(
68
+ CratisRendering.CreateProfile("Shop", new("Shop.Backend", "Acme.Shop")), input);
69
+ ```
70
+
71
+ `configurationJson` is the host-supplied file content. Invalid version, application,
72
+ fields or convention are refused, not defaulted. Self mode emits public static
73
+ `Reduce` overloads and non-public typed-context helpers on the read-model record,
74
+ with unchanged queries and no companion `IReducerFor<T>`. StateView and Automation
75
+ slices use the layout; observer filters become model attributes. Existing purity,
76
+ identity, tenant, deletion and occurrence semantics remain. Model/property/query
77
+ name `Reduce`, replay-hook query names, or generated `Transition_<suffix>` collisions
78
+ refuse `STAGE-ESM-019`; Stage never silently changes layout.
79
+
80
+ No per-model override or existing-application migration is supported. Do not flip
81
+ an existing classic application to `self`: observer identity and old reducer removal
82
+ need migration-aware publication. This opt-in does not automatically change CLI,
83
+ Studio or semantic-engine execution.
84
+
45
85
  ## What is managed
46
86
 
47
87
  Every path in `.cratis-render.json` is managed: the scaffold files (project, solution,
@@ -3,6 +3,7 @@
3
3
  ## Contents
4
4
 
5
5
  - The sandbox: a partial, disposable runtime
6
+ - Protected command reads
6
7
  - Refusals shared by both engines
7
8
  - The specification runner
8
9
  - Choosing between them
@@ -101,6 +102,32 @@ A refusal or an acceptance from the default engine therefore proves nothing beyo
101
102
  lists above. Use the semantic engine, or Debug tests of a render, for
102
103
  evidence about the rest.
103
104
 
105
+ ## Protected command reads
106
+
107
+ Requires Stage 4.129.0 for semantic Host and specification-executor protected reads;
108
+ older engines refuse them with `STAGE-ESM-044`. The default EventModel Host and
109
+ structural runner still refuse the preamble with `STAGE-ESM-044`; the structural
110
+ runner exits `1` without a report. The Cratis C# renderer also retains `-044`:
111
+ executing a model here does not make it renderable.
112
+
113
+ After authorization and property/concept rules, each declared read must exist at
114
+ its key. Missing state rejects with `<View> '<key>' does not exist.` before any
115
+ requirement or generation, even a command-only requirement. `/validate` reports
116
+ absence too. Present read properties feed `require` and produced-event mappings.
117
+ The executor projects prior facts through Chronicle's in-memory read-model scenario,
118
+ preserving event-source-keyed removal and recreation. Join removals, parent keys,
119
+ children and nested scopes remain refused.
120
+
121
+ A protected command with any non-Error requirement refuses `STAGE-ESM-045` before
122
+ execution. This includes reaction-invoked commands, even a specification expecting
123
+ rejection: the outcome is `Unsupported`, before seeding facts, not a passing refusal.
124
+ Do not change modeled severity to get an executable result.
125
+
126
+ The semantic Host faults the session on **any outside append** to its event log,
127
+ even an unrelated one, before committing an accepted command. This interim guard
128
+ is stricter than the reference's dependency-scoped decide/commit conflicts; do not
129
+ claim full reference conflict parity or generated-application protection.
130
+
104
131
  ## Refusals shared by both engines
105
132
 
106
133
  Both engines refuse public events (`STAGE-ESM-032`), foreign or source-event captures
@@ -141,7 +168,7 @@ invalid semantic option.
141
168
  - **Semantic**: creates a fresh in-memory Chronicle log per specification and dispatches
142
169
  admitted commands through Arc's in-memory pipeline; supports explicit-source and routed
143
170
  given events, unconditional production, event assertions, caller and authorization,
144
- command rules, unique constraints, flat and event-source-keyed scoped projections, and
171
+ command rules, protected command reads (including reaction invocations), unique constraints, flat and event-source-keyed scoped projections, and
145
172
  optional snapshot queries, including protected ones: portable authorization is evaluated
146
173
  with the fixture caller, query arguments and key, and an expected denial matches only
147
174
  `then denied`. Report schema `stage-spec-run/1` with outcomes
@@ -150,6 +177,10 @@ invalid semantic option.
150
177
  allocation, external effects, composite values, queries other than optional snapshots, and
151
178
  a reached opaque authorization policy (reported as `Unsupported`). Unsupported is never a pass. Do not feed the file to a legacy reader.
152
179
 
180
+ The runner and generated-fixture checks use Screenplay's public
181
+ `SemanticValidationRules.Check`. This shared rule check does not execute opaque
182
+ generation or validation bodies.
183
+
153
184
  How the runner relates to the verdicts: a structural pass is not a behavioral result. The
154
185
  semantic engine is Stage's own executor running through Arc's in-memory pipeline. It is
155
186
  not the Screenplay reference route, so a semantic pass is never V4 (V4 is reference
@@ -62,6 +62,16 @@ The scaffold's Scene runtime provides:
62
62
  imports and network assets; an explicit importer map is not arbitrary module
63
63
  loading. Diagnostics block mismatched or unavailable bundles.
64
64
 
65
+ Requires Stage 4.130.0 for Stage shell selection from `ui profile` root template,
66
+ options and appearance; older hosts do not apply that complete shell contract.
67
+ The Host and render plan use Scene's shell resolution: root, legacy layout,
68
+ default blueprint layout, then bare shell. Unknown/unavailable/version-mismatched
69
+ roots and roots lacking a `content` outlet produce planning findings or an explicit
70
+ Host startup message, never silent fallback. Shell options such as `navigationMode`,
71
+ `menuTheme` and `showFooter` are applied or reported unsupported. Light/dark/system
72
+ color scheme and accent reach the shell; runtime Scene carries root, appearance
73
+ and defaults but no sample data. Browser evidence is still needed for UI parity.
74
+
65
75
  Keep authoring acceptance, executable admission and runtime behavior separate.
66
76
  Require Stage's plan/diagnostics for emission and a browser run for UI parity;
67
77
  source verification alone proves neither. For authoring details read
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.64.0",
3
+ "version": "7.66.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [