@cratis/pi 8.7.0 → 8.8.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/skills/cratis-arc-migrate-relational-schema/SKILL.md +2 -0
- package/package/corpus/skills/cratis-arc-migrate-relational-schema/references/provenance.md +11 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +2 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/provenance.md +15 -0
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +2 -0
- package/package/corpus/skills/cratis-event-model-diagram/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-modeling-design-event-model/LICENSE +18 -0
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +9 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/modeling-discipline.md +71 -0
- package/package/corpus/skills/cratis-modeling-design-event-model/references/provenance.md +39 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/LICENSE +14 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +8 -2
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/discovery-questions.md +28 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/provenance.md +22 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/story-retelling.md +66 -0
- package/package/corpus/skills/cratis-modeling-review-event-model/LICENSE +17 -0
- package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +11 -0
- package/package/corpus/skills/cratis-modeling-review-event-model/references/business-review.md +58 -0
- package/package/corpus/skills/cratis-modeling-review-event-model/references/event-log-hygiene.md +1 -1
- package/package/corpus/skills/cratis-modeling-review-event-model/references/provenance.md +15 -0
- package/package/corpus/skills/cratis-modeling-review-event-model/references/resilience-review.md +27 -2
- package/package/corpus/skills/cratis-modeling-review-event-model/references/structural-shapes.md +33 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/LICENSE +11 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +19 -15
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/provenance.md +18 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/reading-lenses.md +76 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/resuming-a-trace.md +12 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +2 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +2 -0
- package/package/corpus/skills/cratis-screenplay-handoff-slice/references/provenance.md +18 -0
- package/package/corpus/skills/cratis-screenplay-model-automation/LICENSE +14 -0
- package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +8 -4
- package/package/corpus/skills/cratis-screenplay-model-automation/references/provenance.md +25 -0
- package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-automation/references/statemachines-and-workflows.md +3 -1
- package/package/corpus/skills/cratis-screenplay-model-automation/references/to-do-lists.md +186 -0
- package/package/corpus/skills/cratis-screenplay-model-interaction/LICENSE +14 -0
- package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +16 -12
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/provenance.md +42 -0
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/screen-design.md +212 -0
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +3 -1
- package/package/corpus/skills/cratis-screenplay-model-translation/references/provenance.md +14 -0
- package/package/corpus/skills/cratis-screenplay-model-translation/references/webhook-contract.md +22 -0
- package/package/corpus/skills/cratis-screenplay-recover-intent/LICENSE +11 -0
- package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +3 -0
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/running-system.md +5 -2
- package/package/corpus/skills/cratis-screenplay-specify-outcome/LICENSE +13 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +10 -5
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/case-questions.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/coverage-worksheet.md +23 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/provenance.md +15 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenario-discipline.md +126 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenario-narrative.md +61 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +18 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +2 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/provenance.md +15 -0
- package/package.json +1 -1
package/package/corpus/skills/cratis-modeling-review-event-model/references/resilience-review.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Review business resilience without editing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A resilience review asks what is left of the model when its surroundings change, and which parts turn out to depend on the same thing. It predicts nothing and is not a risk list: the value comes from stressors that arrive from many directions. It is read-only; a proposal is not an edit. Names are illustrative: a training provider registers attendees, enrolls them on courses and sends a welcome email.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Method
|
|
6
|
+
|
|
7
|
+
1. **Pin the accepted model revision.** Done when the revision is written at the top of the report.
|
|
8
|
+
2. **List stressors with the owner.** A stressor is anything that can happen to the business or its environment: technical, legal, market, people, nature. Take at least five from outside the model, far-fetched ones included: a provider outage, a new law, the company is acquired, a key person leaves, the main customer fails. Add stressors from the business itself: a changed policy, a missing actor, a changed tenant entitlement or package. Word each as a business person would say it, with no field names or technical mechanics. Done when the list has at least five external stressors and no two share an obvious cause.
|
|
9
|
+
3. **Describe the residue of each stressor.** The residue is what is left after the stressor hits: which slices still work, which recorded facts survive, which views stop or go stale, who is not told. One plain sentence each, naming slices and views, not fields. A residue is observed, not designed: the fix is not the residue. "Enrollments still come in, but nobody is welcomed until the mail provider returns" is a residue; "queue the welcome" is a fix.
|
|
10
|
+
4. **Let the owner mark each residue** accept, investigate or propose a change. Whether a residue is acceptable is a business decision. Done when every residue has a disposition.
|
|
11
|
+
5. **Build the incidence matrix** for the residues not accepted: stressors as rows; affected slices, views and notified parties as columns; a mark at each intersection where the stressor hits. For each mark record what still works, what stops or goes stale and who misses notice. Take every hit from the pinned model, never from a guess.
|
|
12
|
+
6. **Name the clusters.** Columns hit by the same stressors are coupled in a way the model does not show. Name the shared cause of each cluster: one outside system, one role, one clock. Columns with the most hits are the hotspots. Similar symptoms do not establish a common cause: if both a directory outage and lost permission stop the lookup, check that both actually reach it. A cluster that crosses module boundaries is evidence for `cratis-screenplay-streams-and-consistency`.
|
|
13
|
+
7. **Propose a redesign for one cluster at a time,** the one the owner selects. Propose new slices beside the accepted ones; recorded facts and accepted slices stay as they are. State the new predicted residue for every stressor that hit the cluster, and check that the proposal does not depend on the cluster's shared cause: does the fallback still need the lookup that failed? Compare only the affected intersections against the baseline, and mark predicted recoveries and remaining losses as predictions.
|
|
14
|
+
8. **Check with fresh stressors.** Add stressors not used before and report how many residues are acceptable before and after the proposal. Stop when new stressors stop hitting columns that were not hit before, or when every residue is acceptable to the owner.
|
|
15
|
+
|
|
16
|
+
## Typical proposals
|
|
17
|
+
|
|
18
|
+
Each is a recommendation that names the owning skill; none is made here.
|
|
19
|
+
|
|
20
|
+
| Cluster cause | Proposal | Owning skill |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| An outside system is read live | Record what the outside system reports as the application's own facts, so slices work from the last known facts | `cratis-screenplay-model-translation` |
|
|
23
|
+
| Work cannot finish while something is down | A to-do list view of the open work, and a reaction that completes each item when it can | `cratis-screenplay-model-automation` |
|
|
24
|
+
| A reply or deadline may never come | A scheduled reaction that records the lapse as a fact, so the open item closes with a stated outcome | `cratis-screenplay-model-automation` |
|
|
25
|
+
| One role is the only way in | A second role or entry path for the same command | `cratis-modeling-design-event-model` |
|
|
26
|
+
| A part must be switched off for some tenants or during an incident | An availability gate on that part | `cratis-screenplay-availability` |
|
|
27
|
+
|
|
28
|
+
## Return
|
|
29
|
+
|
|
30
|
+
Return the stressor list with residues and dispositions, the matrix with its clusters and hotspots, and the proposals with their predicted residues, all against the pinned revision.
|
package/package/corpus/skills/cratis-modeling-review-event-model/references/structural-shapes.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Structural shapes
|
|
2
|
+
|
|
3
|
+
A shape is a count that crosses a rough threshold in how screens, commands, facts, views and specifications connect. Check the shapes once, after the model questions, when the whole examined part is visible: they compare elements with their neighbors, so one slice alone cannot show them. Names are illustrative: a training provider registers attendees and enrolls them on courses.
|
|
4
|
+
|
|
5
|
+
Only the first shape is a finding on the count alone. The others are leads: read the facts, properties and cases involved, and drop the lead silently when the domain explains the count. The shape names are reviewer shorthand. Never put them in a report; describe the concern in plain terms and ask the question given.
|
|
6
|
+
|
|
7
|
+
| Shape (shorthand) | Count | Standing | Question for the owner |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| Bed | One submission issues more than one command | Always a finding | "Sending this form does more than one thing. Is that one decision that succeeds or fails as a whole, or separate actions the person chooses between?" |
|
|
10
|
+
| Left chair | One command records more than two distinct facts | Lead | "When this succeeds, do all of these always happen together, or could some happen without the others?" |
|
|
11
|
+
| Right chair | One view is built from more than three distinct facts | Lead | "Does this answer one question for the person, or several bundled together?" |
|
|
12
|
+
| Shelf | One slice has far more specifications than its neighbors on the same timeline | Lead | "This step has many more cases than the ones around it. Is it really doing more, or covering something that should be its own step?" |
|
|
13
|
+
| Shared fact | Two entities each treat one fact as part of their own history | Finding when either entity decides on it | "Which of the two does this belong to, and what must the other one know about it?" |
|
|
14
|
+
|
|
15
|
+
## Bed: one submission, several commands
|
|
16
|
+
|
|
17
|
+
Count commands per submission, not per screen. A screen that offers several separate actions, or alternatives of which the person selects one, is sound: each action is one decision. A single submit that issues two commands hides a choice, or splits one decision across two commits, so the second can be refused after the first is recorded. Report it every time, as the model finding "One promise, independent requests". The correction is one command for one decision, or the partial outcomes stated as intended (`cratis-modeling-design-event-model`).
|
|
18
|
+
|
|
19
|
+
## Left chair: one command, many facts
|
|
20
|
+
|
|
21
|
+
More than two distinct facts from one command can be one outcome told in several facts, or two decisions sharing a button. Ask whether any of the facts could happen without the others. If one can, the command combines decisions and its refusals and rights combine with it. If they always occur together, the count is justified; say so and move on. In a Screenplay model, `find-modeling-smells` with `eventFanOutThreshold` set to 2 lists every such command as `SMELL004`.
|
|
22
|
+
|
|
23
|
+
## Right chair: one view, many facts
|
|
24
|
+
|
|
25
|
+
More than three distinct facts feeding one view can be one coherent picture or several questions on one screen. Ask whether every property shown belongs to the one thing the person is checking. If the view serves two readers or two decisions, a change made for one rebuilds the view for both. Count the distinct facts per view by hand: `SMELL005` counts facts per view property, not per view, so a view of many narrow properties passes it.
|
|
26
|
+
|
|
27
|
+
## Shelf: one slice, many more specifications
|
|
28
|
+
|
|
29
|
+
Compare a slice's specification count with the typical count on the same timeline; there is no fixed number. Read what the extra cases cover before asking. Cases that need a different actor or intent point at a second slice, which is the model finding "Whose decision do these cases test?". Cases that exercise one rule with more boundary values are a slice that is simply harder.
|
|
30
|
+
|
|
31
|
+
## Shared fact: one fact, two histories
|
|
32
|
+
|
|
33
|
+
A fact is appended to one history. Carrying another entity's identifier, or feeding several views, does not make it shared. The coupling is real when two entities each need the fact as part of their own history: both lifecycles read it, or a rule in each decides on it. Then one team's change to the fact changes the other entity's behavior, and a decision that reads only its own history misses a fact appended elsewhere. Report it as coupling, with the two decisions that read it. A fact that seems to belong to two entities is usually a naming or boundary mistake: ask which entity the fact is about, and whether the other needs a fact of its own or only a view. When a decision already relies on it, also report the model finding "Reference mistaken for a destination".
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
`references/reading-lenses.md` and the later-pass finding rules in `references/resuming-a-trace.md`
|
|
7
|
+
adapt material from the Eventmodelers Build-Kits skills by Martin Dilger and Nebulit GmbH
|
|
8
|
+
(https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits; https://nebulit.de), used with the
|
|
9
|
+
explicit consent of Martin Dilger and Nebulit GmbH. The adapted material remains credited to
|
|
10
|
+
Martin Dilger and Nebulit GmbH. The upstream skills and the ideas taken from each are listed in
|
|
11
|
+
`references/provenance.md`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-modeling-trace-existing-behavior
|
|
3
3
|
description: Use when an existing application's code, shipped artifacts, captured runtime signals or stored events must yield a candidate event model, or when its code or a running Chronicle namespace must be compared with an accepted model. Not for recovering intent from a recording or a bounded walk of a running system (use cratis-screenplay-recover-intent), settling a disputed business rule (use cratis-modeling-discover-timeline) or designing a change (use cratis-modeling-design-event-model).
|
|
4
|
+
license: LICENSE
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Trace existing behavior
|
|
@@ -16,9 +17,9 @@ description: Use when an existing application's code, shipped artifacts, capture
|
|
|
16
17
|
|
|
17
18
|
## What tracing produces
|
|
18
19
|
|
|
19
|
-
Tracing reads what an existing system
|
|
20
|
+
Tracing reads what an existing system does and reports it as labelled evidence: candidate slices and business facts, or a comparison with an accepted model. It never decides what the system should do. A recovered draft, a clean conformance check or a matching screenshot is evidence for the model owner, not acceptance.
|
|
20
21
|
|
|
21
|
-
Keep intake read-only: do not change legacy code, data or an authored model
|
|
22
|
+
Keep intake read-only: do not change legacy code, data or an authored model. Use synthetic values. No running target is required; do not inspect production by default.
|
|
22
23
|
|
|
23
24
|
Label every finding:
|
|
24
25
|
|
|
@@ -29,21 +30,22 @@ Label every finding:
|
|
|
29
30
|
| **proposed fact** | Candidate business meaning, kept separate from what the code stores. |
|
|
30
31
|
| **unknown** | Not settled; name the check or owner that would settle it. |
|
|
31
32
|
|
|
32
|
-
A screenshot of a row cannot identify its writer. Static inspection does not show that a request ran. A missing test is not a missing behavior.
|
|
33
|
+
A screenshot of a row cannot identify its writer. Static inspection does not show that a request ran. A missing test is not a missing behavior. Names here (a support agent, `OpenTicket`, `TicketOpened`, an Open tickets list) are illustrative.
|
|
33
34
|
|
|
34
35
|
## Choose the mode
|
|
35
36
|
|
|
36
|
-
- **Default: reconstruct current behavior.** No accepted baseline exists. Trace journeys as implemented and propose candidate slices separately from the implementation. Do not claim
|
|
37
|
+
- **Default: reconstruct current behavior.** No accepted baseline exists. Trace journeys as implemented and propose candidate slices separately from the implementation. Do not claim anything changed since an earlier revision.
|
|
37
38
|
- **Baseline comparison** when an accepted model or accepted examples exist. Identify the model revision and its acceptance status, the code revision inspected and any included uncommitted changes. Compare the same actor, inputs, address and outcome on each side. If the change range is known, use it to focus, then follow callers and consumers beyond the diff. A difference does not decide which side should change. For ambiguous signals, enforcement points and the comparison table, read [compare evidence](references/compare-evidence.md).
|
|
38
|
-
- **Black-box reconstruction** when only shipped artifacts or captured interface evidence
|
|
39
|
+
- **Black-box reconstruction** when only shipped artifacts or captured interface evidence exist: read [black-box intake](references/blackbox-intake.md).
|
|
39
40
|
- **Tool-assisted recovery** when static reading leaves a gap and the owner proposes a source generator or a runtime capture: read [recovery inputs](references/recovery-inputs.md) before running either.
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
41
|
+
- **Whole application, or no named journey**: start with [reading lenses](references/reading-lenses.md).
|
|
42
|
+
- **A later pass**, and which differences then count: read [resuming a trace](references/resuming-a-trace.md).
|
|
43
|
+
- **Incremental replacement**, one slice at a time: read [side-car migration](references/side-car-migration.md).
|
|
42
44
|
|
|
43
45
|
## How the recovery tools behave
|
|
44
46
|
|
|
45
|
-
- **Source generation** loads a .NET solution or project through MSBuild with the installed .NET SDK. Packages must already be restored. MSBuild evaluates the project and may write intermediate build files, so run it only on a trusted checkout. It does not start the application or connect to its database or Chronicle. One bundled provider interprets the whole application: Arc, Marten, or Marten with Wolverine (Critter Stack). Auto detection picks the most specific match and reports unrelated matches instead of guessing. It reads only the selection; spec and test projects (`.Specs`, `.Specifications`, `.Tests`, `.Test`, `.IntegrationTests`, `.Specs.AppHost`) are
|
|
46
|
-
- **Generation output** is `.play` text, reproducible from the same restored checkout, so a draft can be committed and diffed. Diagnostics carry a code,
|
|
47
|
+
- **Source generation** loads a .NET solution or project through MSBuild with the installed .NET SDK. Packages must already be restored. MSBuild evaluates the project and may write intermediate build files, so run it only on a trusted checkout. It does not start the application or connect to its database or Chronicle. One bundled provider interprets the whole application: Arc, Marten, or Marten with Wolverine (Critter Stack). Auto detection picks the most specific match and reports unrelated matches instead of guessing. It reads only the selection; spec and test projects (`.Specs`, `.Specifications`, `.Tests`, `.Test`, `.IntegrationTests`, `.Specs.AppHost`) are left out.
|
|
48
|
+
- **Generation output** is `.play` text, reproducible from the same restored checkout, so a draft can be committed and diffed. Diagnostics carry a code, location and message, and go to standard error. Codes starting `CLI` concern the run (target, restore, build, framework, provider, an ignored option); the provider's own diagnostics name a construct it left out or weakened. Warnings do not fail the run. On an error, standard output gets nothing; an explicit output file still gets the partial draft, unless no source was produced.
|
|
47
49
|
- **A draft is partial, and quiet diagnostics are not coverage.** It holds only the framework declarations the provider recognizes, not arbitrary handler logic, and says nothing about projects outside the selection. A construct missing from a draft is a model limit, not evidence that the system lacks it. Reconcile the draft against the code and tests you inspected.
|
|
48
50
|
- **Source conformance** runs the same extraction in memory. It compares the authored model (before) with the recovered one (after) by exact kind and address, so a rename or move reads as a removal plus an addition. It does not run specifications or read opaque code bodies, so a clean result is not behavioral equivalence.
|
|
49
51
|
- **Namespace conformance** reads one Chronicle event store, namespace and event sequence. It captures the tail first, reads the event type registry and the observers, then reads event metadata only, never payloads. Each event is attributed through its causation chain to the innermost command or reactor. Projections and reducers come back as Unknown. It never replays observers, appends events or changes the model.
|
|
@@ -55,7 +57,7 @@ Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Nod
|
|
|
55
57
|
|
|
56
58
|
## Default path: trace one journey through the code
|
|
57
59
|
|
|
58
|
-
Let the user choose one journey with a start and a visible result,
|
|
60
|
+
Let the user choose one journey with a start and a visible result, such as a support agent opening a ticket and finding it in the Open tickets list.
|
|
59
61
|
|
|
60
62
|
1. **Entry.** Start with the actor or trigger and the request contract. Follow the real entry point through validation and authorization to the deciding handler. Trace one success and one meaningful refusal. If no refusal is known, mark that branch unknown rather than inventing a rule.
|
|
61
63
|
2. **Decision and write.** Identify whose state changes and what the handler returns, writes or appends. For an event, separate the addressed event source from the payload. If the handler updates a row, say so: a proposed fact is not an event the system emitted.
|
|
@@ -63,7 +65,7 @@ Let the user choose one journey with a start and a visible result, for example a
|
|
|
63
65
|
4. **Record.** Write one row per finding with its label, its locator (symbol, request, frame or document section) and the candidate slice it supports, such as `OpenTicket` producing `TicketOpened`.
|
|
64
66
|
5. **Ask.** Take one batch of unresolved questions to the requester or their named decision owner. If asked to proceed provisionally, state which outcomes remain unaccepted.
|
|
65
67
|
|
|
66
|
-
For a whole-application candidate on a trusted, restored .NET checkout, generate a draft into its own folder beside the journey traces: `cratis screenplay generate <solution-or-project> --file <draft-folder>/<Name>.play`. Sort the diagnostics: fix `CLI` blockers and configuration warnings (`CLI0014` means an option was ignored) as run problems, and record each provider diagnostic as a **not expressible** loss. Only if a draft was written, run `cratis screenplay validate <draft-folder> --executable`. Then reconcile the draft with the journeys
|
|
68
|
+
For a whole-application candidate on a trusted, restored .NET checkout, generate a draft into its own folder beside the journey traces: `cratis screenplay generate <solution-or-project> --file <draft-folder>/<Name>.play`. Sort the diagnostics: fix `CLI` blockers and configuration warnings (`CLI0014` means an option was ignored) as run problems, and record each provider diagnostic as a **not expressible** loss. Only if a draft was written, run `cratis screenplay validate <draft-folder> --executable`. Then reconcile the draft with the traced journeys as [recovery inputs](references/recovery-inputs.md) describes. Never write a draft over a hand-authored model.
|
|
67
69
|
|
|
68
70
|
Stay within the authorized system and material. A reconstruction from public material is plausible, not proof of the private workflow. Inspect statically before proposing a run; a live write needs separate approval for the target and the action. Do not bypass access controls to fill an evidence gap.
|
|
69
71
|
|
|
@@ -73,8 +75,8 @@ Commands are in the Cratis CLI unless marked as the standalone Screenplay tool (
|
|
|
73
75
|
|
|
74
76
|
### Recover a draft from source: `cratis screenplay generate [PATH]`
|
|
75
77
|
|
|
76
|
-
- `PATH`: a solution (`.slnx`, `.sln`, `.slnf`), a project (`.csproj`) or a folder. When omitted or a folder, the CLI searches that folder and then each parent, preferring `.slnx`, `.sln`, `.slnf`, then `.csproj`. Use a `.slnf` to pick one application in a repository with several. A `.csproj` selects that project and its transitive project references
|
|
77
|
-
- `--file <FILE>`: write the draft to a file, even when generation reports errors; an existing file is overwritten. Without it,
|
|
78
|
+
- `PATH`: a solution (`.slnx`, `.sln`, `.slnf`), a project (`.csproj`) or a folder. When omitted or a folder, the CLI searches that folder and then each parent, preferring `.slnx`, `.sln`, `.slnf`, then `.csproj`. Use a `.slnf` to pick one application in a repository with several. A `.csproj` selects that project and its transitive project references.
|
|
79
|
+
- `--file <FILE>`: write the draft to a file, even when generation reports errors; an existing file is overwritten. Without it, the document goes to standard output.
|
|
78
80
|
- `--provider auto|arc|marten|critter-stack`: choose when unrelated providers match, or pin for reproducible CI. It selects a provider but does not isolate that provider's adapters.
|
|
79
81
|
- `--framework <TFM>`: required when any application project targets several frameworks.
|
|
80
82
|
- `--domain <NAME>`: name the domain when the assembly, root namespace or solution name would be wrong.
|
|
@@ -95,7 +97,7 @@ Commands are in the Cratis CLI unless marked as the standalone Screenplay tool (
|
|
|
95
97
|
- Shared generation options: `--provider`, `--framework`, `--feature-root`, `--module`, `--skip-segments`, `--modules-from-namespace-roots` and `--authoring-only-constructs`. Pass the ones that reproduce the authored module, feature and slice placement; otherwise declarations read as missing. Nothing is written, so there is no `--file`.
|
|
96
98
|
- Findings: `MissingFromModel` (in code only, blocking); `NotRealizedInCode` (in the model only, not blocking); `ShapeMismatch` (blocking for event property, generation contract and other member changes, but not for an authored member extraction did not recover); informational specification and metadata changes; a `sameNameCounterpart` hint for a likely rename.
|
|
97
99
|
- `-o json`: `verdict` (`clean`, `defects-found` or `incomplete`), counts, findings, `notCompared`, `gaps` and provenance.
|
|
98
|
-
- Exit codes: `0
|
|
100
|
+
- Exit codes: `0`: no blocking finding and no gap that prevented looking; `1`: a blocking finding; `2`: the model or project could not be resolved, extraction or comparison failed, or coverage gaps prevented looking.
|
|
99
101
|
|
|
100
102
|
### Check a running namespace against an accepted model: `cratis screenplay conform-namespace <MODEL_ROOT>`
|
|
101
103
|
|
|
@@ -137,7 +139,9 @@ Commands are in the Cratis CLI unless marked as the standalone Screenplay tool (
|
|
|
137
139
|
|
|
138
140
|
- Take disputed or unobserved intent to [timeline discovery](../cratis-modeling-discover-timeline/SKILL.md).
|
|
139
141
|
- Take confirmed changes to [slice design](../cratis-modeling-design-event-model/SKILL.md).
|
|
140
|
-
-
|
|
142
|
+
- A recording or a bounded walk of a running system: `cratis-screenplay-recover-intent`.
|
|
143
|
+
|
|
144
|
+
Read [provenance](references/provenance.md) when checking attribution.
|
|
141
145
|
- To accept a recovered or compared model, use `cratis-screenplay-accept-model`.
|
|
142
146
|
|
|
143
147
|
Neither passing examples nor your judgment grant acceptance, and an agreed example is not authorization to execute.
|
package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/provenance.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
The practices below come from the Eventmodelers Build-Kits skills by Martin Dilger and Nebulit GmbH (https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits at commit `bfab031`; https://nebulit.de), used with the explicit consent of Martin Dilger and Nebulit GmbH. They are expressed here in Screenplay, Chronicle and Arc terms; the upstream board, chat and build-kit mechanics are not used. The notice is in `LICENSE`.
|
|
4
|
+
|
|
5
|
+
| Source (upstream skill path) | Idea used | Where | Form |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| `eventmodelers-cli/stacks/modeling-kit/templates/.claude/skills/analyze-code-base/SKILL.md` | The five lenses (entry points, persistence writes, tests, user interface, documents), with entry points and persistence writes read hardest, tests as vocabulary only and documents trusted least on current behavior | `reading-lenses.md`, The five lenses | close adaptation |
|
|
8
|
+
| same | Mapping from a code construct to a candidate slice, including read-only rows as reference data | `reading-lenses.md`, From code to candidate slices | close adaptation |
|
|
9
|
+
| same | Progressive passes: every area at a high level first, then one area per pass chosen by the person; the depth table; an area is a journey, not an operation; ask only what the code cannot tell, proposing first | `reading-lenses.md`, Progressive passes | close adaptation |
|
|
10
|
+
| same | The person outranks the code, with the code's behavior kept as a decision | `reading-lenses.md`, The person outranks the code | close adaptation |
|
|
11
|
+
| same | Decision records as table rows written in the same pass, the kinds to record and who settled each | `reading-lenses.md`, Decision records | close adaptation |
|
|
12
|
+
| same | Re-read only what changed since the recorded revision; an earlier answer still holds | `resuming-a-trace.md` | idea |
|
|
13
|
+
| `eventmodelers-cli/stacks/modeling-kit/templates/.claude/skills/detect-model-drift/SKILL.md` | Only changes since the baseline count; behavior files sorted from noise per file; one difference is one finding listing its chain; a change toward the model is no finding; a model change lists every screen that shows or submits the changed value; the baseline moves only when every finding is decided, a declined finding included | `resuming-a-trace.md`, Findings on a later pass against an accepted model | close adaptation |
|
|
14
|
+
| `eventmodelers-cli/extensions/vibe/skills/vibe-translate/SKILL.md` | The same baseline rules, for code written outside the model | `resuming-a-trace.md`, same section | idea |
|
|
15
|
+
|
|
16
|
+
Not taken from `detect-model-drift`: its default of updating the model to match the code. Here a difference does not decide which side changes; the model owner does.
|
|
17
|
+
|
|
18
|
+
This skill succeeds the earlier `cratis-screenplay-legacy-extraction` and `cratis-screenplay-reverse-engineering` skills, whose credits to Martin Dilger and Nebulit GmbH it carries forward.
|
package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/reading-lenses.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Read a whole application through five lenses
|
|
2
|
+
|
|
3
|
+
Use this when the whole application is in scope or nobody can yet name the journey to trace. The lenses find the journeys and their candidate slices; each chosen journey is then traced with the default path. Everything a lens finds is a hypothesis to put to the requester or their named decision owner, labelled as the skill's labels require, never a settled slice. The names below (a clinic, `BookVisit`, `VisitBooked`) are illustrative.
|
|
4
|
+
|
|
5
|
+
## The five lenses
|
|
6
|
+
|
|
7
|
+
Read every pass through the same five lenses, only as deep as the pass needs. Start with entry points and persistence writes: they carry the most signal. Tests, user interface and documents then name, order and corroborate what those two found.
|
|
8
|
+
|
|
9
|
+
| Lens | What to read | What it gives |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| **Entry points** (look hardest) | Routes, controllers, handlers, message listeners, scheduled jobs, outbound clients | Each entry point is a candidate slice. The request and response shapes hint at fields; the caller hints at who or what triggers it. |
|
|
12
|
+
| **Persistence writes** (look hardest) | Inserts, updates, deletes, saves, status changes, migrations | Each write is a candidate fact. The stored values are its candidate content; a status or enumeration column shows a lifecycle; a derived or joined query shows a candidate view. |
|
|
13
|
+
| **Tests** | Test names, fixtures, error cases | Vocabulary only: the business words, which refusals someone cared about, and realistic example values. |
|
|
14
|
+
| **User interface** | Templates, views, components, forms, navigation | Forms and buttons are where a person decides, list and detail pages are views, page order proposes the journey order, and visible labels are the business words. |
|
|
15
|
+
| **Documents** | Overviews, decision records, interface descriptions, diagrams, user stories, acceptance text, deployment and schedule configuration | Vocabulary, stated purpose, the order of steps, the systems around this one and the reason behind a decision. Configuration shows integrations and jobs the code alone hides. |
|
|
16
|
+
|
|
17
|
+
Rules that keep each lens honest:
|
|
18
|
+
|
|
19
|
+
- **Tests show vocabulary, not shape.** A test's arrange, act and assert do not decide what a slice's given, when and then hold, and a mock, repository or setup call is never history. Write examples with `cratis-screenplay-specify-outcome`.
|
|
20
|
+
- **This lens reads the user interface's source.** Walking a running instance is `cratis-screenplay-recover-intent`. Its click path proposes an order; confirm that order against entry points and persistence writes.
|
|
21
|
+
- **Trust documents least on what the system does today.** They state intent and go stale. A documented step still has to be found in the code; until it is, record it as **unknown** (documented only) with the document's section and date as locator.
|
|
22
|
+
- **In doubt, ask which documents describe the business.** List the candidates in one question, then continue with the code and the unambiguous documents. A committed document is not authoritative because it is committed.
|
|
23
|
+
- **A generic engine is not the model.** When the code is a configurable engine (templates, schemas, configurable entities), trace one real case it handles.
|
|
24
|
+
- **A disagreement between lenses is a question, not a slice.** A route nothing calls, a table nothing writes, a test for removed behavior, a screen without a backend, a document describing a flow the code lacks: record each as **unknown** with both locators and the owner who can settle it.
|
|
25
|
+
|
|
26
|
+
## From code to candidate slices
|
|
27
|
+
|
|
28
|
+
| In the code | Candidate |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| A write to storage | A **proposed fact**, past tense, in business words (`VisitBooked`, not "visit row inserted"). Several writes in one call are one decision with possibly several facts: ask. |
|
|
31
|
+
| An inbound call a person triggers from a form, button or page | A state change slice (a screen and its command) when it writes; a state view slice (a screen and the view it reads) when it only reads. The controller is evidence; the person's decision is the command. |
|
|
32
|
+
| An inbound call nobody types: a scheduled job, a listener for a fact of this system | An automation slice. |
|
|
33
|
+
| An inbound call from another system: a webhook, a message, a polled record | An inbound translation slice; behavior that follows it is its own automation slice. |
|
|
34
|
+
| An outbound call to another system: an HTTP client, mail, payment, a published message | An automation slice that reacts to a fact, makes the call and records the outcome as a fact. |
|
|
35
|
+
| A read endpoint, query or join | A view, fed by the facts behind the tables it reads. |
|
|
36
|
+
| A row that is only read and never written by this system | Reference data from outside: ask where it comes from; do not invent a fact for it. |
|
|
37
|
+
|
|
38
|
+
Class, table and route names are locators, never slice or fact names. Slice kinds and their rules belong to `cratis-modeling-design-event-model`; this table only says which kind a signal suggests.
|
|
39
|
+
|
|
40
|
+
## Progressive passes
|
|
41
|
+
|
|
42
|
+
Do not detail everything at once. Each pass ends with a report and a question, and the person chooses where to go next.
|
|
43
|
+
|
|
44
|
+
1. **First pass: every area, high level.** Read broadly through the five lenses and group what you find into areas. An area is a journey from trigger to outcome, never one route, controller or create, read, update or delete operation: registering, finding, viewing and updating an owner are one area although the code splits them. Name each area and its business milestones only: no fields, examples or rules. Report the areas and ask which one to detail. Never pick for the person.
|
|
45
|
+
2. **Each later pass: one area, the one the person chose.** Trace its whole journey from trigger to outcome with the default path, not only its first slice. Stay inside the depth the pass has:
|
|
46
|
+
|
|
47
|
+
| Pass depth | Slices | Fields | Outcomes |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| High level | One area per journey, milestones only | None | None |
|
|
50
|
+
| Flow | The real sequence of commands, facts and views in one journey | Identifying and business-critical only | One success and the one or two refusals that matter |
|
|
51
|
+
| Deeper | Sub-journeys, alternate paths, automations | The full business field set | Refusals and edge rules, each traced to the point that enforces it |
|
|
52
|
+
|
|
53
|
+
Deeper means more business (decisions, rules, ways to fail), never more technical detail.
|
|
54
|
+
3. **End every pass the same way.** Report what the pass added, what is still open, and the sub-journeys found inside the area. Then ask: which area next, deeper here, or stop. Stop when the person says stop; areas not chosen stay at high level.
|
|
55
|
+
|
|
56
|
+
Ask only what the code cannot tell you: usually the order of steps and unclear business requirements. Propose first ("the owner picks a pet and then books a visit: is that the real sequence?"). Never place a step at a guessed position; where neither code, a walk nor a person settles the order, leave it **unknown**.
|
|
57
|
+
|
|
58
|
+
## The person outranks the code
|
|
59
|
+
|
|
60
|
+
When the requester or their decision owner contradicts the code, the candidate follows the person, and what the code does stays in the trace as a decision row with its label and locator. For example: the code lets a booked visit be cancelled and the owner says that never happens, so the candidate has no cancellation, and the row records the cancel path as inferred from inspection and deliberately left out. This shapes the candidate only; it does not accept the model, and in a baseline comparison it does not decide which side changes.
|
|
61
|
+
|
|
62
|
+
## Decision records
|
|
63
|
+
|
|
64
|
+
Record every decision made while turning code into candidates, in the same pass as the candidate it explains, not in a write-up at the end. An answer from the person is a decision too. Use table rows, not prose:
|
|
65
|
+
|
|
66
|
+
| Decision | Why | Locator | Settled by |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| The visit form's handler and the visit insert become `BookVisit` and `VisitBooked` | One decision, one write | Handler symbol; table | code |
|
|
69
|
+
| `PetType` is called Species | The owner's word | Entity symbol | person |
|
|
70
|
+
| Cancelling a visit is left out | The code allows it; the owner says it never happens | Cancel route | person |
|
|
71
|
+
| The audit table is not a candidate | Technical; no business decision | Table | code |
|
|
72
|
+
| A failed booking is refused | No test covers the failure path | Handler symbol | assumed |
|
|
73
|
+
|
|
74
|
+
Record at least these kinds: a code construct mapped to a candidate, an order, a conflict between code and document, a code term mapped to a business term, the person overriding the code, a merge or split, something deliberately left out, reference data, and an assumption.
|
|
75
|
+
|
|
76
|
+
**Settled by** is one of `code` (derived from what was read), `document` (stated only; name the document), `person` (they said so) or `assumed` (neither; still open). An `assumed` row is also an **unknown** finding with the question that would settle it. Give every row a locator precise enough to find again: a symbol, route, table, test or document section, never "the visit code".
|
package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/resuming-a-trace.md
CHANGED
|
@@ -7,3 +7,15 @@ At each pass, record per feature or journey the code revision, whether uncommitt
|
|
|
7
7
|
- Preserve consequential name differences with their locator: legacy `Activated` might mean “registration accepted”; keep that mapping provisional until the owner confirms it.
|
|
8
8
|
- If history was rewritten, either input tree is dirty, or the watermark can't be recovered, fully retrace affected journeys. If their boundary is uncertain, retrace the whole scoped feature.
|
|
9
9
|
- Close the pass with a loss table: item and evidence, class, owner or next check. Distinguish **not examined**, **not observed**, **not expressible** (model limit or generator diagnostic), and **awaiting owner decision**. Record discarded or regenerated draft files and any generated-file cleanup still pending. Do not clean another owner's files.
|
|
10
|
+
|
|
11
|
+
## Findings on a later pass against an accepted model
|
|
12
|
+
|
|
13
|
+
When the later pass compares the code with an accepted model, the recorded revision is the baseline and these rules decide what is a finding:
|
|
14
|
+
|
|
15
|
+
- **Only changes since the baseline count.** A difference that already existed at the recorded revision belongs to the earlier pass's table; carry it forward from there. Report it again only if a change since then touched it.
|
|
16
|
+
- **Sort the changed files before comparing.** Entry points, handlers, stored shapes, projections, queries, validation, screens and tests can change behavior. So can a dependency update, a build or runtime configuration change and a regenerated file: follow each to the behavior it reaches before you set it aside. Exclude a change only when you verified it has no behavioral effect, such as formatting or a comment; list those once as not relevant, with the check you made, never as findings. One change can mix both; drop its noise and keep its behavior.
|
|
17
|
+
- **One difference is one finding.** A field renamed in the request contract, the handler, the stored shape, the projection and the screen is one finding that lists that chain, recorded at the element where it starts.
|
|
18
|
+
- **A change that moves the code toward the model is not a finding.** A fix that finally implements a modeled refusal makes that comparison **matched**; mention it in the summary at most.
|
|
19
|
+
- **A finding does not choose the fix.** State what the model says, what the code now does and the change that introduced it, then let the model owner decide which side changes. Say so when the change looks accidental (a misspelled name, a leftover debugging path, a disabled test), because that is evidence for restoring the code.
|
|
20
|
+
- **A proposed model change lists every screen it touches.** When the owner decides the model should change, follow the changed command, event or read-model property with `screenplay lineage` and name each screen that shows or submits it in the same finding. Those screens change in place; never propose a new screen beside an outdated one.
|
|
21
|
+
- **Move the baseline only when every finding is decided.** Record each finding as applied to the model, returned to the code or declined. A declined finding is accepted as it stands, so the next pass does not report it. While any finding is undecided, keep the old recorded revision so the same changes come up again.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
This skill uses ideas from the Eventmodelers Build-Kits skills by Martin Dilger and Nebulit GmbH (https://nebulit.de), with the explicit consent of Martin Dilger and Nebulit GmbH. The adapted material remains credited to them.
|
|
4
|
+
|
|
5
|
+
Source repository: https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits at commit `bfab031`. Skill paths are relative to `eventmodelers-cli/`.
|
|
6
|
+
|
|
7
|
+
| Source | Idea used | Where | Form |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `stacks/classic` `build-state-change` and `build-state-view`, closing verification | The slice definition is the source of truth. Every contracted field is accounted for in the code, nothing is in the code that the contract does not state, and every specification has its own passing test. | `references/contract-reconciliation.md`, Reconcile in both directions | idea |
|
|
10
|
+
| `shared/skills/request-feedback` | An ambiguity that blocks the work is returned as one specific question that names the element, so the owner can answer without earlier context. | `references/contract-reconciliation.md`, When the evidence conflicts | idea |
|
|
11
|
+
| `stacks/classic` `build-automation`; `stacks/modeling-kit` `prototype` | An automation works off a to-do read model of pending work. The scenarios of that list decide how an item gets on and off it, and handling the same trigger again must not issue the command twice. | `references/csharp.md`, Draining a to-do list; `references/eventual-consistency.md`, A reactor | idea |
|
|
12
|
+
| `stacks/kurrent` `build-automation` | When an automation issues one command per item, an item that was already handled must not stop the others. | `references/csharp.md`, Reactions | idea |
|
|
13
|
+
|
|
14
|
+
An earlier version of this corpus took the closing-verification and automation ideas from the same authors' agentic-engineer repository (https://github.com/Nebulit-GmbH/agentic-engineer, commit `07b0f30648d663cb588d7e2c7aa031af9dfc21f2`), under the same consent.
|
|
15
|
+
|
|
16
|
+
Not adopted: `slice.json`, the board, the Slice map and evidence notes; isolating a slice so that it can be deleted; recording assumptions as code comments; swallowing an exception to treat a repeat as handled (here the command decides again and returns a refusal).
|
|
@@ -137,3 +137,5 @@ Export `--format openapi` from the accepted full model when any selected operati
|
|
|
137
137
|
In-process export and direct Stage planning are C#-only; otherwise use the CLI or MCP. The library opens roots with identities, opens a read-only root for release-baseline checks, exports and narrows ESM, admits screens, emits API/UI/agent contracts, and reads ESM strictly or while preserving unknown fields.
|
|
138
138
|
|
|
139
139
|
Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir); only the project's languages are installed.
|
|
140
|
+
|
|
141
|
+
Read [provenance](references/provenance.md) when checking attribution.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
This skill uses ideas from the Eventmodelers Build-Kits skills by Martin Dilger and Nebulit GmbH (https://nebulit.de), with the explicit consent of Martin Dilger and Nebulit GmbH. The adapted material remains credited to them.
|
|
4
|
+
|
|
5
|
+
Source repository: https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits at commit `bfab031`. Skill paths are relative to `eventmodelers-cli/`.
|
|
6
|
+
|
|
7
|
+
Skill paths below are under `stacks/modeling-kit/templates/.claude/skills/`.
|
|
8
|
+
|
|
9
|
+
| Source | Idea used | Where | Form |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| `eventmodeling-orchestrating-event-modeling`, `references/project-planning-with-event-modeling.md` | Estimate by counting slices and measuring throughput from slices already completed, instead of estimating each feature. | `references/ordering.md`, Count and estimate | idea |
|
|
12
|
+
| same | Count only slice work, and budget other work separately. | `references/ordering.md`, Count and estimate | idea |
|
|
13
|
+
| same | Dependencies between slices decide what can run in parallel, and settled contracts are what let work proceed in parallel. | `references/ordering.md`, Build the waves | idea |
|
|
14
|
+
| same | Capacity is per team, so the plan follows the load on each owner and not the total divided by headcount. | `references/ordering.md`, Count and estimate | idea |
|
|
15
|
+
|
|
16
|
+
An earlier version of this corpus took the same ideas from the authors' agentic-engineer repository (https://github.com/Nebulit-GmbH/agentic-engineer, commit `07b0f30648d663cb588d7e2c7aa031af9dfc21f2`), under the same consent.
|
|
17
|
+
|
|
18
|
+
Not adopted: the flat cost curve claim, sprint velocity figures and the planning spreadsheet, weighting by complexity class, and the board status vocabulary.
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
This skill adapts material from the Eventmodelers Build-Kits skills by Martin Dilger and
|
|
7
|
+
Nebulit GmbH (https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits; https://nebulit.de), used
|
|
8
|
+
with the explicit consent of Martin Dilger and Nebulit GmbH. The adapted material remains credited
|
|
9
|
+
to Martin Dilger and Nebulit GmbH.
|
|
10
|
+
|
|
11
|
+
This skill also adapts material from agentic-engineer by Martin Dilger and Nebulit GmbH
|
|
12
|
+
(https://github.com/Nebulit-GmbH/agentic-engineer, commit 07b0f30648d663cb588d7e2c7aa031af9dfc21f2;
|
|
13
|
+
https://nebulit.de), used with the explicit consent of Martin Dilger and Nebulit GmbH. The adapted
|
|
14
|
+
material remains credited to Martin Dilger and Nebulit GmbH.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-screenplay-model-automation
|
|
3
|
-
description: Use when a Screenplay model needs system-initiated work - a reaction to a local fact, a clock schedule or a host signal, a call to an external system's abilities,
|
|
3
|
+
description: Use when a Screenplay model needs system-initiated work - a reaction to a local fact, a clock schedule or a host signal, a call to an external system's abilities, a process over time with waits, approvals, deadlines or retries (facts, reactions and a to-do list by default), or a deliberately modeled state machine or workflow. Not for importing external records or another application's public events (use cratis-screenplay-model-translation), and not for the decision a user's command makes (use cratis-screenplay-declare-slice).
|
|
4
|
+
license: LICENSE
|
|
4
5
|
compatibility: Requires the Screenplay CLI.
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -26,8 +27,9 @@ A state machine tracks one entity per read-model key. Only a transition runs ent
|
|
|
26
27
|
## Choose the mechanism
|
|
27
28
|
|
|
28
29
|
- Follow up on a local fact with a reaction, not a second user action. Use a clock reaction for a schedule or a typed trigger for an application signal only where the target admits it; use the extension contract for a provider signal.
|
|
29
|
-
-
|
|
30
|
-
-
|
|
30
|
+
- **Process over time** (waits, approvals, deadlines, retries, per-item work): default to facts, reactions and a [to-do list](references/to-do-lists.md). A fact opens an item, a reaction invokes a command that rechecks state, a closing fact removes it.
|
|
31
|
+
- **State machine or workflow:** only when the owner deliberately models one or a construct requires it: an `answers later` ability (workflow action only), a Stage Host ability call (workflow action or state entry), or iterating a collection (workflow `foreach`).
|
|
32
|
+
- Ask an external system via an ability. An operation records intent only. For external records or another application's public events, use `cratis-screenplay-model-translation` instead.
|
|
31
33
|
|
|
32
34
|
## Default path: react to a fact by invoking a command
|
|
33
35
|
|
|
@@ -73,7 +75,7 @@ A reaction may have several triggers; each is handled separately, in authored or
|
|
|
73
75
|
### Under a trigger
|
|
74
76
|
|
|
75
77
|
- `<value>` lines: select event or trigger values by name (selection, not declaration). Escape a value named like a keyword with `@`, such as `@reads` or `@file`. Clock triggers carry no values.
|
|
76
|
-
- `invokes <Command>` + `<input> = <source>` lines: ask a command to decide. Map every required request input, never generated inputs. Authoring type-checks nested paths, but that does not guarantee target support. A list path never fans out;
|
|
78
|
+
- `invokes <Command>` + `<input> = <source>` lines: ask a command to decide. Map every required request input, never generated inputs. Authoring type-checks nested paths, but that does not guarantee target support. A list path never fans out; record a fact per item.
|
|
77
79
|
- `invokes <System>.<Ability>` + inputs + answer branches: model an external call with scripted reference answers; Stage refuses reaction ability calls (see Systems and abilities).
|
|
78
80
|
- `produces <Event>` + mappings: append a declared event. `for` takes a required scalar trigger value or nonblank text; omit only for an event trigger to reuse its source. `produces ... when` is the command form; a reaction narrows with `where`.
|
|
79
81
|
- Production `tag <tag>` lines: literal append metadata, before the payload mappings.
|
|
@@ -200,3 +202,5 @@ Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Nod
|
|
|
200
202
|
- [Reaction boundaries](references/reaction-boundaries.md): whose authority, whose decision and what commits together.
|
|
201
203
|
- [Systems, abilities and external effects](references/external-effects.md): choosing the effect class and handling lost replies.
|
|
202
204
|
- [State machines and workflows](references/statemachines-and-workflows.md): examples, node semantics and specifications.
|
|
205
|
+
|
|
206
|
+
Read [provenance](references/provenance.md) when checking attribution.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
This skill uses material from the Eventmodelers Build-Kits skills by Martin Dilger and Nebulit GmbH (https://nebulit.de), with the explicit consent of Martin Dilger and Nebulit GmbH. The adapted material remains credited to them.
|
|
4
|
+
|
|
5
|
+
Source repository: https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits at commit `bfab031`. Skill paths are relative to `eventmodelers-cli/stacks/modeling-kit/templates/.claude/skills/`.
|
|
6
|
+
|
|
7
|
+
| Source | Idea used | Form |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `eventmodeling-designing-automation-chains` | An automation drains a to-do list: a fact opens the item and a fact closes it. Narrowed here to work that stays pending over time. Used in `references/to-do-lists.md`, "The shape". | close adaptation |
|
|
10
|
+
| `eventmodeling-designing-automation-chains` | Membership in the list is the pending state, with no status field; a consumer that needs a status reads a different read model. | close adaptation |
|
|
11
|
+
| `eventmodeling-designing-automation-chains` | Every field of the to-do item has a known source and states whether it is one value or a list. | close adaptation |
|
|
12
|
+
| `eventmodeling-designing-automation-chains` | A second automation only for a second decision; a stage that restates the first fact is redundant, and a `...Synced` name is the sign. | close adaptation |
|
|
13
|
+
| `eventmodeling-designing-automation-chains` | An outside event never drives local work directly; it is translated into an internal fact first, and that translation is never closed by its own fact. | idea |
|
|
14
|
+
|
|
15
|
+
An earlier version of this corpus adapted the same practices in `cratis-screenplay-automations-and-translations` from the same authors' agentic-engineer repository (https://github.com/Nebulit-GmbH/agentic-engineer, commit `07b0f30648d663cb588d7e2c7aa031af9dfc21f2`), under the same consent.
|
|
16
|
+
|
|
17
|
+
The recheck of current state by the command, the waits and deadlines table and the Screenplay example are Cratis material.
|
|
18
|
+
|
|
19
|
+
Not adopted:
|
|
20
|
+
|
|
21
|
+
- Board, column, lane and connection mechanics, and the rule that the to-do read model sits one column before its automation.
|
|
22
|
+
- A to-do list for the translation step. In Screenplay the capture or reaction in the `Translate` slice is the translation, so it needs no pending view.
|
|
23
|
+
- A mandatory translation automation with its own command. A capture or a reaction in a `Translate` slice does that work.
|
|
24
|
+
- "Every trigger is an event". Screenplay also has clock and application triggers.
|
|
25
|
+
- "Default gracefully" for missing data. This skill never fabricates a default.
|
package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Decide what one reaction can promise
|
|
2
2
|
|
|
3
|
-
For
|
|
3
|
+
For work that waits for a later fact, a person or a deadline, use a [to-do list](to-do-lists.md). For a deliberately modeled state machine or workflow, see [state machines and workflows](statemachines-and-workflows.md).
|
|
4
4
|
|
|
5
|
-
Start with one occurrence. An event reaction sees a recorded fact; its command may still have to decide whether acting is allowed **now**. A reaction is not by itself a lifecycle:
|
|
5
|
+
Start with one occurrence. An event reaction sees a recorded fact; its command may still have to decide whether acting is allowed **now**. A reaction is not by itself a lifecycle: by default the facts and a to-do list carry the process, and a state machine or workflow does so only when the owner models one or a construct requires it. A repeated entry can repeat its effects.
|
|
6
6
|
|
|
7
7
|
**Whose authority?** Declare `runs as system` once directly on the reaction, not on an individual trigger. Its declared roles apply to the commands it invokes across triggers. It does not supply arbitrary user claims, change the original caller or turn a direct `produces` into an authorized command. Without the declaration the invocation has no caller in the reference evaluator. `given caller` in a specification never supplies this actor: a gated invocation without `runs as system` is always denied, and the compiler warns (`PLAY0648`, or `PLAY0557` when the invocation has an `on refused by authorization` branch). In Arc the same roles sit on the reactor class: `[ExecuteCommandsAsSystem("<Role>")]` from `Cratis.Arc.Chronicle.Reactors` in C# (Stage renders it from `runs as system` when the invoked command's gate is role-only or authenticated-only; it refuses a claim-reading or opaque gate there with `STAGE-ESM-034`), or `@ExecuteCommandsAsSystem("<Role>")` from `io.cratis.arc.chronicle` in Kotlin. A hand-written reactor carries it itself. Without it, C# runs the returned commands with no principal and Kotlin runs them as the event's causing identity with no roles, so a role gate denies them. If two triggers need different privileges, separate their responsibilities rather than giving both the union of roles.
|
|
8
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Model entity state and durable work separately
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A process over time defaults to facts, reactions and a [to-do list](to-do-lists.md). Read this file when the owner deliberately models a state machine or workflow, or a construct requires one: an `answers later` ability (workflow action only), an ability call the Stage Host must run (workflow action or state entry), or a `foreach` over a collection.
|
|
4
|
+
|
|
5
|
+
A top-level state machine holds the state of one entity; its `follows` read model's key is the subject identity. A top-level workflow carries a process across several steps, including a time or human wait. The `for` read model's key identifies the subject; one run of that workflow can be active per subject.
|
|
4
6
|
|
|
5
7
|
These excerpts assume a keyed `Invoice` read model, `InvoiceRegistered`, `InvoiceSent` and `InvoicePaid` facts on the invoice stream, `NotifyPaid`, `WriteOff` and `OfferPlan` commands, and a `Controller` persona. Supply every required fixture property in the actual model.
|
|
6
8
|
|