@cratis/pi 7.23.0 → 7.24.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 (79) hide show
  1. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
  2. package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +5 -5
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +3 -3
  4. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +1 -1
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +1 -1
  6. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +1 -1
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -3
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +1 -1
  9. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +6 -5
  10. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +1 -1
  11. package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +5 -4
  12. package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +1 -1
  13. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +1 -1
  14. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +7 -4
  15. package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +8 -7
  16. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +2 -2
  17. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +10 -0
  18. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +1 -2
  19. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +1 -1
  20. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +1 -1
  21. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +4 -4
  22. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
  23. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -4
  24. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +14 -6
  25. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +71 -8
  26. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +15 -6
  27. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +1 -1
  28. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +10 -9
  29. package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +5 -1
  30. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +1 -1
  31. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +2 -2
  32. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +7 -5
  33. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +4 -4
  34. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +1 -1
  35. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +24 -19
  36. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +1 -1
  37. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +4 -2
  38. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  39. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +15 -9
  40. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +4 -1
  41. package/package/corpus/skills/cratis-screenplay-read-surface/references/guarded-actions.md +4 -0
  42. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +4 -3
  43. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +1 -1
  44. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +3 -3
  45. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +25 -9
  46. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +1 -1
  47. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +5 -0
  48. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +7 -4
  49. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +1 -1
  50. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +1 -1
  51. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +1 -1
  52. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +12 -7
  53. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -3
  54. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -2
  55. package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +87 -0
  56. package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +1 -1
  57. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -2
  58. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +8 -8
  59. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +3 -3
  60. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +9 -3
  61. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +22 -5
  62. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +59 -1
  63. package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +117 -0
  64. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +1 -1
  65. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +14 -13
  66. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +3 -3
  67. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +3 -2
  68. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +14 -11
  69. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +2 -2
  70. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +49 -0
  71. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +6 -3
  72. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +4 -4
  73. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +10 -0
  74. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +4 -2
  75. package/package/corpus/skills/cratis-screenplay-ui-composition/references/guarded-interactions.md +71 -0
  76. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +5 -2
  77. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +17 -6
  78. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +1 -1
  79. package/package.json +1 -1
@@ -73,7 +73,7 @@ are, is `cratis-screenplay-modeling-lifecycle` ("Decide the level first").
73
73
  4. Existing code has no authority over the contract.
74
74
 
75
75
  Precedence inside the contract. Executable parts of the contract beat prose: specifications,
76
- mappings, constraints and authorization first; then the `description` and realization notes;
76
+ mappings, constraints and authorization first; then the `description`, `documentation` and realization notes;
77
77
  then issue text. If prose contradicts an executable part, that is a model defect: stop that
78
78
  scope, return an **edit request** (address, change, reason) and do not pick a side silently.
79
79
  Reading a question is not resolving it. Details: `references/contract-and-precedence.md`.
@@ -23,11 +23,11 @@ or the unmanaged extension code.
23
23
 
24
24
  ## Precedence (highest first)
25
25
  1. Executable parts: specifications, mappings, constraints, authorization, rules.
26
- 2. The slice `description` and realization notes: they explain intent and never license a
27
- contradiction or an undocumented default. Realization notes are the explicit realization
28
- requirements stated in a description: they bind adapters and fallback code, cannot contradict
29
- executable parts, and are never supplemented with inferred rules; other description prose is
30
- only a hint.
26
+ 2. The slice `description`, its fenced `documentation`, and realization notes: they explain intent
27
+ and never license a contradiction or an undocumented default. Realization notes are the explicit
28
+ realization requirements stated in the `description` or `documentation`: they bind adapters and
29
+ fallback code, cannot contradict executable parts, and are never supplemented with inferred
30
+ rules; other prose is only a hint.
31
31
  3. Issue or ticket text.
32
32
  4. Existing code: no authority.
33
33
 
@@ -56,7 +56,7 @@ Outcomes:
56
56
 
57
57
  When a todo list is not needed: the effect is immediate, internal and cannot fail (a direct
58
58
  `produces` or co-production), and nobody needs to see pending work. Say why in the slice
59
- `description`; do not add a list just to follow a pattern.
59
+ `documentation`; do not add a list just to follow a pattern.
60
60
 
61
61
  ## 3. Effects: `produces` vs `invokes`
62
62
  | | `produces <Fact>` | `invokes <Command>` |
@@ -80,8 +80,8 @@ not identity inferred from prose or an imperative pipeline call.
80
80
  Decide and record one of:
81
81
  1. **Internal ungated command** - only if the security design supports it: not reachable by
82
82
  outside callers in the target (verify; the model cannot show exposure), safe to repeat
