@cratis/pi 7.138.1 → 7.139.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.
Files changed (78) hide show
  1. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +2 -0
  2. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +2 -0
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/statemachines-and-workflows.md +12 -1
  4. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +2 -0
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +2 -0
  6. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +4 -0
  7. package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +2 -0
  8. package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +2 -0
  9. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +2 -0
  10. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +2 -0
  11. package/package/corpus/skills/cratis-screenplay-command-surface/references/enum-numbers.md +2 -0
  12. package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +2 -0
  13. package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +2 -0
  14. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +2 -0
  15. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +2 -0
  16. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +4 -0
  17. package/package/corpus/skills/cratis-screenplay-command-surface/references/uuid-equality.md +6 -0
  18. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +2 -0
  19. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +2 -0
  20. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +2 -0
  21. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +4 -0
  22. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +4 -0
  23. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +2 -2
  24. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +2 -0
  25. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +2 -1
  26. package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +28 -25
  27. package/package/corpus/skills/cratis-screenplay-model-review/references/walkthrough.md +2 -0
  28. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +8 -0
  29. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +5 -1
  30. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/version-migration.md +50 -0
  31. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +2 -0
  32. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +2 -0
  33. package/package/corpus/skills/cratis-screenplay-projections/references/reducer-identity.md +4 -0
  34. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +5 -4
  35. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +2 -2
  36. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +2 -0
  37. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
  38. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +7 -0
  39. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +9 -0
  40. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +8 -0
  41. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +2 -0
  42. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -1
  43. package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +2 -0
  44. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -0
  45. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +2 -0
  46. package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +2 -0
  47. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +2 -0
  48. package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +2 -0
  49. package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +2 -0
  50. package/package/corpus/skills/cratis-screenplay-specifications/references/whitespace-rules.md +4 -0
  51. package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +2 -0
  52. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +6 -0
  53. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +2 -0
  54. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +8 -0
  55. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -0
  56. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +2 -0
  57. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +6 -0
  58. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +1 -1
  59. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +1 -1
  60. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +2 -0
  61. package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +4 -0
  62. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +4 -0
  63. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +1 -1
  64. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +16 -0
  65. package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +2 -0
  66. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +6993 -2979
  67. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  68. package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +2 -0
  69. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +55 -70
  70. package/package/corpus/skills/cratis-screenplay-ui-composition/references/action-subjects.md +4 -1
  71. package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md +304 -136
  72. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +46 -31
  73. package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +2 -2
  74. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +9 -9
  75. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +2 -0
  76. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +4 -0
  77. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +4 -0
  78. package/package.json +1 -1
@@ -25,6 +25,8 @@ module Moorings
25
25
  for berthId
26
26
  name BerthName = name
27
27
  maxLength BoatLength = maxLength
28
+ screen RegisterBerth
29
+ action RegisterBerth for screen
28
30
  specification RegisteringABerth
29
31
  given caller
30
32
  authenticated
@@ -63,6 +63,8 @@ module Integration
63
63
  carrier String
64
64
  produces event OrderPacked
65
65
  carrier String = carrier
66
+ screen PackOrder
67
+ action PackOrder for screen
66
68
  slice Translate PublishOrderShipped
67
69
  direction outbound
68
70
  public event OrderShipped
@@ -41,22 +41,32 @@ module Billing
41
41
  command SendInvoice
42
42
  invoiceId InvoiceId identifier
43
43
  produces event InvoiceSent
44
+ screen SendInvoice
45
+ action SendInvoice for screen
44
46
  slice StateChange MarkOverdue
45
47
  command MarkOverdue
46
48
  invoiceId InvoiceId identifier
47
49
  produces event InvoiceMarkedOverdue
50
+ screen MarkOverdue
51
+ action MarkOverdue for screen
48
52
  slice StateChange PayInvoice
49
53
  command PayInvoice
50
54
  invoiceId InvoiceId identifier
51
55
  produces event InvoicePaid
56
+ screen PayInvoice
57
+ action PayInvoice for screen
52
58
  slice StateChange SendReminder
53
59
  command SendReminder
54
60
  invoiceId InvoiceId identifier
55
61
  produces event ReminderSent
62
+ screen SendReminder
63
+ action SendReminder for screen
56
64
  slice StateChange WriteOffInvoice
57
65
  command WriteOffInvoice
58
66
  invoiceId InvoiceId identifier
59
67
  produces event InvoiceWrittenOff
68
+ screen WriteOffInvoice
69
+ action WriteOffInvoice for screen
60
70
  slice StateView InvoiceStatus
61
71
  readmodel Invoice
