@cratis/pi 7.6.5 → 7.7.1

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.
Files changed (212) hide show
  1. package/package/corpus/agents/backend-developer.md +14 -0
  2. package/package/corpus/agents/code-reviewer.md +16 -0
  3. package/package/corpus/agents/coordinator.md +17 -0
  4. package/package/corpus/agents/frontend-developer.md +17 -0
  5. package/package/corpus/agents/orchestrator.md +18 -0
  6. package/package/corpus/agents/planner.md +24 -0
  7. package/package/corpus/agents/screenplay-modeler.md +57 -0
  8. package/package/corpus/agents/screenplay-renderer.md +42 -0
  9. package/package/corpus/agents/screenplay-reviewer.md +45 -0
  10. package/package/corpus/agents/slice-implementer.md +32 -5
  11. package/package/corpus/agents/spec-writer.md +16 -3
  12. package/package/corpus/prompts/add-reactor.prompt.md +5 -3
  13. package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
  14. package/package/corpus/prompts/write-specs.prompt.md +12 -6
  15. package/package/corpus/rules/application-profile.md +7 -3
  16. package/package/corpus/rules/general.md +8 -3
  17. package/package/corpus/rules/glossary.md +1 -1
  18. package/package/corpus/rules/profiles.md +42 -4
  19. package/package/corpus/rules/reactors.md +30 -22
  20. package/package/corpus/rules/vertical-slices.md +3 -1
  21. package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
  22. package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
  23. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
  24. package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
  25. package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
  26. package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
  27. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
  28. package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
  29. package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
  30. package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
  31. package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
  32. package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
  33. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
  34. package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
  35. package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
  36. package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
  37. package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
  38. package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
  39. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
  40. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
  41. package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
  42. package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
  43. package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
  44. package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
  45. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
  46. package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
  47. package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
  48. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
  49. package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
  50. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
  51. package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
  52. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
  53. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
  54. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
  55. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
  56. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
  57. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
  58. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
  59. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
  60. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
  61. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
  62. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
  63. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
  64. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
  65. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
  66. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
  67. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
  68. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
  69. package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
  70. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
  71. package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
  72. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
  73. package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
  74. package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
  75. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
  76. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
  77. package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
  78. package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
  79. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
  80. package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
  81. package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
  82. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
  83. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
  84. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
  85. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
  86. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
  87. package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
  88. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
  89. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
  90. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
  91. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
  92. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
  93. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
  94. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
  95. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
  96. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
  97. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
  98. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
  99. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
  100. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
  101. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
  102. package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
  103. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +77 -57
  104. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
  105. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
  106. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +44 -6
  107. package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
  108. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -10
  109. package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
  110. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
  111. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
  112. package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
  113. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
  114. package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
  115. package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
  116. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
  117. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
  118. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
  119. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
  120. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
  121. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
  122. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
  123. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
  124. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
  125. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
  126. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
  127. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
  128. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
  129. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
  130. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
  131. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
  132. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
  133. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
  134. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
  135. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
  136. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
  137. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
  138. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
  139. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
  140. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
  141. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
  142. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
  143. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
  144. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
  145. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
  146. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
  147. package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
  148. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
  149. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
  150. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
  151. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
  152. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
  153. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
  154. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
  155. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
  156. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
  157. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
  158. package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
  159. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
  160. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
  161. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
  162. package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
  163. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
  164. package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
  165. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
  166. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
  167. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
  168. package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
  169. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
  170. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
  171. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
  172. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
  173. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
  174. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
  175. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
  176. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
  177. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
  178. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
  179. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
  180. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
  181. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
  182. package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
  183. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
  184. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
  185. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
  186. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
  187. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
  188. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
  189. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
  190. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
  191. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
  192. package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
  193. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
  194. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
  195. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
  196. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
  197. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
  198. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
  199. package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
  200. package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
  201. package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
  202. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
  203. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
  204. package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
  205. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
  206. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
  207. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
  208. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
  209. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
  210. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
  211. package/package/profile-catalog.json +11 -0
  212. package/package.json +1 -1
