@cratis/pi 7.66.0 → 7.67.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 (42) hide show
  1. package/package/corpus/product-sync.json +3 -3
  2. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +1 -1
  3. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +1 -1
  4. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +4 -3
  5. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +13 -2
  6. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +2 -2
  7. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +1 -1
  8. package/package/corpus/skills/cratis-screenplay-model-review/references/public-keys-and-routes.md +4 -2
  9. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +5 -0
  10. package/package/corpus/skills/cratis-screenplay-projections/references/pdl-grammar.md +42 -2
  11. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +9 -7
  12. package/package/corpus/skills/cratis-screenplay-read-surface/references/equality-filters.md +1 -1
  13. package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +168 -58
  14. package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +2 -2
  15. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +1 -1
  16. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
  17. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +2 -2
  18. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +3 -3
  19. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +2 -2
  20. package/package/corpus/skills/cratis-screenplay-slice-design/references/public-boundaries-and-keys.md +5 -3
  21. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +3 -2
  22. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +3 -2
  23. package/package/corpus/skills/cratis-screenplay-specifications/references/query-rejections.md +4 -0
  24. package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +17 -0
  25. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +3 -1
  26. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +46 -0
  27. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +6 -5
  28. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +2 -2
  29. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +9 -6
  30. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +31 -9
  31. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +15 -5
  32. package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +1 -1
  33. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +3 -3
  34. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +1722 -76
  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 +2 -2
  37. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -1
  38. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +5 -4
  39. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +12 -7
  40. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +17 -0
  41. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +1 -1
  42. package/package.json +1 -1
@@ -13,7 +13,7 @@ Compiler syntax: `cheat-sheet.md`. Negative capability claims depend on the tool
13
13
  9. Authorization (module AND feature AND construct) runs before validation; unauthorized is `then denied`, never `then error`.
14
14
  10. Without a declared actor an invocation is caller-less. Declare reaction `runs as system role "<Role>"` (ESM v10), keep its gate, and reference-test the trusted path. Stage renders role and authenticated reaction identity; claim-reading or opaque system gates refuse STAGE-ESM-034. Arc gap-fill uses `[ExecuteCommandsAsSystem]` for returned commands, not a fictional `given caller`.
15
15
  11. A reaction `produces` without `for` lands on the trigger's event source; clock and application triggers need an explicit `for`.
16
- 12. Explicit trailing `key` marks replace inference (never `identifier`); multipart read-model keys remain PLAY0268. Without marks, single-instance queries in the owning slice must agree on `by xId XId`, where `xId` is a read-model property. Only with no such identifier and an admitted list query does `*Id` inference run (collection-key exclusions: read-surface `references/named-keys.md`); queryless views need explicit `key`. The identifier equals the projection's effective key (table in slice-design `references/read-model-design.md`; full rule, including Stage's narrower admission and `STAGE-ESM-017`, in `cratis-stage-rendering-and-sandbox` `references/admission.md`). Never mark a read-model property `identifier`. (Without explicit `key`, PLAY0268 when identity inference is ambiguous or absent; PLAY0351 when a `given`/`then` readmodel block omits that property.)
16
+ 12. Explicit trailing `key` marks replace inference (never `identifier`); several parts bind as v27 with an untyped projection `key` block per root `from` and `remove with`. Without marks, single-instance queries in the owning slice must agree on `by xId XId`, where `xId` is a read-model property. Only with no such identifier and an admitted list query does `*Id` inference run (collection-key exclusions: read-surface `references/named-keys.md`); queryless views need explicit `key`. The identifier equals the projection's effective key (table in slice-design `references/read-model-design.md`; full rule, including Stage's narrower admission and `STAGE-ESM-017`, in `cratis-stage-rendering-and-sandbox` `references/admission.md`). Never mark a read-model property `identifier`. (Without explicit `key`, PLAY0268 when identity inference is ambiguous or absent; PLAY0351 when a `given`/`then` readmodel block omits that property.)
17
17
  13. Projection `key` routes only on `from` (projection-level: PLAY0381). `all` is per event source. Joins never create instances and match the joined event's source id.
18
18
  14. AutoMap is on by default: same-named event properties fill read-model properties silently (scoped: case-insensitive, same type only; flat-bound: exact name, no type check, so a type mismatch invalidates the model). Use `no automap` for control.
19
19
  15. `given readmodel` bypasses the projection; prove a projection with `given` events + `when append`/command + `then readmodel`/`then query`.
@@ -40,7 +40,7 @@ Compiler syntax: `cheat-sheet.md`. Negative capability claims depend on the tool
40
40
 