62
72
  invoiceId InvoiceId key
@@ -136,7 +146,8 @@ workflow CollectOverdue
136
146
  `at`, `manual`), `action <Name> sends <Command> [attempts n] [timeout] [retry after]`,
137
147
  `decide <Name> when <condition>` with exactly two outlets, `wait` for an event or a
138
148
  duration, `approval <Name> by <Persona or Policy>`, `foreach <Name> over <collection>` and
139
- `join all|any|at least n`. Edges are `<outlet> -> <Node>` under their node.
149
+ `join all|any|at least n`. Edges are `<outlet> -> <Node>` under their node; a workflow
150
+ outlet is a node's outcome, unrelated to a template's UI outlet.
140
151
  - An unconnected negative outlet (`failed`, `rejected`, `expired`) fails the run; an
141
152
  unconnected positive outlet ends that branch. Give every event wait and approval an
142
153
  `expires after` (PLAY0849 warns otherwise).
@@ -70,6 +70,8 @@ module Courses
70
70
  constraint OneResultPerEnrolment
71
71
  unique event CoursePassed
72
72
  unique event CourseFailed
73
+ screen RecordCompletion
74
+ action RecordCompletion for screen
73
75
  specification RecordingAPass
74
76
  given caller
75
77
  authenticated
@@ -47,6 +47,8 @@ module Exams
47
47
  memberId MemberId
48
48
  produces event ExamBooked
49
49
  memberId MemberId = memberId
50
+ screen BookExam
51
+ action BookExam for screen
50
52
  specification BookingAnExam
51
53
  given caller
52
54
  authenticated
@@ -110,6 +110,8 @@ module Onboarding
110
110
  workspaceId WorkspaceId
111
111
  produces event InvitationAccepted
112
112
  workspaceId WorkspaceId = workspaceId
113
+ screen AcceptInvitation
114
+ action AcceptInvitation for screen
113
115
  slice StateChange SendWelcomeMail
114
116
  command SendWelcomeMail
115
117
  workspaceId WorkspaceId identifier
@@ -215,6 +217,8 @@ module Collections
215
217
  invoiceId InvoiceId
216
218
  amount Decimal
217
219
  sentAt DateTime
220
+ screen SendInvoice
221
+ action SendInvoice for screen
218
222
  slice StateChange CloseInvoice
219
223
  command CloseInvoice
220
224
  invoiceId InvoiceId identifier
@@ -155,6 +155,8 @@ module Finance
155
155
  slice StateChange RecordContact
156
156
  command RecordContact
157
157
  name ContactName
158
+ screen RecordContact
159
+ action RecordContact for screen
158
160
  ```
159
161
 
160
162
  A top-level `purpose` has optional singleton `description`, `basis` (optional
@@ -79,6 +79,8 @@ module Work
79
79
  produces TaskClosed
80
80
  for taskId
81
81
  reason = "done"
82
+ screen CloseTask
83
+ action CloseTask for screen
82
84
  specification ClosingAnUnknownTask
83
85
  when CloseTask
84
86
  taskId = "missing"
@@ -70,6 +70,8 @@ module Retention
70
70
  produces event WindowKept
71
71
  from DateTime = from
72
72
  to DateTime = to
73
+ screen KeepWindow
74
+ action KeepWindow for screen
73
75
  specification AcceptingEqualInstantsWithDifferentOffsets
74
76
  when KeepWindow
75
77
  windowId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -28,6 +28,8 @@ module Invoices
28
28
  for invoiceId
29
29
  event LateFeeApplied
30
30
  amount Decimal
31
+ screen ApplyLateFee
32
+ action ApplyLateFee for screen
31
33
  ```
32
34
 
33
35
  A pending `implementation` has no `file` or fence. Bare `implementation` is valid;
@@ -23,6 +23,8 @@ module Invoicing
23
23
  status InvoiceStatus
24
24
  produces event InvoiceSent
25
25
  status InvoiceStatus = status
26
+ screen SendingInvoice
27
+ action SendInvoice for screen
26
28
  specification Sending
27
29
  when SendInvoice
28
30
  invoiceId = "6f9619ff-8b86-d011-b42d-00c04fc964ff"
