@flyingrobots/parley-emit 0.0.0-stage → 0.1.0

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.
package/src/schemas.ts ADDED
@@ -0,0 +1,1408 @@
1
+ // Generated by scripts/sync-schemas.ts. Do not edit; edit schemas/ at the repository root.
2
+ export const SCHEMA_SOURCE = { commit: "7a19ddbc23d5590d119c8008807eeb4c2460f141", files: {
3
+ "parley.cache.hit.schema.json": "d5b5b7a8571a3c74f99d49de1fb75b6ce056f18438d7a9f83e976dd82178c4e8",
4
+ "parley.command.schema.json": "b496c818c7025cecb878dc50f7b97693692787609fc6da39eebd5a9da49c9782",
5
+ "parley.end.schema.json": "bebd27748368241cef9bdbc6bff3efa48ec82a5798c246a967cf73d338318bab",
6
+ "parley.error.schema.json": "66970cbe1a245947bbec234cf8f4cd2146a7c69fecd4f555bec3b1174f874b51",
7
+ "parley.page.schema.json": "86ef95b18e7ec1cddba6d337c99e8538da179ba69b000aecd6b683531a0594a6",
8
+ "parley.receipt.head.schema.json": "5728ae69c9b5abcce318bc86ecf2850936e9f09122a8f05453096b7878de79cd",
9
+ "parley.receipt.inputs.schema.json": "dbc16f662e82e8eb5024cb1454c80fc01aae8554c918427559564f91191727f7",
10
+ "parley.receipt.step.schema.json": "4bd32d020ec12f3ad5dba70031bbc70f5e5dc3f04dc20da7241b5103f112c3af",
11
+ "parley.redaction.schema.json": "8e9ab89f468456d27ad2eea0a5a366c4ff4de96471d87914af7f48715ae82d54",
12
+ "parley.run.bootstrap.schema.json": "bb565c59c45363e35820b77ed2bff68a34634b43b5892bb9092b401e56fce6a1",
13
+ "parley.schema.schema.json": "c3049368c90686b3f6cf5a32d10851a457f229b46dd2788471828a5f364b243f",
14
+ "parley.sidecar.schema.json": "fa159ce26f619a4bcb49275e2e9993b85ac75d3c8e5c28fb30917db92292fa1a",
15
+ "parley.startup.failed.schema.json": "59dc383258e3ac62e717553497fe8a6a0b7e02ccb4bec44160242a0ef4c70ef1",
16
+ "parley.warning.schema.json": "15f11264c7233c15d89f69c748d78adbe30fa7268a359a071c401950404ef619"
17
+ } } as const;
18
+ export const SCHEMAS: ReadonlyArray<{ id: string; version: string; schema: Record<string, unknown> }> = [
19
+ {
20
+ "id": "parley.cache.hit",
21
+ "version": "1.0.0",
22
+ "schema": {
23
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
24
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.cache.hit/1.0.0",
25
+ "title": "parley cache hit",
26
+ "description": "Emitted when a program answers from a prior receipt instead of recomputing (spec §2.3).",
27
+ "type": "object",
28
+ "required": [
29
+ "event",
30
+ "t",
31
+ "seq",
32
+ "run",
33
+ "inv",
34
+ "served_run",
35
+ "receipt",
36
+ "_schema"
37
+ ],
38
+ "properties": {
39
+ "event": {
40
+ "const": "cache.hit"
41
+ },
42
+ "t": {
43
+ "type": "integer",
44
+ "minimum": 0,
45
+ "description": "POSIX time in milliseconds (spec §1.3)."
46
+ },
47
+ "seq": {
48
+ "type": "integer",
49
+ "minimum": 1,
50
+ "description": "The run's single counter (spec §1.3)."
51
+ },
52
+ "run": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "description": "The execution this line belongs to (spec §2.1)."
56
+ },
57
+ "inv": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "served_run": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "description": "The run whose receipt supplied the answer."
65
+ },
66
+ "receipt": {
67
+ "type": "string",
68
+ "minLength": 1,
69
+ "description": "That receipt's path."
70
+ },
71
+ "_schema": {
72
+ "type": "object",
73
+ "required": [
74
+ "id",
75
+ "version"
76
+ ],
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "id": {
80
+ "const": "parley.cache.hit"
81
+ },
82
+ "version": {
83
+ "const": "1.0.0",
84
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ {
92
+ "id": "parley.command",
93
+ "version": "1.0.0",
94
+ "schema": {
95
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
96
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.command/1.0.0",
97
+ "title": "parley command",
98
+ "description": "A command's description: name, intent, declared effects, declared secrets and the message types it can emit (spec §4.1 to §4.3). Emitted by --schema and --help.",
99
+ "type": "object",
100
+ "required": [
101
+ "event",
102
+ "t",
103
+ "seq",
104
+ "run",
105
+ "name",
106
+ "intent",
107
+ "effects",
108
+ "secrets",
109
+ "emits",
110
+ "_schema"
111
+ ],
112
+ "properties": {
113
+ "event": {
114
+ "const": "command"
115
+ },
116
+ "t": {
117
+ "type": "integer",
118
+ "minimum": 0,
119
+ "description": "POSIX time in milliseconds (spec §1.3)."
120
+ },
121
+ "seq": {
122
+ "type": "integer",
123
+ "minimum": 1,
124
+ "description": "The run's single counter (spec §1.3)."
125
+ },
126
+ "run": {
127
+ "type": "string",
128
+ "minLength": 1,
129
+ "description": "The execution this line belongs to (spec §2.1)."
130
+ },
131
+ "name": {
132
+ "type": "string",
133
+ "minLength": 1
134
+ },
135
+ "intent": {
136
+ "type": "string",
137
+ "minLength": 1,
138
+ "description": "One line: what question the command answers."
139
+ },
140
+ "effects": {
141
+ "type": "object",
142
+ "required": [
143
+ "reads",
144
+ "writes",
145
+ "network",
146
+ "idempotent",
147
+ "bookkeeping"
148
+ ],
149
+ "properties": {
150
+ "reads": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "string",
154
+ "minLength": 1
155
+ }
156
+ },
157
+ "writes": {
158
+ "type": "array",
159
+ "items": {
160
+ "type": "string",
161
+ "minLength": 1
162
+ },
163
+ "description": "Subject-matter writes only (spec §4.3)."
164
+ },
165
+ "network": {
166
+ "type": "boolean"
167
+ },
168
+ "idempotent": {
169
+ "type": "boolean"
170
+ },
171
+ "bookkeeping": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "object",
175
+ "required": [
176
+ "op",
177
+ "scope"
178
+ ],
179
+ "properties": {
180
+ "op": {
181
+ "enum": [
182
+ "create",
183
+ "append",
184
+ "delete"
185
+ ]
186
+ },
187
+ "scope": {
188
+ "type": "string",
189
+ "minLength": 1
190
+ }
191
+ }
192
+ },
193
+ "description": "Evidence writes: receipts, sidecars, the local ignore file, retention (spec §4.3)."
194
+ }
195
+ }
196
+ },
197
+ "secrets": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "string",
201
+ "minLength": 1
202
+ },
203
+ "description": "Arguments by flag, environment variables by name, and credential sources by logical name, whose values are secrets (spec §4.3, §5.3)."
204
+ },
205
+ "emits": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "object",
209
+ "required": [
210
+ "id",
211
+ "version"
212
+ ],
213
+ "properties": {
214
+ "id": {
215
+ "type": "string",
216
+ "minLength": 1
217
+ },
218
+ "version": {
219
+ "type": "string",
220
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
221
+ }
222
+ }
223
+ },
224
+ "description": "Message types this command can emit, by exact (id, version)."
225
+ },
226
+ "_schema": {
227
+ "type": "object",
228
+ "required": [
229
+ "id",
230
+ "version"
231
+ ],
232
+ "additionalProperties": false,
233
+ "properties": {
234
+ "id": {
235
+ "const": "parley.command"
236
+ },
237
+ "version": {
238
+ "const": "1.0.0",
239
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ },
246
+ {
247
+ "id": "parley.end",
248
+ "version": "1.0.0",
249
+ "schema": {
250
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
251
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.end/1.0.0",
252
+ "title": "parley end",
253
+ "description": "The terminal event of a run that bootstrapped: written to stdout and to the receipt as one event. Its seq is the run's final sequence number (spec §3.3).",
254
+ "type": "object",
255
+ "required": [
256
+ "event",
257
+ "t",
258
+ "seq",
259
+ "run",
260
+ "status",
261
+ "receipt",
262
+ "redacted",
263
+ "_schema"
264
+ ],
265
+ "properties": {
266
+ "event": {
267
+ "const": "end"
268
+ },
269
+ "t": {
270
+ "type": "integer",
271
+ "minimum": 0,
272
+ "description": "POSIX time in milliseconds (spec §1.3)."
273
+ },
274
+ "seq": {
275
+ "type": "integer",
276
+ "minimum": 1,
277
+ "description": "The run's single counter (spec §1.3)."
278
+ },
279
+ "run": {
280
+ "type": "string",
281
+ "minLength": 1,
282
+ "description": "The execution this line belongs to (spec §2.1)."
283
+ },
284
+ "status": {
285
+ "type": "integer",
286
+ "minimum": 0,
287
+ "maximum": 255,
288
+ "not": {
289
+ "const": 3
290
+ },
291
+ "description": "The exit status the process is about to exit with (spec §3.4); never 3, since a run that could not bootstrap has no end."
292
+ },
293
+ "receipt": {
294
+ "type": "string",
295
+ "pattern": "^/",
296
+ "minLength": 2,
297
+ "description": "The receipt path, absolute, as the bootstrap line declared it."
298
+ },
299
+ "redacted": {
300
+ "type": "boolean",
301
+ "description": "True exactly when the head carries redacted or any redaction event was emitted (spec §3.3)."
302
+ },
303
+ "_schema": {
304
+ "type": "object",
305
+ "required": [
306
+ "id",
307
+ "version"
308
+ ],
309
+ "additionalProperties": false,
310
+ "properties": {
311
+ "id": {
312
+ "const": "parley.end"
313
+ },
314
+ "version": {
315
+ "const": "1.0.0",
316
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ {
324
+ "id": "parley.error",
325
+ "version": "2.0.0",
326
+ "schema": {
327
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
328
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.error/2.0.0",
329
+ "title": "parley error",
330
+ "description": "Errors are data. measured, limit and remedy are what make an error actionable in one step rather than several.",
331
+ "type": "object",
332
+ "required": [
333
+ "event",
334
+ "t",
335
+ "seq",
336
+ "run",
337
+ "code",
338
+ "problem",
339
+ "_schema"
340
+ ],
341
+ "properties": {
342
+ "event": {
343
+ "const": "error"
344
+ },
345
+ "t": {
346
+ "type": "integer",
347
+ "minimum": 0,
348
+ "description": "POSIX time in milliseconds (spec §1.3)."
349
+ },
350
+ "seq": {
351
+ "type": "integer",
352
+ "minimum": 1,
353
+ "description": "The run's single counter; 0 is the bootstrap line (spec §1.3)."
354
+ },
355
+ "run": {
356
+ "type": "string",
357
+ "minLength": 1,
358
+ "description": "The execution this line belongs to. Required on every line so a detached line can still be attributed (spec §1.3)."
359
+ },
360
+ "code": {
361
+ "type": "string",
362
+ "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$",
363
+ "description": "Stable identifier: two or more dot-separated segments of lowercase letters, digits and underscores (spec §6). Never a prose message."
364
+ },
365
+ "problem": {
366
+ "type": "string",
367
+ "minLength": 1,
368
+ "description": "What is wrong, in one sentence."
369
+ },
370
+ "measured": {
371
+ "description": "The value observed, when the failure is a threshold."
372
+ },
373
+ "limit": {
374
+ "description": "The threshold that was not met."
375
+ },
376
+ "remedy": {
377
+ "type": "string",
378
+ "description": "The lever to pull. Omit rather than invent one."
379
+ },
380
+ "remedy_target": {
381
+ "type": "string",
382
+ "description": "What the remedy applies to."
383
+ },
384
+ "retryable": {
385
+ "type": "boolean"
386
+ },
387
+ "_schema": {
388
+ "type": "object",
389
+ "required": [
390
+ "id",
391
+ "version"
392
+ ],
393
+ "additionalProperties": false,
394
+ "properties": {
395
+ "id": {
396
+ "const": "parley.error"
397
+ },
398
+ "version": {
399
+ "const": "2.0.0",
400
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
401
+ }
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ {
408
+ "id": "parley.page",
409
+ "version": "1.0.0",
410
+ "schema": {
411
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
412
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.page/1.0.0",
413
+ "title": "parley page",
414
+ "description": "One page of unbounded output; cursor required when has_more is true (spec §7.2).",
415
+ "type": "object",
416
+ "required": [
417
+ "event",
418
+ "t",
419
+ "seq",
420
+ "run",
421
+ "has_more",
422
+ "_schema"
423
+ ],
424
+ "properties": {
425
+ "event": {
426
+ "const": "page"
427
+ },
428
+ "t": {
429
+ "type": "integer",
430
+ "minimum": 0,
431
+ "description": "POSIX time in milliseconds (spec §1.3)."
432
+ },
433
+ "seq": {
434
+ "type": "integer",
435
+ "minimum": 1,
436
+ "description": "The run's single counter (spec §1.3)."
437
+ },
438
+ "run": {
439
+ "type": "string",
440
+ "minLength": 1,
441
+ "description": "The execution this line belongs to (spec §2.1)."
442
+ },
443
+ "cursor": {
444
+ "type": "string",
445
+ "minLength": 1,
446
+ "description": "Opaque to the caller."
447
+ },
448
+ "has_more": {
449
+ "type": "boolean"
450
+ },
451
+ "_schema": {
452
+ "type": "object",
453
+ "required": [
454
+ "id",
455
+ "version"
456
+ ],
457
+ "additionalProperties": false,
458
+ "properties": {
459
+ "id": {
460
+ "const": "parley.page"
461
+ },
462
+ "version": {
463
+ "const": "1.0.0",
464
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
465
+ }
466
+ }
467
+ }
468
+ },
469
+ "if": {
470
+ "type": "object",
471
+ "properties": {
472
+ "has_more": {
473
+ "const": true
474
+ }
475
+ }
476
+ },
477
+ "then": {
478
+ "type": "object",
479
+ "required": [
480
+ "cursor"
481
+ ],
482
+ "properties": {
483
+ "cursor": {
484
+ "type": "string",
485
+ "minLength": 1
486
+ }
487
+ }
488
+ }
489
+ }
490
+ },
491
+ {
492
+ "id": "parley.receipt.head",
493
+ "version": "2.0.0",
494
+ "schema": {
495
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
496
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.receipt.head/2.0.0",
497
+ "title": "parley receipt head",
498
+ "description": "First line of a receipt file. Carries what the bootstrap line deliberately omitted, so stdout stays small while the record stays complete.",
499
+ "type": "object",
500
+ "required": [
501
+ "event",
502
+ "t",
503
+ "seq",
504
+ "run",
505
+ "tool",
506
+ "v",
507
+ "argv",
508
+ "resolved",
509
+ "inputs",
510
+ "_schema"
511
+ ],
512
+ "properties": {
513
+ "event": {
514
+ "const": "receipt.head"
515
+ },
516
+ "t": {
517
+ "type": "integer",
518
+ "minimum": 0,
519
+ "description": "POSIX time in milliseconds (spec §1.3)."
520
+ },
521
+ "seq": {
522
+ "type": "integer",
523
+ "minimum": 1,
524
+ "description": "The run's single counter continues from the bootstrap line, which is seq 0 (spec §1.3)."
525
+ },
526
+ "run": {
527
+ "type": "string",
528
+ "minLength": 1,
529
+ "description": "The execution this line belongs to (spec §2.1). ULID or equivalent: unique per execution and lexicographically sortable."
530
+ },
531
+ "tool": {
532
+ "type": "string",
533
+ "minLength": 1,
534
+ "description": "The program that wrote this receipt, so a receipt read alone says what produced it (spec §5)."
535
+ },
536
+ "v": {
537
+ "type": "string",
538
+ "minLength": 1,
539
+ "description": "That program's own version; with tool, a component of the inv preimage (spec §2.2) that a receipt read alone must carry."
540
+ },
541
+ "inv": {
542
+ "type": "string",
543
+ "minLength": 1,
544
+ "description": "Content-addressed identity of the question (spec §2.2); never includes a declared secret. Optional in v0.2: supplied when the tool documents its derivation and the identity is known at this point; never a placeholder (spec §2.2)."
545
+ },
546
+ "session": {
547
+ "type": "string",
548
+ "minLength": 1
549
+ },
550
+ "argv": {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "string"
554
+ },
555
+ "description": "As received, after §5.3 redaction: a declared secret appears as the literal [redacted]."
556
+ },
557
+ "resolved": {
558
+ "type": "object",
559
+ "description": "After defaults, environment and path resolution. The gap between this and argv is where bugs live."
560
+ },
561
+ "inputs": {
562
+ "type": "array",
563
+ "description": "Every declared input as a descriptor: its path, its role when the tool distinguishes roles, and a content digest once read. A digest that arrives later is carried by receipt.inputs (spec §2.2). Credential files are never inputs (§2.2).",
564
+ "items": {
565
+ "type": "object",
566
+ "required": [
567
+ "path"
568
+ ],
569
+ "properties": {
570
+ "path": {
571
+ "type": "string",
572
+ "minLength": 1
573
+ },
574
+ "role": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ },
578
+ "sha256": {
579
+ "type": "string",
580
+ "pattern": "^[0-9a-f]{64}$"
581
+ },
582
+ "error": {
583
+ "type": "string",
584
+ "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$",
585
+ "description": "Why the input could not be read; no digest then."
586
+ }
587
+ },
588
+ "not": {
589
+ "type": "object",
590
+ "required": [
591
+ "sha256",
592
+ "error"
593
+ ],
594
+ "properties": {
595
+ "sha256": {
596
+ "type": "string"
597
+ },
598
+ "error": {
599
+ "type": "string"
600
+ }
601
+ }
602
+ }
603
+ }
604
+ },
605
+ "effects": {
606
+ "type": "object",
607
+ "properties": {
608
+ "reads": {
609
+ "type": "array",
610
+ "items": {
611
+ "type": "string"
612
+ }
613
+ },
614
+ "writes": {
615
+ "type": "array",
616
+ "items": {
617
+ "type": "string"
618
+ }
619
+ },
620
+ "network": {
621
+ "type": "boolean"
622
+ },
623
+ "idempotent": {
624
+ "type": "boolean"
625
+ }
626
+ }
627
+ },
628
+ "_schema": {
629
+ "type": "object",
630
+ "required": [
631
+ "id",
632
+ "version"
633
+ ],
634
+ "additionalProperties": false,
635
+ "properties": {
636
+ "id": {
637
+ "const": "parley.receipt.head"
638
+ },
639
+ "version": {
640
+ "const": "2.0.0",
641
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
642
+ }
643
+ }
644
+ },
645
+ "redacted": {
646
+ "type": "object",
647
+ "minProperties": 1,
648
+ "description": "Present and non-empty whenever a declared secret was supplied to the run; absent otherwise (spec §5.3). Lists where the head carries a replaced value, and which credential sources were present.",
649
+ "properties": {
650
+ "argv": {
651
+ "type": "array",
652
+ "items": {
653
+ "type": "integer",
654
+ "minimum": 0
655
+ },
656
+ "description": "Indexes into argv."
657
+ },
658
+ "resolved": {
659
+ "type": "array",
660
+ "items": {
661
+ "type": "string",
662
+ "format": "json-pointer",
663
+ "minLength": 1
664
+ },
665
+ "description": "JSON Pointers (RFC 6901) into resolved."
666
+ },
667
+ "env": {
668
+ "type": "array",
669
+ "items": {
670
+ "type": "string",
671
+ "minLength": 1
672
+ },
673
+ "description": "Names of declared environment variables that were present."
674
+ },
675
+ "inputs": {
676
+ "type": "array",
677
+ "items": {
678
+ "type": "integer",
679
+ "minimum": 0
680
+ },
681
+ "description": "Indexes into inputs whose path carried a replaced value."
682
+ },
683
+ "sources": {
684
+ "type": "array",
685
+ "items": {
686
+ "type": "string",
687
+ "minLength": 1
688
+ },
689
+ "description": "Logical names of declared credential sources that were present (spec §5.3)."
690
+ }
691
+ },
692
+ "anyOf": [
693
+ {
694
+ "type": "object",
695
+ "required": [
696
+ "argv"
697
+ ],
698
+ "properties": {
699
+ "argv": {
700
+ "type": "array",
701
+ "minItems": 1
702
+ }
703
+ }
704
+ },
705
+ {
706
+ "type": "object",
707
+ "required": [
708
+ "resolved"
709
+ ],
710
+ "properties": {
711
+ "resolved": {
712
+ "type": "array",
713
+ "minItems": 1
714
+ }
715
+ }
716
+ },
717
+ {
718
+ "type": "object",
719
+ "required": [
720
+ "inputs"
721
+ ],
722
+ "properties": {
723
+ "inputs": {
724
+ "type": "array",
725
+ "minItems": 1
726
+ }
727
+ }
728
+ },
729
+ {
730
+ "type": "object",
731
+ "required": [
732
+ "env"
733
+ ],
734
+ "properties": {
735
+ "env": {
736
+ "type": "array",
737
+ "minItems": 1
738
+ }
739
+ }
740
+ },
741
+ {
742
+ "type": "object",
743
+ "required": [
744
+ "sources"
745
+ ],
746
+ "properties": {
747
+ "sources": {
748
+ "type": "array",
749
+ "minItems": 1
750
+ }
751
+ }
752
+ }
753
+ ]
754
+ },
755
+ "dry_run": {
756
+ "type": "boolean",
757
+ "description": "True when the run performed no subject-matter writes, no mutating remote action and no retention deletion (spec §4.3). Absent means false."
758
+ }
759
+ }
760
+ }
761
+ },
762
+ {
763
+ "id": "parley.receipt.inputs",
764
+ "version": "1.0.0",
765
+ "schema": {
766
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
767
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.receipt.inputs/1.0.0",
768
+ "title": "parley receipt inputs",
769
+ "description": "The metadata-finalisation record: late input digests and, when known, inv; emitted once inputs are settled and before end (spec §2.2).",
770
+ "type": "object",
771
+ "required": [
772
+ "event",
773
+ "t",
774
+ "seq",
775
+ "run",
776
+ "inputs",
777
+ "_schema"
778
+ ],
779
+ "properties": {
780
+ "event": {
781
+ "const": "receipt.inputs"
782
+ },
783
+ "t": {
784
+ "type": "integer",
785
+ "minimum": 0,
786
+ "description": "POSIX time in milliseconds (spec §1.3)."
787
+ },
788
+ "seq": {
789
+ "type": "integer",
790
+ "minimum": 1,
791
+ "description": "The run's single counter (spec §1.3)."
792
+ },
793
+ "run": {
794
+ "type": "string",
795
+ "minLength": 1,
796
+ "description": "The execution this line belongs to (spec §2.1)."
797
+ },
798
+ "inputs": {
799
+ "type": "array",
800
+ "description": "Every declared input as a descriptor: its path, its role when the tool distinguishes roles, and a content digest once read. A digest that arrives later is carried by receipt.inputs (spec §2.2). Credential files are never inputs (§2.2).",
801
+ "items": {
802
+ "type": "object",
803
+ "required": [
804
+ "path"
805
+ ],
806
+ "properties": {
807
+ "path": {
808
+ "type": "string",
809
+ "minLength": 1
810
+ },
811
+ "role": {
812
+ "type": "string",
813
+ "minLength": 1
814
+ },
815
+ "sha256": {
816
+ "type": "string",
817
+ "pattern": "^[0-9a-f]{64}$"
818
+ },
819
+ "error": {
820
+ "type": "string",
821
+ "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$",
822
+ "description": "Why the input could not be read; no digest then."
823
+ }
824
+ },
825
+ "not": {
826
+ "type": "object",
827
+ "required": [
828
+ "sha256",
829
+ "error"
830
+ ],
831
+ "properties": {
832
+ "sha256": {
833
+ "type": "string"
834
+ },
835
+ "error": {
836
+ "type": "string"
837
+ }
838
+ }
839
+ }
840
+ }
841
+ },
842
+ "inv": {
843
+ "type": "string",
844
+ "minLength": 1,
845
+ "description": "Present when the identity could be computed (spec §2.2)."
846
+ },
847
+ "_schema": {
848
+ "type": "object",
849
+ "required": [
850
+ "id",
851
+ "version"
852
+ ],
853
+ "additionalProperties": false,
854
+ "properties": {
855
+ "id": {
856
+ "const": "parley.receipt.inputs"
857
+ },
858
+ "version": {
859
+ "const": "1.0.0",
860
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
861
+ }
862
+ }
863
+ }
864
+ }
865
+ }
866
+ },
867
+ {
868
+ "id": "parley.receipt.step",
869
+ "version": "1.0.0",
870
+ "schema": {
871
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
872
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.receipt.step/1.0.0",
873
+ "title": "parley receipt step",
874
+ "description": "One decision the program made while working, with its reason; receipt only (spec §5).",
875
+ "type": "object",
876
+ "required": [
877
+ "event",
878
+ "t",
879
+ "seq",
880
+ "run",
881
+ "decision",
882
+ "because",
883
+ "_schema"
884
+ ],
885
+ "properties": {
886
+ "event": {
887
+ "const": "receipt.step"
888
+ },
889
+ "t": {
890
+ "type": "integer",
891
+ "minimum": 0,
892
+ "description": "POSIX time in milliseconds (spec §1.3)."
893
+ },
894
+ "seq": {
895
+ "type": "integer",
896
+ "minimum": 1,
897
+ "description": "The run's single counter (spec §1.3)."
898
+ },
899
+ "run": {
900
+ "type": "string",
901
+ "minLength": 1,
902
+ "description": "The execution this line belongs to (spec §2.1)."
903
+ },
904
+ "decision": {
905
+ "type": "string",
906
+ "minLength": 1
907
+ },
908
+ "because": {
909
+ "type": "string",
910
+ "minLength": 1
911
+ },
912
+ "detail": {
913
+ "type": "object"
914
+ },
915
+ "_schema": {
916
+ "type": "object",
917
+ "required": [
918
+ "id",
919
+ "version"
920
+ ],
921
+ "additionalProperties": false,
922
+ "properties": {
923
+ "id": {
924
+ "const": "parley.receipt.step"
925
+ },
926
+ "version": {
927
+ "const": "1.0.0",
928
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
929
+ }
930
+ }
931
+ }
932
+ }
933
+ }
934
+ },
935
+ {
936
+ "id": "parley.redaction",
937
+ "version": "1.0.0",
938
+ "schema": {
939
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
940
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.redaction/1.0.0",
941
+ "title": "parley redaction",
942
+ "description": "A receipt line recording a redaction not covered by the head's redacted field: in the head itself (in: 1) or in any later record or sidecar (spec §5.3).",
943
+ "type": "object",
944
+ "required": [
945
+ "event",
946
+ "t",
947
+ "seq",
948
+ "run",
949
+ "in",
950
+ "at",
951
+ "_schema"
952
+ ],
953
+ "properties": {
954
+ "event": {
955
+ "const": "redaction"
956
+ },
957
+ "t": {
958
+ "type": "integer",
959
+ "minimum": 0,
960
+ "description": "POSIX time in milliseconds (spec §1.3)."
961
+ },
962
+ "seq": {
963
+ "type": "integer",
964
+ "minimum": 1,
965
+ "description": "The run's single counter (spec §1.3)."
966
+ },
967
+ "run": {
968
+ "type": "string",
969
+ "minLength": 1,
970
+ "description": "The execution this line belongs to (spec §2.1)."
971
+ },
972
+ "in": {
973
+ "type": "integer",
974
+ "minimum": 1,
975
+ "description": "The seq of the affected record: the head, a result, an error, a reasoning line, or the stored record a sidecar holds (its source)."
976
+ },
977
+ "at": {
978
+ "type": "string",
979
+ "format": "json-pointer",
980
+ "minLength": 1,
981
+ "description": "JSON Pointer (RFC 6901) within that record."
982
+ },
983
+ "_schema": {
984
+ "type": "object",
985
+ "required": [
986
+ "id",
987
+ "version"
988
+ ],
989
+ "additionalProperties": false,
990
+ "properties": {
991
+ "id": {
992
+ "const": "parley.redaction"
993
+ },
994
+ "version": {
995
+ "const": "1.0.0",
996
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
997
+ }
998
+ }
999
+ }
1000
+ }
1001
+ }
1002
+ },
1003
+ {
1004
+ "id": "parley.run.bootstrap",
1005
+ "version": "1.1.1",
1006
+ "schema": {
1007
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1008
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.run.bootstrap/1.1.1",
1009
+ "title": "parley run bootstrap",
1010
+ "description": "First line of stdout, emitted before work begins so a crashed run still names its receipt.",
1011
+ "type": "object",
1012
+ "required": [
1013
+ "event",
1014
+ "t",
1015
+ "seq",
1016
+ "tool",
1017
+ "v",
1018
+ "run",
1019
+ "paths",
1020
+ "_schema"
1021
+ ],
1022
+ "properties": {
1023
+ "event": {
1024
+ "const": "run"
1025
+ },
1026
+ "t": {
1027
+ "type": "integer",
1028
+ "minimum": 0,
1029
+ "description": "POSIX time in milliseconds (spec §1.3)."
1030
+ },
1031
+ "seq": {
1032
+ "const": 0,
1033
+ "description": "The bootstrap line is always the first line the run emits, so it is the only line with a pinned seq."
1034
+ },
1035
+ "tool": {
1036
+ "type": "string",
1037
+ "minLength": 1
1038
+ },
1039
+ "v": {
1040
+ "type": "string",
1041
+ "description": "The program's own version, distinct from _schema.version on the same line (spec §3).",
1042
+ "minLength": 1
1043
+ },
1044
+ "inv": {
1045
+ "type": "string",
1046
+ "description": "Content-addressed identity of the question: tool, version, normalised args, and the bytes of every declared input; never a declared secret (spec §2.2, §5.3). Optional in v0.2: supplied when the tool documents its derivation and the identity is known at this point; never a placeholder (spec §2.2).",
1047
+ "minLength": 1
1048
+ },
1049
+ "run": {
1050
+ "type": "string",
1051
+ "minLength": 1,
1052
+ "description": "Unique, lexicographically sortable identity of this execution."
1053
+ },
1054
+ "session": {
1055
+ "type": "string",
1056
+ "description": "Working period spanning runs. Supplied by the caller or inherited.",
1057
+ "minLength": 1
1058
+ },
1059
+ "paths": {
1060
+ "type": "object",
1061
+ "required": [
1062
+ "receipt"
1063
+ ],
1064
+ "properties": {
1065
+ "receipt": {
1066
+ "type": "string",
1067
+ "pattern": "^/",
1068
+ "minLength": 2,
1069
+ "description": "Absolute path of the receipt file for this run (spec §5). The only path the protocol defines; a program may add others it documents."
1070
+ }
1071
+ },
1072
+ "description": "Files this run writes."
1073
+ },
1074
+ "_schema": {
1075
+ "type": "object",
1076
+ "required": [
1077
+ "id",
1078
+ "version"
1079
+ ],
1080
+ "additionalProperties": false,
1081
+ "properties": {
1082
+ "id": {
1083
+ "const": "parley.run.bootstrap"
1084
+ },
1085
+ "version": {
1086
+ "const": "1.1.1",
1087
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
1088
+ }
1089
+ }
1090
+ },
1091
+ "dry_run": {
1092
+ "type": "boolean",
1093
+ "description": "True when the run performed no subject-matter writes, no mutating remote action and no retention deletion (spec §4.3). Absent means false."
1094
+ }
1095
+ }
1096
+ }
1097
+ },
1098
+ {
1099
+ "id": "parley.schema",
1100
+ "version": "1.0.0",
1101
+ "schema": {
1102
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1103
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.schema/1.0.0",
1104
+ "title": "parley schema",
1105
+ "description": "One message schema, carried by --schema and --help (spec §4.1, §4.2).",
1106
+ "type": "object",
1107
+ "required": [
1108
+ "event",
1109
+ "t",
1110
+ "seq",
1111
+ "run",
1112
+ "id",
1113
+ "version",
1114
+ "schema",
1115
+ "_schema"
1116
+ ],
1117
+ "properties": {
1118
+ "event": {
1119
+ "const": "schema"
1120
+ },
1121
+ "t": {
1122
+ "type": "integer",
1123
+ "minimum": 0,
1124
+ "description": "POSIX time in milliseconds (spec §1.3)."
1125
+ },
1126
+ "seq": {
1127
+ "type": "integer",
1128
+ "minimum": 1,
1129
+ "description": "The run's single counter (spec §1.3)."
1130
+ },
1131
+ "run": {
1132
+ "type": "string",
1133
+ "minLength": 1,
1134
+ "description": "The execution this line belongs to (spec §2.1)."
1135
+ },
1136
+ "id": {
1137
+ "type": "string",
1138
+ "minLength": 1
1139
+ },
1140
+ "version": {
1141
+ "type": "string",
1142
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
1143
+ },
1144
+ "schema": {
1145
+ "type": "object",
1146
+ "description": "The JSON Schema document for that exact (id, version)."
1147
+ },
1148
+ "_schema": {
1149
+ "type": "object",
1150
+ "required": [
1151
+ "id",
1152
+ "version"
1153
+ ],
1154
+ "additionalProperties": false,
1155
+ "properties": {
1156
+ "id": {
1157
+ "const": "parley.schema"
1158
+ },
1159
+ "version": {
1160
+ "const": "1.0.0",
1161
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
1162
+ }
1163
+ }
1164
+ }
1165
+ }
1166
+ }
1167
+ },
1168
+ {
1169
+ "id": "parley.sidecar",
1170
+ "version": "1.0.0",
1171
+ "schema": {
1172
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1173
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.sidecar/1.0.0",
1174
+ "title": "parley sidecar",
1175
+ "description": "A receipt line standing in for a record stored beside the receipt because it exceeded the inline threshold (spec §5).",
1176
+ "type": "object",
1177
+ "required": [
1178
+ "event",
1179
+ "t",
1180
+ "seq",
1181
+ "run",
1182
+ "source",
1183
+ "path",
1184
+ "bytes",
1185
+ "sha256",
1186
+ "_schema"
1187
+ ],
1188
+ "properties": {
1189
+ "event": {
1190
+ "const": "sidecar"
1191
+ },
1192
+ "t": {
1193
+ "type": "integer",
1194
+ "minimum": 0,
1195
+ "description": "POSIX time in milliseconds (spec §1.3)."
1196
+ },
1197
+ "seq": {
1198
+ "type": "integer",
1199
+ "minimum": 1,
1200
+ "description": "The run's single counter (spec §1.3)."
1201
+ },
1202
+ "run": {
1203
+ "type": "string",
1204
+ "minLength": 1,
1205
+ "description": "The execution this line belongs to (spec §2.1)."
1206
+ },
1207
+ "source": {
1208
+ "type": "integer",
1209
+ "minimum": 1,
1210
+ "description": "The seq of the record the sidecar holds."
1211
+ },
1212
+ "path": {
1213
+ "type": "string",
1214
+ "minLength": 1,
1215
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$)).+$",
1216
+ "description": "Relative to the receipt's directory; never absolute, never escaping it."
1217
+ },
1218
+ "bytes": {
1219
+ "type": "integer",
1220
+ "minimum": 0,
1221
+ "description": "Length of the stored bytes."
1222
+ },
1223
+ "sha256": {
1224
+ "type": "string",
1225
+ "pattern": "^[0-9a-f]{64}$",
1226
+ "description": "SHA-256 of the stored bytes; not the semantic digest of §7.1."
1227
+ },
1228
+ "_schema": {
1229
+ "type": "object",
1230
+ "required": [
1231
+ "id",
1232
+ "version"
1233
+ ],
1234
+ "additionalProperties": false,
1235
+ "properties": {
1236
+ "id": {
1237
+ "const": "parley.sidecar"
1238
+ },
1239
+ "version": {
1240
+ "const": "1.0.0",
1241
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
1242
+ }
1243
+ }
1244
+ }
1245
+ }
1246
+ }
1247
+ },
1248
+ {
1249
+ "id": "parley.startup.failed",
1250
+ "version": "1.0.0",
1251
+ "schema": {
1252
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1253
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.startup.failed/1.0.0",
1254
+ "title": "parley startup failed",
1255
+ "description": "The single line a run emits, on stderr, when it cannot reach the bootstrap line; exit status 3 (spec §3.2).",
1256
+ "type": "object",
1257
+ "required": [
1258
+ "event",
1259
+ "t",
1260
+ "seq",
1261
+ "run",
1262
+ "tool",
1263
+ "v",
1264
+ "code",
1265
+ "problem",
1266
+ "_schema"
1267
+ ],
1268
+ "properties": {
1269
+ "event": {
1270
+ "const": "startup.failed"
1271
+ },
1272
+ "t": {
1273
+ "type": "integer",
1274
+ "minimum": 0
1275
+ },
1276
+ "seq": {
1277
+ "const": 0,
1278
+ "description": "The only line the run emits (spec §1.3, §3.2)."
1279
+ },
1280
+ "run": {
1281
+ "type": "string",
1282
+ "minLength": 1
1283
+ },
1284
+ "tool": {
1285
+ "type": "string",
1286
+ "minLength": 1
1287
+ },
1288
+ "v": {
1289
+ "type": "string",
1290
+ "minLength": 1
1291
+ },
1292
+ "code": {
1293
+ "type": "string",
1294
+ "pattern": "^startup\\.[a-z0-9_]+(\\.[a-z0-9_]+)*$",
1295
+ "description": "A §6 code in the startup namespace."
1296
+ },
1297
+ "problem": {
1298
+ "type": "string",
1299
+ "minLength": 1
1300
+ },
1301
+ "remedy": {
1302
+ "type": "string"
1303
+ },
1304
+ "remedy_target": {
1305
+ "type": "string"
1306
+ },
1307
+ "_schema": {
1308
+ "type": "object",
1309
+ "required": [
1310
+ "id",
1311
+ "version"
1312
+ ],
1313
+ "additionalProperties": false,
1314
+ "properties": {
1315
+ "id": {
1316
+ "const": "parley.startup.failed"
1317
+ },
1318
+ "version": {
1319
+ "const": "1.0.0",
1320
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
1321
+ }
1322
+ }
1323
+ }
1324
+ }
1325
+ }
1326
+ },
1327
+ {
1328
+ "id": "parley.warning",
1329
+ "version": "1.0.0",
1330
+ "schema": {
1331
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1332
+ "$id": "https://flyingrobots.dev/parley/schemas/parley.warning/1.0.0",
1333
+ "title": "parley warning",
1334
+ "description": "A recovered condition: the same shape as an error, on stderr and in the receipt, never changing the exit status (spec §6.1).",
1335
+ "type": "object",
1336
+ "required": [
1337
+ "event",
1338
+ "t",
1339
+ "seq",
1340
+ "run",
1341
+ "code",
1342
+ "problem",
1343
+ "_schema"
1344
+ ],
1345
+ "properties": {
1346
+ "event": {
1347
+ "const": "warning"
1348
+ },
1349
+ "t": {
1350
+ "type": "integer",
1351
+ "minimum": 0,
1352
+ "description": "POSIX time in milliseconds (spec §1.3)."
1353
+ },
1354
+ "seq": {
1355
+ "type": "integer",
1356
+ "minimum": 1,
1357
+ "description": "The run's single counter; 0 is the bootstrap line (spec §1.3)."
1358
+ },
1359
+ "run": {
1360
+ "type": "string",
1361
+ "minLength": 1,
1362
+ "description": "The execution this line belongs to. Required on every line so a detached line can still be attributed (spec §1.3)."
1363
+ },
1364
+ "code": {
1365
+ "type": "string",
1366
+ "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$",
1367
+ "description": "Stable identifier: two or more dot-separated segments of lowercase letters, digits and underscores (spec §6). Never a prose message."
1368
+ },
1369
+ "problem": {
1370
+ "type": "string",
1371
+ "minLength": 1,
1372
+ "description": "What is wrong, in one sentence."
1373
+ },
1374
+ "measured": {
1375
+ "description": "The value observed, when the failure is a threshold."
1376
+ },
1377
+ "limit": {
1378
+ "description": "The threshold that was not met."
1379
+ },
1380
+ "remedy": {
1381
+ "type": "string",
1382
+ "description": "The lever to pull. Omit rather than invent one."
1383
+ },
1384
+ "remedy_target": {
1385
+ "type": "string",
1386
+ "description": "What the remedy applies to."
1387
+ },
1388
+ "_schema": {
1389
+ "type": "object",
1390
+ "required": [
1391
+ "id",
1392
+ "version"
1393
+ ],
1394
+ "additionalProperties": false,
1395
+ "properties": {
1396
+ "id": {
1397
+ "const": "parley.warning"
1398
+ },
1399
+ "version": {
1400
+ "const": "1.0.0",
1401
+ "description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
1402
+ }
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+ }
1408
+ ];