83
- (guarded by `unique event`), and touching one stream. State the reasons in the module
84
- `description` (as `todo-list-example.md` does) and list "not externally exposed" as a target
83
+ (guarded by `unique event`), and touching one stream. State the reasons in module
84
+ `documentation` (the historical `todo-list-example.md` used a description) and list "not externally exposed" as a target
85
85
  requirement in `STATE.md`.
86
86
  2. **Direct `produces`** - when no decision is left (the fact is already decided) and nothing
87
87
  should refuse it.
@@ -38,7 +38,7 @@ One spec in the slice does not cover the others.
38
38
  | invalid | unknown code, wrong type | `translate` has no entry -> decide and specify |
39
39
  | changed / corrected | outside value changes after our fact | correction fact or open decision (`translation-patterns.md` §6) |
40
40
  | mis-correlated | reference points at the wrong stream | property constraint on the external reference, or an expert review case |
41
- | personal data | field we must not keep | excluded from the append mappings; note in `description`; the source record may still carry it |
41
+ | personal data | field we must not keep | excluded from the append mappings; record the reason in `documentation`; the source record may still carry it |
42
42
  | authenticity / ownership | wrong source, tenant or entity reference | specify the rejection and name where it is enforced; capture metadata does not verify it |
43
43
  | each mapping branch | every recognized code has its intended local meaning | concrete payload and exact translated values; unknown code is a separate case |
44
44
  | same object, different occurrence | two legitimate events share a provider object id | both stay representable; dedup hits only the repeated occurrence |
@@ -70,7 +70,7 @@ See "Effect guarantees and recovery traps" in SKILL.md.
70
70
  the target's replay behaviour before relying on it, and record the answer.
71
71
  See "Effect guarantees and recovery traps" in SKILL.md.
72
72
 
73
- ## What to write down (slice `description` + `STATE.md`)
73
+ ## What to write down (slice `documentation` + `STATE.md`)
74
74
  - Effect placement (1-4) and why. Placement 4 is syntax-only: say the model then has no
75
75
  executable form.
76
76
  - The idempotency key, and whether the outside system honours it.
@@ -1,7 +1,7 @@
1
1
  # Integration contracts
2
2
 
3
3
  Use before completing a new or changed translation. Keep accepted decisions in the relevant
4
- `.play` descriptions and specs; open questions and target requirements go to `STATE.md`. Do
4
+ `.play` `documentation` and specs; open questions and target requirements go to `STATE.md`. Do
5
5
  not create a second canonical model.
6
6
 
7
7
  ## Resolve only the unknowns
@@ -17,14 +17,16 @@ with `cratis-screenplay-render-and-gap-fill`.
17
17
  | Model element | Realization | Skill |
18
18
  |---|---|---|
19
19
  | reaction `when <Event>` with `invokes` or `produces` | Chronicle reactor returning commands or events | `cratis-chronicle-reactor` |
20
- | trusted actor for `invokes` | `[ExecuteCommandsAsSystem("<role>")]` on the reactor plus a policy requiring the role (Arc, since v20.56.0; available in a rendered app's Arc 22.25.0) | `cratis-chronicle-reactor` |
20
+ | trusted actor for `invokes` | `[ExecuteCommandsAsSystem("<role>")]` on the reactor plus a policy requiring the role (Arc, since v20.56.0; available in Stage 4.51.3's rendered Arc 22.50.5) | `cratis-chronicle-reactor` |
21
21
  | clock trigger, application trigger | scheduler or host signal that raises the occurrence | `cratis-engineering-effect-boundaries` |
22
22
  | call to an outside system | adapter behind an effect boundary, keyed by the idempotency key in the model | `cratis-engineering-effect-boundaries` |
23
23
  | capture source (webhook, poll, topic) | adapter that authenticates, parses and appends | `cratis-engineering-effect-boundaries` |
24
24
  | replay versus recovery redelivery | `[OnceOnly]` for replay; a receipt keyed by `ReactorDelivery.Id` for recovery | `cratis-chronicle-reactor` |
25
25
 
26
- `[ProtectedDecision]` (Arc v22.39.0 and later) is not available in a Stage-rendered app (Arc
27
- 22.25.0), and `Directory.Packages.props` there is Stage-managed: do not edit it to get a newer Arc.
26
+ Stage 4.51.3 rendered apps pin Arc 22.50.5/Chronicle 19.32.0, so
27
+ `[ProtectedDecision]` and `DecisionRead<T>` are available to gap-fill, not
28
+ Stage-emitted enforcement. Admit the projection/key and enroll the read in the
29
+ active unit of work; never edit managed `Directory.Packages.props`.
28
30
 
29
31
  ## Faithful realization
30
32
  A realization may choose the reactor, scheduler or queue mechanism. It may not: drop pending
@@ -33,7 +33,7 @@ thing by it. Keep it as a property when it is needed to correlate or deduplicate
33
33
  `<X>WebhookReceived` are smells; a business fact such as `PaymentReceived` is fine).
34
34
 
35
35
  ## 4. Per-field disposition
36
- For every field of the outside record, decide and write in the slice `description`:
36
+ For every field of the outside record, decide and write in slice `documentation`:
37
37
  | Disposition | Meaning | Screenplay |
38
38
  |---|---|---|
39
39
  | **map** | carried into our fact as is or translated | `map` + mapping `x = $.x`; `translate` for codes |
@@ -88,7 +88,8 @@ to reach the intended result." With a brief, restate domain and goal in two sent
88
88
 
89
89
  **Unattended: assume visibly.** Never stop to ask. Take the most reasonable assumption,
90
90
  record it with its reason in the session STATE.md (`.ai-work/screenplay/<model-slug>/STATE.md`,
91
- untracked) and, when it shapes the model, in the feature `description`. Keep what the user
91
+ untracked) and, when it shapes the model, in the feature's fenced `documentation` (a short
92
+ **ASSUMED** marker may stay in its `description`). Keep what the user
92
93
  decided apart from what you assumed. Never guess silently.