@@ -0,0 +1,150 @@
1
+ # Example: a model inside the Stage 4.24 renderable subset
2
+
3
+ A complete marina-berth model that `cratis render` 3.27.1 accepts, followed by what the
4
+ render produced and how each claim was checked. Use it as a shape to stay inside when a
5
+ model must be renderable; it is not a template for richer slices (see `admission.md`).
6
+
7
+ ```screenplay
8
+ // cratis-stage-rendering-and-sandbox: a complete model inside the Stage 4.24 renderable subset.
9
+ // Two commands with one event each, one projection with a removal, one keyed snapshot query,
10
+ // declarative authorization and three reference specifications. Compiles with warnings as errors
11
+ // and renders with `cratis render`; no code attachments, no ESM v4+ constructs.
12
+
13
+ domain Harbour.Marina
14
+
15
+ concept BerthId : Uuid // event source id of one berth stream
16
+ concept BoatName : String
17
+ validate
18
+ not empty message "A boat name is required"
19
+
20
+ policy IsHarbourMaster
21
+ require authenticated and role "HarbourMaster"
22
+
23
+ module Berths
24
+ description "Which boats hold which berths"
25
+ feature Reservations
26
+ slice StateChange ReserveBerth
27
+ description "A boat reserves one berth"
28
+ command ReserveBerth
29
+ berthId BerthId identifier
30
+ boatName BoatName
31
+ authorize IsHarbourMaster
32
+ produces BerthReserved
33
+ for berthId
34
+ boatName = boatName
35
+ event BerthReserved
36
+ boatName BoatName
37
+ specification ReservingABerth
38
+ given caller
39
+ authenticated
40
+ role "HarbourMaster"
41
+ when ReserveBerth
42
+ berthId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
43
+ boatName = "Sea Otter"
44
+ then BerthReserved
45
+ for "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
46
+ boatName = "Sea Otter"
47
+
48
+ specification ShowingAReservedBerth
49
+ given caller
50
+ authenticated
51
+ role "HarbourMaster"
52
+ when ReserveBerth
53
+ berthId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
54
+ boatName = "Sea Otter"
55
+ then BerthReserved
56
+ for "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
57
+ boatName = "Sea Otter"
58
+ then query BerthStatusById
59
+ arguments
60
+ berthId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
61
+ result
62
+ boatName = "Sea Otter"
63
+
64
+ slice StateChange ReleaseBerth
65
+ command ReleaseBerth
66
+ berthId BerthId identifier
67
+ authorize IsHarbourMaster
68
+ produces BerthReleased
69
+ for berthId
70
+ event BerthReleased
71
+ specification ReleasingABerth
72
+ given caller
73
+ authenticated
74
+ role "HarbourMaster"
75
+ when ReleaseBerth
76
+ berthId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
77
+ then BerthReleased
78
+ for "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
79
+
80
+ slice StateView BerthStatus
81
+ description "Who holds a berth now"
82
+ readmodel BerthStatus
83
+ berthId BerthId
84
+ boatName BoatName
85
+ query BerthStatusById => BerthStatus optional
86
+ by berthId BerthId
87
+ projection BerthStatusProjection => BerthStatus
88
+ from BerthReserved
89
+ boatName = boatName
90
+ remove with BerthReleased
91
+ ```
92
+
93
+ Why it is shaped this way:
94
+
95
+ - Each command has one unconditional `produces`, with a typed `for` on the identifier.
96
+ - The policy requires authentication as well as the role; a role alone is `STAGE-ESM-015`.
97
+ - The projection has a `from` and a `remove with`, so Stage renders it as a scoped
98
+ projection keyed by the event source. The identifier is never mapped: the key
99
+ establishes it, and mapping it is `STAGE-ESM-017`.
100
+ - The query is the admitted shape: `=> X optional` with one `by` equal to the read-model
101
+ identifier. It has no `authorize`, so it renders as `[AllowAnonymous]`.
102
+ - The specifications that assert a query sit in the **command** slice: a `then query`
103
+ needs the `when` command of its own slice and the `then` event as well.
104
+ - No `handler`, no code attachments, no reactions, no ESM v4 or newer constructs.
105
+
106
+ ## What was run
107
+
108
+ All with cratis 3.27.1 on a folder holding only `berths.play`:
109
+
110
+ | Step | Command | Result |
111
+ | --- | --- | --- |
112
+ | Compile | `screenplay <folder> --warnaserror` (4.64.0) and `cratis screenplay validate <folder> --warnings-as-errors` | 0 errors, 0 warnings |
113
+ | Admission and publication | `cratis render <folder> --name Marina --destination out -o json` | exit 0, 30 artifacts written, `recovered: false` |
114
+ | Re-render | the same command | `written: 0`, `unchanged: 30` |
115
+ | Local edit | append a line to `out/Program.cs`, render again | exit 5: `Managed artifact 'Program.cs' was modified by the user; pass --force to replace it.` |
116
+ | Forced | the same with `--force` | `written: 1`, `unchanged: 29` |
117
+ | Missing name | render without `--name` | exit 5: `A valid --name is required and must be a C# identifier` |
118
+ | Debug build | `dotnet build out/Marina.csproj -c Debug` | succeeded, 0 warnings, 0 errors |
119
+ | Debug tests | `dotnet test out/Marina.csproj -c Debug` | 7 passed, 0 failed |
120
+
121
+ Runtime (`docker compose up`, `/healthz`) and the frontend build were **not run**.
122
+
123
+ **Admission is not a passing test.** An earlier draft of the query specification also
124
+ asserted `berthId` in the `result`. It was admitted and built, and its rendered Debug
125
+ test failed (`should_return_the_expected_read_model`): the scoped projection does not set
126
+ the identifier property in that scenario. Dropping the identifier from the `result` made
127
+ all 7 tests pass. That removes an assertion about the key, so it is an accepted
128
+ trade-off only when the model's owner agrees; otherwise record it as a capability gap.
129
+
130
+ ## What came out
131
+
132
+ ```text
133
+ .cratis-render.json ownership manifest: semanticRevision, identity, path + SHA-256
134
+ Marina.csproj, Marina.slnx project named from --name
135
+ Program.cs, GeneratedPolicyRegistration.cs, GeneratedPolicies/Policies.cs
136
+ appsettings.json, docker-compose.yml, Directory.Build.props/.targets, Directory.Packages.props
137
+ Common/BerthId.cs, Common/BoatName.cs concepts
138
+ Berths/Reservations/ReserveBerth/ReserveBerth.cs [Command] record, Handle(), [EventType] event, validator
139
+ Berths/Reservations/ReleaseBerth/ReleaseBerth.cs the second command and event
140
+ Berths/Reservations/*/when_*.cs Debug-only specification classes
141
+ Berths/Reservations/BerthStatus/BerthStatus.cs [ReadModel] record, keyed query, projection
142
+ scene.json, package.json, tsconfig.json, src/bindings.ts, .gitignore, .frontend/* React/Vite scaffold
143
+ ```
144
+
145
+ The namespace follows the folders under the application name
146
+ (`Marina.Berths.Reservations.ReserveBerth`), and a specification class lives in a
147
+ namespace of its own name, so it is `...ReserveBerth.when_reserving_aberth.when_reserving_aberth`.
148
+ A command carries `[Authorize(Policy = "StagePolicy_sem1_...")]` with a generated policy
149
+ that checks `IsAuthenticated` and `IsInRole("HarbourMaster")`. After a successful
150
+ publication the destination holds the manifest and no `.cratis-render/` control directory.
@@ -0,0 +1,87 @@
1
+ # The rendered application: scaffold, managed files and `Customizations/`
2
+
3
+ Read at Stage `v4.24.0` (`Scaffolding/CratisBackendApplicationScaffold*.cs`,
4
+ `CratisFrontendApplicationScaffold.cs`, `README.md`,
5
+ `Documentation/guides/customize-rendered-application.md`) and checked against a real
6
+ render (see [render-example.md](render-example.md)).
7
+
8
+ ## Scaffold pins
9
+
10
+ | Item | Value |
11
+ | --- | --- |
12
+ | Target framework | .NET 10 (`net10.0`), `Microsoft.NET.Sdk.Web` |
13
+ | Arc packages (`Cratis`, `Cratis.Arc.MongoDB`, Arc testing) | `22.25.0` |
14
+ | Chronicle client | `Cratis.Chronicle` and `.AspNetCore` `19.8.1`, matched to the `cratis/chronicle:19.8.1-development` image in the compose file |
15
+ | Test packages | xunit, NSubstitute, Cratis.Specifications; **Debug configuration only** (`IsTestProject` when Debug) |
16
+ | Frontend | Vite and React, Components `4.14.0`, Scene `4.2.0`, Fundamentals `7.19.6` |
17
+ | Package management | central package management **off**; `Directory.Packages.props` is managed, do not edit it |
18
+
19
+ Consequences: `[ProtectedDecision]` and `DecisionRead<T>` (Arc 22.39.0 and later) are not
20
+ available in a rendered application; `[ExecuteCommandsAsSystem]` (Arc 20.56.0 and later)
21
+ is. Upgrading Arc or Chronicle inside a rendered application is a re-render under a newer
22
+ Stage, not an edit of the managed files. The compose file binds local ports `27017` and
23
+ `35000`, keeps data in the named volumes `chronicle-data` and `chronicle-config`, and
24
+ `docker compose down --volumes` is the only thing that deletes them.
25
+
26
+ ## What is managed
27
+
28
+ Every path in `.cratis-render.json` is managed: the scaffold files (project, solution,
29
+ `Program.cs`, `GeneratedPolicyRegistration.cs`, `appsettings.json`, `docker-compose.yml`,
30
+ the three `Directory.*` files, `package.json`, `tsconfig.json`, `.gitignore`,
31
+ `.frontend/*`), `scene.json`, `src/bindings.ts` and everything rendered from the model
32
+ (concepts, slice folders, policies, Debug specifications). Editing any of them is lost or
33
+ refused on the next render. The application identity from `--name` becomes the
34
+ Chronicle event-store name in `appsettings.json` and the default project name and root
35
+ namespace.
36
+
37
+ Whether modeled `screen` declarations become faithful screens in the frontend was not
38
+ verified. The scaffold is a working shell, and the customization guide says screens stay
39
+ managed; do not claim UI fidelity from a published render.
40
+
41
+ ## `Customizations/` (unmanaged)
42
+
43
+ The top-level `Customizations/` folder is reserved and user-owned. No plan contains a path
44
+ there (a module or feature that would render into it fails with `STAGE-CRATIS-005`), and
45
+ the planner never reads it, so it can neither break nor repair a render.
46
+
47
+ | File | Use | Picked up when |
48
+ | --- | --- | --- |
49
+ | `Customizations/Program.cs` | Service registrations, options, extra endpoints or middleware, through the partial methods `ConfigureServices(WebApplicationBuilder)` and `ConfigureApplication(WebApplication)` | the project compiles |
50
+ | `Customizations/*.cs` | Adapters and other types | the project compiles |
51
+ | `Customizations/Dependencies.props` | Project and package references, MSBuild properties; imported last | MSBuild evaluates the project |
52
+ | `Customizations/styles.css` | Font and `--cratis-*` token overrides | Vite builds or serves the frontend |
53
+
54
+ Every file is optional. Rules that bite:
55
+
56
+ - `Customizations/Program.cs` stays in the global namespace and declares
57
+ `partial class Program` with exactly the managed signatures (`static partial void ...`);
58
+ a namespace or a changed signature fails with `CS0759`.
59
+ - `ConfigureServices` runs after `AddCratis` and before `Build`; `ConfigureApplication`
60
+ runs last, after the generated middleware and endpoints. The last registration of a
61
+ service wins, so do not re-register Cratis types unless you mean to replace them.
62
+ - Configuration comes from environment variables or other sources, not from
63
+ `appsettings.json` (managed). Keep secrets out of files under `Customizations/`.
64
+ - A `PackageReference` in `Dependencies.props` needs an explicit `Version`.
65
+ - Endpoints sit under `/api` (the Vite dev server proxies it) on a path that cannot collide
66
+ with a route Arc generates.
67
+ - `package.json` is managed, so `styles.css` cannot add npm dependencies. Restart the dev
68
+ server after creating or deleting the file.
69
+ - Mapped endpoints are anonymous unless secured with ASP.NET Core authorization;
70
+ modeled authorization covers only what Stage renders.
71
+
72
+ What the seam does **not** do: it binds no modeled reaction or capture, runs no
73
+ Automation or Translate slice and renders nothing. An automation or translation is
74
+ hand-written (gap-fill) with its adapters and DI registration here, and the model remains
75
+ its contract. Keep `Customizations/` under version control: whether a re-render keeps
76
+ it depends on the publisher, and `cratis render` writes only the planned paths and
77
+ refuses unmanaged files at them.
78
+
79
+ ## Re-render checklist
80
+
81
+ 1. Commit or stash local work; `Customizations/` is untracked by Stage, not protected by it.
82
+ 2. Render from the same model folder with the same `--name` and `--destination`.
83
+ 3. On a refusal for a modified managed file, find out why it was edited. Move the intent
84
+ into the model or `Customizations/`, then re-render; use `--force` only to discard the
85
+ edit on purpose.
86
+ 4. A result with `recovered: true` stops the work until the destination is reconciled.
87
+ 5. Build and test in Debug (separate results); do not infer them from the render.
@@ -0,0 +1,98 @@
1
+ # The `cratis/stage` sandbox and the `cratis/stage-specrunner` job
2
+
3
+ Read at Stage `v4.24.0` (`README.md`, `Documentation/docker/index.md`,
4
+ `Documentation/docker/spec-runner.md`, `Documentation/reference/urls.md`) and cli
5
+ `v3.27.1` (`Commands/Run/*`). Docker was **not run** for this skill: every behaviour here
6
+ is documented behaviour, not an observed result. Both images are still shipped.
7
+
8
+ ## The sandbox: a partial, disposable runtime
9
+
10
+ `cratis/stage` is the Stage host plus an in-memory Chronicle kernel. Each session starts
11
+ empty and leaves nothing behind. It is for playing a model, not a generated application
12
+ and not a test of one.
13
+
14
+ ```bash
15
+ cratis run ./model # folder or a single .play file; Docker required
16
+ cratis run --port 9191 --workbench-port 35001
17
+ docker run --rm -p 127.0.0.1:9090:9090 -p 127.0.0.1:35000:35000 \
18
+ -v "$PWD":/eventmodel:ro cratis/stage:latest
19
+ ```
20
+
21
+ `cratis run` mounts only the selected file or folder, read-only, and defaults to the
22
+ Stage version the CLI renders with (`--tag` overrides). The Stage API and the Scalar
23
+ reference (`/scalar/v1`) are on `9090`; the Chronicle Workbench is on **`https://`**
24
+ port `35000` (a plain `http://` request gets no reply; the certificate is self-signed).
25
+ The entrypoint takes a model file or folder, default `/eventmodel`. Deployment settings
26
+ come from `cratis-stage.json` (path override `STAGE_CONFIG`), not `appsettings.json`.
27
+ Implementation `file` references stay symbolic: the sandbox never opens them.
28
+
29
+ Two engines:
30
+
31
+ | Engine | Selected by | Behaviour |
32
+ | --- | --- | --- |
33
+ | EventModel (default) | nothing | Commands evaluate their modeled `produces` mappings, append the facts to Chronicle and echo the payload. **Modeled validation, authorization and query authorization are not enforced.** It registers Chronicle projections |
34
+ | Semantic | `Stage__Runtime__Engine=semantic` | Evaluates validation, requirements, authorization, conditional production and constraints before accepting a command; appends one batch; denied is HTTP 403, validation or constraint failure HTTP 400, an unsupported command HTTP 501. `GET /stage/semantic/admission` lists what is admitted. Refuses a model it cannot execute (`state: "unsupported"`, `/api/**` returns 501). Read models are in-process, not Chronicle projections in the Workbench; the history is unbounded, so use it for short sessions |
35
+
36
+ Do not read an answering sandbox as evidence of correct authorization. Callers are
37
+ built from unsigned `x-ms-client-principal` headers that anyone who can reach the host can
38
+ forge, the default engine enforces nothing, and Stage's documentation says to keep the
39
+ session private (loopback ports or an authenticated proxy). The semantic engine does not
40
+ execute modeled specifications; use the runner for those. Rendered applications use the
41
+ renderer's admitted Arc authorization instead, which is the thing to test for production
42
+ behaviour (Debug tests of a render, `render-example.md`).
43
+
44
+ ## The specification runner
45
+
46
+ A run-to-completion job: compiles the model, checks its specifications, writes a results
47
+ file and exits.
48
+
49
+ ```bash
50
+ docker run --rm -v /path/to/model:/model:ro -v /path/to/results:/output \
51
+ cratis/stage-specrunner:latest # structural, deprecated
52
+ docker run --rm -v /path/to/model:/model:ro -v /path/to/results:/output \
53
+ cratis/stage-specrunner:latest --engine semantic --application MyApplication
54
+ ```
55
+
56
+ | Argument | Default | Meaning |
57
+ | --- | --- | --- |
58
+ | `--model <file-or-folder>` | `/model` | `.play` file or folder, one application |
59
+ | `--output <file>` | `/output/results.json` | Result file |
60
+ | `--slice <guid>`, `--spec <guid>` | | Structural engine only; an invalid GUID means no filter |
61
+ | `--engine semantic` | `structural` | Opt in to executable specifications |
62
+ | `--specification`, `--scope`, `--catalog`, `--application` | | Semantic engine only |
63
+
64
+ Exit `0` means the run completed and the file was written **even when a specification
65
+ failed**: read the outcomes. `1` is a missing or uncompilable input, `2` a missing required
66
+ argument or an invalid semantic option.
67
+
68
+ - **Structural** (default, deprecated, to be removed in the next major): verifies that the
69
+ events and commands a specification names resolve to its slice and that modeled rules
70
+ agree. Outcomes `Passed`, `Failed`, `Inconclusive` (not verifiable for that slice type
71
+ yet; not a failure). It does not execute any slice.
72
+ - **Semantic**: runs admitted commands through Arc's in-memory command pipeline with a
73
+ fresh in-memory Chronicle log per specification; supports explicit-source given events,
74
+ unconditional production, event assertions, caller and authorization, command rules,
75
+ unique constraints, flat and event-source-keyed scoped projections, and unprotected
76
+ optional snapshot queries. Report schema `stage-spec-run/1` with outcomes `Passed`,
77
+ `Failed`, `Unsupported` (carrying kind, construct id and reason) or `Cancelled`.
78
+ Not supported: given read models, conditional production, implicit identity allocation,
79
+ external effects, composite values, protected queries, queries other than optional
80
+ snapshots. Unsupported is never a pass. Do not feed the file to a legacy reader.
81
+
82
+ How the runner relates to the verdicts: a structural pass is not a behavioural result. The
83
+ semantic engine is Stage's own `SemanticSpecificationExecutor` (verified at Stage `v4.24.0`,
84
+ `Source/SpecRunner/Program.cs`), running through Arc's in-memory pipeline. It is not the
85
+ Screenplay reference route, so a semantic pass is never V4 (V4 is reference execution only;
86
+ `cratis-screenplay-toolchain` `references/verdicts.md`) and it is not a rendered Debug test run
87
+ (V5.tests). Report its outcomes as a separate line, "Stage semantic engine (target-engine
88
+ evidence)", with the report schema counts, next to the V5 results and labelled as such. How the runner behaves on ESM v4 to v6 specifications was not
89
+ verified: record it as "not run" rather than assuming.
90
+
91
+ ## Choosing between them
92
+
93
+ | Question | Use |
94
+ | --- | --- |
95
+ | Does the model feel right as a running API? | Sandbox (`cratis run`) |
96
+ | Do the modeled specifications pass in Stage's semantic engine (target-engine evidence, not V4)? | Specification runner, `--engine semantic` |
97
+ | Does the generated code behave? | `cratis render`, then Debug build and tests of the output |
98
+ | Is authorization enforced? | Debug tests of a render and the rendered policies; never the default sandbox |
@@ -0,0 +1,19 @@
1
+ {
2
+ "skill": "cratis-stage-rendering-and-sandbox",
3
+ "input": "Can Stage render this Screenplay model, and how do I re-render it safely after someone edited Program.cs?",
4
+ "fixtures": [],
5
+ "assertions": [
6
+ { "kind": "skill-contains", "value": "`cratis render`" },
7
+ { "kind": "skill-contains", "value": "`--name <NAME>` | **Required for plain source**" },
8
+ { "kind": "skill-contains", "value": "`.cratis-render.json`" },
9
+ { "kind": "skill-contains", "value": "`.cratis-render/`" },
10
+ { "kind": "skill-contains", "value": "means stop and reconcile" },
11
+ { "kind": "skill-contains", "value": "STAGE-ESM-016" },
12
+ { "kind": "skill-contains", "value": "**Render never builds, tests or runs**" },
13
+ { "kind": "skill-contains", "value": "Arc `22.25.0`" },
14
+ { "kind": "skill-contains", "value": "`[ProtectedDecision]`" },
15
+ { "kind": "skill-contains", "value": "`Customizations/`" },
16
+ { "kind": "skill-contains", "value": "`Stage__Runtime__Engine=semantic`" },
17
+ { "kind": "skill-contains", "value": "`--engine semantic`" }
18
+ ]
19
+ }
@@ -795,13 +795,23 @@
795
795
  {
796
796
  "id": "cratis/screenplay",
797
797
  "availableTargets": [
798
+ "cratis-screenplay-automations-and-translations",
798
799
  "cratis-screenplay-captures-and-reactions",
799
800
  "cratis-screenplay-command-surface",
801
+ "cratis-screenplay-discovery",
800
802
  "cratis-screenplay-event-modeling",
803
+ "cratis-screenplay-legacy-extraction",
801
804
  "cratis-screenplay-model-authoring",
805
+ "cratis-screenplay-model-review",
806
+ "cratis-screenplay-modeling-lifecycle",
802
807
  "cratis-screenplay-projections",
803
808
  "cratis-screenplay-read-surface",
809
+ "cratis-screenplay-render-and-gap-fill",
810
+ "cratis-screenplay-scenario-coverage",
811
+ "cratis-screenplay-slice-design",
804
812
  "cratis-screenplay-specifications",
813
+ "cratis-screenplay-streams-and-consistency",
814
+ "cratis-screenplay-toolchain",
805
815
  "cratis-screenplay-ui-composition"
806
816
  ],
807
817
  "languages": [
@@ -823,6 +833,7 @@
823
833
  "cratis/specifications"
824
834
  ],
825
835
  "availableTargets": [
836
+ "cratis-application-slice-conformance",
826
837
  "cratis-application-slice-specifications",
827
838
  "cratis-chronicle-event-specifications",
828
839
  "cratis-chronicle-read-model-specifications",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.6.5",
3
+ "version": "7.7.1",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [