@cratis/pi 7.153.6 → 7.153.8
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/harnesses/copilot/instructions/profiles.instructions.md +1 -0
- package/package/corpus/rules/profiles.md +1 -0
- package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +24 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/systems-and-abilities.md +56 -3
- package/package/corpus/skills/cratis-screenplay-extension-packages/SKILL.md +62 -0
- package/package/corpus/skills/cratis-screenplay-extension-packages/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/ability-answers.md +12 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/neighbouring-skills.md +1 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +6080 -2129
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +2 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/extension-components.md +19 -0
- package/package/profile-catalog.json +1 -0
- package/package.json +1 -1
|
@@ -311,6 +311,7 @@ and one phase skill, then the construct skill needed for syntax.
|
|
|
311
311
|
| `cratis-screenplay-ui-composition` | `layout`, templates, `form`, `contribute`, `ui profile`, `theme`, `$strings`, `file` |
|
|
312
312
|
| `cratis-screenplay-captures-and-reactions` | The Change Data Capture Language, `reaction`, `trigger` |
|
|
313
313
|
| `cratis-screenplay-authentication-and-onboarding` | `authentication`, `onboarding`, and the environment keys derived from them |
|
|
314
|
+
| `cratis-screenplay-extension-packages` | Authoring, verifying, locking and restoring extension packages that realize a `system` |
|
|
314
315
|
| `cratis-screenplay-specifications` | Given/when/then and the reference execution |
|
|
315
316
|
| `cratis-screenplay-model-authoring` | Typed MCP authoring, model navigation/refactoring, compiler diagnostics, and source-versus-executable readiness |
|
|
316
317
|
|
|
@@ -310,6 +310,7 @@ and one phase skill, then the construct skill needed for syntax.
|
|
|
310
310
|
| `cratis-screenplay-ui-composition` | `layout`, templates, `form`, `contribute`, `ui profile`, `theme`, `$strings`, `file` |
|
|
311
311
|
| `cratis-screenplay-captures-and-reactions` | The Change Data Capture Language, `reaction`, `trigger` |
|
|
312
312
|
| `cratis-screenplay-authentication-and-onboarding` | `authentication`, `onboarding`, and the environment keys derived from them |
|
|
313
|
+
| `cratis-screenplay-extension-packages` | Authoring, verifying, locking and restoring extension packages that realize a `system` |
|
|
313
314
|
| `cratis-screenplay-specifications` | Given/when/then and the reference execution |
|
|
314
315
|
| `cratis-screenplay-model-authoring` | Typed MCP authoring, model navigation/refactoring, compiler diagnostics, and source-versus-executable readiness |
|
|
315
316
|
|
|
@@ -73,6 +73,30 @@ cratis config --missing ./model # keys the model needs and the environm
|
|
|
73
73
|
All accept `-o json`. Exit codes: `0` success, `1` not found, `4` authentication failed (wrong
|
|
74
74
|
passphrase), `5` validation, including any key missing under `--missing`.
|
|
75
75
|
|
|
76
|
+
## Extension settings and secrets
|
|
77
|
+
|
|
78
|
+
A Screenplay system realized by an extension needs values that belong to the environment, not the model. The model says where each value comes from; the environment holds the value. Never put a value in the model, the lock or a brief.
|
|
79
|
+
|
|
80
|
+
| The model says | Environment key | Kind |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| Nothing about a setting the extension's contract declares | `systems.<System>.<setting>` | Secret when the contract declares the setting `secret`, otherwise plain |
|
|
83
|
+
| `secret <Name>`, used by `setting <name> from secret <Name>` | `secrets.<Name>` | Always a secret; one value for every system that maps it |
|
|
84
|
+
| `setting <name> = <literal>` (non-secret settings only) | `systems.<System>.<name>` | Optional; the environment value overrides the literal |
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
cratis config --requires ./model # keys, kind (setting or secret), set or missing; never prints a value
|
|
88
|
+
cratis config set secrets.StripeKey # always stored as a secret; stdin or hidden prompt
|
|
89
|
+
cratis config set systems.Payments.accountId acct_123
|
|
90
|
+
cratis run ./model -e development
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- A key under `secrets.` is stored as a secret with or without `--secret` and is never read from an argument.
|
|
94
|
+
- `--requires` exits `5` while any key is missing, and when an extension is not restored, because its contract's settings cannot be known. `--missing` remains the narrower check.
|
|
95
|
+
- `activation always` or `activation on demand [idle after <n> <unit>]` on the system overrides the extension contract's default; neither is an environment key.
|
|
96
|
+
- A literal on a `secret` setting, an unknown setting, an unused secret and a duplicate mapping are errors (`PLAY0990` to `PLAY0997`).
|
|
97
|
+
- Registry credentials for private extension packages are environment keys too: `extensions.registry.<host>.token`, or `.username` with `.password`, set as secrets. See [extension packages](../cratis-screenplay-extension-packages/SKILL.md).
|
|
98
|
+
- `cratis run` hands the Stage the settings and secrets of the admitted extensions; read the CLI environments and `run` pages for details rather than assuming.
|
|
99
|
+
|
|
76
100
|
## Choosing a secrets provider
|
|
77
101
|
|
|
78
102
|
Default to **passphrase** for a project with one team and a committed environment file. Choose a
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
- Answers that arrive later
|
|
10
10
|
- Implementation
|
|
11
11
|
- The one `invokes` verb
|
|
12
|
-
-
|
|
12
|
+
- Invoke an ability
|
|
13
|
+
- Realize a system with an extension
|
|
14
|
+
- What is admitted and what is not
|
|
13
15
|
|
|
14
16
|
## Code computes, abilities touch the world
|
|
15
17
|
|
|
@@ -83,8 +85,59 @@ An ability owns at most one `file` or tagged fence, directly or in an `implement
|
|
|
83
85
|
| `then sends <Command>` | `then invokes <Command>` |
|
|
84
86
|
| `action <Name> sends <Command>` | `action <Name> invokes <Command>` |
|
|
85
87
|
|
|
86
|
-
##
|
|
88
|
+
## Invoke an ability
|
|
89
|
+
|
|
90
|
+
A reaction, a workflow action and a state's `entering` line ask a system for an ability with `invokes <System>.<Ability>`; the dotted name is what tells an ability from a command. Map every declared input exactly once with a compatible value (`PLAY1003`, `PLAY1004`, `PLAY1005`); the system and ability must exist (`PLAY1001`). The answer is handled where the call is made:
|
|
91
|
+
|
|
92
|
+
```play
|
|
93
|
+
reaction PickupBooking
|
|
94
|
+
runs as system
|
|
95
|
+
when OrderPacked
|
|
96
|
+
parcelId
|
|
97
|
+
shippingAddress
|
|
98
|
+
invokes Carrier.BookPickup
|
|
99
|
+
parcelId = parcelId
|
|
100
|
+
address = shippingAddress
|
|
101
|
+
on returned
|
|
102
|
+
produces PickupBooked
|
|
103
|
+
trackingNumber = $result.trackingNumber
|
|
104
|
+
on NoCapacity
|
|
105
|
+
produces PickupUnavailable
|
|
106
|
+
on failed
|
|
107
|
+
produces PickupBookingFailed
|
|
108
|
+
reason = $failure.reason
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `on returned` reads `$result.<field>` from the ability's `returns`; `on failed` reads `$failure.reason`; `on <Outcome>` handles a declared outcome (`PLAY1002` when undeclared). A branch is declared once (`PLAY1006`); reading a branch value outside its branch is `PLAY1008`. The result becomes a fact only through the `produces` the model writes.
|
|
112
|
+
- Workflow action: `action BookPickup invokes Carrier.BookPickup attempts 3`, inputs on the lines under it (a literal, a property of the workflow's subject or an earlier node's result as `Node.field`), then edges `next -> ...`, `failed -> ...` and one edge per declared outcome. An outlet that can never be taken, such as `expired` on an ability that does not answer later, is `PLAY1007`. A node may only read the result of a node that always ran before it (`PLAY1009`).
|
|
113
|
+
- State machine: `entering invokes <System>.<Ability>` with inputs mapped below. `entering` may run again on redelivery, so the ability should be `safe` or `idempotent`. A state machine holds nothing to wait with, so an `answers later` ability there is `PLAY1011`; a reaction cannot invoke one either (`PLAY1010`).
|
|
114
|
+
- A `once` ability is never retried; `attempts` above one on its call site is the warning `PLAY1015`.
|
|
115
|
+
- Specifications script the answer with `given <System>.<Ability> returns` (with the returned fields), `given <System>.<Ability> answers <Outcome>` or `given <System>.<Ability> fails "<reason>"`, and assert the call with `then invokes <System>.<Ability>`. Naming an ability, outcome or field the system does not declare is `PLAY1017`. See [specifications](../../cratis-screenplay-specifications/SKILL.md).
|
|
116
|
+
- Operations in an Arc command can invoke abilities too (`invokes <System>.<Ability>` in an operation phase; Arc's `ISystemAbilities`); see Arc's command-operations page on abilities and the Screenplay operations page.
|
|
117
|
+
|
|
118
|
+
Invoking an ability selects ESM v51. Models that invoke none keep their bytes and version. Take the call's name, inputs and branch names from the page, never from memory.
|
|
119
|
+
|
|
120
|
+
## Realize a system with an extension
|
|
121
|
+
|
|
122
|
+
A system is realized either by code attached to its abilities (see Implementation) or by an extension package. Name the package on the system and map its settings:
|
|
123
|
+
|
|
124
|
+
```play
|
|
125
|
+
secret MailerApiKey
|
|
126
|
+
description "The API key of the transactional mail service"
|
|
127
|
+
|
|
128
|
+
system Mailer
|
|
129
|
+
extension "ghcr.io/cratis/extension-mail" version 2
|
|
130
|
+
setting apiKey from secret MailerApiKey
|
|
131
|
+
setting senderName = "Invoicing"
|
|
132
|
+
activation on demand idle after 10 minutes
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- A system that names an extension declares no abilities of its own (`PLAY1106`); it receives the contract's abilities, and the contract's triggers become application triggers a reaction uses as `when Payments.PaymentSucceeded`.
|
|
136
|
+
- `extension`, `setting` and `activation` are realization metadata: they change no bytes of the executable model.
|
|
137
|
+
- The contract, `screenplay.lock` and restore are in [extension packages](../../cratis-screenplay-extension-packages/SKILL.md); settings, named secrets and the environment keys are in [environments and secrets](../../cratis-environments-and-secrets/SKILL.md).
|
|
138
|
+
|
|
139
|
+
## What is admitted and what is not
|
|
87
140
|
|
|
88
|
-
|
|
141
|
+
According to the Screenplay documentation, these parse, print and validate but are not admitted yet, and binding reports `PLAY0268` naming Screenplay#1252: ability invocations in operation phases, an approval answered through an ability (`approval <Name> by <Policy> via <System>.<Ability> expires after 2 days`), `compute <Name>` nodes with `returns` fields and a C# body, a `$trigger` value, a `decide` that reads an ability or compute result, and a bare `entering` followed by a C# fence or `file` body. Author them when the model needs them, but report them as authored, not executable, and recheck the pages for the installed Screenplay version before claiming otherwise. Stage lists what it renders and runs in its [ESM feature matrix](https://github.com/Cratis/Stage/blob/main/Documentation/reference/esm-feature-matrix.md).
|
|
89
142
|
|
|
90
143
|
Read Screenplay's [systems and abilities](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/systems.md) page and [decision 0159](https://github.com/Cratis/Screenplay/blob/main/decisions/0159-systems-with-abilities-extensions-and-durable-invocations.md) for the contract.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cratis-screenplay-extension-packages
|
|
3
|
+
description: Use when authoring, verifying, publishing or consuming a Cratis extension package that realizes a Screenplay system, including its contract, lock, restore, settings and components. Not for declaring a system's abilities in a model or invoking them; use cratis-screenplay-automations-and-translations.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Building and consuming extension packages
|
|
8
|
+
|
|
9
|
+
An **extension package** is the code and contract that realizes a Screenplay `system`. The model names what the business can ask (abilities, triggers, components); the package carries how. Do not invent package behavior: the contract below is the Screenplay documentation, and the tooling is the Cratis CLI. If a fact is not on a linked page, say so instead of guessing.
|
|
10
|
+
|
|
11
|
+
## Pages to read first
|
|
12
|
+
|
|
13
|
+
- Screenplay [extension contracts](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/extension-contracts.md): the contract file, manifest, settings, components, the `extension` reference, the lock, the cache and restore, provider compatibility.
|
|
14
|
+
- Screenplay [systems and abilities](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/systems.md) and [environments](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/environments.md#system-settings-and-named-secrets).
|
|
15
|
+
- Screenplay [screens: extension components](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/screens.md#extension-components) and the [command line `restore`](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/tool.md#restore-extensions).
|
|
16
|
+
- Stage [extension backends](https://github.com/Cratis/Stage/blob/main/Documentation/extensions/index.md) (protocol, SDKs for C#, Kotlin, Go and TypeScript, host services), [packages](https://github.com/Cratis/Stage/blob/main/Documentation/extensions/packages.md) and [execution tiers and activation](https://github.com/Cratis/Stage/blob/main/Documentation/extensions/execution-tiers.md).
|
|
17
|
+
- Scene [extension component contract](https://github.com/Cratis/Scene/blob/main/Documentation/extensions/contract.md): how a frontend component registers and what conformance checks.
|
|
18
|
+
- Cratis CLI [manage extension packages](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension.md), [`extension new`](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension-new.md), [`extension verify`](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension-verify.md), [`restore`](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension-restore.md), [`update`](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension-update.md) and [`vendor`](https://github.com/Cratis/cli/blob/main/Documentation/reference/extension-vendor.md).
|
|
19
|
+
|
|
20
|
+
## Author a package
|
|
21
|
+
|
|
22
|
+
1. **Scaffold, do not hand-roll.** `cratis extension new -n <Name> [--kind extension|package] [--backend csharp|kotlin|go|typescript|none] [--frontend react|mount|screenplay|none] [--component react|mount] [--publisher <name>]`. The result already has a `contract.play`, builds and passes `cratis extension verify` without edits. In an AI agent or with redirected output it never prompts; it uses flags and defaults. `--dry-run` lists files without writing. The templates are `Cratis.Templates.Extensions` (`cratis-extension`, `cratis-extension-package`) from Cratis/Templates.
|
|
23
|
+
2. **Choose the kind.** `extension` is an OCI artifact (contract, optional backend, optional frontend). `package` is an npm package with frontend components only and no backend. An extension with neither backend nor frontend that only declares abilities is valid.
|
|
24
|
+
3. **Write the contract** (`contract.play`): a manifest (`display name`, `description`, `icon` required, else `PLAY0999`; `image`, `requires stage|screenplay|platform|runtime`, `activation`), then `setting`, `ability` (same grammar as [systems](../cratis-screenplay-automations-and-translations/references/systems-and-abilities.md)), `trigger`, `component` and `backend runtime <name> <version> assembly "<file>"` / `frontend "<path>"`. Contents are read from their declarations; never restate them in the manifest. Types resolve in the consuming model's scope.
|
|
25
|
+
4. **Settings.** `setting <name> [public | secret]`. `public` may reach a browser; `secret` never does; both is `PLAY1103`; neither stays with the backend.
|
|
26
|
+
5. **Components.** `kind react | mount | screenplay` (else `PLAY1100`), `platform`, `placeholder "<path>"` (required for `react` and `mount`, `PLAY1102`), typed `property` lines, `raises <signal>` with typed values, and `invokes <Ability>` for abilities the component may call through the host (must be declared, `PLAY1104`). A placeholder is static HTML: no script, inline event handler, `javascript:` URL or external reference, styles inline and images as `data:` URIs (`PLAY1113`).
|
|
27
|
+
6. **Backend.** Stage hosts backends outside its own process over a two-way gRPC protocol; the backend asks Stage for settings, secrets and telemetry through host services. Tier is chosen by Stage (`None`, `SharedHost`, `Native`, `Container`) from the contract's runtime. A backend is told its address, system and package digest by `STAGE_EXTENSION_*` environment variables. Read the Stage SDK page for the language chosen.
|
|
28
|
+
7. **Frontend.** A frontend component registers as its declared kind and must pass the Scene conformance kit; use the Scene contract page, not memory.
|
|
29
|
+
8. **Same name twice** (abilities, triggers, components, settings, ignoring case) is `PLAY1105`; anything else unrecognized in the file is `PLAY0998`.
|
|
30
|
+
|
|
31
|
+
A `.extensionignore` in the package folder names what the build does not ship (sources, specifications, scripts) so verify can tell it from what ships.
|
|
32
|
+
|
|
33
|
+
## Verify before publishing
|
|
34
|
+
|
|
35
|
+
`cratis extension verify [TARGET] [--range <r>] [--baseline <folder>] [--strict] [--format table|json]`. TARGET is a package folder (default current directory), a `contract.play`, or a package reference. Checks always appear with a status: `passed`, `failed`, `skipped` (could not run; never a pass; `--strict` fails it) or `notapplicable`. The checks are `contract`, `manifest`, `contents`, `placeholders`, `frontend` and `backend`. The `frontend` and `backend` checks report `EXTV060` and `EXTV070` where they cannot run yet; read what the CLI page says does not run yet and report that honestly, never as green.
|
|
36
|
+
|
|
37
|
+
## Consume a package from a model
|
|
38
|
+
|
|
39
|
+
```play
|
|
40
|
+
system Payments
|
|
41
|
+
extension "cratis/stripe" version 2
|
|
42
|
+
setting secretKey from secret StripeSecretKey
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- A system that names an extension declares no abilities of its own (`PLAY1106`); it gets the contract's abilities, and the contract's triggers become `<System>.<Trigger>` for reactions.
|
|
46
|
+
- A reference is a catalog short name (`owner/name` resolves to `ghcr.io/owner/extension-name`), a full OCI reference, or `npm:<package>` for frontend-only packages. `version 2` is the latest 2.x, `2.3.1` exactly, `"^2.3"` and `"~2.3"` as in semver.
|
|
47
|
+
- **The lock.** `screenplay.lock` beside the model root pins each reference (range, resolved reference, version, package `digest`, `contract` hash, `publisher`). Commit it. The compiler never resolves a range; it reads the contract by locked digest from the vendored `extensions` folder, then the user cache (`SCREENPLAY_EXTENSION_CACHE`). Unlocked is `PLAY1107`, range mismatch `PLAY1110`, not restored `PLAY1108`, contract differs from the hash `PLAY1109`, malformed lock `PLAY1111`. The language server and MCP downgrade some to warnings and restore on opening a model root.
|
|
48
|
+
- **Restore, update, vendor.** `cratis extension restore` fills the cache from the lock and pins what is missing; `cratis extension update` moves references to the newest release in range and shows how each contract changes; `cratis extension vendor` copies every locked package to a folder or private registry for offline use. `--locked` is for CI and never pins. Shared options: `--root`, `--source <folder|oci://host/prefix>`, `-e <environment>`, `-o <format>`. `screenplay restore` in the Screenplay tool restores from a directory without network.
|
|
49
|
+
- **Trust.** Naming a package is not trusting it. The CLI requires a valid signature for exactly the package digest and a publisher in the committed `.cratis/extensions.json` allow-list. An interactive terminal may ask once; CI and AI agents cannot ask and fail `Unallowed`. Never edit the allow-list or accept a publisher to make a command pass without the user's say; a changed key is reviewed, never auto-trusted.
|
|
50
|
+
- **Exit codes** of the extension commands: `0` ok, `1` not found, `2` registry unreachable, `4` credentials refused or missing, `5` not locked, unallowed, unsigned, mismatched or incompatible.
|
|
51
|
+
- **Registry credentials** live in the selected environment (`extensions.registry.<host>.token` or `.username` and `.password`, as secrets), never in the model or lock. See [environments and secrets](../cratis-environments-and-secrets/SKILL.md).
|
|
52
|
+
- **Swapping providers.** A replacement must offer the same abilities, triggers, components, properties and signals with the same typed shape; mismatches are reported at each use (`PLAY1112`, unknown ability).
|
|
53
|
+
|
|
54
|
+
## Configure and run
|
|
55
|
+
|
|
56
|
+
Settings, named secrets and activation are set in the model and supplied by the environment; see [environments and secrets](../cratis-environments-and-secrets/SKILL.md). `cratis run <model> -e <environment>` admits the model's locked extensions and hands the Stage their settings and secrets; read the CLI `run` page.
|
|
57
|
+
|
|
58
|
+
## Boundaries
|
|
59
|
+
|
|
60
|
+
- Declaring a system and invoking its abilities from the model is [automations and translations](../cratis-screenplay-automations-and-translations/SKILL.md).
|
|
61
|
+
- Placing a package component on a screen is [UI composition](../cratis-screenplay-ui-composition/references/extension-components.md).
|
|
62
|
+
- Do not publish, push to a registry or change an allow-list unless the user asked for that effect.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "cratis-screenplay-extension-packages",
|
|
3
|
+
"input": "We want to build a Stripe extension package with a Go backend and a React component, lock it in our model and restore it in CI.",
|
|
4
|
+
"fixtures": [],
|
|
5
|
+
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "cratis extension new" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "cratis extension verify" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "`screenplay.lock`" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "`--locked` is for CI" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "`.cratis/extensions.json`" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "PLAY1106" }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -194,6 +194,8 @@ Read [references/actions-beyond-commands.md](references/actions-beyond-commands.
|
|
|
194
194
|
From ESM v6 every action sets reactions off. A specification runs only the slice that declares it: only that slice's reactions, captures and publications run, and `then` events compare the new facts of that slice. A specification whose action is a command goes in the slice that declares the command and states the command's own events. Another slice's event is `PLAY0285` (unreachable): state it in the slice that produces it. An automation states a command it invokes in another slice with `then invokes <Command>` (ESM v34).
|
|
195
195
|
Read [references/reactions-and-cascades.md](references/reactions-and-cascades.md) when a specification's expected events include what a reaction appends, when a cascade, clock tick or invoked command is involved, or when a compiler reports `PLAY0285` (it holds the "Version skew and `PLAY0285`" section).
|
|
196
196
|
|
|
197
|
+
Ability answers (`given <System>.<Ability> returns|answers|fails`): [references/ability-answers.md](references/ability-answers.md).
|
|
198
|
+
|
|
197
199
|
A `statemachine` or `workflow` (ESM v36) carries its own specifications with `then is`, `then invokes`, `then starts`, `outcome`, `then completes`, `then fails at` and `then waits at`. Read automations-and-translations [state machines and workflows](../cratis-screenplay-automations-and-translations/references/statemachines-and-workflows.md) when specifying either.
|
|
198
200
|
|
|
199
201
|
## Published-event specifications (released ESM v9)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Ability answers and `then invokes`
|
|
2
|
+
|
|
3
|
+
A reaction specification scripts what a system's ability answers while the reaction runs, then asserts the events and the call:
|
|
4
|
+
|
|
5
|
+
```play
|
|
6
|
+
given Carrier.BookPickup returns
|
|
7
|
+
trackingNumber = "TRK-1"
|
|
8
|
+
given Carrier.BookPickup answers NoCapacity
|
|
9
|
+
given Carrier.BookPickup fails "carrier unavailable"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`returns` gives the returned fields, `answers` names a declared outcome, `fails` supplies the failure reason, and `then invokes <System>.<Ability>` asserts the call. Naming an ability, outcome or returned field the system does not declare is `PLAY1017`. A branch that reads a value the specification did not script is not silently passed. Read the Screenplay [specifications](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/specifications.md#ability-answers) page for the exact rules, and [systems and abilities](../../cratis-screenplay-automations-and-translations/references/systems-and-abilities.md) for the declaration.
|
|
@@ -99,6 +99,8 @@ for MCP initialization, source identity and reporting. Without MCP, report
|
|
|
99
99
|
version, source identity and any blocking codes; MCP `modelRevision` is semantic,
|
|
100
100
|
not the source identity.
|
|
101
101
|
|
|
102
|
+
A model whose systems name an `extension` also needs `screenplay.lock` and restored contracts: every compile is strict about them (`PLAY1107` not locked, `PLAY1108` not restored, `PLAY1109` contract differs, `PLAY1110` other range, `PLAY1111` malformed lock). Restore with `cratis extension restore` or `screenplay restore [<folder>] [--locked] [--update] [--source <directory>] [--vendor]`; the language server and MCP restore on opening a model root and report warnings until then. See [extension packages](../cratis-screenplay-extension-packages/SKILL.md).
|
|
103
|
+
|
|
102
104
|
Read [observation comparison](references/observation-comparison.md) when asking whether a running namespace holds what the model declares, or when reading a `conform-namespace` verdict. It differs from model comparison (model versus model) and `conform` (model versus code).
|
|
103
105
|
|
|
104
106
|
PLAY0516 ordering is presentation-only, not execution. For a wildcard-import
|
|
@@ -9,6 +9,7 @@ Which skill owns each task next to the toolchain.
|
|
|
9
9
|
`cratis-screenplay-specifications`, `cratis-screenplay-ui-composition`.
|
|
10
10
|
- Sign-in providers, onboarding and the environment keys a model needs: `cratis-screenplay-authentication-and-onboarding`;
|
|
11
11
|
creating the environment and setting secrets: `cratis-environments-and-secrets`.
|
|
12
|
+
- Extension packages (contract, lock, restore, `cratis extension new` and `verify`): `cratis-screenplay-extension-packages`.
|
|
12
13
|
- Rendering and gap-fill: `cratis-screenplay-render-and-gap-fill`,
|
|
13
14
|
`cratis-stage-rendering-and-sandbox`.
|
|
14
15
|
- Running systems (Chronicle server operations through the `cratis` CLI, with its authorization boundaries): `cratis-chronicle-cli-operations`.
|