93
94
 
94
95
  ## Procedure
@@ -111,7 +112,7 @@ decided apart from what you assumed. Never guess silently.
111
112
  a set-aside, an open question, or "does not apply, because ...". Unattended: model a lens
112
113
  fact only when the input implies it; otherwise record an open question.
113
114
  5. **Plot: order and branch** (`references/plotting-and-handoff.md`). Walk from the first
114
- trigger to every end. In each event's slice `description` record what it comes **after**,
115
+ trigger to every end. In each event's slice `documentation` record what it comes **after**,
115
116
  what **causes** it (persona, schedule, outside party, other fact) and what it is **only
116
117
  allowed under** (intent). At every event ask what can happen next *instead*, including
117
118
  nothing, and which next steps may happen in any order. Classify forks: *outcome branch* (one
@@ -151,7 +152,7 @@ decided apart from what you assumed. Never guess silently.
151
152
  matches alphabetically. Unimported folder files remain visible after ranked siblings.
152
153
  MCP `expand-layout` preserves this order with import barrels; an import-less
153
154
  `PlayFileWriter.Expand` layout falls back to path order. Order is presentation, not
154
- execution or identity. Keep causes and branches in the feature `description` and STATE.md.
155
+ execution or identity. Keep causes and branches in the feature `documentation` and STATE.md.
155
156
  - A misspelt keyword inside a slice is only warning PLAY0029 and the block disappears: always
156
157
  validate with warnings as errors.
157
158
 
@@ -159,7 +160,7 @@ decided apart from what you assumed. Never guess silently.
159
160
  - An event is a fact the business wants to remember: past tense, business verb, two to four
160
161
  words, specific (`BerthAssigned`, not `BerthUpdated`). No generic edit events.
161
162
  - One business decision usually yields one event; several facts recognised separately may
162
- yield several, with the reason in the slice `description`.
163
+ yield several, with the reason in slice `documentation`.
163
164
  - Calculated values are views, not events, unless the calculation is itself a decision the
164
165
  business must be able to show later (a quoted price, a fee set for the season).
165
166
  - Personas are roles with a purpose. A read-only persona is legitimate; a role that neither
@@ -169,7 +170,7 @@ decided apart from what you assumed. Never guess silently.
169
170
  - A hand-over from an outside party is named as the fact we learn from it
170
171
  (`MooringPermitGranted`). If most of a story is the outside party's steps, model only what
171
172
  crosses to us.
172
- - A rule that depends on stored state goes into the `description` of the slice it constrains
173
+ - A rule that depends on stored state is recorded in `documentation` on the slice it constrains
173
174
  (`only if ...`), marked as stated intent not enforced in the model today, with its target
174
175
  enforcement named for `cratis-screenplay-streams-and-consistency` and
175
176
  `cratis-screenplay-slice-design`. Never state copies, attestation booleans or rules living
@@ -56,7 +56,7 @@
56
56
  - Optional event properties: the default is none. Chronicle warns on nullable event
57
57
  properties (CHR0012) and a specification cannot state `null` for an event value (PLAY0350).
58
58
  Make the value required, or record the second situation as its own event. Keep `optional`
59
- only for a detail the business genuinely may not have, with the reason in the `description`.
59
+ only for a detail the business genuinely may not have, with the reason in event `documentation`.
60
60
  - Does the event restate the creation event's fields (a generic edit in disguise)? Ask which
61
61
  business change it records; if none, name the specific correction or drop it.
62
62
  - Never put personal data in the event-source id; one data subject per event.
@@ -38,7 +38,7 @@ that decision. If not, note the need as a view and move on.
38
38
  ## Unattended runs
39
39
 
40
40
  - Never block on a question. Take the most reasonable assumption, record it in STATE.md with
41
- why, and mark it in the feature `description` when it shapes the model.
41
+ why, and record it in feature `documentation` when it shapes the model.
42
42
  - Prefer assumptions that keep the model honest (fewer, clearly named facts) over ones that
43
43
  invent detail.
44
44
 
@@ -52,6 +52,7 @@ See "Evidence and privacy" in SKILL.md.
52
52
  4. List assumptions taken.
53
53
  5. Per workflow give the happy path, the decision points and the terminal facts in a few lines.
54
54
  6. Propose the next step: the next workflow, or `cratis-screenplay-slice-design` for this one.
55
- 7. Update STATE.md (phase, status, carry-forward); keep durable rationale in model
56
- `description` text, which is rendered and queryable; `//` comments survive printing at
57
- Screenplay v4.66.0, but check the dropped-comments report after any edit that cannot retain them.
55
+ 7. Update STATE.md (phase, status, carry-forward); keep durable rationale in fenced Markdown
56
+ `documentation`, summaries in `description`. At 4.127.0 canonical printing retains
57
+ documentation on its owner; MCP exposes it, but it changes no `modelRevision` and
58
+ reaches no rendered code. Inspect dropped comments after canonicalizing edits.
@@ -142,7 +142,7 @@ lists non-human causes (schedules, outside parties) separately.
142
142
  - Ask everywhere: "What happens next instead, including nothing?"
143
143
 
144
144
  Do not get stuck on exact timing; the point is the logical flow. The agent keeps the feature
145
- `description` story line and after / caused by / only if in the slices current
145
+ `documentation` story line and after / caused by / only if in the slices current
146
146
  (`plotting-and-handoff.md`).
147
147
 
148
148
  ### 6. Sweep and close (15 to 20 minutes)
@@ -28,7 +28,7 @@ assumption you take instead of asking.
28
28
  | Hotspots | Where does this go wrong, get disputed or need workarounds today? | Focuses depth | per hotspot: what happened the last time? |
29
29
  | Competition | Can two parties want the same thing at the same moment? | Uniqueness rules, competing claims | yes: who wins, and what does the other see? |
30
30
  | On behalf | Does anyone do this for someone else, or override it? | Authority and denial | yes: may they, and must we record who acted? |
31
- | In any order | After this, which next steps must wait for each other and which need not? | Ordering, later automations | they need not: say so in the feature description |
31
+ | In any order | After this, which next steps must wait for each other and which need not? | Ordering, later automations | they need not: say so in the feature `documentation` |
32
32
  | Instead | At this point, what else could happen instead, including nothing? | Branches and endings | "nothing": does it expire or wait forever? |
33
33
 
34
34
  ## Interview flow
@@ -61,8 +61,8 @@ into exactly one of these:
61
61
 
62
62
  1. **Executable.** An `authorize` gate with a role, claim or authenticated policy the persona
63
63
  does not satisfy, or an ownership policy (`claim "x" matches subject|<command property>`),
64
- plus a `then denied` specification whose `given caller` carries the roles and claims that
65
- stand for that persona (`cratis-screenplay-scenario-coverage`). Every command and query
64
+ plus a `then denied` specification using `given caller as <Persona>` for a
65
+ synthesized witness, or an explicit effective-gate caller (`cratis-screenplay-scenario-coverage`). Every command and query
66
66
  under an inherited module or feature `authorize` gets its own denial spec. Ownership
67
67
  against a Uuid-backed identifier is not renderable today (STAGE-ESM-015): note it.
68
68
  2. **Gap or target requirement.** The check depends on stored state ("only the requester may
@@ -74,8 +74,11 @@ into exactly one of these:
74
74
  Anything not yet resolved is an open question. Do not write Cannot lines for rules that bind
75
75
  everyone (business rules, not authority).
76
76
 
77
- A spec that passes is not a persona check by itself: it proves the gate refuses a caller with
78
- those roles and claims. Say which fixture stands for which persona.
77
+ A passing spec proves the gate refuses that caller, not every caller fitting a
78
+ persona. `given caller as <Persona>` chooses one authenticated policy witness;
79
+ inspect its `or` choice. Use explicit fixtures for anonymous callers, ownership
80
+ claims, missing gate conjuncts or refused synthesis. Name which witness stands
81
+ for which persona.
79
82
 
80
83
  ## Cannot resolved to an executable gate
81
84
 
@@ -13,8 +13,9 @@
13
13
 
14
14
  Plotting arranges the discovered events as a narrative: what happens first, what depends on
15
15
  what, what can happen instead, where it ends. In Screenplay the plot is written into the
16
- model (slice and feature `description` text) and into STATE.md; files sort by name, so story
17
- order is never carried by structure.
16
+ model (fenced `documentation` on slices and features) and into STATE.md. Board order is the
17
+ authored declaration and import order; it is presentation, not causation, so write causes and
18
+ dependencies down.
18
19
 
19
20
  ## 1. Sequence
20
21
 
@@ -23,7 +24,7 @@ what came before it, what made it happen, what is it only allowed under?
23
24
 
24
25
  ## 2. Record after / caused by / only if
25
26
 
26
- Write these three into the `description` of the `StateChange` slice that produces the event:
27
+ Write these three into the `documentation` of the `StateChange` slice that produces the event:
27
28
 
28
29
  ```text
29
30
  After: BerthRequested
@@ -48,7 +49,7 @@ At every event, not only at forks someone mentions:
48
49
 
49
50
  - What can happen next *instead*, including nothing? Does "nothing" expire, or wait forever?
50
51
  - Which next steps may happen in any order, and which must wait for each other? Unordered
51
- successors become automations or ordering specs later; say so in the feature description.
52
+ successors become automations or ordering specs later; say so in the feature `documentation`.
52
53
  - On failure or refusal, what compensates, and is the refusal itself a fact the business must
53
54
  remember (a decision) or just a rejection (a scenario later)?
54
55
 
@@ -62,7 +63,7 @@ thing from the views that listed it).
62
63
 
63
64
  ## 4. Plot output format
64
65
 
65
- Put a compact story line in the feature `description` and report the plot per workflow:
66
+ Put a compact story line in the feature `documentation` and report the plot per workflow:
66
67
 
67
68
  ```text
68
69
  The plot: SeasonalBerths
@@ -92,7 +93,7 @@ Switch only at a genuine handoff (a boat owner requests a berth, then the Harbou
92
93
  act on it) or as a deliberate cutaway to show what another persona sees. A change to another
93
94
  persona's read model is not automatically a new beat; it earns one only when that persona
94
95
  would look at it as the next step. Do not alternate personas for symmetry. Carry each real
95
- handoff into the feature `description` and the slice-design handoff packet; a cutaway is
96
+ handoff into the feature `documentation` and the slice-design handoff packet; a cutaway is
96
97
  marked as such there.
97
98
 
98
99
  ```text
@@ -105,7 +106,7 @@ Alternating: Harbourmaster, BoatOwner, Harbourmaster, BoatOwner with no handoff
105
106
  When the story is about a *view* rather than a stream (a waiting list, a work queue, a berth
106
107
  board), a set of isolated before/after pairs hides what the user cares about: the same read
107
108
  model changing over time. Note it as one narrated walkthrough in STATE.md and the feature
108
- `description`: empty, then an item added, then the item done or failed, then removed, naming
109
+ `documentation`: empty, then an item added, then the item done or failed, then removed, naming
109
110
  the event that causes each step. It is a seed only; discovery writes no specification.
110
111
  `cratis-screenplay-scenario-coverage` turns it into cumulative lifecycle specifications on
111
112
  the read model, and `cratis-screenplay-automations-and-translations` owns the work-queue
@@ -29,7 +29,7 @@ then reports what changed and asks one question. The user should always be able
29
29
  | rename | better business name for an existing fact | identity-affecting once persisted: see SKILL.md |
30
30
  | split | one name was covering two facts | keep the original if it is persisted; add the second |
31
31
  | merge | two names for one fact | only when they truly mean the same thing |
32
- | reorder | the story order changed | change declaration/import order for the board; update the feature `description`/STATE.md for causes and branches |
32
+ | reorder | the story order changed | change declaration/import order for the board; update the feature `documentation`/STATE.md for causes and branches |
33
33
  | drop | not a fact after all | record why in STATE.md |
34
34
  | none | already modeled | say so briefly |
35
35
 
@@ -68,7 +68,7 @@ What a model looks like after the first workflow has been stormed: no commands,
68
68
  or screens yet. Slices are named after the command expected to produce each event. At
69
69
  Screenplay 4.125.0, boards use authored declaration/import order, and MCP `expand-layout`
70
70
  preserves it with imports. An import-less `PlayFileWriter.Expand` layout still falls back to
71
- path order. Order is presentation only; the feature `description` records causes and branches.
71
+ path order. Order is presentation only; the feature `documentation` records causes and branches.
72
72
  Persona `description` text holds Does / Reads / Cannot on one quoted line here; the multi-line fenced
73
73
  form is in `personas-and-causes.md`.
74
74
 
@@ -191,6 +191,16 @@ do not assume; it lands as `module`, `persona` and `import`; protocol in
191
191
  `cratis-screenplay-discovery`). Phase 2 designs one workflow at a time through all nine steps
192
192
  ([nine-steps.md](references/nine-steps.md): activities, Screenplay output, questions).
193
193
 
194
+ ## Keep modeling reasoning with its declaration
195
+
196
+ Use `description` for summaries and fenced Markdown `documentation` on modules,
197
+ features, slices, commands, read models and reactions (also events) for assumptions,
198
+ boundaries and rejected alternatives. Do not leave that reasoning only in comments
199
+ or disconnected notes. Both are report-only (PLAY0270), never executable rules.
200
+ Specifications use `description` to name the witnessed behavior; longer reasoning
201
+ belongs to their slice. Syntax, merge rules and diagnostics:
202
+ [model reasoning](../cratis-screenplay-slice-design/references/model-reasoning.md).
203
+
194
204
  ## The prime directive: do not lose information
195
205
 
196
206
  Store what happened (events), not just current state. Events are immutable
@@ -215,8 +215,7 @@ reaction's `reads UnpaidInvoice` is report-only metadata at 4.66.0 (information
215
215
  it does not make the model consult the view. Binding therefore admits only a scheduled
216
216
  invocation that records a timestamp. Choosing which invoices are overdue (due date before the
217
217
  clock instant) is a target-side decision: record it as gap-fill with the model as the
218
- contract (`cratis-screenplay-render-and-gap-fill`), and say so in the slice description as
219
- the example does. Do not claim the specification proves the overdue decision.
218
+ contract (`cratis-screenplay-render-and-gap-fill`), and say so in the slice `documentation`. Do not claim the specification proves the overdue decision.
220
219
 
221
220
  ```screenplay
222
221
  domain Acme.Invoicing
@@ -148,7 +148,7 @@ chain per slice before handoff (evidence template); never manufacture references
148
148
  `<Noun>Updated`): split by intent;
149
149
  - refusals: input or constraint rejection is `validate` / `require` / constraint plus
150
150
  `then error` with the exact message from code; authorization refusal is `authorize` plus
151
- `then denied`. Legacy HTTP codes and check order go in the description;
151
+ `then denied`. Legacy HTTP codes and check order go in the slice `documentation`;
152
152
  - a state-dependent rule is `reads <View>` + `require ... message "..."`, marked **NOT enforced
153
153
  in the model today**, target named; a unique index with business meaning becomes
154
154
  `unique ... on <every event that sets it>` with `released by`
@@ -31,7 +31,7 @@ and the question raised.
31
31
  One line per rule, named individually (never one generic platform caveat): the rule, its
32
32
  evidence row, the invariant and consistency risk, and the target enforcement. State-dependent
33
33
  checks are written as `reads` + `require` and marked NOT enforced in the slice description;
34
- date rules and opaque policies that no declaration can state stay in `description` and here.
34
+ date rules and opaque policies that no declaration can state stay in the slice `documentation` and here.
35
35
 
36
36
  ## Unknowns and undecided target decisions
37
37
  | Row/question | What is unknown | Who can answer | Candidate assumption |
@@ -4,19 +4,19 @@
4
4
  - Input or constraint rejection: declarative `validate`, `require` or constraint, plus a
5
5
  `then error "<exact legacy message>"` specification.
6
6
  - Authorization refusal: `authorize` with a policy (role, claim, authenticated, or an
7
- ownership policy) plus `then denied`, with caller fixtures carrying the roles or claims.
7
+ ownership policy) plus `then denied`, with a synthesized persona caller or an explicit effective-gate fixture.
8
8
  Every command and query under an inherited module or feature `authorize` gets its own
