@openvtc/trust-tasks 0.28.12 → 0.28.13

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 (80) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/_shared/components.d.ts +458 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +42 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +42 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vtc/boards/_shared/0.1/board.d.ts +22 -0
  9. package/dist/vtc/boards/_shared/0.1/board.d.ts.map +1 -0
  10. package/dist/vtc/boards/_shared/0.1/board.js +6 -0
  11. package/dist/vtc/boards/_shared/0.1/board.js.map +1 -0
  12. package/dist/vtc/boards/create/0.1/payload.d.ts +2402 -0
  13. package/dist/vtc/boards/create/0.1/payload.d.ts.map +1 -0
  14. package/dist/vtc/boards/create/0.1/payload.js +1349 -0
  15. package/dist/vtc/boards/create/0.1/payload.js.map +1 -0
  16. package/dist/vtc/boards/ideas/decide/0.1/payload.d.ts +1781 -0
  17. package/dist/vtc/boards/ideas/decide/0.1/payload.d.ts.map +1 -0
  18. package/dist/vtc/boards/ideas/decide/0.1/payload.js +1028 -0
  19. package/dist/vtc/boards/ideas/decide/0.1/payload.js.map +1 -0
  20. package/dist/vtc/boards/ideas/propose/0.1/payload.d.ts +1781 -0
  21. package/dist/vtc/boards/ideas/propose/0.1/payload.d.ts.map +1 -0
  22. package/dist/vtc/boards/ideas/propose/0.1/payload.js +1025 -0
  23. package/dist/vtc/boards/ideas/propose/0.1/payload.js.map +1 -0
  24. package/dist/vtc/boards/ideas/select/0.1/payload.d.ts +1788 -0
  25. package/dist/vtc/boards/ideas/select/0.1/payload.d.ts.map +1 -0
  26. package/dist/vtc/boards/ideas/select/0.1/payload.js +1029 -0
  27. package/dist/vtc/boards/ideas/select/0.1/payload.js.map +1 -0
  28. package/dist/vtc/boards/ideas/update/0.1/payload.d.ts +1781 -0
  29. package/dist/vtc/boards/ideas/update/0.1/payload.d.ts.map +1 -0
  30. package/dist/vtc/boards/ideas/update/0.1/payload.js +1023 -0
  31. package/dist/vtc/boards/ideas/update/0.1/payload.js.map +1 -0
  32. package/dist/vtc/boards/ideas/withdraw/0.1/payload.d.ts +1753 -0
  33. package/dist/vtc/boards/ideas/withdraw/0.1/payload.d.ts.map +1 -0
  34. package/dist/vtc/boards/ideas/withdraw/0.1/payload.js +1011 -0
  35. package/dist/vtc/boards/ideas/withdraw/0.1/payload.js.map +1 -0
  36. package/dist/vtc/boards/list/0.1/payload.d.ts +2267 -0
  37. package/dist/vtc/boards/list/0.1/payload.d.ts.map +1 -0
  38. package/dist/vtc/boards/list/0.1/payload.js +1326 -0
  39. package/dist/vtc/boards/list/0.1/payload.js.map +1 -0
  40. package/dist/vtc/boards/notes/add/0.1/payload.d.ts +655 -0
  41. package/dist/vtc/boards/notes/add/0.1/payload.d.ts.map +1 -0
  42. package/dist/vtc/boards/notes/add/0.1/payload.js +374 -0
  43. package/dist/vtc/boards/notes/add/0.1/payload.js.map +1 -0
  44. package/dist/vtc/boards/notes/hide/0.1/payload.d.ts +657 -0
  45. package/dist/vtc/boards/notes/hide/0.1/payload.d.ts.map +1 -0
  46. package/dist/vtc/boards/notes/hide/0.1/payload.js +378 -0
  47. package/dist/vtc/boards/notes/hide/0.1/payload.js.map +1 -0
  48. package/dist/vtc/boards/notes/list/0.1/payload.d.ts +730 -0
  49. package/dist/vtc/boards/notes/list/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/boards/notes/list/0.1/payload.js +406 -0
  51. package/dist/vtc/boards/notes/list/0.1/payload.js.map +1 -0
  52. package/dist/vtc/boards/notes/withdraw/0.1/payload.d.ts +641 -0
  53. package/dist/vtc/boards/notes/withdraw/0.1/payload.d.ts.map +1 -0
  54. package/dist/vtc/boards/notes/withdraw/0.1/payload.js +367 -0
  55. package/dist/vtc/boards/notes/withdraw/0.1/payload.js.map +1 -0
  56. package/dist/vtc/boards/show/0.1/payload.d.ts +3713 -0
  57. package/dist/vtc/boards/show/0.1/payload.d.ts.map +1 -0
  58. package/dist/vtc/boards/show/0.1/payload.js +2160 -0
  59. package/dist/vtc/boards/show/0.1/payload.js.map +1 -0
  60. package/dist/vtc/boards/update/0.1/payload.d.ts +2423 -0
  61. package/dist/vtc/boards/update/0.1/payload.d.ts.map +1 -0
  62. package/dist/vtc/boards/update/0.1/payload.js +1356 -0
  63. package/dist/vtc/boards/update/0.1/payload.js.map +1 -0
  64. package/package.json +1 -1
  65. package/src/_shared/components.ts +493 -0
  66. package/src/index.ts +42 -0
  67. package/src/vtc/boards/_shared/0.1/board.ts +23 -0
  68. package/src/vtc/boards/create/0.1/payload.ts +1517 -0
  69. package/src/vtc/boards/ideas/decide/0.1/payload.ts +1068 -0
  70. package/src/vtc/boards/ideas/propose/0.1/payload.ts +1063 -0
  71. package/src/vtc/boards/ideas/select/0.1/payload.ts +1070 -0
  72. package/src/vtc/boards/ideas/update/0.1/payload.ts +1061 -0
  73. package/src/vtc/boards/ideas/withdraw/0.1/payload.ts +1045 -0
  74. package/src/vtc/boards/list/0.1/payload.ts +1376 -0
  75. package/src/vtc/boards/notes/add/0.1/payload.ts +410 -0
  76. package/src/vtc/boards/notes/hide/0.1/payload.ts +414 -0
  77. package/src/vtc/boards/notes/list/0.1/payload.ts +457 -0
  78. package/src/vtc/boards/notes/withdraw/0.1/payload.ts +401 -0
  79. package/src/vtc/boards/show/0.1/payload.ts +2212 -0
  80. package/src/vtc/boards/update/0.1/payload.ts +1529 -0
