@cratis/pi 7.139.0 → 7.140.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.
@@ -22,7 +22,7 @@ repository is the full list; this page is the authoring summary.
22
22
  ## Accepted constructs
23
23
 
24
24
  **Top level:** `domain`, `import`, `concept`, `type`, `policy`, `persona`,
25
- `authentication`, `identity`, `purpose`, `trigger`, `theme`, `layout`, `ui profile`, `behavior`,
25
+ `authentication`, `identity`, `purpose`, `trigger`, `design system` (one per application: `modes`, `default theme`, `tokens`, `components`, `words`, `rules`), `theme` (`implements`, `compatible with`, `palette`, `values`, a block per mode), `layout`, `ui profile`, `behavior`,
26
26
  `module`, `seed`, authoring-only `system`, and admitted `eventsource` with its `stream`s (ESM v8).
27
27
 
28
28
  **Inside a module:** `description`, `authorize`, `import "<glob>"`,
@@ -68,12 +68,14 @@ the [MCP loop](mcp-loop.md).
68
68
  | --- | --- | --- |
69
69
  | Understanding | `describe-application`, `search-declarations`, `find-declaration`, `declaration-details` | Navigate logical hierarchy and inspect bounded details |
70
70
  | References and examples | `find-references`, `dependencies`, `dependency-graph`, `find-fixtures`, `find-assertion-gaps`, `find-specification-obligations`, `find-modeling-smells`, `trace-lineage`, `semantic-diff` | Inspect declared relationships and authored examples, not executed coverage |
71
- | Source and validation | `diagnostics`, `ui-profiles`, `read-document`, `merged-document`, `syntax-schema` | Read exact source or typed structure and diagnose problems |
71
+ | Source and validation | `diagnostics`, `ui-profiles` (also the design system, themes and resolved values per mode), `read-document`, `merged-document`, `syntax-schema` | Read exact source or typed structure and diagnose problems |
72
72
  | Workspace inspection | `open-workspace`, `read-workspace`, `read-ast`, `workspace-state`, `export-workspace`, `repair-capabilities` | Obtain current identities, handles, readiness, code attachment requirements, source-map locations, durable-state status and the repair catalog |
73
73
  | Visual (MCP-Apps hosts only) | `visualize-model` | Draw the board for the model or a `proposalId`; its `sketch` argument previews a what-if of whole documents. Reads only |
74
74
  | Planning | `propose-source`, `propose-ast`, `propose-rename`, `propose-move`, `propose-repair`, `propose-property`, `propose-number-enum-members`, `propose-extract-inline-event`, `propose-inline-event`, `propose`, `recommend-layout`, `expand-layout` | Produce validated, reviewable candidates without writing them |
75
75
  | Review | `read-proposal`, `discard-proposal` | Inspect exact changes, dropped comments and proposed attachments, or abandon a connection-local proposal |
76
76
  | Reference execution | `run-specifications` | Run the workspace or a retained proposal candidate read-only; not attached code or target tests |
77
+
78
+ `propose-ast` node kinds for the design (Screenplay with design systems): `DesignSystemSyntax`, `DesignTokenCategorySyntax`, `DesignTokenSyntax`, `DesignComponentSyntax`, `DesignVariantSyntax`, `DesignStateSyntax`, `DesignAssignmentSyntax`, `DesignWordsSyntax`, `DesignContrastRuleSyntax`, `ThemeModeValuesSyntax`; `ThemeSyntax` gains `implements`, `palette`, `values` and `modeValues`. The tool count is unchanged: `ui-profiles` carries the read.
77
79
  | Version migration | `migrate` | Read-only: report what `screenplay migrate --from <major> [--to <major>]` rewrites and, for a named `document`, its migrated source to write through a proposal (`cratis-screenplay-modeling-lifecycle`) |
78
80
  | Effects | `apply`, `recover-workspace` | Apply an accepted plan or explicitly recover an interrupted write |
79
81
 
@@ -184,17 +184,29 @@ such outlet. The syntax and when to choose an outlet over a screen toolbar are i
184
184
 
185
185
  ### The profile's shell
186
186
 
