@cratis/pi 7.138.0 → 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 (81) hide show
  1. package/package/corpus/hooks/README.md +14 -4
  2. package/package/corpus/hooks/scripts/cratis-guard-shell-writes.sh +24 -6
  3. package/package/corpus/hooks/scripts/cratis-guard-writes.sh +48 -14
  4. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +2 -0
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +2 -0
  6. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/statemachines-and-workflows.md +12 -1
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +2 -0
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +2 -0
  9. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +4 -0
  10. package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +2 -0
  11. package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +2 -0
  12. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +2 -0
  13. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +2 -0
  14. package/package/corpus/skills/cratis-screenplay-command-surface/references/enum-numbers.md +2 -0
  15. package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +2 -0
  16. package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +2 -0
  17. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +2 -0
  18. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +2 -0
  19. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +4 -0
  20. package/package/corpus/skills/cratis-screenplay-command-surface/references/uuid-equality.md +6 -0
  21. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +2 -0
  22. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +2 -0
  23. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +2 -0
  24. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +4 -0
  25. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +4 -0
  26. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +2 -2
  27. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +2 -0
  28. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +2 -1
  29. package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +28 -25
  30. package/package/corpus/skills/cratis-screenplay-model-review/references/walkthrough.md +2 -0
  31. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +8 -0
  32. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +5 -1
  33. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/version-migration.md +50 -0
  34. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +2 -0
  35. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +2 -0
  36. package/package/corpus/skills/cratis-screenplay-projections/references/reducer-identity.md +4 -0
  37. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +5 -4
  38. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +2 -2
  39. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +2 -0
  40. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
  41. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +7 -0
  42. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +9 -0
  43. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +8 -0
  44. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +2 -0
  45. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -1
  46. package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +2 -0
  47. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -0
  48. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +2 -0
  49. package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +2 -0
  50. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +2 -0
  51. package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +2 -0
  52. package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +2 -0
  53. package/package/corpus/skills/cratis-screenplay-specifications/references/whitespace-rules.md +4 -0
  54. package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +2 -0
  55. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +6 -0
  56. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +2 -0
  57. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +8 -0
  58. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -0
  59. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +2 -0
  60. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +6 -0
  61. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +1 -1
  62. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +1 -1
  63. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +2 -0
  64. package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +4 -0
  65. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +4 -0
  66. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +1 -1
  67. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +16 -0
  68. package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +2 -0
  69. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +6993 -2979
  70. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  71. package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +2 -0
  72. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +55 -70
  73. package/package/corpus/skills/cratis-screenplay-ui-composition/references/action-subjects.md +4 -1
  74. package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md +304 -136
  75. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +46 -31
  76. package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +2 -2
  77. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +9 -9
  78. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +2 -0
  79. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +4 -0
  80. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +4 -0
  81. package/package.json +1 -1
@@ -189,7 +189,8 @@ Dependency manifests, including `package.json`, retain their origin/opt-in allow
189
189
  **every simple command must be on this read-only allowlist**:
190
190
 
191
191
  Only the following **exact options** are exempt, because they select/present reads rather
192
- than create files or invoke helpers. Any other option denies, including long-option
192
+ than create files or name helpers. Repository configuration can still run helpers for
193
+ allowed Git verbs. Any other option denies, including long-option
193
194
  abbreviations and unlisted `--option=value` forms. `--` ends option checking; remaining
194
195
  arguments are operands. A lone `-` is a stdin operand. Value-free short flags may combine
195
196
  (e.g. `grep -ni`); value-taking forms must use the explicitly listed spelling.
@@ -200,24 +201,33 @@ arguments are operands. A lone `-` is a stdin operand. Value-free short flags ma
200
201
  | `head`, `tail` | `-n N`, `-nN`, `-c N`, `-N` (numeric counts); no `-f` |
201
202
  | `wc` | `-l -w -c -m` |
202
203
  | `ls` | `-l -a -A -1 -h -d -R -t -r -F` |
204
+ | `rg` | `-n` only; no long options |
203
205
  | `grep`, `egrep`, `fgrep` | `-n -i -r -R -l -L -c -v -w -x -F -E -H -h -o -q -s`; `-e PATTERN`, `-A N`, `-B N`, `-C N`; no long options |
204
206
  | `echo` | `-n -e -E` |
205
207
  | `printf`, `test`, `[`, `true`, `false`, `pwd` | None (in particular, no `printf -v`) |
206
208
  | `git status` | `-s -b --short --porcelain` |
