@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,30 @@
|
|
|
1
|
+
Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
Licensed under the MIT license. See LICENSE file in the canonical Cratis/AI repository for the full license text.
|
|
3
|
+
|
|
4
|
+
## Third-party notices
|
|
5
|
+
|
|
6
|
+
Parts of this skill (the interview-phase format and the quality-checklist items) are adapted
|
|
7
|
+
from the TrogonStack event modeling skills (TrogonStack/agentskills, commit
|
|
8
|
+
7b249d3ee42d8b7e11fa564141ebd5fbc37aadf1). See `references/provenance.md`.
|
|
9
|
+
|
|
10
|
+
MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2025 Straw Hat, LLC
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cratis-screenplay-slice-design
|
|
3
|
+
description: "Shape Screenplay slices from a discovered timeline: commands with reachable, authorized origins and traced inputs, rules placed by layer, a per-command refusal inventory, events-vs-views decisions, read models per screen component with queries that follow the business view, Level-1 screens, field lineage, state-transition tables, slice dependencies and the next slice. Use after discovery, when adding a capability or deciding command inputs, rule placement, read-model shape or screen data. Not for: stream boundaries or invariants across streams (use `cratis-screenplay-streams-and-consistency`), reactions and captures (use `cratis-screenplay-automations-and-translations`), which scenarios to write (use `cratis-screenplay-scenario-coverage`), or auditing a finished model (use `cratis-screenplay-model-review`)."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Slice design
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Turn a timeline of events into designed slices: for each fact, the command that records it and
|
|
12
|
+
where its data comes from; for each thing someone needs to see, the read model, query and
|
|
13
|
+
screen. Output: compiling `StateChange` and `StateView` slices in the chosen mode, a command
|
|
14
|
+
card and refusal inventory per command, a lineage matrix, a state-transition table per entity,
|
|
15
|
+
slice dependencies, and the rules the model records but cannot enforce yet.
|
|
16
|
+
Grammar: `cratis-screenplay-command-surface`, `cratis-screenplay-read-surface`,
|
|
17
|
+
`cratis-screenplay-projections`. Tools, versions and verdicts: `cratis-screenplay-toolchain`.
|
|
18
|
+
Lifecycle, modes and hand-offs: `cratis-screenplay-modeling-lifecycle`.
|
|
19
|
+
|
|
20
|
+
## When / when not
|
|
21
|
+
|
|
22
|
+
- Use after `cratis-screenplay-discovery`; for adding a capability; for command inputs, rule
|
|
23
|
+
placement, read-model or query shape, screen data; for checking lineage.
|
|
24
|
+
- Not for: which identity a fact belongs to and where invariants are enforced
|
|
25
|
+
(`cratis-screenplay-streams-and-consistency`); reactions, todo lists, captures
|
|
26
|
+
(`cratis-screenplay-automations-and-translations`); which scenarios to write
|
|
27
|
+
(`cratis-screenplay-scenario-coverage`); a full audit (`cratis-screenplay-model-review`).
|
|
28
|
+
|
|
29
|
+
## Interview phase
|
|
30
|
+
|
|
31
|
+
Skip if the request already names the origins of the commands (screens, reactions, outside
|
|
32
|
+
systems), the decision a person makes with each shown field, and how fresh each view must be.
|
|
33
|
+
Otherwise ask, in one batch, only what is missing. Unattended: assume visibly, write each
|
|
34
|
+
assumption into the phase report and the slice `description`, and continue.
|
|
35
|
+
|
|
36
|
+
1. **Origin of each action.** Is it a person on a screen, an automatic reaction, or an outside
|
|
37
|
+
system? Impact: separates screen commands from automation (and a trusted path).
|
|
38
|
+
Follow-up: if a mix, which user actions start automation, and what does the automation
|
|
39
|
+
decide on its own? If outside systems, which one and what data does it send?
|
|
40
|
+
2. **Critical fields.** Which data matters most on each screen, and what decision does the
|
|
41
|
+
person make from each field? Impact: fields with no decision behind them are questions, not
|
|
42
|
+
requirements. Follow-up: for a field nobody can justify, ask whether it is history worth
|
|
43
|
+
keeping or can go.
|
|
44
|
+
3. **Freshness and cost.** How stale may each view be, and what does a stale answer cost?
|
|
45
|
+
Impact: picks projection versus reducer, and one-shot versus `observable`. Follow-up: if a
|
|
46
|
+
wrong answer is expensive (a booking, a payment), that decision needs a protected read
|
|
47
|
+
(`references/rule-layers.md`), not a view.
|
|
48
|
+
4. **Granularity.** When someone changes these values, why? Impact: separates decisions from
|
|
49
|
+
forms. Follow-up: when a screen edits several values, ask for each who changes it and why.
|
|
50
|
+
5. **Existing UI or constraints.** Is there a screen or system to match? Impact: origins and
|
|
51
|
+
screen data. Follow-up: ask to see it; styling belongs to `cratis-screenplay-ui-composition`.
|
|
52
|
+
|
|
53
|
+
## Procedure
|
|
54
|
+
|
|
55
|
+
1. **Fix the mode** for the scope (`cratis-screenplay-modeling-lifecycle`): design, executable
|
|
56
|
+
or renderable. It decides which shapes you may use (steps 6, 9). Read the existing model
|
|
57
|
+
before adding to it.
|
|
58
|
+
2. **Find each event's origin.** For every event ask who or what makes it happen and through
|
|
59
|
+
which path: a persona's screen `action` or form, a reaction's `invokes`, a capture. The
|
|
60
|
+
origin must be **reachable** (some screen, form, reaction or integration leads to the
|
|
61
|
+
command) and **authorized** (the persona's policies satisfy every gate on module, feature
|
|
62
|
+
and command). A command may have several origins; each must be real. A reaction's `invokes`
|
|
63
|
+
has no caller, so a gated command it invokes is refused: design the trusted path, never
|
|
64
|
+
delete the gate.
|
|
65
|
+
3. **Design the command** (`references/command-inventory.md`). Imperative business name for
|
|
66
|
+
**one** decision (`ReassignLocker`, `CorrectLockerVolume`). A form verb (`Update`, `Edit`,
|
|
67
|
+
`Save`, `Set`, `Change`, `Manage` + noun) means several decisions share a form: ask which
|
|
68
|
+
separate reasons change these values, then split (`references/slicing.md` *Generic edits*).
|
|
69
|
+
One input per thing the caller decides or supplies; `identifier` on the property naming the
|
|
70
|
+
instance (omit only for allocation); `for <identifier>` on every `produces`. Trace each input
|
|
71
|
+
(`references/field-lineage.md`). A conditional input is a granularity question: two
|
|
72
|
+
decisions are two commands; one decision with a dependent rule is an implication
|
|
73
|
+
(`require a == false or b > c`). Never a boolean attestation input (`confirmsX == true`)
|
|
74
|
+
standing in for a rule. Place each rule in its layer (`references/rule-layers.md`). A rule
|
|
75
|
+
over stored state is written as `reads <View>` + `require ... message "..."` and marked
|
|
76
|
+
**NOT enforced in the model today** in the slice `description`, with its target named (Arc
|
|
77
|
+
`[ProtectedDecision]` + `DecisionRead<T>` on Arc 22.39.0+, not available in Stage-rendered
|
|
78
|
+
apps; Chronicle DCB; or a constraint). Never copy state
|
|
79
|
+
into the command as input or hide a rule in `handler` / hint prose; descriptions are not
|
|
80
|
+
rendered (Stage#178). Fill the **refusal inventory**: success, each distinct refusal with
|
|
81
|
+
layer and message, and the denied persona.
|
|
82
|
+
4. **Name and shape the event.** Past tense, the specific change that became true
|
|
83
|
+
(`LockerRelocated`, `VolumeCorrected`); never `XUpdated`/`Changed`/`Edited`/`Saved`/
|
|
84
|
+
`Modified`, never `XRecalculated` (a running figure is a view), and no payload restating the
|
|
85
|
+
creation event without a named business change. Naming: `cratis-screenplay-discovery`
|
|
86
|
+
`references/event-naming.md`. Only facts: values the command supplied, literals,
|
|
87
|
+
`$context.occurred` or caller identity. No event-source id in the payload (it is the `for`);
|
|
88
|
+
references to other instances are payload. No nullable property by default (a required value
|
|
89
|
+
or a separate event). No PII on the identifier; one data subject per stream. Add a field only
|
|
90
|
+
when something downstream needs it.
|
|
91
|
+
5. **Events or views?** For each value someone needs: was it decided or supplied (event), or
|
|
92
|
+
can it be worked out from facts already recorded (view)? Decided calculations (a quoted
|
|
93
|
+
price, a set fee) are facts. Running figures are views. Time-relative states ("overdue")
|
|
94
|
+
are not stored: store the deadline.
|
|
95
|
+
6. **Design the read side** (`references/read-model-design.md`). One read model per screen
|
|
96
|
+
component or automation need. Pick the builder (declarative projection first, reducer when
|
|
97
|
+
guards cannot be expressed). The query follows the business view: a list where people scan a
|
|
98
|
+
list, a keyed lookup where they open one thing. For **executable or renderable scope**, every
|
|
99
|
+
read model also needs one unambiguous key: keyed queries `query XById => RM optional` all
|
|
100
|
+
using the same `by xId XId`. The identifier always equals the projection's effective key;
|
|
101
|
+
the decision table is in `references/read-model-design.md` and the full rule in
|
|
102
|
+
`cratis-stage-rendering-and-sandbox` `references/admission.md`. Keep the list query in design mode and record that it blocks V3.
|
|
103
|
+
Whose rows is part of the view; a caller-supplied filter is not access control.
|
|
104
|
+
7. **Screens, Level 1.** `data <RM> via query <Q>` plus `action <Command>` per thing the user
|
|
105
|
+
can do there. Build each slice as read model, screen, command, event. A screen acting on an
|
|
106
|
+
existing instance also shows `data` from a view that supplies the identifier and the state
|
|
107
|
+
the user decides on; only a creation screen may lack `data` (say so in the slice
|
|
108
|
+
`description`). A screen with neither `data` nor `action` is a gap. One actor's point of view
|
|
109
|
+
per screen, at a real beat of the story, not one per persona for symmetry; know where the
|
|
110
|
+
actor sees each state change's result. Beyond Level 1: `cratis-screenplay-ui-composition`.
|
|
111
|
+
8. **Lineage pass.** Build the matrix in `references/field-lineage.md` from the `.play` files
|
|
112
|
+
(read them), not from memory or an earlier summary. For each read model, write one line per
|
|
113
|
+
contributing event in its StateView slice `description`: which fields it sets and why. An
|
|
114
|
+
event with no reason does not belong in the view. A field without an origin is a gap: add
|
|
115
|
+
the missing input or event field, or record an open question. Never invent a source.
|
|
116
|
+
9. **Slice and continue** (`references/slicing.md`): state-transition table per entity; one
|
|
117
|
+
command per `StateChange` slice by default (required for renderable scope), one view per
|
|
118
|
+
`StateView` slice; record the events each slice consumes and which slice produces them. If
|
|
119
|
+
the request names the next capability, build that; otherwise pick the next slice with the
|
|
120
|
+
heuristic there, act, and state why you chose it.
|
|
121
|
+
10. **Validate** after the batch: V1 with warnings as errors, then V3 when the mode is
|
|
122
|
+
executable or renderable, with the tool and version named (`cratis-screenplay-toolchain`
|
|
123
|
+
`references/verdicts.md`). Hand off with the model root and source revision, the slices
|
|
124
|
+
touched, and **one line per element** (command, screen, read model, slice inventory), not
|
|
125
|
+
only problems. Decided refusals go to `cratis-screenplay-scenario-coverage`, never to open
|
|
126
|
+
questions.
|
|
127
|
+
|
|
128
|
+
## Rules
|
|
129
|
+
|
|
130
|
+
### Compiler contracts (the tool enforces these)
|
|
131
|
+
|
|
132
|
+
- At most one `identifier` per command; never on an event property; never on a read-model
|
|
133
|
+
property (identity comes from the keyed query's `by`).
|
|
134
|
+
- At most one builder (projection or reducer) per read model (`PLAY0191`).
|
|
135
|
+
- A query's `by` goes on its own body line. Only `=> RM optional` with one caller-supplied `by`
|
|
136
|
+
binds in the executable model; list, observable, filtered or scoped queries are `PLAY0268` at
|
|
137
|
+
binding but compile.
|
|
138
|
+
- A `unique` constraint names a property the event declares directly; the constraint name is
|
|
139
|
+
its identity (renaming starts an empty index).
|
|
140
|
+
- Unauthorized is `then denied`; a broken rule is `then error`; authorization runs first.
|
|
141
|
+
- A mapping to an undeclared target fails only at binding (V3, PLAY0273); a declared property that nothing maps (for example after a one-sided rename that AutoMap relied on) is reported by no tool: check field lineage by hand.
|
|
142
|
+
|
|
143
|
+
### Modeling defaults (follow unless the domain gives a reason not to)
|
|
144
|
+
|
|
145
|
+
- One command per `StateChange` slice (renderable: required, plus no `produces when`).
|
|
146
|
+
- One business decision usually produces one event; a decision establishing several facts the
|
|
147
|
+
business recognises separately may produce several (say why in the `description`).
|
|
148
|
+
- Copy an identity into an event payload only when a consumer needs it as a value.
|
|
149
|
+
- Keep durable design rationale in slice `description` text, not `//` comments.
|
|
150
|
+
- Rule coverage: for each value carrying a rule, list every path that sets it
|
|
151
|
+
(`references/slicing.md`). A constraint on a claim covers every event setting that claim;
|
|
152
|
+
value invariants live in the concept so they travel; command-level conditions are reviewed
|
|
153
|
+
per path, not copied blindly.
|
|
154
|
+
|
|
155
|
+
### Review questions
|
|
156
|
+
|
|
157
|
+
Ask the design review questions in `references/review-questions.md` (reachability, forms in
|
|
158
|
+
disguise, secrets, fan-in, collections, atomic invariants, who sees which rows); report a
|
|
159
|
+
finding only with a domain consequence.
|
|
160
|
+
|
|
161
|
+
## Identity-affecting edits on an existing model
|
|
162
|
+
|
|
163
|
+
Classify an edit by whether it changes catalog addresses. When `.screenplay/identities.json`
|
|
164
|
+
exists, adding, removing or renaming an addressed element (declarations, properties of commands, events,
|
|
165
|
+
read models, composite types and triggers, queries, query arguments, specifications), moving
|
|
166
|
+
declarations between files, creating, deleting, renaming or moving a mapped `.play` document, and any
|
|
167
|
+
contract change to a persisted event go through MCP, performed by the identity owner
|
|
168
|
+
(`cratis-screenplay-modeling-lifecycle`, *Classify by catalog address*; evolution classes:
|
|
169
|
+
`cratis-screenplay-streams-and-consistency`). Bounded text edits are only for edits that
|
|
170
|
+
preserve addresses (descriptions, rule and expression bodies, mappings between existing
|
|
171
|
+
members). Without `identities.json`, plain text edits are fine. Never use a text edit to get
|
|
172
|
+
around a refusal from the typed tools.
|
|
173
|
+
|
|
174
|
+
## Gate
|
|
175
|
+
|
|
176
|
+
Slice design is done when all of these hold; otherwise report what is open.
|
|
177
|
+
|
|
178
|
+
- [ ] Every command: origin reachable and authorized; every input traced; rules placed by
|
|
179
|
+
layer; stored-state rules recorded NOT enforced with a named target; no form-verb name.
|
|
180
|
+
- [ ] Every command has a refusal inventory (success, each refusal with layer and message,
|
|
181
|
+
denied persona); every gated command and query has a `then denied` row.
|
|
182
|
+
- [ ] Every event is past tense, a specific change, and consumed or justified.
|
|
183
|
+
- [ ] Every read model has a consumer and, when the scope is executable, one unambiguous key (keyed queries all using the same `by` property).
|
|
184
|
+
- [ ] Every StateView `description` gives a reason per contributing event; every read-model
|
|
185
|
+
field and screen field is traced; every `from` event sets a field.
|
|
186
|
+
- [ ] No `screen` without `data` or `action`; every acting screen has `data` or a stated
|
|
187
|
+
exemption.
|
|
188
|
+
- [ ] State-transition table per entity, including refused transitions; rule coverage listed
|
|
189
|
+
per rule-carrying value; slice dependencies recorded.
|
|
190
|
+
- [ ] V1 passed, and V3 for executable or renderable scope with expected codes only (or
|
|
191
|
+
ready), each naming the tool and version.
|
|
192
|
+
|
|
193
|
+
## Verified product sources
|
|
194
|
+
|
|
195
|
+
| Source | Pin | Used for |
|
|
196
|
+
| --- | --- | --- |
|
|
197
|
+
| Screenplay | `v4.64.0` (`7e16162`) | `commands.md`, `constraints.md`, `specifications.md`, `diagnostics.md` (`PLAY0191`, `PLAY0268`, `PLAY0271`, `PLAY0350`, `PLAY0381`, `PLAY0397`), `projections/keys.md` |
|
|
198
|
+
|
|
199
|
+
Every example here compiles with the standalone `screenplay` 4.64.0 `--warnaserror`, and with
|
|
200
|
+
`cratis screenplay validate --warnings-as-errors` (cratis 3.27.1). Other pins:
|
|
201
|
+
`cratis-screenplay-toolchain` `references/versions.md`. Compilation proves syntax, not that
|
|
202
|
+
the model is executable or renders.
|
|
203
|
+
|
|
204
|
+
## Verify
|
|
205
|
+
|
|
206
|
+
- V1 passes with the tool named in `cratis-screenplay-toolchain` (name tool and version).
|
|
207
|
+
- Executable/renderable scope: V3 reports the expected codes only (or ready).
|
|
208
|
+
- Walk the Gate list above; the report lists every element as ok / exempt with reason / gap.
|
|
209
|
+
- Every persona `Cannot` line resolves to a gate plus a denied spec, or is recorded as a gap.
|
|
210
|
+
- Worked reference: `references/worked-example.md` (design mode, compiles clean).
|
|
211
|
+
|
|
212
|
+
## Route near misses
|
|
213
|
+
|
|
214
|
+
- Grammar: `cratis-screenplay-command-surface`, `cratis-screenplay-read-surface`,
|
|
215
|
+
`cratis-screenplay-projections`.
|
|
216
|
+
- Streams, retries, cross-stream invariants: `cratis-screenplay-streams-and-consistency`.
|
|
217
|
+
- Automations and captures: `cratis-screenplay-automations-and-translations`.
|
|
218
|
+
- Scenario coverage and specification forms: `cratis-screenplay-scenario-coverage`,
|
|
219
|
+
`cratis-screenplay-specifications`.
|
|
220
|
+
- Audit of a finished model: `cratis-screenplay-model-review`.
|
|
221
|
+
- Layout, forms, templates: `cratis-screenplay-ui-composition`.
|
|
222
|
+
|
|
223
|
+
## References (load on demand)
|
|
224
|
+
|
|
225
|
+
- `references/command-inventory.md` - command card, interview questions, refusal inventory.
|
|
226
|
+
- `references/review-questions.md` - design review questions.
|
|
227
|
+
- `references/rule-layers.md` - rule placement, executable authorization, PII.
|
|
228
|
+
- `references/field-lineage.md` - origins per element, matrix, reason lines, chain edits.
|
|
229
|
+
- `references/read-model-design.md` - components, fan-in, list vs keyed, singletons, scope.
|
|
230
|
+
- `references/slicing.md` - slice naming, dependencies, state table, generic edits, coverage,
|
|
231
|
+
next slice.
|
|
232
|
+
- `references/worked-example.md` - parcel lockers, design mode, complete and compiling.
|
|
233
|
+
|
|
234
|
+
## Lineage
|
|
235
|
+
|
|
236
|
+
Method lineage and attribution: `references/provenance.md`.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Command design and the per-command refusal inventory
|
|
2
|
+
|
|
3
|
+
For every command, record what it needs, where each input comes from, how it can succeed and
|
|
4
|
+
every way it can be refused. The inventory is the design output that
|
|
5
|
+
`cratis-screenplay-scenario-coverage` consumes: each refusal becomes a specification there,
|
|
6
|
+
and each persona that must be denied becomes a `given caller` fixture. Build it from the
|
|
7
|
+
`.play` files, not from memory.
|
|
8
|
+
|
|
9
|
+
## Command card
|
|
10
|
+
|
|
11
|
+
Fill one card per command before (or while) writing the slice. Keep it in the phase report;
|
|
12
|
+
durable rationale goes in the slice `description`.
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
Command: <ImperativeBusinessName> (one decision)
|
|
16
|
+
Origins: <screen action / form / reaction invokes / capture>, persona, gate chain
|
|
17
|
+
Inputs: <property: Concept - who supplies it - why the caller decides it>
|
|
18
|
+
Identifier: <property naming the instance, or "allocation" with the reason>
|
|
19
|
+
Rules by layer: <concept validate | command validate/require | authorize | claim policy
|
|
20
|
+
| constraint | stored-state (NOT enforced, target named)>
|
|
21
|
+
Success: <event(s) with for <identifier>, payload mapping>
|
|
22
|
+
Refusals: <see the inventory table>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Questions that fill it (ask them of the domain expert, or assume visibly when unattended):
|
|
26
|
+
|
|
27
|
+
1. Who or what makes this happen: a person on a screen, a reaction, an outside system? Is it
|
|
28
|
+
always the same persona? (Several origins are fine; each must be reachable and authorized.)
|
|
29
|
+
2. What does the caller decide or supply, and what do they merely see? Anything they only see
|
|
30
|
+
is a read-model value, not an input; anything that is who they are comes from context.
|
|
31
|
+
3. Does one input only matter for certain values of another? That is a granularity question:
|
|
32
|
+
two decisions are two commands; one decision with a dependent rule is an implication
|
|
33
|
+
(`require a == false or b > c`). Never leave a conditional input implicit.
|
|
34
|
+
4. What must be true for this to be allowed, and where does each condition live? Walk the
|
|
35
|
+
layers in `rule-layers.md` from the lowest up.
|
|
36
|
+
5. What can go wrong that the business names? Each distinct failure is a row below, with its
|
|
37
|
+
message in the user's words.
|
|
38
|
+
6. What new fact becomes true on success, and who reacts to it? If nobody can say, the event
|
|
39
|
+
may be a form in disguise (`slicing.md` *Generic edits*).
|
|
40
|
+
|
|
41
|
+
## The inventory
|
|
42
|
+
|
|
43
|
+
One row per outcome. The layer says where the refusal is enforced; the spec column says
|
|
44
|
+
which specification pins it (or `gap`, handed to `cratis-screenplay-scenario-coverage`).
|
|
45
|
+
|
|
46
|
+
| Command | Outcome | Layer | Message / denied persona | Spec |
|
|
47
|
+
|---|---|---|---|---|
|
|
48
|
+
| a command | success event, or a refusal | `authorize`, concept `validate`, command `validate`/`require`, `constraint`, stored-state (NOT enforced), claim policy | exact message, or the caller fixture that must be denied | name, or `gap` |
|
|
49
|
+
|
|
50
|
+
Rules for filling it:
|
|
51
|
+
|
|
52
|
+
- Every command has a success row and at least one refusal row, or a stated reason for none.
|
|
53
|
+
- Every gated command and query has its own `then denied` row, even when the gate is
|
|
54
|
+
inherited from the module or feature (an ownership gate needs a second caller with a
|
|
55
|
+
different claim value).
|
|
56
|
+
- Every persona `Cannot` line resolves to a row with a gate and a denied spec, or is recorded
|
|
57
|
+
as a gap. Persona description text is intent only.
|
|
58
|
+
- A refusal that depends on stored state is a row marked **NOT enforced in the model today**
|
|
59
|
+
with its target (Arc `[ProtectedDecision]` + `DecisionRead<T>` where Arc 22.39.0 or later is
|
|
60
|
+
available, which Stage-rendered apps are not; Chronicle DCB, or a
|
|
61
|
+
constraint). It still gets a spec row, because the intended behaviour is the contract.
|
|
62
|
+
- A decided refusal never goes to open questions: it goes here, then to scenarios.
|
|
63
|
+
- A refusal message is a fact of the design; keep the wording identical in the rule, the
|
|
64
|
+
inventory and the spec.
|
|
65
|
+
|
|
66
|
+
## Filled for `worked-example.md`
|
|
67
|
+
|
|
68
|
+
| Command | Outcome | Layer | Message / denied persona | Spec |
|
|
69
|
+
|---|---|---|---|---|
|
|
70
|
+
| InstallLocker | LockerInstalled for the locker id | | | InstallingALocker |
|
|
71
|
+
| InstallLocker | caller is not an attendant | `authorize IsAttendant` | denied: Customer (authenticated, role "Customer") | RefusingACustomerInstallingALocker |
|
|
72
|
+
| InstallLocker | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | gap (inherited gate; the Customer row proves the command is gated) |
|
|
73
|
+
| InstallLocker | locker number empty | concept `LockerNumber` | "A locker needs a number" | gap |
|
|
74
|
+
| InstallLocker | volume below one litre | concept `Litres` | "A locker must hold at least one litre" | gap (one spec per concept, through one command) |
|
|
75
|
+
| InstallLocker | number already used by another locker | constraint `UniqueLockerNumber` | "That locker number is already installed" | gap |
|
|
76
|
+
| InstallLocker | the same locker installed twice | constraint `LockerInstalledOnce` | "The locker is already installed" | gap |
|
|
77
|
+
| RequestLocker | LockerRequested for the request id | | | RequestingALocker |
|
|
78
|
+
| RequestLocker | preferred volume below one litre | concept `Litres` | "A locker must hold at least one litre" | covered by the shared concept rejection spec through InstallLocker (one spec per concept) |
|
|
79
|
+
| RequestLocker | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | RefusingAnAnonymousRequest |
|
|
80
|
+
| AssignLocker | LockerAssigned for the locker id | | | AssigningALocker |
|
|
81
|
+
| AssignLocker | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | gap (inherited gate; the Customer row proves the command is gated) |
|
|
82
|
+
| AssignLocker | caller is not an attendant | `authorize IsAttendant` | denied: Customer | RefusingACustomerAssigningALocker |
|
|
83
|
+
| AssignLocker | locker already has a request | constraint `OneRequestPerLocker` | "The locker is already assigned" | AppendingASecondAssignmentOfALocker (`when append`: the command's own `require` would reject first) |
|
|
84
|
+
| AssignLocker | request already has a locker | constraint `OneLockerPerRequest` | "The request already has a locker" | gap |
|
|
85
|
+
| AssignLocker | locker is not free | `reads` + `require`, NOT enforced today | "The locker is not free"; target: `[ProtectedDecision]` (Arc 22.39.0+; unavailable in Stage-rendered apps, so a capability gap there) or DCB on the locker stream | RejectingASecondAssignmentOfALocker (pins the message; blocked until the target exists) |
|
|
86
|
+
| AssignLocker | request is not waiting | `reads` + `require`, NOT enforced today | "The request is not waiting for a locker" | gap (same) |
|
|
87
|
+
| LockerById, ListLockers | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | RefusingAnAnonymousLockerLookup, RefusingAnAnonymousLockerList |
|
|
88
|
+
| RequestById | caller is anonymous | module `authorize IsAuthenticated` | denied: no caller | RefusingAnAnonymousRequestLookup |
|
|
89
|
+
|
|
90
|
+
The gaps are the hand-off: most are cheap rejection specs, and two are blocked on a target the
|
|
91
|
+
model cannot express yet. A model whose inventory shows no gaps at design time has probably
|
|
92
|
+
not been asked the refusal questions.
|
|
93
|
+
|
|
94
|
+
## Common mistakes
|
|
95
|
+
|
|
96
|
+
- Naming the command for the form (`UpdateLocker`) instead of the decision.
|
|
97
|
+
- A boolean input that attests a rule (`confirmsLockerIsFree == true`) instead of a modeled
|
|
98
|
+
value or a recorded stored-state rule.
|
|
99
|
+
- Copying state into the command so `require` can read it, instead of `reads <View>`.
|
|
100
|
+
- An origin that is neither reachable (no screen, form or reaction leads there) nor authorized
|
|
101
|
+
for the persona who should act.
|
|
102
|
+
- A reaction invoking a gated command: the invocation has no caller and is refused; design the
|
|
103
|
+
trusted path (`cratis-screenplay-automations-and-translations`), never delete the gate.
|
|
104
|
+
- Refusals recorded as prose in the `description` with no layer and no spec row.
|
|
105
|
+
- Personal data or secrets as command input: values are by default recorded in the causation chain, so treat them as permanent
|
|
106
|
+
(retention can be configured in newer Chronicle; verify it, never audit secrets).
|
|
107
|
+
Mark the concept `@pii` or record the need; never put `@pii` on the identifier's concept.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Field lineage
|
|
2
|
+
|
|
3
|
+
Every value in the model has a place it comes from and a place it goes. If you cannot say
|
|
4
|
+
where a field comes from, the model is missing an input, an event field or a decision. If an
|
|
5
|
+
event field goes nowhere, ask why it is recorded (audit and history are valid answers; say so).
|
|
6
|
+
|
|
7
|
+
## Where values come from, per element
|
|
8
|
+
|
|
9
|
+
**Command property**
|
|
10
|
+
|
|
11
|
+
| Origin | In Screenplay | Notes |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| the user types or picks it | screen `action`, form or dialog input | default for business decisions |
|
|
14
|
+
| shown before the user acts | form `populate via query` from a read model | the read model must exist and be traced |
|
|
15
|
+
| the instance being acted on | the `identifier` property, carried from the screen row or route | |
|
|
16
|
+
| allocated by the runtime | design mode: `Type generated` on a required `Uuid`-backed concept (syntax-only, PLAY0268 at binding; remove before executable/renderable scope) | never a request input or form field; executable scope needs explicit allocation |
|
|
17
|
+
| an outside party | capture field `$.x` or a reaction trigger value | `cratis-screenplay-automations-and-translations` |
|
|
18
|
+
| 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" |
|
|
19
|
+
|
|
20
|
+
**Event property** - set only in `produces` mappings, from:
|
|
21
|
+
command properties; literals; `$context.occurred`; caller identity (`$context.identity.id|name|userName`).
|
|
22
|
+
Those are the portable sources. The event-source id is the `for` value, not a property.
|
|
23
|
+
|
|
24
|
+
**Read-model property** - set by the projection (PDL) or a reducer, from:
|
|
25
|
+
an event field (same-named fields map automatically - AutoMap is on; its matching differs between flat and scoped projections, see `read-model-design.md` "Building it");
|
|
26
|
+
`$eventSourceId` (the instance identity); a literal (status words); a counter or arithmetic;
|
|
27
|
+
a join on another event stream; children for collections. A reducer is opaque: write its
|
|
28
|
+
lineage in the slice `description`. A read model built by a query `performer` (no events)
|
|
29
|
+
has lineage outside the model; say where.
|
|
30
|
+
|
|
31
|
+
**Screen field** - from the query result named in `data ... via query`. A screen showing a
|
|
32
|
+
value that is in no read model is a gap. A value computed for display only (a formatted
|
|
33
|
+
duration, a sum of rows) is recorded as `derived: <expression>` with its origin fields traced.
|
|
34
|
+
|
|
35
|
+
**Conditional inputs.** If one input matters only for some values of another, record the
|
|
36
|
+
condition in the matrix, then decide: two commands (two decisions) or one command with an
|
|
37
|
+
implication rule. Never leave it implicit.
|
|
38
|
+
|
|
39
|
+
## The matrix
|
|
40
|
+
|
|
41
|
+
One row per field, per slice touched, built from the `.play` files, not from memory or an
|
|
42
|
+
earlier summary. Report every element, not only problems. Status: `ok`, `gap` (no origin), `unused` (no
|
|
43
|
+
destination), `decision` (accepted with a reason).
|
|
44
|
+
|
|
45
|
+
| Element | Field | Origin | Destination | Status |
|
|
46
|
+
|---|---|---|---|---|
|
|
47
|
+
| command | | | event field / rule / identity | |
|
|
48
|
+
| event | | command prop / literal / context | read-model field / reaction / audit | |
|
|
49
|
+
| read model | | event.field / $eventSourceId / literal / derived | screen / automation / query key | |
|
|
50
|
+
| screen | | query result field | user | |
|
|
51
|
+
|
|
52
|
+
Filled for `worked-example.md`:
|
|
53
|
+
|
|
54
|
+
| Element | Field | Origin | Destination | Status |
|
|
55
|
+
|---|---|---|---|---|
|
|
56
|
+
| InstallLocker | lockerId | new id for the locker (LockerBoard action) | `for`, LockerSummary.lockerId via `$eventSourceId` | ok |
|
|
57
|
+
| InstallLocker | number, volume | user input | LockerInstalled | ok |
|
|
58
|
+
| LockerInstalled | number, volume | InstallLocker | LockerSummary; UniqueLockerNumber (number) | ok |
|
|
59
|
+
| RequestLocker | requestId | new id for the customer's request (MyRequest action) | `for`; RequestStatus.requestId | ok |
|
|
60
|
+
| RequestLocker | preferredVolume | user input | LockerRequested | ok |
|
|
61
|
+
| LockerRequested | requestedAt | `$context.occurred` | none yet | decision: kept for queue order (a future waiting-request view) |
|
|
62
|
+
| AssignLocker | lockerId | LockerBoard row | `for`; RequestStatus.lockerId via `$eventSourceId` | ok |
|
|
63
|
+
| AssignLocker | requestId | attendant picks a request | LockerAssigned.requestId | gap: no waiting-request view to pick from yet (next slice) |
|
|
64
|
+
| LockerSummary | assigned | literal on LockerInstalled / LockerAssigned | LockerBoard | ok |
|
|
65
|
+
| RequestStatus | state, lockerId | literal / `$eventSourceId` of LockerAssigned (key requestId) | MyRequest | ok |
|
|
66
|
+
|
|
67
|
+
## The reason line per contributing event
|
|
68
|
+
|
|
69
|
+
The matrix is the audit; the durable record is the StateView slice `description`: one line per
|
|
70
|
+
contributing event saying which fields it sets and why. Write it as a tagged text block in a
|
|
71
|
+
real model (a bare fence warns with `PLAY0397`). `worked-example.md` uses one-string
|
|
72
|
+
descriptions only so that it stays a single compiling fence.
|
|
73
|
+
|
|
74
|
+
````text
|
|
75
|
+
slice StateView LockerBoard
|
|
76
|
+
description
|
|
77
|
+
```text
|
|
78
|
+
The attendant's overview: every locker and whether it is taken.
|
|
79
|
+
LockerInstalled sets number, volume and assigned=false: the locker enters the board.
|
|
80
|
+
LockerAssigned sets assigned=true: the board shows which lockers are taken.
|
|
81
|
+
```
|
|
82
|
+
````
|
|
83
|
+
|
|
84
|
+
An event with no reason line does not belong in the view; a line you cannot write is a
|
|
85
|
+
modeling question. Extend the block whenever a `from` is added.
|
|
86
|
+
|
|
87
|
+
## Gap handling
|
|
88
|
+
|
|
89
|
+
- No origin for a command input: who knows this value at the moment of the action? Add the
|
|
90
|
+
read model that shows it, or make it an input, or ask.
|
|
91
|
+
- No origin for a read-model field: add the field to the event that should carry it (only if
|
|
92
|
+
that fact really includes it), derive it in the view, or record an open question.
|
|
93
|
+
- An event field nobody reads: keep it if the business needs the history; otherwise drop it
|
|
94
|
+
before it is persisted (dropping later is an event-evolution change).
|
|
95
|
+
|
|
96
|
+
## Adding or renaming a field along a chain (manual checklist)
|
|
97
|
+
|
|
98
|
+
Until there is a propagation tool (Screenplay#389), walk the chain from consumer back to source and list each
|
|
99
|
+
hop before editing:
|
|
100
|
+
|
|
101
|
+
1. Screen column/field and any `populate via query` mapping.
|
|
102
|
+
2. Read-model property and its projection mapping (or reducer).
|
|
103
|
+
3. Event property and the `produces` mapping (and `id "OldName"` thinking if the event is
|
|
104
|
+
persisted: renaming an event property is a contract change).
|
|
105
|
+
4. Command property, its `validate` rules, and every screen/form/reaction/capture that supplies it.
|
|
106
|
+
5. Concept, if the value deserves one.
|
|
107
|
+
6. Specifications that set or expect the field.
|
|
108
|
+
|
|
109
|
+
7. After renaming one side of a projection mapping, check the other: AutoMap matches by name (rules in `read-model-design.md` "Building it")
|
|
110
|
+
An explicit mapping to a renamed-away target fails binding (V3, PLAY0273); a property AutoMap
|
|
111
|
+
used to fill and no longer matches is **not reported** - the field silently stays empty.
|
|
112
|
+
|
|
113
|
+
Report the walk hop by hop: element, field, `updated` or `skipped` with the reason (already
|
|
114
|
+
present; not on this element). Run V1 after the chain edit; if a hop cannot be applied, stop
|
|
115
|
+
and report that hop. Rename only through the identity-aware path when any hop is persisted
|
|
116
|
+
(SKILL.md).
|
|
117
|
+
|
|
118
|
+
Example hop report (renaming the board column and read-model property `volume` to
|
|
119
|
+
`capacityLitres`; the persisted event property stays `volume`, so the projection mapping
|
|
120
|
+
becomes `capacityLitres = volume`. Renaming the event property itself would stop at hop 3 and
|
|
121
|
+
go to the identity owner):
|
|
122
|
+
|
|
123
|
+
| Hop | Element | Field | Result |
|
|
124
|
+
|---|---|---|---|
|
|
125
|
+
| 1 | screen LockerBoard | column volume | updated |
|
|
126
|
+
| 2 | projection LockerBoard | `volume = volume` target and read-model property | updated |
|
|
127
|
+
| 3 | event LockerInstalled | `volume` | skipped: persisted contract, owner decides |
|
|
128
|
+
| 4 | command InstallLocker | `volume` | skipped: not part of this change |
|
|
129
|
+
| 5 | concept Litres | none | skipped: unchanged |
|
|
130
|
+
| 6 | specifications | read-model and query expectations only; LockerInstalled event expectations stay `volume` | updated |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
Sources are pinned. TrogonStack/agentskills is MIT, Copyright (c) 2025 Straw Hat, LLC (full
|
|
4
|
+
notice in this skill's `LICENSE`). Nebulit-GmbH/agentic-engineer has no licence: its material
|
|
5
|
+
is recorded as ideas written independently, with no text reused beyond a short phrase.
|
|
6
|
+
Event Modeling practice (Adam Dymitruk, Martin Dilger) is cited as practice; no text taken.
|
|
7
|
+
|
|
8
|
+
| Item | Source | Licence | Treatment | Where in this skill |
|
|
9
|
+
|---|---|---|---|---|
|
|
10
|
+
| Interview phase layout (skip condition, critical questions with impact and follow-up, interview flow) | TrogonStack/agentskills@7b249d3:plugins/trogonstack-eventmodeling/skills/eventmodeling-{storyboarding-events,identifying-inputs,identifying-outputs,designing-event-models}/SKILL.md | MIT | ADAPT closely; questions rewritten for Screenplay | SKILL.md *Interview phase* |
|
|
11
|
+
| Per-command specifics: source, inputs, validation, preconditions, success, each failure result | TrogonStack/agentskills@7b249d3:.../eventmodeling-identifying-inputs/SKILL.md (workflow 3) | MIT | ADAPT closely; failures become inventory rows with layer and spec | references/command-inventory.md |
|
|
12
|
+
| Conditional input pattern | same, *Conditional Input Pattern* | MIT | ADAPT: granularity question, implication rule | SKILL.md step 3; command-inventory.md |
|
|
13
|
+
| Common mistakes and quality checklists (screens, inputs, outputs, slices, design) | TrogonStack/agentskills@7b249d3:.../eventmodeling-{storyboarding-events,identifying-inputs,identifying-outputs,slicing-event-models,designing-event-models}/SKILL.md | MIT | ADAPT closely; merged into one Gate | SKILL.md *Gate*; command-inventory.md |
|
|
14
|
+
| Event versus read model test and recalculated-state anti-pattern | TrogonStack/agentskills@7b249d3:.../eventmodeling-identifying-outputs/SKILL.md | MIT | ADAPT; decided calculations stay facts | SKILL.md steps 4-5 |
|
|
15
|
+
| Slice dependency record (events consumed, producing slice) | TrogonStack/agentskills@7b249d3:.../eventmodeling-slicing-event-models/SKILL.md | MIT | ADAPT as a table | references/slicing.md |
|
|
16
|
+
| Slice shape read model, screen, command, event; a screen acting on an instance needs a view; no screen per persona for symmetry; no empty placeholder screen | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/eventmodeling-storyboarding-events, eventmodeling-identifying-outputs, written independently | none | IDEA | SKILL.md step 7 |
|
|
17
|
+
| Reason line per contributing event; build lineage from files, not memory; per-element results | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/eventmodeling-identifying-outputs, written independently | none | IDEA | SKILL.md step 8; references/field-lineage.md |
|
|
18
|
+
| Next-slice heuristic: explicit request wins, act on a wrong guess, say why | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/add-next-slice, written independently | none | IDEA | references/slicing.md *The next slice* |
|
|
19
|
+
| Per-hop chain report (updated, skipped with reason) | idea from Nebulit-GmbH/agentic-engineer@07b0f30:.claude/skills/attributes, written independently | none | IDEA | references/field-lineage.md |
|
|
20
|
+
| Generic-edit ban, rule coverage, state-transition table, rule layers, refusal inventory, worked example | Cratis/AI corpus (original) | MIT | original | references/*.md |
|