@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,5 +1,5 @@
1
1
  /**
2
- * Message blocks (20 §6) — custom message content as **data, not code**.
2
+ * Message blocks — custom message content as **data, not code**.
3
3
  *
4
4
  * A plugin's message part carries a block tree in `data.blocks`; core renders
5
5
  * it with its own components. Nothing to sanitize (no HTML crosses the
@@ -11,17 +11,18 @@
11
11
  * The validator is the write-time gate: a hostile or malformed tree is refused
12
12
  * with the block path named, and the caps make "render whatever a sandboxed
13
13
  * hook produced" a bounded promise. Findings carry a `fix` like every finding
14
- * in this SDK (15 §1.3).
14
+ * in this SDK.
15
+ * @ruling 20 §6, 15 §1.3
15
16
  */
16
17
  import type { SettingsSchema } from './settings.js';
17
18
  import { type EffectsLineDeclarationInput } from './actions.js';
18
19
  import { type ParticipantRef } from './participants.js';
19
20
  /**
20
- * What a `choices` button or a `form` submit fires (U5c review, W-E).
21
+ * What a `choices` button or a `form` submit fires.
21
22
  *
22
23
  * `fn` is the action's **key** — the second half of its identity, the word
23
- * a spec's own block names one of its actions by (plans/31 V2; it was the
24
- * routing *function* until then, and the key of every action core ships was
24
+ * a spec's own block names one of its actions by (it was once the
25
+ * routing *function*, and the key of every action core ships was
25
26
  * already that word). `action` is the
26
27
  * **identity** of the declaration the press is held to, `<spec slug>#<key>`
27
28
  * (`ACTION_IDENTITY`): the server checks THAT action's audience and
@@ -33,13 +34,14 @@ import { type ParticipantRef } from './participants.js';
33
34
  * whose spec declares no action for `fn` — is fired as the legacy shape and
34
35
  * gets the narrowest reading: the owner floor.
35
36
  * @experimental
37
+ * @ruling U5c review, W-E, plans/31 V2
36
38
  */
37
39
  export interface BlockActionRef {
38
40
  fn: string;
39
41
  action?: string;
40
42
  }
41
43
  /**
42
- * A **form** (plans/29 R-15 *Forms*; 30 §U5d, built 2026-09-17) is an
44
+ * A **form** is an
43
45
  * action still awaiting its answer, addressed to an audience and carried in
44
46
  * a message: a `choices` block (one question, several options) or a `form`
45
47
  * block (fields to fill). The two fields below are what make a block a form
@@ -58,8 +60,7 @@ export interface BlockActionRef {
58
60
  * host at the write (`assignBlockIds`) so a fire, a `form-addressed`
59
61
  * event and a `form-answered` change can all name it. Never written by a
60
62
  * spec; one it wrote is kept.
61
- * - **`head`** — the **channel head** the form was issued at (plans/29
62
- * R-15 *Staleness and order*; 30 §U5f, 2026-09-17): the greatest message
63
+ * - **`head`** — the **channel head** the form was issued at: the greatest message
63
64
  * id on the row's channel at the write, stamped by the host
64
65
  * (`assignBlockHead`) — for a fresh write, the row itself. The head
65
66
  * moving past it **stales** the form: unanswered, and a newer message
@@ -78,13 +79,15 @@ export interface BlockActionRef {
78
79
  * enum of these keys). Options of an addressed block must each carry one,
79
80
  * distinct — a question with options must be answerable by key.
80
81
  * @experimental
82
+ * @ruling plans/29 R-15 *Forms*, 30 §U5d (2026-09-17), plans/29 R-15 *Staleness and order*, 30 §U5f (2026-09-17)
81
83
  */
82
84
  export interface FormBlockFields {
83
85
  id?: string;
84
86
  /**
85
- * The channel head at issue (U5f) — a positive message id, the host's
87
+ * The channel head at issue — a positive message id, the host's
86
88
  * stamp. See the module note: staleness is `!answered && head != null &&
87
89
  * headNow > head`, computed by whoever holds the channel.
90
+ * @ruling U5f
88
91
  */
89
92
  head?: number;
90
93
  addressee?: ParticipantRef;
@@ -97,8 +100,8 @@ export interface FormBlockFields {
97
100
  question?: string;
98
101
  /**
99
102
  * What the question is **about**, by name — the thing an answer acts on,
100
- * carried from the run that asked to the run the press fires (lair pass
101
- * B12, 2026-09-27). The Lair's knock asks *is there a room here?*; the
103
+ * carried from the run that asked to the run the press fires.
104
+ * The Lair's knock asks *is there a room here?*; the
102
105
  * room is its `referent`, and *Answer the door* reads it off the form
103
106
  * (`read-answer@1`'s `referent`) to name the room it writes. Plain text,
104
107
  * never an id: it is shown to nobody and trusted for nothing — a press
@@ -108,22 +111,25 @@ export interface FormBlockFields {
108
111
  * Neither the question (prose a person reads) nor an option's `choice`
109
112
  * (a key a junction compares): those two could not carry a name without
110
113
  * breaking what they are for.
114
+ * @ruling lair pass B12 (2026-09-27)
111
115
  */
112
116
  referent?: string;
113
117
  /**
114
118
  * Where the question was asked **from**, by name — carried beside
115
- * `referent` from the run that asked to the run the press fires (plan
116
- * A27, 2026-09-30). The Lair's knock stamps the room its planner said the
119
+ * `referent` from the run that asked to the run the press fires.
120
+ * The Lair's knock stamps the room its planner said the
117
121
  * party stood in, and *Answer the door* links the new room to it when the
118
122
  * world's `location` names nowhere. Plain text, shown to nobody and
119
123
  * trusted for nothing, like `referent`; absent on most questions.
124
+ * @ruling plan A27 (2026-09-30)
120
125
  */
121
126
  vantage?: string;
122
127
  /**
123
- * The answer, once given (U5d review, W7) — stamped on the stored block
128
+ * The answer, once given — stamped on the stored block
124
129
  * by the host when the action's run landed, never written by a spec. A
125
130
  * form is answered **once**: a second press is refused naming who
126
131
  * answered, and a client greys the block and shows the answer.
132
+ * @ruling U5d review, W7
127
133
  */
128
134
  answered?: FormAnswered;
129
135
  }
@@ -228,22 +234,23 @@ export declare const BLOCK_ID_MAX_LENGTH = 64;
228
234
  export declare function checkMessageBlocks(value: unknown): MessageBlockFinding[];
229
235
  /**
230
236
  * Stamp each `choices` button and `form` in a tree with the identity of the
231
- * declaration it fires — the outlet's half of W-E, called where a block part
237
+ * declaration it fires — the outlet's half of the action's identity, called where a block part
232
238
  * is written with the run's spec in hand. That is the host's seam, not the
233
239
  * SDK's: in Serene Pub the executor's host scope carries the running
234
240
  * document's slug (`runtime/host.ts`, `HostScope.specId`) and its message
235
- * outlet is where the stamp lands; the `blocks` port U5d builds is built on
241
+ * outlet is where the stamp lands; the `blocks` port is built on
236
242
  * this call. The SDK declares no `HostScope` — a host wired by hand passes
237
243
  * `{ id, contributes }` from wherever it keeps the running spec.
238
244
  *
239
245
  * The identity is `<spec id>#<key>` for the action of `spec` whose `key`
240
- * is the block's `fn` (plans/31 V2: the key is the identity's second half,
246
+ * is the block's `fn` (the key is the identity's second half,
241
247
  * so `fn` names at most one). A block whose `fn` the spec declares no
242
248
  * action for is left unstamped — it fires as legacy and gets the
243
249
  * owner floor — rather than guessed; and a block that already carries an
244
250
  * `action` keeps it, so a spec may name a declaration of another spec's on
245
251
  * purpose. Returns a copy; the input is never mutated.
246
252
  * @internal
253
+ * @ruling W-E, U5d, plans/31 V2
247
254
  */
248
255
  export declare function stampBlockActions(blocks: MessageBlock[], spec: {
249
256
  id: string;
@@ -298,24 +305,24 @@ export declare function foreignBlockActions(blocks: MessageBlock[], spec: {
298
305
  contributes?: unknown;
299
306
  }): string[];
300
307
  /**
301
- * **The one addressee a `world` action may be named to** (L1, ruled
302
- * 2026-09-17): the session's owner, and nobody else.
308
+ * **The one addressee a `world` action may be named to**: the session's owner, and nobody else.
303
309
  *
304
310
  * `owner` the role, never `user:<id>` — this half of the law is pure and
305
311
  * holds no session, so it cannot know which person owns one; a reference that
306
312
  * happens to name the owner is resolved at the press, where the host can ask.
307
313
  * @experimental
314
+ * @ruling L1 (2026-09-17)
308
315
  */
309
316
  export declare const isOwnerAddressed: (addressee: unknown) => boolean;
310
317
  /**
311
- * The effects line (plans/29 R-15 *The line*; 09-B F39): a block naming a
318
+ * The effects line: a block naming a
312
319
  * `world` action — one whose result touches cards, lorebooks, settings,
313
320
  * permissions, connections — is refused. Such an action lives in the
314
321
  * composer or the review gate and is owner-only; a message carrying it would
315
322
  * put an out-of-fiction effect where a character could be asked to answer
316
323
  * it. Returns the functions of the offending actions.
317
324
  *
318
- * ## The one exception: a block addressed to the **owner** (L1, 2026-09-17)
325
+ * ## The one exception: a block addressed to the **owner**
319
326
  *
320
327
  * A `choices` or `form` block whose `addressee` is `owner` may name a `world`
321
328
  * action. The reasoning is the line's own: the rule exists so that an
@@ -327,20 +334,21 @@ export declare const isOwnerAddressed: (addressee: unknown) => boolean;
327
334
  * a user by id, or none at all (“nobody in particular”, which anyone the
328
335
  * audience admits may press) — keeps the refusal.
329
336
  *
330
- * ⚠ The **venue** half of F41 is untouched: an action declaring
337
+ * ⚠ The **venue** half of the effects line is untouched: an action declaring
331
338
  * `venue: { kind: 'form' }` still may not be `world`, because a venue is
332
339
  * declared and an addressee is decided at run time, so the construction-time
333
340
  * check cannot see one. An owner-addressed block therefore names a
334
341
  * `composer`-venue world action — the Lair genre's knock does exactly this
335
342
  * — and `form` stays fiction-only.
336
343
  * @experimental
344
+ * @ruling plans/29 R-15 *The line*, 09-B F39, L1 (2026-09-17), F41
337
345
  */
338
346
  export declare function worldBlockFunctions(blocks: MessageBlock[], spec: {
339
347
  id: string;
340
348
  contributes?: unknown;
341
349
  }): string[];
342
350
  /**
343
- * Every shape the effects line is heard in (F41), one verdict:
351
+ * Every shape the effects line is heard in, one verdict:
344
352
  *
345
353
  * - `venue` / `actor` — a declaration: a `world` action's declared venue,
346
354
  * or a reference its `act` audience names (`worldActionCrossing`).
@@ -352,6 +360,7 @@ export declare function worldBlockFunctions(blocks: MessageBlock[], spec: {
352
360
  * - `press` — the fire: a `world` action pressed from a block, or answered
353
361
  * **as** a participant by the answer pipeline.
354
362
  * @experimental
363
+ * @ruling F41
355
364
  */
356
365
  export type EffectsLineInput = EffectsLineDeclarationInput | {
357
366
  kind: 'block';
@@ -377,19 +386,20 @@ export type EffectsLineInput = EffectsLineDeclarationInput | {
377
386
  blockAddressee: unknown;
378
387
  };
379
388
  /**
380
- * The effects line (plans/29 R-15 *The line*; F41), as one verdict: an
389
+ * The effects line, as one verdict: an
381
390
  * out-of-fiction effect — cards, lore, settings, permissions — is the
382
391
  * owner's (or an administrator's), from the composer or the review gate, and
383
392
  * never a question a character could be asked. Heard at the declaration
384
393
  * (`actionFindingsByLaw`: the builder, `validate()`, the packager, a host's
385
394
  * publish), at the write (`worldBlockFunctions`, the host's block gate) and
386
- * at the fire (the host's `fireAction`). The one exception is L1's: a block
395
+ * at the fire (the host's `fireAction`). The one exception: a block
387
396
  * addressed to the **owner** may carry it, because the owner is already the
388
397
  * whole of such an action's `act` audience and pressing the button is the
389
398
  * owner acting. A fire made **as** a participant has no exception — that is
390
399
  * the answer pipeline answering for someone, and an oracle granting a
391
400
  * permission is the thing the line exists to make impossible.
392
401
  * @internal
402
+ * @ruling plans/29 R-15 *The line*, F41, L1
393
403
  */
394
404
  export declare const effectsLineVerdict: import("./verdicts.js").VerdictDecl<EffectsLineInput>;
395
405
  /**
@@ -402,19 +412,18 @@ export declare function assignBlockIds(blocks: MessageBlock[], makeId: () => str
402
412
  /** A channel head as a block carries it: a positive integer message id. @experimental */
403
413
  export declare const isChannelHead: (v: unknown) => v is number;
404
414
  /**
405
- * Stamp the **channel head** on every `choices` and `form` block (plans/29
406
- * R-15 *Staleness and order*; 30 §U5f) — the host's half, at the write,
415
+ * Stamp the **channel head** on every `choices` and `form` block — the host's half, at the write,
407
416
  * with the head it read off the channel. Unlike `assignBlockIds`, a value
408
417
  * the block already carries is **replaced**: the head is a fact about the
409
418
  * channel at the write, and only the host holds the channel. Returns a
410
419
  * copy; the input is never mutated.
411
420
  * @internal
421
+ * @ruling plans/29 R-15 *Staleness and order*, 30 §U5f
412
422
  */
413
423
  export declare function assignBlockHead(blocks: MessageBlock[], head: number): MessageBlock[];
414
424
  /**
415
425
  * Is this form **stale** — issued at a channel head the channel has since
416
- * moved past, and still unanswered? The one rule (R-15 *Staleness and
417
- * order*), written once so the host's door and a client's render agree:
426
+ * moved past, and still unanswered? The one rule, written once so the host's door and a client's render agree:
418
427
  *
419
428
  * !answered && head != null && headNow > head
420
429
  *
@@ -425,17 +434,19 @@ export declare function assignBlockHead(blocks: MessageBlock[], head: number): M
425
434
  * stale everywhere: a form answered before the head moved stays answered.
426
435
  * A block with no `head` is never stale.
427
436
  * @experimental
437
+ * @ruling R-15 *Staleness and order*
428
438
  */
429
439
  export declare function isFormStale(block: {
430
440
  head?: unknown;
431
441
  answered?: unknown;
432
442
  }, headNow: number | null | undefined): boolean;
433
443
  /**
434
- * Staleness as a verdict (R-15 *Staleness and order*; U5f): `isFormStale`
444
+ * Staleness as a verdict: `isFormStale`
435
445
  * is the judge, and the sentence is the one the host's fire refuses a press
436
446
  * with and a dispatched answer is receipted with. The client draws a stale
437
447
  * form collapsed as *superseded* from the same verdict, over the head it
438
448
  * holds — the `list` door, an affordance; the fire refuses regardless.
449
+ * @ruling R-15 *Staleness and order*, U5f
439
450
  */
440
451
  /** Input to `stalenessVerdict`'s judge. @experimental */
441
452
  export interface StalenessInput {
@@ -449,8 +460,8 @@ export interface StalenessInput {
449
460
  /** @internal */
450
461
  export declare const stalenessVerdict: import("./verdicts.js").VerdictDecl<StalenessInput>;
451
462
  /**
452
- * The JSON Schema an oracle answers a form against (R-15: "an oracle with
453
- * `json` capability answers against the form's schema").
463
+ * The JSON Schema an oracle answers a form against: an oracle with
464
+ * `json` capability answers against the form's schema.
454
465
  *
455
466
  * - `choices` → `{ choice: <enum of the option keys> }`, required.
456
467
  * - `form` → the field schema, mapped field by field (`fieldsToJsonSchema`).
@@ -458,6 +469,7 @@ export declare const stalenessVerdict: import("./verdicts.js").VerdictDecl<Stale
458
469
  * A `choices` block whose options carry no keys yields an empty enum, which
459
470
  * is what the validator refuses on an addressed block before it is written.
460
471
  * @internal
472
+ * @ruling R-15
461
473
  */
462
474
  export declare function formAnswerSchema(block: FormBlock): Record<string, unknown>;
463
475
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Message blocks (20 §6) — custom message content as **data, not code**.
2
+ * Message blocks — custom message content as **data, not code**.
3
3
  *
4
4
  * A plugin's message part carries a block tree in `data.blocks`; core renders
5
5
  * it with its own components. Nothing to sanitize (no HTML crosses the
@@ -11,7 +11,8 @@
11
11
  * The validator is the write-time gate: a hostile or malformed tree is refused
12
12
  * with the block path named, and the caps make "render whatever a sandboxed
13
13
  * hook produced" a bounded promise. Findings carry a `fix` like every finding
14
- * in this SDK (15 §1.3).
14
+ * in this SDK.
15
+ * @ruling 20 §6, 15 §1.3
15
16
  */
16
17
  import { checkSchema } from './settings.js';
17
18
  import { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, actionsOf, effectsOf, worldActionCrossing, } from './actions.js';
@@ -195,22 +196,23 @@ export function checkMessageBlocks(value) {
195
196
  }
196
197
  /**
197
198
  * Stamp each `choices` button and `form` in a tree with the identity of the
198
- * declaration it fires — the outlet's half of W-E, called where a block part
199
+ * declaration it fires — the outlet's half of the action's identity, called where a block part
199
200
  * is written with the run's spec in hand. That is the host's seam, not the
200
201
  * SDK's: in Serene Pub the executor's host scope carries the running
201
202
  * document's slug (`runtime/host.ts`, `HostScope.specId`) and its message
202
- * outlet is where the stamp lands; the `blocks` port U5d builds is built on
203
+ * outlet is where the stamp lands; the `blocks` port is built on
203
204
  * this call. The SDK declares no `HostScope` — a host wired by hand passes
204
205
  * `{ id, contributes }` from wherever it keeps the running spec.
205
206
  *
206
207
  * The identity is `<spec id>#<key>` for the action of `spec` whose `key`
207
- * is the block's `fn` (plans/31 V2: the key is the identity's second half,
208
+ * is the block's `fn` (the key is the identity's second half,
208
209
  * so `fn` names at most one). A block whose `fn` the spec declares no
209
210
  * action for is left unstamped — it fires as legacy and gets the
210
211
  * owner floor — rather than guessed; and a block that already carries an
211
212
  * `action` keeps it, so a spec may name a declaration of another spec's on
212
213
  * purpose. Returns a copy; the input is never mutated.
213
214
  * @internal
215
+ * @ruling W-E, U5d, plans/31 V2
214
216
  */
215
217
  export function stampBlockActions(blocks, spec) {
216
218
  const byKey = new Map();
@@ -332,24 +334,24 @@ export function foreignBlockActions(blocks, spec) {
332
334
  return [...out];
333
335
  }
334
336
  /**
335
- * **The one addressee a `world` action may be named to** (L1, ruled
336
- * 2026-09-17): the session's owner, and nobody else.
337
+ * **The one addressee a `world` action may be named to**: the session's owner, and nobody else.
337
338
  *
338
339
  * `owner` the role, never `user:<id>` — this half of the law is pure and
339
340
  * holds no session, so it cannot know which person owns one; a reference that
340
341
  * happens to name the owner is resolved at the press, where the host can ask.
341
342
  * @experimental
343
+ * @ruling L1 (2026-09-17)
342
344
  */
343
345
  export const isOwnerAddressed = (addressee) => addressee === 'owner';
344
346
  /**
345
- * The effects line (plans/29 R-15 *The line*; 09-B F39): a block naming a
347
+ * The effects line: a block naming a
346
348
  * `world` action — one whose result touches cards, lorebooks, settings,
347
349
  * permissions, connections — is refused. Such an action lives in the
348
350
  * composer or the review gate and is owner-only; a message carrying it would
349
351
  * put an out-of-fiction effect where a character could be asked to answer
350
352
  * it. Returns the functions of the offending actions.
351
353
  *
352
- * ## The one exception: a block addressed to the **owner** (L1, 2026-09-17)
354
+ * ## The one exception: a block addressed to the **owner**
353
355
  *
354
356
  * A `choices` or `form` block whose `addressee` is `owner` may name a `world`
355
357
  * action. The reasoning is the line's own: the rule exists so that an
@@ -361,13 +363,14 @@ export const isOwnerAddressed = (addressee) => addressee === 'owner';
361
363
  * a user by id, or none at all (“nobody in particular”, which anyone the
362
364
  * audience admits may press) — keeps the refusal.
363
365
  *
364
- * ⚠ The **venue** half of F41 is untouched: an action declaring
366
+ * ⚠ The **venue** half of the effects line is untouched: an action declaring
365
367
  * `venue: { kind: 'form' }` still may not be `world`, because a venue is
366
368
  * declared and an addressee is decided at run time, so the construction-time
367
369
  * check cannot see one. An owner-addressed block therefore names a
368
370
  * `composer`-venue world action — the Lair genre's knock does exactly this
369
371
  * — and `form` stays fiction-only.
370
372
  * @experimental
373
+ * @ruling plans/29 R-15 *The line*, 09-B F39, L1 (2026-09-17), F41
371
374
  */
372
375
  export function worldBlockFunctions(blocks, spec) {
373
376
  const world = new Set(actionsOf(spec)
@@ -392,19 +395,20 @@ const worldBlockSentence = (named) => `the blocks name ${named}, whose action ch
392
395
  `Such an action is the owner's, from the composer or the review gate — the one block that may ` +
393
396
  `carry it is one addressed to 'owner' (the effects line, R-15)`;
394
397
  /**
395
- * The effects line (plans/29 R-15 *The line*; F41), as one verdict: an
398
+ * The effects line, as one verdict: an
396
399
  * out-of-fiction effect — cards, lore, settings, permissions — is the
397
400
  * owner's (or an administrator's), from the composer or the review gate, and
398
401
  * never a question a character could be asked. Heard at the declaration
399
402
  * (`actionFindingsByLaw`: the builder, `validate()`, the packager, a host's
400
403
  * publish), at the write (`worldBlockFunctions`, the host's block gate) and
401
- * at the fire (the host's `fireAction`). The one exception is L1's: a block
404
+ * at the fire (the host's `fireAction`). The one exception: a block
402
405
  * addressed to the **owner** may carry it, because the owner is already the
403
406
  * whole of such an action's `act` audience and pressing the button is the
404
407
  * owner acting. A fire made **as** a participant has no exception — that is
405
408
  * the answer pipeline answering for someone, and an oracle granting a
406
409
  * permission is the thing the line exists to make impossible.
407
410
  * @internal
411
+ * @ruling plans/29 R-15 *The line*, F41, L1
408
412
  */
409
413
  export const effectsLineVerdict = defineVerdict({
410
414
  id: 'core:verdict/effects-line',
@@ -502,13 +506,13 @@ export function assignBlockIds(blocks, makeId) {
502
506
  /** A channel head as a block carries it: a positive integer message id. @experimental */
503
507
  export const isChannelHead = (v) => typeof v === 'number' && Number.isInteger(v) && v > 0;
504
508
  /**
505
- * Stamp the **channel head** on every `choices` and `form` block (plans/29
506
- * R-15 *Staleness and order*; 30 §U5f) — the host's half, at the write,
509
+ * Stamp the **channel head** on every `choices` and `form` block — the host's half, at the write,
507
510
  * with the head it read off the channel. Unlike `assignBlockIds`, a value
508
511
  * the block already carries is **replaced**: the head is a fact about the
509
512
  * channel at the write, and only the host holds the channel. Returns a
510
513
  * copy; the input is never mutated.
511
514
  * @internal
515
+ * @ruling plans/29 R-15 *Staleness and order*, 30 §U5f
512
516
  */
513
517
  export function assignBlockHead(blocks, head) {
514
518
  const walk = (list) => list.map((b) => {
@@ -526,8 +530,7 @@ export function assignBlockHead(blocks, head) {
526
530
  }
527
531
  /**
528
532
  * Is this form **stale** — issued at a channel head the channel has since
529
- * moved past, and still unanswered? The one rule (R-15 *Staleness and
530
- * order*), written once so the host's door and a client's render agree:
533
+ * moved past, and still unanswered? The one rule, written once so the host's door and a client's render agree:
531
534
  *
532
535
  * !answered && head != null && headNow > head
533
536
  *
@@ -538,6 +541,7 @@ export function assignBlockHead(blocks, head) {
538
541
  * stale everywhere: a form answered before the head moved stays answered.
539
542
  * A block with no `head` is never stale.
540
543
  * @experimental
544
+ * @ruling R-15 *Staleness and order*
541
545
  */
542
546
  export function isFormStale(block, headNow) {
543
547
  if (block.answered)
@@ -564,8 +568,8 @@ export const stalenessVerdict = defineVerdict({
564
568
  failing: () => ({ block: { head: 3 }, headNow: 4 }),
565
569
  });
566
570
  /**
567
- * The JSON Schema an oracle answers a form against (R-15: "an oracle with
568
- * `json` capability answers against the form's schema").
571
+ * The JSON Schema an oracle answers a form against: an oracle with
572
+ * `json` capability answers against the form's schema.
569
573
  *
570
574
  * - `choices` → `{ choice: <enum of the option keys> }`, required.
571
575
  * - `form` → the field schema, mapped field by field (`fieldsToJsonSchema`).
@@ -573,6 +577,7 @@ export const stalenessVerdict = defineVerdict({
573
577
  * A `choices` block whose options carry no keys yields an empty enum, which
574
578
  * is what the validator refuses on an addressed block before it is written.
575
579
  * @internal
580
+ * @ruling R-15
576
581
  */
577
582
  export function formAnswerSchema(block) {
578
583
  if (block.kind === 'choices')
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Migration harness — converting an existing workflow into a pipeline without users
3
- * losing what they customised (08 §5, U25).
3
+ * losing what they customised.
4
4
  *
5
5
  * The failure this exists to prevent is specific and it is not "the migration crashed."
6
6
  * A migration that runs cleanly and quietly changes what the model receives is far worse
@@ -15,6 +15,7 @@
15
15
  * That is checkable because a preview run already produces the exact payload that would
16
16
  * be sent, from the same formatter and the same tokenizer as a real run (src/preview.ts).
17
17
  * The parity test is the preview, not a second renderer written for the occasion.
18
+ * @ruling 08 §5, U25
18
19
  */
19
20
  import type { ScopeKind } from './config.js';
20
21
  import type { Receipt } from './receipt.js';
@@ -23,9 +24,10 @@ import type { SpecDocument } from './document.js';
23
24
  * A migrated row's slug is derived from where it came from, not generated.
24
25
  *
25
26
  * This is what makes a migration **idempotent**: re-running after a bug fix matches the
26
- * existing row by slug and replaces it, instead of creating a second copy beside it
27
- * (12 §3b). A migration that cannot be safely re-run is a migration nobody dares fix.
27
+ * existing row by slug and replaces it, instead of creating a second copy beside it.
28
+ * A migration that cannot be safely re-run is a migration nobody dares fix.
28
29
  * @experimental
30
+ * @ruling 12 §3b
29
31
  */
30
32
  export declare function migratedSlug(sourceTable: string, sourceId: string | number): string;
31
33
  /** @experimental */
@@ -41,7 +43,10 @@ export interface MigrationEntry {
41
43
  /** Where the value landed: the scope it was written at, and what it became. */
42
44
  target?: {
43
45
  slug: string;
44
- /** A `ScopeKind` (config.ts): `session · config · defaults · author` since R-10. */
46
+ /**
47
+ * A `ScopeKind` (config.ts): `session · config · defaults · author`.
48
+ * @ruling R-10
49
+ */
45
50
  scopeKind: ScopeKind;
46
51
  nodeKey?: string;
47
52
  slot?: string;
@@ -66,9 +71,10 @@ export declare function summarize(r: MigrationReport): {
66
71
  };
67
72
  /**
68
73
  * Everything that did not migrate cleanly must say why, and must remain visible —
69
- * `spec_diagnostics` in core, the same place an orphaned slot lands after a node swap
70
- * (12 §5). Same principle as export (12 §7a): nothing is dropped silently.
74
+ * `spec_diagnostics` in core, the same place an orphaned slot lands after a node swap.
75
+ * Same principle as export: nothing is dropped silently.
71
76
  * @experimental
77
+ * @ruling 12 §5, 12 §7a
72
78
  */
73
79
  export declare function unmappedEntries(r: MigrationReport): MigrationEntry[];
74
80
  /** @experimental */
@@ -90,10 +96,11 @@ export interface ParityResult {
90
96
  /** @internal */
91
97
  export declare function checkParity(fixture: string, legacyPrompt: string, preview: Receipt, count?: (v: unknown) => number): ParityResult;
92
98
  /**
93
- * The gate on dropping an old code path (08 §5). Deliberately strict: an empty corpus
99
+ * The gate on dropping an old code path. Deliberately strict: an empty corpus
94
100
  * passes nothing, because "no failures" and "nothing was checked" look identical in a
95
101
  * summary and only one of them is safe.
96
102
  * @internal
103
+ * @ruling 08 §5
97
104
  */
98
105
  export declare function parityGate(results: ParityResult[], minimumCorpus?: number): {
99
106
  pass: boolean;
@@ -114,8 +121,9 @@ export declare function renderParity(r: ParityResult): string;
114
121
  *
115
122
  * So the rule is: an id wired in (by edge or by config) means update; nothing wired
116
123
  * means create; **anything else is reported unmapped rather than decided**. `unmapped`
117
- * is already the shape 08 §5b uses for "a human has to look at this."
124
+ * is already the shape used for "a human has to look at this."
118
125
  * @experimental
126
+ * @ruling 08 §5b
119
127
  */
120
128
  export declare const LEGACY_COMMIT_MESSAGE = "core:outlet/commit-message";
121
129
  /** @experimental */
package/dist/migration.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Migration harness — converting an existing workflow into a pipeline without users
3
- * losing what they customised (08 §5, U25).
3
+ * losing what they customised.
4
4
  *
5
5
  * The failure this exists to prevent is specific and it is not "the migration crashed."
6
6
  * A migration that runs cleanly and quietly changes what the model receives is far worse
@@ -15,15 +15,17 @@
15
15
  * That is checkable because a preview run already produces the exact payload that would
16
16
  * be sent, from the same formatter and the same tokenizer as a real run (src/preview.ts).
17
17
  * The parity test is the preview, not a second renderer written for the occasion.
18
+ * @ruling 08 §5, U25
18
19
  */
19
20
  // ── Deterministic identity, so a migration can be re-run ────────────────────
20
21
  /**
21
22
  * A migrated row's slug is derived from where it came from, not generated.
22
23
  *
23
24
  * This is what makes a migration **idempotent**: re-running after a bug fix matches the
24
- * existing row by slug and replaces it, instead of creating a second copy beside it
25
- * (12 §3b). A migration that cannot be safely re-run is a migration nobody dares fix.
25
+ * existing row by slug and replaces it, instead of creating a second copy beside it.
26
+ * A migration that cannot be safely re-run is a migration nobody dares fix.
26
27
  * @experimental
28
+ * @ruling 12 §3b
27
29
  */
28
30
  export function migratedSlug(sourceTable, sourceId) {
29
31
  const clean = String(sourceId)
@@ -45,9 +47,10 @@ export function summarize(r) {
45
47
  }
46
48
  /**
47
49
  * Everything that did not migrate cleanly must say why, and must remain visible —
48
- * `spec_diagnostics` in core, the same place an orphaned slot lands after a node swap
49
- * (12 §5). Same principle as export (12 §7a): nothing is dropped silently.
50
+ * `spec_diagnostics` in core, the same place an orphaned slot lands after a node swap.
51
+ * Same principle as export: nothing is dropped silently.
50
52
  * @experimental
53
+ * @ruling 12 §5, 12 §7a
51
54
  */
52
55
  export function unmappedEntries(r) {
53
56
  return r.entries.filter((e) => e.outcome !== 'migrated');
@@ -76,7 +79,7 @@ const EXCERPT = 60;
76
79
  * Three shapes reach here. A Provider with a `wire` slot puts a formed payload on
77
80
  * the port, and that may already be a string. Core's Assemble puts an **allocated
78
81
  * context** there — blocks plus the rendered string, because the budget panel needs
79
- * the blocks (16 §7) — so the prompt is one level in. A split-chat connection has
82
+ * the blocks — so the prompt is one level in. A split-chat connection has
80
83
  * `messages` instead of `rendered`, and its comparable form is the role-tagged text.
81
84
  *
82
85
  * Unwrapping matters more than it looks: the first version compared
@@ -84,6 +87,7 @@ const EXCERPT = 60;
84
87
  * "diverges at character 0" on every fixture forever — a harness that can never go
85
88
  * green is indistinguishable from one whose subject is broken, and it costs a day
86
89
  * to tell them apart.
90
+ * @ruling 16 §7
87
91
  */
88
92
  function renderedText(value) {
89
93
  if (typeof value === 'string')
@@ -131,10 +135,11 @@ export function checkParity(fixture, legacyPrompt, preview, count) {
131
135
  };
132
136
  }
133
137
  /**
134
- * The gate on dropping an old code path (08 §5). Deliberately strict: an empty corpus
138
+ * The gate on dropping an old code path. Deliberately strict: an empty corpus
135
139
  * passes nothing, because "no failures" and "nothing was checked" look identical in a
136
140
  * summary and only one of them is safe.
137
141
  * @internal
142
+ * @ruling 08 §5
138
143
  */
139
144
  export function parityGate(results, minimumCorpus = 1) {
140
145
  if (results.length < minimumCorpus) {
@@ -176,8 +181,9 @@ export function renderParity(r) {
176
181
  *
177
182
  * So the rule is: an id wired in (by edge or by config) means update; nothing wired
178
183
  * means create; **anything else is reported unmapped rather than decided**. `unmapped`
179
- * is already the shape 08 §5b uses for "a human has to look at this."
184
+ * is already the shape used for "a human has to look at this."
180
185
  * @experimental
186
+ * @ruling 08 §5b
181
187
  */
182
188
  export const LEGACY_COMMIT_MESSAGE = 'core:outlet/commit-message';
183
189
  /** @experimental */
package/dist/names.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Names, compared the one way every reader agrees on (lair pass R7, 2026-09-28).
2
+ * Names, compared the one way every reader agrees on.
3
3
  *
4
4
  * `core:task/undescribed-name@1` asks whether a room the planner named is
5
5
  * already described: by a lorebook entry whose name or keys answer to it, or
@@ -37,6 +37,7 @@
37
37
  * ⚠ Hyphens separate words, so "well-lit" counts as two words toward
38
38
  * `minWords`. That is consistent on both sides, which is what matters.
39
39
  * @experimental
40
+ * @ruling lair pass R7 (2026-09-28)
40
41
  */
41
42
  /** The articles one strip removes from the front of a name. @experimental */
42
43
  export declare const LEADING_ARTICLES: readonly string[];
package/dist/names.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Names, compared the one way every reader agrees on (lair pass R7, 2026-09-28).
2
+ * Names, compared the one way every reader agrees on.
3
3
  *
4
4
  * `core:task/undescribed-name@1` asks whether a room the planner named is
5
5
  * already described: by a lorebook entry whose name or keys answer to it, or
@@ -37,6 +37,7 @@
37
37
  * ⚠ Hyphens separate words, so "well-lit" counts as two words toward
38
38
  * `minWords`. That is consistent on both sides, which is what matters.
39
39
  * @experimental
40
+ * @ruling lair pass R7 (2026-09-28)
40
41
  */
41
42
  /** The articles one strip removes from the front of a name. @experimental */
42
43
  export const LEADING_ARTICLES = ['the', 'a', 'an'];
@@ -336,7 +336,7 @@ export interface TypedReads<P> {
336
336
  paramTypes?: Partial<Record<ReadableParams<P>, FieldType>>;
337
337
  }
338
338
  /**
339
- * Attach a read declaration a contract has checked (ruling R-12, 2026-09-15).
339
+ * Attach a read declaration a contract has checked.
340
340
  *
341
341
  * ```ts
342
342
  * reads<typeof C.sessionHistory>(
@@ -371,6 +371,7 @@ export interface TypedReads<P> {
371
371
  * when the two pins read differently, and declare the intersection when they
372
372
  * do not. An identical redeclaration is a no-op, on the registry's own terms.
373
373
  * @experimental
374
+ * @ruling R-12 (2026-09-15)
374
375
  */
375
376
  export declare function reads<P>(hook: Hook, requires: TypedReads<P>): DeclaredHook<Hook>;
376
377
  /** Does this hook carry a read declaration? @internal */