207
- | `git diff` | `--stat --name-only --name-status --cached --staged --check -p -U<N> --no-color` |
209
+ | `git diff` | `--stat --numstat --name-only --name-status --cached --staged --check -p -U<N> --no-color` |
208
210
  | `git log` | `--oneline --stat --name-only -n N -nN -<N> -p --no-color --format=<fmt> --pretty=<fmt> --follow` |
209
211
  | `git show` | `--stat --name-only -p --no-color --format=<fmt>` |
210
212
  | `git add` | `-A -u -p` |
211
213
  | `git commit` | `-m MSG`, `-mMSG`, `-a`, `-q`; `-F FILE` only for a literal non-protected file; no `--no-verify` |
212
214
  | `git blame`, `ls-files`, `rev-parse`, `check-ignore`, `grep` | None |
213
215
 
214
- No global git options are exempt (`-C`, `-c`, `--no-pager` etc. deny before the subcommand).
216
+ The only global Git option exemption is a single separate `-C <dir>` with a literal,
217
+ non-empty directory word not starting with `-`, followed by exactly one of these tails:
218
+ `status --short`, `rev-parse HEAD`, `branch --show-current`, or `tag --list <pattern>`.
219
+ The tag tail takes exactly one pattern not starting with `-` (for example, `'*7.321*'`).
220
+ No extra words are accepted. Attached `-Cdir`/`-C=dir`, repeated `-C`, other verbs and
221
+ all other global options (`-c`, `--git-dir`, `--work-tree`, `--no-pager`, `--exec-path`, etc.)
222
+ remain denied. `-C` gives **no protection** from a hostile repository's configuration:
223
+ fsmonitor, hooks, pager and diff/textconv helpers can still run. This is a syntax filter,
224
+ not a repository sandbox.
215
225
  Git format values containing `%(` are not accepted. Index/commit operations are deliberate
216
226
  allowances, not general shell execution permission. Output-to-file options such as
217
227
  `git diff --output=...` are never exempt, even with a non-protected destination on a line
218
228
  that references a protected file.
219
229
 
220
- `gh` (all subcommands), `rg`, `ag`, `sort`, `uniq`, `cut`, `jq`, `yq`, `less`, `more`, `stat`,
230
+ `gh` (all subcommands), `ag`, `sort`, `uniq`, `cut`, `jq`, `yq`, `less`, `more`, `stat`,
221
231
  `file`, `diff`, `cmp`, checksum tools, `realpath`, `dirname`, `basename`, `which` and `type`
222
232
  are not on this list: their option surfaces are deliberately not analysed here.
223
233
 
@@ -42,14 +42,16 @@ function candidate(s) {
42
42
  # A generic attached option prefix must not hide a path spelling (-t.pi/...).
43
43
  if (s ~ /^-/ && match(s, /[.\/]/) && RSTART > 1) candidate(substr(s, RSTART))
44
44
  }
45
- function scan(s, n, i, c, word) {
45
+ function scan(s, n, i, c, word, whole) {
46
46
  n = length(s)
47
47
  for (i = 1; i <= n; i++) {
48
48
  c = substr(s, i, 1)
49
49
  if (c ~ /[ \t\n\r;|&<>()\047"`$=\\]/) { candidate(word); word = "" }
50
50
  else word = word c
51
+ if (c ~ /[ \t\n\r;|&<>()\047"`$]/) { candidate(whole); whole = "" }
52
+ else whole = whole c
51
53
  }
52
- candidate(word)
54
+ candidate(word); candidate(whole)
53
55
  # Braces have a second boundary view; retain the original pattern above too.
54
56
  if (s ~ /[{}]/) { gsub(/[{}]/, " ", s); scan(s) }
55
57
  }
@@ -98,8 +100,9 @@ function endword() {
98
100
  } else {
99
101
  if (++argc > 256) bad = 1
100
102
  W[argc] = word
103
+ globbed[argc] = glob
101
104
  }
102
- word = ""; inword = 0
105
+ word = ""; inword = glob = 0
103
106
  }
104
107
  # Each exemption permits only the reviewed read/presentation options below. No unknown
105
108
  # options, long-option abbreviations or implicit value-taking short clusters are accepted.
@@ -152,15 +155,27 @@ function options_allowed(verb, first, i, w) {
152
155
  }
153
156
  return 1
154
157
  }
158
+ # Only git -C <literal-dir> status --short, rev-parse HEAD, branch --show-current,
159
+ # or tag --list <pattern> are exempt, with exact arity; no other global option is.
160
+ # -C gives no protection from hostile repository config (fsmonitor, hooks, pager,
161
+ # diff/textconv helpers). This filter checks syntax, not repository trust.
162
+ function directory_metadata() {
163
+ if (argc < 5 || W[3] == "" || W[3] ~ /^-/ || globbed[3]) return 0
164
+ if (argc == 5) return (W[4] == "status" && W[5] == "--short") || (W[4] == "rev-parse" && W[5] == "HEAD") || (W[4] == "branch" && W[5] == "--show-current")
165
+ return argc == 6 && W[4] == "tag" && W[5] == "--list" && W[6] !~ /^-/
166
+ }
155
167
  function allow_command( verb, first) {
156
168
  if (!argc) return
157
169
  if (++commands > 64) { bad = 1; return }
158
170
  verb = W[1]; first = 2
159
- # No global git option is exempt, including -C, -c and --no-pager.
171
+ if (verb == "git" && W[2] == "-C") {
172
+ if (!directory_metadata()) bad = 1
173
+ return
174
+ }
160
175
  if (verb == "git") { verb = verb " " W[2]; first = 3 }
161
176
  if (!(verb in verbs) || !options_allowed(verb, first)) bad = 1
162
177
  }
163
- function command_end() { endword(); allow_command(); delete W; argc = 0 }
178
+ function command_end() { endword(); allow_command(); delete W; delete globbed; argc = 0 }
164
179
  function readonly(s, i, c, c2, sq, dq) {
165
180
  for (i = 1; i <= length(s); i++) {
166
181
  c = substr(s, i, 1); c2 = substr(s, i + 1, 1)
@@ -171,6 +186,8 @@ function readonly(s, i, c, c2, sq, dq) {
171
186
  # Expansions and globs can supply option words the per-verb tables never see.
172
187
  if (c == "`" || c == "$") bad = 1
173
188
  if (dq) { word = word c; continue }
189
+ # Directory metadata requires a literal -C operand, not a pathname expansion.
190
+ if (c == "*" || c == "?" || c == "[") glob = 1
174
191
  # A glob that starts a word, or follows a leading dash, may expand to an option word.
175
192
  if ((c == "*" || c == "?" || c == "[") && (word == "" ? !(c == "[" && c2 ~ /[ \t]/) : substr(word, 1, 1) == "-")) bad = 1
176
193
  if (c == "#" && !inword) { while (i <= length(s) && substr(s, i, 1) != "\n") i++; c = "\n" }
@@ -196,13 +213,14 @@ BEGIN {
196
213
  policy("cat", "nAvetsb", "")
197
214
  policy("head", "", ""); policy("tail", "", "")
198
215
  policy("wc", "lwcm", ""); policy("ls", "laA1hdRtrF", "")
216
+ policy("rg", "n", "")
199
217
  policy("grep", "nirRlLcvwxFEHhoqs", "")
200
218
  policy("egrep", "nirRlLcvwxFEHhoqs", ""); policy("fgrep", "nirRlLcvwxFEHhoqs", "")
201
219
  policy("echo", "neE", "")
202
220
  policy("printf", "", ""); policy("test", "", ""); policy("[", "", "")
203
221
  policy("true", "", ""); policy("false", "", ""); policy("pwd", "", "")
204
222
  policy("git status", "sb", "--short --porcelain")
205
- policy("git diff", "p", "--stat --name-only --name-status --cached --staged --check --no-color")
223
+ policy("git diff", "p", "--stat --numstat --name-only --name-status --cached --staged --check --no-color")
206
224
  policy("git log", "p", "--oneline --stat --name-only --no-color --follow")
207
225
  policy("git show", "p", "--stat --name-only --no-color")
208
226
  policy("git add", "Aup", ""); policy("git commit", "aq", "")
@@ -193,30 +193,63 @@ control_patterns=('.claude/settings.json' '.claude/settings.local.json' '.mcp.js
193
193
 
194
194
  # Glob-language intersection, not expansion/eval. A star has an epsilon transition and
195
195
  # a character loop. The product automaton accepts iff the two patterns share a spelling.
196
- # Braces conservatively become a star; bracket classes retain their ordinary meaning.
196
+ # In a reference, everything from the first '{' to the last '}' becomes one star: brace
197
+ # expansion, however nested, quoted or escaped, only rewrites text inside that span. A
198
+ # reference bracket is never parsed: it is either a literal '[' or one any-character step
199
+ # to any later ']' in the same segment. Bash's reading is always one of those alternatives,
200
+ # so the class contents can only widen the match. References that mix braces with brackets,
201
+ # whose brace span holds '/', with anything but plain path characters outside the brace
202
+ # span (quoting, substitution and expansion syntax), or with dense brackets are not modeled at all: they fail closed (exit 2) so the work stays
203
+ # bounded.
197
204
  IFS= read -r -d '' glob_program <<'AWK' || true
198
- function tokens(s, side, i, c, j, t, n) {
205
+ function tokens(s, side, i, c, j, k, t, copy, jumps, first, closing) {
199
206
  s = tolower(s)
207
+ if (side == 1) {
208
+ copy = s
209
+ if (index(s, "{") && index(s, "[")) exit 2
210
+ if (gsub(/\[/, "[", copy) > 64) exit 2
211
+ first = index(s, "{")
212
+ for (k = length(s); k > first; k--) if (substr(s, k, 1) == "}") { closing = k; break }
213
+ if (first && closing) {
214
+ if (index(substr(s, first, closing - first + 1), "/")) exit 2
215
+ if (substr(s, 1, first - 1) substr(s, closing + 1) ~ /[^a-z0-9._\/*?,+=:@%-]/) exit 2
216
+ s = substr(s, 1, first) substr(s, closing)
217
+ }
218
+ }
200
219
  for (i = 1; i <= length(s); i++) {
201
- c = substr(s, i, 1); t = c
202
- if (c == "{") { j = index(substr(s, i), "}"); if (j) i += j - 1; t = "*" }
203
- else if (c == "[") {
204
- j = index(substr(s, i + 1), "]")
205
- if (j) { t = substr(s, i, j + 1); i += j; sub(/^\[!/, "[^", t) }
220
+ c = substr(s, i, 1); t = c; j = i
221
+ if (c == "{") {
222
+ j = index(substr(s, i), "}"); j = j ? i + j - 1 : i; t = "*"
223
+ if (side == 1 && index(substr(s, i, j - i + 1), "/")) exit 2
206
224
  }
207
225
  N[side]++; A[side, N[side]] = t
226
+ for (k = i; k <= j; k++) TOKEN[side, k] = N[side]
227
+ if (c == "[" && side == 1) START[N[side]] = i
228
+ i = j
229
+ }
230
+ TOKEN[side, length(s) + 1] = N[side] + 1
231
+ for (t = 1; t <= N[side]; t++) {
232
+ if (side != 1 || !(t in START)) continue
233
+ for (k = START[t] + 2; k <= length(s); k++) {
234
+ c = substr(s, k, 1)
235
+ if (c == "/") break
236
+ if (c != "]") continue
237
+ # A ']' inside a brace star re-enters that star, which covers the rest of it.
238
+ j = TOKEN[1, k] == TOKEN[1, k + 1] ? TOKEN[1, k] : TOKEN[1, k + 1]
239
+ if (++jumps > 4096) exit 2
240
+ JUMP[t, ++JUMPS[t]] = j
241
+ }
208
242
  }
209
243
  }
210
244
  function push(i, j, key) { key = i SUBSEP j; if (!(key in seen)) { seen[key] = 1; L[++last] = i; R[last] = j } }
211
245
  function accepts(t, c, side) {
212
- if (side == 1 && c == "/" && (t == "*" || t == "?" || length(t) > 1)) return 0
213
- return t == "*" || t == "?" || (length(t) > 1 && substr(t, 1, 1) == "[" ? c ~ ("^" t "$") : t == c)
246
+ if (side == 1 && c == "/" && (t == "*" || t == "?")) return 0
247
+ return t == "*" || t == "?" || t == c
214
248
  }
215
- function compatible(a, b, k, c) {
216
- if (length(a) == 1 && a != "*" && a != "?") return accepts(b, a, 2)
217
- if (length(b) == 1 && b != "*" && b != "?") return accepts(a, b, 1)
218
- for (k = 1; k < 256; k++) { c = sprintf("%c", k); if (accepts(a, c, 1) && accepts(b, c, 2)) return 1 }
219
- return 0
249
+ function compatible(a, b) {
250
+ if (a != "*" && a != "?") return accepts(b, a, 2)
251
+ if (b != "*" && b != "?") return accepts(a, b, 1)
252
+ return 1
220
253
  }
221
254
  BEGIN {
222
255
  tokens(ENVIRON["REF_LEFT"], 1); tokens(ENVIRON["REF_RIGHT"], 2); push(1, 1)
@@ -228,6 +261,7 @@ BEGIN {
228
261
  if (a == "*") push(i + 1, j)
229
262
  if (b == "*") push(i, j + 1)
230
263
  if (i <= N[1] && j <= N[2] && compatible(a, b)) push(i + (a != "*"), j + (b != "*"))
264
+ if (i <= N[1] && j <= N[2] && compatible("?", b)) for (k = 1; k <= JUMPS[i]; k++) push(JUMP[i, k], j + (b != "*"))
231
265
  }
232
266
  exit 1
233
267
  }
@@ -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.