@@ -29,6 +29,8 @@ module Projects
29
29
  ```
30
30
  tag audit
31
31
  name ProjectName = name
32
+ screen RenameProject
33
+ action RenameProject for screen
32
34
  ````
33
35
 
34
36
  The omitted `for` means the command's required scalar identifier **only for
@@ -64,6 +64,8 @@ module Projects
64
64
  projectId ProjectId identifier
65
65
  produces OpenCostCenter
66
66
  projectId = projectId
67
+ screen Register
68
+ action RegisterProject for screen
67
69
  specification Compensating
68
70
  given operation OpenCostCenter fails
69
71
  when RegisterProject
@@ -58,6 +58,8 @@ module Newsletter
58
58
  authorize PublicAccess
59
59
  produces event SubscriberSignedUp
60
60
  email EmailAddress = email
61
+ screen SubscribeToNewsletter
62
+ action SubscribeToNewsletter for screen
61
63
  specification SubscribingWithoutAnIdentity
62
64
  when SubscribeToNewsletter
63
65
  subscriberId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -47,6 +47,8 @@ module Stock
47
47
  quantity = Current.quantity
48
48
  event Allocated
49
49
  quantity Int
50
+ screen Allocate
51
+ action Allocate for screen
50
52
  ```
51
53
 
52
54
  ## Admission and paths
@@ -59,6 +59,8 @@ module Shop
59
59
  returns
60
60
  customerId = customerId
61
61
  inviteCode = inviteCode
62
+ screen Register
63
+ action RegisterCustomer for screen
62
64
  specification RegistersWithPinnedValues
63
65
  when RegisterCustomer
64
66
  for "cus_01ARZ3NDEKTSV4RRFFQ69G5FAV"
@@ -83,6 +85,8 @@ module Shop
83
85
  invoiceNumber InvoiceNumber = invoiceNumber
84
86
  pickupTicket TicketNumber = pickupTicket
85
87
  returns orderId
88
+ screen Place
89
+ action PlaceOrder for screen
86
90
  specification PlacesWithPinnedValue
87
91
  given clock "2026-10-02T09:00:00Z"
88
92
  when PlaceOrder
@@ -43,6 +43,8 @@ module Library
43
43
  produces DocumentCreated
44
44
  for id
45
45
  owner = owner
46
+ screen CreateDocument
47
+ action CreateDocument for screen
46
48
  slice StateChange RenameDocument
47
49
  command RenameDocument
48
50
  id DocumentId identifier
@@ -57,6 +59,8 @@ module Library
57
59
  title = title
58
60
  event DocumentRenamed
59
61
  title String
62
+ screen RenameDocument
63
+ action RenameDocument for screen
60
64
  specification OwnerRenames
61
65
  given DocumentCreated
62
66
  for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -89,6 +93,8 @@ module Library
89
93
  for id
90
94
  event DocumentReviewed
91
95
  event ReviewIndependent
96
+ screen ReviewDocument
97
+ action ReviewDocument for screen
92
98
  specification IndependentReview
93
99
  when ReviewDocument
94
100
  id = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -89,6 +89,8 @@ module Moorings
89
89
  damage DamageDescription
90
90
  produces event HullDamageReported
91
91
  damage DamageDescription = damage
92
+ screen ReportHullDamage
93
+ action ReportHullDamage for screen
92
94
  specification ReportingScratchedBow
93
95
  when ReportHullDamage
94
96
  berthNumber = "A-12"
@@ -154,6 +154,8 @@ module Moorings
154
154
  authorize IsHarbourmaster
155
155
  produces event BerthAssigned
156
156
  berthNumber BerthNumber = berthNumber
157
+ screen AssignBerth
158
+ action AssignBerth for screen
157
159
  specification AssigningABerthAsHarbourmaster
158
160
  given caller
159
161
  authenticated
@@ -30,6 +30,8 @@ module Invoicing
30
30
  invoiceNumber InvoiceNumber = invoiceNumber
31
31
  registeredAt DateTime = $context.occurred
32
32
  event InvoiceSent
33
+ screen RegisterInvoice
34
+ action RegisterInvoice for screen
33
35
 
34
36
  slice StateView InvoiceList
35
37
  readmodel InvoiceListReadModel
@@ -65,6 +65,8 @@ module Cloakroom
65
65
  unique ticketNumber on CoatTakenIn
66
66
  released by CoatHandedBack
67
67
  message "That ticket number is already in use"
68
+ screen TakeInCoat
69
+ action TakeInCoat for screen
68
70
  specification TakingInACoat
69
71
  given caller
70
72
  authenticated
@@ -122,6 +124,8 @@ module Cloakroom
122
124
  require CoatStatus.onHook == true
123
125
  message "That coat is not on a hook"
124
126
  produces event CoatHandedBack
127
+ screen HandBackCoat
128
+ action HandBackCoat for screen
125
129
  specification HandingBackACoat
126
130
  given caller
127
131
  authenticated
@@ -98,6 +98,8 @@ module Visits
98
98
  reason VisitReason
99
99
  produces event VisitBooked
100
100
  reason VisitReason = reason
101
+ screen BookVisit
102
+ action BookVisit for screen
101
103
  specification BookingATypicalVisit
102
104
  when TypicalBooking
103
105
  petId = "3f2a1b0c-9d8e-4f7a-b6c5-d4e3f2a1b001"
@@ -131,6 +133,8 @@ module Visits
131
133
  description "Pass 0. Evidence: E1"
132
134
  command BookVisit
133
135
  produces event VisitBooked
136
+ screen BookVisit
137
+ action BookVisit for screen
134
138
  ```
135
139
 
136
140
  ## 3. Asking during extraction
@@ -89,8 +89,8 @@ editing. Existing standalone `screenplay mcp` users may retain that entry point.
89
89
  skipped completeness checks are not passes. Details: `references/mcp-tools.md`.
90
90
  5. Echo `sourceRevision` on subsequent pages. Restart the query after drift;
91
91
  never combine pages from different snapshots.
92
- 6. For screens, also discover the template, form, toolbar, package/icon and
93
- outlet declarations that provide context. A component binding with no traced
92
+ 6. For screens, also discover the template (its slots and outlets), form,
93
+ toolbar and package/icon declarations that provide context. A component binding with no traced
94
94
  data source is not a shortcut; fix the model source.
95
95
 
96
96
  Scope reads to the relevant container/document, not the whole merged AST.
@@ -150,6 +150,8 @@ module Projects
150
150
  name not empty message "Project name is required"
151
151
  produces event ProjectRegistered
152
152
  name ProjectName = name
153
+ screen RegisterProject
154
+ action RegisterProject for screen
153
155
  specification RegisteringAProject
154
156
  when RegisterProject
155
157
  projectId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -25,7 +25,7 @@
25
25
  - Formatting and recovery limits
26
26
  - Code attachments
27
27
 
28
- The standalone MCP server lists 46 tools from Screenplay 4.228.0 (including the MCP-Apps visualization tool); `tools/list` is the authority for the installed server, and the CLI-bundled MCP (`cratis screenplay mcp`) can be an older Screenplay that lacks newer tools.
28
+ The standalone MCP server lists 47 tools from Screenplay 6.0 (including the MCP-Apps visualization tool and `migrate`); `tools/list` is the authority for the installed server, and the CLI-bundled MCP (`cratis screenplay mcp`) can be an older Screenplay that lacks newer tools.
29
29
 
30
30
  The supported CLI launch is `cratis screenplay mcp <model-root>`, or `cratis screenplay mcp`
31
31
  alone inside a project, where the CLI reuses existing model/workspace roots.
@@ -74,6 +74,7 @@ the [MCP loop](mcp-loop.md).
74
74
  | Planning | `propose-source`, `propose-ast`, `propose-rename`, `propose-move`, `propose-repair`, `propose-property`, `propose-number-enum-members`, `propose-extract-inline-event`, `propose-inline-event`, `propose`, `recommend-layout`, `expand-layout` | Produce validated, reviewable candidates without writing them |
75
75
  | Review | `read-proposal`, `discard-proposal` | Inspect exact changes, dropped comments and proposed attachments, or abandon a connection-local proposal |
76
76
  | Reference execution | `run-specifications` | Run the workspace or a retained proposal candidate read-only; not attached code or target tests |
77
+ | Version migration | `migrate` | Read-only: report what `screenplay migrate --from <major> [--to <major>]` rewrites and, for a named `document`, its migrated source to write through a proposal (`cratis-screenplay-modeling-lifecycle`) |
77
78
  | Effects | `apply`, `recover-workspace` | Apply an accepted plan or explicitly recover an interrupted write |
78
79
 
79
80
  `propose-move` moves a slice to another feature, a feature to another module or feature, or a single command, event, read model, projection, query, reaction or capture to another slice, keeping identities: copy the `target` and `newParent` `{kind, parts}` addresses from the identity inventory (`newParent` is the destination slice for a declaration) and pass `expectedRevision` and `expectedCatalogRevision`. It repairs qualified references and `depends on`, and refuses identity loss, collisions, descendant destinations, name capture (a reference that would resolve to a different declaration), inherited authorization or screen-interaction changes and glob imports; review `moveReport` (`identityMigrations`, `referenceRepairs`, `fragmentsMoved`, and `specificationsCarried` for a declaration). It does not rename events, change pins or move files. Use it for legacy re-slicing instead of retyping declarations. Its report document fields are plain strings, not nested identity objects.
@@ -61,7 +61,7 @@ For a new canonical application this usually creates or changes:
61
61
  - module/feature/slice documents;
62
62
  - read models and queries that supply screen data;
63
63
  - screen declarations with Level 1 data/actions;
64
- - templates, components, forms, toolbar items, outlets and navigation bindings;
64
+ - templates and their slots, components, forms, toolbar items, outlets, `fits` and navigation bindings;
65
65
  - localized `$strings` keys referenced by labels.
66
66
 
67
67
  Use `referencePolicy: "Safe"` unless unresolved debt is explicitly part of the
@@ -144,40 +144,43 @@ edit.
144
144
  Requires cratis CLI 3.44.0 or later (`cratis --version`) for `cratis render --check`.
145
145
 
146
146
  For screens-release parity, the smoke check must assert that every authored
147
- screen, template, component, form, toolbar, outlet, route and package/icon use is
147
+ screen, template, slot, component, form, toolbar, outlet, hook, route and package/icon use is
148
148
  represented in the generated plan or runtime diagnostics. A consumer that cannot
149
149
  implement one reports a blocking diagnostic. Silent fallback to the default screen
150
150
  composition is a failure.
151
151
 
152
152
  ## Edit the application shell
153
153
 
154
- Navigation regions, toolbar buttons, blueprint template references and sample data are typed nodes and follow the same
155
- open, read, propose, review, apply, reopen loop; the syntax and rules are in
154
+ Requires Screenplay 6.0 or later. Slots, outlets, hooks, blueprint template references and sample data are typed nodes
155
+ and follow the same open, read, propose, review, apply, reopen loop; the syntax and rules are in
156
156
  `cratis-screenplay-ui-composition` (`references/application-shell.md`). The vectors to replay against are the
157
- `screen-shell-navigation-positive` source case and its rejection vectors in `Cratis.Screenplay.CanonicalCorpus`.
158
-
159
- 1. `read-ast` with `kind` `NavigationRegionSyntax`, `NavigationItemSyntax`, `ToolbarButtonSyntax`,
160
- `TemplateAssignmentSyntax`, `ScreenTemplateReferenceSyntax` or `SampleDataPackSyntax`, `includeContent: true`.
161
- Select the occurrence by its parent: a region belongs to the `LayoutSyntax` or a `ModuleSyntax`, and the same item id
162
- can appear in several regions.
163
- 2. `propose-ast` with `replace` (copy the returned node, change `mode`, `items`, `slice`, `version` or a row value),
164
- `add` to a member the node kind declares (`navigation`, `items`, `children`, `buttons`) or `remove`. A member that
165
- holds nothing is not in the node JSON; `add` still accepts it.
157
+ `screen-shell-navigation-positive` source case and its rejection vectors in `Cratis.Screenplay.CanonicalCorpus`. A model
158
+ still written for Screenplay 5 is migrated first (`screenplay migrate --from 5 --to 6`, or the MCP `migrate` tool); never
159
+ hand-edit the old forms into the new ones through proposals.
160
+
161
+ 1. `read-ast` with `kind` `OutletSyntax`, `NavigationItemSyntax`, `ToolbarButtonSyntax`, `TemplateAssignmentSyntax`,
162
+ `ScreenTemplateReferenceSyntax` or `SampleDataPackSyntax`, `includeContent: true`. Select the occurrence by its
163
+ parent: an outlet sits in the `outlets` member of a `LayoutSyntax`, `ScreenTemplateSyntax`, `DialogTemplateSyntax`,
164
+ `ModuleSyntax`, `FeatureSyntax` or `ScreenSyntax`, and the same outlet name and item id appear at several levels.
165
+ 2. `propose-ast` with `replace` (copy the returned node, change its `mode`, `items`, `hides`, a button's `slice`,
166
+ `opens` or `enabledWhen`, a screen's `fits`, a `version` or a row value), `add` to a member the node kind declares
167
+ (`outlets`, `items`, `children`) or `remove`. A member that holds nothing is not in the node JSON; `add` still
168
+ accepts it. Resolve member names with `syntax-schema`, not from this prose.
166
169
  3. Read the proposal's diagnostics before applying. A refusal such as `PLAY0750` (a module item targeting another
167
- module), `PLAY0762` (a button on a State View slice), `PLAY0722` (a blueprint no profile lists) or `PLAY0714` (an
168
- unknown active pack) is the answer; change the proposal, not the rule.
170
+ module), `PLAY0903` (an outlet nothing declares), `PLAY0905` (a repeated item id), `PLAY0762` (a hook on a State
171
+ View slice), `PLAY0911` (a slot the slice's screen does not fit), `PLAY0722` (a blueprint no profile lists) or
172
+ `PLAY0714` (an unknown active pack) is the answer; change the proposal, not the rule.
169
173
  4. `apply` with both revisions. A `StaleRevision` means the model moved: reopen, re-read the nodes and propose again.
170
- 5. Switching a module from inherit to override copies the application's items; retarget each copy to the module's own
171
- features first or the proposal is refused.
174
+ 5. Switching a module's outlet from inherit to override copies the inherited items; retarget each copy to the module's
175
+ own features first or the proposal is refused.
172
176
 
173
- ### Feature and module toolbars
177
+ ### Buttons shared by a feature's screens
174
178
 
175
- A feature (or module) toolbar is a `ScreenToolbarSyntax` in the `toolbars` member of its `FeatureSyntax` (or `ModuleSyntax`);
176
- `syntax-schema` for `FeatureSyntax` lists `toolbars`. `add` a `ScreenToolbarSyntax` with `name`, `items` and `buttons` to the
177
- feature, and `replace` a `ToolbarButtonSyntax` or `ToolbarItemSyntax` to set its `confirm` text; `remove` takes a button away.
178
- Read the proposal's diagnostics: a warning says an `item ... action` names a command no slice of that feature (or module)
179
- declares. The syntax, the `confirm` rule and when to prefer the feature toolbar are in `cratis-screenplay-ui-composition`
180
- (`references/application-shell.md`, "Feature and module toolbars"; Screenplay 4.238.0 or later).
179
+ Buttons shared by every screen of a feature extend the template's actions outlet: `add` an `OutletSyntax` with the
180
+ outlet's `name`, mode `extends` and its `ToolbarButtonSyntax` items to the feature's `outlets`, and `replace` a button to
181
+ set its `confirm`, `runs`, `opens` or `enabledWhen`; `remove` takes one away. `PLAY0903` means the template declares no
182
+ such outlet. The syntax and when to choose an outlet over a screen toolbar are in `cratis-screenplay-ui-composition`
183
+ (`references/application-shell.md`, "Outlets of actions, filters, tabs and stats" and "Hooks").
181
184
 
182
185
  ### The profile's shell
183
186
 
@@ -192,7 +195,7 @@ cannot start a screen). `PLAY0796` (an option the shell does not expose) and `PL
192
195
  the proposal is accepted and `ui-profiles` shows them. Replay against the `ui-profile-root-positive` vector and its rejection