@@ -0,0 +1,2212 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/boards/show/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Author, Board, BoardAudience, BoardDescription, BoardHead, BoardId, BoardStatus, BoardTitle, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, ElectionResult, ElectionState, ElectionTemplate, EntryId, Ext, GroupId, Idea, IdeaDecision, IdeaDescription, IdeaElection, IdeaFormat, IdeaId, IdeaOpening, IdeaState, IdeaTitle, Key_VotingV0_1 as Key, Question, QuestionOption, QuestionResult, RankingQuestion, Reason_VtcBoardsV0_1 as Reason, Revote, ScoreQuestion, SecrecyLevel, Slot_VtcBoardsV0_1 as Slot, TextQuestion, Topic_VtcBoardsV0_1 as Topic, Trustees, Window } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Show one board and its ideas as the caller may see them, with each accepted idea's election stage, ballot count where its board is public, and result once tallied — never who took a ticket or voted. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCBoardsShowPayload {
13
+ boardId: BoardId;
14
+ /**
15
+ * @minItems 1
16
+ */
17
+ state?: [IdeaState, ...IdeaState[]];
18
+ topic?: Topic;
19
+ /**
20
+ * An opaque continuation token from a previous response's `nextCursor`, bound to the caller and the filters; a responder MUST NOT accept a cursor it did not issue.
21
+ */
22
+ cursor?: string;
23
+ /**
24
+ * The most items to return, at most 200; the responder chooses a default (50) and MAY return fewer.
25
+ */
26
+ limit?: number;
27
+ ext?: Ext;
28
+ }
29
+ /**
30
+ * The success response to a vtc/boards/show/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/boards/show/0.1#response.
31
+ */
32
+ export interface VTCBoardsShowResponsePayload {
33
+ board: Board;
34
+ ideas: Idea[];
35
+ /**
36
+ * Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`.
37
+ */
38
+ nextCursor?: string;
39
+ ext?: Ext;
40
+ }
41
+
42
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
43
+ export type { Author, Board, BoardAudience, BoardDescription, BoardHead, BoardId, BoardStatus, BoardTitle, BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, ElectionResult, ElectionState, ElectionTemplate, EntryId, Ext, GroupId, Idea, IdeaDecision, IdeaDescription, IdeaElection, IdeaFormat, IdeaId, IdeaOpening, IdeaState, IdeaTitle, Key, Question, QuestionOption, QuestionResult, RankingQuestion, Reason, Revote, ScoreQuestion, SecrecyLevel, Slot, TextQuestion, Topic, Trustees, Window };
44
+
45
+ /** Trust Task type URI. */
46
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/boards/show/0.1" as const;
47
+
48
+ /**
49
+ * The earlier version of this specification that this one declares it
50
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
51
+ * `null`. Only the direct declaration — follow the chain with
52
+ * `extendsChain` / `readForSpec`.
53
+ */
54
+ export const EXTENDS: string | null = null;
55
+
56
+ /**
57
+ * Why this version is deprecated, or `null` while it is current. A
58
+ * superseded or retired version is still supported, and is withdrawn from
59
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
60
+ * Versions").
61
+ */
62
+ export const DEPRECATION: string | null = null;
63
+
64
+ /** Stable alias for this specification's request payload shape. */
65
+ export type Payload = VTCBoardsShowPayload;
66
+
67
+ /** Trust Task response type URI (request type URI + "#response"). */
68
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/boards/show/0.1#response" as const;
69
+
70
+ /** Stable alias for this specification's success-response payload shape. */
71
+ export type Response = VTCBoardsShowResponsePayload;
72
+
73
+ /**
74
+ * This specification's payload schema, as a value.
75
+ *
76
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
77
+ * rather than only as a `.json` file because TypeScript types are erased
78
+ * at runtime: without a schema a consumer has nothing to validate, and
79
+ * every REQUIRED payload member is optional in practice. Cross-file
80
+ * `$ref`s are already inlined, so it needs no resolver.
81
+ */
82
+ export const PAYLOAD_SCHEMA = {
83
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
84
+ "$id": "https://trusttasks.org/spec/vtc/boards/show/0.1",
85
+ "title": "VTC Boards — Show — payload",
86
+ "description": "Show one board and its ideas as the caller may see them, with each accepted idea's election stage, ballot count where its board is public, and result once tallied — never who took a ticket or voted. The outer document members are owned by the framework — SPEC §6.3.",
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": [
90
+ "boardId"
91
+ ],
92
+ "properties": {
93
+ "boardId": {
94
+ "$ref": "#/$defs/BoardId"
95
+ },
96
+ "state": {
97
+ "type": "array",
98
+ "minItems": 1,
99
+ "uniqueItems": true,
100
+ "items": {
101
+ "$ref": "#/$defs/IdeaState"
102
+ }
103
+ },
104
+ "topic": {
105
+ "$ref": "#/$defs/Topic"
106
+ },
107
+ "cursor": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 1024,
111
+ "description": "An opaque continuation token from a previous response's `nextCursor`, bound to the caller and the filters; a responder MUST NOT accept a cursor it did not issue."
112
+ },
113
+ "limit": {
114
+ "type": "integer",
115
+ "minimum": 1,
116
+ "maximum": 200,
117
+ "description": "The most items to return, at most 200; the responder chooses a default (50) and MAY return fewer."
118
+ },
119
+ "ext": {
120
+ "$ref": "#/$defs/Ext"
121
+ }
122
+ },
123
+ "$defs": {
124
+ "Response": {
125
+ "$anchor": "response",
126
+ "title": "VTC Boards — Show — response payload",
127
+ "description": "The success response to a vtc/boards/show/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/boards/show/0.1#response.",
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "board",
132
+ "ideas"
133
+ ],
134
+ "properties": {
135
+ "board": {
136
+ "$ref": "#/$defs/Board"
137
+ },
138
+ "ideas": {
139
+ "type": "array",
140
+ "items": {
141
+ "$ref": "#/$defs/Idea"
142
+ }
143
+ },
144
+ "nextCursor": {
145
+ "type": "string",
146
+ "maxLength": 1024,
147
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
148
+ },
149
+ "ext": {
150
+ "$ref": "#/$defs/Ext"
151
+ }
152
+ }
153
+ },
154
+ "Ext": {
155
+ "title": "Ext",
156
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
157
+ "type": "object",
158
+ "minProperties": 1,
159
+ "additionalProperties": true,
160
+ "propertyNames": {
161
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
162
+ }
163
+ },
164
+ "Idea": {
165
+ "title": "Idea",
166
+ "description": "An idea as one caller may see it.",
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "required": [
170
+ "ideaId",
171
+ "boardId",
172
+ "state",
173
+ "title",
174
+ "description",
175
+ "proposer",
176
+ "proposedAt",
177
+ "noteCount"
178
+ ],
179
+ "properties": {
180
+ "ideaId": {
181
+ "$ref": "#/$defs/IdeaId"
182
+ },
183
+ "boardId": {
184
+ "$ref": "#/$defs/BoardId"
185
+ },
186
+ "state": {
187
+ "$ref": "#/$defs/IdeaState"
188
+ },
189
+ "title": {
190
+ "$ref": "#/$defs/IdeaTitle"
191
+ },
192
+ "description": {
193
+ "$ref": "#/$defs/IdeaDescription"
194
+ },
195
+ "format": {
196
+ "$ref": "#/$defs/IdeaFormat"
197
+ },
198
+ "topic": {
199
+ "$ref": "#/$defs/Topic"
200
+ },
201
+ "proposer": {
202
+ "$ref": "#/$defs/Author"
203
+ },
204
+ "proposedAt": {
205
+ "type": "string",
206
+ "format": "date-time"
207
+ },
208
+ "noteCount": {
209
+ "type": "integer",
210
+ "minimum": 0,
211
+ "description": "Notes on the idea the caller may read."
212
+ },
213
+ "election": {
214
+ "$ref": "#/$defs/IdeaElection",
215
+ "description": "Present once an election was opened for the idea."
216
+ },
217
+ "opening": {
218
+ "$ref": "#/$defs/IdeaOpening"
219
+ },
220
+ "decision": {
221
+ "$ref": "#/$defs/IdeaDecision",
222
+ "description": "Present in `declined`, `merged`, `selected` and `notSelected`."
223
+ }
224
+ }
225
+ },
226
+ "IdeaDecision": {
227
+ "title": "IdeaDecision",
228
+ "description": "A facilitator's decision on an idea: declining or merging it (VTI-BRD-013), or selecting it or not (VTI-BRD-040). The deciding facilitator is not named to the audience.",
229
+ "type": "object",
230
+ "additionalProperties": false,
231
+ "required": [
232
+ "decidedAt"
233
+ ],
234
+ "properties": {
235
+ "decidedAt": {
236
+ "type": "string",
237
+ "format": "date-time"
238
+ },
239
+ "reason": {
240
+ "$ref": "#/$defs/Reason"
241
+ },
242
+ "mergedInto": {
243
+ "$ref": "#/$defs/IdeaId",
244
+ "description": "Present exactly when the idea is `merged`."
245
+ },
246
+ "slotId": {
247
+ "$ref": "#/$defs/Key",
248
+ "description": "A `selected` idea's place in the board's timetable, where it has one."
249
+ },
250
+ "departsFromRule": {
251
+ "type": "boolean",
252
+ "description": "`selected` or `notSelected` only: whether the facilitator said the decision departs from the board's `selectionRule` (VTI-BRD-041); `reason` then says why."
253
+ },
254
+ "ownIdea": {
255
+ "const": true,
256
+ "description": "Present when a facilitator decided their own idea because no other facilitator existed (VTI-BRD-013)."
257
+ }
258
+ }
259
+ },
260
+ "IdeaId": {
261
+ "title": "IdeaId",
262
+ "description": "Opaque identifier of an idea: `ida_` followed by 16 to 64 base64url characters. Random and unique within the community.",
263
+ "type": "string",
264
+ "pattern": "^ida_[A-Za-z0-9_-]{16,64}$"
265
+ },
266
+ "Reason": {
267
+ "title": "Reason",
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "maxLength": 500,
271
+ "description": "A facilitator's stated reason, shown to the board's audience with the decision it explains. Plain text."
272
+ },
273
+ "Key": {
274
+ "title": "Key",
275
+ "description": "A question or option key, unique within its manifest or question.",
276
+ "type": "string",
277
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
278
+ },
279
+ "IdeaOpening": {
280
+ "title": "IdeaOpening",
281
+ "description": "Shown to facilitators only: an accepted idea whose election the ballot box has not yet registered, so the idea is still `proposed` (VTI-BRD-031). `refusal` is the ballot box's or community's refusal of the last attempt, after which the idea is no longer being opened.",
282
+ "type": "object",
283
+ "additionalProperties": false,
284
+ "required": [
285
+ "electionId",
286
+ "startedAt"
287
+ ],
288
+ "properties": {
289
+ "electionId": {
290
+ "$ref": "#/$defs/ElectionId"
291
+ },
292
+ "startedAt": {
293
+ "type": "string",
294
+ "format": "date-time",
295
+ "description": "When the facilitator accepted the idea."
296
+ },
297
+ "refusal": {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": [
301
+ "code",
302
+ "refusedAt"
303
+ ],
304
+ "properties": {
305
+ "code": {
306
+ "type": "string",
307
+ "minLength": 1,
308
+ "maxLength": 200
309
+ },
310
+ "refusedAt": {
311
+ "type": "string",
312
+ "format": "date-time"
313
+ }
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "ElectionId": {
319
+ "title": "ElectionId",
320
+ "description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
321
+ "type": "string",
322
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
323
+ },
324
+ "IdeaElection": {
325
+ "title": "IdeaElection",
326
+ "description": "An idea's election as a board shows it (VTI-BRD-033): never who took a ticket or cast a ballot.",
327
+ "type": "object",
328
+ "additionalProperties": false,
329
+ "required": [
330
+ "electionId",
331
+ "state"
332
+ ],
333
+ "properties": {
334
+ "electionId": {
335
+ "$ref": "#/$defs/ElectionId"
336
+ },
337
+ "state": {
338
+ "$ref": "#/$defs/ElectionState"
339
+ },
340
+ "ballotsOnBoard": {
341
+ "type": "integer",
342
+ "minimum": 0,
343
+ "description": "The ballot box's latest board head's ballot count, where its board is public (VTI-VOT-052); absent otherwise. Counts ballots, not voters, where a later ballot replaces an earlier one."
344
+ },
345
+ "boardHeadIssuedAt": {
346
+ "type": "string",
347
+ "format": "date-time",
348
+ "description": "When the head `ballotsOnBoard` was read from was issued."
349
+ },
350
+ "result": {
351
+ "$ref": "#/$defs/ElectionResult",
352
+ "description": "Present once the election is tallied."
353
+ },
354
+ "certified": {
355
+ "type": "boolean",
356
+ "description": "Present with `result`: whether the community certified it (VTI-VOT-071)."
357
+ }
358
+ }
359
+ },
360
+ "ElectionResult": {
361
+ "title": "ElectionResult",
362
+ "description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
363
+ "type": "object",
364
+ "additionalProperties": false,
365
+ "required": [
366
+ "electionId",
367
+ "manifestDigest",
368
+ "ballotsCounted",
369
+ "questions",
370
+ "head"
371
+ ],
372
+ "properties": {
373
+ "electionId": {
374
+ "$ref": "#/$defs/ElectionId"
375
+ },
376
+ "manifestDigest": {
377
+ "$ref": "#/$defs/DigestMultibase"
378
+ },
379
+ "ballotsCounted": {
380
+ "type": "integer",
381
+ "minimum": 0
382
+ },
383
+ "questions": {
384
+ "type": "array",
385
+ "items": {
386
+ "$ref": "#/$defs/QuestionResult"
387
+ }
388
+ },
389
+ "head": {
390
+ "$ref": "#/$defs/BoardHead",
391
+ "description": "The head of the board as it stood at close: the result counts exactly its entries."
392
+ }
393
+ }
394
+ },
395
+ "BoardHead": {
396
+ "title": "BoardHead",
397
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
398
+ "type": "object",
399
+ "additionalProperties": false,
400
+ "required": [
401
+ "electionId",
402
+ "treeSize",
403
+ "rootHash",
404
+ "issuedAt"
405
+ ],
406
+ "properties": {
407
+ "electionId": {
408
+ "$ref": "#/$defs/ElectionId"
409
+ },
410
+ "treeSize": {
411
+ "type": "integer",
412
+ "minimum": 0
413
+ },
414
+ "rootHash": {
415
+ "$ref": "#/$defs/DigestMultibase",
416
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
417
+ },
418
+ "issuedAt": {
419
+ "type": "string",
420
+ "format": "date-time"
421
+ }
422
+ }
423
+ },
424
+ "DigestMultibase": {
425
+ "title": "DigestMultibase",
426
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
427
+ "type": "string",
428
+ "minLength": 16,
429
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
430
+ "examples": [
431
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
432
+ ]
433
+ },
434
+ "QuestionResult": {
435
+ "title": "QuestionResult",
436
+ "description": "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.",
437
+ "type": "object",
438
+ "additionalProperties": false,
439
+ "required": [
440
+ "question",
441
+ "abstained"
442
+ ],
443
+ "properties": {
444
+ "question": {
445
+ "$ref": "#/$defs/Key"
446
+ },
447
+ "abstained": {
448
+ "type": "integer",
449
+ "minimum": 0
450
+ },
451
+ "choice": {
452
+ "type": "object",
453
+ "propertyNames": {
454
+ "$ref": "#/$defs/Key"
455
+ },
456
+ "additionalProperties": {
457
+ "type": "integer",
458
+ "minimum": 0
459
+ }
460
+ },
461
+ "ranking": {
462
+ "type": "object",
463
+ "propertyNames": {
464
+ "$ref": "#/$defs/Key"
465
+ },
466
+ "additionalProperties": {
467
+ "type": "array",
468
+ "items": {
469
+ "type": "integer",
470
+ "minimum": 0
471
+ }
472
+ }
473
+ },
474
+ "score": {
475
+ "type": "object",
476
+ "propertyNames": {
477
+ "$ref": "#/$defs/Key"
478
+ },
479
+ "additionalProperties": {
480
+ "type": "object",
481
+ "additionalProperties": false,
482
+ "required": [
483
+ "sum",
484
+ "count"
485
+ ],
486
+ "properties": {
487
+ "sum": {
488
+ "type": "integer"
489
+ },
490
+ "count": {
491
+ "type": "integer",
492
+ "minimum": 0
493
+ }
494
+ }
495
+ }
496
+ },
497
+ "text": {
498
+ "type": "array",
499
+ "items": {
500
+ "type": "string",
501
+ "maxLength": 4096
502
+ }
503
+ },
504
+ "withheld": {
505
+ "type": "boolean"
506
+ }
507
+ }
508
+ },
509
+ "ElectionState": {
510
+ "title": "ElectionState",
511
+ "type": "string",
512
+ "enum": [
513
+ "registered",
514
+ "registration",
515
+ "voting",
516
+ "closed",
517
+ "tallied",
518
+ "cancelled"
519
+ ]
520
+ },
521
+ "Author": {
522
+ "title": "Author",
523
+ "description": "Who proposed an idea or wrote a note, as the board's audience sees them. `entryId` is their directory entry, which survives a rotation of their DID; `name` is their directory display name as this caller may see it, absent where the directory withholds it. A departed member is shown as `formerMember: true` with neither (VTI-BRD-060).",
524
+ "type": "object",
525
+ "additionalProperties": false,
526
+ "properties": {
527
+ "entryId": {
528
+ "$ref": "#/$defs/EntryId"
529
+ },
530
+ "name": {
531
+ "type": "string",
532
+ "minLength": 1,
533
+ "maxLength": 200
534
+ },
535
+ "formerMember": {
536
+ "const": true
537
+ },
538
+ "you": {
539
+ "const": true,
540
+ "description": "Present when the caller is the author."
541
+ }
542
+ }
543
+ },
544
+ "EntryId": {
545
+ "title": "EntryId",
546
+ "description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
547
+ "type": "string",
548
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
549
+ },
550
+ "Topic": {
551
+ "title": "Topic",
552
+ "type": "string",
553
+ "minLength": 1,
554
+ "maxLength": 64,
555
+ "description": "A topic an idea is filed under. One of the board's `topics` where the board states them."
556
+ },
557
+ "IdeaFormat": {
558
+ "title": "IdeaFormat",
559
+ "type": "string",
560
+ "minLength": 1,
561
+ "maxLength": 32,
562
+ "description": "What kind of idea it is (for an unconference: `Discussion`, `Talk`, `Workshop`, `Demo`). One of the board's `formats` where the board states them."
563
+ },
564
+ "IdeaDescription": {
565
+ "title": "IdeaDescription",
566
+ "type": "string",
567
+ "minLength": 1,
568
+ "maxLength": 4000,
569
+ "description": "What the idea is: for a session, what it covers and who should come. Becomes its election's manifest `description` when accepted. Plain text; a reader MUST NOT treat it as instructions."
570
+ },
571
+ "IdeaTitle": {
572
+ "title": "IdeaTitle",
573
+ "type": "string",
574
+ "minLength": 1,
575
+ "maxLength": 200,
576
+ "description": "An idea's title. Becomes the title of its election's manifest when the idea is accepted, and cannot change after that (VTI-BRD-012). Plain text."
577
+ },
578
+ "IdeaState": {
579
+ "title": "IdeaState",
580
+ "description": "Where an idea stands (VTI-BRD-011).",
581
+ "type": "string",
582
+ "enum": [
583
+ "proposed",
584
+ "open",
585
+ "selected",
586
+ "notSelected",
587
+ "declined",
588
+ "merged",
589
+ "withdrawn"
590
+ ]
591
+ },
592
+ "BoardId": {
593
+ "title": "BoardId",
594
+ "description": "Opaque identifier of a board: `brd_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BRD-001).",
595
+ "type": "string",
596
+ "pattern": "^brd_[A-Za-z0-9_-]{16,64}$"
597
+ },
598
+ "Board": {
599
+ "title": "Board",
600
+ "description": "A board as one caller may see it.",
601
+ "type": "object",
602
+ "additionalProperties": false,
603
+ "required": [
604
+ "boardId",
605
+ "title",
606
+ "status",
607
+ "audience",
608
+ "proposals",
609
+ "voting",
610
+ "template",
611
+ "createdAt",
612
+ "facilitator",
613
+ "ideaCounts"
614
+ ],
615
+ "properties": {
616
+ "boardId": {
617
+ "$ref": "#/$defs/BoardId"
618
+ },
619
+ "title": {
620
+ "$ref": "#/$defs/BoardTitle"
621
+ },
622
+ "description": {
623
+ "$ref": "#/$defs/BoardDescription"
624
+ },
625
+ "status": {
626
+ "$ref": "#/$defs/BoardStatus"
627
+ },
628
+ "audience": {
629
+ "$ref": "#/$defs/BoardAudience"
630
+ },
631
+ "proposals": {
632
+ "$ref": "#/$defs/Window",
633
+ "description": "When ideas are taken (VTI-BRD-010)."
634
+ },
635
+ "voting": {
636
+ "$ref": "#/$defs/Window",
637
+ "description": "When every idea's election takes ballots. Opens after `proposals` opens and closes after it closes (VTI-BRD-001)."
638
+ },
639
+ "topics": {
640
+ "type": "array",
641
+ "maxItems": 32,
642
+ "uniqueItems": true,
643
+ "items": {
644
+ "$ref": "#/$defs/Topic"
645
+ }
646
+ },
647
+ "formats": {
648
+ "type": "array",
649
+ "maxItems": 16,
650
+ "uniqueItems": true,
651
+ "items": {
652
+ "$ref": "#/$defs/IdeaFormat"
653
+ }
654
+ },
655
+ "maxIdeasPerMember": {
656
+ "type": "integer",
657
+ "minimum": 1,
658
+ "maximum": 100,
659
+ "description": "The most ideas one member may have on the board that are not `withdrawn` or `declined`. Absent: no limit beyond the community's own."
660
+ },
661
+ "selectionRule": {
662
+ "type": "string",
663
+ "minLength": 1,
664
+ "maxLength": 500,
665
+ "description": "How facilitators intend to select, in plain words (VTI-BRD-041), e.g. \"The twelve ideas the most members would attend\"."
666
+ },
667
+ "timetable": {
668
+ "type": "array",
669
+ "maxItems": 256,
670
+ "items": {
671
+ "$ref": "#/$defs/Slot"
672
+ }
673
+ },
674
+ "template": {
675
+ "$ref": "#/$defs/ElectionTemplate"
676
+ },
677
+ "createdAt": {
678
+ "type": "string",
679
+ "format": "date-time"
680
+ },
681
+ "facilitator": {
682
+ "type": "boolean",
683
+ "description": "Whether the caller facilitates this board."
684
+ },
685
+ "ideaCounts": {
686
+ "type": "object",
687
+ "additionalProperties": false,
688
+ "description": "How many of the board's ideas are in each state the caller may see.",
689
+ "properties": {
690
+ "proposed": {
691
+ "type": "integer",
692
+ "minimum": 0
693
+ },
694
+ "open": {
695
+ "type": "integer",
696
+ "minimum": 0
697
+ },
698
+ "selected": {
699
+ "type": "integer",
700
+ "minimum": 0
701
+ },
702
+ "notSelected": {
703
+ "type": "integer",
704
+ "minimum": 0
705
+ },
706
+ "declined": {
707
+ "type": "integer",
708
+ "minimum": 0
709
+ },
710
+ "merged": {
711
+ "type": "integer",
712
+ "minimum": 0
713
+ },
714
+ "withdrawn": {
715
+ "type": "integer",
716
+ "minimum": 0
717
+ }
718
+ }
719
+ }
720
+ }
721
+ },
722
+ "ElectionTemplate": {
723
+ "title": "ElectionTemplate",
724
+ "description": "Every member of an idea's election manifest that the board fixes (VTI-BRD-030). When a facilitator accepts an idea the community completes it: `electionId` (naming the board and the idea), `community`, `title` and `description` from the idea, `registrationOpensAt` and `votingOpensAt` from the board's voting window's `opensAt` or the acceptance, whichever is later, `votingClosesAt` from its `closesAt`, `roll` from the board's audience (rule `members`, or a credential roll naming the group), and `binding: false`. A board's template is never binding, and so has no `binding` member.",
725
+ "type": "object",
726
+ "additionalProperties": false,
727
+ "required": [
728
+ "questions",
729
+ "secrecy",
730
+ "revote",
731
+ "board",
732
+ "ballotBox",
733
+ "allowEarlyClose",
734
+ "resultsBeforeClose",
735
+ "textReleaseThreshold"
736
+ ],
737
+ "properties": {
738
+ "questions": {
739
+ "type": "array",
740
+ "minItems": 1,
741
+ "maxItems": 16,
742
+ "items": {
743
+ "$ref": "#/$defs/Question"
744
+ }
745
+ },
746
+ "secrecy": {
747
+ "$ref": "#/$defs/SecrecyLevel"
748
+ },
749
+ "revote": {
750
+ "$ref": "#/$defs/Revote"
751
+ },
752
+ "board": {
753
+ "type": "object",
754
+ "additionalProperties": false,
755
+ "required": [
756
+ "visibility",
757
+ "auditors"
758
+ ],
759
+ "description": "The ballot box's board for each idea's election, as a manifest states it (VTI-VOT-052). `public` lets a board show each idea's ballot count while voting is open (VTI-BRD-033).",
760
+ "properties": {
761
+ "visibility": {
762
+ "$ref": "#/$defs/BoardVisibility"
763
+ },
764
+ "auditors": {
765
+ "type": "array",
766
+ "uniqueItems": true,
767
+ "items": {
768
+ "type": "string",
769
+ "minLength": 1,
770
+ "maxLength": 2048
771
+ }
772
+ }
773
+ }
774
+ },
775
+ "ballotBox": {
776
+ "type": "string",
777
+ "minLength": 1,
778
+ "maxLength": 2048,
779
+ "description": "The DID of the voting service every idea's election is registered with; one on the community's list (VTI-VOT-082)."
780
+ },
781
+ "trustees": {
782
+ "$ref": "#/$defs/Trustees"
783
+ },
784
+ "allowEarlyClose": {
785
+ "type": "boolean"
786
+ },
787
+ "resultsBeforeClose": {
788
+ "type": "boolean",
789
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061). A board SHOULD set it false (VTI-BRD-033)."
790
+ },
791
+ "textReleaseThreshold": {
792
+ "type": "integer",
793
+ "minimum": 1,
794
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065); SHOULD be at least 10."
795
+ }
796
+ }
797
+ },
798
+ "Trustees": {
799
+ "title": "Trustees",
800
+ "description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
801
+ "type": "object",
802
+ "additionalProperties": false,
803
+ "required": [
804
+ "dids",
805
+ "threshold"
806
+ ],
807
+ "properties": {
808
+ "dids": {
809
+ "type": "array",
810
+ "minItems": 2,
811
+ "items": {
812
+ "type": "string",
813
+ "minLength": 1,
814
+ "maxLength": 2048
815
+ },
816
+ "uniqueItems": true
817
+ },
818
+ "threshold": {
819
+ "type": "integer",
820
+ "minimum": 2
821
+ }
822
+ }
823
+ },
824
+ "BoardVisibility": {
825
+ "title": "BoardVisibility",
826
+ "description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
827
+ "type": "string",
828
+ "enum": [
829
+ "public",
830
+ "private"
831
+ ]
832
+ },
833
+ "Revote": {
834
+ "title": "Revote",
835
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
836
+ "type": "string",
837
+ "enum": [
838
+ "replace",
839
+ "refuse"
840
+ ]
841
+ },
842
+ "SecrecyLevel": {
843
+ "title": "SecrecyLevel",
844
+ "description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
845
+ "type": "string",
846
+ "enum": [
847
+ "open",
848
+ "sealed",
849
+ "talliedEncrypted"
850
+ ]
851
+ },
852
+ "Question": {
853
+ "title": "Question",
854
+ "description": "One question. Tagged union over `type`.",
855
+ "oneOf": [
856
+ {
857
+ "title": "ChoiceQuestion",
858
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
859
+ "type": "object",
860
+ "additionalProperties": false,
861
+ "required": [
862
+ "key",
863
+ "type",
864
+ "options",
865
+ "minSelections",
866
+ "maxSelections",
867
+ "optional"
868
+ ],
869
+ "properties": {
870
+ "key": {
871
+ "$ref": "#/$defs/Key"
872
+ },
873
+ "type": {
874
+ "const": "choice"
875
+ },
876
+ "text": {
877
+ "type": "string",
878
+ "maxLength": 2048
879
+ },
880
+ "options": {
881
+ "type": "array",
882
+ "minItems": 2,
883
+ "maxItems": 256,
884
+ "items": {
885
+ "$ref": "#/$defs/QuestionOption"
886
+ }
887
+ },
888
+ "minSelections": {
889
+ "type": "integer",
890
+ "minimum": 0
891
+ },
892
+ "maxSelections": {
893
+ "type": "integer",
894
+ "minimum": 1
895
+ },
896
+ "optional": {
897
+ "type": "boolean"
898
+ }
899
+ }
900
+ },
901
+ {
902
+ "title": "RankingQuestion",
903
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
904
+ "type": "object",
905
+ "additionalProperties": false,
906
+ "required": [
907
+ "key",
908
+ "type",
909
+ "options",
910
+ "partial",
911
+ "optional"
912
+ ],
913
+ "properties": {
914
+ "key": {
915
+ "$ref": "#/$defs/Key"
916
+ },
917
+ "type": {
918
+ "const": "ranking"
919
+ },
920
+ "text": {
921
+ "type": "string",
922
+ "maxLength": 2048
923
+ },
924
+ "options": {
925
+ "type": "array",
926
+ "minItems": 2,
927
+ "maxItems": 64,
928
+ "items": {
929
+ "$ref": "#/$defs/QuestionOption"
930
+ }
931
+ },
932
+ "partial": {
933
+ "type": "boolean"
934
+ },
935
+ "optional": {
936
+ "type": "boolean"
937
+ }
938
+ }
939
+ },
940
+ {
941
+ "title": "ScoreQuestion",
942
+ "description": "Give each option an integer score within [min, max].",
943
+ "type": "object",
944
+ "additionalProperties": false,
945
+ "required": [
946
+ "key",
947
+ "type",
948
+ "options",
949
+ "min",
950
+ "max",
951
+ "optional"
952
+ ],
953
+ "properties": {
954
+ "key": {
955
+ "$ref": "#/$defs/Key"
956
+ },
957
+ "type": {
958
+ "const": "score"
959
+ },
960
+ "text": {
961
+ "type": "string",
962
+ "maxLength": 2048
963
+ },
964
+ "options": {
965
+ "type": "array",
966
+ "minItems": 1,
967
+ "maxItems": 256,
968
+ "items": {
969
+ "$ref": "#/$defs/QuestionOption"
970
+ }
971
+ },
972
+ "min": {
973
+ "type": "integer"
974
+ },
975
+ "max": {
976
+ "type": "integer"
977
+ },
978
+ "optional": {
979
+ "type": "boolean"
980
+ }
981
+ }
982
+ },
983
+ {
984
+ "title": "TextQuestion",
985
+ "description": "Free text of at most `maxLength` characters.",
986
+ "type": "object",
987
+ "additionalProperties": false,
988
+ "required": [
989
+ "key",
990
+ "type",
991
+ "maxLength",
992
+ "optional"
993
+ ],
994
+ "properties": {
995
+ "key": {
996
+ "$ref": "#/$defs/Key"
997
+ },
998
+ "type": {
999
+ "const": "text"
1000
+ },
1001
+ "text": {
1002
+ "type": "string",
1003
+ "maxLength": 2048
1004
+ },
1005
+ "maxLength": {
1006
+ "type": "integer",
1007
+ "minimum": 1,
1008
+ "maximum": 4096
1009
+ },
1010
+ "optional": {
1011
+ "type": "boolean"
1012
+ }
1013
+ }
1014
+ }
1015
+ ]
1016
+ },
1017
+ "QuestionOption": {
1018
+ "title": "QuestionOption",
1019
+ "type": "object",
1020
+ "additionalProperties": false,
1021
+ "required": [
1022
+ "key"
1023
+ ],
1024
+ "properties": {
1025
+ "key": {
1026
+ "$ref": "#/$defs/Key"
1027
+ },
1028
+ "label": {
1029
+ "type": "string",
1030
+ "maxLength": 512,
1031
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
1032
+ }
1033
+ }
1034
+ },
1035
+ "Slot": {
1036
+ "title": "Slot",
1037
+ "description": "One place in a board's timetable that a selected idea can be put in (VTI-BRD-040): a place (`label`, e.g. a room) and a time.",
1038
+ "type": "object",
1039
+ "additionalProperties": false,
1040
+ "required": [
1041
+ "slotId",
1042
+ "label",
1043
+ "startsAt",
1044
+ "endsAt"
1045
+ ],
1046
+ "properties": {
1047
+ "slotId": {
1048
+ "$ref": "#/$defs/Key"
1049
+ },
1050
+ "label": {
1051
+ "type": "string",
1052
+ "minLength": 1,
1053
+ "maxLength": 100
1054
+ },
1055
+ "startsAt": {
1056
+ "type": "string",
1057
+ "format": "date-time"
1058
+ },
1059
+ "endsAt": {
1060
+ "type": "string",
1061
+ "format": "date-time"
1062
+ }
1063
+ }
1064
+ },
1065
+ "Window": {
1066
+ "title": "Window",
1067
+ "description": "A period, open from `opensAt` until `closesAt`. `closesAt` is after `opensAt` (a consumer check; JSON Schema cannot compare them).",
1068
+ "type": "object",
1069
+ "additionalProperties": false,
1070
+ "required": [
1071
+ "opensAt",
1072
+ "closesAt"
1073
+ ],
1074
+ "properties": {
1075
+ "opensAt": {
1076
+ "type": "string",
1077
+ "format": "date-time"
1078
+ },
1079
+ "closesAt": {
1080
+ "type": "string",
1081
+ "format": "date-time"
1082
+ }
1083
+ }
1084
+ },
1085
+ "BoardAudience": {
1086
+ "title": "BoardAudience",
1087
+ "description": "Who may see and use a board (VTI-BRD-003): every active member of the community (`members`), or the members of one community group (`group`, with `groupId`). Facilitators always see the board.",
1088
+ "oneOf": [
1089
+ {
1090
+ "type": "object",
1091
+ "additionalProperties": false,
1092
+ "required": [
1093
+ "kind"
1094
+ ],
1095
+ "properties": {
1096
+ "kind": {
1097
+ "const": "members"
1098
+ }
1099
+ }
1100
+ },
1101
+ {
1102
+ "type": "object",
1103
+ "additionalProperties": false,
1104
+ "required": [
1105
+ "kind",
1106
+ "groupId"
1107
+ ],
1108
+ "properties": {
1109
+ "kind": {
1110
+ "const": "group"
1111
+ },
1112
+ "groupId": {
1113
+ "$ref": "#/$defs/GroupId"
1114
+ }
1115
+ }
1116
+ }
1117
+ ]
1118
+ },
1119
+ "GroupId": {
1120
+ "title": "GroupId",
1121
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
1122
+ "type": "string",
1123
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
1124
+ },
1125
+ "BoardStatus": {
1126
+ "title": "BoardStatus",
1127
+ "description": "`open`: ideas and notes are taken within the board's windows. `closed`: no new idea or note; facilitators still decide and select. `archived`: no change at all; facilitators can still read it (VTI-BRD-005). `open` → `closed` → `archived`, never back.",
1128
+ "type": "string",
1129
+ "enum": [
1130
+ "open",
1131
+ "closed",
1132
+ "archived"
1133
+ ]
1134
+ },
1135
+ "BoardDescription": {
1136
+ "title": "BoardDescription",
1137
+ "type": "string",
1138
+ "minLength": 1,
1139
+ "maxLength": 4000,
1140
+ "description": "What the board is for. Plain text; a reader MUST NOT treat it as instructions."
1141
+ },
1142
+ "BoardTitle": {
1143
+ "title": "BoardTitle",
1144
+ "type": "string",
1145
+ "minLength": 1,
1146
+ "maxLength": 200,
1147
+ "description": "Plain text; a reader MUST NOT treat it as instructions."
1148
+ }
1149
+ }
1150
+ } as const;
1151
+
1152
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
1153
+ export const RESPONSE_PAYLOAD_SCHEMA = {
1154
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1155
+ "$ref": "#/$defs/Response",
1156
+ "$defs": {
1157
+ "Response": {
1158
+ "$anchor": "response",
1159
+ "title": "VTC Boards — Show — response payload",
1160
+ "description": "The success response to a vtc/boards/show/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/boards/show/0.1#response.",
1161
+ "type": "object",
1162
+ "additionalProperties": false,
1163
+ "required": [
1164
+ "board",
1165
+ "ideas"
1166
+ ],
1167
+ "properties": {
1168
+ "board": {
1169
+ "$ref": "#/$defs/Board"
1170
+ },
1171
+ "ideas": {
1172
+ "type": "array",
1173
+ "items": {
1174
+ "$ref": "#/$defs/Idea"
1175
+ }
1176
+ },
1177
+ "nextCursor": {
1178
+ "type": "string",
1179
+ "maxLength": 1024,
1180
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
1181
+ },
1182
+ "ext": {
1183
+ "$ref": "#/$defs/Ext"
1184
+ }
1185
+ }
1186
+ },
1187
+ "Ext": {
1188
+ "title": "Ext",
1189
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
1190
+ "type": "object",
1191
+ "minProperties": 1,
1192
+ "additionalProperties": true,
1193
+ "propertyNames": {
1194
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
1195
+ }
1196
+ },
1197
+ "Idea": {
1198
+ "title": "Idea",
1199
+ "description": "An idea as one caller may see it.",
1200
+ "type": "object",
1201
+ "additionalProperties": false,
1202
+ "required": [
1203
+ "ideaId",
1204
+ "boardId",
1205
+ "state",
1206
+ "title",
1207
+ "description",
1208
+ "proposer",
1209
+ "proposedAt",
1210
+ "noteCount"
1211
+ ],
1212
+ "properties": {
1213
+ "ideaId": {
1214
+ "$ref": "#/$defs/IdeaId"
1215
+ },
1216
+ "boardId": {
1217
+ "$ref": "#/$defs/BoardId"
1218
+ },
1219
+ "state": {
1220
+ "$ref": "#/$defs/IdeaState"
1221
+ },
1222
+ "title": {
1223
+ "$ref": "#/$defs/IdeaTitle"
1224
+ },
1225
+ "description": {
1226
+ "$ref": "#/$defs/IdeaDescription"
1227
+ },
1228
+ "format": {
1229
+ "$ref": "#/$defs/IdeaFormat"
1230
+ },
1231
+ "topic": {
1232
+ "$ref": "#/$defs/Topic"
1233
+ },
1234
+ "proposer": {
1235
+ "$ref": "#/$defs/Author"
1236
+ },
1237
+ "proposedAt": {
1238
+ "type": "string",
1239
+ "format": "date-time"
1240
+ },
1241
+ "noteCount": {
1242
+ "type": "integer",
1243
+ "minimum": 0,
1244
+ "description": "Notes on the idea the caller may read."
1245
+ },
1246
+ "election": {
1247
+ "$ref": "#/$defs/IdeaElection",
1248
+ "description": "Present once an election was opened for the idea."
1249
+ },
1250
+ "opening": {
1251
+ "$ref": "#/$defs/IdeaOpening"
1252
+ },
1253
+ "decision": {
1254
+ "$ref": "#/$defs/IdeaDecision",
1255
+ "description": "Present in `declined`, `merged`, `selected` and `notSelected`."
1256
+ }
1257
+ }
1258
+ },
1259
+ "IdeaDecision": {
1260
+ "title": "IdeaDecision",
1261
+ "description": "A facilitator's decision on an idea: declining or merging it (VTI-BRD-013), or selecting it or not (VTI-BRD-040). The deciding facilitator is not named to the audience.",
1262
+ "type": "object",
1263
+ "additionalProperties": false,
1264
+ "required": [
1265
+ "decidedAt"
1266
+ ],
1267
+ "properties": {
1268
+ "decidedAt": {
1269
+ "type": "string",
1270
+ "format": "date-time"
1271
+ },
1272
+ "reason": {
1273
+ "$ref": "#/$defs/Reason"
1274
+ },
1275
+ "mergedInto": {
1276
+ "$ref": "#/$defs/IdeaId",
1277
+ "description": "Present exactly when the idea is `merged`."
1278
+ },
1279
+ "slotId": {
1280
+ "$ref": "#/$defs/Key",
1281
+ "description": "A `selected` idea's place in the board's timetable, where it has one."
1282
+ },
1283
+ "departsFromRule": {
1284
+ "type": "boolean",
1285
+ "description": "`selected` or `notSelected` only: whether the facilitator said the decision departs from the board's `selectionRule` (VTI-BRD-041); `reason` then says why."
1286
+ },
1287
+ "ownIdea": {
1288
+ "const": true,
1289
+ "description": "Present when a facilitator decided their own idea because no other facilitator existed (VTI-BRD-013)."
1290
+ }
1291
+ }
1292
+ },
1293
+ "IdeaId": {
1294
+ "title": "IdeaId",
1295
+ "description": "Opaque identifier of an idea: `ida_` followed by 16 to 64 base64url characters. Random and unique within the community.",
1296
+ "type": "string",
1297
+ "pattern": "^ida_[A-Za-z0-9_-]{16,64}$"
1298
+ },
1299
+ "Reason": {
1300
+ "title": "Reason",
1301
+ "type": "string",
1302
+ "minLength": 1,
1303
+ "maxLength": 500,
1304
+ "description": "A facilitator's stated reason, shown to the board's audience with the decision it explains. Plain text."
1305
+ },
1306
+ "Key": {
1307
+ "title": "Key",
1308
+ "description": "A question or option key, unique within its manifest or question.",
1309
+ "type": "string",
1310
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
1311
+ },
1312
+ "IdeaOpening": {
1313
+ "title": "IdeaOpening",
1314
+ "description": "Shown to facilitators only: an accepted idea whose election the ballot box has not yet registered, so the idea is still `proposed` (VTI-BRD-031). `refusal` is the ballot box's or community's refusal of the last attempt, after which the idea is no longer being opened.",
1315
+ "type": "object",
1316
+ "additionalProperties": false,
1317
+ "required": [
1318
+ "electionId",
1319
+ "startedAt"
1320
+ ],
1321
+ "properties": {
1322
+ "electionId": {
1323
+ "$ref": "#/$defs/ElectionId"
1324
+ },
1325
+ "startedAt": {
1326
+ "type": "string",
1327
+ "format": "date-time",
1328
+ "description": "When the facilitator accepted the idea."
1329
+ },
1330
+ "refusal": {
1331
+ "type": "object",
1332
+ "additionalProperties": false,
1333
+ "required": [
1334
+ "code",
1335
+ "refusedAt"
1336
+ ],
1337
+ "properties": {
1338
+ "code": {
1339
+ "type": "string",
1340
+ "minLength": 1,
1341
+ "maxLength": 200
1342
+ },
1343
+ "refusedAt": {
1344
+ "type": "string",
1345
+ "format": "date-time"
1346
+ }
1347
+ }
1348
+ }
1349
+ }
1350
+ },
1351
+ "ElectionId": {
1352
+ "title": "ElectionId",
1353
+ "description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
1354
+ "type": "string",
1355
+ "pattern": "^[A-Za-z0-9._-]{1,128}$"
1356
+ },
1357
+ "IdeaElection": {
1358
+ "title": "IdeaElection",
1359
+ "description": "An idea's election as a board shows it (VTI-BRD-033): never who took a ticket or cast a ballot.",
1360
+ "type": "object",
1361
+ "additionalProperties": false,
1362
+ "required": [
1363
+ "electionId",
1364
+ "state"
1365
+ ],
1366
+ "properties": {
1367
+ "electionId": {
1368
+ "$ref": "#/$defs/ElectionId"
1369
+ },
1370
+ "state": {
1371
+ "$ref": "#/$defs/ElectionState"
1372
+ },
1373
+ "ballotsOnBoard": {
1374
+ "type": "integer",
1375
+ "minimum": 0,
1376
+ "description": "The ballot box's latest board head's ballot count, where its board is public (VTI-VOT-052); absent otherwise. Counts ballots, not voters, where a later ballot replaces an earlier one."
1377
+ },
1378
+ "boardHeadIssuedAt": {
1379
+ "type": "string",
1380
+ "format": "date-time",
1381
+ "description": "When the head `ballotsOnBoard` was read from was issued."
1382
+ },
1383
+ "result": {
1384
+ "$ref": "#/$defs/ElectionResult",
1385
+ "description": "Present once the election is tallied."
1386
+ },
1387
+ "certified": {
1388
+ "type": "boolean",
1389
+ "description": "Present with `result`: whether the community certified it (VTI-VOT-071)."
1390
+ }
1391
+ }
1392
+ },
1393
+ "ElectionResult": {
1394
+ "title": "ElectionResult",
1395
+ "description": "An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).",
1396
+ "type": "object",
1397
+ "additionalProperties": false,
1398
+ "required": [
1399
+ "electionId",
1400
+ "manifestDigest",
1401
+ "ballotsCounted",
1402
+ "questions",
1403
+ "head"
1404
+ ],
1405
+ "properties": {
1406
+ "electionId": {
1407
+ "$ref": "#/$defs/ElectionId"
1408
+ },
1409
+ "manifestDigest": {
1410
+ "$ref": "#/$defs/DigestMultibase"
1411
+ },
1412
+ "ballotsCounted": {
1413
+ "type": "integer",
1414
+ "minimum": 0
1415
+ },
1416
+ "questions": {
1417
+ "type": "array",
1418
+ "items": {
1419
+ "$ref": "#/$defs/QuestionResult"
1420
+ }
1421
+ },
1422
+ "head": {
1423
+ "$ref": "#/$defs/BoardHead",
1424
+ "description": "The head of the board as it stood at close: the result counts exactly its entries."
1425
+ }
1426
+ }
1427
+ },
1428
+ "BoardHead": {
1429
+ "title": "BoardHead",
1430
+ "description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
1431
+ "type": "object",
1432
+ "additionalProperties": false,
1433
+ "required": [
1434
+ "electionId",
1435
+ "treeSize",
1436
+ "rootHash",
1437
+ "issuedAt"
1438
+ ],
1439
+ "properties": {
1440
+ "electionId": {
1441
+ "$ref": "#/$defs/ElectionId"
1442
+ },
1443
+ "treeSize": {
1444
+ "type": "integer",
1445
+ "minimum": 0
1446
+ },
1447
+ "rootHash": {
1448
+ "$ref": "#/$defs/DigestMultibase",
1449
+ "description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
1450
+ },
1451
+ "issuedAt": {
1452
+ "type": "string",
1453
+ "format": "date-time"
1454
+ }
1455
+ }
1456
+ },
1457
+ "DigestMultibase": {
1458
+ "title": "DigestMultibase",
1459
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
1460
+ "type": "string",
1461
+ "minLength": 16,
1462
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
1463
+ "examples": [
1464
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
1465
+ ]
1466
+ },
1467
+ "QuestionResult": {
1468
+ "title": "QuestionResult",
1469
+ "description": "One question's totals. `choice`: selections per option. `ranking`: per option, how many ballots placed it at each position (index 0 = first). `score`: per option, the sum and the number of ballots that scored it. `text`: the answers, in board order, withheld (`withheld: true`) below the manifest's `textReleaseThreshold`. `abstained` counts ballots that left the question unanswered.",
1470
+ "type": "object",
1471
+ "additionalProperties": false,
1472
+ "required": [
1473
+ "question",
1474
+ "abstained"
1475
+ ],
1476
+ "properties": {
1477
+ "question": {
1478
+ "$ref": "#/$defs/Key"
1479
+ },
1480
+ "abstained": {
1481
+ "type": "integer",
1482
+ "minimum": 0
1483
+ },
1484
+ "choice": {
1485
+ "type": "object",
1486
+ "propertyNames": {
1487
+ "$ref": "#/$defs/Key"
1488
+ },
1489
+ "additionalProperties": {
1490
+ "type": "integer",
1491
+ "minimum": 0
1492
+ }
1493
+ },
1494
+ "ranking": {
1495
+ "type": "object",
1496
+ "propertyNames": {
1497
+ "$ref": "#/$defs/Key"
1498
+ },
1499
+ "additionalProperties": {
1500
+ "type": "array",
1501
+ "items": {
1502
+ "type": "integer",
1503
+ "minimum": 0
1504
+ }
1505
+ }
1506
+ },
1507
+ "score": {
1508
+ "type": "object",
1509
+ "propertyNames": {
1510
+ "$ref": "#/$defs/Key"
1511
+ },
1512
+ "additionalProperties": {
1513
+ "type": "object",
1514
+ "additionalProperties": false,
1515
+ "required": [
1516
+ "sum",
1517
+ "count"
1518
+ ],
1519
+ "properties": {
1520
+ "sum": {
1521
+ "type": "integer"
1522
+ },
1523
+ "count": {
1524
+ "type": "integer",
1525
+ "minimum": 0
1526
+ }
1527
+ }
1528
+ }
1529
+ },
1530
+ "text": {
1531
+ "type": "array",
1532
+ "items": {
1533
+ "type": "string",
1534
+ "maxLength": 4096
1535
+ }
1536
+ },
1537
+ "withheld": {
1538
+ "type": "boolean"
1539
+ }
1540
+ }
1541
+ },
1542
+ "ElectionState": {
1543
+ "title": "ElectionState",
1544
+ "type": "string",
1545
+ "enum": [
1546
+ "registered",
1547
+ "registration",
1548
+ "voting",
1549
+ "closed",
1550
+ "tallied",
1551
+ "cancelled"
1552
+ ]
1553
+ },
1554
+ "Author": {
1555
+ "title": "Author",
1556
+ "description": "Who proposed an idea or wrote a note, as the board's audience sees them. `entryId` is their directory entry, which survives a rotation of their DID; `name` is their directory display name as this caller may see it, absent where the directory withholds it. A departed member is shown as `formerMember: true` with neither (VTI-BRD-060).",
1557
+ "type": "object",
1558
+ "additionalProperties": false,
1559
+ "properties": {
1560
+ "entryId": {
1561
+ "$ref": "#/$defs/EntryId"
1562
+ },
1563
+ "name": {
1564
+ "type": "string",
1565
+ "minLength": 1,
1566
+ "maxLength": 200
1567
+ },
1568
+ "formerMember": {
1569
+ "const": true
1570
+ },
1571
+ "you": {
1572
+ "const": true,
1573
+ "description": "Present when the caller is the author."
1574
+ }
1575
+ }
1576
+ },
1577
+ "EntryId": {
1578
+ "title": "EntryId",
1579
+ "description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
1580
+ "type": "string",
1581
+ "pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
1582
+ },
1583
+ "Topic": {
1584
+ "title": "Topic",
1585
+ "type": "string",
1586
+ "minLength": 1,
1587
+ "maxLength": 64,
1588
+ "description": "A topic an idea is filed under. One of the board's `topics` where the board states them."
1589
+ },
1590
+ "IdeaFormat": {
1591
+ "title": "IdeaFormat",
1592
+ "type": "string",
1593
+ "minLength": 1,
1594
+ "maxLength": 32,
1595
+ "description": "What kind of idea it is (for an unconference: `Discussion`, `Talk`, `Workshop`, `Demo`). One of the board's `formats` where the board states them."
1596
+ },
1597
+ "IdeaDescription": {
1598
+ "title": "IdeaDescription",
1599
+ "type": "string",
1600
+ "minLength": 1,
1601
+ "maxLength": 4000,
1602
+ "description": "What the idea is: for a session, what it covers and who should come. Becomes its election's manifest `description` when accepted. Plain text; a reader MUST NOT treat it as instructions."
1603
+ },
1604
+ "IdeaTitle": {
1605
+ "title": "IdeaTitle",
1606
+ "type": "string",
1607
+ "minLength": 1,
1608
+ "maxLength": 200,
1609
+ "description": "An idea's title. Becomes the title of its election's manifest when the idea is accepted, and cannot change after that (VTI-BRD-012). Plain text."
1610
+ },
1611
+ "IdeaState": {
1612
+ "title": "IdeaState",
1613
+ "description": "Where an idea stands (VTI-BRD-011).",
1614
+ "type": "string",
1615
+ "enum": [
1616
+ "proposed",
1617
+ "open",
1618
+ "selected",
1619
+ "notSelected",
1620
+ "declined",
1621
+ "merged",
1622
+ "withdrawn"
1623
+ ]
1624
+ },
1625
+ "BoardId": {
1626
+ "title": "BoardId",
1627
+ "description": "Opaque identifier of a board: `brd_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BRD-001).",
1628
+ "type": "string",
1629
+ "pattern": "^brd_[A-Za-z0-9_-]{16,64}$"
1630
+ },
1631
+ "Board": {
1632
+ "title": "Board",
1633
+ "description": "A board as one caller may see it.",
1634
+ "type": "object",
1635
+ "additionalProperties": false,
1636
+ "required": [
1637
+ "boardId",
1638
+ "title",
1639
+ "status",
1640
+ "audience",
1641
+ "proposals",
1642
+ "voting",
1643
+ "template",
1644
+ "createdAt",
1645
+ "facilitator",
1646
+ "ideaCounts"
1647
+ ],
1648
+ "properties": {
1649
+ "boardId": {
1650
+ "$ref": "#/$defs/BoardId"
1651
+ },
1652
+ "title": {
1653
+ "$ref": "#/$defs/BoardTitle"
1654
+ },
1655
+ "description": {
1656
+ "$ref": "#/$defs/BoardDescription"
1657
+ },
1658
+ "status": {
1659
+ "$ref": "#/$defs/BoardStatus"
1660
+ },
1661
+ "audience": {
1662
+ "$ref": "#/$defs/BoardAudience"
1663
+ },
1664
+ "proposals": {
1665
+ "$ref": "#/$defs/Window",
1666
+ "description": "When ideas are taken (VTI-BRD-010)."
1667
+ },
1668
+ "voting": {
1669
+ "$ref": "#/$defs/Window",
1670
+ "description": "When every idea's election takes ballots. Opens after `proposals` opens and closes after it closes (VTI-BRD-001)."
1671
+ },
1672
+ "topics": {
1673
+ "type": "array",
1674
+ "maxItems": 32,
1675
+ "uniqueItems": true,
1676
+ "items": {
1677
+ "$ref": "#/$defs/Topic"
1678
+ }
1679
+ },
1680
+ "formats": {
1681
+ "type": "array",
1682
+ "maxItems": 16,
1683
+ "uniqueItems": true,
1684
+ "items": {
1685
+ "$ref": "#/$defs/IdeaFormat"
1686
+ }
1687
+ },
1688
+ "maxIdeasPerMember": {
1689
+ "type": "integer",
1690
+ "minimum": 1,
1691
+ "maximum": 100,
1692
+ "description": "The most ideas one member may have on the board that are not `withdrawn` or `declined`. Absent: no limit beyond the community's own."
1693
+ },
1694
+ "selectionRule": {
1695
+ "type": "string",
1696
+ "minLength": 1,
1697
+ "maxLength": 500,
1698
+ "description": "How facilitators intend to select, in plain words (VTI-BRD-041), e.g. \"The twelve ideas the most members would attend\"."
1699
+ },
1700
+ "timetable": {
1701
+ "type": "array",
1702
+ "maxItems": 256,
1703
+ "items": {
1704
+ "$ref": "#/$defs/Slot"
1705
+ }
1706
+ },
1707
+ "template": {
1708
+ "$ref": "#/$defs/ElectionTemplate"
1709
+ },
1710
+ "createdAt": {
1711
+ "type": "string",
1712
+ "format": "date-time"
1713
+ },
1714
+ "facilitator": {
1715
+ "type": "boolean",
1716
+ "description": "Whether the caller facilitates this board."
1717
+ },
1718
+ "ideaCounts": {
1719
+ "type": "object",
1720
+ "additionalProperties": false,
1721
+ "description": "How many of the board's ideas are in each state the caller may see.",
1722
+ "properties": {
1723
+ "proposed": {
1724
+ "type": "integer",
1725
+ "minimum": 0
1726
+ },
1727
+ "open": {
1728
+ "type": "integer",
1729
+ "minimum": 0
1730
+ },
1731
+ "selected": {
1732
+ "type": "integer",
1733
+ "minimum": 0
1734
+ },
1735
+ "notSelected": {
1736
+ "type": "integer",
1737
+ "minimum": 0
1738
+ },
1739
+ "declined": {
1740
+ "type": "integer",
1741
+ "minimum": 0
1742
+ },
1743
+ "merged": {
1744
+ "type": "integer",
1745
+ "minimum": 0
1746
+ },
1747
+ "withdrawn": {
1748
+ "type": "integer",
1749
+ "minimum": 0
1750
+ }
1751
+ }
1752
+ }
1753
+ }
1754
+ },
1755
+ "ElectionTemplate": {
1756
+ "title": "ElectionTemplate",
1757
+ "description": "Every member of an idea's election manifest that the board fixes (VTI-BRD-030). When a facilitator accepts an idea the community completes it: `electionId` (naming the board and the idea), `community`, `title` and `description` from the idea, `registrationOpensAt` and `votingOpensAt` from the board's voting window's `opensAt` or the acceptance, whichever is later, `votingClosesAt` from its `closesAt`, `roll` from the board's audience (rule `members`, or a credential roll naming the group), and `binding: false`. A board's template is never binding, and so has no `binding` member.",
1758
+ "type": "object",
1759
+ "additionalProperties": false,
1760
+ "required": [
1761
+ "questions",
1762
+ "secrecy",
1763
+ "revote",
1764
+ "board",
1765
+ "ballotBox",
1766
+ "allowEarlyClose",
1767
+ "resultsBeforeClose",
1768
+ "textReleaseThreshold"
1769
+ ],
1770
+ "properties": {
1771
+ "questions": {
1772
+ "type": "array",
1773
+ "minItems": 1,
1774
+ "maxItems": 16,
1775
+ "items": {
1776
+ "$ref": "#/$defs/Question"
1777
+ }
1778
+ },
1779
+ "secrecy": {
1780
+ "$ref": "#/$defs/SecrecyLevel"
1781
+ },
1782
+ "revote": {
1783
+ "$ref": "#/$defs/Revote"
1784
+ },
1785
+ "board": {
1786
+ "type": "object",
1787
+ "additionalProperties": false,
1788
+ "required": [
1789
+ "visibility",
1790
+ "auditors"
1791
+ ],
1792
+ "description": "The ballot box's board for each idea's election, as a manifest states it (VTI-VOT-052). `public` lets a board show each idea's ballot count while voting is open (VTI-BRD-033).",
1793
+ "properties": {
1794
+ "visibility": {
1795
+ "$ref": "#/$defs/BoardVisibility"
1796
+ },
1797
+ "auditors": {
1798
+ "type": "array",
1799
+ "uniqueItems": true,
1800
+ "items": {
1801
+ "type": "string",
1802
+ "minLength": 1,
1803
+ "maxLength": 2048
1804
+ }
1805
+ }
1806
+ }
1807
+ },
1808
+ "ballotBox": {
1809
+ "type": "string",
1810
+ "minLength": 1,
1811
+ "maxLength": 2048,
1812
+ "description": "The DID of the voting service every idea's election is registered with; one on the community's list (VTI-VOT-082)."
1813
+ },
1814
+ "trustees": {
1815
+ "$ref": "#/$defs/Trustees"
1816
+ },
1817
+ "allowEarlyClose": {
1818
+ "type": "boolean"
1819
+ },
1820
+ "resultsBeforeClose": {
1821
+ "type": "boolean",
1822
+ "description": "Open elections only: whether running totals may be read while voting is open (VTI-VOT-061). A board SHOULD set it false (VTI-BRD-033)."
1823
+ },
1824
+ "textReleaseThreshold": {
1825
+ "type": "integer",
1826
+ "minimum": 1,
1827
+ "description": "Counted ballots required before any text answer is disclosed (VTI-VOT-065); SHOULD be at least 10."
1828
+ }
1829
+ }
1830
+ },
1831
+ "Trustees": {
1832
+ "title": "Trustees",
1833
+ "description": "The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.",
1834
+ "type": "object",
1835
+ "additionalProperties": false,
1836
+ "required": [
1837
+ "dids",
1838
+ "threshold"
1839
+ ],
1840
+ "properties": {
1841
+ "dids": {
1842
+ "type": "array",
1843
+ "minItems": 2,
1844
+ "items": {
1845
+ "type": "string",
1846
+ "minLength": 1,
1847
+ "maxLength": 2048
1848
+ },
1849
+ "uniqueItems": true
1850
+ },
1851
+ "threshold": {
1852
+ "type": "integer",
1853
+ "minimum": 2
1854
+ }
1855
+ }
1856
+ },
1857
+ "BoardVisibility": {
1858
+ "title": "BoardVisibility",
1859
+ "description": "`public`: anyone reads the board. `private`: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).",
1860
+ "type": "string",
1861
+ "enum": [
1862
+ "public",
1863
+ "private"
1864
+ ]
1865
+ },
1866
+ "Revote": {
1867
+ "title": "Revote",
1868
+ "description": "What a later, different ballot under one ticket does: `replace` the earlier one, or be refused (`refuse`) (VTI-VOT-041).",
1869
+ "type": "string",
1870
+ "enum": [
1871
+ "replace",
1872
+ "refuse"
1873
+ ]
1874
+ },
1875
+ "SecrecyLevel": {
1876
+ "title": "SecrecyLevel",
1877
+ "description": "`open`: ballots are recorded on the board as cast. `sealed`: ballots are encrypted to a jointly generated election key and decrypted after voting closes. `talliedEncrypted`: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). The encrypted levels are cast with `voting/ballot/cast-encrypted/0.1`, under an election key the trustees generate with `voting/trustees/*` (CONVENTIONS §9).",
1878
+ "type": "string",
1879
+ "enum": [
1880
+ "open",
1881
+ "sealed",
1882
+ "talliedEncrypted"
1883
+ ]
1884
+ },
1885
+ "Question": {
1886
+ "title": "Question",
1887
+ "description": "One question. Tagged union over `type`.",
1888
+ "oneOf": [
1889
+ {
1890
+ "title": "ChoiceQuestion",
1891
+ "description": "Select between `minSelections` and `maxSelections` of `options`. A yes/no/abstain motion is a choice of exactly one of three.",
1892
+ "type": "object",
1893
+ "additionalProperties": false,
1894
+ "required": [
1895
+ "key",
1896
+ "type",
1897
+ "options",
1898
+ "minSelections",
1899
+ "maxSelections",
1900
+ "optional"
1901
+ ],
1902
+ "properties": {
1903
+ "key": {
1904
+ "$ref": "#/$defs/Key"
1905
+ },
1906
+ "type": {
1907
+ "const": "choice"
1908
+ },
1909
+ "text": {
1910
+ "type": "string",
1911
+ "maxLength": 2048
1912
+ },
1913
+ "options": {
1914
+ "type": "array",
1915
+ "minItems": 2,
1916
+ "maxItems": 256,
1917
+ "items": {
1918
+ "$ref": "#/$defs/QuestionOption"
1919
+ }
1920
+ },
1921
+ "minSelections": {
1922
+ "type": "integer",
1923
+ "minimum": 0
1924
+ },
1925
+ "maxSelections": {
1926
+ "type": "integer",
1927
+ "minimum": 1
1928
+ },
1929
+ "optional": {
1930
+ "type": "boolean"
1931
+ }
1932
+ }
1933
+ },
1934
+ {
1935
+ "title": "RankingQuestion",
1936
+ "description": "Order `options`; a ballot ranks every option or, when `partial` is true, a prefix of them.",
1937
+ "type": "object",
1938
+ "additionalProperties": false,
1939
+ "required": [
1940
+ "key",
1941
+ "type",
1942
+ "options",
1943
+ "partial",
1944
+ "optional"
1945
+ ],
1946
+ "properties": {
1947
+ "key": {
1948
+ "$ref": "#/$defs/Key"
1949
+ },
1950
+ "type": {
1951
+ "const": "ranking"
1952
+ },
1953
+ "text": {
1954
+ "type": "string",
1955
+ "maxLength": 2048
1956
+ },
1957
+ "options": {
1958
+ "type": "array",
1959
+ "minItems": 2,
1960
+ "maxItems": 64,
1961
+ "items": {
1962
+ "$ref": "#/$defs/QuestionOption"
1963
+ }
1964
+ },
1965
+ "partial": {
1966
+ "type": "boolean"
1967
+ },
1968
+ "optional": {
1969
+ "type": "boolean"
1970
+ }
1971
+ }
1972
+ },
1973
+ {
1974
+ "title": "ScoreQuestion",
1975
+ "description": "Give each option an integer score within [min, max].",
1976
+ "type": "object",
1977
+ "additionalProperties": false,
1978
+ "required": [
1979
+ "key",
1980
+ "type",
1981
+ "options",
1982
+ "min",
1983
+ "max",
1984
+ "optional"
1985
+ ],
1986
+ "properties": {
1987
+ "key": {
1988
+ "$ref": "#/$defs/Key"
1989
+ },
1990
+ "type": {
1991
+ "const": "score"
1992
+ },
1993
+ "text": {
1994
+ "type": "string",
1995
+ "maxLength": 2048
1996
+ },
1997
+ "options": {
1998
+ "type": "array",
1999
+ "minItems": 1,
2000
+ "maxItems": 256,
2001
+ "items": {
2002
+ "$ref": "#/$defs/QuestionOption"
2003
+ }
2004
+ },
2005
+ "min": {
2006
+ "type": "integer"
2007
+ },
2008
+ "max": {
2009
+ "type": "integer"
2010
+ },
2011
+ "optional": {
2012
+ "type": "boolean"
2013
+ }
2014
+ }
2015
+ },
2016
+ {
2017
+ "title": "TextQuestion",
2018
+ "description": "Free text of at most `maxLength` characters.",
2019
+ "type": "object",
2020
+ "additionalProperties": false,
2021
+ "required": [
2022
+ "key",
2023
+ "type",
2024
+ "maxLength",
2025
+ "optional"
2026
+ ],
2027
+ "properties": {
2028
+ "key": {
2029
+ "$ref": "#/$defs/Key"
2030
+ },
2031
+ "type": {
2032
+ "const": "text"
2033
+ },
2034
+ "text": {
2035
+ "type": "string",
2036
+ "maxLength": 2048
2037
+ },
2038
+ "maxLength": {
2039
+ "type": "integer",
2040
+ "minimum": 1,
2041
+ "maximum": 4096
2042
+ },
2043
+ "optional": {
2044
+ "type": "boolean"
2045
+ }
2046
+ }
2047
+ }
2048
+ ]
2049
+ },
2050
+ "QuestionOption": {
2051
+ "title": "QuestionOption",
2052
+ "type": "object",
2053
+ "additionalProperties": false,
2054
+ "required": [
2055
+ "key"
2056
+ ],
2057
+ "properties": {
2058
+ "key": {
2059
+ "$ref": "#/$defs/Key"
2060
+ },
2061
+ "label": {
2062
+ "type": "string",
2063
+ "maxLength": 512,
2064
+ "description": "Display text. Absent from a manifest registered with a ballot box that holds no question text (VTI-VOT-014)."
2065
+ }
2066
+ }
2067
+ },
2068
+ "Slot": {
2069
+ "title": "Slot",
2070
+ "description": "One place in a board's timetable that a selected idea can be put in (VTI-BRD-040): a place (`label`, e.g. a room) and a time.",
2071
+ "type": "object",
2072
+ "additionalProperties": false,
2073
+ "required": [
2074
+ "slotId",
2075
+ "label",
2076
+ "startsAt",
2077
+ "endsAt"
2078
+ ],
2079
+ "properties": {
2080
+ "slotId": {
2081
+ "$ref": "#/$defs/Key"
2082
+ },
2083
+ "label": {
2084
+ "type": "string",
2085
+ "minLength": 1,
2086
+ "maxLength": 100
2087
+ },
2088
+ "startsAt": {
2089
+ "type": "string",
2090
+ "format": "date-time"
2091
+ },
2092
+ "endsAt": {
2093
+ "type": "string",
2094
+ "format": "date-time"
2095
+ }
2096
+ }
2097
+ },
2098
+ "Window": {
2099
+ "title": "Window",
2100
+ "description": "A period, open from `opensAt` until `closesAt`. `closesAt` is after `opensAt` (a consumer check; JSON Schema cannot compare them).",
2101
+ "type": "object",
2102
+ "additionalProperties": false,
2103
+ "required": [
2104
+ "opensAt",
2105
+ "closesAt"
2106
+ ],
2107
+ "properties": {
2108
+ "opensAt": {
2109
+ "type": "string",
2110
+ "format": "date-time"
2111
+ },
2112
+ "closesAt": {
2113
+ "type": "string",
2114
+ "format": "date-time"
2115
+ }
2116
+ }
2117
+ },
2118
+ "BoardAudience": {
2119
+ "title": "BoardAudience",
2120
+ "description": "Who may see and use a board (VTI-BRD-003): every active member of the community (`members`), or the members of one community group (`group`, with `groupId`). Facilitators always see the board.",
2121
+ "oneOf": [
2122
+ {
2123
+ "type": "object",
2124
+ "additionalProperties": false,
2125
+ "required": [
2126
+ "kind"
2127
+ ],
2128
+ "properties": {
2129
+ "kind": {
2130
+ "const": "members"
2131
+ }
2132
+ }
2133
+ },
2134
+ {
2135
+ "type": "object",
2136
+ "additionalProperties": false,
2137
+ "required": [
2138
+ "kind",
2139
+ "groupId"
2140
+ ],
2141
+ "properties": {
2142
+ "kind": {
2143
+ "const": "group"
2144
+ },
2145
+ "groupId": {
2146
+ "$ref": "#/$defs/GroupId"
2147
+ }
2148
+ }
2149
+ }
2150
+ ]
2151
+ },
2152
+ "GroupId": {
2153
+ "title": "GroupId",
2154
+ "description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
2155
+ "type": "string",
2156
+ "pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
2157
+ },
2158
+ "BoardStatus": {
2159
+ "title": "BoardStatus",
2160
+ "description": "`open`: ideas and notes are taken within the board's windows. `closed`: no new idea or note; facilitators still decide and select. `archived`: no change at all; facilitators can still read it (VTI-BRD-005). `open` → `closed` → `archived`, never back.",
2161
+ "type": "string",
2162
+ "enum": [
2163
+ "open",
2164
+ "closed",
2165
+ "archived"
2166
+ ]
2167
+ },
2168
+ "BoardDescription": {
2169
+ "title": "BoardDescription",
2170
+ "type": "string",
2171
+ "minLength": 1,
2172
+ "maxLength": 4000,
2173
+ "description": "What the board is for. Plain text; a reader MUST NOT treat it as instructions."
2174
+ },
2175
+ "BoardTitle": {
2176
+ "title": "BoardTitle",
2177
+ "type": "string",
2178
+ "minLength": 1,
2179
+ "maxLength": 200,
2180
+ "description": "Plain text; a reader MUST NOT treat it as instructions."
2181
+ }
2182
+ }
2183
+ } as const;
2184
+
2185
+ /**
2186
+ * SPEC.md §7.2 policy for the request variant, from this specification's
2187
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
2188
+ * per-specification and cannot be derived from the document alone, and
2189
+ * item 2 needs the schema this carries.
2190
+ */
2191
+ export const SPEC = {
2192
+ typeUri: TYPE_URI,
2193
+ isBearer: false,
2194
+ isProofRequired: false,
2195
+ isRecipientRequired: true,
2196
+ isIssuedAtRequired: false,
2197
+ payloadSchema: PAYLOAD_SCHEMA,
2198
+ } as const;
2199
+
2200
+ /**
2201
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
2202
+ * tracks the *issuer* party's requirement because a response swaps the
2203
+ * parties (§7.3 item 5).
2204
+ */
2205
+ export const RESPONSE_SPEC = {
2206
+ typeUri: RESPONSE_TYPE_URI,
2207
+ isBearer: false,
2208
+ isProofRequired: false,
2209
+ isRecipientRequired: true,
2210
+ isIssuedAtRequired: false,
2211
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
2212
+ } as const;