187
- `ui-profiles` (Screenplay 4.201.0 or later) reads each `ui profile`'s root template, shell options, appearance, new screens default and
187
+ `ui-profiles` (Screenplay 4.201.0 or later) reads each `ui profile`'s root template, shell options, appearance, theme (and `resolvedTheme`, the theme and mode it resolves to), new screens default and
188
188
  shell diagnostics, and lists the own templates that could be the root template (`applicableRootTemplates`) or the new screens
189
189
  default (`applicableNewScreenTemplates`); pick from those instead of guessing. Edit `RootTemplateSyntax` (`name`, `blueprint`,
190
190
  `version`), `ShellOptionSyntax` (`add` to the root's `options`; `syntaxKind` is `Word`, `Text`, `Number` or `Flag`),
191
- `ProfileAppearanceSyntax` (`colorScheme`, `accent`) and `NewScreenTemplateSyntax` with `propose-ast`. A refusal is the answer:
191
+ `ProfileAppearanceSyntax` (`colorScheme`; `accent`, `corners` and `font` are deprecated, `PLAY0929`) and `NewScreenTemplateSyntax` with `propose-ast`. A refusal is the answer:
192
192
  `PLAY0790` (a template nothing declares), `PLAY0792` (a blueprint the profile does not list), `PLAY0794` (a template that cannot
193
- be the shell), `PLAY0795` (no `content` slot), `PLAY0797` (a bad color scheme, accent, corners or identity value), `PLAY0799` (a new screens default that
193
+ be the shell), `PLAY0795` (no `content` slot), `PLAY0797` (a bad color scheme or identity value), `PLAY0799` (a new screens default that
194
194
  cannot start a screen). `PLAY0796` (an option the shell does not expose) and `PLAY0791` (the legacy `layout` line) are warnings:
195
195
  the proposal is accepted and `ui-profiles` shows them. Replay against the `ui-profile-root-positive` vector and its rejection
196
196
  vectors (`ui-profile-root-unknown`, `ui-profile-root-not-a-shell`, `ui-profile-root-invalid`) in `Cratis.Screenplay.CanonicalCorpus`.
197
197
 
198
+ ### The design system and its themes
199
+
200
+ The same `ui-profiles` read (no new tool; the tool count is unchanged) also returns the application's `design system` (modes, tokens,
201
+ components, words, rules), every theme with its palette, values and per-mode values, each theme's resolved tokens and components per mode,
202
+ the design diagnostics `PLAY0916` to `PLAY0930` and the closed vocabulary of token categories, component parts and states: choose from
203
+ those, do not guess. Edit with `propose-ast` on `DesignSystemSyntax`, `DesignTokenCategorySyntax`, `DesignTokenSyntax`,
204
+ `DesignComponentSyntax`, `DesignVariantSyntax`, `DesignStateSyntax`, `DesignAssignmentSyntax`, `DesignWordsSyntax`,
205
+ `DesignContrastRuleSyntax` and `ThemeModeValuesSyntax`; `ThemeSyntax` gains `implements`, `palette`, `values` and `modeValues`. A refusal is
206
+ the answer (`PLAY0916` a malformed design, `PLAY0920` an undeclared token, `PLAY0921` a color token without a value in a mode,
207
+ `PLAY0925` or `PLAY0926` a theme that does not implement the design system); `PLAY0928` (contrast below a rule) and `PLAY0929`
208
+ (deprecated `appearance` member) are warnings. Grammar and examples: the ui-composition skill's `design-system-and-themes.md`.
209
+
198
210
  Requires Screenplay 4.188.0 or later (`screenplay --version`) to `add` the first outlet, item or sub-item to a member
199
211
  the node JSON omits while empty; an older MCP server answers "Unknown typed syntax member".
200
212
 
@@ -99,6 +99,10 @@ model's behalf.
99
99
  Protection and reaction-privilege checks: [mode compliance](references/mode-compliance.md).
100
100
  A client id, secret, authority, sender or mail server in a model is a critical finding: those
101
101
  belong in the environment (`cratis-screenplay-authentication-and-onboarding`).
102
+ **Design system check** (when the model draws a UI): exactly one `design system` with a `default theme` (`PLAY0917`, `PLAY0927`);
103
+ every theme a profile selects `implements` it and gives each `color` token a value in every mode (`PLAY0926`, `PLAY0921`); no raw
104
+ `accent`, `corners` or `font` left in a profile's `appearance` (`PLAY0929`); `contrast` rules declared for the text/background pairs
105
+ components use, and no `PLAY0928` waived without a reason. Detail: `cratis-screenplay-ui-composition`.
102
106
  12. **Root causes, classify, report** (`references/report-template.md`). Group findings that share