41
41
  34. A `from <Event> key <property>` routes only if every such event carries that property: an event that frees or updates a row keyed by another stream's id must carry that id in its payload, or the row never changes. The compiler may not report a missing key property; check by hand.
42
42
  35. `description`/`documentation` are authoring metadata: board, MCP and Prologue show them; `cratis render` emits them only as XML doc comments (invalid XML characters are CLI-RENDER-005), never as behavior. A rule only in prose is unenforced in rendered code; make it a rule layer, a spec or a recorded target requirement.
43
- 36. One unadmitted construct (operations, `numbers exact`, composite view keys) blocks whole-model binding. Routing is admitted (v8), unlike composite view keys. Overrides replace the whole route, filters never match unrouted facts. Do not remove routing or authorization to render a model.
43
+ 36. One unadmitted construct (operations, `numbers exact`) blocks whole-model binding. Routing is admitted (v8), as are flat composite view keys (v27). Overrides replace the whole route, filters never match unrouted facts. Do not remove routing or authorization to render a model.
44
44
  37. Personas remain outside ESM bytes, but specifications accept `given caller as <Persona>`: one authenticated deterministic policy witness, not every matching caller. Inspect the chosen `or` branch; use explicit callers when synthesis is refused.
45
45
  38. A stored-state rule uses `reads <View>` and `require` with an indented message. Opt into `command reads protected` for eligible v25 views; absence rejects and matching decide/commit changes conflict. Legacy reads remain unprotected. The Cratis C# renderer refuses protected reads (STAGE-ESM-044), not the v25 pair; semantic Host/executor support is separate: hand-written Arc `[ProtectedDecision]` + `DecisionRead<T>` or Chronicle consistency enforcement needs separate target verification; use a constraint for uniqueness. Forbidden: caller-supplied copies of state in `require`, boolean attestation inputs (`confirmsX == true`), rules hidden in `handler`/implementation-hint prose. An unguarded materialized read is unsafe for a protected decision.
46
46
  Requires Arc 22.39.0 or later for `[ProtectedDecision]`.
@@ -12,7 +12,7 @@
12
12
  { "kind": "skill-contains", "value": "PLAY0666", "file": "references/diagnostics.md" },
13
13
  { "kind": "skill-contains", "value": "bind/reference-execute as v11", "file": "references/executable-subset.md" },
14
14
  { "kind": "skill-contains", "value": "A consumer admitting v10 must include all three", "file": "references/production-routes-and-filters.md" },
15
- { "kind": "skill-contains", "value": "Composite view keys remain authoring-only (PLAY0268)" },
15
+ { "kind": "skill-contains", "value": "Flat composite read-model keys select v27" },
16
16
  { "kind": "skill-contains", "value": "the **whole source, stream and stream id**", "file": "references/production-routes-and-filters.md" },
17
17
  { "kind": "play-compiles" },
18
18
  { "kind": "skill-contains", "value": "Requires Screenplay 4.144.0", "file": "references/verdicts.md" },
@@ -74,8 +74,9 @@ printed), `1` is a missing input. Add `-o json` for the counts and the publicati
74
74
  Facts that surprise:
75
75
 
76
76
  - **Binding uses the CLI's bundled compiler**, not the standalone one. Version admission
77
- does not imply construct support: exact ESM v1–v21 and v23–v25 pairs are admitted,
78
- while v22/v26 and mixed pairs refuse `STAGE-ESM-016`. Pattern/random generation and checksum validation
77
+ does not imply construct support: exact ESM v1–v21 and v23–v26 pairs are admitted,
78
+ while v22/v27 and mixed pairs refuse `STAGE-ESM-016`. Date/DateTime command comparisons (v26)
79
+ execute in the semantic Host and executor but refuse `STAGE-ESM-046` in the renderer. Pattern/random generation and checksum validation
79
80
  render with an admitting renderer; `generate rule` still refuses `STAGE-ESM-028`.
80
81
  Read [references/admission.md](references/admission.md) for the introducing-release
81
82
  prerequisites, all-Proven unpinned specifications and construct/pin checks (-011/-038).
