@mark1russell7/harness 0.16.31 → 0.16.33

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/README.md CHANGED
@@ -48,6 +48,19 @@ The command `run` of `src/vm.ts` and the workflow `vm-run.yml` operate one comma
48
48
 
49
49
  After the time limit, each process of the argv stops. The file `run.json` in `/out` tells why the run ended, the exit code and the kernel of the guest. A consumer adds one job that uses `vm-run.yml` at a commit of this repository. One file, `vm/linux.json`, pins the kernel for `vm.yml` and `vm-run.yml`.
50
50
 
51
+ ### The gate of the VM tier
52
+
53
+ A pull request that changes the VM tier starts `vm.yml` (SYS-155). The workflow operates one arm `e4` with the cells of the bridge of T01. Then `src/vm-tier.test.ts` reads the records of that arm, with `HARNESS_VM=1`. `vmArmProblems` in `src/vm-tier.ts` gives each difference from the cases of the self-test, as data:
54
+
55
+ | Case | The result that the case expects |
56
+ | --- | --- |
57
+ | control | The guest operates the kernel of `vm/linux.json`. The boot to Docker takes 30 s or less. The steal of each run is 0.01 or less. |
58
+ | idle blackhole | Each run ends with `ETIMEDOUT`. The median of the times is from 11.0 s to 12.0 s. |
59
+ | in-flight blackhole | Each run ends with `ETIMEDOUT` from 5.9 s to 6.5 s after the fault. |
60
+ | stall of 1 s | Each run gets its answer from 1.5 s to 1.9 s after the fault. |
61
+
62
+ A void run does not pass. The arm writes its boot record (`<arm>.boot.json`) before the cells, thus a guest that did not boot fails the control case. A runner with no `/dev/kvm` fails the job in a pull request or a push. Only a dispatch keeps the void result of rule 8. `VM_TIER_FAULTS` names the faults of the gate, and the rig `systems.vm` of `docs/rigs.json` names the same faults.
63
+
51
64
  ## The topologies
52
65
 
53
66
  A topology (`Topology`) is the chain of hops from the client to the target, as data. Each hop is on two networks, one for each side. Network j joins element j and element j + 1: the client is element 0, and the target is the last element.
@@ -595,6 +608,35 @@ for (const fault of plan.faults) console.log((await runDiskFault(lab, fault)).pe
595
608
  - Its torn writes tear `synced.log`. The check gives the size of the file, and a case expects whole lines or a part of the next line.
596
609
  - With `DISK_RETRY=1`, the writer does a failed fsync again. The check gives the last line of `synced.log`, thus a case sees a lost line before later lines.
597
610
 
611
+ ## The fabric tier
612
+
613
+ The fabric tier applies a fault to the routed fabric of layer E3, with no cell and no target service (`fabric-tier.ts`). It opens the fabric of `openFabric` with the BGP timers 2 s and 6 s and no BFD. A client behind leaf1 sends a numbered UDP datagram to a target behind leaf2 each 50 ms.
614
+
615
+ ```ts
616
+ import { openFabricLab, runFabricFault } from "@mark1russell7/harness";
617
+
618
+ const lab = await openFabricLab({ code: { commit, dirty: false } });
619
+ const record = await runFabricFault(lab, { kind: "blackhole" });
620
+ console.log(record.leaves, record.stream.gaps);
621
+ await lab.close();
622
+ ```
623
+
624
+ - **The faults** use the silence of `fabric.ts`: spine1 drops each packet, and its links stay up. `FABRIC_TIER_FAULTS` names the kinds.
625
+ - `stall` silences spine1 for `ms`. Under the hold time, no route changes.
626
+ - `blackhole` silences spine1 until each leaf moves its route to spine2.
627
+ - `route-flap` is a blackhole, then the clear, until each leaf is back on spine1.
628
+ - The control `none` applies no fault for `ms`.
629
+ - **The fault type is local to the harness at this time.** SYS-92 moves the faults of a topology to `@mark1russell7/rigor-chaos`.
630
+ - **The stream** operates in two containers of Node.js, pinned by digest. The target writes the number of each datagram and its time on CLOCK_MONOTONIC.
631
+ - **The record** (`harness-fabric/1`) holds the fault, the stamps of the injector and the drops of the three rules of the silence.
632
+ - It also holds the move and the return of each leaf in ms, the routes in the window, and the BGP sessions before and after.
633
+ - It also holds the gaps of the stream, the FRR image with its digest, the version of containerlab, the substrate (layer E3) and the commit.
634
+ - `fabricRecordProblems` gives each problem of the pins of a record. A record with a problem is not a record.
635
+ - **containerlab needs Docker and sudo.** Thus the tier operates only in CI, in the workflow `fabric.yml`.
636
+ - **The self-test** (`HARNESS_FABRIC=1`) has four cases as data: the control, a stall of 2 s, a blackhole and a route flap.
637
+ - The gate of each case reads the record. A fault that does nothing fails the stall and the blackhole.
638
+ - The bounds come from the timers. A move comes 4 s to 6 s after the silence: the last keepalive arrived 0 s to 2 s before it.
639
+
598
640
  ## Runs
599
641
 
600
642
  - **`runCell(cell)`** (`run.ts`) divides the 11 runs of a cell across two new environments. It records the manifest of each environment, and it removes the fault after each run.
package/build/index.d.ts CHANGED
@@ -651,11 +651,13 @@ interface ClockPair {
651
651
  * prober. The error of the pair is approximately 1 ms, the step of `Date.now`.
652
652
  */
653
653
  export declare const monotonicAt: (wall: number, pair: ClockPair) => number;
654
- /** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
655
- export declare const sessionsOf: (json: string) => {
654
+ /** These are the BGP sessions of a leaf: the count that is up, and the count of establishments so far. */
655
+ interface LeafSessions {
656
656
  readonly up: number;
657
657
  readonly established: number;
658
- };
658
+ }
659
+ /** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
660
+ export declare const sessionsOf: (json: string) => LeafSessions;
659
661
  /** These are the views of a leaf that tell if a run can start on it. */
660
662
  interface LeafViews {
661
663
  readonly neighbors: string;
@@ -678,6 +680,24 @@ export declare const leafLacks: (views: LeafViews) => string | null;
678
680
  * the outage in the two directions.
679
681
  */
680
682
  export declare const laterMove: (routes: readonly RunRoute[], after: number) => number | null;
683
+ /** This type names the spine that a route of a leaf goes through. */
684
+ type Spine = "spine1" | "spine2";
685
+ /**
686
+ * This function gives the time of the first route of a leaf to its far network after an instant, through a spine. It
687
+ * gives null when the leaf has no such route. A route that leaves spine1 is a move, and a route back to spine1 is a return.
688
+ */
689
+ export declare const leafRouteAfter: (routes: readonly RunRoute[], leaf: string, after: number, spine: Spine) => number | null;
690
+ /** These are the counts of the packets that the three rules of a silence dropped. */
691
+ interface SilenceDrops {
692
+ readonly input: number;
693
+ readonly output: number;
694
+ readonly forward: number;
695
+ }
696
+ /**
697
+ * This function reads the drops of a silence from the output of `iptables-save -c`. It gives null when a chain has no
698
+ * rule of a silence: a rule with no match and the target `DROP`.
699
+ */
700
+ export declare const silenceDrops: (text: string) => SilenceDrops | null;
681
701
  /** A fabric lab is the open fabric of a lab. */
682
702
  interface FabricLab {
683
703
  /** These are the lines of the route monitors of the leaves, on the monotonic clock. */
@@ -692,10 +712,14 @@ interface FabricLab {
692
712
  t0: number;
693
713
  t1: number;
694
714
  }>;
715
+ /** This method gives the drops of the silence at this time, or null when spine1 is not silent. */
716
+ drops(): Promise<SilenceDrops | null>;
695
717
  /** This method waits until each leaf is on spine1 with each session up. */
696
718
  ready(): Promise<void>;
697
719
  /** This method gives the count of established sessions of each leaf so far. */
698
720
  sessions(): Promise<Readonly<Record<string, number>>>;
721
+ /** This method gives the BGP sessions of each leaf at this time: the count that is up, and the count of establishments so far. */
722
+ bgp(): Promise<Readonly<Record<string, LeafSessions>>>;
699
723
  /** This method gives the record of the fabric for a manifest. */
700
724
  manifest(): FabricManifest;
701
725
  /** This method destroys the routers. */
@@ -2524,6 +2548,331 @@ export declare const openStandby: (lab: Lab, cell: Cell) => Promise<Sibling>;
2524
2548
  * environment. It removes its rows, thus the numbers of the run start on an empty table.
2525
2549
  */
2526
2550
  export declare const pairOnce: (lab: Lab, standby: Sibling, cell: Cell, environment: number, index: number, dry?: boolean) => Promise<Run>;
2551
+ /**
2552
+ * This function gives each problem of one image of a run outside a manifest of the harness, as the
2553
+ * kind lab records its images. A pulled image needs its digest. An image that a build makes needs
2554
+ * its build record, with each base by digest. The build record must have the tag of the image.
2555
+ */
2556
+ export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
2557
+ /**
2558
+ * This function gives each problem of a manifest that stops it from pinning the programs of its
2559
+ * run. An empty list means that the manifest pins each program.
2560
+ * - the target: an image by its digest, or the build of a subject with its build record and its base
2561
+ * by digest.
2562
+ * - the harness: the version of its package, and the build record of its image.
2563
+ * - the client: an image by its digest, or a build with its build record.
2564
+ * - each hop: an image by its digest, or the tag of a build and the id of its image.
2565
+ */
2566
+ export declare const manifestProblems: (manifest: Manifest) => string[];
2567
+ /** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
2568
+ export declare const commitProblems: (commit: string | undefined) => string[];
2569
+ /** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
2570
+ interface RecordCode {
2571
+ readonly commit: string;
2572
+ readonly dirty: boolean;
2573
+ }
2574
+ /** These are the parts of a record that tell if it pins the programs of its runs. */
2575
+ interface Pinnable {
2576
+ readonly code?: RecordCode | undefined;
2577
+ readonly manifests: readonly Manifest[];
2578
+ /** A local debug run marks its record so. No page reads such a record. */
2579
+ readonly debug?: boolean | undefined;
2580
+ }
2581
+ /** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
2582
+ export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
2583
+ /** This problem is the problem of a record of a local debug run. */
2584
+ export declare const DEBUG = "the record is of a local debug run, and no page reads it";
2585
+ /**
2586
+ * This function gives each problem that stops a record from pinning the programs of its runs. A
2587
+ * record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
2588
+ * of a schedule refuses it. A commit with changes to tracked files is not a pin.
2589
+ */
2590
+ export declare const recordProblems: (record: Pinnable) => string[];
2591
+ /**
2592
+ * The fabric tier applies a fault to the routed fabric of `fabric.ts` (layer E3), and records what the routers and a
2593
+ * stream of datagrams did. Four routers of FRRouting, two leaves and two spines, run eBGP under containerlab. A client
2594
+ * behind leaf1 sends a numbered UDP datagram to a target behind leaf2 each 50 ms. The path goes through spine1.
2595
+ *
2596
+ * Each fault uses the silence of `fabric.ts`: the injector drops each packet of spine1 in one commit, and the links stay
2597
+ * up. Thus only the BGP hold timer can see the fault.
2598
+ *
2599
+ * - `stall` silences spine1 for `ms`, then ends the silence. Under the hold time, no route changes.
2600
+ * - `blackhole` silences spine1 until each leaf moves its route to spine2. Then the stream goes through spine2.
2601
+ * - `route-flap` is a blackhole, then the end of the silence, until each leaf is back on spine1.
2602
+ *
2603
+ * The tier needs Docker, containerlab and sudo on a Linux host. Thus it operates only in CI, in the workflow `fabric.yml`.
2604
+ */
2605
+ /** The format of a record of the fabric tier. */
2606
+ export declare const FABRIC_RECORD_FORMAT = "harness-fabric/1";
2607
+ /** The kinds of fault that the fabric tier applies. */
2608
+ type FabricFaultKind = "stall" | "blackhole" | "route-flap";
2609
+ /** The kinds of fault that the fabric tier applies, in a stable sequence. The rig `systems.fabric-tier` names the same kinds. */
2610
+ export declare const FABRIC_TIER_FAULTS: readonly FabricFaultKind[];
2611
+ /**
2612
+ * A fault of the fabric tier, as data. This type is local to the harness at this time. SYS-92 moves the faults of a
2613
+ * topology to `@mark1russell7/rigor-chaos`.
2614
+ */
2615
+ type FabricFault = {
2616
+ readonly kind: "stall";
2617
+ readonly ms: number;
2618
+ } | {
2619
+ readonly kind: "blackhole";
2620
+ } | {
2621
+ readonly kind: "route-flap";
2622
+ };
2623
+ /** A control of the fabric tier: no fault for `ms`. A self-test compares a fault with it. */
2624
+ interface FabricControl {
2625
+ readonly kind: "none";
2626
+ readonly ms: number;
2627
+ }
2628
+ /**
2629
+ * The BGP timers of the tier: keepalive 2 s, hold 6 s, and no BFD. Only the hold timer detects a silence, thus a move
2630
+ * comes 4 s to 6 s after the start of a silence.
2631
+ */
2632
+ export declare const FABRIC_TIER_TIMERS: Fabric;
2633
+ /** The image of the client and the target of the stream: Node.js 24.21.0, pinned by digest. */
2634
+ export declare const FABRIC_STREAM_IMAGE = "node:24.21.0-alpine@sha256:ebfe2f90462722a7a4de65e91990e97fe0d401c70e0e762c5b53302f905ec1c1";
2635
+ /** The UDP port of the target of the stream. */
2636
+ export declare const FABRIC_STREAM_PORT = 9e3;
2637
+ /** The client sends one datagram in each interval of this length in ms. */
2638
+ export declare const FABRIC_STREAM_INTERVAL_MS = 50;
2639
+ /**
2640
+ * The target of the stream writes one JSON line for each datagram: its number and its time on CLOCK_MONOTONIC in ns.
2641
+ * `process.hrtime` of Node.js reads CLOCK_MONOTONIC. The clock is the same in each container and on the host.
2642
+ */
2643
+ export declare const FABRIC_SINK_SCRIPT: string;
2644
+ /**
2645
+ * The client of the stream waits for the file of its fourth argument. Then it sends a datagram with the next number
2646
+ * each interval of its third argument in ms, on a schedule from its start. A send that fails does not stop the stream.
2647
+ */
2648
+ export declare const FABRIC_STREAM_SCRIPT: string;
2649
+ /** An arrival is one datagram of the stream at the target: its number and its time on CLOCK_MONOTONIC in ns. */
2650
+ interface FabricArrival {
2651
+ readonly seq: number;
2652
+ readonly t: number;
2653
+ }
2654
+ /** This function reads one line of the target of the stream, or it gives null for another line. */
2655
+ export declare const arrivalOf: (line: string) => FabricArrival | null;
2656
+ /** The options of `openFabricLab`. */
2657
+ interface FabricLabOptions {
2658
+ /** The commit of the code that operates, and if its tracked files have changes. The record keeps it. */
2659
+ readonly code: RecordCode;
2660
+ }
2661
+ /** The image of the harness: its tag, and the record of its build. */
2662
+ interface FabricImage {
2663
+ readonly tag: string;
2664
+ readonly build?: BuildRecord;
2665
+ }
2666
+ /** A fabric tier lab holds the routers, the stream and the parts that stay the same from one fault to the next. */
2667
+ interface FabricTierLab {
2668
+ readonly fabric: FabricLab;
2669
+ /** These are the datagrams of the stream at the target, in the sequence of their arrival. */
2670
+ readonly arrivals: readonly FabricArrival[];
2671
+ readonly image: FabricImage;
2672
+ readonly code: RecordCode;
2673
+ readonly substrate: Substrate;
2674
+ /** This method destroys the routers and stops each container of the lab. */
2675
+ close(): Promise<void>;
2676
+ }
2677
+ /** The two stamps of a command of the injector, in ms from the origin of a record. */
2678
+ interface FabricStamp {
2679
+ readonly t0: number;
2680
+ readonly t1: number;
2681
+ }
2682
+ /** The routes of one leaf in the window of a record. */
2683
+ interface FabricLeafRecord {
2684
+ readonly leaf: string;
2685
+ /** The time in ms from the start of the silence to the first route through spine2, or null. */
2686
+ readonly away: number | null;
2687
+ /** The time in ms from the start of the clear to the first route back through spine1, or null. */
2688
+ readonly back: number | null;
2689
+ /** The count of the changes of the route to the far network in the window. */
2690
+ readonly changes: number;
2691
+ }
2692
+ /** An interval between two datagrams of the stream that is longer than two intervals of the client. */
2693
+ interface FabricGap {
2694
+ /** The arrival of the datagram before the gap, in ms from the origin. */
2695
+ readonly at: number;
2696
+ readonly ms: number;
2697
+ /** The number of the datagram before the gap. */
2698
+ readonly after: number;
2699
+ /** The number of the datagram after the gap. */
2700
+ readonly before: number;
2701
+ }
2702
+ /** The stream of datagrams in the window of a record. */
2703
+ interface FabricStreamRecord {
2704
+ readonly intervalMs: number;
2705
+ readonly received: number;
2706
+ readonly firstSeq: number | null;
2707
+ readonly lastSeq: number | null;
2708
+ /** The count of the numbers from the first to the last that did not arrive. The client sends each number. */
2709
+ readonly lost: number;
2710
+ /** The arrival of the first datagram and of the last datagram in the window, in ms from the origin, or null. */
2711
+ readonly first: number | null;
2712
+ readonly last: number | null;
2713
+ /** The longest interval in ms between two datagrams in the window. */
2714
+ readonly longest: number;
2715
+ readonly gaps: readonly FabricGap[];
2716
+ }
2717
+ /** A route line of a leaf in the window of a record, with its time in ms from the origin. */
2718
+ interface FabricRouteRecord {
2719
+ readonly leaf: string;
2720
+ readonly t: number;
2721
+ readonly deleted: boolean;
2722
+ readonly prefix: string;
2723
+ readonly via: string | null;
2724
+ readonly dev: string | null;
2725
+ }
2726
+ /** The record of one fault of the fabric tier. Each time is in ms from the origin: the start of the window. */
2727
+ interface FabricRecord {
2728
+ readonly format: typeof FABRIC_RECORD_FORMAT;
2729
+ readonly fault: FabricFault | FabricControl;
2730
+ /** The time when `runFabricFault` started the fault, in ISO 8601. */
2731
+ readonly at: string;
2732
+ readonly code: RecordCode;
2733
+ readonly substrate: Substrate;
2734
+ /** The image of the harness. The injector and the route monitors operate from it. */
2735
+ readonly image: FabricImage;
2736
+ /** The image of FRRouting and its digest. */
2737
+ readonly frr: {
2738
+ readonly image: string;
2739
+ readonly digest: string;
2740
+ };
2741
+ readonly stream: FabricStreamRecord & {
2742
+ readonly image: string;
2743
+ readonly port: number;
2744
+ };
2745
+ readonly containerlab: string;
2746
+ readonly timers: {
2747
+ readonly keepaliveS: number;
2748
+ readonly holdS: number;
2749
+ readonly bfd: null;
2750
+ };
2751
+ /** The length of the window in ms. */
2752
+ readonly window: number;
2753
+ readonly injector: {
2754
+ readonly silence: FabricStamp | null;
2755
+ readonly clear: FabricStamp | null;
2756
+ /** The drops of the three rules of the silence, read before the clear. */
2757
+ readonly drops: SilenceDrops | null;
2758
+ };
2759
+ /** The time in ms from the later move of the two leaves to the first datagram after it and before the clear, or null. */
2760
+ readonly resumed: number | null;
2761
+ readonly leaves: readonly FabricLeafRecord[];
2762
+ readonly routes: readonly FabricRouteRecord[];
2763
+ /**
2764
+ * The BGP sessions of each leaf at the start and at the end of the window. For a blackhole, the tier reads the end
2765
+ * before the clear.
2766
+ */
2767
+ readonly sessions: {
2768
+ readonly before: Readonly<Record<string, LeafSessions>>;
2769
+ readonly after: Readonly<Record<string, LeafSessions>>;
2770
+ };
2771
+ }
2772
+ /** This function gives each problem of a fault of the fabric tier. An empty list means that the fault is correct. */
2773
+ export declare const fabricFaultProblems: (fault: FabricFault | FabricControl) => string[];
2774
+ /**
2775
+ * This function gives the stream of a window from the arrivals of the target. `from` and `to` are times on
2776
+ * CLOCK_MONOTONIC in ns, and each time of the stream is in ms from `from`.
2777
+ */
2778
+ export declare const fabricStreamOf: (arrivals: readonly FabricArrival[], from: number, to: number) => FabricStreamRecord;
2779
+ /**
2780
+ * This function opens the lab of the fabric tier. It builds the image of the harness once, and starts the target and
2781
+ * the client of the stream. Then it deploys the routers with the timers of `FABRIC_TIER_TIMERS`, and starts the stream.
2782
+ * The promise rejects when the fabric is not ready, or when no datagram arrives.
2783
+ */
2784
+ export declare const openFabricLab: (options: FabricLabOptions) => Promise<FabricTierLab>;
2785
+ /**
2786
+ * This function applies one fault, or the control, to the lab, and gives its record. It throws a `RangeError` for a
2787
+ * fault with problems. First it waits until each leaf is on spine1 with each session up. The window of the record starts
2788
+ * `LEAD_MS` before the fault.
2789
+ */
2790
+ export declare const runFabricFault: (lab: FabricTierLab, fault: FabricFault | FabricControl) => Promise<FabricRecord>;
2791
+ /** These are the parts of a fabric record that tell if it pins its code and its images. */
2792
+ interface FabricPinnable {
2793
+ readonly code?: RecordCode | undefined;
2794
+ readonly image: FabricImage;
2795
+ readonly frr: {
2796
+ readonly image: string;
2797
+ };
2798
+ readonly stream: {
2799
+ readonly image: string;
2800
+ };
2801
+ }
2802
+ /**
2803
+ * This function gives each problem of the pins of a fabric record. The pins are the commit of the code and the image of
2804
+ * the harness with its build record. The FRR image and the image of the stream need a digest. A checkout with changes is
2805
+ * also a problem. A record with a problem is not a record.
2806
+ */
2807
+ export declare const fabricRecordProblems: (record: FabricPinnable) => string[];
2808
+ /** The boot record of an arm in a guest. The command `arm` writes it before the cells start. */
2809
+ interface VmBoot {
2810
+ readonly format: "harness-vm-boot/1";
2811
+ /** This number is the time from the start of QEMU to the first reply of Docker in the guest, in milliseconds. */
2812
+ readonly ms: number;
2813
+ /** This text is the release of the kernel of the guest, as `uname -r` gives it. */
2814
+ readonly kernel: string;
2815
+ }
2816
+ /**
2817
+ * The gate of the VM tier of layer E4 (`vm.ts`). The workflow `vm.yml` operates one arm `e4`: QEMU boots the pinned
2818
+ * kernel, and the cells of T01 operate in the guest. Each cell applies its fault in the lab of the guest.
2819
+ *
2820
+ * This file reads the records of that arm, and gives each difference from the cases of the self-test as data. A
2821
+ * control case examines the boot and the guest. A fault case examines the measure of each run of one cell.
2822
+ */
2823
+ /** The kinds of fault that the cells of the arm apply in the guest. */
2824
+ type VmFaultKind = "blackhole" | "stall";
2825
+ /** The kinds of fault that the gate of the VM tier examines. */
2826
+ export declare const VM_TIER_FAULTS: readonly VmFaultKind[];
2827
+ /** The format of the record of a cell, as the cells write it. */
2828
+ export declare const CELL_RECORD_FORMAT = "loom.cell-record/1";
2829
+ /** These are the parts of the record of a cell that the gate reads. */
2830
+ interface VmCellRecord {
2831
+ readonly format: string;
2832
+ readonly cell: Cell;
2833
+ readonly manifests: readonly Pick<Manifest, "kernel" | "substrate">[];
2834
+ readonly runs: readonly Run[];
2835
+ }
2836
+ /** The records of one arm `e4`: its boot record, or null when the guest did not boot, and the record of each cell. */
2837
+ interface VmArm {
2838
+ readonly boot: VmBoot | null;
2839
+ readonly records: readonly VmCellRecord[];
2840
+ }
2841
+ /** The control case: the guest operates the pinned kernel, boots in its time, and the host takes little of its CPU. */
2842
+ interface VmControlCase {
2843
+ readonly kind: "control";
2844
+ readonly name: string;
2845
+ /** This text is the release of the pinned kernel, the version of `vm/linux.json`. */
2846
+ readonly kernel: string;
2847
+ /** The boot to Docker must take this time in ms or less. */
2848
+ readonly bootMaxMs: number;
2849
+ /** The steal of each run, the share of the CPU that the host took, must be this share or less. */
2850
+ readonly stealMax: number;
2851
+ }
2852
+ /** A fault case: the measure of each run of one cell of the arm, against the result that the case expects. */
2853
+ interface VmFaultCase {
2854
+ readonly kind: "fault";
2855
+ readonly name: string;
2856
+ /** This text is the name of the cell. */
2857
+ readonly cell: string;
2858
+ readonly fault: VmFaultKind;
2859
+ /** Each counted run must end with this outcome. An `error` also needs `errno`. */
2860
+ readonly outcome: "error" | "answered";
2861
+ readonly errno?: string;
2862
+ /** The count of the runs that are not void must be this count or more. */
2863
+ readonly runsMin: number;
2864
+ /** The median of the measured times in s must be in this range. */
2865
+ readonly median?: readonly [number, number];
2866
+ /** The measured time in s of each counted run must be in this range. */
2867
+ readonly each?: readonly [number, number];
2868
+ }
2869
+ /** One case of the self-test of the VM tier. */
2870
+ type VmCase = VmControlCase | VmFaultCase;
2871
+ /**
2872
+ * This function gives each difference between the records of an arm `e4` and the result that a case expects. An arm
2873
+ * with no boot record, no record of the cell or no counted run gives a problem: a void arm does not pass.
2874
+ */
2875
+ export declare const vmArmProblems: (arm: VmArm, cases: readonly VmCase[]) => string[];
2527
2876
  /**
2528
2877
  * This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
2529
2878
  * package that a build installs, thus its sha256 pins the packages that the image holds. The
@@ -2571,46 +2920,6 @@ export declare const jarVersions: (list: string) => Record<string, string>;
2571
2920
  * from such a lockfile.
2572
2921
  */
2573
2922
  export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
2574
- /**
2575
- * This function gives each problem of one image of a run outside a manifest of the harness, as the
2576
- * kind lab records its images. A pulled image needs its digest. An image that a build makes needs
2577
- * its build record, with each base by digest. The build record must have the tag of the image.
2578
- */
2579
- export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
2580
- /**
2581
- * This function gives each problem of a manifest that stops it from pinning the programs of its
2582
- * run. An empty list means that the manifest pins each program.
2583
- * - the target: an image by its digest, or the build of a subject with its build record and its base
2584
- * by digest.
2585
- * - the harness: the version of its package, and the build record of its image.
2586
- * - the client: an image by its digest, or a build with its build record.
2587
- * - each hop: an image by its digest, or the tag of a build and the id of its image.
2588
- */
2589
- export declare const manifestProblems: (manifest: Manifest) => string[];
2590
- /** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
2591
- export declare const commitProblems: (commit: string | undefined) => string[];
2592
- /** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
2593
- interface RecordCode {
2594
- readonly commit: string;
2595
- readonly dirty: boolean;
2596
- }
2597
- /** These are the parts of a record that tell if it pins the programs of its runs. */
2598
- interface Pinnable {
2599
- readonly code?: RecordCode | undefined;
2600
- readonly manifests: readonly Manifest[];
2601
- /** A local debug run marks its record so. No page reads such a record. */
2602
- readonly debug?: boolean | undefined;
2603
- }
2604
- /** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
2605
- export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
2606
- /** This problem is the problem of a record of a local debug run. */
2607
- export declare const DEBUG = "the record is of a local debug run, and no page reads it";
2608
- /**
2609
- * This function gives each problem that stops a record from pinning the programs of its runs. A
2610
- * record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
2611
- * of a schedule refuses it. A commit with changes to tracked files is not a pin.
2612
- */
2613
- export declare const recordProblems: (record: Pinnable) => string[];
2614
2923
  /**
2615
2924
  * The disk tier applies a disk plan of `@mark1russell7/rigor-chaos` to the files of a program. Each fault starts one new
2616
2925
  * container of the shipped image `lazyfs`. LazyFS is a FUSE file system that keeps each write in its cache until an
@@ -3152,4 +3461,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
3152
3461
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
3153
3462
  */
3154
3463
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
3155
- export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskLayerRecord, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, RIG_TERMS, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RigTerm, type RigTermCell, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, TOXIC_RIG_TERMS, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf, rigTermsOf };
3464
+ export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskLayerRecord, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricArrival, type FabricControl, type FabricFault, type FabricFaultKind, type FabricGap, type FabricImage, type FabricLab, type FabricLabOptions, type FabricLeafRecord, type FabricManifest, type FabricParts, type FabricPinnable, type FabricRecord, type FabricRouteRecord, type FabricStamp, type FabricStreamRecord, type FabricTierLab, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafSessions, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, RIG_TERMS, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RigTerm, type RigTermCell, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SilenceDrops, type SocketPlace, type Spine, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, TOXIC_RIG_TERMS, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type VmArm, type VmBoot, type VmCase, type VmCellRecord, type VmControlCase, type VmFaultCase, type VmFaultKind, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf, rigTermsOf };