103
107
  a declaration; report the root cause with its symptoms under it; severity critical, major or
104
108
  minor; kind defect, question or note; verdict with confidence. Never apply changes.
@@ -144,6 +144,10 @@ model still compiles and binds) and its V5 states the scope.
144
144
  form, layout, template, slot, toolbar, hook, component, outlet, route, package/icon use, theme and persona view,
145
145
  or a blocking diagnostic or "not rendered" with the responsible tool version; silent fallback to
146
146
  default composition is a failure (Stage 4.24 rendered the default composition only).
147
+ The design is the same: Stage reads the resolved theme (the profile's theme, else the design system's `default theme`, in the mode
148
+ its `color scheme` selects) once Cratis/Stage adopts it; until then Stage keeps reading the profile's `appearance` `accent`, `corners` and
149
+ `font`, so a model that moved them into a theme renders with the default look. Report that as a UI omission naming the Stage version,
150
+ not as a model defect, and do not put the values back in `appearance` to make it render.
147
151
  8. **Drift:** `cratis render ... --check` (exit 6 pending); also compare the manifest's `semanticRevision`
148
152
  with a fresh render under the same inputs. For hand-written scope, `cratis screenplay conform` gives
149
153
  structural code-vs-model evidence (`references/drift-and-fallback-record.md`). For changes since verification,
@@ -16,6 +16,7 @@
16
16
  - Specification metadata, callers, cases and locators
17
17
  - Guarded interaction diagnostics
18
18
  - UI profile shell: root template, options, appearance
19
+ - Design systems and themes (PLAY0916-PLAY0930)
19
20
  - Structural completeness and timeline checks
20
21
  - Editor versus C# verdicts
21
22
  - Consistency errors (V1: the model contradicts itself)
@@ -315,7 +316,7 @@ Requires Screenplay 4.200.0 or later (`screenplay --version`); 4.197.0 reads the
315
316
  | Code | Severity | Meaning / fix |
316
317
  | --- | --- | --- |
317
318
  | PLAY0788 | E | A `root template` / `new screens use template` line is malformed, or pins a version on an own template. |
318
- | PLAY0789 | E | A malformed or repeated `identity` or `appearance` line, or a second `identity` or `appearance` block. |
319
+ | PLAY0789 | E | A malformed or repeated `identity` or `appearance` line (the deprecated `accent`, `corners` and `font` are still lines it accepts, `PLAY0929`), or a second `identity` or `appearance` block. |
319
320
  | PLAY0790 | E | The template is not declared (or the blueprint does not ship it). Declare it or take it from a blueprint. |
320
321
  | PLAY0791 | W | The profile selects its shell with the legacy `layout <Name>`. Write `root template <Name>`; the quick fix rewrites it (or removes the ignored line beside a `root template`). |
321
322
  | PLAY0792 | E | The blueprint is not in the profile's `packages` (or not installed). |
@@ -323,10 +324,32 @@ Requires Screenplay 4.200.0 or later (`screenplay --version`); 4.197.0 reads the
323
324
  | PLAY0794 | E | The root template cannot be the shell (not a layout or application-scope template, fits a slot, `scopes` without `application`). |
324
325
  | PLAY0795 | E | The root template has no `content` slot. |
325
326
  | PLAY0796 | W | An `option` the shell does not expose. |
326
- | PLAY0797 | E | Color scheme is not `light`, `dark` or `system`, the accent is not a hex colour, the corners are not `sharp`, `default` or `round`, or an `identity` value is outside Scene's rules (initials longer than 2, unknown icon, image that is not a PNG/JPG/SVG/WebP data URI of at most 400 KB). |
327
+ | PLAY0797 | E | Color scheme is not `light`, `dark` or `system`, or an `identity` value is outside Scene's rules (initials longer than 2, unknown icon, image that is not a PNG, JPG, SVG or WebP data URI of at most 400 KB). The deprecated `accent` and `corners` values are still checked while they read; move them to the theme (`PLAY0929`). |
327
328
  | PLAY0798 | E | More than one `root template` in a profile. |
328
329
  | PLAY0799 | E | `new screens use template` cannot start a screen in a feature. |
329
330
 
331
+ ## Design systems and themes (PLAY0916-PLAY0930)
332
+
333
+ Requires a Screenplay release that carries design systems (next minor after 6.2.0, 6.3.0; `screenplay --version`); earlier compilers do not know the codes, and `screenplay-contract.json` lists them only once the pin moves. Fixes: `../../cratis-screenplay-ui-composition/references/design-system-and-themes.md`.
334
+
335
+ | Code | Severity | Meaning / fix |
336
+ | --- | --- | --- |
337
+ | PLAY0916 | E | Malformed `design system`: unknown section, token category, component part or state, bad line shape, a part the component does not declare, or a section twice. |
338
+ | PLAY0917 | E | A second `design system`; an application has exactly one. |
339
+ | PLAY0918 | E | A theme block for a mode the design system's `modes` does not declare. |
340
+ | PLAY0919 | E | A mode, token, component, variant, part, palette entry, value or word declared twice. |
341
+ | PLAY0920 | E | A theme assigns a token the design system does not declare. |
342
+ | PLAY0921 | E | An implementing theme gives a `color` token no value in a declared mode. |
343
+ | PLAY0922 | E | A design reference (`palette.<name>`, `<category>.<token>`) names something undeclared, or a token with no value. |
344
+ | PLAY0923 | E | Design references loop. |
345
+ | PLAY0924 | E | A component part takes a token of a category it cannot take (`background = space.sm`). |
346
+ | PLAY0925 | E | A theme `implements` a design system the application does not declare. |
347
+ | PLAY0926 | E | A `ui profile` selects a theme that does not implement the design system. |
348
+ | PLAY0927 | E | No `default theme`, or it is undeclared or does not implement the design system. |
349
+ | PLAY0928 | W | In some theme and mode a text/background pair is below a `contrast` rule (`disabled` not checked). |
350
+ | PLAY0929 | W | `accent`, `corners` or `font` in a profile's `appearance` is deprecated; put the value in the theme. |
351
+ | PLAY0930 | E | A theme's `implements`, `palette`, `values` or mode block is malformed or repeated. |
352
+
330
353
  ## Structural completeness and timeline checks
331
354
 
332
355
  Opt in with `--check <names>` or MCP diagnostics `checks`, then treat warnings
@@ -5,7 +5,7 @@
5
5
 
6
6
  Use these forms when writing or reviewing `.play`. Acceptance of an older
7
7
  spelling is not a recommendation to teach it. Information diagnostics do not
8
- fail `--warnaserror`; the corpus verification gate rejects the thirteen style codes
8
+ fail `--warnaserror`; the corpus verification gate rejects the fourteen style codes
9
9
  below even when a fence declares `expect`, unless an exact, reasoned migration
10
10
  exception exists in the verifier's preferred-syntax allowlist. That allowlist also
11
11
  covers deliberate legacy explanations in prose; stale entries fail.
@@ -27,6 +27,7 @@ covers deliberate legacy explanations in prose; stale entries fail.
27
27
  | Combined policies | `authorize A and B` | `authorize A B` (adjacent policies mean `and`) | PLAY0825 (information; repair writes `and`) |
28
28
  | Composite key | Indented key parts under `key` | `key {` ... `}` around parts the indentation already groups | PLAY0824 (information; repair removes the braces) |
29
29
  | Profile shell | `root template <Name>` in a `ui profile` | `layout <Name>` in a `ui profile` | PLAY0791 (warning; quick fix) |
30
+ | Profile appearance | `color scheme` in `appearance`; the accent, corner style and font as a palette entry and token values in the selected `theme` of the `design system` | `accent`, `corners` or `font` in a `ui profile`'s `appearance` | PLAY0929 (warning; quick fix moves the values into the theme) |
30
31
  | Literal text rules | `starts with`, `ends with`, `contains`, `not contains` or equality, preserving message and severity | Exact deprecated Studio `matches` shapes | PLAY0787 (warning; not arbitrary regex rewriting) |
31
32
  | Objects and lists | An indented block under the name: `member = value` lines, one `item` line per element, `<name> none` for an empty list | Inline JSON (`= {...}`, `= [...]`) - not accepted; Screenplay has no JSON | PLAY0833 (error; quick fix, and printing converts) |
32
33