@openvtc/trust-tasks 0.23.5 → 0.23.6

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.
@@ -0,0 +1,905 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/vetting/hidden/show/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Read one criterion's stored hidden-vetting configuration, what it publishes, and the aggregate counts an administrator needs to run it. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCVettingHiddenShowPayload {
13
+ /**
14
+ * The Accepts criterion to read.
15
+ */
16
+ criterionId: string;
17
+ ext?: Ext;
18
+ }
19
+ export interface VTCVettingHiddenShowResponsePayload {
20
+ /**
21
+ * The criterion read.
22
+ */
23
+ criterionId: string;
24
+ /**
25
+ * Whether the criterion carries hidden-vetting parameters. When false, stored, published, enrolledVetters and eventStatus are absent.
26
+ */
27
+ enabled: boolean;
28
+ stored?: StoredConfig;
29
+ published?: PublishedConfig;
30
+ /**
31
+ * For each live class label (vetter/<period>), how many members hold an enrolment under it. Counts only.
32
+ */
33
+ enrolledVetters?: {
34
+ [k: string]: number | undefined;
35
+ };
36
+ /**
37
+ * One entry per stored event, in stored order.
38
+ */
39
+ eventStatus?: EventStatus[];
40
+ /**
41
+ * The criterion's current requirementsDigest. Null only when its manifest entry carries none.
42
+ */
43
+ requirementsDigest: string | null;
44
+ ext?: Ext;
45
+ }
46
+ /**
47
+ * The parameters exactly as the community stores them, including the helper key it never publishes.
48
+ */
49
+ export interface StoredConfig {
50
+ /**
51
+ * The blind-signature suite in force, e.g. ps-ddh-bls12381.
52
+ */
53
+ suite: string;
54
+ /**
55
+ * The helper verification key, multibase. A public value, published as helperKey.
56
+ */
57
+ hvk: string;
58
+ /**
59
+ * The token verification key, multibase. Never the same key as hvk.
60
+ */
61
+ tvk: string;
62
+ /**
63
+ * Live vetter class periods, current first, stored as the bare YYYY-MM period.
64
+ */
65
+ livePeriods: string[];
66
+ liveTokenLabels: string[];
67
+ dripPerTick: number;
68
+ events: StoredEvent[];
69
+ }
70
+ export interface StoredEvent {
71
+ eventId: string;
72
+ startDate: string;
73
+ endDate: string;
74
+ graceDays: number;
75
+ groupFloor: number;
76
+ tiers: Tier[];
77
+ /**
78
+ * Who approved the event, or null when nobody has. Recorded in storage only — dropped from the published shape (see published.events).
79
+ */
80
+ approvedBy?: string | null;
81
+ }
82
+ export interface Tier {
83
+ /**
84
+ * How the menu names it: desk, busy-desk.
85
+ */
86
+ name: string;
87
+ /**
88
+ * How many tokens a tick under this tier yields.
89
+ */
90
+ dripPerTick: number;
91
+ }
92
+ /**
93
+ * The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.
94
+ */
95
+ export interface PublishedConfig {
96
+ suite: string;
97
+ /**
98
+ * The helper verification key, multibase — named for its role on the wire rather than for hvk.
99
+ */
100
+ helperKey: string;
101
+ /**
102
+ * The token verification key, multibase — named for its role on the wire rather than for tvk.
103
+ */
104
+ tokenKey: string;
105
+ /**
106
+ * Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.
107
+ */
108
+ vetterLabels: string[];
109
+ tokenLabels: string[];
110
+ dripPerTick: number;
111
+ events: PublishedEvent[];
112
+ }
113
+ /**
114
+ * The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.
115
+ */
116
+ export interface PublishedEvent {
117
+ eventId: string;
118
+ startDate: string;
119
+ endDate: string;
120
+ groupFloor: number;
121
+ tiers: Tier[];
122
+ }
123
+ /**
124
+ * How one stored event stands today. Counts only — never which members asked.
125
+ */
126
+ export interface EventStatus {
127
+ eventId: string;
128
+ /**
129
+ * The smallest group this community will open the label for, as stored.
130
+ */
131
+ groupFloor: number;
132
+ /**
133
+ * How many members have asked to vet at this event through vtc/vetting/vetters/event-mode. The same count event-mode already returns to a vetter.
134
+ */
135
+ groupSize: number;
136
+ /**
137
+ * Whether the stored event names an approver.
138
+ */
139
+ approved: boolean;
140
+ /**
141
+ * Derived: approved, groupSize at least groupFloor, and today no later than endDate plus graceDays.
142
+ */
143
+ live: boolean;
144
+ }
145
+
146
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
147
+ export type { Ext };
148
+
149
+ /** Trust Task type URI. */
150
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/hidden/show/0.1" as const;
151
+
152
+ /** Stable alias for this specification's request payload shape. */
153
+ export type Payload = VTCVettingHiddenShowPayload;
154
+
155
+ /** Trust Task response type URI (request type URI + "#response"). */
156
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/hidden/show/0.1#response" as const;
157
+
158
+ /** Stable alias for this specification's success-response payload shape. */
159
+ export type Response = VTCVettingHiddenShowResponsePayload;
160
+
161
+ /**
162
+ * This specification's payload schema, as a value.
163
+ *
164
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
165
+ * rather than only as a `.json` file because TypeScript types are erased
166
+ * at runtime: without a schema a consumer has nothing to validate, and
167
+ * every REQUIRED payload member is optional in practice. Cross-file
168
+ * `$ref`s are already inlined, so it needs no resolver.
169
+ */
170
+ export const PAYLOAD_SCHEMA = {
171
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
172
+ "$id": "https://trusttasks.org/spec/vtc/vetting/hidden/show/0.1",
173
+ "title": "VTC Vetting — Hidden — Show — payload",
174
+ "description": "Read one criterion's stored hidden-vetting configuration, what it publishes, and the aggregate counts an administrator needs to run it. The outer document members are owned by the framework — SPEC §6.3.",
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "required": [
178
+ "criterionId"
179
+ ],
180
+ "properties": {
181
+ "criterionId": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "description": "The Accepts criterion to read."
185
+ },
186
+ "ext": {
187
+ "$ref": "#/$defs/Ext"
188
+ }
189
+ },
190
+ "$defs": {
191
+ "Tier": {
192
+ "title": "Tier",
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "required": [
196
+ "name",
197
+ "dripPerTick"
198
+ ],
199
+ "properties": {
200
+ "name": {
201
+ "type": "string",
202
+ "minLength": 1,
203
+ "description": "How the menu names it: desk, busy-desk."
204
+ },
205
+ "dripPerTick": {
206
+ "type": "integer",
207
+ "minimum": 1,
208
+ "description": "How many tokens a tick under this tier yields."
209
+ }
210
+ }
211
+ },
212
+ "StoredEvent": {
213
+ "title": "StoredEvent",
214
+ "type": "object",
215
+ "additionalProperties": false,
216
+ "required": [
217
+ "eventId",
218
+ "startDate",
219
+ "endDate",
220
+ "graceDays",
221
+ "groupFloor",
222
+ "tiers"
223
+ ],
224
+ "properties": {
225
+ "eventId": {
226
+ "type": "string",
227
+ "minLength": 1
228
+ },
229
+ "startDate": {
230
+ "type": "string",
231
+ "format": "date"
232
+ },
233
+ "endDate": {
234
+ "type": "string",
235
+ "format": "date"
236
+ },
237
+ "graceDays": {
238
+ "type": "integer",
239
+ "minimum": 0
240
+ },
241
+ "groupFloor": {
242
+ "type": "integer",
243
+ "minimum": 1
244
+ },
245
+ "tiers": {
246
+ "type": "array",
247
+ "items": {
248
+ "$ref": "#/$defs/Tier"
249
+ }
250
+ },
251
+ "approvedBy": {
252
+ "type": [
253
+ "string",
254
+ "null"
255
+ ],
256
+ "description": "Who approved the event, or null when nobody has. Recorded in storage only — dropped from the published shape (see published.events)."
257
+ }
258
+ }
259
+ },
260
+ "PublishedEvent": {
261
+ "title": "PublishedEvent",
262
+ "description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
263
+ "type": "object",
264
+ "additionalProperties": false,
265
+ "required": [
266
+ "eventId",
267
+ "startDate",
268
+ "endDate",
269
+ "groupFloor",
270
+ "tiers"
271
+ ],
272
+ "properties": {
273
+ "eventId": {
274
+ "type": "string",
275
+ "minLength": 1
276
+ },
277
+ "startDate": {
278
+ "type": "string",
279
+ "format": "date"
280
+ },
281
+ "endDate": {
282
+ "type": "string",
283
+ "format": "date"
284
+ },
285
+ "groupFloor": {
286
+ "type": "integer",
287
+ "minimum": 1
288
+ },
289
+ "tiers": {
290
+ "type": "array",
291
+ "items": {
292
+ "$ref": "#/$defs/Tier"
293
+ }
294
+ }
295
+ }
296
+ },
297
+ "StoredConfig": {
298
+ "title": "StoredConfig",
299
+ "description": "The parameters exactly as the community stores them, including the helper key it never publishes.",
300
+ "type": "object",
301
+ "additionalProperties": false,
302
+ "required": [
303
+ "suite",
304
+ "hvk",
305
+ "tvk",
306
+ "livePeriods",
307
+ "liveTokenLabels",
308
+ "dripPerTick",
309
+ "events"
310
+ ],
311
+ "properties": {
312
+ "suite": {
313
+ "type": "string",
314
+ "minLength": 1,
315
+ "description": "The blind-signature suite in force, e.g. ps-ddh-bls12381."
316
+ },
317
+ "hvk": {
318
+ "type": "string",
319
+ "minLength": 1,
320
+ "description": "The helper verification key, multibase. A public value, published as helperKey."
321
+ },
322
+ "tvk": {
323
+ "type": "string",
324
+ "minLength": 1,
325
+ "description": "The token verification key, multibase. Never the same key as hvk."
326
+ },
327
+ "livePeriods": {
328
+ "type": "array",
329
+ "items": {
330
+ "type": "string",
331
+ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
332
+ },
333
+ "description": "Live vetter class periods, current first, stored as the bare YYYY-MM period."
334
+ },
335
+ "liveTokenLabels": {
336
+ "type": "array",
337
+ "items": {
338
+ "type": "string",
339
+ "minLength": 1
340
+ }
341
+ },
342
+ "dripPerTick": {
343
+ "type": "integer",
344
+ "minimum": 1
345
+ },
346
+ "events": {
347
+ "type": "array",
348
+ "items": {
349
+ "$ref": "#/$defs/StoredEvent"
350
+ }
351
+ }
352
+ }
353
+ },
354
+ "PublishedConfig": {
355
+ "title": "PublishedConfig",
356
+ "description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
357
+ "type": "object",
358
+ "additionalProperties": false,
359
+ "required": [
360
+ "suite",
361
+ "helperKey",
362
+ "tokenKey",
363
+ "vetterLabels",
364
+ "tokenLabels",
365
+ "dripPerTick",
366
+ "events"
367
+ ],
368
+ "properties": {
369
+ "suite": {
370
+ "type": "string",
371
+ "minLength": 1
372
+ },
373
+ "helperKey": {
374
+ "type": "string",
375
+ "minLength": 1,
376
+ "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk."
377
+ },
378
+ "tokenKey": {
379
+ "type": "string",
380
+ "minLength": 1,
381
+ "description": "The token verification key, multibase — named for its role on the wire rather than for tvk."
382
+ },
383
+ "vetterLabels": {
384
+ "type": "array",
385
+ "items": {
386
+ "type": "string",
387
+ "minLength": 1
388
+ },
389
+ "description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period."
390
+ },
391
+ "tokenLabels": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "string",
395
+ "minLength": 1
396
+ }
397
+ },
398
+ "dripPerTick": {
399
+ "type": "integer",
400
+ "minimum": 1
401
+ },
402
+ "events": {
403
+ "type": "array",
404
+ "items": {
405
+ "$ref": "#/$defs/PublishedEvent"
406
+ }
407
+ }
408
+ }
409
+ },
410
+ "EventStatus": {
411
+ "title": "EventStatus",
412
+ "description": "How one stored event stands today. Counts only — never which members asked.",
413
+ "type": "object",
414
+ "additionalProperties": false,
415
+ "required": [
416
+ "eventId",
417
+ "groupFloor",
418
+ "groupSize",
419
+ "approved",
420
+ "live"
421
+ ],
422
+ "properties": {
423
+ "eventId": {
424
+ "type": "string",
425
+ "minLength": 1
426
+ },
427
+ "groupFloor": {
428
+ "type": "integer",
429
+ "minimum": 1,
430
+ "description": "The smallest group this community will open the label for, as stored."
431
+ },
432
+ "groupSize": {
433
+ "type": "integer",
434
+ "minimum": 0,
435
+ "description": "How many members have asked to vet at this event through vtc/vetting/vetters/event-mode. The same count event-mode already returns to a vetter."
436
+ },
437
+ "approved": {
438
+ "type": "boolean",
439
+ "description": "Whether the stored event names an approver."
440
+ },
441
+ "live": {
442
+ "type": "boolean",
443
+ "description": "Derived: approved, groupSize at least groupFloor, and today no later than endDate plus graceDays."
444
+ }
445
+ }
446
+ },
447
+ "Response": {
448
+ "$anchor": "response",
449
+ "title": "VTC Vetting — Hidden — Show — response payload",
450
+ "type": "object",
451
+ "additionalProperties": false,
452
+ "required": [
453
+ "criterionId",
454
+ "enabled",
455
+ "requirementsDigest"
456
+ ],
457
+ "dependentRequired": {
458
+ "stored": [
459
+ "published",
460
+ "enrolledVetters",
461
+ "eventStatus"
462
+ ],
463
+ "published": [
464
+ "stored"
465
+ ],
466
+ "enrolledVetters": [
467
+ "stored"
468
+ ],
469
+ "eventStatus": [
470
+ "stored"
471
+ ]
472
+ },
473
+ "properties": {
474
+ "criterionId": {
475
+ "type": "string",
476
+ "minLength": 1,
477
+ "description": "The criterion read."
478
+ },
479
+ "enabled": {
480
+ "type": "boolean",
481
+ "description": "Whether the criterion carries hidden-vetting parameters. When false, stored, published, enrolledVetters and eventStatus are absent."
482
+ },
483
+ "stored": {
484
+ "$ref": "#/$defs/StoredConfig"
485
+ },
486
+ "published": {
487
+ "$ref": "#/$defs/PublishedConfig"
488
+ },
489
+ "enrolledVetters": {
490
+ "type": "object",
491
+ "description": "For each live class label (vetter/<period>), how many members hold an enrolment under it. Counts only.",
492
+ "propertyNames": {
493
+ "pattern": "^vetter/[0-9]{4}-(0[1-9]|1[0-2])$"
494
+ },
495
+ "additionalProperties": {
496
+ "type": "integer",
497
+ "minimum": 0
498
+ }
499
+ },
500
+ "eventStatus": {
501
+ "type": "array",
502
+ "items": {
503
+ "$ref": "#/$defs/EventStatus"
504
+ },
505
+ "description": "One entry per stored event, in stored order."
506
+ },
507
+ "requirementsDigest": {
508
+ "type": [
509
+ "string",
510
+ "null"
511
+ ],
512
+ "description": "The criterion's current requirementsDigest. Null only when its manifest entry carries none."
513
+ },
514
+ "ext": {
515
+ "$ref": "#/$defs/Ext"
516
+ }
517
+ }
518
+ },
519
+ "Ext": {
520
+ "title": "Ext",
521
+ "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.",
522
+ "type": "object",
523
+ "minProperties": 1,
524
+ "additionalProperties": true,
525
+ "propertyNames": {
526
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
527
+ }
528
+ }
529
+ }
530
+ } as const;
531
+
532
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
533
+ export const RESPONSE_PAYLOAD_SCHEMA = {
534
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
535
+ "$ref": "#/$defs/Response",
536
+ "$defs": {
537
+ "Tier": {
538
+ "title": "Tier",
539
+ "type": "object",
540
+ "additionalProperties": false,
541
+ "required": [
542
+ "name",
543
+ "dripPerTick"
544
+ ],
545
+ "properties": {
546
+ "name": {
547
+ "type": "string",
548
+ "minLength": 1,
549
+ "description": "How the menu names it: desk, busy-desk."
550
+ },
551
+ "dripPerTick": {
552
+ "type": "integer",
553
+ "minimum": 1,
554
+ "description": "How many tokens a tick under this tier yields."
555
+ }
556
+ }
557
+ },
558
+ "StoredEvent": {
559
+ "title": "StoredEvent",
560
+ "type": "object",
561
+ "additionalProperties": false,
562
+ "required": [
563
+ "eventId",
564
+ "startDate",
565
+ "endDate",
566
+ "graceDays",
567
+ "groupFloor",
568
+ "tiers"
569
+ ],
570
+ "properties": {
571
+ "eventId": {
572
+ "type": "string",
573
+ "minLength": 1
574
+ },
575
+ "startDate": {
576
+ "type": "string",
577
+ "format": "date"
578
+ },
579
+ "endDate": {
580
+ "type": "string",
581
+ "format": "date"
582
+ },
583
+ "graceDays": {
584
+ "type": "integer",
585
+ "minimum": 0
586
+ },
587
+ "groupFloor": {
588
+ "type": "integer",
589
+ "minimum": 1
590
+ },
591
+ "tiers": {
592
+ "type": "array",
593
+ "items": {
594
+ "$ref": "#/$defs/Tier"
595
+ }
596
+ },
597
+ "approvedBy": {
598
+ "type": [
599
+ "string",
600
+ "null"
601
+ ],
602
+ "description": "Who approved the event, or null when nobody has. Recorded in storage only — dropped from the published shape (see published.events)."
603
+ }
604
+ }
605
+ },
606
+ "PublishedEvent": {
607
+ "title": "PublishedEvent",
608
+ "description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
609
+ "type": "object",
610
+ "additionalProperties": false,
611
+ "required": [
612
+ "eventId",
613
+ "startDate",
614
+ "endDate",
615
+ "groupFloor",
616
+ "tiers"
617
+ ],
618
+ "properties": {
619
+ "eventId": {
620
+ "type": "string",
621
+ "minLength": 1
622
+ },
623
+ "startDate": {
624
+ "type": "string",
625
+ "format": "date"
626
+ },
627
+ "endDate": {
628
+ "type": "string",
629
+ "format": "date"
630
+ },
631
+ "groupFloor": {
632
+ "type": "integer",
633
+ "minimum": 1
634
+ },
635
+ "tiers": {
636
+ "type": "array",
637
+ "items": {
638
+ "$ref": "#/$defs/Tier"
639
+ }
640
+ }
641
+ }
642
+ },
643
+ "StoredConfig": {
644
+ "title": "StoredConfig",
645
+ "description": "The parameters exactly as the community stores them, including the helper key it never publishes.",
646
+ "type": "object",
647
+ "additionalProperties": false,
648
+ "required": [
649
+ "suite",
650
+ "hvk",
651
+ "tvk",
652
+ "livePeriods",
653
+ "liveTokenLabels",
654
+ "dripPerTick",
655
+ "events"
656
+ ],
657
+ "properties": {
658
+ "suite": {
659
+ "type": "string",
660
+ "minLength": 1,
661
+ "description": "The blind-signature suite in force, e.g. ps-ddh-bls12381."
662
+ },
663
+ "hvk": {
664
+ "type": "string",
665
+ "minLength": 1,
666
+ "description": "The helper verification key, multibase. A public value, published as helperKey."
667
+ },
668
+ "tvk": {
669
+ "type": "string",
670
+ "minLength": 1,
671
+ "description": "The token verification key, multibase. Never the same key as hvk."
672
+ },
673
+ "livePeriods": {
674
+ "type": "array",
675
+ "items": {
676
+ "type": "string",
677
+ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
678
+ },
679
+ "description": "Live vetter class periods, current first, stored as the bare YYYY-MM period."
680
+ },
681
+ "liveTokenLabels": {
682
+ "type": "array",
683
+ "items": {
684
+ "type": "string",
685
+ "minLength": 1
686
+ }
687
+ },
688
+ "dripPerTick": {
689
+ "type": "integer",
690
+ "minimum": 1
691
+ },
692
+ "events": {
693
+ "type": "array",
694
+ "items": {
695
+ "$ref": "#/$defs/StoredEvent"
696
+ }
697
+ }
698
+ }
699
+ },
700
+ "PublishedConfig": {
701
+ "title": "PublishedConfig",
702
+ "description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
703
+ "type": "object",
704
+ "additionalProperties": false,
705
+ "required": [
706
+ "suite",
707
+ "helperKey",
708
+ "tokenKey",
709
+ "vetterLabels",
710
+ "tokenLabels",
711
+ "dripPerTick",
712
+ "events"
713
+ ],
714
+ "properties": {
715
+ "suite": {
716
+ "type": "string",
717
+ "minLength": 1
718
+ },
719
+ "helperKey": {
720
+ "type": "string",
721
+ "minLength": 1,
722
+ "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk."
723
+ },
724
+ "tokenKey": {
725
+ "type": "string",
726
+ "minLength": 1,
727
+ "description": "The token verification key, multibase — named for its role on the wire rather than for tvk."
728
+ },
729
+ "vetterLabels": {
730
+ "type": "array",
731
+ "items": {
732
+ "type": "string",
733
+ "minLength": 1
734
+ },
735
+ "description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period."
736
+ },
737
+ "tokenLabels": {
738
+ "type": "array",
739
+ "items": {
740
+ "type": "string",
741
+ "minLength": 1
742
+ }
743
+ },
744
+ "dripPerTick": {
745
+ "type": "integer",
746
+ "minimum": 1
747
+ },
748
+ "events": {
749
+ "type": "array",
750
+ "items": {
751
+ "$ref": "#/$defs/PublishedEvent"
752
+ }
753
+ }
754
+ }
755
+ },
756
+ "EventStatus": {
757
+ "title": "EventStatus",
758
+ "description": "How one stored event stands today. Counts only — never which members asked.",
759
+ "type": "object",
760
+ "additionalProperties": false,
761
+ "required": [
762
+ "eventId",
763
+ "groupFloor",
764
+ "groupSize",
765
+ "approved",
766
+ "live"
767
+ ],
768
+ "properties": {
769
+ "eventId": {
770
+ "type": "string",
771
+ "minLength": 1
772
+ },
773
+ "groupFloor": {
774
+ "type": "integer",
775
+ "minimum": 1,
776
+ "description": "The smallest group this community will open the label for, as stored."
777
+ },
778
+ "groupSize": {
779
+ "type": "integer",
780
+ "minimum": 0,
781
+ "description": "How many members have asked to vet at this event through vtc/vetting/vetters/event-mode. The same count event-mode already returns to a vetter."
782
+ },
783
+ "approved": {
784
+ "type": "boolean",
785
+ "description": "Whether the stored event names an approver."
786
+ },
787
+ "live": {
788
+ "type": "boolean",
789
+ "description": "Derived: approved, groupSize at least groupFloor, and today no later than endDate plus graceDays."
790
+ }
791
+ }
792
+ },
793
+ "Response": {
794
+ "$anchor": "response",
795
+ "title": "VTC Vetting — Hidden — Show — response payload",
796
+ "type": "object",
797
+ "additionalProperties": false,
798
+ "required": [
799
+ "criterionId",
800
+ "enabled",
801
+ "requirementsDigest"
802
+ ],
803
+ "dependentRequired": {
804
+ "stored": [
805
+ "published",
806
+ "enrolledVetters",
807
+ "eventStatus"
808
+ ],
809
+ "published": [
810
+ "stored"
811
+ ],
812
+ "enrolledVetters": [
813
+ "stored"
814
+ ],
815
+ "eventStatus": [
816
+ "stored"
817
+ ]
818
+ },
819
+ "properties": {
820
+ "criterionId": {
821
+ "type": "string",
822
+ "minLength": 1,
823
+ "description": "The criterion read."
824
+ },
825
+ "enabled": {
826
+ "type": "boolean",
827
+ "description": "Whether the criterion carries hidden-vetting parameters. When false, stored, published, enrolledVetters and eventStatus are absent."
828
+ },
829
+ "stored": {
830
+ "$ref": "#/$defs/StoredConfig"
831
+ },
832
+ "published": {
833
+ "$ref": "#/$defs/PublishedConfig"
834
+ },
835
+ "enrolledVetters": {
836
+ "type": "object",
837
+ "description": "For each live class label (vetter/<period>), how many members hold an enrolment under it. Counts only.",
838
+ "propertyNames": {
839
+ "pattern": "^vetter/[0-9]{4}-(0[1-9]|1[0-2])$"
840
+ },
841
+ "additionalProperties": {
842
+ "type": "integer",
843
+ "minimum": 0
844
+ }
845
+ },
846
+ "eventStatus": {
847
+ "type": "array",
848
+ "items": {
849
+ "$ref": "#/$defs/EventStatus"
850
+ },
851
+ "description": "One entry per stored event, in stored order."
852
+ },
853
+ "requirementsDigest": {
854
+ "type": [
855
+ "string",
856
+ "null"
857
+ ],
858
+ "description": "The criterion's current requirementsDigest. Null only when its manifest entry carries none."
859
+ },
860
+ "ext": {
861
+ "$ref": "#/$defs/Ext"
862
+ }
863
+ }
864
+ },
865
+ "Ext": {
866
+ "title": "Ext",
867
+ "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.",
868
+ "type": "object",
869
+ "minProperties": 1,
870
+ "additionalProperties": true,
871
+ "propertyNames": {
872
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
873
+ }
874
+ }
875
+ }
876
+ } as const;
877
+
878
+ /**
879
+ * SPEC.md §7.2 policy for the request variant, from this specification's
880
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
881
+ * per-specification and cannot be derived from the document alone, and
882
+ * item 2 needs the schema this carries.
883
+ */
884
+ export const SPEC = {
885
+ typeUri: TYPE_URI,
886
+ isBearer: false,
887
+ isProofRequired: true,
888
+ isRecipientRequired: true,
889
+ isIssuedAtRequired: false,
890
+ payloadSchema: PAYLOAD_SCHEMA,
891
+ } as const;
892
+
893
+ /**
894
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
895
+ * tracks the *issuer* party's requirement because a response swaps the
896
+ * parties (§7.3 item 5).
897
+ */
898
+ export const RESPONSE_SPEC = {
899
+ typeUri: RESPONSE_TYPE_URI,
900
+ isBearer: false,
901
+ isProofRequired: true,
902
+ isRecipientRequired: true,
903
+ isIssuedAtRequired: false,
904
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
905
+ } as const;