@@ -132,9 +133,9 @@ One blocker publishes nothing. Codes, limits and fixes: [references/admission.md
132
133
  The Cratis C# renderer refuses protected reads with `STAGE-ESM-044`, described handlers `STAGE-IMPL-002`
133
134
  (even Stub mode), and atomic mode in admitted pairs `STAGE-ESM-043`.
134
135
  - **Binding refusals (`PLAY0268`/`PLAY0271`):** legacy reads, `concurrency`, attached
135
- handlers, context/single-result filters, opaque scope/performer, composite `by`,
136
+ handlers, context/single-result filters, opaque scope/performer, a list-query `by` block,
136
137
  enum/identity compliance and subject lineage. Eligible protected reads bind v25;
137
- pending handlers with unconditional productions bind v23, but neither renders.
138
+ pending handlers with unconditional productions bind v23, but neither renders. A read model with several key parts (v27) refuses `STAGE-ESM-016`.
138
139
  Never drop protection.
139
140
 
140
141
  A refusal is not a licence to weaken the model: drop no specification, event generation or
@@ -11,8 +11,8 @@
11
11
  - Specification rules (`STAGE-ESM-011`)
12
12
  - Refusals seen while drafting a model
13
13
 
14
- Stage admits exact ESM v1–v21 and v23–v25 language/semantic pairs, then checks
15
- constructs. V22, v26 and mixed or unknown pairs report `STAGE-ESM-016`. The CLI's bundled renderer
14
+ Stage admits exact ESM v1–v21 and v23–v26 language/semantic pairs, then checks
15
+ constructs. V22, v27 and mixed or unknown pairs report `STAGE-ESM-016`. The CLI's bundled renderer
16
16
  may stop at v16 and refuse newer models with `CLI-RENDER-004`.
17
17
 
18
18
  Requires Stage 4.96.0 for v16, 4.101.0 for v17, 4.102.0 for v19, 4.106.0 for v18, and 4.103.0 for rendered redelivery; older renderers refuse the respective shapes.
@@ -34,9 +34,13 @@ Requires Stage 4.129.0 for semantic Host/executor protected reads; older engines
34
34
  Described handlers refuse STAGE-IMPL-002, even Stub mode; atomic mode in an
35
35
  admitted pair refuses STAGE-ESM-043. Version admission never implements a body,
36
36
  batch or rendered protected decision. Chronological Date/DateTime command comparisons
37
- select v26 in Screenplay but still refuse STAGE-ESM-016 here; standalone reference
38
- success is not rendering or Host/executor admission. Keep the date rule and use
39
- authorized gap-fill rather than downgrading to ordinal text or millisecond precision.
37
+ select v26. The semantic Host and specification executor run them; the renderer,
38
+ legacy engines and default sandbox engine refuse them with STAGE-ESM-046, naming the
39
+ property, and emit no artifacts. Standalone reference success is not rendering. Keep
40
+ the date rule and use authorized gap-fill rather than downgrading to ordinal text or
41
+ millisecond precision.
42
+
43
+ Requires Stage 4.135.0 for v26 admission; older Stage refuses v26 with STAGE-ESM-016.
40
44
 
41
45
  Binding with the CLI's bundled compiler is a separate
42
46
  prerequisite. The exhaustive construct table is `references/renderable-subset.md` in
@@ -135,13 +139,13 @@ Requires Stage 4.90.0 for snapshot/live lists, 4.96.0 for non-text secrets and 4
135
139
  | `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 |
136
140
  | `STAGE-ESM-006` | `produces` that cannot render without changing its destination or mappings (expression/enum conditions, literal or computed mappings, `for` not a command identifier, mappings not one-to-one with event properties, duplicate tags) | Map properties one to one; supported conditional productions render as guarded events, not separate commands |
137
141
  | `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 |
138
- | `STAGE-ESM-010` | A query is neither an optional snapshot lookup by the read-model identifier nor a supported snapshot/observable collection query; each query is checked on its own. Both collection modes render. Concept-typed keys and filters retain Arc validation, including composite members and collection elements; nullable concept keys or optional concept filters with `not empty` cannot preserve null semantics | Keyed `XById => X optional` queries or snapshot/observable lists. Equality filters render on both collections; DateTime filters, required filters after optional ones and unsupported null-validation shapes refuse 010. Filter-name collisions refuse 012. Context/single-result filters, opaque scope/performer and composite `by` remain PLAY0268 |
142
+ | `STAGE-ESM-010` | A query is neither an optional snapshot lookup by the read-model identifier nor a supported snapshot/observable collection query; each query is checked on its own. Both collection modes render. Concept-typed keys and filters retain Arc validation, including composite members and collection elements; nullable concept keys or optional concept filters with `not empty` cannot preserve null semantics | Keyed `XById => X optional` queries or snapshot/observable lists. Equality filters render on both collections; DateTime filters, required filters after optional ones and unsupported null-validation shapes refuse 010. Filter-name collisions refuse 012. Context/single-result filters, opaque scope/performer and a list-query `by` block remain PLAY0268; a read model with several key parts (v27) refuses `STAGE-ESM-016` |
139
143
  | `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 |
140
144
  | `STAGE-ESM-012` | Generated C# names collide (properties, types, namespaces, constraints) | Rename |
141
145
  | `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 |
142
146
  | `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 |
143
147
  | `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 |
144
- | `STAGE-ESM-016` | Model language/semantic pair is not admitted by the installed Stage; exact v1–v21 and v23–v25 pairs are admitted, v22/v26 and mixed pairs refused; older Stage also refuses the versions listed in the minimums above. A CLI bundle stopping at v16 reports `CLI-RENDER-004` above v16 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 |
148
+ | `STAGE-ESM-016` | Model language/semantic pair is not admitted by the installed Stage; exact v1–v21 and v23–v26 pairs are admitted, v22/v27 and mixed pairs refused; older Stage also refuses the versions listed in the minimums above. A CLI bundle stopping at v16 reports `CLI-RENDER-004` above v16 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 |
145
149
  | `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, unsupported `all` mappings, the refused scope shapes below) | Reshape the projection without changing what it records, or record the gap |
146
150
  | `STAGE-ESM-018` | `$strings.` key missing in the default locale or containing formatting characters | Fix the strings |
147
151
  | `STAGE-ESM-019` | Reducer structure or body not admitted (outside a `StateView`, impure, does not compile) | An equivalent pure body, or gap-fill |
@@ -164,6 +168,7 @@ Requires Stage 4.90.0 for snapshot/live lists, 4.96.0 for non-text secrets and 4
164
168
  | `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 |
165
169
  | `STAGE-ESM-043` | `reaction batches atomic` in an admitted version pair | Keep the batch boundary; gap-fill without splitting it |
166
170
  | `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 |
171
+ | `STAGE-ESM-046` | Date/DateTime comparison in `require`, `produces when` or a validation rule (including through concepts) in the renderer, legacy engines or default sandbox engine; names the property | Keep the date rule; the semantic Host/executor run it; deliver rendering through gap-fill that compares exact calendar dates and UTC ticks |
167
172
  | `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 |
168
173
  | `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 |
169
174
  | `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 |
@@ -4,6 +4,7 @@
4
4
 
5
5
  - The sandbox: a partial, disposable runtime
6
6
  - Protected command reads
7
+ - Date comparisons (v26)
7
8
  - Refusals shared by both engines
8
9
  - The specification runner
9
10
  - Choosing between them
@@ -128,6 +129,22 @@ even an unrelated one, before committing an accepted command. This interim guard
128
129
  is stricter than the reference's dependency-scoped decide/commit conflicts; do not
129
130
  claim full reference conflict parity or generated-application protection.
130
131
 
132
+ ## Date comparisons (v26)
133
+
134
+ Requires Stage 4.135.0 for v26 admission; older Stage refuses v26 with `STAGE-ESM-016`.
135
+ The semantic Host and specification executor compare `Date` as calendar days and
136
+ `DateTime` as UTC ticks in `require`, `produces when` and validation rules, including
137
+ through concepts. A participating `DateTime` input without an offset or `Z` rejects
138
+ with Validation after authorization and before any rule. `then` stays ordinal. The
139
+ renderer, legacy engines and default sandbox engine refuse these comparisons with
140
+ `STAGE-ESM-046`, naming the property; no date validators or artifacts are emitted.
141
+
142
+ One ordering differs from the reference: the reference checks authorization, then
143
+ offsets, then opaque C# validation, so an offset-less DateTime beside opaque
144
+ validation is a Validation rejection there. The specification executor refuses opaque
145
+ validation at run admission and the Host refuses it before authorization, so both Stage
146
+ paths report `Unsupported`, which never counts as a pass.
147
+
131
148
  ## Refusals shared by both engines
132
149
 
133
150
  Both engines refuse public events (`STAGE-ESM-032`), foreign or source-event captures
@@ -24,7 +24,7 @@
24
24
  { "kind": "skill-contains", "value": "`cratis run` has no `--engine` option", "file": "references/sandbox-and-specrunner.md" },
25
25
  { "kind": "skill-contains", "value": "the environment setting below", "file": "references/sandbox-and-specrunner.md" },
26
26
  { "kind": "skill-contains", "value": "fresh in-memory Chronicle log per specification", "file": "references/sandbox-and-specrunner.md" },
27
- { "kind": "skill-contains", "value": "exact ESM v1–v21 and v23–v25 pairs" },
27
+ { "kind": "skill-contains", "value": "exact ESM v1–v21 and v23–v26 pairs" },
28
28
  { "kind": "skill-contains", "value": "STAGE-ESM-044" },
29
29
  { "kind": "skill-contains", "value": "STAGE-IMPL-002" },
30
30
  { "kind": "skill-contains", "value": "all-Proven rules permit unpinned rendered", "file": "references/admission.md" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.66.0",
3
+ "version": "7.67.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [