@cratis/pi 7.48.3 → 7.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/agents/backend-developer.md +1 -1
- package/package/corpus/agents/screenplay-modeler.md +2 -1
- package/package/corpus/agents/screenplay-renderer.md +2 -2
- package/package/corpus/agents/screenplay-reviewer.md +1 -1
- package/package/corpus/agents/slice-implementer.md +15 -5
- package/package/corpus/harnesses/copilot/instructions/application-profile.instructions.md +3 -3
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +3 -3
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +6 -3
- package/package/corpus/hooks/README.md +28 -1
- package/package/corpus/hooks/scripts/cratis-guard-writes.sh +75 -0
- package/package/corpus/prompts/add-projection.prompt.md +2 -1
- package/package/corpus/prompts/add-reducer.prompt.md +6 -4
- package/package/corpus/rules/application-profile.md +3 -3
- package/package/corpus/rules/csharp.md +3 -1
- package/package/corpus/rules/glossary.md +3 -3
- package/package/corpus/rules/vertical-slices.md +6 -3
- package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +5 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/build-prompts.md +38 -19
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +4 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +17 -0
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +27 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +6 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +16 -33
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +92 -7
- package/package/corpus/skills/cratis-chronicle-event-modeling/LICENSE +5 -0
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +4 -1
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +18 -10
- package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +6 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/slice-delivery-checklist.md +5 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +46 -18
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +34 -14
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +194 -38
- package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +3 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/domain-analysis-template.md +26 -1
- package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +7 -5
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +31 -34
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +64 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +18 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +5 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +5 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +20 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +89 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +9 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +28 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +4 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +4 -0
- package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +5 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/model-inventory-report.md +11 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/stressor-analysis.md +74 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +12 -11
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +2 -2
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/{drift-and-ledger.md → drift-and-fallback-record.md} +53 -6
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +12 -11
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +11 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +3 -3
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +2 -2
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +6 -6
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +7 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +29 -3
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +2 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +5 -4
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +64 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +24 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +1 -0
- package/package.json +1 -1
package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- Command card
|
|
6
|
+
- Values a rule reads
|
|
6
7
|
- The inventory
|
|
7
8
|
- Filled for `worked-example.md`
|
|
8
9
|
- Common mistakes
|
|
@@ -26,6 +27,7 @@ Origins: <screen action / form / reaction invokes (event, clock or applic
|
|
|
26
27
|
a reaction)
|
|
27
28
|
Inputs: <property: Concept - who supplies it - why the caller decides it>
|
|
28
29
|
Identifier: <property naming the instance, or "allocation" with the reason>
|
|
30
|
+
Reads: <per rule: each value it reads, as input | state | context>
|
|
29
31
|
Rules by layer: <concept validate | command validate/require | authorize | claim policy
|
|
30
32
|
| constraint | stored-state (NOT enforced, target named)>
|
|
31
33
|
Success: <event(s) with for <identifier>, payload mapping>
|
|
@@ -57,6 +59,64 @@ issues no command; any later command is reached through a reaction. Design
|
|
|
57
59
|
these in `cratis-screenplay-automations-and-translations`. Every automation-issued command states
|
|
58
60
|
what happens when it fails or is retried.
|
|
59
61
|
|
|
62
|
+
## Values a rule reads
|
|
63
|
+
|
|
64
|
+
Before placing a rule in a layer, list every value it reads and classify each one:
|
|
65
|
+
|
|
66
|
+
- **input**: a command property the caller decides.
|
|
67
|
+
- **state**: a `reads <View>` path, or the prior facts of the stream.
|
|
68
|
+
- **context**: the time the decision occurs, the caller, the tenant.
|
|
69
|
+
|
|
70
|
+
A value that fits none of the three is a gap: a missing input, a missing view or a hidden
|
|
71
|
+
dependency. Do not close it with prose in `description` or `handler`.
|
|
72
|
+
|
|
73
|
+
Context is never a command property. The pipeline supplies who is calling and when, because a
|
|
74
|
+
caller-supplied "who am I" or "what time is it" cannot be trusted, and a field the caller
|
|
75
|
+
fills is still an input. A date the person chooses (a start day, a requested slot) is an
|
|
76
|
+
input; "now" is context. A declarative `require` reads only command properties and read state,
|
|
77
|
+
so a rule over context is a named `rule` with a code body (its `RuleContext` carries
|
|
78
|
+
`Occurred`, `CausedBy` and `Tenant`), or an `authorize` policy when it concerns roles or
|
|
79
|
+
claims. The reference runner cannot execute an opaque body: record that, do not delete the
|
|
80
|
+
rule. When a rule depends on a local calendar day ("before midnight", "a business day"), state
|
|
81
|
+
whose timezone applies and where it comes from (an input, a setting read through a view, or an
|
|
82
|
+
open question).
|
|
83
|
+
|
|
84
|
+
Give each context-reading rule its own inventory row, and have its specification state the
|
|
85
|
+
context it relies on: `given clock` for time, `given caller` or `given caller as <Persona>`
|
|
86
|
+
for the actor. A time rule without `given clock` is not pinned.
|
|
87
|
+
|
|
88
|
+
~~~screenplay test=unbound
|
|
89
|
+
domain Bikeshare.Rentals
|
|
90
|
+
|
|
91
|
+
concept ReservationId : Uuid
|
|
92
|
+
concept BikeId : Uuid
|
|
93
|
+
|
|
94
|
+
module Rentals
|
|
95
|
+
feature Reservations
|
|
96
|
+
slice StateChange ReserveBike
|
|
97
|
+
command ReserveBike
|
|
98
|
+
reservationId ReservationId identifier
|
|
99
|
+
bikeId BikeId
|
|
100
|
+
startTime DateTime
|
|
101
|
+
validate
|
|
102
|
+
startTime rule StartsAfterRequest message "The start time has already passed"
|
|
103
|
+
```csharp
|
|
104
|
+
return (DateTimeOffset)context.Value > context.Occurred;
|
|
105
|
+
```
|
|
106
|
+
produces event BikeReserved
|
|
107
|
+
bikeId BikeId = bikeId
|
|
108
|
+
startTime DateTime = startTime
|
|
109
|
+
reservedAt DateTime = $context.occurred
|
|
110
|
+
|
|
111
|
+
specification RejectingAStartTimeInThePast
|
|
112
|
+
given clock "2026-06-01T09:00:00Z"
|
|
113
|
+
when ReserveBike
|
|
114
|
+
reservationId = "6b2a5f0e-6d1c-4f4e-9f57-3a9a6d3c8b10"
|
|
115
|
+
bikeId = "0d7c3a34-5a43-4c1a-8f7e-9a1c2b3d4e5f"
|
|
116
|
+
startTime = "2026-06-01T08:00:00Z"
|
|
117
|
+
then error "The start time has already passed"
|
|
118
|
+
~~~
|
|
119
|
+
|
|
60
120
|
## The inventory
|
|
61
121
|
|
|
62
122
|
One row per outcome. The layer says where the refusal is enforced; the spec column says
|
|
@@ -79,6 +139,8 @@ Rules for filling it:
|
|
|
79
139
|
available, including Stage 4.73.1's rendered package set for gap-fill, not emitted
|
|
80
140
|
protection; Chronicle DCB, or a
|
|
81
141
|
constraint). It still gets a spec row, because the intended behaviour is the contract.
|
|
142
|
+
- Every rule row names what the rule reads (input, state or context); a context read needs a
|
|
143
|
+
`given clock` or `given caller` in the spec that pins it.
|
|
82
144
|
- A decided refusal never goes to open questions: it goes here, then to scenarios.
|
|
83
145
|
- A refusal message is a fact of the design; keep the wording identical in the rule, the
|
|
84
146
|
inventory and the spec.
|
|
@@ -122,6 +184,8 @@ not been asked the refusal questions.
|
|
|
122
184
|
- A reaction invoking a gated command without `runs as system role "<Role>"`: the invocation has
|
|
123
185
|
no caller and is refused; declare the trusted path with the role the gate admits
|
|
124
186
|
(`cratis-screenplay-automations-and-translations`), never delete the gate.
|
|
187
|
+
- A time- or actor-dependent rule written as if it only read inputs: its specification passes
|
|
188
|
+
for the wrong reason, or cannot be reproduced.
|
|
125
189
|
- Refusals recorded as prose in the `description` with no layer and no spec row.
|
|
126
190
|
- Personal data or secrets as command input: values are by default recorded in the causation chain, so treat them as permanent
|
|
127
191
|
(retention can be configured in newer Chronicle; verify it, never audit secrets).
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
|
+
- Where information starts
|
|
5
6
|
- Where values come from, per element
|
|
7
|
+
- Check as you edit
|
|
6
8
|
- The matrix
|
|
7
9
|
- The reason line per contributing event
|
|
8
10
|
- Gap handling
|
|
@@ -12,6 +14,12 @@ Every value in the model has a place it comes from and a place it goes. If you c
|
|
|
12
14
|
where a field comes from, the model is missing an input, an event field or a decision. If an
|
|
13
15
|
event field goes nowhere, ask why it is recorded (audit and history are valid answers; say so).
|
|
14
16
|
|
|
17
|
+
## Where information starts
|
|
18
|
+
|
|
19
|
+
Every value starts at one specific place and is carried by name from there: the person's
|
|
20
|
+
input on a screen, the runtime's context (caller, time, tenant), an identifier the runtime
|
|
21
|
+
allocates, or a view's own calculation. A value with no such start is a gap, not a default.
|
|
22
|
+
|
|
15
23
|
## Where values come from, per element
|
|
16
24
|
|
|
17
25
|
**Command property**
|
|
@@ -23,6 +31,7 @@ event field goes nowhere, ask why it is recorded (audit and history are valid an
|
|
|
23
31
|
| the instance being acted on | the `identifier` property, carried from the screen row or route | |
|
|
24
32
|
| allocated by the runtime | `Type generated` on a required scalar generatable Uuid/String concept (implicit UUID is v7; explicit serialized strategy selects v15, Screenplay 4.147.0+ with strict fixtures and whole-source freshness). CLI 3.57.0 / Stage 4.89.1 render supported strategies; types/combinations retain -028/-038; no concept rules. See command-surface `references/generated-values-and-responses.md` | never a request input or form field; no policy, rule or requirement may read it (`PLAY0273`); return it with `returns`; where a tool cannot bind it, executable scope needs explicit allocation |
|
|
25
33
|
| an outside party | capture field `$.x` or a reaction trigger value | `cratis-screenplay-automations-and-translations` |
|
|
34
|
+
| time of the decision | not an input: `$context.occurred` in `produces`; a rule reads it as `context.Occurred` in a named rule (`command-inventory.md` *Values a rule reads*) | a date the person chooses is an input; "now" is context |
|
|
26
35
|
| the caller | not an input: `$context.identity.*` in `produces`; who may act in `authorize`; "acting on own X" is a claim policy matched to the identifier or a command property | never trust a caller-supplied "who am I" |
|
|
27
36
|
|
|
28
37
|
**Event property** - set only in `produces` mappings, from:
|
|
@@ -44,6 +53,21 @@ duration, a sum of rows) is recorded as `derived: <expression>` with its origin
|
|
|
44
53
|
condition in the matrix, then decide: two commands (two decisions) or one command with an
|
|
45
54
|
implication rule. Never leave it implicit.
|
|
46
55
|
|
|
56
|
+
## Check as you edit
|
|
57
|
+
|
|
58
|
+
After every edit that adds, renames or removes a field, run the opt-in structural checks on
|
|
59
|
+
the model root rather than waiting for the audit: `field-origins` (a read-model field with no
|
|
60
|
+
origin), `input-surfaces` (a command nothing issues), `data-bindings`, `query-keys` and
|
|
61
|
+
`event-consumers`. Use `--check` on the standalone tool or the MCP `diagnostics` `checks`;
|
|
62
|
+
flags and versions are in `cratis-screenplay-toolchain`. They run only when the whole model
|
|
63
|
+
has no source errors, so fix those first and never read a skipped check as clean.
|
|
64
|
+
|
|
65
|
+
- A finding is a prompt to look, not proof of a gap, and a clean result covers structure only.
|
|
66
|
+
It does not replace the matrix for command inputs, screen fields, reducers or performer views.
|
|
67
|
+
- An origin must be known, not just labeled. Calling an unknown value "allocated", "derived"
|
|
68
|
+
or "from context" to close a row is the same failure as leaving it blank: mark it `gap`
|
|
69
|
+
and ask.
|
|
70
|
+
|
|
47
71
|
## The matrix
|
|
48
72
|
|
|
49
73
|
One row per field, per slice touched, built from the `.play` files, not from memory or an
|
|
@@ -39,3 +39,13 @@ by Martin Dilger and Nebulit GmbH (https://nebulit.de), used with the explicit c
|
|
|
39
39
|
| `.build-kit/.slices/restaurant/*/slice.json` | none in this skill | patterns only; passed to scenario coverage (spec example values that vary one rule) |
|
|
40
40
|
| `.claude/skills/eventmodeling-identifying-outputs/SKILL.md`, "Common Patterns": status, list, timeline and processor-decision view patterns | `references/read-model-design.md` "Common view patterns" | Adapted closely as a table over `readmodel`, projection and `query`; the pseudo-code blocks became prose |
|
|
41
41
|
| `.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md`, "Recognizing a dedicated business event behind a derived condition": the "is this fact worth a new event" test, producing it by automation, fold only redundant causes, display-only conditions stay projections | `references/derived-condition-events.md` | Adapted closely; the todo-list translation pattern became a `reaction` that `produces` (a pending-work view only when the work can wait, retry or fail); the >3-events heuristic stays in `read-model-design.md`; board placement, 0,0-node scans and `validate_model` batch calls not adopted |
|
|
42
|
+
|
|
43
|
+
### Eventmodelers Build-Kits
|
|
44
|
+
|
|
45
|
+
Source: https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits, by Martin Dilger and Nebulit GmbH
|
|
46
|
+
(https://nebulit.de), used with the explicit consent of Martin Dilger and Nebulit GmbH.
|
|
47
|
+
|
|
48
|
+
| Source skill | Used in | How |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `eventmodeling-identifying-inputs` | `references/command-inventory.md` *Values a rule reads*; `references/field-lineage.md` | adapted closely: list every value a rule reads and classify it as input, state or context; time, caller and tenant are context, never caller-supplied, and a date the person chooses stays an input; the worked reservation example restated in Screenplay; the upstream mechanism of putting time and the acting user on the command is not adopted |
|
|
51
|
+
| `eventmodeling-information-completeness` | `references/field-lineage.md` *Where information starts*, *Check as you edit* | adapted closely: every value starts at one specific place and is carried by name; an unknown origin is a gap, never labeled to close a row; checked as each field is edited |
|
|
@@ -261,6 +261,7 @@ criterion.
|
|
|
261
261
|
For every specification:
|
|
262
262
|
|
|
263
263
|
- [ ] Concrete, realistic values — never "valid user" or "some amount".
|
|
264
|
+
- [ ] The values the outcome depends on are visible in the body, at the edge that matters.
|
|
264
265
|
- [ ] Tests exactly one behavior, independent of other specifications.
|
|
265
266
|
- [ ] Business language matching the event-model vocabulary.
|
|
266
267
|
|