@nurix/nustack 0.23.0 → 0.23.1

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,2850 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/nurixlabs/NuStack/dev/packages/contracts/spec/records.schema.json",
4
+ "title": "NuStack harness records",
5
+ "description": "Generated from @nurix/contracts/records by `pnpm --filter @nurix/contracts schema:records`; never edited by hand.",
6
+ "definitions": {
7
+ "BacklogInput": {
8
+ "type": "object",
9
+ "properties": {
10
+ "payload": {
11
+ "type": "object",
12
+ "properties": {
13
+ "anchor": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 256
17
+ },
18
+ "priority": {
19
+ "type": "string",
20
+ "enum": [
21
+ "P0",
22
+ "P1",
23
+ "P2",
24
+ "P3"
25
+ ]
26
+ },
27
+ "text": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 20000
31
+ },
32
+ "discoveredBy": {
33
+ "anyOf": [
34
+ {
35
+ "type": "string",
36
+ "maxLength": 20000
37
+ },
38
+ {
39
+ "type": "null"
40
+ }
41
+ ]
42
+ },
43
+ "section": {
44
+ "type": "string",
45
+ "maxLength": 20000
46
+ },
47
+ "state": {
48
+ "type": "string",
49
+ "enum": [
50
+ "open",
51
+ "removed"
52
+ ]
53
+ }
54
+ },
55
+ "required": [
56
+ "anchor",
57
+ "priority",
58
+ "text"
59
+ ],
60
+ "additionalProperties": false
61
+ },
62
+ "sessionId": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "maxLength": 128
66
+ },
67
+ "planAnchor": {
68
+ "type": "string",
69
+ "maxLength": 256,
70
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
71
+ },
72
+ "occurredAt": {
73
+ "type": "string",
74
+ "allOf": [
75
+ {
76
+ "type": "string",
77
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
78
+ },
79
+ {
80
+ "type": "string",
81
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ "required": [
87
+ "payload"
88
+ ],
89
+ "additionalProperties": false
90
+ },
91
+ "BacklogPayload": {
92
+ "type": "object",
93
+ "properties": {
94
+ "anchor": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 256
98
+ },
99
+ "priority": {
100
+ "type": "string",
101
+ "enum": [
102
+ "P0",
103
+ "P1",
104
+ "P2",
105
+ "P3"
106
+ ]
107
+ },
108
+ "text": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "maxLength": 20000
112
+ },
113
+ "discoveredBy": {
114
+ "anyOf": [
115
+ {
116
+ "type": "string",
117
+ "maxLength": 20000
118
+ },
119
+ {
120
+ "type": "null"
121
+ }
122
+ ]
123
+ },
124
+ "section": {
125
+ "type": "string",
126
+ "maxLength": 20000
127
+ },
128
+ "state": {
129
+ "type": "string",
130
+ "enum": [
131
+ "open",
132
+ "removed"
133
+ ]
134
+ }
135
+ },
136
+ "required": [
137
+ "anchor",
138
+ "priority",
139
+ "text"
140
+ ],
141
+ "additionalProperties": false
142
+ },
143
+ "ChangelogInput": {
144
+ "type": "object",
145
+ "properties": {
146
+ "payload": {
147
+ "type": "object",
148
+ "properties": {
149
+ "origin": {
150
+ "type": "string",
151
+ "maxLength": 256,
152
+ "pattern": "^(plan|change):[^#\\s]+$"
153
+ },
154
+ "title": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "maxLength": 200
158
+ },
159
+ "body": {
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "maxLength": 20000
163
+ },
164
+ "commits": {
165
+ "type": "array",
166
+ "items": {
167
+ "type": "string",
168
+ "pattern": "^[0-9a-f]{7,40}$"
169
+ }
170
+ }
171
+ },
172
+ "required": [
173
+ "origin",
174
+ "title",
175
+ "body"
176
+ ],
177
+ "additionalProperties": false
178
+ },
179
+ "sessionId": {
180
+ "type": "string",
181
+ "minLength": 1,
182
+ "maxLength": 128
183
+ },
184
+ "planAnchor": {
185
+ "type": "string",
186
+ "maxLength": 256,
187
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
188
+ },
189
+ "occurredAt": {
190
+ "type": "string",
191
+ "allOf": [
192
+ {
193
+ "type": "string",
194
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
195
+ },
196
+ {
197
+ "type": "string",
198
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
199
+ }
200
+ ]
201
+ }
202
+ },
203
+ "required": [
204
+ "payload"
205
+ ],
206
+ "additionalProperties": false
207
+ },
208
+ "ChangelogPayload": {
209
+ "type": "object",
210
+ "properties": {
211
+ "origin": {
212
+ "type": "string",
213
+ "maxLength": 256,
214
+ "pattern": "^(plan|change):[^#\\s]+$"
215
+ },
216
+ "title": {
217
+ "type": "string",
218
+ "minLength": 1,
219
+ "maxLength": 200
220
+ },
221
+ "body": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "maxLength": 20000
225
+ },
226
+ "commits": {
227
+ "type": "array",
228
+ "items": {
229
+ "type": "string",
230
+ "pattern": "^[0-9a-f]{7,40}$"
231
+ }
232
+ }
233
+ },
234
+ "required": [
235
+ "origin",
236
+ "title",
237
+ "body"
238
+ ],
239
+ "additionalProperties": false
240
+ },
241
+ "GateEventInput": {
242
+ "type": "object",
243
+ "properties": {
244
+ "payload": {
245
+ "type": "object",
246
+ "properties": {
247
+ "eventId": {
248
+ "type": "string",
249
+ "format": "uuid",
250
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
251
+ },
252
+ "gate": {
253
+ "type": "string",
254
+ "minLength": 1,
255
+ "maxLength": 256
256
+ },
257
+ "verdict": {
258
+ "type": "string",
259
+ "enum": [
260
+ "pass",
261
+ "flag",
262
+ "block"
263
+ ]
264
+ },
265
+ "target": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 20000
269
+ },
270
+ "reason": {
271
+ "type": "string",
272
+ "minLength": 1,
273
+ "maxLength": 20000
274
+ },
275
+ "isBypassed": {
276
+ "type": "boolean"
277
+ }
278
+ },
279
+ "required": [
280
+ "eventId",
281
+ "gate",
282
+ "verdict"
283
+ ],
284
+ "additionalProperties": false
285
+ },
286
+ "sessionId": {
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "maxLength": 128
290
+ },
291
+ "planAnchor": {
292
+ "type": "string",
293
+ "maxLength": 256,
294
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
295
+ },
296
+ "occurredAt": {
297
+ "type": "string",
298
+ "allOf": [
299
+ {
300
+ "type": "string",
301
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
302
+ },
303
+ {
304
+ "type": "string",
305
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
306
+ }
307
+ ]
308
+ }
309
+ },
310
+ "required": [
311
+ "payload"
312
+ ],
313
+ "additionalProperties": false
314
+ },
315
+ "GateEventPayload": {
316
+ "type": "object",
317
+ "properties": {
318
+ "eventId": {
319
+ "type": "string",
320
+ "format": "uuid",
321
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
322
+ },
323
+ "gate": {
324
+ "type": "string",
325
+ "minLength": 1,
326
+ "maxLength": 256
327
+ },
328
+ "verdict": {
329
+ "type": "string",
330
+ "enum": [
331
+ "pass",
332
+ "flag",
333
+ "block"
334
+ ]
335
+ },
336
+ "target": {
337
+ "type": "string",
338
+ "minLength": 1,
339
+ "maxLength": 20000
340
+ },
341
+ "reason": {
342
+ "type": "string",
343
+ "minLength": 1,
344
+ "maxLength": 20000
345
+ },
346
+ "isBypassed": {
347
+ "type": "boolean"
348
+ }
349
+ },
350
+ "required": [
351
+ "eventId",
352
+ "gate",
353
+ "verdict"
354
+ ],
355
+ "additionalProperties": false
356
+ },
357
+ "LabelRow": {
358
+ "type": "object",
359
+ "properties": {
360
+ "id": {
361
+ "type": "string",
362
+ "minLength": 1,
363
+ "maxLength": 128
364
+ },
365
+ "sessionId": {
366
+ "type": "string",
367
+ "minLength": 1,
368
+ "maxLength": 128
369
+ },
370
+ "agentType": {
371
+ "type": "string",
372
+ "minLength": 1,
373
+ "maxLength": 128
374
+ },
375
+ "path": {
376
+ "anyOf": [
377
+ {
378
+ "type": "string",
379
+ "maxLength": 512
380
+ },
381
+ {
382
+ "type": "null"
383
+ }
384
+ ]
385
+ },
386
+ "estimatedTokens": {
387
+ "type": "integer",
388
+ "minimum": 0,
389
+ "maximum": 9007199254740991
390
+ },
391
+ "returnedTokens": {
392
+ "type": "integer",
393
+ "minimum": 0,
394
+ "maximum": 9007199254740991
395
+ },
396
+ "handler": {
397
+ "type": "string",
398
+ "enum": [
399
+ "outline",
400
+ "bypass",
401
+ "digest",
402
+ "full_read",
403
+ "local_model",
404
+ "redirect",
405
+ "pack_hit",
406
+ "pack_miss"
407
+ ]
408
+ },
409
+ "checkResult": {
410
+ "anyOf": [
411
+ {
412
+ "type": "string",
413
+ "enum": [
414
+ "pass",
415
+ "fail",
416
+ "budget",
417
+ "unavailable",
418
+ "latched"
419
+ ]
420
+ },
421
+ {
422
+ "type": "null"
423
+ }
424
+ ]
425
+ },
426
+ "isBypassUsed": {
427
+ "type": "boolean"
428
+ },
429
+ "latencyMs": {
430
+ "type": "integer",
431
+ "minimum": 0,
432
+ "maximum": 9007199254740991
433
+ },
434
+ "tokensKeptOut": {
435
+ "type": "integer",
436
+ "minimum": -9007199254740991,
437
+ "maximum": 9007199254740991
438
+ },
439
+ "createdAt": {
440
+ "type": "integer",
441
+ "minimum": 0,
442
+ "maximum": 9007199254740991
443
+ }
444
+ },
445
+ "required": [
446
+ "id",
447
+ "sessionId",
448
+ "agentType",
449
+ "path",
450
+ "estimatedTokens",
451
+ "returnedTokens",
452
+ "handler",
453
+ "checkResult",
454
+ "isBypassUsed",
455
+ "latencyMs",
456
+ "tokensKeptOut",
457
+ "createdAt"
458
+ ],
459
+ "additionalProperties": false
460
+ },
461
+ "MemoryInput": {
462
+ "type": "object",
463
+ "properties": {
464
+ "payload": {
465
+ "type": "object",
466
+ "properties": {
467
+ "path": {
468
+ "type": "string",
469
+ "minLength": 1,
470
+ "maxLength": 512
471
+ },
472
+ "body": {
473
+ "type": "string",
474
+ "maxLength": 100000
475
+ }
476
+ },
477
+ "required": [
478
+ "path",
479
+ "body"
480
+ ],
481
+ "additionalProperties": false
482
+ },
483
+ "sessionId": {
484
+ "type": "string",
485
+ "minLength": 1,
486
+ "maxLength": 128
487
+ },
488
+ "planAnchor": {
489
+ "type": "string",
490
+ "maxLength": 256,
491
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
492
+ },
493
+ "occurredAt": {
494
+ "type": "string",
495
+ "allOf": [
496
+ {
497
+ "type": "string",
498
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
499
+ },
500
+ {
501
+ "type": "string",
502
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
503
+ }
504
+ ]
505
+ }
506
+ },
507
+ "required": [
508
+ "payload"
509
+ ],
510
+ "additionalProperties": false
511
+ },
512
+ "MemoryPayload": {
513
+ "type": "object",
514
+ "properties": {
515
+ "path": {
516
+ "type": "string",
517
+ "minLength": 1,
518
+ "maxLength": 512
519
+ },
520
+ "body": {
521
+ "type": "string",
522
+ "maxLength": 100000
523
+ }
524
+ },
525
+ "required": [
526
+ "path",
527
+ "body"
528
+ ],
529
+ "additionalProperties": false
530
+ },
531
+ "ObligationInput": {
532
+ "type": "object",
533
+ "properties": {
534
+ "payload": {
535
+ "oneOf": [
536
+ {
537
+ "type": "object",
538
+ "properties": {
539
+ "origin": {
540
+ "type": "string",
541
+ "maxLength": 256,
542
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
543
+ },
544
+ "type": {
545
+ "type": "string",
546
+ "maxLength": 64,
547
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
548
+ },
549
+ "subject": {
550
+ "type": "string",
551
+ "minLength": 1,
552
+ "maxLength": 512
553
+ },
554
+ "claim": {
555
+ "type": "string",
556
+ "minLength": 1,
557
+ "maxLength": 20000
558
+ },
559
+ "ownerAgentDefinitionId": {
560
+ "type": "string",
561
+ "minLength": 1,
562
+ "maxLength": 128
563
+ },
564
+ "isGateCounted": {
565
+ "type": "boolean"
566
+ },
567
+ "state": {
568
+ "type": "string",
569
+ "const": "open"
570
+ }
571
+ },
572
+ "required": [
573
+ "origin",
574
+ "type",
575
+ "subject",
576
+ "state"
577
+ ],
578
+ "additionalProperties": false
579
+ },
580
+ {
581
+ "type": "object",
582
+ "properties": {
583
+ "origin": {
584
+ "type": "string",
585
+ "maxLength": 256,
586
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
587
+ },
588
+ "type": {
589
+ "type": "string",
590
+ "maxLength": 64,
591
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
592
+ },
593
+ "subject": {
594
+ "type": "string",
595
+ "minLength": 1,
596
+ "maxLength": 512
597
+ },
598
+ "claim": {
599
+ "type": "string",
600
+ "minLength": 1,
601
+ "maxLength": 20000
602
+ },
603
+ "ownerAgentDefinitionId": {
604
+ "type": "string",
605
+ "minLength": 1,
606
+ "maxLength": 128
607
+ },
608
+ "isGateCounted": {
609
+ "type": "boolean"
610
+ },
611
+ "state": {
612
+ "type": "string",
613
+ "const": "discharged"
614
+ },
615
+ "outcome": {
616
+ "oneOf": [
617
+ {
618
+ "type": "object",
619
+ "properties": {
620
+ "verdict": {
621
+ "type": "string",
622
+ "enum": [
623
+ "updated",
624
+ "satisfied",
625
+ "fixed"
626
+ ]
627
+ },
628
+ "reason": {
629
+ "type": "string",
630
+ "minLength": 1,
631
+ "maxLength": 20000
632
+ }
633
+ },
634
+ "required": [
635
+ "verdict"
636
+ ],
637
+ "additionalProperties": false
638
+ },
639
+ {
640
+ "type": "object",
641
+ "properties": {
642
+ "verdict": {
643
+ "type": "string",
644
+ "enum": [
645
+ "owes_nothing",
646
+ "blocked",
647
+ "dismissed"
648
+ ]
649
+ },
650
+ "reason": {
651
+ "type": "string",
652
+ "minLength": 1,
653
+ "maxLength": 20000
654
+ }
655
+ },
656
+ "required": [
657
+ "verdict",
658
+ "reason"
659
+ ],
660
+ "additionalProperties": false
661
+ }
662
+ ]
663
+ }
664
+ },
665
+ "required": [
666
+ "origin",
667
+ "type",
668
+ "subject",
669
+ "state",
670
+ "outcome"
671
+ ],
672
+ "additionalProperties": false
673
+ }
674
+ ]
675
+ },
676
+ "sessionId": {
677
+ "type": "string",
678
+ "minLength": 1,
679
+ "maxLength": 128
680
+ },
681
+ "planAnchor": {
682
+ "type": "string",
683
+ "maxLength": 256,
684
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
685
+ },
686
+ "occurredAt": {
687
+ "type": "string",
688
+ "allOf": [
689
+ {
690
+ "type": "string",
691
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
692
+ },
693
+ {
694
+ "type": "string",
695
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
696
+ }
697
+ ]
698
+ }
699
+ },
700
+ "required": [
701
+ "payload"
702
+ ],
703
+ "additionalProperties": false
704
+ },
705
+ "ObligationPayload": {
706
+ "oneOf": [
707
+ {
708
+ "type": "object",
709
+ "properties": {
710
+ "origin": {
711
+ "type": "string",
712
+ "maxLength": 256,
713
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
714
+ },
715
+ "type": {
716
+ "type": "string",
717
+ "maxLength": 64,
718
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
719
+ },
720
+ "subject": {
721
+ "type": "string",
722
+ "minLength": 1,
723
+ "maxLength": 512
724
+ },
725
+ "claim": {
726
+ "type": "string",
727
+ "minLength": 1,
728
+ "maxLength": 20000
729
+ },
730
+ "ownerAgentDefinitionId": {
731
+ "type": "string",
732
+ "minLength": 1,
733
+ "maxLength": 128
734
+ },
735
+ "isGateCounted": {
736
+ "type": "boolean"
737
+ },
738
+ "state": {
739
+ "type": "string",
740
+ "const": "open"
741
+ }
742
+ },
743
+ "required": [
744
+ "origin",
745
+ "type",
746
+ "subject",
747
+ "state"
748
+ ],
749
+ "additionalProperties": false
750
+ },
751
+ {
752
+ "type": "object",
753
+ "properties": {
754
+ "origin": {
755
+ "type": "string",
756
+ "maxLength": 256,
757
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
758
+ },
759
+ "type": {
760
+ "type": "string",
761
+ "maxLength": 64,
762
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
763
+ },
764
+ "subject": {
765
+ "type": "string",
766
+ "minLength": 1,
767
+ "maxLength": 512
768
+ },
769
+ "claim": {
770
+ "type": "string",
771
+ "minLength": 1,
772
+ "maxLength": 20000
773
+ },
774
+ "ownerAgentDefinitionId": {
775
+ "type": "string",
776
+ "minLength": 1,
777
+ "maxLength": 128
778
+ },
779
+ "isGateCounted": {
780
+ "type": "boolean"
781
+ },
782
+ "state": {
783
+ "type": "string",
784
+ "const": "discharged"
785
+ },
786
+ "outcome": {
787
+ "oneOf": [
788
+ {
789
+ "type": "object",
790
+ "properties": {
791
+ "verdict": {
792
+ "type": "string",
793
+ "enum": [
794
+ "updated",
795
+ "satisfied",
796
+ "fixed"
797
+ ]
798
+ },
799
+ "reason": {
800
+ "type": "string",
801
+ "minLength": 1,
802
+ "maxLength": 20000
803
+ }
804
+ },
805
+ "required": [
806
+ "verdict"
807
+ ],
808
+ "additionalProperties": false
809
+ },
810
+ {
811
+ "type": "object",
812
+ "properties": {
813
+ "verdict": {
814
+ "type": "string",
815
+ "enum": [
816
+ "owes_nothing",
817
+ "blocked",
818
+ "dismissed"
819
+ ]
820
+ },
821
+ "reason": {
822
+ "type": "string",
823
+ "minLength": 1,
824
+ "maxLength": 20000
825
+ }
826
+ },
827
+ "required": [
828
+ "verdict",
829
+ "reason"
830
+ ],
831
+ "additionalProperties": false
832
+ }
833
+ ]
834
+ }
835
+ },
836
+ "required": [
837
+ "origin",
838
+ "type",
839
+ "subject",
840
+ "state",
841
+ "outcome"
842
+ ],
843
+ "additionalProperties": false
844
+ }
845
+ ]
846
+ },
847
+ "ProposalInput": {
848
+ "type": "object",
849
+ "properties": {
850
+ "payload": {
851
+ "type": "object",
852
+ "properties": {
853
+ "origin": {
854
+ "type": "string",
855
+ "maxLength": 256,
856
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
857
+ },
858
+ "targetKind": {
859
+ "type": "string",
860
+ "enum": [
861
+ "rule",
862
+ "skill",
863
+ "document",
864
+ "instruction",
865
+ "memory"
866
+ ]
867
+ },
868
+ "targetPath": {
869
+ "type": "string",
870
+ "minLength": 1,
871
+ "maxLength": 512
872
+ },
873
+ "summary": {
874
+ "type": "string",
875
+ "minLength": 1,
876
+ "maxLength": 20000
877
+ },
878
+ "body": {
879
+ "type": "string",
880
+ "minLength": 1,
881
+ "maxLength": 20000
882
+ },
883
+ "state": {
884
+ "type": "string",
885
+ "enum": [
886
+ "proposed",
887
+ "approved",
888
+ "rejected"
889
+ ]
890
+ }
891
+ },
892
+ "required": [
893
+ "origin",
894
+ "targetKind",
895
+ "targetPath",
896
+ "summary",
897
+ "state"
898
+ ],
899
+ "additionalProperties": false
900
+ },
901
+ "sessionId": {
902
+ "type": "string",
903
+ "minLength": 1,
904
+ "maxLength": 128
905
+ },
906
+ "planAnchor": {
907
+ "type": "string",
908
+ "maxLength": 256,
909
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
910
+ },
911
+ "occurredAt": {
912
+ "type": "string",
913
+ "allOf": [
914
+ {
915
+ "type": "string",
916
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
917
+ },
918
+ {
919
+ "type": "string",
920
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
921
+ }
922
+ ]
923
+ }
924
+ },
925
+ "required": [
926
+ "payload"
927
+ ],
928
+ "additionalProperties": false
929
+ },
930
+ "ProposalPayload": {
931
+ "type": "object",
932
+ "properties": {
933
+ "origin": {
934
+ "type": "string",
935
+ "maxLength": 256,
936
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
937
+ },
938
+ "targetKind": {
939
+ "type": "string",
940
+ "enum": [
941
+ "rule",
942
+ "skill",
943
+ "document",
944
+ "instruction",
945
+ "memory"
946
+ ]
947
+ },
948
+ "targetPath": {
949
+ "type": "string",
950
+ "minLength": 1,
951
+ "maxLength": 512
952
+ },
953
+ "summary": {
954
+ "type": "string",
955
+ "minLength": 1,
956
+ "maxLength": 20000
957
+ },
958
+ "body": {
959
+ "type": "string",
960
+ "minLength": 1,
961
+ "maxLength": 20000
962
+ },
963
+ "state": {
964
+ "type": "string",
965
+ "enum": [
966
+ "proposed",
967
+ "approved",
968
+ "rejected"
969
+ ]
970
+ }
971
+ },
972
+ "required": [
973
+ "origin",
974
+ "targetKind",
975
+ "targetPath",
976
+ "summary",
977
+ "state"
978
+ ],
979
+ "additionalProperties": false
980
+ },
981
+ "RecordEnvelope": {
982
+ "oneOf": [
983
+ {
984
+ "type": "object",
985
+ "properties": {
986
+ "kind": {
987
+ "type": "string",
988
+ "const": "obligation"
989
+ },
990
+ "schemaVersion": {
991
+ "type": "number",
992
+ "const": 1
993
+ },
994
+ "projectId": {
995
+ "type": "string",
996
+ "minLength": 1,
997
+ "maxLength": 128
998
+ },
999
+ "sessionId": {
1000
+ "type": "string",
1001
+ "minLength": 1,
1002
+ "maxLength": 128
1003
+ },
1004
+ "planAnchor": {
1005
+ "type": "string",
1006
+ "maxLength": 256,
1007
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1008
+ },
1009
+ "naturalKey": {
1010
+ "type": "string",
1011
+ "minLength": 1,
1012
+ "maxLength": 1024
1013
+ },
1014
+ "payload": {
1015
+ "oneOf": [
1016
+ {
1017
+ "type": "object",
1018
+ "properties": {
1019
+ "origin": {
1020
+ "type": "string",
1021
+ "maxLength": 256,
1022
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
1023
+ },
1024
+ "type": {
1025
+ "type": "string",
1026
+ "maxLength": 64,
1027
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
1028
+ },
1029
+ "subject": {
1030
+ "type": "string",
1031
+ "minLength": 1,
1032
+ "maxLength": 512
1033
+ },
1034
+ "claim": {
1035
+ "type": "string",
1036
+ "minLength": 1,
1037
+ "maxLength": 20000
1038
+ },
1039
+ "ownerAgentDefinitionId": {
1040
+ "type": "string",
1041
+ "minLength": 1,
1042
+ "maxLength": 128
1043
+ },
1044
+ "isGateCounted": {
1045
+ "type": "boolean"
1046
+ },
1047
+ "state": {
1048
+ "type": "string",
1049
+ "const": "open"
1050
+ }
1051
+ },
1052
+ "required": [
1053
+ "origin",
1054
+ "type",
1055
+ "subject",
1056
+ "state"
1057
+ ],
1058
+ "additionalProperties": false
1059
+ },
1060
+ {
1061
+ "type": "object",
1062
+ "properties": {
1063
+ "origin": {
1064
+ "type": "string",
1065
+ "maxLength": 256,
1066
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
1067
+ },
1068
+ "type": {
1069
+ "type": "string",
1070
+ "maxLength": 64,
1071
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
1072
+ },
1073
+ "subject": {
1074
+ "type": "string",
1075
+ "minLength": 1,
1076
+ "maxLength": 512
1077
+ },
1078
+ "claim": {
1079
+ "type": "string",
1080
+ "minLength": 1,
1081
+ "maxLength": 20000
1082
+ },
1083
+ "ownerAgentDefinitionId": {
1084
+ "type": "string",
1085
+ "minLength": 1,
1086
+ "maxLength": 128
1087
+ },
1088
+ "isGateCounted": {
1089
+ "type": "boolean"
1090
+ },
1091
+ "state": {
1092
+ "type": "string",
1093
+ "const": "discharged"
1094
+ },
1095
+ "outcome": {
1096
+ "oneOf": [
1097
+ {
1098
+ "type": "object",
1099
+ "properties": {
1100
+ "verdict": {
1101
+ "type": "string",
1102
+ "enum": [
1103
+ "updated",
1104
+ "satisfied",
1105
+ "fixed"
1106
+ ]
1107
+ },
1108
+ "reason": {
1109
+ "type": "string",
1110
+ "minLength": 1,
1111
+ "maxLength": 20000
1112
+ }
1113
+ },
1114
+ "required": [
1115
+ "verdict"
1116
+ ],
1117
+ "additionalProperties": false
1118
+ },
1119
+ {
1120
+ "type": "object",
1121
+ "properties": {
1122
+ "verdict": {
1123
+ "type": "string",
1124
+ "enum": [
1125
+ "owes_nothing",
1126
+ "blocked",
1127
+ "dismissed"
1128
+ ]
1129
+ },
1130
+ "reason": {
1131
+ "type": "string",
1132
+ "minLength": 1,
1133
+ "maxLength": 20000
1134
+ }
1135
+ },
1136
+ "required": [
1137
+ "verdict",
1138
+ "reason"
1139
+ ],
1140
+ "additionalProperties": false
1141
+ }
1142
+ ]
1143
+ }
1144
+ },
1145
+ "required": [
1146
+ "origin",
1147
+ "type",
1148
+ "subject",
1149
+ "state",
1150
+ "outcome"
1151
+ ],
1152
+ "additionalProperties": false
1153
+ }
1154
+ ]
1155
+ },
1156
+ "occurredAt": {
1157
+ "type": "string",
1158
+ "allOf": [
1159
+ {
1160
+ "type": "string",
1161
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1162
+ },
1163
+ {
1164
+ "type": "string",
1165
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1166
+ }
1167
+ ]
1168
+ }
1169
+ },
1170
+ "required": [
1171
+ "kind",
1172
+ "schemaVersion",
1173
+ "projectId",
1174
+ "naturalKey",
1175
+ "payload",
1176
+ "occurredAt"
1177
+ ],
1178
+ "additionalProperties": false
1179
+ },
1180
+ {
1181
+ "type": "object",
1182
+ "properties": {
1183
+ "kind": {
1184
+ "type": "string",
1185
+ "const": "gate_event"
1186
+ },
1187
+ "schemaVersion": {
1188
+ "type": "number",
1189
+ "const": 1
1190
+ },
1191
+ "projectId": {
1192
+ "type": "string",
1193
+ "minLength": 1,
1194
+ "maxLength": 128
1195
+ },
1196
+ "sessionId": {
1197
+ "type": "string",
1198
+ "minLength": 1,
1199
+ "maxLength": 128
1200
+ },
1201
+ "planAnchor": {
1202
+ "type": "string",
1203
+ "maxLength": 256,
1204
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1205
+ },
1206
+ "naturalKey": {
1207
+ "type": "string",
1208
+ "minLength": 1,
1209
+ "maxLength": 1024
1210
+ },
1211
+ "payload": {
1212
+ "type": "object",
1213
+ "properties": {
1214
+ "eventId": {
1215
+ "type": "string",
1216
+ "format": "uuid",
1217
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1218
+ },
1219
+ "gate": {
1220
+ "type": "string",
1221
+ "minLength": 1,
1222
+ "maxLength": 256
1223
+ },
1224
+ "verdict": {
1225
+ "type": "string",
1226
+ "enum": [
1227
+ "pass",
1228
+ "flag",
1229
+ "block"
1230
+ ]
1231
+ },
1232
+ "target": {
1233
+ "type": "string",
1234
+ "minLength": 1,
1235
+ "maxLength": 20000
1236
+ },
1237
+ "reason": {
1238
+ "type": "string",
1239
+ "minLength": 1,
1240
+ "maxLength": 20000
1241
+ },
1242
+ "isBypassed": {
1243
+ "type": "boolean"
1244
+ }
1245
+ },
1246
+ "required": [
1247
+ "eventId",
1248
+ "gate",
1249
+ "verdict"
1250
+ ],
1251
+ "additionalProperties": false
1252
+ },
1253
+ "occurredAt": {
1254
+ "type": "string",
1255
+ "allOf": [
1256
+ {
1257
+ "type": "string",
1258
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1259
+ },
1260
+ {
1261
+ "type": "string",
1262
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1263
+ }
1264
+ ]
1265
+ }
1266
+ },
1267
+ "required": [
1268
+ "kind",
1269
+ "schemaVersion",
1270
+ "projectId",
1271
+ "naturalKey",
1272
+ "payload",
1273
+ "occurredAt"
1274
+ ],
1275
+ "additionalProperties": false
1276
+ },
1277
+ {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "kind": {
1281
+ "type": "string",
1282
+ "const": "changelog"
1283
+ },
1284
+ "schemaVersion": {
1285
+ "type": "number",
1286
+ "const": 1
1287
+ },
1288
+ "projectId": {
1289
+ "type": "string",
1290
+ "minLength": 1,
1291
+ "maxLength": 128
1292
+ },
1293
+ "sessionId": {
1294
+ "type": "string",
1295
+ "minLength": 1,
1296
+ "maxLength": 128
1297
+ },
1298
+ "planAnchor": {
1299
+ "type": "string",
1300
+ "maxLength": 256,
1301
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1302
+ },
1303
+ "naturalKey": {
1304
+ "type": "string",
1305
+ "minLength": 1,
1306
+ "maxLength": 1024
1307
+ },
1308
+ "payload": {
1309
+ "type": "object",
1310
+ "properties": {
1311
+ "origin": {
1312
+ "type": "string",
1313
+ "maxLength": 256,
1314
+ "pattern": "^(plan|change):[^#\\s]+$"
1315
+ },
1316
+ "title": {
1317
+ "type": "string",
1318
+ "minLength": 1,
1319
+ "maxLength": 200
1320
+ },
1321
+ "body": {
1322
+ "type": "string",
1323
+ "minLength": 1,
1324
+ "maxLength": 20000
1325
+ },
1326
+ "commits": {
1327
+ "type": "array",
1328
+ "items": {
1329
+ "type": "string",
1330
+ "pattern": "^[0-9a-f]{7,40}$"
1331
+ }
1332
+ }
1333
+ },
1334
+ "required": [
1335
+ "origin",
1336
+ "title",
1337
+ "body"
1338
+ ],
1339
+ "additionalProperties": false
1340
+ },
1341
+ "occurredAt": {
1342
+ "type": "string",
1343
+ "allOf": [
1344
+ {
1345
+ "type": "string",
1346
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1347
+ },
1348
+ {
1349
+ "type": "string",
1350
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1351
+ }
1352
+ ]
1353
+ }
1354
+ },
1355
+ "required": [
1356
+ "kind",
1357
+ "schemaVersion",
1358
+ "projectId",
1359
+ "naturalKey",
1360
+ "payload",
1361
+ "occurredAt"
1362
+ ],
1363
+ "additionalProperties": false
1364
+ },
1365
+ {
1366
+ "type": "object",
1367
+ "properties": {
1368
+ "kind": {
1369
+ "type": "string",
1370
+ "const": "memory"
1371
+ },
1372
+ "schemaVersion": {
1373
+ "type": "number",
1374
+ "const": 1
1375
+ },
1376
+ "projectId": {
1377
+ "type": "string",
1378
+ "minLength": 1,
1379
+ "maxLength": 128
1380
+ },
1381
+ "sessionId": {
1382
+ "type": "string",
1383
+ "minLength": 1,
1384
+ "maxLength": 128
1385
+ },
1386
+ "planAnchor": {
1387
+ "type": "string",
1388
+ "maxLength": 256,
1389
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1390
+ },
1391
+ "naturalKey": {
1392
+ "type": "string",
1393
+ "minLength": 1,
1394
+ "maxLength": 1024
1395
+ },
1396
+ "payload": {
1397
+ "type": "object",
1398
+ "properties": {
1399
+ "path": {
1400
+ "type": "string",
1401
+ "minLength": 1,
1402
+ "maxLength": 512
1403
+ },
1404
+ "body": {
1405
+ "type": "string",
1406
+ "maxLength": 100000
1407
+ }
1408
+ },
1409
+ "required": [
1410
+ "path",
1411
+ "body"
1412
+ ],
1413
+ "additionalProperties": false
1414
+ },
1415
+ "occurredAt": {
1416
+ "type": "string",
1417
+ "allOf": [
1418
+ {
1419
+ "type": "string",
1420
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1421
+ },
1422
+ {
1423
+ "type": "string",
1424
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1425
+ }
1426
+ ]
1427
+ }
1428
+ },
1429
+ "required": [
1430
+ "kind",
1431
+ "schemaVersion",
1432
+ "projectId",
1433
+ "naturalKey",
1434
+ "payload",
1435
+ "occurredAt"
1436
+ ],
1437
+ "additionalProperties": false
1438
+ },
1439
+ {
1440
+ "type": "object",
1441
+ "properties": {
1442
+ "kind": {
1443
+ "type": "string",
1444
+ "const": "backlog"
1445
+ },
1446
+ "schemaVersion": {
1447
+ "type": "number",
1448
+ "const": 1
1449
+ },
1450
+ "projectId": {
1451
+ "type": "string",
1452
+ "minLength": 1,
1453
+ "maxLength": 128
1454
+ },
1455
+ "sessionId": {
1456
+ "type": "string",
1457
+ "minLength": 1,
1458
+ "maxLength": 128
1459
+ },
1460
+ "planAnchor": {
1461
+ "type": "string",
1462
+ "maxLength": 256,
1463
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1464
+ },
1465
+ "naturalKey": {
1466
+ "type": "string",
1467
+ "minLength": 1,
1468
+ "maxLength": 1024
1469
+ },
1470
+ "payload": {
1471
+ "type": "object",
1472
+ "properties": {
1473
+ "anchor": {
1474
+ "type": "string",
1475
+ "minLength": 1,
1476
+ "maxLength": 256
1477
+ },
1478
+ "priority": {
1479
+ "type": "string",
1480
+ "enum": [
1481
+ "P0",
1482
+ "P1",
1483
+ "P2",
1484
+ "P3"
1485
+ ]
1486
+ },
1487
+ "text": {
1488
+ "type": "string",
1489
+ "minLength": 1,
1490
+ "maxLength": 20000
1491
+ },
1492
+ "discoveredBy": {
1493
+ "anyOf": [
1494
+ {
1495
+ "type": "string",
1496
+ "maxLength": 20000
1497
+ },
1498
+ {
1499
+ "type": "null"
1500
+ }
1501
+ ]
1502
+ },
1503
+ "section": {
1504
+ "type": "string",
1505
+ "maxLength": 20000
1506
+ },
1507
+ "state": {
1508
+ "type": "string",
1509
+ "enum": [
1510
+ "open",
1511
+ "removed"
1512
+ ]
1513
+ }
1514
+ },
1515
+ "required": [
1516
+ "anchor",
1517
+ "priority",
1518
+ "text"
1519
+ ],
1520
+ "additionalProperties": false
1521
+ },
1522
+ "occurredAt": {
1523
+ "type": "string",
1524
+ "allOf": [
1525
+ {
1526
+ "type": "string",
1527
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1528
+ },
1529
+ {
1530
+ "type": "string",
1531
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1532
+ }
1533
+ ]
1534
+ }
1535
+ },
1536
+ "required": [
1537
+ "kind",
1538
+ "schemaVersion",
1539
+ "projectId",
1540
+ "naturalKey",
1541
+ "payload",
1542
+ "occurredAt"
1543
+ ],
1544
+ "additionalProperties": false
1545
+ },
1546
+ {
1547
+ "type": "object",
1548
+ "properties": {
1549
+ "kind": {
1550
+ "type": "string",
1551
+ "const": "proposal"
1552
+ },
1553
+ "schemaVersion": {
1554
+ "type": "number",
1555
+ "const": 1
1556
+ },
1557
+ "projectId": {
1558
+ "type": "string",
1559
+ "minLength": 1,
1560
+ "maxLength": 128
1561
+ },
1562
+ "sessionId": {
1563
+ "type": "string",
1564
+ "minLength": 1,
1565
+ "maxLength": 128
1566
+ },
1567
+ "planAnchor": {
1568
+ "type": "string",
1569
+ "maxLength": 256,
1570
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1571
+ },
1572
+ "naturalKey": {
1573
+ "type": "string",
1574
+ "minLength": 1,
1575
+ "maxLength": 1024
1576
+ },
1577
+ "payload": {
1578
+ "type": "object",
1579
+ "properties": {
1580
+ "origin": {
1581
+ "type": "string",
1582
+ "maxLength": 256,
1583
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
1584
+ },
1585
+ "targetKind": {
1586
+ "type": "string",
1587
+ "enum": [
1588
+ "rule",
1589
+ "skill",
1590
+ "document",
1591
+ "instruction",
1592
+ "memory"
1593
+ ]
1594
+ },
1595
+ "targetPath": {
1596
+ "type": "string",
1597
+ "minLength": 1,
1598
+ "maxLength": 512
1599
+ },
1600
+ "summary": {
1601
+ "type": "string",
1602
+ "minLength": 1,
1603
+ "maxLength": 20000
1604
+ },
1605
+ "body": {
1606
+ "type": "string",
1607
+ "minLength": 1,
1608
+ "maxLength": 20000
1609
+ },
1610
+ "state": {
1611
+ "type": "string",
1612
+ "enum": [
1613
+ "proposed",
1614
+ "approved",
1615
+ "rejected"
1616
+ ]
1617
+ }
1618
+ },
1619
+ "required": [
1620
+ "origin",
1621
+ "targetKind",
1622
+ "targetPath",
1623
+ "summary",
1624
+ "state"
1625
+ ],
1626
+ "additionalProperties": false
1627
+ },
1628
+ "occurredAt": {
1629
+ "type": "string",
1630
+ "allOf": [
1631
+ {
1632
+ "type": "string",
1633
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1634
+ },
1635
+ {
1636
+ "type": "string",
1637
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1638
+ }
1639
+ ]
1640
+ }
1641
+ },
1642
+ "required": [
1643
+ "kind",
1644
+ "schemaVersion",
1645
+ "projectId",
1646
+ "naturalKey",
1647
+ "payload",
1648
+ "occurredAt"
1649
+ ],
1650
+ "additionalProperties": false
1651
+ },
1652
+ {
1653
+ "type": "object",
1654
+ "properties": {
1655
+ "kind": {
1656
+ "type": "string",
1657
+ "const": "triage"
1658
+ },
1659
+ "schemaVersion": {
1660
+ "type": "number",
1661
+ "const": 1
1662
+ },
1663
+ "projectId": {
1664
+ "type": "string",
1665
+ "minLength": 1,
1666
+ "maxLength": 128
1667
+ },
1668
+ "sessionId": {
1669
+ "type": "string",
1670
+ "minLength": 1,
1671
+ "maxLength": 128
1672
+ },
1673
+ "planAnchor": {
1674
+ "type": "string",
1675
+ "maxLength": 256,
1676
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1677
+ },
1678
+ "naturalKey": {
1679
+ "type": "string",
1680
+ "minLength": 1,
1681
+ "maxLength": 1024
1682
+ },
1683
+ "payload": {
1684
+ "type": "object",
1685
+ "properties": {
1686
+ "tracker": {
1687
+ "type": "string",
1688
+ "maxLength": 64,
1689
+ "pattern": "^[a-z][a-z0-9-]*$"
1690
+ },
1691
+ "itemRef": {
1692
+ "type": "string",
1693
+ "minLength": 1,
1694
+ "maxLength": 256
1695
+ },
1696
+ "title": {
1697
+ "type": "string",
1698
+ "minLength": 1,
1699
+ "maxLength": 20000
1700
+ },
1701
+ "summary": {
1702
+ "type": "string",
1703
+ "minLength": 1,
1704
+ "maxLength": 20000
1705
+ },
1706
+ "priority": {
1707
+ "type": "string",
1708
+ "minLength": 1,
1709
+ "maxLength": 64
1710
+ },
1711
+ "state": {
1712
+ "type": "string",
1713
+ "enum": [
1714
+ "open",
1715
+ "triaged",
1716
+ "closed"
1717
+ ]
1718
+ }
1719
+ },
1720
+ "required": [
1721
+ "tracker",
1722
+ "itemRef",
1723
+ "title",
1724
+ "state"
1725
+ ],
1726
+ "additionalProperties": false
1727
+ },
1728
+ "occurredAt": {
1729
+ "type": "string",
1730
+ "allOf": [
1731
+ {
1732
+ "type": "string",
1733
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1734
+ },
1735
+ {
1736
+ "type": "string",
1737
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1738
+ }
1739
+ ]
1740
+ }
1741
+ },
1742
+ "required": [
1743
+ "kind",
1744
+ "schemaVersion",
1745
+ "projectId",
1746
+ "naturalKey",
1747
+ "payload",
1748
+ "occurredAt"
1749
+ ],
1750
+ "additionalProperties": false
1751
+ }
1752
+ ]
1753
+ },
1754
+ "RecordKind": {
1755
+ "type": "string",
1756
+ "enum": [
1757
+ "obligation",
1758
+ "gate_event",
1759
+ "changelog",
1760
+ "memory",
1761
+ "backlog",
1762
+ "proposal",
1763
+ "triage"
1764
+ ]
1765
+ },
1766
+ "RecordsRequest": {
1767
+ "oneOf": [
1768
+ {
1769
+ "type": "object",
1770
+ "properties": {
1771
+ "kind": {
1772
+ "type": "string",
1773
+ "const": "obligation"
1774
+ },
1775
+ "rows": {
1776
+ "maxItems": 200,
1777
+ "type": "array",
1778
+ "items": {
1779
+ "type": "object",
1780
+ "properties": {
1781
+ "kind": {
1782
+ "type": "string",
1783
+ "const": "obligation"
1784
+ },
1785
+ "schemaVersion": {
1786
+ "type": "number",
1787
+ "const": 1
1788
+ },
1789
+ "projectId": {
1790
+ "type": "string",
1791
+ "minLength": 1,
1792
+ "maxLength": 128
1793
+ },
1794
+ "sessionId": {
1795
+ "type": "string",
1796
+ "minLength": 1,
1797
+ "maxLength": 128
1798
+ },
1799
+ "planAnchor": {
1800
+ "type": "string",
1801
+ "maxLength": 256,
1802
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
1803
+ },
1804
+ "naturalKey": {
1805
+ "type": "string",
1806
+ "minLength": 1,
1807
+ "maxLength": 1024
1808
+ },
1809
+ "payload": {
1810
+ "oneOf": [
1811
+ {
1812
+ "type": "object",
1813
+ "properties": {
1814
+ "origin": {
1815
+ "type": "string",
1816
+ "maxLength": 256,
1817
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
1818
+ },
1819
+ "type": {
1820
+ "type": "string",
1821
+ "maxLength": 64,
1822
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
1823
+ },
1824
+ "subject": {
1825
+ "type": "string",
1826
+ "minLength": 1,
1827
+ "maxLength": 512
1828
+ },
1829
+ "claim": {
1830
+ "type": "string",
1831
+ "minLength": 1,
1832
+ "maxLength": 20000
1833
+ },
1834
+ "ownerAgentDefinitionId": {
1835
+ "type": "string",
1836
+ "minLength": 1,
1837
+ "maxLength": 128
1838
+ },
1839
+ "isGateCounted": {
1840
+ "type": "boolean"
1841
+ },
1842
+ "state": {
1843
+ "type": "string",
1844
+ "const": "open"
1845
+ }
1846
+ },
1847
+ "required": [
1848
+ "origin",
1849
+ "type",
1850
+ "subject",
1851
+ "state"
1852
+ ],
1853
+ "additionalProperties": false
1854
+ },
1855
+ {
1856
+ "type": "object",
1857
+ "properties": {
1858
+ "origin": {
1859
+ "type": "string",
1860
+ "maxLength": 256,
1861
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
1862
+ },
1863
+ "type": {
1864
+ "type": "string",
1865
+ "maxLength": 64,
1866
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
1867
+ },
1868
+ "subject": {
1869
+ "type": "string",
1870
+ "minLength": 1,
1871
+ "maxLength": 512
1872
+ },
1873
+ "claim": {
1874
+ "type": "string",
1875
+ "minLength": 1,
1876
+ "maxLength": 20000
1877
+ },
1878
+ "ownerAgentDefinitionId": {
1879
+ "type": "string",
1880
+ "minLength": 1,
1881
+ "maxLength": 128
1882
+ },
1883
+ "isGateCounted": {
1884
+ "type": "boolean"
1885
+ },
1886
+ "state": {
1887
+ "type": "string",
1888
+ "const": "discharged"
1889
+ },
1890
+ "outcome": {
1891
+ "oneOf": [
1892
+ {
1893
+ "type": "object",
1894
+ "properties": {
1895
+ "verdict": {
1896
+ "type": "string",
1897
+ "enum": [
1898
+ "updated",
1899
+ "satisfied",
1900
+ "fixed"
1901
+ ]
1902
+ },
1903
+ "reason": {
1904
+ "type": "string",
1905
+ "minLength": 1,
1906
+ "maxLength": 20000
1907
+ }
1908
+ },
1909
+ "required": [
1910
+ "verdict"
1911
+ ],
1912
+ "additionalProperties": false
1913
+ },
1914
+ {
1915
+ "type": "object",
1916
+ "properties": {
1917
+ "verdict": {
1918
+ "type": "string",
1919
+ "enum": [
1920
+ "owes_nothing",
1921
+ "blocked",
1922
+ "dismissed"
1923
+ ]
1924
+ },
1925
+ "reason": {
1926
+ "type": "string",
1927
+ "minLength": 1,
1928
+ "maxLength": 20000
1929
+ }
1930
+ },
1931
+ "required": [
1932
+ "verdict",
1933
+ "reason"
1934
+ ],
1935
+ "additionalProperties": false
1936
+ }
1937
+ ]
1938
+ }
1939
+ },
1940
+ "required": [
1941
+ "origin",
1942
+ "type",
1943
+ "subject",
1944
+ "state",
1945
+ "outcome"
1946
+ ],
1947
+ "additionalProperties": false
1948
+ }
1949
+ ]
1950
+ },
1951
+ "occurredAt": {
1952
+ "type": "string",
1953
+ "allOf": [
1954
+ {
1955
+ "type": "string",
1956
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
1957
+ },
1958
+ {
1959
+ "type": "string",
1960
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
1961
+ }
1962
+ ]
1963
+ }
1964
+ },
1965
+ "required": [
1966
+ "kind",
1967
+ "schemaVersion",
1968
+ "projectId",
1969
+ "naturalKey",
1970
+ "payload",
1971
+ "occurredAt"
1972
+ ],
1973
+ "additionalProperties": false
1974
+ }
1975
+ }
1976
+ },
1977
+ "required": [
1978
+ "kind",
1979
+ "rows"
1980
+ ],
1981
+ "additionalProperties": false
1982
+ },
1983
+ {
1984
+ "type": "object",
1985
+ "properties": {
1986
+ "kind": {
1987
+ "type": "string",
1988
+ "const": "gate_event"
1989
+ },
1990
+ "rows": {
1991
+ "maxItems": 200,
1992
+ "type": "array",
1993
+ "items": {
1994
+ "type": "object",
1995
+ "properties": {
1996
+ "kind": {
1997
+ "type": "string",
1998
+ "const": "gate_event"
1999
+ },
2000
+ "schemaVersion": {
2001
+ "type": "number",
2002
+ "const": 1
2003
+ },
2004
+ "projectId": {
2005
+ "type": "string",
2006
+ "minLength": 1,
2007
+ "maxLength": 128
2008
+ },
2009
+ "sessionId": {
2010
+ "type": "string",
2011
+ "minLength": 1,
2012
+ "maxLength": 128
2013
+ },
2014
+ "planAnchor": {
2015
+ "type": "string",
2016
+ "maxLength": 256,
2017
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2018
+ },
2019
+ "naturalKey": {
2020
+ "type": "string",
2021
+ "minLength": 1,
2022
+ "maxLength": 1024
2023
+ },
2024
+ "payload": {
2025
+ "type": "object",
2026
+ "properties": {
2027
+ "eventId": {
2028
+ "type": "string",
2029
+ "format": "uuid",
2030
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
2031
+ },
2032
+ "gate": {
2033
+ "type": "string",
2034
+ "minLength": 1,
2035
+ "maxLength": 256
2036
+ },
2037
+ "verdict": {
2038
+ "type": "string",
2039
+ "enum": [
2040
+ "pass",
2041
+ "flag",
2042
+ "block"
2043
+ ]
2044
+ },
2045
+ "target": {
2046
+ "type": "string",
2047
+ "minLength": 1,
2048
+ "maxLength": 20000
2049
+ },
2050
+ "reason": {
2051
+ "type": "string",
2052
+ "minLength": 1,
2053
+ "maxLength": 20000
2054
+ },
2055
+ "isBypassed": {
2056
+ "type": "boolean"
2057
+ }
2058
+ },
2059
+ "required": [
2060
+ "eventId",
2061
+ "gate",
2062
+ "verdict"
2063
+ ],
2064
+ "additionalProperties": false
2065
+ },
2066
+ "occurredAt": {
2067
+ "type": "string",
2068
+ "allOf": [
2069
+ {
2070
+ "type": "string",
2071
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2072
+ },
2073
+ {
2074
+ "type": "string",
2075
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2076
+ }
2077
+ ]
2078
+ }
2079
+ },
2080
+ "required": [
2081
+ "kind",
2082
+ "schemaVersion",
2083
+ "projectId",
2084
+ "naturalKey",
2085
+ "payload",
2086
+ "occurredAt"
2087
+ ],
2088
+ "additionalProperties": false
2089
+ }
2090
+ }
2091
+ },
2092
+ "required": [
2093
+ "kind",
2094
+ "rows"
2095
+ ],
2096
+ "additionalProperties": false
2097
+ },
2098
+ {
2099
+ "type": "object",
2100
+ "properties": {
2101
+ "kind": {
2102
+ "type": "string",
2103
+ "const": "changelog"
2104
+ },
2105
+ "rows": {
2106
+ "maxItems": 200,
2107
+ "type": "array",
2108
+ "items": {
2109
+ "type": "object",
2110
+ "properties": {
2111
+ "kind": {
2112
+ "type": "string",
2113
+ "const": "changelog"
2114
+ },
2115
+ "schemaVersion": {
2116
+ "type": "number",
2117
+ "const": 1
2118
+ },
2119
+ "projectId": {
2120
+ "type": "string",
2121
+ "minLength": 1,
2122
+ "maxLength": 128
2123
+ },
2124
+ "sessionId": {
2125
+ "type": "string",
2126
+ "minLength": 1,
2127
+ "maxLength": 128
2128
+ },
2129
+ "planAnchor": {
2130
+ "type": "string",
2131
+ "maxLength": 256,
2132
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2133
+ },
2134
+ "naturalKey": {
2135
+ "type": "string",
2136
+ "minLength": 1,
2137
+ "maxLength": 1024
2138
+ },
2139
+ "payload": {
2140
+ "type": "object",
2141
+ "properties": {
2142
+ "origin": {
2143
+ "type": "string",
2144
+ "maxLength": 256,
2145
+ "pattern": "^(plan|change):[^#\\s]+$"
2146
+ },
2147
+ "title": {
2148
+ "type": "string",
2149
+ "minLength": 1,
2150
+ "maxLength": 200
2151
+ },
2152
+ "body": {
2153
+ "type": "string",
2154
+ "minLength": 1,
2155
+ "maxLength": 20000
2156
+ },
2157
+ "commits": {
2158
+ "type": "array",
2159
+ "items": {
2160
+ "type": "string",
2161
+ "pattern": "^[0-9a-f]{7,40}$"
2162
+ }
2163
+ }
2164
+ },
2165
+ "required": [
2166
+ "origin",
2167
+ "title",
2168
+ "body"
2169
+ ],
2170
+ "additionalProperties": false
2171
+ },
2172
+ "occurredAt": {
2173
+ "type": "string",
2174
+ "allOf": [
2175
+ {
2176
+ "type": "string",
2177
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2178
+ },
2179
+ {
2180
+ "type": "string",
2181
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2182
+ }
2183
+ ]
2184
+ }
2185
+ },
2186
+ "required": [
2187
+ "kind",
2188
+ "schemaVersion",
2189
+ "projectId",
2190
+ "naturalKey",
2191
+ "payload",
2192
+ "occurredAt"
2193
+ ],
2194
+ "additionalProperties": false
2195
+ }
2196
+ }
2197
+ },
2198
+ "required": [
2199
+ "kind",
2200
+ "rows"
2201
+ ],
2202
+ "additionalProperties": false
2203
+ },
2204
+ {
2205
+ "type": "object",
2206
+ "properties": {
2207
+ "kind": {
2208
+ "type": "string",
2209
+ "const": "memory"
2210
+ },
2211
+ "rows": {
2212
+ "maxItems": 200,
2213
+ "type": "array",
2214
+ "items": {
2215
+ "type": "object",
2216
+ "properties": {
2217
+ "kind": {
2218
+ "type": "string",
2219
+ "const": "memory"
2220
+ },
2221
+ "schemaVersion": {
2222
+ "type": "number",
2223
+ "const": 1
2224
+ },
2225
+ "projectId": {
2226
+ "type": "string",
2227
+ "minLength": 1,
2228
+ "maxLength": 128
2229
+ },
2230
+ "sessionId": {
2231
+ "type": "string",
2232
+ "minLength": 1,
2233
+ "maxLength": 128
2234
+ },
2235
+ "planAnchor": {
2236
+ "type": "string",
2237
+ "maxLength": 256,
2238
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2239
+ },
2240
+ "naturalKey": {
2241
+ "type": "string",
2242
+ "minLength": 1,
2243
+ "maxLength": 1024
2244
+ },
2245
+ "payload": {
2246
+ "type": "object",
2247
+ "properties": {
2248
+ "path": {
2249
+ "type": "string",
2250
+ "minLength": 1,
2251
+ "maxLength": 512
2252
+ },
2253
+ "body": {
2254
+ "type": "string",
2255
+ "maxLength": 100000
2256
+ }
2257
+ },
2258
+ "required": [
2259
+ "path",
2260
+ "body"
2261
+ ],
2262
+ "additionalProperties": false
2263
+ },
2264
+ "occurredAt": {
2265
+ "type": "string",
2266
+ "allOf": [
2267
+ {
2268
+ "type": "string",
2269
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2270
+ },
2271
+ {
2272
+ "type": "string",
2273
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2274
+ }
2275
+ ]
2276
+ }
2277
+ },
2278
+ "required": [
2279
+ "kind",
2280
+ "schemaVersion",
2281
+ "projectId",
2282
+ "naturalKey",
2283
+ "payload",
2284
+ "occurredAt"
2285
+ ],
2286
+ "additionalProperties": false
2287
+ }
2288
+ }
2289
+ },
2290
+ "required": [
2291
+ "kind",
2292
+ "rows"
2293
+ ],
2294
+ "additionalProperties": false
2295
+ },
2296
+ {
2297
+ "type": "object",
2298
+ "properties": {
2299
+ "kind": {
2300
+ "type": "string",
2301
+ "const": "backlog"
2302
+ },
2303
+ "rows": {
2304
+ "maxItems": 200,
2305
+ "type": "array",
2306
+ "items": {
2307
+ "type": "object",
2308
+ "properties": {
2309
+ "kind": {
2310
+ "type": "string",
2311
+ "const": "backlog"
2312
+ },
2313
+ "schemaVersion": {
2314
+ "type": "number",
2315
+ "const": 1
2316
+ },
2317
+ "projectId": {
2318
+ "type": "string",
2319
+ "minLength": 1,
2320
+ "maxLength": 128
2321
+ },
2322
+ "sessionId": {
2323
+ "type": "string",
2324
+ "minLength": 1,
2325
+ "maxLength": 128
2326
+ },
2327
+ "planAnchor": {
2328
+ "type": "string",
2329
+ "maxLength": 256,
2330
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2331
+ },
2332
+ "naturalKey": {
2333
+ "type": "string",
2334
+ "minLength": 1,
2335
+ "maxLength": 1024
2336
+ },
2337
+ "payload": {
2338
+ "type": "object",
2339
+ "properties": {
2340
+ "anchor": {
2341
+ "type": "string",
2342
+ "minLength": 1,
2343
+ "maxLength": 256
2344
+ },
2345
+ "priority": {
2346
+ "type": "string",
2347
+ "enum": [
2348
+ "P0",
2349
+ "P1",
2350
+ "P2",
2351
+ "P3"
2352
+ ]
2353
+ },
2354
+ "text": {
2355
+ "type": "string",
2356
+ "minLength": 1,
2357
+ "maxLength": 20000
2358
+ },
2359
+ "discoveredBy": {
2360
+ "anyOf": [
2361
+ {
2362
+ "type": "string",
2363
+ "maxLength": 20000
2364
+ },
2365
+ {
2366
+ "type": "null"
2367
+ }
2368
+ ]
2369
+ },
2370
+ "section": {
2371
+ "type": "string",
2372
+ "maxLength": 20000
2373
+ },
2374
+ "state": {
2375
+ "type": "string",
2376
+ "enum": [
2377
+ "open",
2378
+ "removed"
2379
+ ]
2380
+ }
2381
+ },
2382
+ "required": [
2383
+ "anchor",
2384
+ "priority",
2385
+ "text"
2386
+ ],
2387
+ "additionalProperties": false
2388
+ },
2389
+ "occurredAt": {
2390
+ "type": "string",
2391
+ "allOf": [
2392
+ {
2393
+ "type": "string",
2394
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2395
+ },
2396
+ {
2397
+ "type": "string",
2398
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2399
+ }
2400
+ ]
2401
+ }
2402
+ },
2403
+ "required": [
2404
+ "kind",
2405
+ "schemaVersion",
2406
+ "projectId",
2407
+ "naturalKey",
2408
+ "payload",
2409
+ "occurredAt"
2410
+ ],
2411
+ "additionalProperties": false
2412
+ }
2413
+ }
2414
+ },
2415
+ "required": [
2416
+ "kind",
2417
+ "rows"
2418
+ ],
2419
+ "additionalProperties": false
2420
+ },
2421
+ {
2422
+ "type": "object",
2423
+ "properties": {
2424
+ "kind": {
2425
+ "type": "string",
2426
+ "const": "proposal"
2427
+ },
2428
+ "rows": {
2429
+ "maxItems": 200,
2430
+ "type": "array",
2431
+ "items": {
2432
+ "type": "object",
2433
+ "properties": {
2434
+ "kind": {
2435
+ "type": "string",
2436
+ "const": "proposal"
2437
+ },
2438
+ "schemaVersion": {
2439
+ "type": "number",
2440
+ "const": 1
2441
+ },
2442
+ "projectId": {
2443
+ "type": "string",
2444
+ "minLength": 1,
2445
+ "maxLength": 128
2446
+ },
2447
+ "sessionId": {
2448
+ "type": "string",
2449
+ "minLength": 1,
2450
+ "maxLength": 128
2451
+ },
2452
+ "planAnchor": {
2453
+ "type": "string",
2454
+ "maxLength": 256,
2455
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2456
+ },
2457
+ "naturalKey": {
2458
+ "type": "string",
2459
+ "minLength": 1,
2460
+ "maxLength": 1024
2461
+ },
2462
+ "payload": {
2463
+ "type": "object",
2464
+ "properties": {
2465
+ "origin": {
2466
+ "type": "string",
2467
+ "maxLength": 256,
2468
+ "pattern": "^(plan|change|path|session|run):[^#\\s]+$"
2469
+ },
2470
+ "targetKind": {
2471
+ "type": "string",
2472
+ "enum": [
2473
+ "rule",
2474
+ "skill",
2475
+ "document",
2476
+ "instruction",
2477
+ "memory"
2478
+ ]
2479
+ },
2480
+ "targetPath": {
2481
+ "type": "string",
2482
+ "minLength": 1,
2483
+ "maxLength": 512
2484
+ },
2485
+ "summary": {
2486
+ "type": "string",
2487
+ "minLength": 1,
2488
+ "maxLength": 20000
2489
+ },
2490
+ "body": {
2491
+ "type": "string",
2492
+ "minLength": 1,
2493
+ "maxLength": 20000
2494
+ },
2495
+ "state": {
2496
+ "type": "string",
2497
+ "enum": [
2498
+ "proposed",
2499
+ "approved",
2500
+ "rejected"
2501
+ ]
2502
+ }
2503
+ },
2504
+ "required": [
2505
+ "origin",
2506
+ "targetKind",
2507
+ "targetPath",
2508
+ "summary",
2509
+ "state"
2510
+ ],
2511
+ "additionalProperties": false
2512
+ },
2513
+ "occurredAt": {
2514
+ "type": "string",
2515
+ "allOf": [
2516
+ {
2517
+ "type": "string",
2518
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2519
+ },
2520
+ {
2521
+ "type": "string",
2522
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2523
+ }
2524
+ ]
2525
+ }
2526
+ },
2527
+ "required": [
2528
+ "kind",
2529
+ "schemaVersion",
2530
+ "projectId",
2531
+ "naturalKey",
2532
+ "payload",
2533
+ "occurredAt"
2534
+ ],
2535
+ "additionalProperties": false
2536
+ }
2537
+ }
2538
+ },
2539
+ "required": [
2540
+ "kind",
2541
+ "rows"
2542
+ ],
2543
+ "additionalProperties": false
2544
+ },
2545
+ {
2546
+ "type": "object",
2547
+ "properties": {
2548
+ "kind": {
2549
+ "type": "string",
2550
+ "const": "triage"
2551
+ },
2552
+ "rows": {
2553
+ "maxItems": 200,
2554
+ "type": "array",
2555
+ "items": {
2556
+ "type": "object",
2557
+ "properties": {
2558
+ "kind": {
2559
+ "type": "string",
2560
+ "const": "triage"
2561
+ },
2562
+ "schemaVersion": {
2563
+ "type": "number",
2564
+ "const": 1
2565
+ },
2566
+ "projectId": {
2567
+ "type": "string",
2568
+ "minLength": 1,
2569
+ "maxLength": 128
2570
+ },
2571
+ "sessionId": {
2572
+ "type": "string",
2573
+ "minLength": 1,
2574
+ "maxLength": 128
2575
+ },
2576
+ "planAnchor": {
2577
+ "type": "string",
2578
+ "maxLength": 256,
2579
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2580
+ },
2581
+ "naturalKey": {
2582
+ "type": "string",
2583
+ "minLength": 1,
2584
+ "maxLength": 1024
2585
+ },
2586
+ "payload": {
2587
+ "type": "object",
2588
+ "properties": {
2589
+ "tracker": {
2590
+ "type": "string",
2591
+ "maxLength": 64,
2592
+ "pattern": "^[a-z][a-z0-9-]*$"
2593
+ },
2594
+ "itemRef": {
2595
+ "type": "string",
2596
+ "minLength": 1,
2597
+ "maxLength": 256
2598
+ },
2599
+ "title": {
2600
+ "type": "string",
2601
+ "minLength": 1,
2602
+ "maxLength": 20000
2603
+ },
2604
+ "summary": {
2605
+ "type": "string",
2606
+ "minLength": 1,
2607
+ "maxLength": 20000
2608
+ },
2609
+ "priority": {
2610
+ "type": "string",
2611
+ "minLength": 1,
2612
+ "maxLength": 64
2613
+ },
2614
+ "state": {
2615
+ "type": "string",
2616
+ "enum": [
2617
+ "open",
2618
+ "triaged",
2619
+ "closed"
2620
+ ]
2621
+ }
2622
+ },
2623
+ "required": [
2624
+ "tracker",
2625
+ "itemRef",
2626
+ "title",
2627
+ "state"
2628
+ ],
2629
+ "additionalProperties": false
2630
+ },
2631
+ "occurredAt": {
2632
+ "type": "string",
2633
+ "allOf": [
2634
+ {
2635
+ "type": "string",
2636
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2637
+ },
2638
+ {
2639
+ "type": "string",
2640
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2641
+ }
2642
+ ]
2643
+ }
2644
+ },
2645
+ "required": [
2646
+ "kind",
2647
+ "schemaVersion",
2648
+ "projectId",
2649
+ "naturalKey",
2650
+ "payload",
2651
+ "occurredAt"
2652
+ ],
2653
+ "additionalProperties": false
2654
+ }
2655
+ }
2656
+ },
2657
+ "required": [
2658
+ "kind",
2659
+ "rows"
2660
+ ],
2661
+ "additionalProperties": false
2662
+ }
2663
+ ]
2664
+ },
2665
+ "RecordsResult": {
2666
+ "type": "object",
2667
+ "properties": {
2668
+ "landed": {
2669
+ "type": "integer",
2670
+ "minimum": 0,
2671
+ "maximum": 9007199254740991
2672
+ },
2673
+ "skipped": {
2674
+ "type": "integer",
2675
+ "minimum": 0,
2676
+ "maximum": 9007199254740991
2677
+ }
2678
+ },
2679
+ "required": [
2680
+ "landed",
2681
+ "skipped"
2682
+ ],
2683
+ "additionalProperties": false
2684
+ },
2685
+ "SessionRowExtension": {
2686
+ "type": "object",
2687
+ "properties": {
2688
+ "runtime": {
2689
+ "type": "string",
2690
+ "enum": [
2691
+ "claude_code",
2692
+ "codex",
2693
+ "opencode",
2694
+ "copilot_cli",
2695
+ "nustack"
2696
+ ]
2697
+ },
2698
+ "model": {
2699
+ "type": "string",
2700
+ "minLength": 1,
2701
+ "maxLength": 128
2702
+ },
2703
+ "harnessSemver": {
2704
+ "type": "string",
2705
+ "maxLength": 64,
2706
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$"
2707
+ },
2708
+ "harnessDigest": {
2709
+ "type": "string",
2710
+ "pattern": "^[0-9a-f]{64}$"
2711
+ },
2712
+ "configDigest": {
2713
+ "type": "string",
2714
+ "pattern": "^[0-9a-f]{64}$"
2715
+ },
2716
+ "handover": {
2717
+ "type": "string",
2718
+ "minLength": 1,
2719
+ "maxLength": 20000
2720
+ }
2721
+ },
2722
+ "required": [
2723
+ "runtime"
2724
+ ],
2725
+ "additionalProperties": false
2726
+ },
2727
+ "TriageInput": {
2728
+ "type": "object",
2729
+ "properties": {
2730
+ "payload": {
2731
+ "type": "object",
2732
+ "properties": {
2733
+ "tracker": {
2734
+ "type": "string",
2735
+ "maxLength": 64,
2736
+ "pattern": "^[a-z][a-z0-9-]*$"
2737
+ },
2738
+ "itemRef": {
2739
+ "type": "string",
2740
+ "minLength": 1,
2741
+ "maxLength": 256
2742
+ },
2743
+ "title": {
2744
+ "type": "string",
2745
+ "minLength": 1,
2746
+ "maxLength": 20000
2747
+ },
2748
+ "summary": {
2749
+ "type": "string",
2750
+ "minLength": 1,
2751
+ "maxLength": 20000
2752
+ },
2753
+ "priority": {
2754
+ "type": "string",
2755
+ "minLength": 1,
2756
+ "maxLength": 64
2757
+ },
2758
+ "state": {
2759
+ "type": "string",
2760
+ "enum": [
2761
+ "open",
2762
+ "triaged",
2763
+ "closed"
2764
+ ]
2765
+ }
2766
+ },
2767
+ "required": [
2768
+ "tracker",
2769
+ "itemRef",
2770
+ "title",
2771
+ "state"
2772
+ ],
2773
+ "additionalProperties": false
2774
+ },
2775
+ "sessionId": {
2776
+ "type": "string",
2777
+ "minLength": 1,
2778
+ "maxLength": 128
2779
+ },
2780
+ "planAnchor": {
2781
+ "type": "string",
2782
+ "maxLength": 256,
2783
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9][a-z0-9-]*$"
2784
+ },
2785
+ "occurredAt": {
2786
+ "type": "string",
2787
+ "allOf": [
2788
+ {
2789
+ "type": "string",
2790
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
2791
+ },
2792
+ {
2793
+ "type": "string",
2794
+ "pattern": "T\\d{2}:\\d{2}:\\d{2}"
2795
+ }
2796
+ ]
2797
+ }
2798
+ },
2799
+ "required": [
2800
+ "payload"
2801
+ ],
2802
+ "additionalProperties": false
2803
+ },
2804
+ "TriagePayload": {
2805
+ "type": "object",
2806
+ "properties": {
2807
+ "tracker": {
2808
+ "type": "string",
2809
+ "maxLength": 64,
2810
+ "pattern": "^[a-z][a-z0-9-]*$"
2811
+ },
2812
+ "itemRef": {
2813
+ "type": "string",
2814
+ "minLength": 1,
2815
+ "maxLength": 256
2816
+ },
2817
+ "title": {
2818
+ "type": "string",
2819
+ "minLength": 1,
2820
+ "maxLength": 20000
2821
+ },
2822
+ "summary": {
2823
+ "type": "string",
2824
+ "minLength": 1,
2825
+ "maxLength": 20000
2826
+ },
2827
+ "priority": {
2828
+ "type": "string",
2829
+ "minLength": 1,
2830
+ "maxLength": 64
2831
+ },
2832
+ "state": {
2833
+ "type": "string",
2834
+ "enum": [
2835
+ "open",
2836
+ "triaged",
2837
+ "closed"
2838
+ ]
2839
+ }
2840
+ },
2841
+ "required": [
2842
+ "tracker",
2843
+ "itemRef",
2844
+ "title",
2845
+ "state"
2846
+ ],
2847
+ "additionalProperties": false
2848
+ }
2849
+ }
2850
+ }