@cratis/pi 7.6.4 → 7.7.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 +14 -0
- package/package/corpus/agents/code-reviewer.md +16 -0
- package/package/corpus/agents/coordinator.md +17 -0
- package/package/corpus/agents/frontend-developer.md +17 -0
- package/package/corpus/agents/orchestrator.md +18 -0
- package/package/corpus/agents/planner.md +24 -0
- package/package/corpus/agents/screenplay-modeler.md +57 -0
- package/package/corpus/agents/screenplay-renderer.md +42 -0
- package/package/corpus/agents/screenplay-reviewer.md +45 -0
- package/package/corpus/agents/slice-implementer.md +32 -5
- package/package/corpus/agents/spec-writer.md +16 -3
- package/package/corpus/prompts/add-reactor.prompt.md +5 -3
- package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
- package/package/corpus/prompts/write-specs.prompt.md +12 -6
- package/package/corpus/rules/application-profile.md +7 -3
- package/package/corpus/rules/general.md +8 -3
- package/package/corpus/rules/glossary.md +1 -1
- package/package/corpus/rules/profiles.md +42 -4
- package/package/corpus/rules/reactors.md +30 -22
- package/package/corpus/rules/vertical-slices.md +3 -1
- package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
- package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
- package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
- package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
- package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
- package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
- package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
- package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
- package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +95 -54
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +45 -5
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -7
- package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
- package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
- package/package/profile-catalog.json +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# From a Screenplay model to an Arc React page
|
|
2
|
+
|
|
3
|
+
Use this when the page you are asked to build, or change, is described by a
|
|
4
|
+
`screen` or `form` in a `.play` model. The model is the specification; the page
|
|
5
|
+
is how that specification looks in React. Read the model first, build the page
|
|
6
|
+
to match it element by element, and report every place where it is silent or
|
|
7
|
+
where the request disagrees with it. Where they disagree, change the model first
|
|
8
|
+
(`cratis-screenplay-event-modeling`), then the page.
|
|
9
|
+
|
|
10
|
+
## What is verified, and what is not
|
|
11
|
+
|
|
12
|
+
Three different claims are mixed in any "screen to page" mapping. Keep them apart.
|
|
13
|
+
|
|
14
|
+
| Claim | Status | Evidence |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| What each `screen`, `form` and interaction construct means | Verified | Screenplay `v4.64.0`: `Documentation/screenplay/{screens,forms,interactions}.md` |
|
|
17
|
+
| What Stage does with a screen | Verified: it draws it through Scene, it does not write a React page | Stage `v4.24.0`: `Documentation/reference/stage-rendering.md` ("It does not generate screens for it"), `Documentation/reference/default-scene-composition.md` ("does not ... generate per-screen TypeScript components"), `Source/Contracts/Scene/ScreenDirectiveConverter.cs` (`data`, `action`, `section`, `title`, `table`, `summary` become Scene elements) |
|
|
18
|
+
| Which Components and Arc API gives a page the same behavior | Verified API; the pairing is this skill's convention | `@cratis/components` `v4.6.0` (`DataPage`, `DataTables`, `CommandDialog`, `CommandForm`) and the sibling references |
|
|
19
|
+
|
|
20
|
+
So no product source maps a `.play` screen to an Arc React page. A hand-written
|
|
21
|
+
page is a **gap-fill** (`cratis-screenplay-render-and-gap-fill`) with the `.play`
|
|
22
|
+
screen as its contract. Screens are deferred by the backend profile: that deferral
|
|
23
|
+
is information `PLAY0269` and does not block binding, but the authoring
|
|
24
|
+
diagnostics still apply (syntax, unresolved or ambiguous references), and
|
|
25
|
+
warnings fail a warnings-as-errors gate. A clean compile proves the model is
|
|
26
|
+
authorable, not that every projection mapping resolves: binding reports `PLAY0273` for a mapped event property the event never declares. It does not prove a hand-written React page conforms to it, and no
|
|
27
|
+
tool checks that. You do, with the reconciliation at the end.
|
|
28
|
+
|
|
29
|
+
Stage 4.24 documents a frontend seam only for `Customizations/styles.css`
|
|
30
|
+
(`Documentation/guides/customize-rendered-application.md`); it documents no place
|
|
31
|
+
for hand-written pages in a rendered application. Never edit the generated React
|
|
32
|
+
scaffold. If you cannot say where the page lives, that is a blocker to report.
|
|
33
|
+
|
|
34
|
+
## Worked model
|
|
35
|
+
|
|
36
|
+
Every mapping below refers to this model. It is a complete document that compiles in design mode: the `ListBerths` list query blocks binding (V3), so it does not run through binding or rendering. The list stays because the screen is a list of berths; `GetBerth` is the keyed query for the detail screen.
|
|
37
|
+
|
|
38
|
+
```screenplay
|
|
39
|
+
concept BerthId : Uuid
|
|
40
|
+
concept BoatName : String
|
|
41
|
+
|
|
42
|
+
module Marina
|
|
43
|
+
feature BerthBookings
|
|
44
|
+
slice StateChange BookBerth
|
|
45
|
+
command BookBerth
|
|
46
|
+
berthId BerthId identifier
|
|
47
|
+
boatName BoatName
|
|
48
|
+
produces event BerthBooked
|
|
49
|
+
boatName BoatName = boatName
|
|
50
|
+
|
|
51
|
+
slice StateChange CancelBerth
|
|
52
|
+
command CancelBerth
|
|
53
|
+
berthId BerthId identifier
|
|
54
|
+
produces event BerthCancelled
|
|
55
|
+
|
|
56
|
+
slice StateView BerthList
|
|
57
|
+
readmodel BerthListView
|
|
58
|
+
berthId BerthId
|
|
59
|
+
boatName BoatName
|
|
60
|
+
projection BerthListProjection => BerthListView
|
|
61
|
+
from BerthBooked
|
|
62
|
+
berthId = $eventSourceId
|
|
63
|
+
boatName = boatName
|
|
64
|
+
query ListBerths => BerthListView[]
|
|
65
|
+
query GetBerth => BerthListView optional
|
|
66
|
+
by berthId BerthId
|
|
67
|
+
|
|
68
|
+
screen BerthListScreen
|
|
69
|
+
title "Berths"
|
|
70
|
+
data BerthListView[] via query ListBerths
|
|
71
|
+
action BookBerth
|
|
72
|
+
label "Book a berth"
|
|
73
|
+
action CancelBerth
|
|
74
|
+
table BerthListView
|
|
75
|
+
column boatName label "Boat"
|
|
76
|
+
on row-click navigate to BerthDetailsScreen by berthId
|
|
77
|
+
|
|
78
|
+
screen BerthDetailsScreen
|
|
79
|
+
data BerthListView via query GetBerth by berthId
|
|
80
|
+
summary BerthListView
|
|
81
|
+
field boatName label "Boat"
|
|
82
|
+
action CancelBerth
|
|
83
|
+
navigate to BerthListScreen
|
|
84
|
+
|
|
85
|
+
form BookBerthForm for BookBerth
|
|
86
|
+
field boatName label "Boat name"
|
|
87
|
+
on submit navigate to BerthListScreen
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The form `BookBerthForm` is found through `action BookBerth` on any screen, so
|
|
91
|
+
one dialog component serves every screen that offers the action. It lists one
|
|
92
|
+
field because `berthId` is the identifier, not something the user types.
|
|
93
|
+
|
|
94
|
+
## Level 1 and 2: `screen`
|
|
95
|
+
|
|
96
|
+
| In the model | In the page | Status |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `screen BerthListScreen` | One page component named after the screen, mounted on a route of the application's router | Router is application-owned; the sandbox addresses screens as `#/<ScreenName>` and that is not a rule for your app |
|
|
99
|
+
| `title "Berths"` | `DataPage` `title` (required prop) | Verified |
|
|
100
|
+
| `data BerthListView[] via query ListBerths` | `<DataPage query={ListBerths} ...>` | Verified |
|
|
101
|
+
| `data ... via query Q by p` | `queryArguments={{ p: ... }}`; the value comes from a route parameter or the caller | Verified prop; the origin goes in the Step 2 table |
|
|
102
|
+
| `data BerthListView via query GetBerth by berthId` (single result, not a collection) | `GetBerth.use({ berthId })`, render `result.data` once `hasData`; `hasData: false` right after a command is pending, not missing ([queries-and-commands.md](queries-and-commands.md)) | Verified hook; `DataPage` is for collections |
|
|
103
|
+
| An observable query behind `Q` | Same `query` prop; the page stays live | Verified |
|
|
104
|
+
| `table BerthListView` with `column boatName label "Boat"` | `<DataPage.Columns><Column field='boatName' header='Boat' /></DataPage.Columns>`; one `Column` per modeled `column`, no extras | Verified |
|
|
105
|
+
| A second `table` on one screen | `DataTableForQuery` / `DataTableForObservableQuery` ([data-tables.md](data-tables.md)) | Verified |
|
|
106
|
+
| `summary BerthListView` with `field boatName label "Boat"` | Plain markup in the page or in `detailsComponent` (`{ item }`), one labelled line per modeled `field` | Gap: this skill's verified sources name no summary component |
|
|
107
|
+
| `action BookBerth` with `label "Book a berth"` | `<MenuItem label='Book a berth' icon={...} command={() => showBookBerth()} />` plus `CommandDialog` and `useDialog` | Verified |
|
|
108
|
+
| `action CancelBerth` on a list with a table | `MenuItem` with `disableOnUnselected`; the selected row supplies the identifier | Verified prop |
|
|
109
|
+
| `action` with no `label` | The model gives no text. Use the command name, spaced, and report it | Gap |
|
|
110
|
+
| `action X` with `navigate to S [by p]` | Navigate to the page for `S` after the command succeeds, in `onSuccess`; pass `p` from the response or the row | Assumption: `screens.md` does not say when it navigates. The form's `on submit` is defined as "after a successful submit"; confirm with the model owner |
|
|
111
|
+
| `on row-click navigate to S by p` | `DataPage` and `DataTableForQuery` forward no row-click prop at `4.6.0` (only `DataTableCore` has `onRowClick`, and it takes rows, not a query). Use controlled `selection` and `onSelectionChange` to navigate, or a link in a `Column` `body` | Gap: selection is not a click; report which you chose |
|
|
112
|
+
| `section`, `sidebar`, `main`, `template MasterDetail` | Page layout. Keep the section names as component names so the page can be compared to the model. `MasterDetail` over a list is `detailsComponent` | Convention: Components has no screen-template concept |
|
|
113
|
+
| `title`, `label`, `message` written as `$strings.key` | The text of that key in the `.strings` file for the locale, never retyped from memory | Verified token ([internationalization.md](https://github.com/Cratis/Screenplay/blob/v4.64.0/Documentation/screenplay/internationalization.md)); the runtime mechanism is application-owned |
|
|
114
|
+
| `ui profile`, `theme`, `layout`, `arrangement` | Not page code. Theming is `cratis-components-styling`; the shell is the application's | Design-only |
|
|
115
|
+
| A Level 3 `react` block | The block is already the implementation, with typed `Props`. Port it into a component that honors those `Props` | Convention |
|
|
116
|
+
| `file Screens/X.tsx` | That file is the page. The model keeps the contract; the file must still show the declared data and actions | Stage's handling of the file reference is not verified |
|
|
117
|
+
|
|
118
|
+
## `form` and `field`
|
|
119
|
+
|
|
120
|
+
| In the model | In the page | Status |
|
|
121
|
+
| --- | --- | --- |
|
|
122
|
+
| `form BookBerthForm for BookBerth` | One `CommandDialog<BookBerth>` component, reused by every screen that has `action BookBerth` | Verified (a form is discovered by its command) |
|
|
123
|
+
| `field boatName` | A `CommandForm` field whose `value` accessor selects `c.boatName` | Verified |
|
|
124
|
+
| `field dueDate label "Due date"` | The same field with `title='Due date'` | Verified |
|
|
125
|
+
| `field` with no `label` | The model gives no text. Use the property name, spaced, and report it | Gap |
|
|
126
|
+
| The property's type | Choose the field component that matches it (`InputTextField`, `NumberField`, `CalendarField`, `CheckboxField`, `DropdownField`, ...), all from `@cratis/components/CommandForm` | Verified field set |
|
|
127
|
+
| A command property with no `field` | Not shown. It must come from `initialValues`, the route, or the server. If nothing supplies a required value, report a model gap; do not add a field | Convention |
|
|
128
|
+
| `populate from item` | `initialValues` built from the selected row, synchronously | Verified prop |
|
|
129
|
+
| `populate via query Q by p` | Read `Q`, then pass the result as `currentValues` (the overlay for late-loading values) | Verified prop |
|
|
130
|
+
| `field p from src` | Keep the accessor on `p`; seed `p` from `src` in `initialValues` | Convention |
|
|
131
|
+
| `field p compose using Callback` | The value is derived. Put the derivation in a pure function or view-model getter with a spec, and seed it through `initialValues`/`currentValues` | Gap: the model names a callback but not its signature; report it |
|
|
132
|
+
| `on submit navigate to S [by p]` | `onSuccess` navigates. `onSuccess` fires only after the command succeeds | Verified |
|
|
133
|
+
| No `on submit` | A successful submit leaves the user where they were: close the dialog, nothing more | Verified |
|
|
134
|
+
|
|
135
|
+
The command's validation lives on the command, not in the form. The page
|
|
136
|
+
surfaces it through the bound fields and the failure callbacks; it does not
|
|
137
|
+
restate a rule ([queries-and-commands.md](queries-and-commands.md)).
|
|
138
|
+
|
|
139
|
+
## Interactions: `on`, `uses`, `behavior`
|
|
140
|
+
|
|
141
|
+
The action set is closed ([interactions.md](https://github.com/Cratis/Screenplay/blob/v4.64.0/Documentation/screenplay/interactions.md)).
|
|
142
|
+
|
|
143
|
+
| Model action | Page |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| `execute <Command>` | `CommandDialog`, or `Command.use()` then `execute()` for a command with no user input ([queries-and-commands.md](queries-and-commands.md)) |
|
|
146
|
+
| `confirm "text"` | `useConfirmationDialog`; declining stops what follows |
|
|
147
|
+
| `notify info\|warning\|error "text"` | `toast.info/warn/error({ title, description })`, or `toastCommandResult` for a command result |
|
|
148
|
+
| `refresh <Query>` | For a query you read with the hook, call the `perform` function from `[result, perform, setSorting]` ([queries-and-commands.md](queries-and-commands.md)). An observable query updates by itself and has no `perform`. Gap: `DataPage` only forwards `onRefresh` to your own callback at `4.6.0`; it does not re-run its internal snapshot query, so an explicit refresh of a `DataPage` list has no verified mechanism. Use an observable query, or read the query yourself and render with `DataTableCore`-level components, and report the choice |
|
|
149
|
+
| `open dialog <Template>` / `close dialog` | `useDialog` / `closeDialog(DialogResult.Ok)` |
|
|
150
|
+
| `navigate to <Screen>` / `navigate back` | The application's router |
|
|
151
|
+
| `set <target> to <value>` | View-model state |
|
|
152
|
+
| `on success` / `on failure` continuation | `onSuccess` / `onFailed` |
|
|
153
|
+
| `raise <ApplicationTrigger>` | No page equivalent; a trigger is consumed by a `reaction` on the backend |
|
|
154
|
+
|
|
155
|
+
Triggers map the same way: `on click` is the control's handler or a `MenuItem`
|
|
156
|
+
`command`; `on select` is `onSelectionChange`; `on enter` is page mount or the
|
|
157
|
+
view model's `handleParams`.
|
|
158
|
+
|
|
159
|
+
`on submit` has two meanings. The one-line form shorthand `on submit navigate to
|
|
160
|
+
<Screen>` runs after a successful command, so it belongs in `onSuccess`. A generic
|
|
161
|
+
`on submit` behavior runs when the form is submitted and passes the modeled
|
|
162
|
+
validation, and it may itself contain `execute`. Run its actions from the
|
|
163
|
+
validated submit handler, in the order written; use `onSuccess` and `onFailed`
|
|
164
|
+
only for the `on success` and `on failure` continuations of an `execute` inside it.
|
|
165
|
+
|
|
166
|
+
`on event <Event>` is a gap. It observes a domain event and carries that event's
|
|
167
|
+
payload; an observable query delivers read-model changes, not event payloads, so
|
|
168
|
+
it is not a substitute. Do not implement it until the payload, subscription and
|
|
169
|
+
teardown contract of a verified event-delivery adapter is known. Report it.
|
|
170
|
+
`on interval` and `raise` need the same decision.
|
|
171
|
+
|
|
172
|
+
Anything a page does that no `on` clause says (an extra confirmation, an extra
|
|
173
|
+
toast) is an addition the model lacks: either add it to the model or leave it
|
|
174
|
+
out.
|
|
175
|
+
|
|
176
|
+
## Reconcile before you finish
|
|
177
|
+
|
|
178
|
+
Walk the screen once, declaration by declaration, and fill this table in your
|
|
179
|
+
report. Both columns must be empty at the end, or the entry explained.
|
|
180
|
+
|
|
181
|
+
| Model element | Page counterpart | Status |
|
|
182
|
+
| --- | --- | --- |
|
|
183
|
+
| each `data`, `action`, `column`, `summary field`, `form field`, `on` clause | the component or prop that implements it | present / missing / gap (see above) |
|
|
184
|
+
| (each user-visible value or control in the page) | the model element it came from | traced / **not in the model** |
|
|
185
|
+
|
|
186
|
+
A page element that is not in the model is not allowed to stay silently. Remove
|
|
187
|
+
it, or change the model first and say so.
|
|
188
|
+
|
|
189
|
+
## Verify
|
|
190
|
+
|
|
191
|
+
- The provenance of this guidance is in [provenance.md](provenance.md).
|
|
192
|
+
- The `.play` screen and form were read before the page was written, and the
|
|
193
|
+
mapping gaps above are named in the report with the choice made.
|
|
194
|
+
- Every `data`, `action`, `column`, `summary field`, form `field` and `on` clause
|
|
195
|
+
has a counterpart; the page adds no data or action the model lacks.
|
|
196
|
+
- Labels and messages equal the model's text or its `$strings` key.
|
|
197
|
+
- No generated or Stage-managed file was edited; the page's location is known.
|
|
198
|
+
- The states of [SKILL.md](../SKILL.md) Verify (empty, loading, failure, denied,
|
|
199
|
+
after success) are designed.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
Nebulit-GmbH/agentic-engineer has no licence; its material is recorded as ideas written
|
|
4
|
+
independently, with no text reused beyond a short phrase. No TrogonStack text is adapted
|
|
5
|
+
in this skill.
|
|
6
|
+
|
|
7
|
+
| Item | Source | Licence | Treatment | Where in this skill |
|
|
8
|
+
|---|---|---|---|---|
|
|
9
|
+
| Every displayed or captured value has a named origin; a value with none is a gap upstream | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/html-screen and .claude/skills/eventmodeling-storyboarding-events, written independently | none | IDEA | SKILL.md Step 2 |
|
|
10
|
+
| Check the implementation against its source of truth element by element | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/build-state-change, written independently | none | IDEA | references/from-screenplay.md *Reconcile before you finish*; SKILL.md Verify |
|
|
11
|
+
| Design the alternative states of a screen (empty, error, after success) | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/eventmodeling-storyboarding-events and .claude/skills/discover-storyboard, written independently | none | IDEA | SKILL.md Verify |
|
|
12
|
+
| Component APIs, props and hooks | Cratis Components 4.6.0 and Arc, see *Verified product sources* | MIT | original | SKILL.md, references/ |
|
|
13
|
+
| Screenplay and Stage facts in the screen mapping | Cratis/Screenplay v4.64.0 and Cratis/Stage v4.24.0 documentation and source | MIT | original | references/from-screenplay.md |
|
|
@@ -37,6 +37,16 @@ memory.
|
|
|
37
37
|
`cratis-chronicle-read-model`.
|
|
38
38
|
- You are writing the specification and want the `EventScenario` mechanics in
|
|
39
39
|
depth: use `cratis-chronicle-event-specifications`.
|
|
40
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
41
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
42
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
43
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
44
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
45
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
46
|
+
say so and do not author `.play` from memory.
|
|
47
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
48
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
49
|
+
never edit Stage-managed output.
|
|
40
50
|
|
|
41
51
|
## Step 1 — Pick the mechanism
|
|
42
52
|
|
|
@@ -6,6 +6,22 @@ license: MIT
|
|
|
6
6
|
|
|
7
7
|
# Chronicle event modeling
|
|
8
8
|
|
|
9
|
+
> **Model-first check.** If an accepted model under the model root covers this scope, or the
|
|
10
|
+
> repository is opted in (the root, default `.cratis/screenplay/`, holds a committed `.play`
|
|
11
|
+
> file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project explicitly set `mcpServers.screenplay.root` in
|
|
12
|
+
> `.cratis/ai.json`), the model is the source of truth: use
|
|
13
|
+
> `cratis-screenplay-event-modeling` (and the lifecycle in
|
|
14
|
+
> `cratis-screenplay-modeling-lifecycle`, which holds the master definition)
|
|
15
|
+
> instead of this skill. An empty directory, install output, a `.play` file
|
|
16
|
+
> outside the root or an untracked or uncommitted draft is not consent. This skill is for
|
|
17
|
+
> hand-written C# models where the repository has not opted in (never force a
|
|
18
|
+
> model; only the entry-point session proposes one, at most once per session), and for
|
|
19
|
+
> code-level work against an already accepted contract (stream identity,
|
|
20
|
+
> compliance, specifications). If the repository is opted in and the Screenplay
|
|
21
|
+
> skills are not installed, report the missing capability and block the
|
|
22
|
+
> model-authoring work; do not write a competing brief here and never author
|
|
23
|
+
> model syntax from memory.
|
|
24
|
+
|
|
9
25
|
Use this **before writing code**, when behavior, event vocabulary, stream
|
|
10
26
|
boundaries, or a multi-step flow is not already settled. The output is an
|
|
11
27
|
implementation brief: which commands exist, which stream each event lands on,
|
|
@@ -38,11 +54,14 @@ Classify every behavior in the model as exactly one:
|
|
|
38
54
|
| --- | --- | --- |
|
|
39
55
|
| **State change** | accepts a command, appends events | command, validation, events |
|
|
40
56
|
| **State view** | projects events into a queryable read model | read model plus a projection or a reducer |
|
|
41
|
-
| **Automation** | reacts to events and causes an external
|
|
42
|
-
| **Translation** |
|
|
57
|
+
| **Automation** | reacts to our own events and causes a side effect: an external call, a follow-up event (Screenplay `produces`) or a follow-up command (Screenplay `invokes`) | a reactor |
|
|
58
|
+
| **Translation** | takes data from outside our own facts (an external system or another service) and records it as our own facts | an adapter at the boundary, often a reactor |
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
The two differ in where the data comes from. An automation answers one of our own
|
|
61
|
+
events. A translation brings outside data in and keeps the external fact distinct
|
|
62
|
+
from the local one. A reactor that turns our own event into a follow-up event or
|
|
63
|
+
command is therefore an **automation**, however it is built. In Screenplay terms
|
|
64
|
+
these are the `Automation` and `Translate` slice types.
|
|
46
65
|
|
|
47
66
|
## Decide before implementing
|
|
48
67
|
|
|
@@ -59,8 +78,9 @@ the system, a translation stays inside it and produces new facts.
|
|
|
59
78
|
- **Read models** — their consumers and their source events, and whether the
|
|
60
79
|
model is projection-backed, reducer-backed, or `[Passive]` for a
|
|
61
80
|
strongly-consistent command-side decision.
|
|
62
|
-
- **Automations and translations** — which events
|
|
63
|
-
emit follow-up events or run commands, and which side
|
|
81
|
+
- **Automations and translations** — which events (or which outside data) they
|
|
82
|
+
react to, whether they emit follow-up events or run commands, and which side
|
|
83
|
+
effects must not repeat.
|
|
64
84
|
- **Specifications** — the happy path, the validation failures, the constraints,
|
|
65
85
|
the projections and reducers, and the reactor side effects.
|
|
66
86
|
|
|
@@ -80,9 +100,14 @@ than after the projection misbehaves.
|
|
|
80
100
|
automation, or translation. An event nothing consumes is a smell: either a
|
|
81
101
|
consumer is missing or the event should not exist.
|
|
82
102
|
|
|
83
|
-
If a field can only be filled by reaching into another behavior's read model
|
|
84
|
-
|
|
85
|
-
cross-read
|
|
103
|
+
If a field can only be filled by reaching into another behavior's read model to
|
|
104
|
+
*learn a fact the events should have carried*, you have found a missing event or
|
|
105
|
+
a wrong stream boundary. Fix the model. A read-only cross-slice read through
|
|
106
|
+
Chronicle is allowed where the rule needs it (an injected read model read by
|
|
107
|
+
explicit key, or a `[Passive]` projection for a command-side decision); see
|
|
108
|
+
Cross-slice patterns in `rules/vertical-slices.md`. Make such a read deliberate
|
|
109
|
+
and name it in the brief, with the consistency it needs: a rule that must hold
|
|
110
|
+
under concurrency uses the DCB pattern rather than a stale materialized read.
|
|
86
111
|
|
|
87
112
|
## Compliance modeling
|
|
88
113
|
|
|
@@ -151,13 +176,16 @@ remain separately authorized; a ready model authorizes none of them.
|
|
|
151
176
|
property.
|
|
152
177
|
- Every read-model field traces back to an event.
|
|
153
178
|
- Every event has at least one consumer.
|
|
154
|
-
-
|
|
179
|
+
- Every cross-slice read is deliberate, read-only, goes through Chronicle, and
|
|
180
|
+
is named in the brief with the consistency it needs; none stands in for a
|
|
181
|
+
missing event.
|
|
155
182
|
- Personal data has a decided subject, and the subject is person-level or the
|
|
156
183
|
trade-off is surfaced.
|
|
157
184
|
- The specification outline names the failures, not only the happy path.
|
|
158
185
|
|
|
159
186
|
## Route near misses
|
|
160
187
|
|
|
188
|
+
- A model covers the scope or the repository opted in (see the check at the top): start from `cratis-screenplay-event-modeling`; do not write the brief here.
|
|
161
189
|
- Modeling the same system as a **Screenplay `.play` document** rather than as a
|
|
162
190
|
brief for hand-written C#: `cratis-screenplay-event-modeling`. The method is the
|
|
163
191
|
same; the artifact is a file that compiles, and the four behavior types above
|
|
@@ -220,6 +220,19 @@ is expected, since the prior generation records history rather than new intent.
|
|
|
220
220
|
| Splitting one event into two inside `Upcast` | a migration produces one event; model a split as a reactor or a command |
|
|
221
221
|
| Adding a new generation for a renamed enum member | not needed; only removal or renumbering requires one |
|
|
222
222
|
|
|
223
|
+
## Route near misses
|
|
224
|
+
|
|
225
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
226
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
227
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
228
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
229
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
230
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
231
|
+
say so and do not author `.play` from memory.
|
|
232
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
233
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
234
|
+
never edit Stage-managed output.
|
|
235
|
+
|
|
223
236
|
## Verify
|
|
224
237
|
|
|
225
238
|
- The current record carries the bumped `[EventType(generation: N)]`.
|
|
@@ -242,6 +242,19 @@ through the read-model specification for this model and assert the projected
|
|
|
242
242
|
state — seed each contributing stream with its own event-source setup when the
|
|
243
243
|
projection spans streams.
|
|
244
244
|
|
|
245
|
+
## Route near misses
|
|
246
|
+
|
|
247
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
248
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
249
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
250
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
251
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
252
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
253
|
+
say so and do not author `.play` from memory.
|
|
254
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
255
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
256
|
+
never edit Stage-managed output.
|
|
257
|
+
|
|
245
258
|
## Verify
|
|
246
259
|
|
|
247
260
|
- Model-bound attributes were exhausted before the fluent builder, and the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-chronicle-reactor
|
|
3
|
-
description: Implement a Chronicle IReactor - an automation that causes an external side effect, or a translation
|
|
3
|
+
description: Implement a Chronicle IReactor - an automation that causes an external side effect or appends a follow-up event or command, or the adapter side of a translation of outside data into our own facts. Covers handler dispatch and parameter resolution, every supported return type, targeting another event source, replay handling with [OnceOnly] and [Replay], event filtering, failure and quarantine behavior, and the analyzer rules. Use for event-driven side effects; do not use to populate a read model.
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -15,9 +15,27 @@ effects. If the answer is "populate a queryable model", it is not a reactor.
|
|
|
15
15
|
| populate a queryable read model from events | a projection |
|
|
16
16
|
| a current-state-plus-event transition | a reducer |
|
|
17
17
|
| trigger a side effect outside the system | a reactor (**automation**) |
|
|
18
|
-
| append follow-up
|
|
18
|
+
| append a follow-up event or run a follow-up command in response to our own event | a reactor (**automation**: Screenplay `produces` / `invokes`) |
|
|
19
|
+
| record data from an outside system or service as our own facts | an adapter at the boundary, often a reactor (**translation**) |
|
|
19
20
|
| both a model and an effect | one projection *and* one reactor |
|
|
20
21
|
|
|
22
|
+
A reactor is an **automation** when it answers one of our own events, whatever it
|
|
23
|
+
causes. It is the adapter side of a **translation** only when its input is
|
|
24
|
+
outside data that becomes our own facts.
|
|
25
|
+
|
|
26
|
+
> **Model first.** If an accepted model under the model root covers this scope, or
|
|
27
|
+
> the repository is opted in (the root, default `.cratis/screenplay/`, holds a
|
|
28
|
+
> committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project explicitly set `mcpServers.screenplay.root` in
|
|
29
|
+
> `.cratis/ai.json`; master definition in `cratis-screenplay-modeling-lifecycle`), the automation is
|
|
30
|
+
> a modeled slice: find it (`Automation` or `Translate`), treat its `produces` /
|
|
31
|
+
> `invokes`, conditions and fields as the contract, and write the reactor only as
|
|
32
|
+
> gap-fill for what the model leaves to code (Stage renders no Automation or
|
|
33
|
+
> Translate slices). Use `cratis-screenplay-automations-and-translations` to
|
|
34
|
+
> change the model; never change the model to fit the reactor, and never leave a
|
|
35
|
+
> modeled rule living only in the reactor. If the repository is not opted in
|
|
36
|
+
> (an empty directory, install output, a `.play` file outside the root or an untracked or uncommitted draft is not consent), stay code-first here
|
|
37
|
+
> (`cratis-chronicle-event-modeling` for a new, unsettled flow); if the Screenplay skills are not installed, say so and do not author `.play` from memory.
|
|
38
|
+
|
|
21
39
|
## Verified product sources
|
|
22
40
|
|
|
23
41
|
This skill is verified against these exact sources:
|
|
@@ -277,10 +295,10 @@ await eventStore.EventLog.Append(
|
|
|
277
295
|
A **projection cannot be filtered at all** — if you need metadata-based
|
|
278
296
|
selection, a reactor or a reducer is where it happens.
|
|
279
297
|
|
|
280
|
-
##
|
|
298
|
+
## Invoking a command from a reactor
|
|
281
299
|
|
|
282
|
-
|
|
283
|
-
rather than appending directly. With the Arc Chronicle integration the handler
|
|
300
|
+
An automation that turns one area's events into another area's intent runs a
|
|
301
|
+
command rather than appending directly (Screenplay `invokes`). With the Arc Chronicle integration the handler
|
|
284
302
|
**returns** the command — the same shape as returning an event — and Arc executes
|
|
285
303
|
it through validation and authorization; a denied, invalid or throwing result is a
|
|
286
304
|
side-effect failure that fails the partition rather than being dropped:
|
|
@@ -363,6 +381,29 @@ handlers that return events, assert the resulting appends through the scenario's
|
|
|
363
381
|
event store. Cover the replay path separately when the reactor has `[OnceOnly]`
|
|
364
382
|
or `[Replay]` handlers.
|
|
365
383
|
|
|
384
|
+
Specify the contract, not only the happy path:
|
|
385
|
+
|
|
386
|
+
- **Field lineage.** For each returned command or event, a specification asserts
|
|
387
|
+
every field value against the trigger event, the injected read model, or the
|
|
388
|
+
mapping the contract states. Use distinct values per source so a swapped or
|
|
389
|
+
defaulted field fails.
|
|
390
|
+
- **Contract-authorized filtering.** A reactor skips an event only for a
|
|
391
|
+
condition the contract states. Give each stated condition a specification
|
|
392
|
+
that shows the skip, and one showing the neighbouring case that does act. Do
|
|
393
|
+
not add a skip nobody specified.
|
|
394
|
+
- **Repeated delivery.** Recovery re-delivers the same event even with
|
|
395
|
+
`[OnceOnly]`, so specify what the reactor does the second time (one effect, an
|
|
396
|
+
idempotent write, or a receipt keyed by `ReactorDelivery`). The scenario gives
|
|
397
|
+
every event it delivers its own sequence number, so firing the same event twice
|
|
398
|
+
through `Given` is two deliveries, not a re-delivery; to prove the
|
|
399
|
+
re-delivery guard, call the handler twice with the same `ReactorDelivery`, or
|
|
400
|
+
assert it on the collaborator that holds the receipt.
|
|
401
|
+
- **Unrelated events.** `WithStrictEventSubscription()` belongs to
|
|
402
|
+
`ReadModelScenario<T>` and only fails a specification that *seeds* an event the
|
|
403
|
+
projection does not subscribe to; it does not prove a subscription set, and
|
|
404
|
+
`ReactorScenario<T>` has no equivalent. For a reactor, show with a
|
|
405
|
+
specification that an event outside its handlers causes no effect.
|
|
406
|
+
|
|
366
407
|
## Verify
|
|
367
408
|
|
|
368
409
|
- The class implements `IReactor` and is not generic.
|
|
@@ -374,10 +415,21 @@ or `[Replay]` handlers.
|
|
|
374
415
|
- No `IEventLog` is injected; side-effect events are returned instead.
|
|
375
416
|
- Handlers returning events carry `[OnceOnly]`.
|
|
376
417
|
- Side effects are idempotent even with `[OnceOnly]`, because recovery
|
|
377
|
-
re-delivers.
|
|
418
|
+
re-delivers, and a specification covers repeated delivery.
|
|
419
|
+
- Every field of a returned command or event comes from the trigger event, an
|
|
420
|
+
injected read model, or a mapping the contract states; none is invented or
|
|
421
|
+
defaulted.
|
|
422
|
+
- Every condition that skips an event is stated in the contract; none is
|
|
423
|
+
invented.
|
|
424
|
+
- A modeled automation (an opted-in scope) matches its `.play` slice (events, `produces` /
|
|
425
|
+
`invokes`, conditions); the model was not edited to match the reactor.
|
|
378
426
|
- `[EventStore]` is not combined with an explicit event sequence.
|
|
379
427
|
- No filter attribute is placed where it is inert.
|
|
380
428
|
- The reactor holds no mutable state and injects no storage primitive.
|
|
381
429
|
- The build is clean with no `CHR0004`, `CHR0005`, `CHR0008`, `CHR0013`,
|
|
382
430
|
`CHR0022`, `CHR0031`, or `CHR0032` outstanding, and the reactor
|
|
383
431
|
specifications pass.
|
|
432
|
+
|
|
433
|
+
## Lineage
|
|
434
|
+
|
|
435
|
+
The specification checklist (field lineage, contract-authorized filtering, repeated delivery) follows an idea from Nebulit's reactor build checklist, written independently. See `references/provenance.md`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
## Ideas from Nebulit, written independently
|
|
4
|
+
|
|
5
|
+
| Idea | Used in | Source |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Reactor build checklist: output fields traced to a stated source, skip conditions stated in the contract, repeated-input cases | `SKILL.md` "Specifications" (field lineage, contract-authorized filtering, repeated delivery) and "Verify" | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/build-automation/SKILL.md, written independently; no passages reused |
|
|
8
|
+
|
|
9
|
+
The `WithStrictEventSubscription()` scope statement and the scenario sequence-number behavior are verified against Chronicle `v19.32.0` source (`Source/Clients/Testing/ReadModels/ReadModelScenario.cs`, `Source/Clients/Testing/Reactors/ReactorScenario.cs`).
|
|
@@ -208,6 +208,19 @@ through the read-model specification for this model and assert the projected
|
|
|
208
208
|
state. Seed each contributing stream with its own event source when the model
|
|
209
209
|
spans streams.
|
|
210
210
|
|
|
211
|
+
## Route near misses
|
|
212
|
+
|
|
213
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
214
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
215
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
216
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
217
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
218
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
219
|
+
say so and do not author `.play` from memory.
|
|
220
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
221
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
222
|
+
never edit Stage-managed output.
|
|
223
|
+
|
|
211
224
|
## Verify
|
|
212
225
|
|
|
213
226
|
- Every event is a past-tense fact with one purpose and no nullable properties.
|
|
@@ -38,6 +38,21 @@ version.
|
|
|
38
38
|
- Deciding what the read model or projection should *be*: use
|
|
39
39
|
`cratis-chronicle-read-model`, `cratis-chronicle-projection`, or
|
|
40
40
|
`cratis-chronicle-reducer`.
|
|
41
|
+
- The scope is model-first (its read-model `specification` blocks and `then
|
|
42
|
+
readmodel` rows are the contract). Decide this with the decision rule in
|
|
43
|
+
`cratis-screenplay-modeling-lifecycle`: model-first only when an accepted
|
|
44
|
+
model under the model root covers this scope, or the repository is opted in
|
|
45
|
+
(the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set `mcpServers.screenplay.root`
|
|
46
|
+
in `.cratis/ai.json`); an empty directory, install output, a `.play` file
|
|
47
|
+
outside the root or an uncommitted draft does not count, and framework, infrastructure, client, adapter and not-opted-in
|
|
48
|
+
brownfield work stays code-first. Opted in but no model for this scope: model
|
|
49
|
+
it first (`cratis-screenplay-discovery`, then `cratis-screenplay-slice-design`)
|
|
50
|
+
before writing specifications. If those Screenplay skills are not installed,
|
|
51
|
+
say so and stop; never author `.play` from memory. Never edit Stage-managed
|
|
52
|
+
output, and never change a model specification to match existing code. Author model
|
|
53
|
+
specifications with `cratis-screenplay-specifications` and
|
|
54
|
+
`cratis-screenplay-scenario-coverage`; check finished code against them with
|
|
55
|
+
`cratis-application-slice-conformance`.
|
|
41
56
|
|
|
42
57
|
## When you need this
|
|
43
58
|
|
|
@@ -155,6 +170,35 @@ public class and_two_items_are_priced : Specification
|
|
|
155
170
|
Wrap every file in `#if DEBUG … #endif` so specification code ships only in
|
|
156
171
|
Debug, and keep one outcome per `should_` fact.
|
|
157
172
|
|
|
173
|
+
## Step 6 — Cover the read model, not just one event
|
|
174
|
+
|
|
175
|
+
One summation example proves one event. Take the inventory from the contract
|
|
176
|
+
(the `.play` read model and its specifications, or the agreed outline); without
|
|
177
|
+
one, derive it from the projection and say so. Then check each line:
|
|
178
|
+
|
|
179
|
+
- **Every property is asserted** in at least one specification.
|
|
180
|
+
- **Every subscribed event has a specification.** Reconcile three lists in both
|
|
181
|
+
directions: the contract's event types, the projection's actual subscriptions,
|
|
182
|
+
and the events your specifications seed. Report any event in one list missing
|
|
183
|
+
from another; route that reconciliation to
|
|
184
|
+
`cratis-application-slice-conformance`. `WithStrictEventSubscription()` is
|
|
185
|
+
narrower: it fails a specification that *seeds* an event the projection does
|
|
186
|
+
not subscribe to. It does not reveal an extra subscription that no
|
|
187
|
+
specification seeds, nor a subscribed event lacking a specification.
|
|
188
|
+
- **Every removal or clearing event has a specification asserting absence**:
|
|
189
|
+
`Instance` is `null`, or the child is gone from the collection. Absence is a
|
|
190
|
+
result, not a skipped case.
|
|
191
|
+
- **A later event that updates only some properties** has a specification showing
|
|
192
|
+
the other properties are unchanged.
|
|
193
|
+
- **Use the contract's example values** so the code and the contract describe the
|
|
194
|
+
same example; substitute fresh identifiers only where isolation needs it,
|
|
195
|
+
keeping the example's relationships. A read-model rule found in the projection with no contract
|
|
196
|
+
specification is a proposal for the contract (the `.play` model when one covers the slice, otherwise the agreed outline), not silent coverage.
|
|
197
|
+
|
|
198
|
+
## Lineage
|
|
199
|
+
|
|
200
|
+
Step 6 is adapted in our own words from ideas recorded in `references/provenance.md`.
|
|
201
|
+
|
|
158
202
|
## What breaks
|
|
159
203
|
|
|
160
204
|
- **`NoReadModelHandlerFound`.** Nothing in the loaded assemblies handles
|
|
@@ -167,6 +211,9 @@ Debug, and keep one outcome per `should_` fact.
|
|
|
167
211
|
identically named property over the explicit setter, or the explicit setter
|
|
168
212
|
never fired. This looks like a specification problem and is a projection
|
|
169
213
|
problem.
|
|
214
|
+
- **A removal is never exercised.** The suite is green because every
|
|
215
|
+
specification only adds. Seed the event that removes or clears, then assert the
|
|
216
|
+
instance is `null` or the child is absent.
|
|
170
217
|
- **The specification passes but production does not.** The specification pinned
|
|
171
218
|
a read-model instance instead of seeding events, so the projection under
|
|
172
219
|
question never ran.
|
package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
Lineage of the #493 additions to `cratis-chronicle-read-model-specifications`. No third-party
|
|
4
|
+
text is reproduced and no TrogonStack material was adapted, so no third-party notice applies.
|
|
5
|
+
|
|
6
|
+
## Ideas written independently
|
|
7
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.claude/skills/build-state-view/SKILL.md`
|
|
8
|
+
(checklist: every field asserted, every event covered, empty-list case), written
|
|
9
|
+
independently: Step 6 read-model lifecycle coverage, absence as a result, and partial-update
|
|
10
|
+
preservation. The strict-subscription reconciliation is original to Cratis and verified
|
|
11
|
+
against Chronicle v18.3.0 and v19.32.0.
|
|
@@ -174,6 +174,19 @@ model and assert on the resulting instance. Cover, at minimum:
|
|
|
174
174
|
- every branch the reducer actually has;
|
|
175
175
|
- deletion, if the reducer ever returns `null`.
|
|
176
176
|
|
|
177
|
+
## Route near misses
|
|
178
|
+
|
|
179
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
180
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
181
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
182
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
183
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
184
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
185
|
+
say so and do not author `.play` from memory.
|
|
186
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
187
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
188
|
+
never edit Stage-managed output.
|
|
189
|
+
|
|
177
190
|
## Verify
|
|
178
191
|
|
|
179
192
|
- The admission test is satisfied and the justification names the specific
|
|
@@ -196,6 +196,19 @@ children.
|
|
|
196
196
|
| Seeding a required value in `onBeforeExecute` | Use `initialValues` |
|
|
197
197
|
| `pt` applied expecting it to reach the dialog | `pt` targets the stepper; use `dialogPt` |
|
|
198
198
|
|
|
199
|
+
## Route near misses
|
|
200
|
+
|
|
201
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
202
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
203
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
204
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
205
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
206
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
207
|
+
say so and do not author `.play` from memory.
|
|
208
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
209
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
210
|
+
never edit Stage-managed output.
|
|
211
|
+
|
|
199
212
|
## Verify
|
|
200
213
|
|
|
201
214
|
- Imports come from `@cratis/components/CommandDialog` and
|