@cratis/pi 7.6.0 → 7.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,12 +165,32 @@ Reviewability, not an arbitrary line count, triggers the next split. In a large
165
165
  model, one slice per file makes a scripted edit's blast radius visible in the
166
166
  diff instead of hiding cross-reference defects in a single enormous file.
167
167
 
168
- At the most granular layout, folders mirror the language, one folder per level:
169
- `application.play` at the root (`domain`, `import`, `concept`, `type`, `policy`,
170
- `persona`, `authentication`, `seed`), then `<Module>/<Module>.play`,
171
- `<Module>/…/<Feature>/<Feature>.play`, and `<Module>/…/<Slice>/<Slice>.play` for
172
- one slice, whole. A slice file restates its `module` and `feature`; nothing is
173
- written twice.
168
+ At the most granular layout, folders mirror the language, one folder per level,
169
+ and every level above the slices is a **barrel file** that declares its scope
170
+ and imports what is beneath it:
171
+
172
+ - `application.play` at the root holds `domain` and imports the rest:
173
+ `import "Shared/*.play"` for the files of `concept`, `type`, `policy`,
174
+ `persona`, `authentication` and `seed`, then one import per module file.
175
+ - `<Module>/<Module>.play` declares the module - `description`, `authorize`,
176
+ templates, forms - and its features. Either declare each feature inline and
177
+ import its folder (`feature Orders` / `import "Orders/*.play"`), or import one
178
+ `<Feature>/<Feature>.play` per feature.
179
+ - `<Feature>/<Feature>.play`, when a feature has its own file, declares the
180
+ feature and imports its slice files (`import "*.play"`) and any nested
181
+ feature's file.
182
+ - A slice file holds just its `slice`, at the top level. The import that brings
183
+ it in places it in its feature, so it does **not** restate `module` or
184
+ `feature` - the barrel above it already says where it belongs.
185
+
186
+ The root then reads as a table of contents, and every file is reachable from
187
+ it: `screenplay application.play` compiles exactly what the imports reach, and
188
+ a file no import reaches is not part of the application. Do not hand-write the
189
+ older merge-only layout, where barrels import nothing and every slice file
190
+ restates `module` and `feature` so the folder merges into one model. It compiles
191
+ as a folder, but the root says nothing about what the application holds and
192
+ every slice file repeats where it lives. The MCP `expand-layout` tool still
193
+ writes that layout; compose its output with imports when you take it over.
174
194
 
175
195
  **Compose focused files with imports** (v4.48.0, checked at tag `v4.48.0`,
176
196
  commit `3baf4a4`). `import "<path or glob>"` imports `.play` files relative to
@@ -197,8 +217,10 @@ module Ordering
197
217
 
198
218
  Every file is imported once. When a root glob and a module file both match a
199
219
  file, the deepest placement wins; two placements where neither lies inside the
200
- other are an error (`PLAY0457`), and so is a file placed in a module it does not
201
- restate (`PLAY0459`). `import Customers.CustomerRegistered` without quotes still
220
+ other are an error (`PLAY0457`), and so is a file that declares a module other
221
+ than the one it is placed in (`PLAY0459`). A placed file's top level holds only
222
+ what its scope can hold (`PLAY0460`) - a `screen template` belongs in the
223
+ module file, not in a slice file placed in a feature. `import Customers.CustomerRegistered` without quotes still
202
224
  names a contract from another bounded context.
203
225
 
204
226
  ⚠️ **Compile the folder, or its root file, as one application.**
@@ -42,6 +42,14 @@
42
42
  {
43
43
  "kind": "skill-contains",
44
44
  "value": "are accepted but\n**not available**"
45
+ },
46
+ {
47
+ "kind": "skill-contains",
48
+ "value": "every level above the slices is a **barrel file**"
49
+ },
50
+ {
51
+ "kind": "skill-contains",
52
+ "value": "it does **not** restate `module` or"
45
53
  }
46
54
  ]
47
55
  }
@@ -117,8 +117,21 @@ proposal. Layout is not application semantics.
117
117
  - Use one file per feature when nested features need separate review.
118
118
  - Use one file per slice when a large model needs isolated diffs.
119
119
 
120
+ Compose split files with quoted imports (`import "<path or glob>"`, v4.48.0).
121
+ Each level above the slices is a barrel file: `application.play` holds `domain`
122
+ and imports `Shared/*.play` and each module file; a module file declares the
123
+ module and its features, each feature importing its folder
124
+ (`import "Orders/*.play"`); a slice file holds only its `slice`, because the
125
+ import places it in its feature. When you write or reorganize files yourself,
126
+ do not restate `module`/`feature` in a slice file, and do not leave a barrel
127
+ that declares a scope but imports nothing. `expand-layout` still writes that
128
+ older merge-only layout; it compiles as a folder, and you can compose it with
129
+ imports afterwards. See the
130
+ [language reference](references/language-reference.md) for placement rules.
131
+
120
132
  Parent scaffolding carries no duplicated module forms or contributions. Compile
121
- and validate the whole `.cratis/screenplay/` folder, not just the edited fragment.
133
+ and validate the whole `.cratis/screenplay/` folder, or its root file, not just
134
+ the edited fragment.
122
135
 
123
136
  ## Preserve state and recover explicitly
124
137
 
@@ -58,6 +58,10 @@
58
58
  {
59
59
  "kind": "skill-contains",
60
60
  "value": "Screenplay never compiles or runs them"
61
+ },
62
+ {
63
+ "kind": "skill-contains",
64
+ "value": "Each level above the slices is a barrel file"
61
65
  }
62
66
  ]
63
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.6.0",
3
+ "version": "7.6.1",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [