@flyingrobots/parley-emit 0.1.0 → 0.2.4
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/CHANGELOG.md +295 -0
- package/README.md +517 -15
- package/package.json +1 -1
- package/src/check.ts +198 -0
- package/src/history.ts +229 -0
- package/src/index.ts +7 -1
- package/src/location.ts +47 -4
- package/src/refusal.ts +54 -0
- package/src/run.ts +279 -15
- package/src/schemas.ts +635 -1
- package/src/tool.ts +160 -25
- package/src/transforms/declared.ts +49 -0
- package/src/transforms/secret-patterns.ts +84 -0
- package/src/transforms/secrets.ts +153 -0
package/src/schemas.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// Generated by scripts/sync-schemas.ts. Do not edit; edit schemas/ at the repository root.
|
|
2
|
-
export const SCHEMA_SOURCE = { commit: "
|
|
2
|
+
export const SCHEMA_SOURCE = { commit: "58c42ad4afed81a04662bd0bada901b405bdc961", files: {
|
|
3
3
|
"parley.cache.hit.schema.json": "d5b5b7a8571a3c74f99d49de1fb75b6ce056f18438d7a9f83e976dd82178c4e8",
|
|
4
4
|
"parley.command.schema.json": "b496c818c7025cecb878dc50f7b97693692787609fc6da39eebd5a9da49c9782",
|
|
5
5
|
"parley.end.schema.json": "bebd27748368241cef9bdbc6bff3efa48ec82a5798c246a967cf73d338318bab",
|
|
6
6
|
"parley.error.schema.json": "66970cbe1a245947bbec234cf8f4cd2146a7c69fecd4f555bec3b1174f874b51",
|
|
7
|
+
"parley.history.transform.schema.json": "36b03c4c80fa55f2584f61b0e2c1a3453fc2c742da8720510cb99fafd6861fcf",
|
|
8
|
+
"parley.lens.schema.json": "8718c8121c9c86e5ae54a293c6cd1b6f3fa47ac37d3095c27dc39dea98515e8c",
|
|
7
9
|
"parley.page.schema.json": "86ef95b18e7ec1cddba6d337c99e8538da179ba69b000aecd6b683531a0594a6",
|
|
10
|
+
"parley.query.schema.json": "9ddceb209513d0d069c147c862d7bf5aa9ff93a8b0c68607b94b08d8db26ba07",
|
|
8
11
|
"parley.receipt.head.schema.json": "5728ae69c9b5abcce318bc86ecf2850936e9f09122a8f05453096b7878de79cd",
|
|
9
12
|
"parley.receipt.inputs.schema.json": "dbc16f662e82e8eb5024cb1454c80fc01aae8554c918427559564f91191727f7",
|
|
10
13
|
"parley.receipt.step.schema.json": "4bd32d020ec12f3ad5dba70031bbc70f5e5dc3f04dc20da7241b5103f112c3af",
|
|
@@ -404,6 +407,466 @@ export const SCHEMAS: ReadonlyArray<{ id: string; version: string; schema: Recor
|
|
|
404
407
|
}
|
|
405
408
|
}
|
|
406
409
|
},
|
|
410
|
+
{
|
|
411
|
+
"id": "parley.history.transform",
|
|
412
|
+
"version": "1.0.0",
|
|
413
|
+
"schema": {
|
|
414
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
415
|
+
"$id": "https://flyingrobots.dev/parley/schemas/parley.history.transform/1.0.0",
|
|
416
|
+
"title": "parley history transform",
|
|
417
|
+
"description": "The opening line of a projected copy of a run on the shared history stream: every line of this run that follows on this stream is a projection of the receipt copy by the named transform, so a reader can tell a projected copy from a whole one and by what (spec §8, informative). Stream only: the receipt copy is never projected and never carries this line.",
|
|
418
|
+
"type": "object",
|
|
419
|
+
"required": [
|
|
420
|
+
"event",
|
|
421
|
+
"t",
|
|
422
|
+
"seq",
|
|
423
|
+
"run",
|
|
424
|
+
"name",
|
|
425
|
+
"sha256",
|
|
426
|
+
"_schema"
|
|
427
|
+
],
|
|
428
|
+
"properties": {
|
|
429
|
+
"event": {
|
|
430
|
+
"const": "history.transform"
|
|
431
|
+
},
|
|
432
|
+
"t": {
|
|
433
|
+
"type": "integer",
|
|
434
|
+
"minimum": 0,
|
|
435
|
+
"description": "POSIX time in milliseconds (spec §1.3)."
|
|
436
|
+
},
|
|
437
|
+
"seq": {
|
|
438
|
+
"type": "integer",
|
|
439
|
+
"minimum": 1,
|
|
440
|
+
"description": "The run's single counter (spec §1.3). This line takes a seq of its own and reaches no other sink, so the receipt copy has no line at this seq."
|
|
441
|
+
},
|
|
442
|
+
"run": {
|
|
443
|
+
"type": "string",
|
|
444
|
+
"minLength": 1,
|
|
445
|
+
"description": "The execution whose copy on this stream is a projection (spec §2.1)."
|
|
446
|
+
},
|
|
447
|
+
"name": {
|
|
448
|
+
"type": "string",
|
|
449
|
+
"minLength": 1,
|
|
450
|
+
"description": "What the transform is called: the name its configuration gave it, or the function's own name."
|
|
451
|
+
},
|
|
452
|
+
"sha256": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
455
|
+
"description": "SHA-256, hex, of the transform's source text as the runtime renders it. It tells two projections apart and pins which one wrote this copy; it is not a build identity, and nothing fetches it."
|
|
456
|
+
},
|
|
457
|
+
"_schema": {
|
|
458
|
+
"type": "object",
|
|
459
|
+
"required": [
|
|
460
|
+
"id",
|
|
461
|
+
"version"
|
|
462
|
+
],
|
|
463
|
+
"additionalProperties": false,
|
|
464
|
+
"properties": {
|
|
465
|
+
"id": {
|
|
466
|
+
"const": "parley.history.transform"
|
|
467
|
+
},
|
|
468
|
+
"version": {
|
|
469
|
+
"const": "1.0.0",
|
|
470
|
+
"description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"id": "parley.lens",
|
|
479
|
+
"version": "1.0.0",
|
|
480
|
+
"schema": {
|
|
481
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
482
|
+
"$id": "https://flyingrobots.dev/parley/schemas/parley.lens/1.0.0",
|
|
483
|
+
"title": "parley lens",
|
|
484
|
+
"description": "The lens a result carries: the asker, the view, the budget and the window that produced it, the query it answers, a stated bound on what the view loses, and the records it was built from by (run, seq) (spec §9, informative; decided in flyingrobots/parley#46). One lens line precedes the result it describes, so a later reader knows what it is looking at and can get back to the records.",
|
|
485
|
+
"type": "object",
|
|
486
|
+
"required": [
|
|
487
|
+
"event",
|
|
488
|
+
"t",
|
|
489
|
+
"seq",
|
|
490
|
+
"run",
|
|
491
|
+
"query",
|
|
492
|
+
"asker",
|
|
493
|
+
"view",
|
|
494
|
+
"budget",
|
|
495
|
+
"window",
|
|
496
|
+
"loss",
|
|
497
|
+
"records",
|
|
498
|
+
"_schema"
|
|
499
|
+
],
|
|
500
|
+
"properties": {
|
|
501
|
+
"event": {
|
|
502
|
+
"const": "lens"
|
|
503
|
+
},
|
|
504
|
+
"t": {
|
|
505
|
+
"type": "integer",
|
|
506
|
+
"minimum": 0,
|
|
507
|
+
"description": "POSIX time in milliseconds (spec §1.3)."
|
|
508
|
+
},
|
|
509
|
+
"seq": {
|
|
510
|
+
"type": "integer",
|
|
511
|
+
"minimum": 1,
|
|
512
|
+
"description": "The run's single counter (spec §1.3)."
|
|
513
|
+
},
|
|
514
|
+
"run": {
|
|
515
|
+
"type": "string",
|
|
516
|
+
"minLength": 1,
|
|
517
|
+
"description": "The execution this line belongs to: the read itself, not the runs being read (spec §2.1)."
|
|
518
|
+
},
|
|
519
|
+
"session": {
|
|
520
|
+
"type": "string",
|
|
521
|
+
"minLength": 1,
|
|
522
|
+
"description": "Working period spanning runs. Supplied by the caller or inherited; never invented (spec §2.1)."
|
|
523
|
+
},
|
|
524
|
+
"query": {
|
|
525
|
+
"type": "object",
|
|
526
|
+
"required": [
|
|
527
|
+
"run",
|
|
528
|
+
"seq"
|
|
529
|
+
],
|
|
530
|
+
"properties": {
|
|
531
|
+
"run": {
|
|
532
|
+
"type": "string",
|
|
533
|
+
"minLength": 1
|
|
534
|
+
},
|
|
535
|
+
"seq": {
|
|
536
|
+
"type": "integer",
|
|
537
|
+
"minimum": 1
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"description": "The recorded query this result answers, by (run, seq). Required: §9 records every query, and a result whose query was not recorded cannot be audited."
|
|
541
|
+
},
|
|
542
|
+
"asker": {
|
|
543
|
+
"type": "object",
|
|
544
|
+
"required": [
|
|
545
|
+
"tool"
|
|
546
|
+
],
|
|
547
|
+
"properties": {
|
|
548
|
+
"tool": {
|
|
549
|
+
"type": "string",
|
|
550
|
+
"minLength": 1
|
|
551
|
+
},
|
|
552
|
+
"cwd": {
|
|
553
|
+
"type": "string",
|
|
554
|
+
"pattern": "^/",
|
|
555
|
+
"minLength": 2
|
|
556
|
+
},
|
|
557
|
+
"task": {
|
|
558
|
+
"type": "string",
|
|
559
|
+
"minLength": 1
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
"description": "Echoed from the query: who the result is for."
|
|
563
|
+
},
|
|
564
|
+
"view": {
|
|
565
|
+
"enum": [
|
|
566
|
+
"what-ran",
|
|
567
|
+
"what-failed",
|
|
568
|
+
"what-changed",
|
|
569
|
+
"how-it-decided",
|
|
570
|
+
"everything"
|
|
571
|
+
],
|
|
572
|
+
"description": "The view this result is. Echoed from the query, from the same closed set."
|
|
573
|
+
},
|
|
574
|
+
"budget": {
|
|
575
|
+
"type": "object",
|
|
576
|
+
"required": [
|
|
577
|
+
"records"
|
|
578
|
+
],
|
|
579
|
+
"properties": {
|
|
580
|
+
"records": {
|
|
581
|
+
"type": "integer",
|
|
582
|
+
"minimum": 1
|
|
583
|
+
},
|
|
584
|
+
"bytes": {
|
|
585
|
+
"type": "integer",
|
|
586
|
+
"minimum": 1
|
|
587
|
+
},
|
|
588
|
+
"ms": {
|
|
589
|
+
"type": "integer",
|
|
590
|
+
"minimum": 1
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
"description": "The budget actually applied, including a default the query did not supply. Constitutive, not decoration: two results computed under different budgets are not comparable, so a lens without it does not identify the view that produced the result."
|
|
594
|
+
},
|
|
595
|
+
"window": {
|
|
596
|
+
"type": "object",
|
|
597
|
+
"required": [
|
|
598
|
+
"from",
|
|
599
|
+
"to"
|
|
600
|
+
],
|
|
601
|
+
"properties": {
|
|
602
|
+
"from": {
|
|
603
|
+
"type": "integer",
|
|
604
|
+
"minimum": 0
|
|
605
|
+
},
|
|
606
|
+
"to": {
|
|
607
|
+
"type": "integer",
|
|
608
|
+
"minimum": 0
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"description": "The stretch of history the result covers, echoed from the query."
|
|
612
|
+
},
|
|
613
|
+
"loss": {
|
|
614
|
+
"type": "object",
|
|
615
|
+
"required": [
|
|
616
|
+
"bound",
|
|
617
|
+
"excluded"
|
|
618
|
+
],
|
|
619
|
+
"properties": {
|
|
620
|
+
"bound": {
|
|
621
|
+
"enum": [
|
|
622
|
+
"none",
|
|
623
|
+
"count-only"
|
|
624
|
+
],
|
|
625
|
+
"description": "What kind of statement the loss is. none: nothing in the window was left out, so the result and the window hold the same records and excluded must be 0. Not restricted to the identity view: a view orders a result and filters none of it (flyingrobots/parley#49), so any view whose result reached the end of its order lost nothing. count-only: the excluded count is all that is known, which is a weak proxy. A measured distortion bound needs a translator to measure it and is a later version of this schema."
|
|
626
|
+
},
|
|
627
|
+
"excluded": {
|
|
628
|
+
"type": "integer",
|
|
629
|
+
"minimum": 0,
|
|
630
|
+
"description": "How many records in the window the view did not name, whatever left them out: the budget, or a fold (folded). A proxy and a weak one: one withheld record can matter more than fifty, so this count cannot bound what the view loses."
|
|
631
|
+
},
|
|
632
|
+
"folded": {
|
|
633
|
+
"type": "integer",
|
|
634
|
+
"minimum": 0,
|
|
635
|
+
"description": "How many of excluded were left out because their run was folded into another run of the same invocation and the same result, rather than by the budget (flyingrobots/parley#79): the records of every run a runs section's folded stands for, other than the section's own. It depends on the window alone, never on the budget, so excluded minus folded is what the budget cut. At most excluded, which a schema cannot check; a reader can. Optional so that lines written under the earlier drafts still validate; parley-read always writes it, 0 included."
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"description": "What the view loses against the records it was built from, so a later reader knows which questions this result can still answer and cannot mistake a digest for the whole. A digest that folded runs names fewer records than it stands for, and says how many in folded."
|
|
639
|
+
},
|
|
640
|
+
"runs": {
|
|
641
|
+
"type": "array",
|
|
642
|
+
"items": {
|
|
643
|
+
"type": "object",
|
|
644
|
+
"required": [
|
|
645
|
+
"run"
|
|
646
|
+
],
|
|
647
|
+
"properties": {
|
|
648
|
+
"run": {
|
|
649
|
+
"type": "string",
|
|
650
|
+
"minLength": 1,
|
|
651
|
+
"description": "The run this section is about: one that records names."
|
|
652
|
+
},
|
|
653
|
+
"tool": {
|
|
654
|
+
"type": "string",
|
|
655
|
+
"minLength": 1,
|
|
656
|
+
"description": "The run's receipt head's tool (spec §5), as the loader read it."
|
|
657
|
+
},
|
|
658
|
+
"v": {
|
|
659
|
+
"type": "string",
|
|
660
|
+
"minLength": 1,
|
|
661
|
+
"description": "The run's receipt head's v (spec §5), as the loader read it."
|
|
662
|
+
},
|
|
663
|
+
"argv": {
|
|
664
|
+
"type": "array",
|
|
665
|
+
"items": {
|
|
666
|
+
"type": "string"
|
|
667
|
+
},
|
|
668
|
+
"description": "The run's receipt head's argv (spec §5), already redacted there (spec §5.3). Never cut part-way: when it does not fit the section's bound it is dropped whole and named in dropped."
|
|
669
|
+
},
|
|
670
|
+
"resolved": {
|
|
671
|
+
"type": "object",
|
|
672
|
+
"description": "The run's receipt head's resolved (spec §5): its interpretation after defaults, environment and path resolution, copied whole and already redacted there (spec §5.3), so a reader can tell, say, which commits a run compared without opening the head (flyingrobots/parley#90). Its shape is the tool's; the reader chooses none of its keys. Never cut part-way: when it does not fit the section's bound it is dropped whole, first of all fields, and named in dropped. Absent when the window does not hold the head or the head's resolved is not an object."
|
|
673
|
+
},
|
|
674
|
+
"inv": {
|
|
675
|
+
"type": "string",
|
|
676
|
+
"minLength": 1,
|
|
677
|
+
"description": "The run's inv (spec §2.2): the head's, or else the window's receipt.inputs for the run. Absent when neither carries one; never a placeholder."
|
|
678
|
+
},
|
|
679
|
+
"outcome": {
|
|
680
|
+
"enum": [
|
|
681
|
+
"failed",
|
|
682
|
+
"undetermined",
|
|
683
|
+
"succeeded"
|
|
684
|
+
],
|
|
685
|
+
"description": "What the records in the window establish about the run: failed for an error, a startup failure or a non-zero end; succeeded for an end of 0 and nothing against it; undetermined otherwise (spec §1.2a). It is the window's verdict, not the digest's: a run whose end the bound cut is still succeeded. Absent when the reader established none."
|
|
686
|
+
},
|
|
687
|
+
"reason": {
|
|
688
|
+
"enum": [
|
|
689
|
+
"no_end_in_window",
|
|
690
|
+
"end_status_unusable"
|
|
691
|
+
],
|
|
692
|
+
"description": "Why the outcome is undetermined, present exactly when it is. no_end_in_window: the window holds no end for the run, which cannot say whether the run ended later or never did. end_status_unusable: the window holds an end whose status is not a number."
|
|
693
|
+
},
|
|
694
|
+
"head": {
|
|
695
|
+
"const": "not_in_window",
|
|
696
|
+
"description": "Present when the window does not hold the run's receipt head, so tool, v and argv are not known from it. Absent when it does."
|
|
697
|
+
},
|
|
698
|
+
"folded": {
|
|
699
|
+
"type": "object",
|
|
700
|
+
"required": [
|
|
701
|
+
"others",
|
|
702
|
+
"records"
|
|
703
|
+
],
|
|
704
|
+
"properties": {
|
|
705
|
+
"others": {
|
|
706
|
+
"type": "integer",
|
|
707
|
+
"minimum": 1,
|
|
708
|
+
"description": "How many other runs this section stands for, this run excluded: the section reads as this run plus others like it, so it stands for others + 1 runs (flyingrobots/parley#100)."
|
|
709
|
+
},
|
|
710
|
+
"records": {
|
|
711
|
+
"type": "integer",
|
|
712
|
+
"minimum": 0,
|
|
713
|
+
"description": "How many records of those other runs, in the window, the fold left out of records, this run's own excluded; each is counted in loss.excluded and loss.folded."
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
"description": "Present when this run stands for other runs of the same invocation and the same result (flyingrobots/parley#79): runs with an equal inv (spec §2.2) whose outcome, reason, end status and error, warning and startup-failure codes are equal too. This run is the most recent of them, and the others' records are not named. A run with no inv, and a redacted run, never stands for another (spec §2.3). A run that stands for no other has no folded. The folded runs' ids are not listed, to keep the line small: a read of a window that holds one of them without this run, or a load of the window, finds them. Never dropped to fit the section's bound."
|
|
717
|
+
},
|
|
718
|
+
"dropped": {
|
|
719
|
+
"type": "array",
|
|
720
|
+
"minItems": 1,
|
|
721
|
+
"items": {
|
|
722
|
+
"enum": [
|
|
723
|
+
"resolved",
|
|
724
|
+
"argv",
|
|
725
|
+
"inv",
|
|
726
|
+
"v",
|
|
727
|
+
"tool"
|
|
728
|
+
]
|
|
729
|
+
},
|
|
730
|
+
"description": "The fields left out, whole, to bound the section's serialised JSON, in the order they were dropped, each at most once: resolved, then argv, then inv, then v, then tool. The bound is the reader's to state (parley-read: 512 UTF-8 bytes); a string or an object is never cut part-way.",
|
|
731
|
+
"maxItems": 5
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
"if": {
|
|
735
|
+
"type": "object",
|
|
736
|
+
"required": [
|
|
737
|
+
"outcome"
|
|
738
|
+
],
|
|
739
|
+
"properties": {
|
|
740
|
+
"outcome": {
|
|
741
|
+
"const": "undetermined"
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"then": {
|
|
746
|
+
"type": "object",
|
|
747
|
+
"required": [
|
|
748
|
+
"reason"
|
|
749
|
+
],
|
|
750
|
+
"properties": {
|
|
751
|
+
"reason": {
|
|
752
|
+
"enum": [
|
|
753
|
+
"no_end_in_window",
|
|
754
|
+
"end_status_unusable"
|
|
755
|
+
]
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
"else": {
|
|
760
|
+
"not": {
|
|
761
|
+
"type": "object",
|
|
762
|
+
"required": [
|
|
763
|
+
"reason"
|
|
764
|
+
],
|
|
765
|
+
"properties": {
|
|
766
|
+
"reason": {
|
|
767
|
+
"enum": [
|
|
768
|
+
"no_end_in_window",
|
|
769
|
+
"end_status_unusable"
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
"description": "One section per run that records names, in the order records first names it, and none for any other run (flyingrobots/parley#83). It states once what is true of every record of the run — which invocation it was and what became of it — rather than on each entry. Read off the window's records when the lens is built, so it cannot drift from the head it summarises. Part of the line budget.bytes bounds. Optional so that lines written under the earlier drafts still validate; parley-read always writes it."
|
|
777
|
+
},
|
|
778
|
+
"records": {
|
|
779
|
+
"type": "array",
|
|
780
|
+
"items": {
|
|
781
|
+
"type": "object",
|
|
782
|
+
"required": [
|
|
783
|
+
"run",
|
|
784
|
+
"seq"
|
|
785
|
+
],
|
|
786
|
+
"properties": {
|
|
787
|
+
"run": {
|
|
788
|
+
"type": "string",
|
|
789
|
+
"minLength": 1
|
|
790
|
+
},
|
|
791
|
+
"seq": {
|
|
792
|
+
"type": "integer",
|
|
793
|
+
"minimum": 0,
|
|
794
|
+
"description": "0 for a bootstrap or startup-failure line (spec §1.3)."
|
|
795
|
+
},
|
|
796
|
+
"event": {
|
|
797
|
+
"type": "string",
|
|
798
|
+
"minLength": 1,
|
|
799
|
+
"description": "The named record's event token as the loader read it, a tool's own token included verbatim (flyingrobots/parley#77). Absent when the record carries none; never filled in."
|
|
800
|
+
},
|
|
801
|
+
"t": {
|
|
802
|
+
"type": "integer",
|
|
803
|
+
"minimum": 0,
|
|
804
|
+
"description": "The named record's POSIX time in milliseconds (spec §1.3) as the loader read it. Absent when the record has no usable t; never a made-up one."
|
|
805
|
+
},
|
|
806
|
+
"code": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$",
|
|
809
|
+
"description": "On an error or warning entry, the record's code (spec §6), so failures of one case read as one without opening them (flyingrobots/parley#83). Absent on any other record, and on a code that is not spec §6's shape; never filled in."
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"description": "The records this result was built from, by (run, seq), never more than budget.records of them. Stored rather than recomputed: projecting down to a result is cheap and expanding back up may be impossible within a budget, so the way back has to be written here. A result is built from records, never from another result. Each entry may also carry a fixed summary of the record it names — event, t and, on an error or warning, its code — so a reader can choose what to open without opening it (flyingrobots/parley#77, flyingrobots/parley#83). What is true of the entry's whole run, its identity and outcome, is stated once in runs. The summary is read off the record when the lens is built and is part of the line budget.bytes bounds."
|
|
814
|
+
},
|
|
815
|
+
"_schema": {
|
|
816
|
+
"type": "object",
|
|
817
|
+
"required": [
|
|
818
|
+
"id",
|
|
819
|
+
"version"
|
|
820
|
+
],
|
|
821
|
+
"additionalProperties": false,
|
|
822
|
+
"properties": {
|
|
823
|
+
"id": {
|
|
824
|
+
"const": "parley.lens"
|
|
825
|
+
},
|
|
826
|
+
"version": {
|
|
827
|
+
"const": "1.0.0",
|
|
828
|
+
"description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
"if": {
|
|
834
|
+
"type": "object",
|
|
835
|
+
"required": [
|
|
836
|
+
"loss"
|
|
837
|
+
],
|
|
838
|
+
"properties": {
|
|
839
|
+
"loss": {
|
|
840
|
+
"type": "object",
|
|
841
|
+
"required": [
|
|
842
|
+
"bound"
|
|
843
|
+
],
|
|
844
|
+
"properties": {
|
|
845
|
+
"bound": {
|
|
846
|
+
"const": "none"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
"then": {
|
|
853
|
+
"type": "object",
|
|
854
|
+
"properties": {
|
|
855
|
+
"loss": {
|
|
856
|
+
"type": "object",
|
|
857
|
+
"properties": {
|
|
858
|
+
"excluded": {
|
|
859
|
+
"const": 0
|
|
860
|
+
},
|
|
861
|
+
"folded": {
|
|
862
|
+
"const": 0
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
},
|
|
407
870
|
{
|
|
408
871
|
"id": "parley.page",
|
|
409
872
|
"version": "1.0.0",
|
|
@@ -488,6 +951,177 @@ export const SCHEMAS: ReadonlyArray<{ id: string; version: string; schema: Recor
|
|
|
488
951
|
}
|
|
489
952
|
}
|
|
490
953
|
},
|
|
954
|
+
{
|
|
955
|
+
"id": "parley.query",
|
|
956
|
+
"version": "1.0.0",
|
|
957
|
+
"schema": {
|
|
958
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
959
|
+
"$id": "https://flyingrobots.dev/parley/schemas/parley.query/1.0.0",
|
|
960
|
+
"title": "parley query",
|
|
961
|
+
"description": "A read against the history, recorded as an event: the asker it is for, the view it wants, the budget it will accept and the window it covers (spec §9, informative; the representation is decided in flyingrobots/parley#46 and read against the observer-geometry treatment in docs/topics/related-work/observer-geometry.md). The envelope's run is the read's own run; asker is who the read is for. A drill-down, which opens records a lens named, is the same message with records stating which.",
|
|
962
|
+
"type": "object",
|
|
963
|
+
"required": [
|
|
964
|
+
"event",
|
|
965
|
+
"t",
|
|
966
|
+
"seq",
|
|
967
|
+
"run",
|
|
968
|
+
"asker",
|
|
969
|
+
"view",
|
|
970
|
+
"budget",
|
|
971
|
+
"window",
|
|
972
|
+
"_schema"
|
|
973
|
+
],
|
|
974
|
+
"properties": {
|
|
975
|
+
"event": {
|
|
976
|
+
"const": "query"
|
|
977
|
+
},
|
|
978
|
+
"t": {
|
|
979
|
+
"type": "integer",
|
|
980
|
+
"minimum": 0,
|
|
981
|
+
"description": "POSIX time in milliseconds (spec §1.3)."
|
|
982
|
+
},
|
|
983
|
+
"seq": {
|
|
984
|
+
"type": "integer",
|
|
985
|
+
"minimum": 1,
|
|
986
|
+
"description": "The run's single counter (spec §1.3)."
|
|
987
|
+
},
|
|
988
|
+
"run": {
|
|
989
|
+
"type": "string",
|
|
990
|
+
"minLength": 1,
|
|
991
|
+
"description": "The execution this line belongs to: the read itself, not the runs being read (spec §2.1)."
|
|
992
|
+
},
|
|
993
|
+
"session": {
|
|
994
|
+
"type": "string",
|
|
995
|
+
"minLength": 1,
|
|
996
|
+
"description": "Working period spanning runs. Supplied by the caller or inherited; never invented (spec §2.1)."
|
|
997
|
+
},
|
|
998
|
+
"asker": {
|
|
999
|
+
"type": "object",
|
|
1000
|
+
"required": [
|
|
1001
|
+
"tool"
|
|
1002
|
+
],
|
|
1003
|
+
"properties": {
|
|
1004
|
+
"tool": {
|
|
1005
|
+
"type": "string",
|
|
1006
|
+
"minLength": 1,
|
|
1007
|
+
"description": "The calling program, named as in spec §2.1. Established from the caller's own identity or supplied as one argument; never invented, so a read that cannot establish it is refused."
|
|
1008
|
+
},
|
|
1009
|
+
"cwd": {
|
|
1010
|
+
"type": "string",
|
|
1011
|
+
"pattern": "^/",
|
|
1012
|
+
"minLength": 2,
|
|
1013
|
+
"description": "Absolute POSIX working directory the read was made from. Inferred from the process; omitted when it is not meaningful."
|
|
1014
|
+
},
|
|
1015
|
+
"task": {
|
|
1016
|
+
"type": "string",
|
|
1017
|
+
"minLength": 1,
|
|
1018
|
+
"description": "The caller's current task id, supplied by the caller and never inferred (flyingrobots/parley#61); omitted when the caller does not state it. Not the session: a session is a working period, a task is a unit of work inside one."
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
"description": "Who the read is for, and the context the budget is inferred from. The asker is not the view: two askers requesting the same view under the same budget get the same answer."
|
|
1022
|
+
},
|
|
1023
|
+
"view": {
|
|
1024
|
+
"enum": [
|
|
1025
|
+
"what-ran",
|
|
1026
|
+
"what-failed",
|
|
1027
|
+
"what-changed",
|
|
1028
|
+
"how-it-decided",
|
|
1029
|
+
"everything"
|
|
1030
|
+
],
|
|
1031
|
+
"description": "The shape of the answer, one token from a closed set. Never inferred: there is no privileged view, so a missing view is refused rather than guessed. Adding a token is a version of this schema."
|
|
1032
|
+
},
|
|
1033
|
+
"budget": {
|
|
1034
|
+
"type": "object",
|
|
1035
|
+
"required": [
|
|
1036
|
+
"records"
|
|
1037
|
+
],
|
|
1038
|
+
"properties": {
|
|
1039
|
+
"records": {
|
|
1040
|
+
"type": "integer",
|
|
1041
|
+
"minimum": 1,
|
|
1042
|
+
"description": "The most records the answer may name. Required: a view with no bound collapses into \"return every record\"."
|
|
1043
|
+
},
|
|
1044
|
+
"bytes": {
|
|
1045
|
+
"type": "integer",
|
|
1046
|
+
"minimum": 1,
|
|
1047
|
+
"description": "The most bytes the answer may occupy."
|
|
1048
|
+
},
|
|
1049
|
+
"ms": {
|
|
1050
|
+
"type": "integer",
|
|
1051
|
+
"minimum": 1,
|
|
1052
|
+
"description": "The most wall-clock milliseconds the read may spend."
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
"description": "The size of answer the asker will accept. One documented default applies when it is not supplied, and the applied budget is carried verbatim by the result's lens, so a default is never invisible."
|
|
1056
|
+
},
|
|
1057
|
+
"window": {
|
|
1058
|
+
"type": "object",
|
|
1059
|
+
"required": [
|
|
1060
|
+
"from",
|
|
1061
|
+
"to"
|
|
1062
|
+
],
|
|
1063
|
+
"properties": {
|
|
1064
|
+
"from": {
|
|
1065
|
+
"type": "integer",
|
|
1066
|
+
"minimum": 0,
|
|
1067
|
+
"description": "Inclusive lower bound of the window, POSIX time in milliseconds. 0 means \"from the start of the history\"."
|
|
1068
|
+
},
|
|
1069
|
+
"to": {
|
|
1070
|
+
"type": "integer",
|
|
1071
|
+
"minimum": 0,
|
|
1072
|
+
"description": "Inclusive upper bound of the window, POSIX time in milliseconds. Never below from."
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
"description": "The stretch of history the read covers, always stated as two timestamps and echoed by the result's lens."
|
|
1076
|
+
},
|
|
1077
|
+
"note": {
|
|
1078
|
+
"type": "string",
|
|
1079
|
+
"minLength": 1,
|
|
1080
|
+
"description": "Free text from the asker, recorded and never parsed. Nothing in the answer branches on it."
|
|
1081
|
+
},
|
|
1082
|
+
"records": {
|
|
1083
|
+
"type": "array",
|
|
1084
|
+
"minItems": 1,
|
|
1085
|
+
"items": {
|
|
1086
|
+
"type": "object",
|
|
1087
|
+
"required": [
|
|
1088
|
+
"run",
|
|
1089
|
+
"seq"
|
|
1090
|
+
],
|
|
1091
|
+
"properties": {
|
|
1092
|
+
"run": {
|
|
1093
|
+
"type": "string",
|
|
1094
|
+
"minLength": 1
|
|
1095
|
+
},
|
|
1096
|
+
"seq": {
|
|
1097
|
+
"type": "integer",
|
|
1098
|
+
"minimum": 0,
|
|
1099
|
+
"description": "0 for a bootstrap or startup-failure line (spec §1.3)."
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
"description": "Present only on a drill-down: the records the read asks for by (run, seq), the identity a parley.lens names them by, in the order asked (flyingrobots/parley#51). A drill-down answers with exactly these records in full, a sidecar's stored record included, and an outcome per id; the view and window are recorded and select nothing, budget.records is the number of ids asked, and budget.bytes, when stated, bounds the records opened: whole records in the order asked while their summed size stays within it, and an over_budget outcome with no contents for each id past it (flyingrobots/parley#78). Absent on a read that answers with a digest."
|
|
1104
|
+
},
|
|
1105
|
+
"_schema": {
|
|
1106
|
+
"type": "object",
|
|
1107
|
+
"required": [
|
|
1108
|
+
"id",
|
|
1109
|
+
"version"
|
|
1110
|
+
],
|
|
1111
|
+
"additionalProperties": false,
|
|
1112
|
+
"properties": {
|
|
1113
|
+
"id": {
|
|
1114
|
+
"const": "parley.query"
|
|
1115
|
+
},
|
|
1116
|
+
"version": {
|
|
1117
|
+
"const": "1.0.0",
|
|
1118
|
+
"description": "Full validation is against the schema for this exact id and version (spec §4.5, §4.6)."
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
491
1125
|
{
|
|
492
1126
|
"id": "parley.receipt.head",
|
|
493
1127
|
"version": "2.0.0",
|