@serene-pub/sdk 0.6.0-pr-2 → 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 +24 -20
  2. package/dist/actions.d.ts +150 -68
  3. package/dist/actions.js +90 -36
  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 +195 -96
  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 +5 -4
  74. package/dist/identity.js +5 -4
  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 +103 -41
  136. package/dist/shapes.js +105 -40
  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,14 +1,16 @@
1
1
  /**
2
- * Descriptors — the shared-scope declaration of a **node definition** (01 §1, 04 §3;
3
- * NOMENCLATURE §5 — *node type* is retired, ruled 2026-09-14).
2
+ * Descriptors — the shared-scope declaration of a **node definition**
3
+ * (*node type* is retired, ruled 2026-09-14).
4
4
  *
5
5
  * A descriptor is data: it can be listed, rendered and validated without loading
6
6
  * the handler that implements it. That is what lets the plugin manager and the
7
- * editor work from rows (10 §10.2).
7
+ * editor work from rows.
8
+ * @ruling 01 §1, 04 §3, NOMENCLATURE §5, 10 §10.2
8
9
  */
9
10
  import type { ShapeId } from './shapes.js';
10
11
  import type { CapabilityId } from './capabilities.js';
11
12
  import type { ReviewPosition } from './review.js';
13
+ import type { Prefers } from './loadouts.js';
12
14
  import type { TemplateScope, VarField } from './template.js';
13
15
  import type { VariableDecl } from './variables.js';
14
16
  import { type SettingsSchema, type FieldDecl } from './settings.js';
@@ -17,8 +19,10 @@ import { type EnabledWhen, type EnabledWhenDecl } from './predicates.js';
17
19
  import type { WidgetDecl } from './layout.js';
18
20
  import type { MediaCapability } from './media.js';
19
21
  import { type DisplayKeys } from './hash.js';
22
+ import { type SeamAddress } from './scripts.js';
23
+ import { type SceneSettingsDecl } from './sceneSettings.js';
20
24
  /**
21
- * The node kinds (R-13, ruled 2026-09-14): **inlet** (where the run enters) ·
25
+ * The node kinds (ruled 2026-09-14): **inlet** (where the run enters) ·
22
26
  * **query** (reads) · **task** (pure transform) · **oracle** (calls out to an
23
27
  * external nondeterministic source — a model, TTS, image gen, embeddings, a human)
24
28
  * · **outlet** (the only effect-capable kind: writes, attaches, emits — the run
@@ -31,26 +35,44 @@ import { type DisplayKeys } from './hash.js';
31
35
  * answer to "what kind of thing is this lorebook row". It is a Kind rather than
32
36
  * a registry of its own because everything downstream of a declaration is the
33
37
  * same machinery: one `snapshotRegistry`, one content hash, one boot sync, one
34
- * freeze rule (the argument 18 §2 makes for script kinds, one construct over).
38
+ * freeze rule (the argument made for script kinds, one construct over).
35
39
  * @experimental
40
+ * @ruling R-13, 18 §2
36
41
  */
37
42
  export type Kind = 'inlet' | 'query' | 'task' | 'oracle' | 'outlet' | 'entry';
38
43
  export type { I18n, LocaleMap } from './i18n.js';
39
44
  /**
40
- * Slot kinds (12 §2). Siblings; only two are ever cross-referenced.
45
+ * Slot kinds. Siblings; only two are ever cross-referenced.
41
46
  *
42
- * `settings` (R-9, ruled 2026-09-15) is the one kind **no author declares**:
47
+ * `settings` (ruled 2026-09-15) is the one kind **no author declares**:
43
48
  * the substrate declares it, on every definition that is `optional`
44
49
  * (`enabled`), every one whose `effects` gate (`review`), and every gather
45
50
  * clause (`mode`). The slot name `settings` is reserved for it — `register`
46
51
  * refuses a descriptor that authors one, and an out-port of the name, since
47
- * `<node>.settings` is the address F39 reads as a switch — and it is projected into the
52
+ * `<node>.settings` is the address the settings-travel rule reads as a switch — and it is projected into the
48
53
  * registry row by `snapshotRegistry` rather than written on the descriptor,
49
54
  * so the executor keeps reading `config[key].settings.*` exactly as before
50
55
  * and the panel renders it from the row like any slot (`settingsSlot.ts`).
51
56
  * @experimental
57
+ * @ruling 12 §2, R-9, F39
52
58
  */
53
- export type SlotKind = 'connection' | 'sampling' | 'prompts' | 'template' | 'parameters' | 'wire' | 'variables' | 'scripts' | 'settings';
59
+ export type SlotKind = 'connection' | 'sampling' | 'prompts' | 'template' | 'parameters' | 'wire' | 'variables' | 'scripts' | 'settings'
60
+ /**
61
+ * 🚧 A **workflow** — a provider document one dialect consumes (a ComfyUI
62
+ * API-format graph), stored as its own row in the host's `workflows`
63
+ * table. The value is `{ id }`; the host's control is `workflow-ref`, a
64
+ * sibling of `connection-ref`. Not a template slot: a workflow is not a
65
+ * context template, and nothing else offers one.
66
+ * @ruling DESIGN-image-generation §4.10 (2026-10-12)
67
+ */
68
+ | 'workflow'
69
+ /**
70
+ * A **loadout** reference: the engine a model call runs on — pair,
71
+ * sampling, workflow — named by id. Control `loadout-ref`, value
72
+ * `{ id }`. The `connection` and `sampling` slots beside it stay as
73
+ * per-value overrides.
74
+ */
75
+ | 'loadout';
54
76
  /** @experimental */
