@serene-pub/sdk 0.6.0-pr-4 → 0.6.0-pr-5

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 (186) hide show
  1. package/README.md +23 -19
  2. package/dist/actions.d.ts +149 -67
  3. package/dist/actions.js +89 -35
  4. package/dist/annexFields.d.ts +8 -4
  5. package/dist/annexFields.js +5 -2
  6. package/dist/announce.d.ts +78 -28
  7. package/dist/announce.js +14 -5
  8. package/dist/attributes.d.ts +9 -6
  9. package/dist/attributes.js +9 -5
  10. package/dist/bands.d.ts +41 -6
  11. package/dist/bands.js +83 -33
  12. package/dist/builder.d.ts +161 -58
  13. package/dist/builder.js +128 -22
  14. package/dist/candidates.d.ts +5 -3
  15. package/dist/candidates.js +3 -2
  16. package/dist/clauses.d.ts +2 -1
  17. package/dist/clauses.js +2 -1
  18. package/dist/component.d.ts +24 -7
  19. package/dist/component.js +16 -6
  20. package/dist/componentBuild.d.ts +16 -5
  21. package/dist/componentBuild.js +14 -5
  22. package/dist/componentClient.d.ts +61 -30
  23. package/dist/componentClient.js +11 -1
  24. package/dist/componentImports.d.ts +8 -5
  25. package/dist/componentImports.js +23 -4
  26. package/dist/componentModule.js +2 -1
  27. package/dist/componentWire.d.ts +2 -1
  28. package/dist/componentWire.js +34 -2
  29. package/dist/config.d.ts +28 -14
  30. package/dist/config.js +20 -10
  31. package/dist/connections.d.ts +9 -4
  32. package/dist/connections.js +7 -4
  33. package/dist/declarations.d.ts +46 -17
  34. package/dist/declarations.js +46 -15
  35. package/dist/descriptors.d.ts +242 -97
  36. package/dist/descriptors.js +145 -41
  37. package/dist/dev.d.ts +6 -5
  38. package/dist/dev.js +6 -5
  39. package/dist/document.d.ts +74 -25
  40. package/dist/document.js +32 -11
  41. package/dist/dowry.d.ts +241 -0
  42. package/dist/dowry.js +315 -0
  43. package/dist/engines.d.ts +16 -7
  44. package/dist/engines.js +6 -4
  45. package/dist/eventMapLaws.d.ts +19 -8
  46. package/dist/eventMapLaws.js +9 -6
  47. package/dist/events.d.ts +101 -39
  48. package/dist/events.js +106 -33
  49. package/dist/executor.d.ts +122 -41
  50. package/dist/executor.js +188 -95
  51. package/dist/extension.d.ts +99 -35
  52. package/dist/extension.js +43 -9
  53. package/dist/facets.d.ts +2 -1
  54. package/dist/facets.js +4 -2
  55. package/dist/foldedSections.d.ts +4 -2
  56. package/dist/foldedSections.js +2 -1
  57. package/dist/genres.d.ts +123 -41
  58. package/dist/genres.js +127 -22
  59. package/dist/guardedConnection.d.ts +4 -3
  60. package/dist/guardedConnection.js +4 -3
  61. package/dist/handlebarsReach.d.ts +1 -1
  62. package/dist/handlebarsReach.js +1 -1
  63. package/dist/hash.d.ts +16 -5
  64. package/dist/hash.js +14 -4
  65. package/dist/hookGrants.d.ts +3 -2
  66. package/dist/hookGrants.js +6 -4
  67. package/dist/hooks.d.ts +21 -16
  68. package/dist/hooks.js +12 -10
  69. package/dist/hostElements.d.ts +41 -17
  70. package/dist/hostElements.js +49 -17
  71. package/dist/i18n.d.ts +5 -3
  72. package/dist/i18n.js +5 -3
  73. package/dist/identity.d.ts +4 -3
  74. package/dist/identity.js +4 -3
  75. package/dist/index.d.ts +5 -0
  76. package/dist/index.js +15 -0
  77. package/dist/layout.d.ts +36 -15
  78. package/dist/layout.js +2 -2
  79. package/dist/loadouts.d.ts +97 -0
  80. package/dist/loadouts.js +81 -0
  81. package/dist/media.d.ts +26 -4
  82. package/dist/media.js +2 -1
  83. package/dist/messageBlocks.d.ts +44 -32
  84. package/dist/messageBlocks.js +23 -18
  85. package/dist/migration.d.ts +16 -8
  86. package/dist/migration.js +14 -8
  87. package/dist/names.d.ts +2 -1
  88. package/dist/names.js +2 -1
  89. package/dist/nodeInput.d.ts +2 -1
  90. package/dist/nodeInput.js +2 -1
  91. package/dist/participants.d.ts +22 -15
  92. package/dist/participants.js +14 -12
  93. package/dist/personGate.d.ts +2 -1
  94. package/dist/personGate.js +2 -1
  95. package/dist/pluginHarness.d.ts +8 -3
  96. package/dist/pluginHarness.js +4 -2
  97. package/dist/pluginPermissions.d.ts +2 -1
  98. package/dist/pluginPermissions.js +12 -1
  99. package/dist/pluginRuleRef.d.ts +2 -2
  100. package/dist/pluginRuleRef.js +1 -1
  101. package/dist/predicates.d.ts +16 -11
  102. package/dist/predicates.js +7 -6
  103. package/dist/preview.d.ts +8 -3
  104. package/dist/preview.js +2 -1
  105. package/dist/promptBlocks.d.ts +5 -3
  106. package/dist/promptBlocks.js +5 -3
  107. package/dist/rankingDecisions.d.ts +2 -1
  108. package/dist/rankingDecisions.js +2 -1
  109. package/dist/receipt.d.ts +65 -29
  110. package/dist/receipt.js +9 -4
  111. package/dist/receiverRules.js +3 -2
  112. package/dist/refs.d.ts +34 -9
  113. package/dist/refs.js +33 -13
  114. package/dist/registry.d.ts +42 -23
  115. package/dist/registry.js +7 -5
  116. package/dist/review.d.ts +16 -5
  117. package/dist/review.js +11 -4
  118. package/dist/sampling.d.ts +54 -0
  119. package/dist/sampling.js +95 -3
  120. package/dist/sceneSettings.d.ts +312 -0
  121. package/dist/sceneSettings.js +425 -0
  122. package/dist/scope.d.ts +6 -4
  123. package/dist/scope.js +4 -3
  124. package/dist/scripts.d.ts +81 -14
  125. package/dist/scripts.js +90 -11
  126. package/dist/sessionDossier.d.ts +521 -0
  127. package/dist/sessionDossier.js +33 -0
  128. package/dist/sessionLayout.d.ts +303 -19
  129. package/dist/sessionLayout.js +354 -40
  130. package/dist/sessionSettings.d.ts +8 -5
  131. package/dist/settings.d.ts +45 -20
  132. package/dist/settings.js +19 -12
  133. package/dist/settingsSlot.d.ts +11 -8
  134. package/dist/settingsSlot.js +11 -8
  135. package/dist/shapes.d.ts +99 -36
  136. package/dist/shapes.js +101 -35
  137. package/dist/sheets.d.ts +4 -2
  138. package/dist/sheets.js +6 -3
  139. package/dist/statShapes.d.ts +2 -1
  140. package/dist/statShapes.js +2 -1
  141. package/dist/status.d.ts +13 -9
  142. package/dist/status.js +8 -6
  143. package/dist/storage.d.ts +2 -1
  144. package/dist/storage.js +2 -1
  145. package/dist/storyTime.d.ts +13 -7
  146. package/dist/storyTime.js +11 -6
  147. package/dist/strokes.d.ts +176 -0
  148. package/dist/strokes.js +281 -0
  149. package/dist/surfaces.d.ts +54 -25
  150. package/dist/surfaces.js +3 -3
  151. package/dist/template.d.ts +9 -5
  152. package/dist/template.js +5 -3
  153. package/dist/templateCheck.d.ts +2 -2
  154. package/dist/templateCheck.js +2 -2
  155. package/dist/templateFit.d.ts +37 -8
  156. package/dist/templateFit.js +92 -8
  157. package/dist/templateIds.d.ts +3 -3
  158. package/dist/templateIds.js +3 -3
  159. package/dist/templateScopeAt.d.ts +21 -11
  160. package/dist/templateScopeAt.js +21 -11
  161. package/dist/testing.d.ts +11 -4
  162. package/dist/testing.js +13 -5
  163. package/dist/tokenizers.d.ts +2 -2
  164. package/dist/tokenizers.js +2 -2
  165. package/dist/turnLock.d.ts +4 -2
  166. package/dist/turnLock.js +2 -1
  167. package/dist/turnOrder.d.ts +17 -11
  168. package/dist/turnOrder.js +9 -5
  169. package/dist/validate.d.ts +11 -8
  170. package/dist/validate.js +81 -10
  171. package/dist/values.d.ts +17 -8
  172. package/dist/values.js +11 -6
  173. package/dist/variables.d.ts +46 -7
  174. package/dist/variables.js +87 -6
  175. package/dist/verdicts.d.ts +20 -13
  176. package/dist/verdicts.js +17 -11
  177. package/dist/widgetDecls.d.ts +8 -4
  178. package/dist/widgetDecls.js +4 -2
  179. package/dist/widgets.d.ts +987 -94
  180. package/dist/widgets.js +93 -18
  181. package/dist/wire.d.ts +13 -6
  182. package/dist/wire.js +3 -3
  183. package/dist/worldinfo.d.ts +11 -6
  184. package/dist/worldinfo.js +8 -4
  185. package/host-elements.d.ts +13 -0
  186. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  /**
2
- * announce() — the serializer behind `defineExtension()` (R48, T1b). A package
2
+ * announce() — the serializer behind `defineExtension()`. A package
3
3
  * is authored with `defineExtension()`; `announcementOf()` compiles that to the
4
4
  * announcement document this builder produces. Kept exported for core's and
5
5
  * the CLI's use, and for one release of packages still exporting a builder.
6
6
  *
7
- * Was: "the ONE authoring surface" (24 §6).
7
+ * Was: "the ONE authoring surface".
8
8
  *
9
9
  * A package is an announcement: identity first, then everything it declares —
10
10
  * genres, hook declarations, pipelines, configs, presets. Plugins compile the
@@ -19,20 +19,22 @@
19
19
  * Cross-package references are ids with the referenced thing's owner in them
20
20
  * (`use()` handles compile down to these). Referencing something external is
21
21
  * allowed and recorded; what the instance enforces at install is the
22
- * requirement, not the bundle (24 §10).
22
+ * requirement, not the bundle.
23
+ * @ruling R48, T1b, 24 §6, 24 §10
23
24
  */