9
9
  `then denied` spec. A role gate with no executable form is a recorded gap.
10
10
  - Legacy HTTP status and check order (for example 409 before 403) are facts about the old
11
- system: record them in the slice description and the evidence row, not in the model logic.
11
+ system: record them in slice `documentation` and the evidence row, not in the model logic.
12
12
 
13
13
  ## State-dependent rules
14
14
  A rule that depends on stored state (current status, existing records, balances) is written
15
15
  as `reads <View>` + `require <expr> message "…"` and the slice description says it is **NOT
16
16
  enforced in the model today** (PLAY0268/0271 at binding are expected in design mode;
17
17
  Screenplay#129/#209). Name the invariant, the race it leaves open, and the target:
18
- `[ProtectedDecision]` + `DecisionRead<T>` (Arc 22.39.0 and later; hand-written code only,
19
- not available in Stage-rendered applications, which pin Arc 22.25.0), or a Chronicle
18
+ `[ProtectedDecision]` + `DecisionRead<T>` (Arc 22.39.0 and later; available to gap-fill
19
+ in Stage 4.51.3's Arc 22.50.5/Chronicle 19.32.0 package set, not automatically emitted), or a Chronicle
20
20
  `concurrency` scope on the event source or stream, or a constraint where one fits. Forbidden: caller-supplied copies of state
21
21
  in `require`, boolean inputs standing in for a rule (`confirmsX == true`), and rules hidden in
22
22
  `handler`/`implementation hint` prose. Descriptions are not rendered (Stage#178), so a rule
@@ -14,7 +14,7 @@ who decided it?* If nobody can answer, classify the row `unknown` and ask.
14
14
  |---|---|---|---|
15
15
  | One request writes several tables | one decision; one table carries the fact, the others are consequences | one event per table (`CheckinCreated`, `HookUpdated`) | one event named for the decision (`CoatTakenIn`); consequences become projections |
16
16
  | Generic update route (`PUT /members/{id}`) | several intents hidden behind one form | one `MemberUpdated` event | split by which columns change together and why (address change, suspension, renewal); ask experts. No `Update/Edit/Save<Noun>` command and no `<Noun>Updated/Changed` event; a full-payload `*Updated` event is the default generator output and a review signal |
17
- | Request with no table write and a 4xx status | a rejected attempt; evidence of a rule | Prologue models it like a success (status codes are ignored) and the merge can strip properties | `validate`/`require`/constraint plus a `then error` spec with the exact message from code (authorization refusals are `then denied`); legacy HTTP code and check order go in the slice description |
17
+ | Request with no table write and a 4xx status | a rejected attempt; evidence of a rule | Prologue models it like a success (status codes are ignored) and the merge can strip properties | `validate`/`require`/constraint plus a `then error` spec with the exact message from code (authorization refusals are `then denied`); legacy HTTP code and check order go in slice `documentation` |
18
18
  | 2xx with no table write | read, idempotent no-op, or external side effect | treated as a command | check code; classify |
19
19
  | Single-column unique index | a business uniqueness rule, or a technical key | every unique index becomes a constraint, or a clear business rule is dropped to a bare `rule` | when the meaning is clear, `unique <prop> on <every event that sets it>` plus `released by <removal event>`; list collation, case and reuse questions. Fall back to a bare `rule` only when no constraint form fits, and record that as a loss. A purely technical key stays out |
20
20
  | Foreign key | an identity relation between streams or read models | copying the parent id into every event | keep ids only where a consumer needs the value |
@@ -130,9 +130,9 @@ and applies; others send an edit request ([MCP loop](references/mcp-loop.md)).
130
130
  3. Prefer `propose-rename` for supported logical renames: it coordinates fragments,
131
131
  repairs proven references and preserves assigned identities. Never substitute
132
132
  global string replacement for an explicit refusal.
133
- 4. Use `propose-ast` for typed additions, replacements, removals and moves. Group
134
- related cross-file changes in one batch so no broken intermediate state lands.
135
- Parser-invalid source can be repaired by typed whole-document replacement.
133
+ 4. Use `propose-source` for whole text or `propose-ast` for typed edits
134
+ (Authoring defaults); `propose` is executable-only. Batch changes;
135
+ details: `references/mcp-tools.md`.
136
136
  5. Keep reference policy `Safe`. Use `Draft` only for deliberately requested
137
137
  unresolved model debt and report that debt; it does not waive structural,
138
138
  identity or binding-protection checks.
@@ -261,7 +261,8 @@ target or consequence expands.
261
261
  Readiness has two verdicts: `readiness.authoringAccepted` says the source is valid
262
262
  Screenplay; `executableReady` describes only the current executable subset. Do not
263
263
  call a model broken because it is not executable, and prefer `propose-ast` for
264
- full-language authoring. A rejected proposal lists its diagnostics: fix those, do not
264
+ focused full-language edits, or `propose-source` for whole documents. A rejected
265
+ proposal lists its diagnostics: fix those, do not
265
266
  retry the same input.
266
267
 
267
268
  ## Code attachments
@@ -102,14 +102,18 @@ the server sends `roots/list` and serves `tools/list` after the reply).
102
102
  `search-declarations`, `declaration-details`, `dependencies`/`dependency-graph`.
103
103
  Diagnostics `scope` includes descendants and direct dependents; `checks` opts
104
104
  into completeness warnings (skipped on whole-source errors). Paging with
105
- `offset > 0` requires `expectedSourceRevision`.
105
+ `offset > 0` requires `expectedSourceRevision`. Seed coverage with
106
+ `find-specification-obligations` (presence, not execution), use
107
+ `find-modeling-smells` as questions needing a domain consequence, and compare
108
+ generated/curated exported snapshots with `semantic-diff`.
106
109
  3. `open-workspace` and keep `revision` and `catalogRevision`. Opening writes
107
110
  nothing. With `identityPersistence: "root-local-on-apply"` the identities file
108
111
  is written only by `apply`.
109
112
  4. Choose the edit route (next section). For typed edits: `syntax-schema` for the
110
113
  node kind, then `read-ast` with `includeContent` for revision-bound handles.
111
114
  Never invent a handle.
112
- 5. Propose one coherent change (a slice works best): `propose-ast` with
115
+ 5. Propose one coherent change (a slice works best): `propose-source` for whole
116
+ `.play` text, `propose-ast` for focused typed edits, with
113
117
  `validation: "Authoring"`, `referencePolicy: "Safe"` (`Draft` only for
114
118
  deliberate, reported gaps), `formatting: "PreserveTrivia"` for value and mapping
115
119
  patches, otherwise `CanonicalizeTouchedDocuments` (reprints the touched files).
@@ -140,7 +144,11 @@ the server sends `roots/list` and serves `tools/list` after the reply).
140
144
  2. **Prefer typed, identity-preserving operations**: `propose-rename` for renames
141
145
  (keeps `id` pins and assigned identities, refuses on ambiguity),
142
146
  `propose-repair`, `propose-extract-inline-event`, `propose-ast` for additions,
143
- replacements, removals and moves.
147
+ replacements, removals and moves. Use `propose-source` when authoring whole
148
+ documents as UTF-8 text, not base64 or typed node JSON; `propose` remains the
149
+ executable-only exact-byte interface. Both authoring routes require revisions,
150
+ formatting consent and identity continuity. `SourceParseFailed` returns located
151
+ `authoringDiagnostics` without a proposal. Details: `mcp-tools.md`.
144
152
  3. **Bounded text edits** are fine only where no catalog address changes (table below). With
145
153
  `.screenplay/identities.json`, adding, removing or renaming a declaration, a property of a
146
154
  command, event, read model, composite type or trigger, a query, a query argument or a
@@ -162,10 +170,10 @@ the server sends `roots/list` and serves `tools/list` after the reply).
162
170
  | --- | --- | --- |