55
77
  export interface SlotDecl {
56
78
  kind: SlotKind;
@@ -103,7 +125,10 @@ export interface SlotDecl {
103
125
  optional?: readonly CapabilityId[];
104
126
  /** What this slot is for, shown under its option. Display text — see FieldDecl. */
105
127
  description?: I18n;
106
- /** Which lens renders it (05 §3). */
128
+ /**
129
+ * Which lens renders it.
130
+ * @ruling 05 §3
131
+ */
107
132
  facet?: string;
108
133
  /** For prompts: the authored text fields. */
109
134
  fields?: Record<string, {
@@ -148,35 +173,38 @@ export interface SlotDecl {
148
173
  /**
149
174
  * For template slots: the variables this template may reference.
150
175
  *
151
- * ⚠ Required, and 16 §4 is wrong to imply otherwise. A *source* template renders one
176
+ * ⚠ Required, whatever the design notes imply. A *source* template renders one
152
177
  * item out of a collection, and the item's shape lives inside the port's payload
153
178
  * rather than on the port — so typed ports alone cannot tell an author what
154
179
  * `{{ entry.title }}` is allowed to be. See src/template.ts.
180
+ * @ruling 16 §4
155
181
  */
156
182
  variables?: TemplateScope;
157
183
  /**
158
- * For `scripts` slots: which script types this hook accepts (18 §4a).
184
+ * For `scripts` slots: which script types this hook accepts.
159
185
  *
160
186
  * Pinned ids — `core:script:text/transform@1` — and **part of the content
161
- * hash** (S3): widening or narrowing what a hook accepts changes what an
187
+ * hash**: widening or narrowing what a hook accepts changes what an
162
188
  * untouched spec does, which is the `optional` lesson applied before it is
163
189
  * re-learned. Plain strings rather than the `ScriptKindId` alias, because
164
190
  * scripts.ts already imports from this module and a type-only cycle is
165
191
  * still a cycle.
166
192
  *
167
193
  * The value stored in a scripts slot is an ordered list of script row ids —
168
- * a chain. Transform chains fold; verdict chains reduce (18 §5). The chain
194
+ * a chain. Transform chains fold; verdict chains reduce. The chain
169
195
  * is configuration like any slot value: resolved through the scope chain,
170
196
  * carried by presets, exported with the document.
197
+ * @ruling 18 §4a, S3, 18 §5
171
198
  */
172
199
  accepts?: string[];
173
200
  /**
174
201
  * For `scripts` slots: where the chains apply, as (port, phase) — the
175
- * substrate declaration of 18 §4a. `before` transforms a value entering the
202
+ * substrate's declaration of a port hook. `before` transforms a value entering the
176
203
  * named in-port; `after` transforms what left the named out-port. The
177
204
  * binding never sees a chain and cannot decline one; declaring is all a
178
205
  * type does, which is what makes a plugin's hook trustworthy without
179
- * trusting the plugin (03 §4 symmetry).
206
+ * trusting the plugin.
207
+ * @ruling 18 §4a, 03 §4 symmetry
180
208
  */
181
209
  port?: string;
182
210
  phase?: 'before' | 'after';
@@ -184,10 +212,11 @@ export interface SlotDecl {
184
212
  * For `scripts` slots: read-only context this hook supplies beyond the
185
213
  * port's own variables — a speaker's name, the cast list. In-only **by
186
214
  * construction**: extras have no legal out declaration, so the general
187
- * in-but-not-out rule (18 §6a) covers them with no special case. The
215
+ * in-but-not-out rule covers them with no special case. The
188
216
  * editor offers exactly `ports + extras` as the fixed choices for a
189
217
  * script's declared reads — never a freeform name, which would be a
190
218
  * declaration nothing supplies.
219
+ * @ruling 18 §6a
191
220
  */
192
221
  extras?: string[];
193
222
  /**
@@ -209,7 +238,7 @@ export interface SlotDecl {
209
238
  renders?: Record<string, string>;
210
239
  /**
211
240
  * For `variables` slots: the slot also renders every **band declared
212
- * upstream** of in-port `from` (typed templates P2) — each under its band
241
+ * upstream** of in-port `from` — each under its band
213
242
  * key, through the variable the declaring source names
214
243
  * (`Descriptor.bands`). So `renders` is open: a plugin's source adds a
215
244
  * layout setting here by declaring its band, with no edit to this node.
@@ -219,6 +248,7 @@ export interface SlotDecl {
219
248
  * **Contract** — hashed with the slot: which bands a node renders is what
220
249
  * its template may place.
221
250
  * @experimental
251
+ * @ruling typed templates P2
222
252
  */
223
253
  rendersBands?: {
224
254
  from: string;
@@ -247,7 +277,7 @@ export interface SlotDecl {
247
277
  export type { MemberDecl, FieldDecl, FieldType } from './settings.js';
248
278
  export { fieldLabel, fieldAccepts } from './settings.js';
249
279
  /**
250
- * One interior script point (18 §4e): a named moment inside a binding's work
280
+ * One interior script point: a named moment inside a binding's work
251
281
  * where a user chain may run, and which script kinds may be attached there.
252
282
  *
253
283
  * `accepts` is the attachment rule, on the same terms as `SlotDecl.accepts`
@@ -255,6 +285,7 @@ export { fieldLabel, fieldAccepts } from './settings.js';
255
285
  * than the `ScriptKindId` alias for the reason that field gives: scripts.ts
256
286
  * imports from this module. `label` is display text, stripped from the hash.
257
287
  * @experimental
288
+ * @ruling 18 §4e
258
289
  */
259
290
  export interface ScriptPointDecl {
260
291
  key: string;
@@ -272,11 +303,48 @@ export declare function scriptPointsOf(d: {
272
303
  scriptPoints?: ReadonlyArray<ScriptPointDecl>;
273
304
  }): ScriptPointDecl[];
274
305
  /**
275
- * The message verbs no genre may remove (R-15, ruled 2026-09-15): a person
306
+ * One seam of a definition: a place a script
307
+ * chain may run, named by its seam address.
308
+ * @experimental
309
+ * @ruling PLAN-script-placement D1
310
+ */
311
+ export interface Seam {
312
+ /** `in:<port>` · `out:<port>` · `<pointKey>` — see `SeamAddress`. */
313
+ at: SeamAddress;
314
+ kind: 'in' | 'out' | 'point';
315
+ /** The `scripts` slot carrying this seam; absent for an interior point. */
316
+ slot?: string;
317
+ /** The port the slot hooks; absent for an interior point. */
318
+ port?: string;
319
+ /** The script kind ids the seam accepts, as declared. */
320
+ accepts: string[];
321
+ /**
322
+ * The seam's OWN extras: a slot's declared `extras`, a point's none. The
323
+ * ambient set (`AMBIENT_SCRIPT_EXTRAS`) is the executor's to add, at every
324
+ * site alike, so it is not repeated here.
325
+ */
326
+ extras: string[];
327
+ description?: I18n;
328
+ }
329
+ /**
330
+ * A definition's seams, in run order — the one place that order is computed:
331
+ * `in:` seams in slot declaration order, then interior points in declaration
332
+ * order, then `out:` seams in slot declaration order. Reads `scripts`-kind
333
+ * slots and `scriptPointsOf`; works on a registry row as well as a
334
+ * descriptor, since rows carry slot declarations verbatim.
335
+ * @experimental
336
+ */
337
+ export declare function seamsOf(d: {
338
+ slots?: Record<string, unknown>;
339
+ scriptPoints?: ReadonlyArray<ScriptPointDecl>;
340
+ }): Seam[];
341
+ /**
342
+ * The message verbs no genre may remove (ruled 2026-09-15): a person
276
343
  * can always stop a reply, branch a session and rewrite a line. Not keys of
277
344
  * `SessionShape.messageVerbs`; a declaration naming one `false` is refused
278
345
  * at registration (`assertMessageVerbFloors`).
279
346
  * @experimental
347
+ * @ruling R-15
280
348
  */
281
349
  export declare const MESSAGE_VERB_FLOORS: readonly ['stop', 'branch', 'edit'];
282
350
  /** @experimental */
@@ -298,7 +366,7 @@ export declare const MESSAGE_VERBS: readonly ["retry", "extend", "stepBack", "de
298
366
  /** @experimental */
299
367
  export type MessageVerb = (typeof MESSAGE_VERBS)[number];
300
368
  /**
301
- * The turn controls (lair pass B7 + B8, 2026-09-27) — the composer's presses
369
+ * The turn controls — the composer's presses
302
370
  * that move the story on, as opposed to the message verbs, which act on one
303
371
  * row. Keys of `SessionShape.turnControls`, in the order the extra venue
304
372
  * draws them.
@@ -312,8 +380,8 @@ export type MessageVerb = (typeof MESSAGE_VERBS)[number];
312
380
  * - `narrate` fires a **narrator turn** (`sessions:fireTurn` with a `null`
313
381
  * ref the order does not hold) — only a `voice: 'narrator'` genre has a
314
382
  * narrator to fire (`turnControlDefault`).
315
- * - `retake` is **Regenerate the last turn, as a whole** (lair pass R2,
316
- * owner 2026-09-28; label _Regenerate_, `sessions:retakeTurn`): it
383
+ * - `retake` is **Regenerate the last turn, as a whole** (label
384
+ * _Regenerate_, `sessions:retakeTurn`): it
317
385
  * deletes the newest turn's **turn yield** — every row that turn's run
318
386
  * created, on every channel, never a person's own line — and takes the
319
387
  * same turn again. ⚠ Not `retry`, the message verb that rewrites ONE
@@ -321,6 +389,7 @@ export type MessageVerb = (typeof MESSAGE_VERBS)[number];
321
389
  * declares it (`turnControlDefault`): a genre whose turn writes one row
322
390
  * keeps `retry`.
323
391
  * @experimental
392
+ * @ruling lair pass B7 + B8 (2026-09-27), lair pass R2 (owner 2026-09-28)
324
393
  */
325
394
  export declare const TURN_CONTROLS: readonly ['advance', 'pick', 'narrate', 'retake'];
326
395
  /** @experimental */
@@ -328,7 +397,7 @@ export type TurnControl = (typeof TURN_CONTROLS)[number];
328
397
  /**
329
398
  * What an undeclared turn control resolves to — read off the shape's own
330
399
  * declarations, so a genre that says nothing keeps what its shape already
331
- * means (R42: turn controls only where there is somebody to take a turn):
400
+ * means (turn controls only where there is somebody to take a turn):
332
401
  *
333
402
  * - `advance` and `pick` are on where the shape has a **character system**
334
403
  * (`characters` declared with a `max` other than 0; an unreadable shape
@@ -338,6 +407,7 @@ export type TurnControl = (typeof TURN_CONTROLS)[number];
338
407
  * - `retake` is never on by default: nothing in a shape says a turn writes
339
408
  * more than one row, so a genre opts in (`turnControls.retake: true`).
340
409
  * @experimental
410
+ * @ruling R42
341
411
  */
342
412
  export declare function turnControlDefault(shape: unknown, control: TurnControl): boolean;
343
413
  /**
@@ -371,11 +441,12 @@ export type TurnControlPolicy = Record<TurnControl, TurnControlPresence>;
371
441
  * (`turnControlDefault`), `false` takes it away, `true` or an object offers it. Pure, and
372
442
  * takes `unknown` for a stored shape.
373
443
  *
374
- * With a `channel` (a slug or `slug:lane`; lair re-plan R6), that channel's
444
+ * With a `channel` (a slug or `slug:lane`), that channel's
375
445
  * declared `ChannelDecl.turnControls` win over the genre's, key by key — the
376
446
  * `messageVerbs` merge. A channel the shape does not declare in the long
377
447
  * form answers the genre's policy.
378
448
  * @experimental
449
+ * @ruling lair re-plan R6
379
450
  */
380
451
  export declare function resolveTurnControls(shape: unknown, channel?: string): TurnControlPolicy;
381
452
  /**
@@ -399,10 +470,11 @@ export declare function turnControlPresent(policy: TurnControlPolicy, control: T
399
470
  */
400
471
  export declare function assertTurnControls(shape: SessionShape | undefined, who: string): void;
401
472
  /**
402
- * The writes a genre may switch off (R-B, 2026-09-17) — what a session does
473
+ * The writes a genre may switch off — what a session does
403
474
  * *beyond messages*. Keys of `SessionShape.writes`, in the order a policy
404
475
  * reads them.
405
476
  * @experimental
477
+ * @ruling R-B (2026-09-17)
406
478
  */
407
479
  export declare const SESSION_WRITES: readonly ['lore', 'scenes'];
408
480
  /** @experimental */
@@ -430,11 +502,11 @@ export declare function resolveWrites(shape: unknown): SessionWritePolicy;
430
502
  */
431
503
  export declare function assertSessionWrites(shape: SessionShape | undefined, who: string): void;
432
504
  /**
433
- * The five built-in writes (R-15), by the verb a person knows them as: the
505
+ * The five built-in writes, by the verb a person knows them as: the
434
506
  * one-node spec core runs for each, and the outlet that spec ends in.
435
507
  *
436
508
  * Here rather than only in the core catalog because the **validator** needs
437
- * them (U5b review W8): a built-in outlet performs the item rule's write —
509
+ * them: a built-in outlet performs the item rule's write —
438
510
  * the handler judged who may act on which row before the run began — so a
439
511
  * spec that is not the built-in's own placing one would perform that write
440
512
  * with nobody having judged anything. `validate()` refuses the placement
@@ -443,6 +515,7 @@ export declare function assertSessionWrites(shape: SessionShape | undefined, who
443
515
  * permission letting a plugin spec place one is the future this leaves room
444
516
  * for; it is not granted today.
445
517
  * @internal
518
+ * @ruling R-15, U5b review W8
446
519
  */
447
520
  export declare const BUILTIN_SPEC_IDS: Readonly<{
448
521
  readonly delete: 'core:spec/builtin-delete';
@@ -466,7 +539,7 @@ export declare const isBuiltInOutlet: (definitionId: string) => boolean;
466
539
  /** Is this spec id one of the five built-in specs — the only documents that may place a built-in outlet? @internal */
467
540
  export declare const isBuiltInSpec: (specId: string) => boolean;
468
541
  /**
469
- * The form-answer pair (plans/29 R-15 *Forms*; 30 §U5d, built 2026-09-17):
542
+ * The form-answer pair (built 2026-09-17):
470
543
  * the inlet `core:event/form-addressed@1` lands on, and the outlet that
471
544
  * commits an oracle's answer exactly as a click would. The outlet may be
472
545
  * placed only in a document whose inlet is the form-addressed one
@@ -475,12 +548,13 @@ export declare const isBuiltInSpec: (specId: string) => boolean;
475
548
  * form to answer — a spec placing it elsewhere would fire an action as
476
549
  * somebody nobody asked.
477
550
  * @internal
551
+ * @ruling plans/29 R-15 *Forms*, 30 §U5d
478
552
  */
479
553
  export declare const FORM_ADDRESSED_INLET_ID = "core:inlet/form-addressed@1";
480
554
  /** @experimental */
481
555
  export declare const ANSWER_FORM_OUTLET_ID = "core:outlet/answer-form@1";
482
556
  /**
483
- * The review-fields rule (R-15 *The review gate*; 30 §U5d): a definition
557
+ * The review-fields rule: a definition
484
558
  * with `effects: 'write' | 'external'` declares `review: { fields }` — what a
485
559
  * reviewer may edit at the gate, `[]` when nothing (approve or refuse). A
486
560
  * definition that declares none still registers and still gates — the form
@@ -490,6 +564,7 @@ export declare const ANSWER_FORM_OUTLET_ID = "core:outlet/answer-form@1";
490
564
  * to such a definition, so a shipped effectful definition without one is
491
565
  * visible rather than silent. Every core definition declares one.
492
566
  * @experimental
567
+ * @ruling R-15 *The review gate*, 30 §U5d
493
568
  */
494
569
  export declare function reviewFieldsFinding(d: {
495
570
  id: string;
@@ -527,13 +602,14 @@ export interface PortDecl {
527
602
  * open `PortDecl`, so nothing that ignores the generics changes.
528
603
  */
529
604
  /**
530
- * The chat-shape contract a mode-bearing input type carries (19 §1). See
605
+ * The chat-shape contract a mode-bearing input type carries. See
531
606
  * `Descriptor.shape` for the rules; this is the vocabulary.
532
607
  *
533
608
  * Bounds omit `max` for "unlimited" and omit the whole capability for "does
534
609
  * not exist here". Every field is optional so the standard mode can state
535
610
  * today's behaviour exactly and a prose mode can state almost nothing.
536
611
  * @experimental
612
+ * @ruling 19 §1
537
613
  */
538
614
  export interface SessionShape {
539
615
  /** The character system: toggles, ordering, pickers, cast rows. */
@@ -559,23 +635,26 @@ export interface SessionShape {
559
635
  */
560
636
  fields?: SettingsSchema;
561
637
  /**
562
- * Does the session settings form offer a **Scenario** field (§4.11,
563
- * R12)? Declared, never assumed: core's chat, adventure and lair say
638
+ * Does the session settings form offer a **Scenario** field? Declared,
639
+ * never assumed: core's chat, adventure and lair say
564
640
  * `true`; guide says `false`. Absent = no field.
641
+ * @ruling §4.11, R12
565
642
  */
566
643
  scenario?: boolean;
567
644
  /**
568
- * Does the session settings form offer **Tags** (§4.11, R12)? `true` for
645
+ * Does the session settings form offer **Tags**? `true` for
569
646
  * every core genre. Absent = no tags section.
647
+ * @ruling §4.11, R12
570
648
  */
571
649
  tags?: boolean;
572
650
  /**
573
651
  * Whether creating a chat of this mode seeds the cast's greeting messages,
574
- * and on which channel (20 §7). Absent means the default — **on, on
652
+ * and on which channel. Absent means the default — **on, on
575
653
  * `main`** — so a custom input node gets the standard chat's welcoming
576
654
  * behaviour for free and turns it off or redirects it only if it wants to.
577
655
  * Core's `user-message` input declares it explicitly so the reusable case
578
656
  * reads at a glance.
657
+ * @ruling 20 §7
579
658
  */
580
659
  greeting?: {
581
660
  /** Seed character greetings on creation. Default true. */
@@ -584,7 +663,7 @@ export interface SessionShape {
584
663
  channel?: string;
585
664
  };
586
665
  /**
587
- * Which message verbs sessions of this genre offer (20 §4; R-15, ruled
666
+ * Which message verbs sessions of this genre offer (ruled
588
667
  * 2026-09-15). Absent means all on — the standard chat's posture. Core
589
668
  * owns the mechanics and integrity rules; this only declares
590
669
  * *availability*, checked server-side at the verb (presence is
@@ -609,6 +688,7 @@ export interface SessionShape {
609
688
  * ⚠ `extend` here is the **prefill** extend — carry one reply on. The
610
689
  * composer's Continue, which fires the next turn, is a turn control
611
690
  * (`turnControls.advance`), switched separately.
691
+ * @ruling 20 §4, R-15
612
692
  */
613
693
  messageVerbs?: {
614
694
  retry?: boolean;
@@ -620,7 +700,7 @@ export interface SessionShape {
620
700
  };
621
701
  /**
622
702
  * Which turn controls sessions of this genre offer, and when each is
623
- * present (lair pass B7 + B8, 2026-09-27). Absent is the shape's
703
+ * present. Absent is the shape's
624
704
  * default (`turnControlDefault`: Continue and Pick where there is a
625
705
  * character system, narrate where there is a narrator). A
626
706
  * control is `true`, `false`, or `{ presentWhen }` — enabled-when
@@ -634,9 +714,10 @@ export interface SessionShape {
634
714
  * genre whose composed reply cannot be extended mid-sentence switches
635
715
  * that off and keeps this.
636
716
  *
637
- * `retake` is **Regenerate the last turn** (R2, 2026-09-28) — delete the
717
+ * `retake` is **Regenerate the last turn** — delete the
638
718
  * newest turn's yield and take the turn again. Never on by default: a
639
719
  * genre whose turn writes several rows declares it.
720
+ * @ruling lair pass B7 + B8 (2026-09-27), R2 (2026-09-28)
640
721
  */
641
722
  turnControls?: {
642
723
  advance?: TurnControlDecl;
@@ -645,7 +726,7 @@ export interface SessionShape {
645
726
  retake?: TurnControlDecl;
646
727
  };
647
728
  /**
648
- * What sessions of this genre may write beyond messages (R-B, 2026-09-17).
729
+ * What sessions of this genre may write beyond messages.
649
730
  * Absent = both on — the standard chat's posture. Enforced server-side at
650
731
  * the write, like `messageVerbs`: presence is presentation, refusal is the
651
732
  * law.
@@ -660,6 +741,7 @@ export interface SessionShape {
660
741
  * The lever is about what a **session** does. Editing the same lorebook
661
742
  * from the lorebook screens is untouched: that is a person at a book, not
662
743
  * a session writing through one.
744
+ * @ruling R-B (2026-09-17)
663
745
  */
664
746
  writes?: {
665
747
  /** May a session of this genre add lore entries to its lorebook? */
@@ -668,17 +750,29 @@ export interface SessionShape {
668
750
  scenes?: boolean;
669
751
  };
670
752
  /**
671
- * Which surface renders sessions of this mode (20 §12). Absent means
753
+ * 🚧 How sessions of this genre place their **scene boundaries** while
754
+ * they are played, and when a scene's summary runs — the genre's default,
755
+ * which a session may override (`resolveSceneSettings`). Absent is
756
+ * `DEFAULT_SCENE_SETTINGS`: **Suggested**, with *day crossed*, *time
757
+ * action* and *place changed* on, summaries **on request**. Refused at
758
+ * the declaration when it does not read (`assertSceneSettings`). A genre
759
+ * whose `writes.scenes` is `false` places nothing, whatever this says.
760
+ * @ruling PROPOSAL-live-scenes §4, §5, ★1 (2026-10-13)
761
+ */
762
+ scenes?: SceneSettingsDecl;
763
+ /**
764
+ * Which surface renders sessions of this mode. Absent means
672
765
  * core's log — today's behaviour exactly. A plugin id (`acme/crawl`)
673
766
  * names the plugin whose declared `session-view` frame surface replaces
674
767
  * the whole message section: the total-conversion lane. The frame gets
675
768
  * the session over the MessageChannel and returns actions as validated
676
769
  * requests; it forfeits core's in-log chrome deliberately. "Restyle the
677
770
  * standard chat" is blocks, never this.
771
+ * @ruling 20 §12
678
772
  */
679
773
  view?: string;
680
774
  /**
681
- * The session's channels beyond the implicit `main` (20 §7) — filter
775
+ * The session's channels beyond the implicit `main` — filter
682
776
  * lanes inside one session. What renders a channel is the surface story
683
777
  * (a frame subscribes to it); what *stores* it is `messages.channel`; and
684
778
  * pipelines choose which lanes build their context through the history
@@ -700,16 +794,17 @@ export interface SessionShape {
700
794
  * extension data — core stores a string. Parse and format one with
701
795
  * `parseChannel` / `formatChannel`.
702
796
  *
703
- * **A bare string, or a `ChannelDecl`** (R-C, 2026-09-17). The string is
797
+ * **A bare string, or a `ChannelDecl`** (since 2026-09-17). The string is
704
798
  * the whole declaration for the ordinary case and keeps meaning exactly
705
799
  * what it meant — `'phone'` is `{ slug: 'phone', role: 'conversation' }`
706
800
  * with the genre's `voice` and `messageVerbs`. Read the normalised list
707
801
  * with `channelDecls`; a string stays a string in the declaration, so the
708
802
  * content hash of every genre written before this union is unmoved.
803
+ * @ruling 20 §7, R-C (2026-09-17)
709
804
  */
710
805
  channels?: (string | ChannelDecl)[];
711
806
  /**
712
- * The panels a session of this mode offers in the surface grid (21). The
807
+ * The panels a session of this mode offers in the surface grid. The
713
808
  * grid is container-responsive: panels flow into tracks that appear and
714
809
  * disappear with the *content box* width (not the viewport), so opening a
715
810
  * sidebar cascades panels the same way shrinking the window would.
@@ -730,7 +825,7 @@ export interface SessionShape {
730
825
  panels?: WidgetDecl[];
731
826
  }
732
827
  /**
733
- * One channel, declared in full (R-C, 2026-09-17) — the long form of an
828
+ * One channel, declared in full — the long form of an
734
829
  * element of `SessionShape.channels`, where the short form is the slug alone.
735
830
  *
736
831
  * Three things a genre may say about a channel that it cannot say about the
@@ -744,6 +839,7 @@ export interface SessionShape {
744
839
  * which is what makes the union additive: a bare string is this object with
745
840
  * `role: 'conversation'`, the genre's `voice` and the genre's `messageVerbs`.
746
841
  * @experimental
842
+ * @ruling R-C (2026-09-17)
747
843
  */
748
844
  export interface ChannelDecl {
749
845
  /**
@@ -774,20 +870,22 @@ export interface ChannelDecl {
774
870
  */
775
871
  messageVerbs?: SessionShape['messageVerbs'];
776
872
  /**
777
- * The channel's display name (lair re-plan R6, 2026-09-28) — what a
873
+ * The channel's display name — what a
778
874
  * widget header and the composer's channel control call it: the Lair's
779
- * `sanctum` is _Sanctum_. Display text (R-20), normalised by
875
+ * `sanctum` is _Sanctum_. Display text, normalised by
780
876
  * `channelDecls` to a locale map. Absent: readers show the slug, as
781
877
  * before the field existed.
878
+ * @ruling lair re-plan R6 (2026-09-28), R-20
782
879
  */
783
880
  label?: I18n;
784
881
  /**
785
882
  * Which turn controls this channel's composer offers, over the genre's
786
- * `turnControls` (lair re-plan R6) — the `messageVerbs` merge rule:
883
+ * `turnControls` — the `messageVerbs` merge rule:
787
884
  * declared keys win, the rest keep the genre's answer. The Lair's
788
885
  * Sanctum takes Pick who speaks and Regenerate the last turn away and
789
886
  * keeps Continue and Narrate. Read one channel's policy with
790
887
  * `resolveTurnControls(shape, channel)`.
888
+ * @ruling lair re-plan R6
791
889
  */
792
890
  turnControls?: SessionShape['turnControls'];
793
891
  }
@@ -836,9 +934,10 @@ export declare function assertChannelDecls(shape: SessionShape | undefined, who:
836
934
  /** @experimental */
837
935
  export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl = PortDecl, Id extends string = string> {
838
936
  /**
839
- * `namespace:kind/name@N` — and the `@N` is the **type** version, which is a pin
840
- * (01 §3). Distinct from a spec's semver, which is an upgrade key (src/identity.ts).
937
+ * `namespace:kind/name@N` — and the `@N` is the **type** version, which is a pin.
938
+ * Distinct from a spec's semver, which is an upgrade key (src/identity.ts).
841
939
  * Carried in the type so a pinned constructor can expose `.v1()` at the call site.
940
+ * @ruling 01 §3
842
941
  */
843
942
  id: Id;
844
943
  kind: Kind;
@@ -851,20 +950,24 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
851
950
  in?: In;
852
951
  out?: Out;
853
952
  };
854
- /** Oracle/outlet only — the review gate keys on this, not on kind (01 §7). */
953
+ /**
954
+ * Oracle/outlet only — the review gate keys on this, not on kind.
955
+ * @ruling 01 §7
956
+ */
855
957
  effects?: 'none' | 'external' | 'write' | 'emit';
856
958
  /**
857
959
  * An author may default review **on** for their own node. There is no value here
858
- * that forbids it — that is the enforcement, not a rule someone checks (F14).
960
+ * that forbids it — that is the enforcement, not a rule someone checks.
859
961
  *
860
962
  * **Policy**, not contract (`DESCRIPTOR_POLICY_KEYS`): where the gate
861
963
  * starts is offered to the person who configures the node, and moving it
862
964
  * changes no port, shape or behaviour of the node itself.
965
+ * @ruling F14
863
966
  */
864
967
  reviewDefault?: ReviewPosition;
865
968
  /**
866
- * Which of this node's in-ports a reviewer may **edit** at the gate (R-15,
867
- * U5b review C1, 2026-09-16): an allow-list of port names. Absent, the
969
+ * Which of this node's in-ports a reviewer may **edit** at the gate: an
970
+ * allow-list of port names. Absent, the
868
971
  * form is inferred from the whole payload the node received, as it always
869
972
  * was — every field editable. Declared, the form shows these fields and
870
973
  * no other, and a decision that submits any other key is refused with a
@@ -880,7 +983,7 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
880
983
  * among them. `fields: []` is a legitimate declaration: approve or
881
984
  * reject, nothing to edit (a delete).
882
985
  *
883
- * **Contract** (`DESCRIPTOR_CONTRACT_KEYS`, plans/31 V6): `fields` is the
986
+ * **Contract** (`DESCRIPTOR_CONTRACT_KEYS`): `fields` is the
884
987
  * list a decision is validated against, so a pinned spec's review form
885
988
  * and the keys its decisions may carry run against it — widening or
886
989
  * narrowing the list moves the hash.
@@ -888,6 +991,7 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
888
991
  * Read from the in-process definition, and carried on the registry row
889
992
  * (`RegistryEntry.review`) so a `transport: process` plugin outlet's form
890
993
  * can be read without loading the plugin.
994
+ * @ruling R-15, U5b review C1 (2026-09-16), plans/31 V6
891
995
  */
892
996
  review?: {
893
997
  fields: readonly string[];
@@ -895,9 +999,10 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
895
999
  /** Connection kind for providers (== produced shape). Contract. */
896
1000
  shape?: ShapeId;
897
1001
  /**
898
- * May this node be switched off? Requires shape transparency (01 §14
899
- * F-toggleable). **Policy** — what the panel offers; the switch itself is
1002
+ * May this node be switched off? Requires shape transparency. **Policy** —
1003
+ * what the panel offers; the switch itself is
900
1004
  * a setting, and the node runs the same either side of it.
1005
+ * @ruling 01 §14 F-toggleable
901
1006
  */
902
1007
  toggleable?: boolean;
903
1008
  /**
@@ -926,53 +1031,56 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
926
1031
  */
927
1032
  optional?: boolean;
928
1033
  /**
929
- * Declares it consumes the run seed — keeps Tasks pure (F11). **Contract**:
1034
+ * Declares it consumes the run seed — keeps Tasks pure. **Contract**:
930
1035
  * a replay with the same seed is only a replay while the set of nodes
931
1036
  * drawing on it is the set the document was compiled against.
1037
+ * @ruling F11
932
1038
  */
933
1039
  declaresRandomness?: boolean;
934
1040
  /**
935
- * Declared, not bound (plans/29 R-2, 2026-09-17).
1041
+ * Declared, not bound.
936
1042
  *
937
- * A definition core publishes because a plan owns it — `speak` (plans/14),
938
- * the two MCP oracles (plans/28) — while no handler implements it yet. The
1043
+ * A definition core publishes because a plan owns it — `speak`,
1044
+ * the two MCP oracles — while no handler implements it yet. The
939
1045
  * flag is what stops the gap from being invisible: the registry row reads
940
1046
  * `status: 'provisional'` and is badged; every listing that OFFERS
941
1047
  * definitions leaves it out; `validate()` refuses a document placing it
942
- * (law R-2, *bind it or remove the node*); and the executor refuses to run
1048
+ * (the provisional-definition law: *bind it or remove the node*); and the executor refuses to run
943
1049
  * the node with the same sentence, so a document that reached it by another
944
1050
  * door halts legibly rather than on "no binding registered".
945
1051
  *
946
- * **Policy, never hashed** (plans/31 V6, 2026-09-17 — reversing U6's
947
- * choice): what is *offered* is policy and what *runs* is contract, and
1052
+ * **Policy, never hashed** (since 2026-09-17): what is *offered* is policy
1053
+ * and what *runs* is contract, and
948
1054
  * this flag decides only the first. The day the handler lands the pin
949
1055
  * stays where it is; the registry row's `status` moves from
950
1056
  * `provisional` to `live` on the next sync, and the receipts that named
951
1057
  * the hash still describe the same contract. `true` or absent, never
952
1058
  * `false`: a definition is either provisional or it is not.
1059
+ * @ruling plans/29 R-2 (2026-09-17), plans/14, plans/28, plans/31 V6 (2026-09-17 — reversing U6's choice)
953
1060
  */
954
1061
  provisional?: true;
955
1062
  /**
956
- * Interior script points (18 §4e): named moments *inside* the binding's
1063
+ * Interior script points: named moments *inside* the binding's
957
1064
  * work where user text-transform chains may run — a drafting loop's
958
1065
  * intermediate texts. Declared here so "which nodes can run scripts, and
959
1066
  * where" is answerable from the document; the binding invokes one with
960
1067
  * `ctx.scripts.applyText(key, text)` and gets no `ctx.scripts` at all
961
1068
  * without a declaration. **Part of the hashed contract** — a point
962
1069
  * appearing or vanishing, or what it `accepts`, changes what an untouched
963
- * spec's configuration can reach (S3's argument, one construct over).
1070
+ * spec's configuration can reach (the content-hash argument, one construct over).
964
1071
  * `label`/`description` are display text and stripped from the hash as
965
1072
  * everywhere.
966
1073
  *
967
- * A point declares what it **accepts** (R-11, ruled 2026-09-15; 18 §4e):
1074
+ * A point declares what it **accepts** (ruled 2026-09-15):
968
1075
  * the executor hands that list to the applier, which refuses a link of any
969
1076
  * other kind — it hardcoded `text/transform` until 2026-09-16. Read the
970
1077
  * list through `scriptPointsOf`. A bare-string point (`'each-draft'`) is
971
1078
  * refused at `register()` — the spelling was retired without an alias.
1079
+ * @ruling 18 §4e, S3, R-11
972
1080
  */
973
1081
  scriptPoints?: ScriptPointDecl[];
974
1082
  /**
975
- * The chat-shape contract (19 §0–§1) — present **only on input types**,
1083
+ * The chat-shape contract — present **only on input types**,
976
1084
  * and its presence is what makes the input type a **chat mode**. The mode
977
1085
  * id is this type's id; any spec pinning it and matching the primary-write
978
1086
  * signature is in the mode's bucket, by construction.
@@ -992,27 +1100,30 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
992
1100
  * through this input's published document. Duties and triggers are
993
1101
  * deliberately NOT here: the shape is owner-only, and event functions
994
1102
  * beyond the intrinsic composer are contributed by the specs that serve
995
- * them (19 §3–§4), so a mode never has to know its narrator exists.
1103
+ * them, so a mode never has to know its narrator exists.
996
1104
  *
997
1105
  * Named `sessionShape` because `shape` was already taken by the provider
998
1106
  * connection kind above — renaming *that* would re-hash every provider
999
1107
  * on the instance for a word.
1108
+ * @ruling 19 §0–§1, 19 §3–§4
1000
1109
  */
1001
1110
  sessionShape?: SessionShape;
1002
1111
  /**
1003
- * May finish before an upstream stream ends (01 §11). **Contract**: a
1112
+ * May finish before an upstream stream ends. **Contract**: a
1004
1113
  * stream consumer that may return early and one that must drain are two
1005
1114
  * different things to wire a stream into.
1115
+ * @ruling 01 §11
1006
1116
  */
1007
1117
  earlyExit?: boolean;
1008
1118
  /**
1009
- * Public pipeline hooks may be pinned by any spec (01 §9b). **Policy**:
1119
+ * Public pipeline hooks may be pinned by any spec. **Policy**:
1010
1120
  * who may pin it is decided at install, not run — a spec that already
1011
1121
  * pins it runs against the same contract either way.
1122
+ * @ruling 01 §9b
1012
1123
  */
1013
1124
  public?: boolean;
1014
1125
  /**
1015
- * F36 — every hook invocation is bounded. **Policy**, both of them: how
1126
+ * Every hook invocation is bounded. **Policy**, both of them: how
1016
1127
  * long the host waits is the host's to tune, and a spec's document is
1017
1128
  * indifferent to it.
1018
1129
  *
@@ -1023,14 +1134,16 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1023
1134
  * bounds the whole. Declare `'idle'` for work whose length is honest but
1024
1135
  * unknown — a streamed reply, a model loading — and `'wall'` for work
1025
1136
  * that should simply be quick.
1137
+ * @ruling F36
1026
1138
  */
1027
1139
  timeoutMs?: number;
1028
1140
  timeoutKind?: 'wall' | 'idle';
1029
1141
  /**
1030
- * Which core event a write causes. Declared here, never per spec (01 §8).
1142
+ * Which core event a write causes. Declared here, never per spec.
1031
1143
  * Refused at registration unless that event's `causedBy` names this
1032
- * definition (R33): `EventDef.causedBy` is the one authored statement of
1144
+ * definition: `EventDef.causedBy` is the one authored statement of
1033
1145
  * what causes what, and this field must agree with it.
1146
+ * @ruling 01 §8, R33
1034
1147
  */
1035
1148
  causesEvent?: string;
1036
1149
  /**
@@ -1040,16 +1153,17 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1040
1153
  */
1041
1154
  causesEventFrom?: string;
1042
1155
  /**
1043
- * Inlet only (R33, PLAN-turn-order §4.14): the event payload shapes this
1156
+ * Inlet only: the event payload shapes this
1044
1157
  * inlet reads. A spec may lock one inlet to several events (`{ genre,
1045
1158
  * events }`) only when every listed event's `payload` is here; an inlet
1046
1159
  * that declares none answers one event. `core:inlet/session-event@1`
1047
1160
  * declares the session payloads.
1161
+ * @ruling R33, PLAN-turn-order §4.14
1048
1162
  */
1049
1163
  payloads?: ShapeId[];
1050
1164
  /**
1051
1165
  * Outlet only: the row this outlet commits becomes the run's **live row**
1052
- * (R-21 (2)) — where core routes an oracle's stream, and what Stop
1166
+ * — where core routes an oracle's stream, and what Stop
1053
1167
  * finalises when a run is cancelled with nothing left to run.
1054
1168
  *
1055
1169
  * Declared rather than inferred from the event the write causes, because
@@ -1063,7 +1177,8 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1063
1177
  * it only when it is a row still being written — its `generating` in-port
1064
1178
  * fed truthy, or its `row` in-port claiming an existing row
1065
1179
  * (`LIVE_ROW_PORTS`, `opensLiveRow`). A complete message written by the
1066
- * same outlet is an ordinary write (F7, W1).
1180
+ * same outlet is an ordinary write.
1181
+ * @ruling R-21 (2), F7, W1
1067
1182
  */
1068
1183
  liveRow?: boolean;
1069
1184
  /**
@@ -1105,7 +1220,7 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1105
1220
  entryShape?: EntryShape;
1106
1221
  /**
1107
1222
  * The bands this source publishes, each with the variable that lays it out
1108
- * (typed templates P2, 2026-09-27) — `{ secretEntry: varSecretEntry }`.
1223
+ * — `{ secretEntry: varSecretEntry }`.
1109
1224
  *
1110
1225
  * A band is the ranker's word for one source's slice of the window, named
1111
1226
  * at the head of the source's candidates (`bandIntent`). Declared here, it
@@ -1124,9 +1239,10 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1124
1239
  * which bands a step produces moves the hash — hashed as `{ key:
1125
1240
  * variableId }`, key order ignored. It still rides the registry row's
1126
1241
  * `policy` as `{ key: variableId }`, so a host reads a plugin's bands
1127
- * without loading the plugin (F6), and `definitionContract` reads it back
1242
+ * without loading the plugin, and `definitionContract` reads it back
1128
1243
  * from there to the same hash.
1129
1244
  * @experimental
1245
+ * @ruling typed templates P2 (2026-09-27), F6
1130
1246
  */
1131
1247
  bands?: Record<string, VariableDecl>;
1132
1248
  /**
@@ -1148,7 +1264,7 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1148
1264
  bandPorts?: Record<string, readonly string[]>;
1149
1265
  /**
1150
1266
  * What each out-port's payload looks like, in the template type language
1151
- * (typed templates P1) — `{ out: { templateContext: { type: 'object', … } } }`.
1267
+ * — `{ out: { templateContext: { type: 'object', … } } }`.
1152
1268
  *
1153
1269
  * A port says which shape flows; this says what is inside it, which is what
1154
1270
  * a template editor needs to offer `{{ templateContext.char }}` with a type.
@@ -1159,10 +1275,22 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1159
1275
  * in the slots). Like `bands`, it rides the row's `policy` verbatim and is
1160
1276
  * hashed from there.
1161
1277
  * @experimental
1278
+ * @ruling typed templates P1
1162
1279
  */
1163
1280
  portSchemas?: {
1164
1281
  out?: Record<string, VarField>;
1165
1282
  };
1283
+ /**
1284
+ * What this model call runs best on — the soft twin of `requires`:
1285
+ * a seeded sampling preset and a
1286
+ * tier. Grades and suggestions read it; nothing refuses on it. A spec may
1287
+ * state its own on the placement (`NodeOpts.prefers`), which wins.
1288
+ *
1289
+ * **Policy** (`DESCRIPTOR_POLICY_KEYS`): it is what is *suggested*, and
1290
+ * changing it moves no pin. Rides the registry row's `policy`.
1291
+ * @experimental
1292
+ */
1293
+ prefers?: Prefers;
1166
1294
  }
1167
1295
  /**
1168
1296
  * A descriptor's display text, beyond the `i18n`/`description` pair every
@@ -1194,7 +1322,7 @@ export interface Descriptor<Out extends PortDecl = PortDecl, In extends PortDecl
1194
1322
  */
1195
1323
  export declare const DESCRIPTOR_DISPLAY_KEYS: DisplayKeys;
1196
1324
  /**
1197
- * The two halves of a `Descriptor` (plans/31 V6, ruled 2026-09-17).
1325
+ * The two halves of a `Descriptor` (ruled 2026-09-17).
1198
1326
  *
1199
1327
  * **Contract** is what a pinned spec runs against: the ports and shapes a
1200
1328
  * document was compiled against, the slots it configures and their schema,
@@ -1217,10 +1345,11 @@ export declare const DESCRIPTOR_DISPLAY_KEYS: DisplayKeys;
1217
1345
  * is classified before it exists; `sdk-tests/contract.test.ts` gives the
1218
1346
  * one-line reason per field.
1219
1347
  * @experimental
1348
+ * @ruling plans/31 V6
1220
1349
  */
1221
1350
  export declare const DESCRIPTOR_CONTRACT_KEYS: readonly ["id", "kind", "ports", "slots", "effects", "review", "shape", "optional", "declaresRandomness", "scriptPoints", "sessionShape", "earlyExit", "causesEvent", "causesEventFrom", "payloads", "liveRow", "media", "entryShape", "bands", "bandPorts", "portSchemas"];
1222
1351
  /** @experimental */
1223
- export declare const DESCRIPTOR_POLICY_KEYS: readonly ["i18n", "reviewDefault", "toggleable", "provisional", "public", "timeoutMs", "timeoutKind", "usage"];
1352
+ export declare const DESCRIPTOR_POLICY_KEYS: readonly ["i18n", "reviewDefault", "toggleable", "provisional", "public", "timeoutMs", "timeoutKind", "usage", "prefers"];
1224
1353
  /** @experimental */
1225
1354
  export type DescriptorContractKey = (typeof DESCRIPTOR_CONTRACT_KEYS)[number];
1226
1355
  /** @experimental */
@@ -1263,6 +1392,8 @@ export interface DefinitionPolicy {
1263
1392
  portSchemas?: {
1264
1393
  out?: Record<string, VarField>;
1265
1394
  };
1395
+ /** `Descriptor.prefers`, verbatim. */
1396
+ prefers?: Prefers;
1266
1397
  }
1267
1398
  /** A definition's policy, projected — `undefined` keys dropped so a row and a re-read agree. @experimental */
1268
1399
  export declare function definitionPolicy(d: {
@@ -1276,6 +1407,7 @@ export declare function definitionPolicy(d: {
1276
1407
  portSchemas?: {
1277
1408
  out?: Record<string, VarField>;
1278
1409
  };
1410
+ prefers?: Prefers;
1279
1411
  }): DefinitionPolicy;
1280
1412
  /**
1281
1413
  * What `definitionContract` reads. A `Descriptor` satisfies it, and so does a
@@ -1286,10 +1418,11 @@ export declare function definitionPolicy(d: {
1286
1418
  * from either, which is what lets core hash a row it read back and get the
1287
1419
  * hash it was written under.
1288
1420
  *
1289
- * Script kinds ride the same registry rows (18 §2), so a row's `semantics` is
1421
+ * Script kinds ride the same registry rows, so a row's `semantics` is
1290
1422
  * contract here too. Their own re-declaration guard (`scripts.ts`) hashes the
1291
1423
  * declaration whole and is not this function.
1292
1424
  * @experimental
1425
+ * @ruling 18 §2
1293
1426
  */
1294
1427
  export interface ContractSource {
1295
1428
  /** `ns:kind/name@N` on a descriptor; bare beside `version` on a row. */
@@ -1397,16 +1530,17 @@ export declare function definitionContract(source: ContractSource): DefinitionCo
1397
1530
  */
1398
1531
  export declare function definitionContractHash(source: ContractSource): string;
1399
1532
  /**
1400
- * The extras every script site is offered, whatever its slot lists (R32,
1401
- * PLAN-turn-order §4.14): `session`, the run's settings document. The
1533
+ * The extras every script site is offered, whatever its slot lists:
1534
+ * `session`, the run's settings document. The
1402
1535
  * executor supplies them at every site — a slot's port hook and an interior
1403
1536
  * point alike — so a slot's `extras` names only what is particular to it,
1404
- * and listing an ambient one is refused (one way to say it, R26).
1537
+ * and listing an ambient one is refused (one way to say it).
1405
1538
  * @internal
1539
+ * @ruling R32, PLAN-turn-order §4.14, R26
1406
1540
  */
1407
1541
  export declare const AMBIENT_SCRIPT_EXTRAS: readonly ['session'];
1408
1542
  /**
1409
- * Can `swap` stand in for `pinned` at node `key` (R28)? A swap is seated with
1543
+ * Can `swap` stand in for `pinned` at node `key`? A swap is seated with
1410
1544
  * the pin's node config, so it must be the same kind with the same in- and
1411
1545
  * out-ports (by name and shape) and the same slots — a slot the pin's node
1412
1546
  * does not wire would never reach the swap, and a person would pick an
@@ -1414,24 +1548,27 @@ export declare const AMBIENT_SCRIPT_EXTRAS: readonly ['session'];
1414
1548
  * chain is configured on the node key, whatever sits there. One sentence
1415
1549
  * for the builder and the package pass alike.
1416
1550
  * @experimental
1551
+ * @ruling R28
1417
1552
  */
1418
1553
  export declare function swapFitFinding(key: string, pinned: Pick<Descriptor, 'id' | 'kind' | 'ports' | 'slots'>, swap: Pick<Descriptor, 'id' | 'kind' | 'ports' | 'slots'> & {
1419
1554
  provisional?: true;
1420
1555
  }): string | undefined;
1421
1556
  /**
1422
- * Can one inlet answer every event of an `events` lock (R33)? Each listed
1557
+ * Can one inlet answer every event of an `events` lock? Each listed
1423
1558
  * event must carry a payload the inlet declares it reads; an inlet that
1424
1559
  * declares none answers one event only. One sentence for the builder and
1425
1560
  * the package pass alike.
1426
1561
  * @experimental
1562
+ * @ruling R33
1427
1563
  */
1428
1564
  export declare function eventsLockFindings(inlet: Pick<Descriptor, 'id' | 'payloads'>, events: readonly string[]): string[];
1429
1565
  /**
1430
- * The display text of a list of widget declarations (R-20): each `title`
1566
+ * The display text of a list of widget declarations: each `title`
1431
1567
  * (required — the chrome and the tray show it) and each `settings` schema.
1432
1568
  * Shared by a session shape's `panels` and a genre's shape, which carry the
1433
1569
  * same declarations.
1434
1570
  * @experimental
1571
+ * @ruling R-20
1435
1572
  */
1436
1573
  export declare function widgetDeclsFindings(raw: unknown, where: string): string[];
1437
1574
  /** @experimental */
@@ -1555,12 +1692,13 @@ export type EntrySourceKind = (typeof ENTRY_SOURCE_KINDS)[number];
1555
1692
  *
1556
1693
  * Closed to the names the importer reads: the three every file has carried,
1557
1694
  * plus `location` and `item`, which the app's importer restores as a place and
1558
- * an item (lorebooks plan A26 — written as world lore, a place reads back
1695
+ * an item (written as world lore, a place reads back
1559
1696
  * without its links' meaning or its stats). A type outside them declares
1560
1697
  * nothing here: no marker is honest, where a marker no importer reads is a
1561
1698
  * file that round-trips into the wrong shape. Widening the list is a
1562
1699
  * deliberate act with an importer change beside it.
1563
1700
  * @experimental
1701
+ * @ruling lorebooks plan A26
1564
1702
  */
1565
1703
  export declare const ENTRY_EXPORT_KEYS: readonly ['world', 'character', 'history', 'location', 'item'];
1566
1704
  /** @experimental */
@@ -1647,8 +1785,8 @@ export interface EntryShape {
1647
1785
  * in the one field language (settings.ts), rendered by the one form
1648
1786
  * renderer, and projected into constraints and indexes by one boot step.
1649
1787
  *
1650
- * Only the **T1 declarative** subset projects into a constraint: required,
1651
- * type, min/max, enum. T2 predicates (`showIf`) are UI-level and depend on
1788
+ * Only the **declarative** constraints project into a constraint: required,
1789
+ * type, min/max, enum. Predicates (`showIf`) are UI-level and depend on
1652
1790
  * state a row does not carry.
1653
1791
  */
1654
1792
  fields?: SettingsSchema;
@@ -1694,7 +1832,11 @@ export type EntryDescriptor<Id extends string = string> = Descriptor<PortDecl, P
1694
1832
  export declare const describeEntryType: <const Id extends string>(d: EntryTypeDecl<Id>) => EntryDescriptor<Id>;
1695
1833
  /** Every entry type this build declares. @internal */
1696
1834
  export declare const allEntryTypes: () => EntryDescriptor[];
1697
- /** A conformance finding. Every one names what to do, as everywhere here (15 §1.3). @experimental */
1835
+ /**
1836
+ * A conformance finding. Every one names what to do, as everywhere here.
1837
+ * @experimental
1838
+ * @ruling 15 §1.3
1839
+ */
1698
1840
  export interface EntryFinding {
1699
1841
  severity: 'error';
1700
1842
  code: 'E_UNKNOWN_ROLE' | 'E_DEAD_ROLE';
@@ -1725,9 +1867,10 @@ export declare function checkEntryTypes(types: ReadonlyArray<{
1725
1867
  }>): EntryFinding[];
1726
1868
  /**
1727
1869
  * A pinned constructor. The builder method names the *kind*; this names the
1728
- * *type and version* (04 §4b). Both are required — drop either and F21 or static
1729
- * pin-checking goes with it.
1870
+ * *type and version*. Both are required — drop either and pin-checking,
1871
+ * at run or static, goes with it.
1730
1872
  * @experimental
1873
+ * @ruling 04 §4b, F21
1731
1874
  */
1732
1875
  export interface NodeSpec<D extends Descriptor<any, any, any> = Descriptor> {
1733
1876
  readonly __node: true;
@@ -1739,7 +1882,7 @@ type VersionOf<S extends string> = S extends `${string}@${infer V}` ? V : '1';
1739
1882
  /** @experimental */
1740
1883
  export type NodeCtor<D extends Descriptor<any, any, any>> = (config?: Record<string, unknown>) => NodeSpec<D>;
1741
1884
  /**
1742
- * A pinned constructor (04 §4b).
1885
+ * A pinned constructor.
1743
1886
  *
1744
1887
  * The builder method names the **kind**; this names the **type and version**, and the
1745
1888
  * version sits at the call site — `generateText.v1({ … })` — for three reasons that a
@@ -1750,6 +1893,7 @@ export type NodeCtor<D extends Descriptor<any, any, any>> = (config?: Record<str
1750
1893
  * - a deprecated pin **strikes through** on `generateText.v1` precisely, because the
1751
1894
  * key is what carries the version
1752
1895
  * @experimental
1896
+ * @ruling 04 §4b
1753
1897
  */
1754
1898
  export type Pinned<D extends Descriptor<any, any, any>> = {
1755
1899
  readonly [K in `v${VersionOf<D['id']>}`]: NodeCtor<D>;
@@ -1762,11 +1906,12 @@ export declare function pin<D extends Descriptor<any, any, any>>(descriptor: D):
1762
1906
  /** The out-port map of whatever a pinned constructor produces — the scope's raw material. @experimental */
1763
1907
  export type OutPortsOf<N> = N extends NodeSpec<infer D> ? D extends Descriptor<infer O, any, any> ? O : PortDecl : PortDecl;
1764
1908
  /**
1765
- * The in-ports that make a `liveRow` outlet's write the run's live row (F7,
1766
- * W1): a placeholder (`generating`) or a claimed row (`row`). Anything else
1909
+ * The in-ports that make a `liveRow` outlet's write the run's live row: a
1910
+ * placeholder (`generating`) or a claimed row (`row`). Anything else
1767
1911
  * the outlet writes is a complete row — an ordinary write, as many as the
1768
1912
  * pipeline likes.
1769
1913
  * @experimental
1914
+ * @ruling F7, W1
1770
1915
  */
1771
1916
  export declare const LIVE_ROW_PORTS: readonly ['generating', 'row'];
1772
1917
  /** Whether a `liveRow` outlet's resolved payload opens the live row (see `LIVE_ROW_PORTS`). @experimental */