24
25
  import type { BuiltSpec } from './builder.js';
25
26
  import { type SpecDocument } from './document.js';
26
27
  /** announce() accepts pipelines built or already compiled — one shape lands. @experimental */
27
28
  export type AnnouncedSpec = BuiltSpec | SpecDocument;
28
29
  /**
29
- * A reference to something another package ships (24 §10): an id plus an
30
+ * A reference to something another package ships: an id plus an
30
31
  * optional semver range. `use()` handles compile to references in the
31
32
  * document and requirements in the manifest — never a bundle. The
32
33
  * fully-typed form (option autocomplete off the published declaration
33
34
  * artifact's generated .d.ts) rides the artifact work; this is the
34
35
  * reference primitive both share.
35
36
  * @experimental
37
+ * @ruling 24 §10
36
38
  */
37
39
  export interface ExternalRef {
38
40
  readonly kind: 'external-ref';
@@ -44,9 +46,10 @@ export interface ExternalRef {
44
46
  /**
45
47
  * An external reference carrying its target's option space in the type —
46
48
  * what the generated typings (`serene-pub types`) produce, so a config over
47
- * another package's pipeline autocompletes node → slot → field (24 T7b).
49
+ * another package's pipeline autocompletes node → slot → field.
48
50
  * The phantom never exists at runtime; the document still stores the id.
49
51
  * @experimental
52
+ * @ruling 24 T7b
50
53
  */
51
54
  export interface TypedExternalRef<T> extends ExternalRef {
52
55
  readonly __options?: T;
@@ -80,18 +83,22 @@ export interface PackageIdentity {
80
83
  /** The package namespace every declared id lives under — `core`, `acme.dice`. */
81
84
  ns: string;
82
85
  author: string;
83
- /** What the package is called where it is listed — a string or a locale map with `en` (R-20). */
86
+ /**
87
+ * What the package is called where it is listed — a string or a locale map with `en`.
88
+ * @ruling R-20
89
+ */
84
90
  title: I18n;
85
91
  repo?: string;
86
92
  summary?: I18n;
87
93
  description?: I18n;
88
94
  }
89
95
  /**
90
- * A hook *declaration* (24 §11): identity, event, contract, ordering. The
96
+ * A hook *declaration*: identity, event, contract, ordering. The
91
97
  * implementation lives with its capabilities — core's in core, a plugin's in
92
98
  * its sandboxed bundle — and boot/install binds implementation to declared id
93
99
  * with a completeness check.
94
100
  * @experimental
101
+ * @ruling 24 §11
95
102
  */
96
103
  export interface HookDeclaration {
97
104
  event: string;
@@ -101,7 +108,7 @@ export interface HookDeclaration {
101
108
  after?: string[];
102
109
  }
103
110
  /**
104
- * A shipped prompt (24 T6b): authored prose for one NODE's prompts slot,
111
+ * A shipped prompt: authored prose for one NODE's prompts slot,
105
112
  * selectable wherever that node is used. The slug is the stable identity an
106
113
  * instance's seed pass matches on; the label is display.
107
114
  *
@@ -110,6 +117,7 @@ export interface HookDeclaration {
110
117
  * the prompts written for it, and one built from other nodes is offered none of
111
118
  * them. Spec scoping said the same thing less precisely and cost the reuse.
112
119
  * @experimental
120
+ * @ruling 24 T6b
113
121
  */
114
122
  export interface PromptDecl {
115
123
  /**
@@ -124,17 +132,27 @@ export interface PromptDecl {
124
132
  */
125
133
  slot: string;
126
134
  slug: string;
127
- /** The name a picker lists it by — a string or a locale map with `en` (R-20). */
135
+ /**
136
+ * The name a picker lists it by — a string or a locale map with `en`.
137
+ * @ruling R-20
138
+ */
128
139
  label: I18n;
129
140
  /** Field name → prose, exactly as that slot declares them. */
130
141
  fields: Record<string, string>;
131
142
  }
132
- /** A named configuration: a typed delta over a spec's author defaults (24 §7). @experimental */
143
+ /**
144
+ * A named configuration: a typed delta over a spec's author defaults.
145
+ * @experimental
146
+ * @ruling 24 §7
147
+ */
133
148
  export interface ConfigDecl {
134
149
  /** The spec it configures — may be external (another package's id). */
135
150
  spec: string;
136
151
  slug: string;
137
- /** The name a picker lists it by — a string or a locale map with `en` (R-20). */
152
+ /**
153
+ * The name a picker lists it by — a string or a locale map with `en`.
154
+ * @ruling R-20
155
+ */
138
156
  label: I18n;
139
157
  description?: I18n;
140
158
  /** nodeKey → slot → value. Only deviations; everything else inherits. */
@@ -172,7 +190,7 @@ export interface PresetBinding {
172
190
  config?: string;
173
191
  }
174
192
  /**
175
- * What a preset pre-fills the creation form with (23 §9).
193
+ * What a preset pre-fills the creation form with.
176
194
  *
177
195
  * Every key optional and every key advisory: the form applies the ones it
178
196
  * recognises, type-checks each, and ignores the rest — so a preset written
@@ -180,12 +198,13 @@ export interface PresetBinding {
180
198
  * genre's own fields ride along in `genreFields` rather than growing this
181
199
  * shape a key at a time.
182
200
  * @experimental
201
+ * @ruling 23 §9
183
202
  */
184
203
  export interface PresetDefaults {
185
204
  name?: string;
186
205
  scenario?: string;
187
206
  /**
188
- * Swaps to seat the session with (R40): for each, a definition the named
207
+ * Swaps to seat the session with: for each, a definition the named
189
208
  * spec offers on the named node — its pin or one of its `expose.swaps`,
190
209
  * or an enabled contribution. The same shape a package contributes with
191
210
  * (`SwapContribution`), stored with ids:
@@ -193,6 +212,7 @@ export interface PresetDefaults {
193
212
  * Written as the session's rebinds at create; an entry the node does not
194
213
  * offer is refused there, logged, and the session starts on the pin.
195
214
  * Replaced `speakerStrategy` (2026-09-23), which named one node.
215
+ * @ruling R40
196
216
  */
197
217
  swaps?: StoredSwapContribution[];
198
218
  lorebookId?: number | null;
@@ -200,32 +220,38 @@ export interface PresetDefaults {
200
220
  /** The genre's declared fields, by key. */
201
221
  genreFields?: Record<string, unknown>;
202
222
  /**
203
- * Envoys to seat on creation, by slug (R-18; U5g) — beside the genre's
223
+ * Envoys to seat on creation, by slug — beside the genre's
204
224
  * `default: true` ones, which are seated with no choice. A slug the
205
225
  * genre (or an installed action) does not declare is ignored, on the
206
226
  * same advisory terms as every other key here.
227
+ * @ruling R-18, U5g
207
228
  */
208
229
  envoys?: string[];
209
230
  }
210
231
  /**
211
- * A preset populates a genre's event slots (24 §1): for each event the genre
232
+ * A preset populates a genre's event slots: for each event the genre
212
233
  * declares, which pipeline variant answers it, with which config.
213
234
  * @experimental
235
+ * @ruling 24 §1
214
236
  */
215
237
  export interface PresetDecl {
216
238
  slug: string;
217
239
  genre: string;
218
- /** The name the picker lists it by — a string or a locale map with `en` (R-20). */
240
+ /**
241
+ * The name the picker lists it by — a string or a locale map with `en`.
242
+ * @ruling R-20
243
+ */
219
244
  label: I18n;
220
245
  description?: I18n;
221
246
  bindings: Record<string, PresetBinding>;
222
247
  /**
223
248
  * For the open `session-action` slot: which actions come along, each by
224
- * its **identity** — `<spec slug>#<key>` (U5c review, W-A). A preset
249
+ * its **identity** — `<spec slug>#<key>`. A preset
225
250
  * curates declarations, never functions: two specs contributing one
226
251
  * function are two entries, and including one says nothing about the
227
252
  * other. Absent means the host's companion rule (every action from the
228
253
  * genre owner's own namespace).
254
+ * @ruling U5c review, W-A
229
255
  */
230
256
  actions?: {
231
257
  include: string[];
@@ -311,7 +337,10 @@ export type PresetDefaultsInput = Omit<PresetDefaults, 'swaps'> & {
311
337
  export interface PresetInput {
312
338
  slug: string;
313
339
  genre: GenreDecl | ExternalRef;
314
- /** The name the picker lists it by — a string or a locale map with `en` (R-20). */
340
+ /**
341
+ * The name the picker lists it by — a string or a locale map with `en`.
342
+ * @ruling R-20
343
+ */
315
344
  label: I18n;
316
345
  description?: I18n;
317
346
  bindings: BindingEntry[];
@@ -331,7 +360,11 @@ export interface PresetInput {
331
360
  * @experimental
332
361
  */
333
362
  export declare function preset(input: PresetInput): PresetDecl;
334
- /** The compiled announcement — the package's declaration artifact (24 §10). @experimental */
363
+ /**
364
+ * The compiled announcement — the package's declaration artifact.
365
+ * @experimental
366
+ * @ruling 24 §10
367
+ */
335
368
  export interface AnnouncementDocument {
336
369
  schemaVersion: 1;
337
370
  identity: PackageIdentity;
@@ -343,17 +376,22 @@ export interface AnnouncementDocument {
343
376
  configs: ConfigDecl[];
344
377
  presets: PresetDecl[];
345
378
  /**
346
- * Frame surfaces this package ships (20 §12, 21 §7) — the documents an
379
+ * Frame surfaces this package ships — the documents an
347
380
  * instance mounts in opaque-origin iframes. Absent means the package has
348
381
  * no UI of its own, which is the common case.
382
+ * @ruling 20 §12, 21 §7
349
383
  */
350
384
  surfaces?: SurfacesDecl;
351
- /** In-document components (10 §2, virtual tier). */
385
+ /**
386
+ * In-document components (virtual tier).
387
+ * @ruling 10 §2
388
+ */
352
389
  components: ComponentDecl[];
353
390
  /**
354
- * Definitions this package offers on other packages' swappable nodes
355
- * (R29), definitions as ids. Absent when the package contributes none, so
391
+ * Definitions this package offers on other packages' swappable nodes,
392
+ * stored as ids. Absent when the package contributes none, so
356
393
  * a package that declares no swap announces exactly what it did before.
394
+ * @ruling R29
357
395
  */
358
396
  swaps?: StoredSwapContribution[];
359
397
  /**
@@ -365,7 +403,11 @@ export interface AnnouncementDocument {
365
403
  /** Ids referenced but not declared here — the instance enforces these at install. */
366
404
  requires: string[];
367
405
  }
368
- /** One event slot's standing in a preset, for the coverage report (24 §7). @experimental */
406
+ /**
407
+ * One event slot's standing in a preset, for the coverage report.
408
+ * @experimental
409
+ * @ruling 24 §7
410
+ */
369
411
  export interface CoverageSlot {
370
412
  event: string;
371
413
  required: boolean;
@@ -410,20 +452,27 @@ export declare class AnnouncementBuilder {
410
452
  /** Context sugar: mints `${ns}:genre/${name}` so the id cannot be mistyped. */
411
453
  genre(name: string, props: GenreProps): GenreDecl;
412
454
  genres(map: Record<string, GenreDecl>): this;
413
- /** Declarations only — implementations bind by id per trust domain (24 §11). */
455
+ /**
456
+ * Declarations only — implementations bind by id per trust domain.
457
+ * @ruling 24 §11
458
+ */
414
459
  hooks(map: Record<string, HookDeclaration>): this;
415
460
  pipelines(...specs: AnnouncedSpec[]): this;
416
461
  configs(...configs: ConfigInput<any>[]): this;
417
462
  prompts(...prompts: PromptDecl[]): this;
418
463
  presets(...presets: PresetInput[]): this;
419
464
  /**
420
- * The frame surfaces this package ships (20 §12): documents mounted in
465
+ * The frame surfaces this package ships: documents mounted in
421
466
  * opaque-origin iframes. Declared, never discovered — an instance renders
422
467
  * what the manifest says and `serene-pub preview` renders the same list,
423
468
  * so a surface a modder previewed is a surface an instance will offer.
469
+ * @ruling 20 §12
424
470
  */
425
471
  surfaces(decl: SurfacesDecl): this;
426
- /** In-document components (10 §2, virtual tier) — code trust at install. */
472
+ /**
473
+ * In-document components (virtual tier) — code trust at install.
474
+ * @ruling 10 §2
475
+ */
427
476
  components(...components: ComponentDecl[]): this;
428
477
  /**
429
478
  * Offer this package's definitions on another package's swappable nodes:
@@ -434,7 +483,8 @@ export declare class AnnouncementBuilder {
434
483
  swaps(...contributions: SwapContribution[]): this;
435
484
  /**
436
485
  * Validate the announcement as a whole and compile it to the document.
437
- * Errors carry exact paths — the teaching-error pattern (15 §1.3).
486
+ * Errors carry exact paths — the teaching-error pattern.
487
+ * @ruling 15 §1.3
438
488
  */
439
489
  build(): {
440
490
  document: AnnouncementDocument;
package/dist/announce.js CHANGED
@@ -59,9 +59,10 @@ export function storedConfig(c) {
59
59
  };
60
60
  }
61
61
  /**
62
- * The display text rule (R-20) as a throw for `config()` / `preset()`, where
62
+ * The display text rule as a throw for `config()` / `preset()`, where
63
63
  * the author is. `build()` collects the same findings instead, through the
64
64
  * shared declaration pass.
65
+ * @ruling R-20
65
66
  */
66
67
  function assertDisplayText(at, meta) {
67
68
  const findings = labelFindings(at, meta);
@@ -260,7 +261,10 @@ export class AnnouncementBuilder {
260
261
  }
261
262
  return this;
262
263
  }
263
- /** Declarations only — implementations bind by id per trust domain (24 §11). */
264
+ /**
265
+ * Declarations only — implementations bind by id per trust domain.
266
+ * @ruling 24 §11
267
+ */
264
268
  hooks(map) {
265
269
  for (const [key, decl] of Object.entries(map))
266
270
  this._hooks[`${this.identity.ns}:hook/${key}`] = decl;
@@ -283,16 +287,20 @@ export class AnnouncementBuilder {
283
287
  return this;
284
288
  }
285
289
  /**
286
- * The frame surfaces this package ships (20 §12): documents mounted in
290
+ * The frame surfaces this package ships: documents mounted in
287
291
  * opaque-origin iframes. Declared, never discovered — an instance renders
288
292
  * what the manifest says and `serene-pub preview` renders the same list,
289
293
  * so a surface a modder previewed is a surface an instance will offer.
294
+ * @ruling 20 §12
290
295
  */
291
296
  surfaces(decl) {
292
297
  this._surfaces = { ...this._surfaces, ...decl };
293
298
  return this;
294
299
  }
295
- /** In-document components (10 §2, virtual tier) — code trust at install. */
300
+ /**
301
+ * In-document components (virtual tier) — code trust at install.
302
+ * @ruling 10 §2
303
+ */
296
304
  components(...components) {
297
305
  this._components.push(...components);
298
306
  return this;
@@ -312,7 +320,8 @@ export class AnnouncementBuilder {
312
320
  }
313
321
  /**
314
322
  * Validate the announcement as a whole and compile it to the document.
315
- * Errors carry exact paths — the teaching-error pattern (15 §1.3).
323
+ * Errors carry exact paths — the teaching-error pattern.
324
+ * @ruling 15 §1.3
316
325
  */
317
326
  build() {
318
327
  const errors = [];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * ## Three levels, and only the middle one is new here
5
5
  *
6
- * A stat is three things, not one (entries plan Part 3): a **declaration**
6
+ * A stat is three things, not one: a **declaration**
7
7
  * ("Health is an integer with a max, and it attaches to cast members"), a
8
8
  * **configuration** ("this character's Health caps at 20"), and a **value**
9
9
  * ("health = 12, as of message 47"). This file owns the first. The other two
@@ -57,7 +57,7 @@
57
57
  * than part of it, and writing one down must not force an `@N+1` on everything
58
58
  * already storing values under the id.
59
59
  *
60
- * ⚠ **"Slot" here is not a pipeline slot.** NOMENCLATURE §"slot" is a declared
60
+ * ⚠ **"Slot" here is not a pipeline slot.** A pipeline *slot* is a declared
61
61
  * parameter address on a node type (`SlotDecl` in descriptors.ts). This is an
62
62
  * *attribute* slot, and prose says the qualified word. The two never meet: one
63
63
  * is a key on a descriptor, the other is an id in this registry.
@@ -69,6 +69,7 @@
69
69
  * will be imported wrong. The *types* keep the short names (`SlotId`,
70
70
  * `SlotConfig`, `SlotValue`): they are only ever written next to this file's
71
71
  * functions, so they cannot be mistaken at a call site.
72
+ * @ruling entries plan Part 3
72
73
  */
73
74
  import type { I18n } from './descriptors.js';
74
75
  import type { FieldDecl } from './settings.js';
@@ -413,8 +414,7 @@ export interface AttributeSlotProps {
413
414
  */
414
415
  pickable?: false;
415
416
  /**
416
- * 🚧 **Earshot**: which prompts may read this slot's value (lair pass R1,
417
- * 2026-09-28).
417
+ * 🚧 **Earshot**: which prompts may read this slot's value.
418
418
  *
419
419
  * · `'all'` (the default) — every agent a run builds a prompt for: the
420
420
  * planner, the scene, the state-keeper, every voice.
@@ -435,6 +435,7 @@ export interface AttributeSlotProps {
435
435
  * so saying the default and saying nothing are one declaration and one
436
436
  * hash. Inside the content hash when `'holder'`: it decides which prompts
437
437
  * the value reaches.
438
+ * @ruling lair pass R1 (2026-09-28)
438
439
  */
439
440
  earshot?: SlotEarshot;
440
441
  }
@@ -553,12 +554,13 @@ export declare function retireAttributeSlot(id: SlotId): AttributeSlotDecl;
553
554
  /** Undo a retirement. Writes are taken again; nothing about the stored values changed either way. @internal */
554
555
  export declare function reviveAttributeSlot(id: SlotId): AttributeSlotDecl;
555
556
  /**
556
- * The display-text findings of one slot declaration (R-20): `label` and
557
+ * The display-text findings of one slot declaration: `label` and
557
558
  * `description`, both optional — a slot may be listed by its id — but a blank
558
559
  * one is a label that draws nothing where the author meant to say something.
559
560
  * Run by the code door here and by the host's **write** door for an authored
560
561
  * slot (the app's `declareSlot` / `updateSlot`), never by a reload.
561
562
  * @internal
563
+ * @ruling R-20
562
564
  */
563
565
  export declare function attributeSlotDisplayFindings(id: SlotId, props: AttributeSlotProps): string[];
564
566
  /** The `SlotType` each stat kind is stored and checked as. @experimental */
@@ -602,10 +604,11 @@ export declare function resolveSlotConfig(decl: AttributeSlotDecl, ...layers: re
602
604
  * inventing three wordings for one rule is how a validator stops being one.
603
605
  *
604
606
  * ⚠ A value is checked against the configuration valid at **its own anchor**,
605
- * not against the current one (plan Part 3). Callers pass that config in; this
607
+ * not against the current one. Callers pass that config in; this
606
608
  * function never reaches for a current one, because doing so is precisely the
607
609
  * mistake that retroactively invalidates a legitimate historical value.
608
610
  * @internal
611
+ * @ruling plan Part 3
609
612
  */
610
613
  export declare function checkSlotValue(decl: AttributeSlotDecl, value: SlotValue, config?: SlotConfig): string | null;
611
614
  /** What a change does to the value already there. @experimental */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * ## Three levels, and only the middle one is new here
5
5
  *
6
- * A stat is three things, not one (entries plan Part 3): a **declaration**
6
+ * A stat is three things, not one: a **declaration**
7
7
  * ("Health is an integer with a max, and it attaches to cast members"), a
8
8
  * **configuration** ("this character's Health caps at 20"), and a **value**
9
9
  * ("health = 12, as of message 47"). This file owns the first. The other two
@@ -57,7 +57,7 @@
57
57
  * than part of it, and writing one down must not force an `@N+1` on everything
58
58
  * already storing values under the id.
59
59
  *
60
- * ⚠ **"Slot" here is not a pipeline slot.** NOMENCLATURE §"slot" is a declared
60
+ * ⚠ **"Slot" here is not a pipeline slot.** A pipeline *slot* is a declared
61
61
  * parameter address on a node type (`SlotDecl` in descriptors.ts). This is an
62
62
  * *attribute* slot, and prose says the qualified word. The two never meet: one
63
63
  * is a key on a descriptor, the other is an id in this registry.
@@ -69,6 +69,7 @@
69
69
  * will be imported wrong. The *types* keep the short names (`SlotId`,
70
70
  * `SlotConfig`, `SlotValue`): they are only ever written next to this file's
71
71
  * functions, so they cannot be mistaken at a call site.
72
+ * @ruling entries plan Part 3
72
73
  */
73
74
  import { i18nFindings } from './i18n.js';
74
75
  import { refuseUnlessIdentical } from './hash.js';
@@ -407,12 +408,13 @@ export function reviveAttributeSlot(id) {
407
408
  return next;
408
409
  }
409
410
  /**
410
- * The display-text findings of one slot declaration (R-20): `label` and
411
+ * The display-text findings of one slot declaration: `label` and
411
412
  * `description`, both optional — a slot may be listed by its id — but a blank
412
413
  * one is a label that draws nothing where the author meant to say something.
413
414
  * Run by the code door here and by the host's **write** door for an authored
414
415
  * slot (the app's `declareSlot` / `updateSlot`), never by a reload.
415
416
  * @internal
417
+ * @ruling R-20
416
418
  */
417
419
  export function attributeSlotDisplayFindings(id, props) {
418
420
  return [
@@ -428,11 +430,12 @@ function assertDisplayText(id, props) {
428
430
  }
429
431
  /**
430
432
  * A stored row reloading at boot is never refused for its display text
431
- * (ruled 2026-09-17, U5i review): the gate is the write door, and a row that
433
+ * (ruled 2026-09-17): the gate is the write door, and a row that
432
434
  * was stored with a blank `description` would otherwise vanish from every
433
435
  * boot after. The offending field is dropped — a blank label reads as "listed
434
436
  * by id" — and a warning names the row and the finding, so the defect is
435
437
  * visible without the slot being lost.
438
+ * @ruling U5i review
436
439
  */
437
440
  function withDisplayTextTolerated(id, props) {
438
441
  const findings = attributeSlotDisplayFindings(id, props);
@@ -671,10 +674,11 @@ export function resolveSlotConfig(decl, ...layers) {
671
674
  * inventing three wordings for one rule is how a validator stops being one.
672
675
  *
673
676
  * ⚠ A value is checked against the configuration valid at **its own anchor**,
674
- * not against the current one (plan Part 3). Callers pass that config in; this
677
+ * not against the current one. Callers pass that config in; this
675
678
  * function never reaches for a current one, because doing so is precisely the
676
679
  * mistake that retroactively invalidates a legitimate historical value.
677
680
  * @internal
681
+ * @ruling plan Part 3
678
682
  */
679
683
  export function checkSlotValue(decl, value, config = resolveSlotConfig(decl)) {
680
684
  // Retirement answers first. It is the newest fact about the slot and the
package/dist/bands.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Bands as template variables (typed templates P2, 2026-09-27).
2
+ * Bands as template variables.
3
3
  *
4
4
  * A **band** is the ranker's word for one source's slice of the context window
5
5
  * (`bandIntent`, candidates.ts). A source that puts its own band in the window
@@ -27,6 +27,7 @@
27
27
  * when the slot says `rendersBands` — every band declared upstream of the
28
28
  * named in-port, followed through any node that takes candidates in
29
29
  * (concatenation, fusion, ranking). `rendersAt` is that answer.
30
+ * @ruling typed templates P2 (2026-09-27)
30
31
  */
31
32
  import { type Descriptor, type SlotDecl } from './descriptors.js';
32
33
  import type { DocEdge, DocNode } from './document.js';
@@ -53,20 +54,54 @@ export declare const ASSEMBLE_OWN_TEMPLATE_NAMES: readonly string[];
53
54
  * - the key is an identifier (a band is a template name);
54
55
  * - the variable is registered (`defineVariable` / `definePluginVariable`) and
55
56
  * its scope declares the key, because a layout renders `{ [key]: value }`;
56
- * - the key does not shadow a name core renders — Assemble's own, or a
57
- * core variable's that is not this band's own variable;
58
- * - no other registered definition declares the key with a different variable.
57
+ * - the key is not one of Assemble's own names.
58
+ *
59
+ * **Not refused here: a key some other definition, or some core variable,
60
+ * already uses** (owner ruling 2026-10-13, ★1). A key is a local name and
61
+ * means one variable *within one template's scope* — `bandsReaching` and
62
+ * `rendersAt` refuse two meanings meeting in one document, and law T1 reports
63
+ * it. Two pipelines that never meet may each mean their own `characterLore`.
59
64
  *
60
65
  * Each refusal names the fix.
61
66
  * @internal
62
67
  */
63
- export declare function checkBandDeclarations(d: Descriptor, others: Iterable<Descriptor>): void;
68
+ export declare function checkBandDeclarations(d: Descriptor): void;
69
+ /**
70
+ * What is wrong with a node rendering `key` as `id`, as the end of a sentence
71
+ * that begins with what renders it — or `undefined` when nothing is.
72
+ *
73
+ * The facts a band declaration states, asked of every rendered key: a layout
74
+ * is written against its variable's scope and renders `{ [key]: value }`, so
75
+ * a key the scope does not name reaches no layout, and a variable nobody
76
+ * registered has no layout, no type and no picker.
77
+ * @internal
78
+ */
79
+ export declare function rendersProblem(key: string, id: unknown): string | undefined;
80
+ /**
81
+ * Refuse a definition's static `renders` (owner ruling 2026-10-13) — at
82
+ * `describe…Definition`, like its bands, and for the same reasons
83
+ * (`rendersProblem`). Until then nothing read a `renders` entry until a run
84
+ * did, and a key whose variable did not declare it rendered nothing.
85
+ * @internal
86
+ */
87
+ export declare function checkRendersDeclarations(d: Descriptor): void;
88
+ /**
89
+ * What one placement's `variables` slot renders, before any band: the slot's
90
+ * static `renders`, with each key the **spec's own `renders`** names for this
91
+ * node (`NodeOpts.renders`, owner ruling 2026-10-13) re-pointed at the
92
+ * spec's variable. Only keys the slot already renders — the spec says what a
93
+ * key *means* here, it does not add keys; `validate()` reports one it names
94
+ * that no slot renders (law T1).
95
+ * @experimental
96
+ */
97
+ export declare function effectiveRenders(slot: Pick<SlotDecl, 'renders'>, node?: Pick<DocNode, 'renders'>): Record<string, VariableId>;
64
98
  /**
65
99
  * What `bandsReaching` needs from a node's definition: its in-ports and the
66
100
  * bands it declares. A `Descriptor` satisfies it, and so does a registry row
67
101
  * (whose policy carries the band ids, `DefinitionPolicy.bands`) — which is how
68
- * a host reading rows answers without loading a plugin (F6).
102
+ * a host reading rows answers without loading a plugin.
69
103
  * @experimental
104
+ * @ruling F6
70
105
  */
71
106
  export interface BandSource {
72
107
  ports?: {