163
171
  | Address-preserving | descriptions; bodies of rules and expressions; mappings between members that already exist; any edit that adds, removes or renames no addressed element. Also every edit in a model with no `.screenplay/identities.json` except persisted names | bounded text edit of the `.play` file, then compile the folder; or `propose-ast` |
164
172
  | Catalog-changing (identity file present) | add, remove or rename a declaration (slice, command, event, read model, projection, ...), a property of a command, event, read model, composite type or trigger, a query, a query argument or a specification; create, delete, rename or move a mapped `.play` document (McpState refuses reopening with `IdentityMappingConflict`; use document operations in `propose-ast`); rename, remove or move an event, command, read model, constraint, module, feature or slice; move declarations between files; contract evolution of a persisted event (new generation, property added, removed or retyped) | `propose-rename` or a reviewed `propose-ast`; never a blind text rename. Renaming a constraint resets its uniqueness index: ask first unless the request names it, then report the reset. A persisted event rename needs `id "OldName"` (added by default) |
165
- | Repair | `PLAY0166`, `0478`, `0469`, `0471`, `0479`, `0516`, `0565`, `0653` (and recipe-only `0397`) | `propose-repair` with `formatting`; PLAY0166/0478 may pin attachment evidence (`pinRepairEvidence` and `expectedRepairEvidenceRevision`), never fix-all PLAY0478 |
173
+ | Repair | `PLAY0166`, `0478`, `0469`, `0471`, `0479`, `0516`, `0563`, `0564`, `0565`, `0614`, `0653` (and recipe-only `0397`) | `propose-repair` with `formatting`; PLAY0166/0478 may pin attachment evidence (`pinRepairEvidence` and `expectedRepairEvidenceRevision`), never fix-all PLAY0478 |
166
174
  | Inline event extraction | `produces event ...` to a declared event | `propose-extract-inline-event` |
167
- | Parser-invalid document | no editable handles | `propose-ast` `replace-document` with a whole typed document, or fix the text |
168
- | Unadmitted constructs | systems/operations, exact numbers, refusal/redelivery | reviewed Authoring `propose-ast`; preserve intent and report PLAY0268 |
175
+ | Parser-invalid document | no editable handles | `propose-source` `replace-document` with corrected source, or typed `propose-ast` document replacement |
176
+ | Unadmitted constructs | systems/operations, exact numbers, refusal/redelivery | reviewed Authoring `propose-source` (whole documents) or `propose-ast` (typed edits); preserve intent and report PLAY0268 |
169
177
  | Admitted source/stream routing | ESM v8 at 4.125.0 | typed `propose-ast`; `propose-rename` repairs proven route references; target admission separate |
170
178
 
171
179
  ## Self-describing identity migration refusals