@cratis/pi 7.14.2 → 7.14.3
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/skills/cratis-application-slice-conformance/SKILL.md +11 -2
- package/package/corpus/skills/cratis-application-slice-conformance/references/build-prompts.md +8 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +10 -6
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +11 -7
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +12 -2
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +16 -1
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +7 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/observable-emission-guards.md +9 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +20 -15
- package/package/corpus/skills/cratis-arc-command/references/command-result.md +7 -0
- package/package/corpus/skills/cratis-arc-command/references/handler-shapes.md +10 -3
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-command-operation/SKILL.md +5 -1
- package/package/corpus/skills/cratis-arc-command-operation/references/execution-and-recovery.md +12 -0
- package/package/corpus/skills/cratis-arc-command-operation/references/testing.md +10 -3
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +20 -116
- package/package/corpus/skills/cratis-arc-command-typescript/references/chronicle-events.md +11 -8
- package/package/corpus/skills/cratis-arc-command-typescript/references/command-specifications.md +63 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/hosting-and-storage.md +10 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/proxy-generation.md +38 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/slice-layout.md +19 -0
- package/package/corpus/skills/cratis-arc-command-typescript/verification.json +1 -1
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +11 -10
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +30 -19
- package/package/corpus/skills/cratis-arc-react-page/references/data-page.md +11 -0
- package/package/corpus/skills/cratis-arc-react-page/references/data-tables.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/references/dialogs.md +12 -10
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/references/mvvm.md +11 -0
- package/package/corpus/skills/cratis-arc-react-page/references/queries-and-commands.md +7 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +58 -122
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/compatibility-check.md +26 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +22 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/hosting.md +31 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +52 -131
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/append-api.md +19 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/variants.md +73 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +29 -232
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-lifecycle.md +20 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/discovery-and-registration.md +44 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/java-api.md +33 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/spring-boot.md +54 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/variants.md +77 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +26 -102
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/read-models-and-projections.md +23 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/variants.md +63 -0
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -13
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -4
- package/package/corpus/skills/cratis-chronicle-projection/references/fluent-builder.md +10 -0
- package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md +14 -6
- package/package/corpus/skills/cratis-chronicle-projection/references/variants.md +9 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +7 -49
- package/package/corpus/skills/cratis-chronicle-reactor/references/domain-failures.md +19 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/specifications.md +33 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-read-model/references/queries.md +11 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +1 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +24 -24
- package/package/corpus/skills/cratis-content-length/SKILL.md +1 -1
- package/package/corpus/skills/cratis-content-length/references/length-evidence.md +12 -0
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +19 -19
- package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +10 -0
- package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +10 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +5 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/code-style.md +15 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +9 -4
- package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +1 -2
- package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +8 -0
- package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +1 -2
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +10 -0
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +1 -1
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +18 -18
- package/package/corpus/skills/cratis-performance-review/SKILL.md +1 -1
- package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +29 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +16 -4
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +4 -15
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +6 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +1 -6
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +45 -245
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +42 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +155 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +27 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-reads-example.md +21 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +69 -227
- package/package/corpus/skills/cratis-screenplay-command-surface/references/context.md +10 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +51 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +62 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +46 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +36 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +11 -11
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +10 -3
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +1 -6
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +13 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +8 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +11 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +7 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +75 -198
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/file-layout.md +89 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/naming-primitives.md +26 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +14 -1
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +8 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/slice-type-rules.md +12 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +12 -6
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +5 -6
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/candidate-inventory.md +11 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +8 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +11 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +33 -10
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +8 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +13 -17
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +11 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +9 -9
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +9 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +15 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +9 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +17 -8
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +8 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +1 -6
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +19 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +1 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +11 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +2 -2
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +3 -4
- package/package/corpus/skills/cratis-screenplay-projections/references/pdl-grammar.md +8 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +8 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +10 -10
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +8 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +4 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +17 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +10 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +11 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +12 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +7 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +8 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +16 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +10 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +52 -360
- package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +34 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +77 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +39 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +72 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +110 -0
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +6 -6
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +21 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +16 -20
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +16 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +13 -7
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +10 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +10 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +10 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +12 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +11 -13
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +1 -1
- package/package/corpus/skills/cratis-social-feed-post/SKILL.md +10 -10
- package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +12 -0
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +13 -2
- package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +10 -10
- package/package/corpus/skills/cratis-specifications-csharp/references/csharp-patterns.md +10 -0
- package/package/corpus/skills/cratis-specifications-csharp/references/integration-specs.md +9 -0
- package/package/corpus/skills/cratis-specifications-typescript/SKILL.md +1 -2
- package/package/corpus/skills/cratis-specifications-typescript/references/typescript-patterns.md +11 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -21
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +9 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +5 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +2 -4
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +2 -2
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +39 -39
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## Inline events and destinations
|
|
2
|
+
|
|
3
|
+
Use `produces event` when the command introduces a new, generation-1 event.
|
|
4
|
+
This complete example declares its payload and mappings together:
|
|
5
|
+
|
|
6
|
+
````screenplay
|
|
7
|
+
concept ProjectId : Uuid
|
|
8
|
+
concept ProjectName : String
|
|
9
|
+
module Projects
|
|
10
|
+
feature Naming
|
|
11
|
+
slice StateChange RenameProject
|
|
12
|
+
command RenameProject
|
|
13
|
+
projectId ProjectId identifier
|
|
14
|
+
name ProjectName
|
|
15
|
+
produces event ProjectRenamed
|
|
16
|
+
description "A project received a new name"
|
|
17
|
+
documentation
|
|
18
|
+
```markdown
|
|
19
|
+
Existing links retain the project's identity.
|
|
20
|
+
```
|
|
21
|
+
tag audit
|
|
22
|
+
name ProjectName = name
|
|
23
|
+
````
|
|
24
|
+
|
|
25
|
+
The omitted `for` means the command's required scalar identifier **only for
|
|
26
|
+
inline productions**, when every production targets that same source. Once a
|
|
27
|
+
production targets another source, every production must state `for`. Mixing
|
|
28
|
+
omitted inline and plain destinations also fails (`PLAY0470`); there is no
|
|
29
|
+
verified MCP repair for that diagnostic. Explicit syntax does not make cross-source
|
|
30
|
+
execution supported.
|
|
31
|
+
|
|
32
|
+
Plain `produces X` references a declared event; omitting `for` does not infer
|
|
33
|
+
the command's identifier. In ESM v2+, it inherits a sibling production's resolved
|
|
34
|
+
destination through the command destination default. An allocated identity is
|
|
35
|
+
used only when no production resolves a destination. State `for` explicitly on
|
|
36
|
+
every production targeting the identifier. `PLAY0478` offers advice and a
|
|
37
|
+
reviewed repair, not permission to silently retarget an append. Supply an
|
|
38
|
+
allocated identity to the executable model when allocation is intentional.
|
|
39
|
+
|
|
40
|
+
Inline declarations are slice-owned contracts, usable by other consumers.
|
|
41
|
+
Their `tag` lines are event-type tags; plain production tags apply at that one
|
|
42
|
+
append site. Both inline and standalone events accept a quoted description or
|
|
43
|
+
text/Markdown description fence, and one nonempty fenced Markdown `documentation`.
|
|
44
|
+
New events omit `id`. Only a rename preserving an old stored name needs
|
|
45
|
+
`id "<old name>"`; it does not replace the catalog's `EventContractId`.
|
|
46
|
+
|
|
47
|
+
| Diagnostic | What to change |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `PLAY0469` | Do not copy the same-source command identifier into payload. Inline copies warn; plain copies with explicit `for` are information. Review persistence before changing a contract. |
|
|
50
|
+
| `PLAY0471` / `PLAY0472` | Remove a redundant name-equal `id`; an id must be one nonempty quoted value. |
|
|
51
|
+
| `PLAY0473` / `PLAY0474` | Avoid declaration/import collisions; inline events belong only in commands, never reactions. |
|
|
52
|
+
| `PLAY0475` | Extract the inline event before adding generations. |
|
|
53
|
+
| `PLAY0476` | Inline `origin` and unescaped system-assigned production metadata are forbidden. |
|
|
54
|
+
| `PLAY0477` | Use one nonempty Markdown documentation fence. |
|
|
55
|
+
|
|
56
|
+
MCP can declare a missing produced event (`PLAY0166`), add explicit routing
|
|
57
|
+
(`PLAY0478`), remove a redundant pin (`PLAY0471`), or remove an inline identifier
|
|
58
|
+
copy (`PLAY0469`). The last **changes the event contract**, retires a property,
|
|
59
|
+
refuses affected consumers/opaque implementations and is not fix-all. It does
|
|
60
|
+
not establish that stored data is safe to migrate. Use
|
|
61
|
+
`cratis-screenplay-model-authoring` for discovery, preview, extraction and rename.
|
|
62
|
+
|
package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Policies, personas and seed
|
|
2
|
+
|
|
3
|
+
## `policy` and `persona`
|
|
4
|
+
|
|
5
|
+
```screenplay
|
|
6
|
+
policy IsAuthenticated
|
|
7
|
+
require authenticated
|
|
8
|
+
policy IsAccountant
|
|
9
|
+
require role "Accountant"
|
|
10
|
+
policy CanManageInvoice
|
|
11
|
+
require role "InvoiceManager"
|
|
12
|
+
or role "Accountant"
|
|
13
|
+
policy OwnsInvoice
|
|
14
|
+
require claim "sub" matches subject
|
|
15
|
+
policy IsAdultCustomer
|
|
16
|
+
file Policies/IsAdultCustomer.cs
|
|
17
|
+
|
|
18
|
+
persona Accountant
|
|
19
|
+
description "Handles invoicing and collections"
|
|
20
|
+
policy IsAccountant
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Three condition forms: `authenticated`, `role "<name>"`, and
|
|
24
|
+
`claim "<name>" matches subject | "<value>" | <path>`. A policy has **exactly one**
|
|
25
|
+
`require` line — continue the condition on deeper-indented lines instead of adding
|
|
26
|
+
a second (`PLAY0441`) — **or** one implementation (a tagged ` ```csharp ` block or
|
|
27
|
+
`file`), never both (`PLAY0440`). Declarative policies run in the reference
|
|
28
|
+
runner; a code policy binds as opaque ESM v3 and needs a target to evaluate it.
|
|
29
|
+
A `persona` is authoring metadata: the binder reports it as information `PLAY0270`
|
|
30
|
+
(report-only) and it does not block binding; an unknown policy it lists is an error.
|
|
31
|
+
|
|
32
|
+
## `seed`
|
|
33
|
+
|
|
34
|
+
Excerpt: `CustomerRegistered` is declared in a slice.
|
|
35
|
+
|
|
36
|
+
```screenplay
|
|
37
|
+
seed
|
|
38
|
+
for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
39
|
+
CustomerRegistered
|
|
40
|
+
name = "Acme Corp"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Events append to that event source in declaration order, using the same mapping
|
|
44
|
+
expression grammar as `produces`. Several `seed` blocks accumulate. Seeding is
|
|
45
|
+
operational metadata, not part of executable behavior (`PLAY0270`).
|
|
46
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Validation rule forms
|
|
2
|
+
|
|
3
|
+
## Rule vocabulary
|
|
4
|
+
|
|
5
|
+
| Rule | Example |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `not empty` | `name not empty` |
|
|
8
|
+
| `max <n>` / `min <n>` | `reason max 500` (length on text), `quantity min 1` (value on numbers) |
|
|
9
|
+
| `> <v>` / `>= <v>` / `< <v>` / `<= <v>` | `quantity > 0`, `discountPct <= 100` |
|
|
10
|
+
| `== <v>` / `!= <v>` | `currency == "NOK"`, `status != draft` |
|
|
11
|
+
| `length == <n>` | `currency length == 3` |
|
|
12
|
+
| `matches email` | the only named pattern; any other name is `PLAY0366` |
|
|
13
|
+
| `matches "<regex>"` | ECMAScript; matches **any substring** unless anchored with `^…$`; an invalid pattern is `PLAY0367` |
|
|
14
|
+
| `all > <v>` / `all >= <v>` | `lines.quantity all > 0` |
|
|
15
|
+
| `rule <Name>` | `orgNumber rule BeAValidOrganizationNumber` |
|
|
16
|
+
|
|
17
|
+
## Rules whose logic is code
|
|
18
|
+
|
|
19
|
+
**Rules whose logic is code.** A bare `rule <Name>` records that a rule exists but
|
|
20
|
+
has no portable meaning (`PLAY0268`). Give it a body when the logic can live in the
|
|
21
|
+
model — a `file` or a tagged ` ```csharp ` fence indented under the rule, or a
|
|
22
|
+
fenced `validate` block for cross-field rules. Excerpt, inside a command:
|
|
23
|
+
|
|
24
|
+
```screenplay
|
|
25
|
+
validate
|
|
26
|
+
orgNumber rule BeAValidOrganizationNumber message "Must be a valid organization number"
|
|
27
|
+
file Validations/BeAValidOrganizationNumber.cs
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A bodied rule or fenced block on a validation, rule or policy binds as opaque code
|
|
31
|
+
(ESM v3): the reference runner reports it unsupported, and a target must supply the
|
|
32
|
+
implementation. Two exceptions never bind: the command `handler`, and a `file`
|
|
33
|
+
constraint (the binder records the requirement, then rejects it with `PLAY0268`;
|
|
34
|
+
only `unique` constraints bind).
|
|
35
|
+
Stage 4.24 admits only pure reducer bodies, so such a body is gap-fill code there. Prefer a
|
|
36
|
+
declarative rule when one can say it.
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"fixtures": [],
|
|
5
5
|
"assertions": [
|
|
6
6
|
{ "kind": "skill-contains", "value": "main `fd18129`" },
|
|
7
|
-
{ "kind": "skill-contains", "value": "produces event ProjectRenamed" },
|
|
8
|
-
{ "kind": "skill-contains", "value": "name ProjectName = name" },
|
|
9
|
-
{ "kind": "skill-contains", "value": "In ESM v2+, it inherits a sibling production's resolved\ndestination through the command destination default" },
|
|
10
|
-
{ "kind": "skill-contains", "value": "An allocated identity is\nused only when no production resolves a destination" },
|
|
11
|
-
{ "kind": "skill-contains", "value": "State `for` explicitly on\nevery production targeting the identifier" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "produces event ProjectRenamed", "file": "references/inline-events.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "name ProjectName = name", "file": "references/inline-events.md" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "In ESM v2+, it inherits a sibling production's resolved\ndestination through the command destination default", "file": "references/inline-events.md" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "An allocated identity is\nused only when no production resolves a destination", "file": "references/inline-events.md" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "State `for` explicitly on\nevery production targeting the identifier", "file": "references/inline-events.md" },
|
|
12
12
|
{ "kind": "skill-contains", "value": "PLAY0478" },
|
|
13
13
|
{ "kind": "skill-contains", "value": "PLAY0479" },
|
|
14
|
-
{ "kind": "skill-contains", "value": "changes the event contract" },
|
|
14
|
+
{ "kind": "skill-contains", "value": "changes the event contract", "file": "references/inline-events.md" },
|
|
15
15
|
{ "kind": "skill-contains", "value": "`reads X optional` is not supported yet" },
|
|
16
16
|
{
|
|
17
17
|
"kind": "skill-contains",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"kind": "skill-contains",
|
|
78
|
-
"value": "No supported ESM version admits them"
|
|
78
|
+
"value": "No supported ESM version admits them", "file": "references/generated-values-and-responses.md"
|
|
79
79
|
},
|
|
80
80
|
{ "kind": "skill-contains", "value": "Generated values and responses (ESM v7)" },
|
|
81
|
-
{ "kind": "skill-contains", "value": "A generated value is not a request input" },
|
|
82
|
-
{ "kind": "skill-contains", "value": "(`PLAY0273`), and a concept with any validation rule cannot back a\n generated property (`PLAY0268`)" },
|
|
83
|
-
{ "kind": "skill-contains", "value": "A response exists only on acceptance" },
|
|
84
|
-
{ "kind": "skill-contains", "value": "**not rendered yet**" },
|
|
81
|
+
{ "kind": "skill-contains", "value": "A generated value is not a request input", "file": "references/generated-values-and-responses.md" },
|
|
82
|
+
{ "kind": "skill-contains", "value": "(`PLAY0273`), and a concept with any validation rule cannot back a\n generated property (`PLAY0268`)", "file": "references/generated-values-and-responses.md" },
|
|
83
|
+
{ "kind": "skill-contains", "value": "A response exists only on acceptance", "file": "references/generated-values-and-responses.md" },
|
|
84
|
+
{ "kind": "skill-contains", "value": "**not rendered yet**", "file": "references/generated-values-and-responses.md" },
|
|
85
85
|
{ "kind": "skill-contains", "value": "4.68.0" }
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -33,6 +33,13 @@ syntax and tool commands in `cratis-screenplay-toolchain`.
|
|
|
33
33
|
entry-point session proposes a model, at most once per session; the master definition is in
|
|
34
34
|
`cratis-screenplay-modeling-lifecycle`. A direct request to model this scope is itself consent.
|
|
35
35
|
|
|
36
|
+
## Evidence and privacy
|
|
37
|
+
|
|
38
|
+
- Do not paste production data, customer records or personal data into hosted models or
|
|
39
|
+
sub-agents without the user's approval. Use invented examples in the model and in
|
|
40
|
+
specifications.
|
|
41
|
+
- Classify personal data on the concept as soon as it shows up.
|
|
42
|
+
|
|
36
43
|
## Verified product sources
|
|
37
44
|
|
|
38
45
|
Pins (Screenplay v4.66.0 `c89198b`, cratis CLI v3.28.3, Stage v4.24.2, Arc v22.50.5, Chronicle
|
|
@@ -221,10 +228,10 @@ and the report says which verdicts were not run (V2 to V5 are not run in discove
|
|
|
221
228
|
- `references/personas-and-causes.md` - role catalogue, Cannot resolved to executable gates.
|
|
222
229
|
- `references/divergent-sweep.md` - lenses for the wide pass.
|
|
223
230
|
- `references/plotting-and-handoff.md` - after / caused by / only if, plot format, whose turn it is, Storyline seed, handoff packet.
|
|
224
|
-
- `references/facilitation.md` - running sessions, disagreement, closing, unattended runs.
|
|
231
|
+
- `references/facilitation.md` - running sessions, disagreement, closing, unattended runs. Read when facilitating a group, handling disagreement, or closing an attended or unattended session.
|
|
225
232
|
- `references/human-workshop.md` - supporting a human workshop: preparation, run sheet, live scribing.
|
|
226
|
-
- `references/worked-session.md` - a short session end to end.
|
|
227
|
-
- `references/provenance.md` - sources and attribution.
|
|
233
|
+
- `references/worked-session.md` - a short session end to end. Read when you need an end-to-end example of discovery from thin input.
|
|
234
|
+
- `references/provenance.md` - sources and attribution. Read when checking source attribution or adaptation history.
|
|
228
235
|
|
|
229
236
|
## Lineage
|
|
230
237
|
|
|
@@ -42,12 +42,7 @@ that decision. If not, note the need as a view and move on.
|
|
|
42
42
|
- Prefer assumptions that keep the model honest (fewer, clearly named facts) over ones that
|
|
43
43
|
invent detail.
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- Do not paste production data, customer records or personal data into hosted models or
|
|
48
|
-
sub-agents without the user's approval. Use invented examples in the model and in
|
|
49
|
-
specifications.
|
|
50
|
-
- Classify personal data on the concept as soon as it shows up.
|
|
45
|
+
See "Evidence and privacy" in SKILL.md.
|
|
51
46
|
|
|
52
47
|
## Closing a session
|
|
53
48
|
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Supporting a human workshop
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- The agent's part
|
|
6
|
+
- Before the workshop
|
|
7
|
+
- Run sheet: discovery
|
|
8
|
+
- Techniques
|
|
9
|
+
- Remote adaptations
|
|
10
|
+
- After the workshop
|
|
11
|
+
- Multi-day plan mapped to phases
|
|
12
|
+
- Checklists
|
|
13
|
+
- Success indicators
|
|
14
|
+
- Evidence and privacy
|
|
15
|
+
|
|
3
16
|
Adapted in part from TrogonStack `eventmodeling-brainstorming-events/references/facilitating-event-modeling-workshops.md`
|
|
4
17
|
(MIT; see `provenance.md`), reshaped for Screenplay and for an agent in a supporting role.
|
|
5
18
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Personas and causes
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Role catalogue on `persona`
|
|
6
|
+
- What a Cannot line becomes
|
|
7
|
+
- Cannot resolved to an executable gate
|
|
8
|
+
- Checks while building
|
|
9
|
+
- Non-human causes (STATE.md, until a reaction or translation exists)
|
|
10
|
+
|
|
3
11
|
## Role catalogue on `persona`
|
|
4
12
|
|
|
5
13
|
Every actor the story mentions gets a catalogue entry. Human roles are `persona`
|
package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Plotting the story and handing it on
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- 1. Sequence
|
|
6
|
+
- 2. Record after / caused by / only if
|
|
7
|
+
- 3. Ask what can happen instead
|
|
8
|
+
- 4. Plot output format
|
|
9
|
+
- Whose turn is it in the story?
|
|
10
|
+
- Storyline: one view walked through its states
|
|
11
|
+
- 5. Plot checks
|
|
12
|
+
- Handoff packet to `cratis-screenplay-slice-design`
|
|
13
|
+
|
|
3
14
|
Plotting arranges the discovered events as a narrative: what happens first, what depends on
|
|
4
15
|
what, what can happen instead, where it ends. In Screenplay the plot is written into the
|
|
5
16
|
model (slice and feature `description` text) and into STATE.md; files sort by name, so story
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# The storming loop on `.play`
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- One turn
|
|
6
|
+
- Choosing the next question
|
|
7
|
+
- When to stop
|
|
8
|
+
- A discovery skeleton
|
|
9
|
+
|
|
3
10
|
The model is the whiteboard. Every piece of input is turned into model edits first; the chat
|
|
4
11
|
then reports what changed and asks one question. The user should always be able to look at the
|
|
5
12
|
`.play` source and see the conversation so far.
|
|
@@ -24,13 +24,13 @@ most reasonable answer, say so visibly where it can be corrected, never guess si
|
|
|
24
24
|
visibly during modeling; delivery blocks any guess that could encode a wrong rule, authorization,
|
|
25
25
|
money or time behavior. Contradictions, a third review round, a gate only the user can accept,
|
|
26
26
|
and approvals not yet given always stop
|
|
27
|
-
(`cratis-screenplay-modeling-lifecycle`, `references/stop-or-assume.md`).
|
|
27
|
+
(`cratis-screenplay-modeling-lifecycle`, `references/stop-or-assume.md`). Read `cratis-screenplay-modeling-lifecycle`'s `references/stop-or-assume.md` when information is missing or contradictory, or when deciding whether unattended work may proceed.
|
|
28
28
|
|
|
29
29
|
**Do not cut corners to save tokens or effort.** A rule that needs more slices, events, views,
|
|
30
30
|
translation steps or specifications gets them written; budget is never a reason to delete a
|
|
31
31
|
modeled behavior, label a gap "accepted debt" or merge translating outside data into our facts
|
|
32
32
|
into the work that acts on them. Flag a real trade-off to the user instead of resolving it by cutting the model
|
|
33
|
-
(`cratis-screenplay-modeling-lifecycle`, `references/completeness-self-check.md`).
|
|
33
|
+
(`cratis-screenplay-modeling-lifecycle`, `references/completeness-self-check.md`). Read `cratis-screenplay-modeling-lifecycle`'s `references/completeness-self-check.md` before every gate and whenever effort or token cost tempts a reduction in modeled behavior.
|
|
34
34
|
|
|
35
35
|
## Start here
|
|
36
36
|
|
|
@@ -85,6 +85,68 @@ keeps the activities, Screenplay output and facilitation questions of each step:
|
|
|
85
85
|
| 9 | Decompose into vertical slices | `cratis-screenplay-slice-design` |
|
|
86
86
|
| after 9 | Specifications, then review | `cratis-screenplay-scenario-coverage`, `cratis-screenplay-model-review` |
|
|
87
87
|
|
|
88
|
+
Read [references/nine-steps.md](references/nine-steps.md) when facilitating a workflow and needing a step's activities, required output, or questions. Read [references/invoicing-example.md](references/invoicing-example.md) when you need a complete worked `.play` document (RegisterInvoice command and InvoiceList view) to copy the shape from.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Verify
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
screenplay <model-folder> --warnaserror
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
(The standalone tool; `cratis screenplay validate <model-folder> --warnings-as-errors`
|
|
98
|
+
is the fallback, and neither names the other's verdict. Versions and commands:
|
|
99
|
+
`cratis-screenplay-toolchain`.)
|
|
100
|
+
|
|
101
|
+
- [ ] Zero errors **and zero warnings**. An unrecognized construct inside a slice
|
|
102
|
+
is only a warning (`PLAY0029`) and its block is **silently dropped** - a typo
|
|
103
|
+
can delete a whole projection while the exit code stays `0`.
|
|
104
|
+
- [ ] Every behavior is exactly one slice type, and the whole model validates
|
|
105
|
+
against the eight Quick gate checks.
|
|
106
|
+
- [ ] Every event is past tense, single-purpose, and carries no event-source id.
|
|
107
|
+
- [ ] Personal data is classified on the `concept`, with a reason.
|
|
108
|
+
- [ ] Specifications name the rejections, not only the happy path.
|
|
109
|
+
- [ ] If the model must reach a runtime, check it binds with the tool that will
|
|
110
|
+
consume it. The standalone 4.68.0 binder admits Automation and Translate slices
|
|
111
|
+
(ESM v6) and generated values and responses (ESM v7); Stage 4.24.0 admits ESM v1 to v3 (4.24.2: v1 to v4, evolved events refused with `STAGE-ESM-026`) and renders only `StateChange` and
|
|
112
|
+
`StateView` slices, so automations and translations are gap-fill there.
|
|
113
|
+
|
|
114
|
+
## Parsed is not runnable
|
|
115
|
+
|
|
116
|
+
The compiler accepts far more than anything executes. Between the syntax tree and
|
|
117
|
+
any runtime sits the **executable semantic model (ESM)**, and it fails closed:
|
|
118
|
+
what it cannot represent reports `PLAY0268` or `PLAY0271` and the model does not
|
|
119
|
+
bind. Keep four states apart when you report on a model: **parsed** (the
|
|
120
|
+
`screenplay` tool), **bound** (ESM), **reference-executed** (specifications pass
|
|
121
|
+
the reference runner) and **target-executed** (Stage or a rendered application).
|
|
122
|
+
The independent verdicts V1 to V5 that report them are in
|
|
123
|
+
`cratis-screenplay-modeling-lifecycle`.
|
|
124
|
+
|
|
125
|
+
What binds depends on **which tool** you ask, so name the tool and its version:
|
|
126
|
+
|
|
127
|
+
- `Automation` and `Translate` slices, reactions, captures and triggers: the
|
|
128
|
+
standalone `screenplay` 4.66.0 or later and the `cratis` 3.28.2 bundle (4.66.0) bind them (ESM v6).
|
|
129
|
+
The `cratis` 3.27.1 bundle (Screenplay 4.60.1) reported *Slice '<name>' of type '<type>'
|
|
130
|
+
is not admitted by ESM v1.* Stage 4.24.2 admits only ESM v1 to v4 and renders none of them.
|
|
131
|
+
- `reads` and `concurrency` on a command do not bind (`PLAY0271`), so no decision is
|
|
132
|
+
protected against stale state. A reaction trigger's `reads` that only `invokes` is
|
|
133
|
+
report-only intent (`PLAY0270`); one that `produces` directly fails binding (`PLAY0268`).
|
|
134
|
+
- `persona` declarations are report-only and never block; `@pii` and `@sensitive`
|
|
135
|
+
concepts do block binding (`PLAY0268`). Keep them anyway: the classification is
|
|
136
|
+
part of the model. Report the block.
|
|
137
|
+
- Generated values and `returns` responses bind and execute from standalone 4.68.0 (ESM v7) but fail binding
|
|
138
|
+
with `PLAY0268` on the 4.66.0 bundled in `cratis` 3.28.x, and Stage 4.24.2 does not render them
|
|
139
|
+
(`STAGE-ESM-016`, tracked in Stage#201): gap-fill. Operations and systems, and event sources and
|
|
140
|
+
streams, are authorable but non-executable (`PLAY0268`; not admitted by any supported ESM version);
|
|
141
|
+
a command `handler` never binds.
|
|
142
|
+
|
|
143
|
+
The ESM versions, the full disposition table and the Step 7 clock example's binding
|
|
144
|
+
result are in [references/parsed-not-runnable.md](references/parsed-not-runnable.md)
|
|
145
|
+
and `cratis-screenplay-toolchain` (`references/executable-subset.md`). Read `references/parsed-not-runnable.md` when determining the required ESM version or interpreting binding dispositions. Read `cratis-screenplay-toolchain`'s `references/executable-subset.md` when checking binder admission or reference-execution limits. Model the wider
|
|
146
|
+
language freely when the `.play` file **is** the deliverable - documentation,
|
|
147
|
+
review, a shared description of a system. Never read a clean `screenplay` run as
|
|
148
|
+
evidence a construct works downstream.
|
|
149
|
+
|
|
88
150
|
## Locate the model
|
|
89
151
|
|
|
90
152
|
Look first for the project's existing `.play` files: the folder holding them is the
|
|
@@ -110,20 +172,14 @@ source is the single flow model.
|
|
|
110
172
|
| `Cratis.Screenplay.Tool` | `4.66.0` (`c89198b`) | Persona, operation and stream dispositions below were read at this tag, and the Step 7 clock example was probed through MCP on it |
|
|
111
173
|
|
|
112
174
|
The pin set for the whole Screenplay family, and which tool reports what, lives only in
|
|
113
|
-
`cratis-screenplay-toolchain` `references/versions.md`. The `fd18129` update follows
|
|
175
|
+
`cratis-screenplay-toolchain` `references/versions.md`. Read `cratis-screenplay-toolchain`'s `references/versions.md` before choosing a tool or reporting a version-dependent verdict. The `fd18129` update follows
|
|
114
176
|
`commands.md`, `events.md` and decision 0023 at that main commit (after v4.52.0);
|
|
115
177
|
compilation does not establish reference execution. The original baseline was checked at
|
|
116
178
|
tag `v4.31.0` (commit `355dffb`): `Documentation/screenplay/{slices,commands,folders,printing,interactions,specifications}.md`,
|
|
117
179
|
`projections/keys.md`, and decisions 0001 to 0014. Changed [nine-step examples](references/nine-steps.md)
|
|
118
180
|
use the newer commit and the 4.66.0 and 4.68.0 tools; do not attribute them to the old tag.
|
|
119
181
|
|
|
120
|
-
|
|
121
|
-
> the GWT discipline follow **Event Modeling** (Adam Dymitruk; Martin Dilger,
|
|
122
|
-
> *Understanding Eventsourcing*), as structured in
|
|
123
|
-
> [jwilger/agent-skills `event-modeling`](https://github.com/jwilger/agent-skills/tree/main/skills/event-modeling).
|
|
124
|
-
> Screenplay adopts that vocabulary directly: *"Slices are the atom - everything
|
|
125
|
-
> lives inside a typed slice aligned with Event Modeling's vocabulary."*
|
|
126
|
-
> Where Cratis deliberately diverges, this skill says so.
|
|
182
|
+
Read [references/slice-type-rules.md](references/slice-type-rules.md) when deciding if a behavior is an Automation or a Translate slice.
|
|
127
183
|
|
|
128
184
|
## Two phases - discovery, then design
|
|
129
185
|
|
|
@@ -152,16 +208,7 @@ Every behavior is exactly one. An unknown slice type is a compile error:
|
|
|
152
208
|
| Event -> decision -> Command/Event | `Automation` | `reaction` |
|
|
153
209
|
| External data -> Event | `Translate` | `capture` |
|
|
154
210
|
|
|
155
|
-
|
|
156
|
-
appear as many times as the behavior needs. Only `description` is limited to one.
|
|
157
|
-
|
|
158
|
-
**Automation has four required components** - a triggering occurrence, the state
|
|
159
|
-
it consults (the trigger's `reads`), conditional logic, and a resulting command
|
|
160
|
-
or event. If the events are always unconditionally co-produced, it is **not** an
|
|
161
|
-
automation: model it as one `StateChange` slice with several `produces` blocks.
|
|
162
|
-
|
|
163
|
-
**Translation is workflow-specific anti-corruption.** Generic infrastructure every
|
|
164
|
-
workflow needs (event persistence, message transport) is not a `Translate` slice.
|
|
211
|
+
Read [references/parsed-not-runnable.md](references/parsed-not-runnable.md) (section "Decision 0006 and shipped generations") when deciding whether a decided construct (trigger `reads`, event generations) is implemented. An accepted decision is not necessarily implemented.
|
|
165
212
|
|
|
166
213
|
## Where Cratis diverges from the generic method
|
|
167
214
|
|
|
@@ -171,7 +218,7 @@ compile or will not be safe. Both are deliberate.
|
|
|
171
218
|
- **A command may read state.** The generic method forbids `ReadModel -> Command`
|
|
172
219
|
edges. Screenplay ships `reads <ReadModel> [as <alias>] [by <property>]` so the
|
|
173
220
|
model shows what a state-dependent decision consulted. **It is not a protected
|
|
174
|
-
read
|
|
221
|
+
read at Screenplay 4.68.0:** nothing checks at append time that the state is still current,
|
|
175
222
|
the executable model rejects `reads` and `concurrency` (`PLAY0271`), and adding
|
|
176
223
|
`concurrency` does not make the decision safe (decision 0003, Screenplay #129).
|
|
177
224
|
Write a state-dependent rule as `reads <View>` plus `require <expr> message "..."`
|
|
@@ -190,32 +237,11 @@ compile or will not be safe. Both are deliberate.
|
|
|
190
237
|
the modeled `reads` + `require` intent, specifications, and the recorded
|
|
191
238
|
target-enforcement gap described above.
|
|
192
239
|
|
|
240
|
+
|
|
193
241
|
## Naming the primitives is the highest-value work
|
|
194
242
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
`Decimal`, `Bool`, `Date` and `DateTime`; `Enum` is a separate concept kind,
|
|
198
|
-
with its values indented beneath.
|
|
199
|
-
- **Classify personal data at the concept**, with a reason:
|
|
200
|
-
`concept PersonName : String @pii` plus an indented `pii reason "..."`. Every
|
|
201
|
-
usage inherits it; a reason for an attribute the concept does not declare is an
|
|
202
|
-
error. Decide this before fixing event shapes - erasure follows the subject and
|
|
203
|
-
the subject follows the stream.
|
|
204
|
-
- **Events are past tense and self-describing** - `InvoiceRegistered`, never
|
|
205
|
-
`Created`. One purpose per event; an event needing an optional property to cover
|
|
206
|
-
two situations is two events.
|
|
207
|
-
- **The event-source identity is never an event property.** The command binds it
|
|
208
|
-
with `identifier` on at most one property; marking an *event* property
|
|
209
|
-
`identifier` is an error: *an event never carries its event source id*.
|
|
210
|
-
- **Inline events remain slice-owned contracts.** A command may introduce one
|
|
211
|
-
with `produces event <Name>` and typed mappings; other slices still consume it
|
|
212
|
-
by name. Extracting it changes placement, not its contract or projection meaning.
|
|
213
|
-
- **Storage identity is not payload identity.** `for` selects the event source;
|
|
214
|
-
`id "<old name>"` preserves an event type's old persisted name on rename. New
|
|
215
|
-
events omit the pin, and the pin does not replace catalog identity. Do not copy
|
|
216
|
-
the same-source identifier into payload merely to project it; use `$eventSourceId`.
|
|
217
|
-
- **Domain facts, not runtime context.** Test: would this field have the same value
|
|
218
|
-
if the event were replayed on a different machine? If not, it does not belong.
|
|
243
|
+
Name concepts before events, classify personal data at the concept, keep events past tense and single-purpose, and never put the event-source identity in an event payload.
|
|
244
|
+
Read [references/naming-primitives.md](references/naming-primitives.md) when declaring concepts, `@pii` classification, event shapes, `identifier`, inline events or `id "<old name>"` pins.
|
|
219
245
|
|
|
220
246
|
## Quick gate - before specifications are called done
|
|
221
247
|
|
|
@@ -234,160 +260,11 @@ The full critic pass (evidence, severity, business-question review) is
|
|
|
234
260
|
instances - ask *"can there be more than one of these at once?"* for each field.
|
|
235
261
|
8. No cross-cutting infrastructure is modeled as a `Translate` slice.
|
|
236
262
|
|
|
237
|
-
## Choose a file layout
|
|
238
263
|
|
|
239
|
-
|
|
240
|
-
that keeps both the source and its diffs readable:
|
|
241
|
-
|
|
242
|
-
- Keep one `application.play` while it stays readable top to bottom.
|
|
243
|
-
- Use one file per module when modules are simple.
|
|
244
|
-
- Use one file per feature when features have sub-features.
|
|
245
|
-
- Use one file per slice when the model is large enough that a change must be
|
|
246
|
-
reviewable in isolation.
|
|
247
|
-
|
|
248
|
-
Reviewability, not an arbitrary line count, triggers the next split. In a large
|
|
249
|
-
model, one slice per file makes a scripted edit's blast radius visible in the
|
|
250
|
-
diff instead of hiding cross-reference defects in a single enormous file.
|
|
251
|
-
|
|
252
|
-
At the most granular layout, folders mirror the language, one folder per level,
|
|
253
|
-
and every level above the slices is a **barrel file** that declares its scope
|
|
254
|
-
and imports what is beneath it:
|
|
255
|
-
|
|
256
|
-
- `application.play` at the root holds `domain` and imports the rest:
|
|
257
|
-
`import "Shared/*.play"` for the files of `concept`, `type`, `policy`,
|
|
258
|
-
`persona`, `authentication` and `seed`, then one import per module file.
|
|
259
|
-
- `<Module>/<Module>.play` declares the module - `description`, `authorize`,
|
|
260
|
-
templates, forms - and its features. Either declare each feature inline and
|
|
261
|
-
import its folder (`feature Orders` / `import "Orders/*.play"`), or import one
|
|
262
|
-
`<Feature>/<Feature>.play` per feature.
|
|
263
|
-
- `<Feature>/<Feature>.play`, when a feature has its own file, declares the
|
|
264
|
-
feature and imports its slice files (`import "*.play"`) and any nested
|
|
265
|
-
feature's file.
|
|
266
|
-
- A slice file holds just its `slice`, at the top level. The import that brings
|
|
267
|
-
it in places it in its feature, so it does **not** restate `module` or
|
|
268
|
-
`feature` - the barrel above it already says where it belongs.
|
|
269
|
-
|
|
270
|
-
The root then reads as a table of contents, and every file is reachable from
|
|
271
|
-
it: `screenplay application.play` compiles exactly what the imports reach, and
|
|
272
|
-
a file no import reaches is not part of the application. Do not hand-write the
|
|
273
|
-
older merge-only layout, where barrels import nothing and every slice file
|
|
274
|
-
restates `module` and `feature` so the folder merges into one model. It compiles
|
|
275
|
-
as a folder, but the root says nothing about what the application holds and
|
|
276
|
-
every slice file repeats where it lives. The MCP `expand-layout` tool still
|
|
277
|
-
writes that layout; compose its output with imports when you take it over.
|
|
278
|
-
|
|
279
|
-
**Compose focused files with imports** (v4.48.0, checked at tag `v4.48.0`,
|
|
280
|
-
commit `3baf4a4`). `import "<path or glob>"` imports `.play` files relative to
|
|
281
|
-
the importing file - `**` crosses folders, `*` stays in one, `..` climbs. Where
|
|
282
|
-
the import is written decides where the files belong: at the top level it brings
|
|
283
|
-
in whole documents; inside a `module` or `feature` it places each imported file
|
|
284
|
-
there, so a file holds only its part of the story - a slice file is just the
|
|
285
|
-
`slice`. A root file that imports everything says what the application is made
|
|
286
|
-
of:
|
|
287
|
-
|
|
288
|
-
Layout sketches (file contents, not standalone documents):
|
|
289
|
-
|
|
290
|
-
```text
|
|
291
|
-
domain Acme.Commerce
|
|
292
|
-
|
|
293
|
-
import "Shared/*.play"
|
|
294
|
-
import "Ordering/Ordering.play"
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
```text
|
|
298
|
-
module Ordering
|
|
299
|
-
description "Orders, from basket to doorstep"
|
|
300
|
-
feature Orders
|
|
301
|
-
import "Orders/*.play"
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
Every file is imported once. When a root glob and a module file both match a
|
|
305
|
-
file, the deepest placement wins; two placements where neither lies inside the
|
|
306
|
-
other are an error (`PLAY0457`), and so is a file that declares a module other
|
|
307
|
-
than the one it is placed in (`PLAY0459`). A placed file's top level holds only
|
|
308
|
-
what its scope can hold (`PLAY0460`) - a `screen template` belongs in the
|
|
309
|
-
module file, not in a slice file placed in a feature. `import Customers.CustomerRegistered` without quotes still
|
|
310
|
-
names a contract from another bounded context.
|
|
311
|
-
|
|
312
|
-
⚠️ **Compile the folder, or its root file, as one application.**
|
|
313
|
-
`screenplay <root file>` compiles what the root imports. `screenplay <folder>` merges every
|
|
314
|
-
`.play` beneath the root *before* resolving, so an event declared in one file and
|
|
315
|
-
produced in another resolves. Compiling files individually reports unknown types,
|
|
316
|
-
events and policies (`PLAY0165`, `PLAY0166`, `PLAY0167`) that are not missing.
|
|
317
|
-
Duplicates *across* files are real errors naming both ends (`PLAY0172`, `PLAY0173`).
|
|
318
|
-
|
|
319
|
-
Round-tripping a folder does not preserve the order of **modules, features and
|
|
320
|
-
slices**: they come back sorted by name, and members of one module or feature
|
|
321
|
-
that come from different files print in canonical kind order. Order *within* one
|
|
322
|
-
file is kept, and some order carries meaning: `authorize` gates and policy
|
|
323
|
-
operands evaluate left to right, and specification events compare in authored
|
|
324
|
-
order unless `then events in any order` is stated. Never encode meaning in the
|
|
325
|
-
order of modules, features or slices.
|
|
326
|
-
|
|
327
|
-
## Verify
|
|
328
|
-
|
|
329
|
-
```shell
|
|
330
|
-
screenplay <model-folder> --warnaserror
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
(The standalone tool; `cratis screenplay validate <model-folder> --warnings-as-errors`
|
|
334
|
-
is the fallback, and neither names the other's verdict. Versions and commands:
|
|
335
|
-
`cratis-screenplay-toolchain`.)
|
|
336
|
-
|
|
337
|
-
- [ ] Zero errors **and zero warnings**. An unrecognized construct inside a slice
|
|
338
|
-
is only a warning (`PLAY0029`) and its block is **silently dropped** - a typo
|
|
339
|
-
can delete a whole projection while the exit code stays `0`.
|
|
340
|
-
- [ ] Every behavior is exactly one slice type, and the whole model validates
|
|
341
|
-
against the eight checks above.
|
|
342
|
-
- [ ] Every event is past tense, single-purpose, and carries no event-source id.
|
|
343
|
-
- [ ] Personal data is classified on the `concept`, with a reason.
|
|
344
|
-
- [ ] Specifications name the rejections, not only the happy path.
|
|
345
|
-
- [ ] If the model must reach a runtime, check it binds with the tool that will
|
|
346
|
-
consume it. The standalone 4.68.0 binder admits Automation and Translate slices
|
|
347
|
-
(ESM v6) and generated values and responses (ESM v7); Stage 4.24.0 admits ESM v1 to v3 (4.24.2: v1 to v4, evolved events refused with `STAGE-ESM-026`) and renders only `StateChange` and
|
|
348
|
-
`StateView` slices, so automations and translations are gap-fill there.
|
|
349
|
-
|
|
350
|
-
## Parsed is not runnable
|
|
351
|
-
|
|
352
|
-
The compiler accepts far more than anything executes. Between the syntax tree and
|
|
353
|
-
any runtime sits the **executable semantic model (ESM)**, and it fails closed:
|
|
354
|
-
what it cannot represent reports `PLAY0268` or `PLAY0271` and the model does not
|
|
355
|
-
bind. Keep four states apart when you report on a model: **parsed** (the
|
|
356
|
-
`screenplay` tool), **bound** (ESM), **reference-executed** (specifications pass
|
|
357
|
-
the reference runner) and **target-executed** (Stage or a rendered application).
|
|
358
|
-
The independent verdicts V1 to V5 that report them are in
|
|
359
|
-
`cratis-screenplay-modeling-lifecycle`.
|
|
360
|
-
|
|
361
|
-
What binds depends on **which tool** you ask, so name the tool and its version:
|
|
362
|
-
|
|
363
|
-
- `Automation` and `Translate` slices, reactions, captures and triggers: the
|
|
364
|
-
standalone `screenplay` 4.66.0 or later and the `cratis` 3.28.2 bundle (4.66.0) bind them (ESM v6).
|
|
365
|
-
The `cratis` 3.27.1 bundle (Screenplay 4.60.1) reported *Slice '<name>' of type '<type>'
|
|
366
|
-
is not admitted by ESM v1.* Stage 4.24.2 admits only ESM v1 to v4 and renders none of them.
|
|
367
|
-
- `reads` and `concurrency` on a command do not bind (`PLAY0271`), so no decision is
|
|
368
|
-
protected against stale state. A reaction trigger's `reads` that only `invokes` is
|
|
369
|
-
report-only intent (`PLAY0270`); one that `produces` directly fails binding (`PLAY0268`).
|
|
370
|
-
- `persona` declarations are report-only and never block; `@pii` and `@sensitive`
|
|
371
|
-
concepts do block binding (`PLAY0268`). Keep them anyway: the classification is
|
|
372
|
-
part of the model. Report the block.
|
|
373
|
-
- Generated values and `returns` responses bind and execute from standalone 4.68.0 (ESM v7) but fail binding
|
|
374
|
-
with `PLAY0268` on the 4.66.0 bundled in `cratis` 3.28.x, and Stage 4.24.2 does not render them
|
|
375
|
-
(`STAGE-ESM-016`, tracked in Stage#201): gap-fill. Operations and systems, and event sources and
|
|
376
|
-
streams, are authorable but non-executable (`PLAY0268`; not admitted by any supported ESM version);
|
|
377
|
-
a command `handler` never binds.
|
|
378
|
-
|
|
379
|
-
The ESM versions, the full disposition table and the Step 7 clock example's binding
|
|
380
|
-
result are in [references/parsed-not-runnable.md](references/parsed-not-runnable.md)
|
|
381
|
-
and `cratis-screenplay-toolchain` (`references/executable-subset.md`). Model the wider
|
|
382
|
-
language freely when the `.play` file **is** the deliverable - documentation,
|
|
383
|
-
review, a shared description of a system. Never read a clean `screenplay` run as
|
|
384
|
-
evidence a construct works downstream.
|
|
264
|
+
## Choose a file layout
|
|
385
265
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
but nothing enforces them yet. Event generations and typed repairs now ship;
|
|
389
|
-
generations do not supply deployed migrations. Do not treat every accepted
|
|
390
|
-
decision as implemented: check the construct's own page and the versions table.
|
|
266
|
+
Choose the coarsest layout that keeps source and diffs readable; compile the folder, or its root file, as one application, because compiling files individually reports false unknown-type errors (`PLAY0165`, `PLAY0166`, `PLAY0167`).
|
|
267
|
+
Read [references/file-layout.md](references/file-layout.md) when choosing or changing the file layout, writing `import` barrels, or compiling a split model.
|
|
391
268
|
|
|
392
269
|
## Route near misses
|
|
393
270
|
|
|
@@ -407,4 +284,4 @@ The lifecycle, toolchain and phase skills are in "Start here" above. Construct a
|
|
|
407
284
|
| Modeling against hand-written Chronicle C# | `cratis-chronicle-event-modeling` |
|
|
408
285
|
|
|
409
286
|
## Lineage
|
|
410
|
-
Method lineage, Nebulit material and licenses: `references/provenance.md`.
|
|
287
|
+
Method lineage, Nebulit material and licenses: `references/provenance.md`. Read it when checking method lineage, attribution, or adaptation permissions.
|