193
196
  vectors (`ui-profile-root-unknown`, `ui-profile-root-not-a-shell`, `ui-profile-root-invalid`) in `Cratis.Screenplay.CanonicalCorpus`.
194
197
 
195
- Requires Screenplay 4.188.0 or later (`screenplay --version`) to `add` the first region, button or sub-item to a member
198
+ Requires Screenplay 4.188.0 or later (`screenplay --version`) to `add` the first outlet, item or sub-item to a member
196
199
  the node JSON omits while empty; an older MCP server answers "Unknown typed syntax member".
197
200
 
198
201
  ## 6. Use Screenplay-owned fixtures
@@ -111,6 +111,8 @@ module Moorings
111
111
  insurer String
112
112
  produces event BoatInsuranceRecorded
113
113
  insurer String = insurer
114
+ screen RecordBoatInsurance
115
+ action RecordBoatInsurance for screen
114
116
  ```
115
117
 
116
118
  A new screen is described in words (what it shows, which action it offers). Screen design belongs
@@ -38,6 +38,8 @@ module Moorings
38
38
  for berthId
39
39
  name BerthName = name
40
40
  maxLength BoatLength = maxLength
41
+ screen RegisterBerth
42
+ action RegisterBerth for screen
41
43
  specification RegisteringABerth
42
44
  given caller
43
45
  authenticated
@@ -62,6 +64,8 @@ module Moorings
62
64
  for berthId
63
65
  name BerthName = name
64
66
  maxLength BoatLength = maxLength
67
+ screen UpdateBerth
68
+ action UpdateBerth for screen
65
69
 
66
70
  slice StateView BerthList
67
71
  readmodel BerthSummary
@@ -194,6 +198,8 @@ module Moorings
194
198
  for berthId
195
199
  name BerthName = name
196
200
  maxLength BoatLength = maxLength
201
+ screen RegisterBerth
202
+ action RegisterBerth for screen
197
203
  specification RegisteringABerth
198
204
  given caller
199
205
  authenticated
@@ -225,6 +231,8 @@ module Moorings
225
231
  produces event BerthLengthLimitRaised
226
232
  for berthId
227
233
  maxLength BoatLength = newMaxLength
234
+ screen RaiseBerthLengthLimit
235
+ action RaiseBerthLengthLimit for screen
228
236
  specification RaisingTheLimit
229
237
  given caller
230
238
  authenticated
@@ -107,7 +107,11 @@ assume visibly unattended and never rerun completed phases.
107
107
  ## Run protocol: stop or assume
108
108
  1. **Start**: read STATE.md; check the source identity; load the phase skill before authoring
109
109
  or judging; read the slice, specs and skill fully before concluding something is missing.
110
- Discover tool capabilities once per session (`cratis-screenplay-toolchain`). One brief per
110
+ Discover tool capabilities once per session (`cratis-screenplay-toolchain`). **A model older
111
+ than the compiler's major is migrated before any edit**: a Screenplay 5 model runs
112
+ `screenplay migrate <model-root> --from 5 --to 6` as its own change, then compiles clean.
113
+ Read `references/version-migration.md` when a model writes a retired form or the compiler
114
+ names `screenplay migrate`. One brief per
111
115
  turn, one closed outcome: `references/per-turn-protocol.md`. Read `references/per-turn-protocol.md` when running a long-lived or delegated session that receives one brief at a time.
112
116
  2. **Scope**: only the addresses and phase the brief names; other defects go in the packet.
113
117
  One authoring agent per model root; reviewers and explainers are read-only.
@@ -0,0 +1,50 @@
1
+ # Migrate a model before editing it
2
+
3
+ Requires Screenplay 6.0 or later (`screenplay --version`) for `screenplay migrate` and the MCP `migrate` tool.
4
+
5
+ A Screenplay major version retires forms without a deprecation period: the old form is an error whose message names the
6
+ replacement and the migration that writes it, for example
7
+ `run 'screenplay migrate --from 5 --to 6' to rewrite the model (slots and outlets)`. Editing such a model by hand mixes
8
+ two changes in one diff and loses what the migration reports for review, so migrate first, as its own change.
9
+
10
+ ## When
11
+
12
+ - The compiler reports a retired-form code (`PLAY0890`-`PLAY0896`), `PLAY0026` on a template `toolbar` slot that holds
13
+ buttons, or any message naming `screenplay migrate`.
14
+ - The model still writes a Screenplay 5 form: a region declared as `outlet <name>` with no kind, `destination outlet`,
15
+ `navigation topbar|sidebar`, `<slot> contributes <Point>`, or a `toolbar <name>` on a feature or module.
16
+ - The project records that its model targets Screenplay 5 and the installed compiler is 6.
17
+
18
+ A file does not say which version it was written for, so the author or the project decides `--from`.
19
+
20
+ ## How
21
+
22
+ 1. Start from a clean working tree under the model root, so the migration is the only diff.
23
+ 2. Preview: `screenplay migrate <model-root> --from 5 --to 6 --dry-run --report .ai-work/<task>/migrate.json`.
24
+ 3. Run: `screenplay migrate <model-root> --from 5 --to 6`. A folder migrates every `.play` file beneath it as one
25
+ application; never migrate one file of a split model on its own unless the brief names it.
26
+ 4. Read the exit code:
27
+
28
+ | Exit | Meaning | Next |
29
+ | --- | --- | --- |
30
+ | `0` | Every file migrated and compiles warning-free with Screenplay 6 | Review the diff, then compile |
31
+ | `2` | A file needs review, or the result still has compiler errors | Decide each review item (below), then compile |
32
+ | `1` | The migration could not run (bad argument, no files, no step chain, a file a step could not rewrite) | Fix the cause; the files that could not be rewritten are unchanged |
33
+
34
+ 5. Decide every review item the report lists, with its file and line. Common ones: a template slot that holds items and
35
+ something else (place the rest with a screen's `fits`, or remove it); a toolbar `item <name> action|navigate|dialog`
36
+ in a feature toolbar (write a `button ... slice <Slice>` hook or remove it); a `logo` below the layout (only the layout
37
+ declares it).
38
+ 6. `screenplay <model-root> --warnaserror` is clean, and `screenplay test <model-root>` passes as before.
39
+ 7. Record the migration as its own change (commit, or a separate proposal through MCP), then start the requested edit.
40
+
41
+ Through MCP, the `screenplay` server's `migrate` tool takes `from`, an optional `to` and an optional root-relative
42
+ `document`. It is read-only: it returns the report and, for a named document, the migrated source to write through the
43
+ usual file tools or a proposal. The VS Code command **Screenplay: Migrate document** migrates the open document.
44
+
45
+ ## Never
46
+
47
+ - Never hand-translate the old forms instead of running the migration: it prints only the lines it changes and keeps
48
+ comments, alignment and every other line byte for byte.
49
+ - Never accept a review item silently or leave the model with the errors the migration reported.
50
+ - Never edit Stage-managed output to match; render again from the migrated model.
@@ -40,6 +40,8 @@ module Berths
40
40
  constraint OneBerthPerBoat
41
41
  unique boat on BerthAllocated
42
42
  message "That boat already holds a berth"
43
+ screen AllocateBerth
44
+ action AllocateBerth for screen
43
45
 
44
46
  specification AllocatingABerth
45
47
  given caller
@@ -4,6 +4,8 @@
4
4
  "fixtures": [],
5
5
  "assertions": [
6
6
  { "kind": "play-compiles" },
7
+ { "kind": "skill-contains", "value": "`screenplay migrate <model-root> --from 5 --to 6`" },
8
+ { "kind": "skill-contains", "value": "Never hand-translate the old forms", "file": "references/version-migration.md" },
7
9
  { "kind": "skill-contains", "value": "record it as a `question` note anchored to the element" },
8
10
  { "kind": "skill-contains", "value": "`refs: [{ \"id\": \"D123\" }]`", "file": "references/stop-or-assume.md" },
9
11
  { "kind": "skill-contains", "value": "`by: \"external-decision\"`", "file": "references/stop-or-assume.md" },
@@ -43,6 +43,8 @@ module Work
43
43
  for resource
44
44
  month = month
45
45
  hours = hours
46
+ screen Record
47
+ action Record for screen
46
48
  ```
47
49
 
48
50
  ## Fix
@@ -75,6 +77,8 @@ module Work
75
77
  for resource
76
78
  month = month
77
79
  hours = hours
80
+ screen Record
81
+ action Record for screen
78
82
  ```
79
83
 
80
84
  When instances already exist under their own identity and another event only enriches them, use a [join](joins.md) instead: it updates the existing instances and never creates one. There is no automatic repair from a reducer to a projection.
@@ -269,10 +269,11 @@ Constructs: `title`, `data … via query … [by <param>]`, `action <Command>` w
269
269
  `label` and `navigate to <Screen> [by <param>]`, `section <name>`,
270
270
  `table <target>` with `column <property> [label]` and
271
271
  `on row-click navigate to <Screen> [by <param>]`, `summary <ReadModel>` with
272
- `field <property> label`, and `template <Name>` with slot bodies.
272
+ `field <property> label`, `template <Name>` with slot bodies, `show <Screen> by <param> from <table>.selection`
273
+ in a slot body, and `fits dialog, drawer, pane` (where a State Change screen opens; `cratis-screenplay-ui-composition`).
273
274
 
274
275
  The screen's `data` and `action` declarations are the typed context for later UI
275
- composition. Component `context`, toolbar parameters, dialog inputs, outlet routes
276
+ composition. Component `context`, toolbar parameters, dialog inputs, slot routes
276
277
  and manual form columns must all trace back to this screen contract, a form's
277
278
  command, a selected item, or `$context`. If a generated app shows a default list
278
279
  or empty panel because it could not consume one of those directives, treat that as
@@ -344,7 +345,7 @@ binding failures are errors.
344
345
  - [ ] A reducer-built view's `by` type matches its events' event-source identity (`PLAY0690`).
345
346
  - [ ] No screen reference is left ambiguous or unresolved.
346
347
  - [ ] Every UI binding that consumes screen data (component context, toolbar
347
- parameter, dialog input, outlet route) has a source in the screen contract
348
+ parameter, dialog input, slot route) has a source in the screen contract
348
349
  or an explicitly provided template/form context.
349
350
 
350
351
  Read `SKILL.md` in `cratis-screenplay-toolchain` when choosing a tool, reading installed versions, or assessing executable and renderable subsets. Where a construct sits in the
@@ -357,6 +358,6 @@ Read [screen patterns](references/screen-patterns.md) when deciding whether a sc
357
358
  Attribution and licences: `references/provenance.md`.
358
359
 
359
360
  - How events fill the read model: `cratis-screenplay-projections`.
360
- - Layouts, templates, forms, component bindings, toolbars and slice buttons, outlets, contributions, navigation regions, sample data, packages and themes: `cratis-screenplay-ui-composition`.
361
+ - Layouts, templates, forms, component bindings, toolbars, hooks and placement, slots, outlets, contributions, sample data, packages and themes: `cratis-screenplay-ui-composition`.
361
362
  - Asserting query results: `cratis-screenplay-specifications`.
362
363
  - Deciding which read models exist: `cratis-screenplay-event-modeling`.