@cratis/pi 7.167.3 → 7.168.1
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.
- package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +321 -89
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md +36 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/storylines.md +1 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +6 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +2 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/screens-before-slices.md +37 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +5 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +24 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract-exceptions.json +476 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +17 -19
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/design-system-and-themes.md +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/free-screens.md +237 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/scene-design.md +138 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +17 -1
- package/package.json +1 -1
package/package/corpus/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Free screens through typed proposals
|
|
2
|
+
|
|
3
|
+
Read this when a proposal adds, changes or removes a `shape`, a screen declared outside a slice, a need, a slice's adoption of a screen or the provision that supplies a need. The syntax, severities and diagnostics are in `cratis-screenplay-ui-composition` ([free screens](../../cratis-screenplay-ui-composition/references/free-screens.md)); the design decisions are in `cratis-screenplay-slice-design`.
|
|
4
|
+
|
|
5
|
+
Requires a Screenplay release whose MCP `syntax-schema` lists `ShapeSyntax` and `UsesScreenSyntax` (check `screenplay --version`; discover the members before constructing typed input).
|
|
6
|
+
|
|
7
|
+
## The nodes
|
|
8
|
+
|
|
9
|
+
| Construct | `read-ast` kind | Edit it with |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| A shape, the typed contract of a screen's data | `ShapeSyntax` | `add` a `PropertySyntax` to `properties`; `replace` a field's name or type; `remove` a field or the shape |
|
|
12
|
+
| A free screen at the top level, in a module or in a feature | `ScreenSyntax` | `add` to `screens` on an `ApplicationSyntax`, `ModuleSyntax` or `FeatureSyntax`; `replace` its directives; `remove` |
|
|
13
|
+
| A need a screen leaves to its adopters | `ScreenNeedSyntax` | `replace` the `type` or the `alias`; `add` to a screen's `directives`; `remove` |
|
|
14
|
+
| A slice's adoption of a screen | `UsesScreenSyntax` | `add` to `usedScreens` on a `SliceSyntax`; `replace` the `screen`; `remove` to stop adopting |
|
|
15
|
+
| The query that provides one need | `ScreenProvisionSyntax`, `ScreenProvisionMappingSyntax` | `add` to a `UsesScreenSyntax`'s `provisions` or a provision's `mappings`; `replace` the `need`, `query`, `by`, a mapping's `field` or `path`; `remove` |
|
|
16
|
+
|
|
17
|
+
Every member is omitted from the AST when empty, so a model with no free screens reads and writes the same AST as before. A screen a slice declares in its own body is a `ScreenSyntax` of that slice, as always.
|
|
18
|
+
|
|
19
|
+
## One coherent proposal
|
|
20
|
+
|
|
21
|
+
1. **Read first.** Read the existing shapes, screens and adoptions, and the target slice's read model and queries (`read-ast`, `declaration-details`, `find-references`), so a need is named after what exists and a provision targets a query that returns the right cardinality.
|
|
22
|
+
2. **Propose the whole change together:** the shape, the screen with its needs, the adoption with its provisions. A reviewer cannot judge a need without the provision that supplies it, and a half-proposal reports `PLAY1155` for the missing part.
|
|
23
|
+
3. **Use typed edits, not text.** `propose-ast` keeps identities and the proposal reports exact diagnostics; `propose-source` is for a whole-file rewrite. Never hand-edit a free screen's text to move or rename it.
|
|
24
|
+
4. **Read the diagnostics by code and typed `arguments`, never by message text.** `read-proposal` shows them before and after.
|
|
25
|
+
5. **Apply only the reviewed proposal** and fetch fresh handles afterwards: handles are revision-bound.
|
|
26
|
+
|
|
27
|
+
## What a proposal accepts and refuses
|
|
28
|
+
|
|
29
|
+
- A proposal that adopts a screen without providing every need is **accepted with warning** `PLAY1155`, as it is on disk. Report it as unfinished, not as done; only the executable-model export refuses it, with a reason naming the screen and the shape.
|
|
30
|
+
- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.
|
|
31
|
+
- A screen no slice adopts reports information `PLAY1164`: design-only, never an error and never in the executable model.
|
|
32
|
+
- A free screen's identity includes the module and feature it is declared in. Moving it to another scope changes its identity, so treat it as an identity-affecting edit and review the proposal's identity effects before applying.
|
|
33
|
+
|
|
34
|
+
## Verify and report
|
|
35
|
+
|
|
36
|
+
Run `screenplay <model> --warnaserror` on the applied model: it must report no unprovided need. Report separately what is only authored (a design-only screen, a screen whose slice does not compile to an executable model) and what is executable. Never drop a need or a provision to make a diagnostic disappear.
|
|
@@ -17,6 +17,7 @@ storyline <Name> ["<title>"]
|
|
|
17
17
|
- `<Name>` is unique among the application's storylines (`PLAY0943`); the optional title is what a board shows.
|
|
18
18
|
- `<kind>` is `module`, `feature`, `slice`, `command`, `event`, `readmodel`, `query`, `screen` or `reaction`; line order is path order.
|
|
19
19
|
- `<reference>` is the element's name; qualify it (`Returns.Requests`, `Requests.RequestReturn`) when several elements of that kind match (`PLAY0198`, warning).
|
|
20
|
+
- A `screen` step names any screen: one declared in a slice, or a free screen declared at the top level, in a module or in a feature, whether or not a slice has adopted it yet ([free screens](free-screens-proposals.md)).
|
|
20
21
|
- A storyline is declared at the top level, in exactly one file of a folder model.
|
|
21
22
|
|
|
22
23
|
```screenplay expect PLAY0533
|
|
@@ -276,6 +276,11 @@
|
|
|
276
276
|
{"kind":"skill-contains","value":"`slices`","file":"references/mcp-tools.md"},
|
|
277
277
|
{"kind":"skill-contains","value":"list-storylines","file":"references/mcp-tools.md"},
|
|
278
278
|
{"kind":"skill-contains","value":"storyline ReturnAnItem","file":"references/storylines.md"},
|
|
279
|
-
{"kind":"skill-contains","value":"`direction`","file":"references/mcp-tools.md"}
|
|
279
|
+
{"kind":"skill-contains","value":"`direction`","file":"references/mcp-tools.md"},
|
|
280
|
+
{"kind":"skill-contains","value":"references/free-screens-proposals.md"},
|
|
281
|
+
{"kind":"skill-contains","value":"`ScreenProvisionSyntax`, `ScreenProvisionMappingSyntax`","file":"references/free-screens-proposals.md"},
|
|
282
|
+
{"kind":"skill-contains","value":"accepted with warning","file":"references/free-screens-proposals.md"},
|
|
283
|
+
{"kind":"skill-contains","value":"**cannot be applied**","file":"references/free-screens-proposals.md"},
|
|
284
|
+
{"kind":"skill-contains","value":"A `screen` step names any screen","file":"references/storylines.md"}
|
|
280
285
|
]
|
|
281
286
|
}
|
|
@@ -199,7 +199,8 @@ PLAY0268, PLAY0468 and the reducer-view `PLAY0690` warning.
|
|
|
199
199
|
## `screen` — three levels
|
|
200
200
|
|
|
201
201
|
Excerpts: each screen sits in a slice, and the queries, commands and screens it names are
|
|
202
|
-
declared elsewhere.
|
|
202
|
+
declared elsewhere. A screen declared outside a slice states `data <Shape>[]` with no
|
|
203
|
+
`via query` (a need) and a slice provides it: `cratis-screenplay-ui-composition`, `references/free-screens.md`.
|
|
203
204
|
|
|
204
205
|
**Level 1 — intent.** Data and actions; the tool generates the component.
|
|
205
206
|
|
|
@@ -100,7 +100,7 @@ Ask the batch below only for what the request leaves open: (1) origin of each ac
|
|
|
100
100
|
components has one `data` line per component, each from its own read model
|
|
101
101
|
(`references/read-model-design.md`). One actor's point of view
|
|
102
102
|
per screen, at a real beat of the story, not one per persona for symmetry; know where the
|
|
103
|
-
actor sees each state change's result. Beyond Level 1: `cratis-screenplay-ui-composition`.
|
|
103
|
+
actor sees each state change's result. A screen drawn before its slice is a free screen whose `data <Shape>[]` is a need the adopting slice provides: `references/screens-before-slices.md`. Beyond Level 1: `cratis-screenplay-ui-composition`.
|
|
104
104
|
**Placement** (Screenplay 6): a State Change slice's screen says what it fits, in order of
|
|
105
105
|
preference (`fits dialog, drawer, pane`); the hook that starts it (a `button` naming the slice
|
|
106
106
|
in a template's actions outlet) picks the first fit the page has free, and names a place
|
|
@@ -207,6 +207,7 @@ Read [references/neighbouring-skills.md](references/neighbouring-skills.md) when
|
|
|
207
207
|
- `references/slicing.md` - slice naming, dependencies, state table, generic edits, coverage,
|
|
208
208
|
next slice.
|
|
209
209
|
- `references/worked-example.md` - parcel lockers, design mode, complete and compiling.
|
|
210
|
+
- `references/screens-before-slices.md` - where a screen lives, design order for free screens, shape lineage, reporting.
|
|
210
211
|
|
|
211
212
|
## Lineage
|
|
212
213
|
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/screens-before-slices.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Screens before slices
|
|
2
|
+
|
|
3
|
+
Syntax, severities and diagnostics of free screens, shapes, `uses screen` and provisions are owned by `cratis-screenplay-ui-composition` ([free screens](../../cratis-screenplay-ui-composition/references/free-screens.md)). This page covers the design decisions: when to draw the screen first, what the contract is, and how the slice that serves it stays honest.
|
|
4
|
+
|
|
5
|
+
## Where the screen lives
|
|
6
|
+
|
|
7
|
+
| Situation | Declare the screen |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Exactly one slice serves it and nothing else needs it | In that slice (unchanged). |
|
|
10
|
+
| It is drawn before any slice exists, or a storyline walks through it | Free: top level, module or feature, with its data as needs. |
|
|
11
|
+
| Two or more slices render the same screen | Free, in the module or feature they share; each slice adopts it. |
|
|
12
|
+
| It belongs to one module or feature but is served by several slices | Free, in that module or feature. |
|
|
13
|
+
|
|
14
|
+
Never invent a slice only to host a screen, and never copy a screen into several slices to avoid adoption.
|
|
15
|
+
|
|
16
|
+
## Design order
|
|
17
|
+
|
|
18
|
+
1. **Level 1 first.** Decide what the screen shows and what the user can do (`data`, `action`), as for any screen. A screen with neither a need nor an action is still a gap.
|
|
19
|
+
2. **Name the need as a shape, not as a read model.** The need says what the screen reads (`number`, `amount`, `dueDate`), in the business's words. A read model is chosen later, by the slice, so naming one now defeats the point.
|
|
20
|
+
3. **Decide inferred or explicit.** Leave the shape inferred while the screen is a sketch. Declare a `shape` with typed fields when more than one slice will adopt the screen, when sample data must be checked against the contract, or when a reviewer needs the contract written down. An explicit shape is a promise: adopters must meet its types.
|
|
21
|
+
4. **One need per purpose.** A screen that shows open and overdue invoices needs two lists. Use aliases (`data Invoice[] as overdue`) and two queries, never one read model with a flag that the screen filters.
|
|
22
|
+
5. **Adopt from the slice that owns the view.** The adopting slice is a State View slice whose read model and query already answer the need, or one you add for it. Each need has its own purpose-built read model: specialization over reuse.
|
|
23
|
+
6. **Provide, then map.** Provide each need from a query of the right cardinality. Add `from` only where names differ; if many names differ, the read model's names are probably wrong, not the shape's.
|
|
24
|
+
|
|
25
|
+
## Lineage: a shape field is not an origin
|
|
26
|
+
|
|
27
|
+
Every field a screen reads still needs an origin ([field lineage](field-lineage.md)): a shape field resolves to a read model property, which resolves to the event property or state that fills it. The compiler checks the first hop (`PLAY1160`, `PLAY1161`); the rest is the lineage pass.
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
PLAY1160: Read model 'InvoiceRow' of query 'ListInvoices' has no 'dueDate' to provide 'dueDate' of 'Invoice'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
When this appears, add the property to the slice's read model and trace it to an event the slice already consumes, or add the fact that carries it. Never delete the field from the screen or the shape to make the diagnostic disappear, and never give the screen a default for a value no event knows.
|
|
34
|
+
|
|
35
|
+
## Reporting
|
|
36
|
+
|
|
37
|
+
For each free screen, say in two or three sentences what it shows and what the user can do, and one of: **adopted by** a named slice (with the provided needs), or **design-only**, with the slice that should adopt it. A design-only screen is design intent: it is not in the UI contract, and a flow that depends on it is not delivered. A finished model has no unprovided need: `screenplay <model> --warnaserror` must report none.
|
|
@@ -65,6 +65,10 @@
|
|
|
65
65
|
{
|
|
66
66
|
"kind": "skill-contains",
|
|
67
67
|
"value": "one `data` line per component"
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
|
+
{ "kind": "skill-contains", "value": "references/screens-before-slices.md" },
|
|
70
|
+
{ "kind": "skill-contains", "value": "Name the need as a shape, not as a read model.", "file": "references/screens-before-slices.md" },
|
|
71
|
+
{ "kind": "skill-contains", "value": "Never delete the field from the screen or the shape", "file": "references/screens-before-slices.md" },
|
|
72
|
+
{ "kind": "skill-contains", "value": "A design-only screen is design intent", "file": "references/screens-before-slices.md" }
|
|
69
73
|
]
|
|
70
74
|
}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- Set once, dictionary keys and children ordering (PLAY0956-PLAY0963)
|
|
27
27
|
- Development users (PLAY0888-PLAY0889)
|
|
28
28
|
- Storylines (PLAY0940-PLAY0943)
|
|
29
|
+
- Free screens, shapes and adoptions
|
|
29
30
|
- Screen visuals and slice placements (PLAY0950-PLAY0955)
|
|
30
31
|
- Structural completeness and timeline checks
|
|
31
32
|
- Editor versus C# verdicts
|
|
@@ -492,6 +493,29 @@ Requires Screenplay 6.6.0 or later (`screenplay --version`). Authoring metadata;
|
|
|
492
493
|
| `PLAY0942` | W | A step names an element that no declaration of that kind matches; remove it or point it at its replacement. An ambiguous step is `PLAY0198`: qualify it. |
|
|
493
494
|
| `PLAY0943` | E | Two storylines carry the same name. |
|
|
494
495
|
|
|
496
|
+
## Free screens, shapes and adoptions
|
|
497
|
+
|
|
498
|
+
Requires a Screenplay release later than 6.31.0 that carries free screens (`screenplay --version`); earlier compilers reject a top-level `shape` or `screen` with `PLAY0001`, and `screenplay-contract.json` lists the codes only once the pin moves. Syntax, severities and fixes: `../../cratis-screenplay-ui-composition/references/free-screens.md`; the design decisions: `../../cratis-screenplay-slice-design/references/screens-before-slices.md`.
|
|
499
|
+
|
|
500
|
+
| Code | Severity | Meaning / fix |
|
|
501
|
+
| --- | --- | --- |
|
|
502
|
+
| `PLAY1149` | E | A `shape` is malformed, sits anywhere but the top level of a document, or has a field with a key, identifier, subject or generated modifier. Write `shape <Name>` with `<name> <Type>` fields at the top level. |
|
|
503
|
+
| `PLAY1150` | E | A `uses screen`, a provision or a mapping is malformed: `uses screen <Name>` directly in a slice, `data <Need> via query <Query> [by <param>]`, `<field> from <path>`. |
|
|
504
|
+
| `PLAY1151` | E | A `shape` is declared twice; declare it once at the top level. |
|
|
505
|
+
| `PLAY1152` | E | A screen is declared twice in one scope (document, module or feature); rename or remove one. |
|
|
506
|
+
| `PLAY1153` | E | A screen needs one shape twice or two needs share a name; tell them apart with `as <alias>` and provide each by its alias. |
|
|
507
|
+
| `PLAY1154` | E | A slice adopts one screen twice; keep one `uses screen` and put every provision under it. |
|
|
508
|
+
| `PLAY1155` | W | An adopted screen has a need the slice does not provide. Fails any warnings-as-errors gate and executable screen admission; add `data <Need> via query <Query>` under `uses screen`. |
|
|
509
|
+
| `PLAY1156` | E | A provision names a need the screen does not have; the message lists what it needs. |
|
|
510
|
+
| `PLAY1157` | E | A provision names data the screen already sources with its own `data <ReadModel> via query`; remove the provision. |
|
|
511
|
+
| `PLAY1158` | E | One need is provided twice in one adoption. |
|
|
512
|
+
| `PLAY1159` | E | A list query provides a single need, or a single-value query a list need; pick the query of the right cardinality. |
|
|
513
|
+
| `PLAY1160` | E | A field the screen reads, or the shape declares, is not on the providing read model, by name or through `from`; fix the read model or the mapping. |
|
|
514
|
+
| `PLAY1161` | E | A read model property has another type than the explicit shape declares (a concept stands for its primitive); fix the read model, not the shape. |
|
|
515
|
+
| `PLAY1162` | E | A provision's `by` is not a parameter of the query; use a declared parameter. |
|
|
516
|
+
| `PLAY1163` | E | A mapping names a field the screen does not read and the shape does not declare; remove or correct it. |
|
|
517
|
+
| `PLAY1164` | I | A screen no slice adopts is design-only: never fails any gate, and is absent from the executable model and the UI contract. Adopt it with `uses screen` when it must render. |
|
|
518
|
+
|
|
495
519
|
## Screen visuals and slice placements (PLAY0950-PLAY0955)
|
|
496
520
|
|
|
497
521
|
Requires Screenplay 6.7.0 or later (`screenplay --version`). Both are presentation-only; neither
|