@mark1russell7/harness 0.16.0 → 0.16.2

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/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as Prediction, A as HostSysctl, At as Stage, B as LoadPlan, C as GroupPrediction, Ct as RunRoute, D as HopPlace, Dt as SentinelStage, E as HopEvent, Et as SentinelEvent, F as KafkaPause, Ft as Toxic, G as MiddleboxForm, H as LoadStream, I as KernelRecord, It as WsProbe, J as Pair, K as Observer, L as LineCount, Lt as environmentProblems, M as ImageSource, Mt as Subject, N as Jitter, Nt as Target, O as HopSignal, Ot as Shipped, P as Kafka, Pt as Topology, Q as PortsPrediction, R as LineMatch, Rt as isHopPlace, S as GroupPlace, St as RunPause, T as Hop, Tt as RunTopology, U as MiddleboxEvent, V as LoadPrediction, W as MiddleboxExpectation, X as PausePrediction, Y as PauseBand, Z as PinnedImage, _ as Fabric, _t as RunBackup, a as ClientCapability, at as QueueEnd, b as FaultPlace, bt as RunGroup, c as ClusterClientAt, ct as Recovers, d as CountBand, dt as ReplicaSetStage, et as ProbeEvent, f as DeliveryPrediction, ft as Replies, g as DriverStep, gt as Run, h as DriverBand, ht as RttRange, i as Client, it as QueueConnection, j as HttpProbe, jt as StageBand, k as HopWrite, kt as ShippedImage, l as ClusterStage, lt as Reference, m as DrillRoom, mt as RouterHop, n as CLIENT_CAPABILITIES, nt as ProxyTime, o as ClientImage, ot as QueuePrediction, p as Drill, pt as RequestPrediction, q as Outcomes, r as Cell, rt as QueueBand, s as Cluster, st as Reconnects, t as BuildImage, tt as ProxyHop, u as ConntrackPrediction, ut as ReplicaSet, v as FabricManifest, vt as RunDrill, w as GroupRole, wt as RunStream, x as Group, xt as RunPart, y as Fault, yt as RunFabric, z as LoadBand, zt as latestEndOf } from "./cell-CHFQ55Ks.js";
1
+ import { $ as Prediction, A as HostSysctl, At as Stage, B as LoadPlan, C as GroupPrediction, Ct as RunRoute, D as HopPlace, Dt as SentinelStage, E as HopEvent, Et as SentinelEvent, F as KafkaPause, Ft as Toxic, G as MiddleboxForm, H as LoadStream, I as KernelRecord, It as WsProbe, J as Pair, K as Observer, L as LineCount, Lt as environmentProblems, M as ImageSource, Mt as Subject, N as Jitter, Nt as Target, O as HopSignal, Ot as Shipped, P as Kafka, Pt as Topology, Q as PortsPrediction, R as LineMatch, Rt as isHopPlace, S as GroupPlace, St as RunPause, T as Hop, Tt as RunTopology, U as MiddleboxEvent, V as LoadPrediction, W as MiddleboxExpectation, X as PausePrediction, Y as PauseBand, Z as PinnedImage, _ as Fabric, _t as RunBackup, a as ClientCapability, at as QueueEnd, b as FaultPlace, bt as RunGroup, c as ClusterClientAt, ct as Recovers, d as CountBand, dt as ReplicaSetStage, et as ProbeEvent, f as DeliveryPrediction, ft as Replies, g as DriverStep, gt as Run, h as DriverBand, ht as RttRange, i as Client, it as QueueConnection, j as HttpProbe, jt as StageBand, k as HopWrite, kt as ShippedImage, l as ClusterStage, lt as Reference, m as DrillRoom, mt as RouterHop, n as CLIENT_CAPABILITIES, nt as ProxyTime, o as ClientImage, ot as QueuePrediction, p as Drill, pt as RequestPrediction, q as Outcomes, r as Cell, rt as QueueBand, s as Cluster, st as Reconnects, t as BuildImage, tt as ProxyHop, u as ConntrackPrediction, ut as ReplicaSet, v as FabricManifest, vt as RunDrill, w as GroupRole, wt as RunStream, x as Group, xt as RunPart, y as Fault, yt as RunFabric, z as LoadBand, zt as latestEndOf } from "./cell-CXxqXp1q.js";
2
2
  import { Quantity } from "@mark1russell7/quantity";
3
3
  import { LoadMeasure, Schedule } from "@mark1russell7/rigor-chaos";
4
4
  import { StartedTestContainer } from "testcontainers";
@@ -471,1539 +471,1853 @@ export declare const namesGroup: (line: string, group: string) => boolean;
471
471
  /** This function reads one run of a paused consumer against its law. */
472
472
  export declare const measurePause: (run: Run, prediction: PausePrediction) => Measured;
473
473
  /**
474
- * This module holds the pure parts of a recovery drill. These are the scripts of the shell, the reader
475
- * of the output of `bsondump`, and the set check of a recovery. It has no container, thus unit tests
476
- * run it. `drill.ts` does the drill on a lab.
474
+ * A fabric is a routed network between the client and the target, on layer E3 (docs/S7.md). Four
475
+ * routers of FRRouting, two leaves and two spines, run real BGP over veth pairs that containerlab
476
+ * makes. The client hangs off leaf1 and the target off leaf2. The path between them goes through
477
+ * spine1 by a weight, and spine2 holds the other path. A cell silences spine1, and the routes of
478
+ * the leaves move to spine2 when a detector of the routers fires.
477
479
  *
478
- * A dump with `--oplog` reads the oplog from the start of the dump to its end. A slice reads the
479
- * oplog after the last entry of the backup before it. Thus the backups together hold each write up
480
- * to the last entry of the last backup, and no write after it. One writer sends the writes one at a
481
- * time, thus the highest sequence number is also the latest write.
482
- */
483
- /** This size is one document of generated data. A tenant holds as many documents as its size needs. */
484
- export declare const SEED_DOCUMENT = 65536;
485
- /** This count is how far the lost writes can be from the writes after the last backup: the writes in flight at the fault. */
486
- export declare const LOSS_MARGIN = 2;
487
- /**
488
- * This function gives the most disk that a drill needs, from the disk that it can use. The peak comes
489
- * before the fault. Then each member holds the data and its oplog, and the backup host holds the
490
- * dump. The seed goes through the oplog, thus each oplog holds the data up to its own size. The
491
- * slices are small: the writes of one client in a few seconds.
480
+ * This file holds the plan of the fabric as pure functions, and `openFabric` that starts it. A lab
481
+ * opens a fabric with `Topology.fabric`. Thus the client, the target, the prober and the verdict
482
+ * stay the same as on layer E1. The fabric needs a Linux host with containerlab and sudo.
492
483
  */
493
- export declare const roomNeeded: (drill: Drill, members: number, disk: Quantity) => Quantity;
494
- /** This function gives MemAvailable from the text of `/proc/meminfo`. */
495
- export declare const memAvailableOf: (meminfo: string) => Quantity;
496
- /** This function gives the reason that a drill has no room on its runner, or null. A record from before SYS-97 has no room, and it is not void for this reason. */
497
- export declare const roomVoidOf: (room: DrillRoom | undefined) => string | null;
498
- /** This function gives the time of a drill from the start of the backups to the fault, in seconds. */
499
- export declare const drillSpan: (drill: Drill) => number;
484
+ /** This image is FRRouting 10.7.1, pinned by digest. */
485
+ export declare const FRR_IMAGE = "quay.io/frrouting/frr:10.7.1@sha256:e995beaa50fdc9edb35eadcfefa29b7f062cc06f2b812613789b68fa541554d2";
486
+ /** This device is the side of the fabric in the client and in the target. Docker keeps eth0. */
487
+ export declare const FABRIC_DEVICE = "eth1";
488
+ /** This address is the client on its network behind leaf1. */
489
+ export declare const FABRIC_CLIENT = "10.1.0.2";
490
+ /** This address is the target on its network behind leaf2. */
491
+ export declare const FABRIC_TARGET = "10.2.0.2";
492
+ /** A router is one box of the fabric, as data. */
493
+ interface Router {
494
+ readonly name: string;
495
+ readonly as: number;
496
+ readonly id: string;
497
+ readonly interfaces: Readonly<Record<string, string>>;
498
+ readonly neighbors: ReadonlyArray<{
499
+ readonly address: string;
500
+ readonly as: number;
501
+ readonly weight?: number;
502
+ }>;
503
+ /** This prefix is the network behind a leaf, which its BGP advertises. */
504
+ readonly network?: string;
505
+ /** This prefix is the network behind the other leaf. A move is a change of its route. */
506
+ readonly remote?: string;
507
+ }
508
+ /** These are the routers. Each leaf prefers spine1 by a weight of 100, thus the path of each run is known. */
509
+ export declare const ROUTERS: readonly Router[];
510
+ /** This text is the `daemons` file of each router: BGP and BFD, on top of what FRRouting always starts. */
511
+ export declare const DAEMONS: string;
500
512
  /**
501
- * This script writes the generated data of each tenant into the collection `tenants`. Each write
502
- * waits for `copies` members, thus each member holds the data when the script ends.
513
+ * This function gives the configuration of a router. Graceful restart is off: after a hold expiry,
514
+ * a helper can keep the stale routes, and the move that a cell measures does not come.
515
+ * `maximum-paths 1` keeps one path, thus a move is one change of one route.
503
516
  */
504
- export declare const seedScript: (drill: Drill, copies: number) => string;
505
- /** This script prints the hash of the collection `tenants`. It takes locks, thus a run reads it with no writer. */
506
- export declare const HASH_SCRIPT: string;
507
- /** This function gives the hash from the output of `HASH_SCRIPT`. */
508
- export declare const hashOf: (text: string) => string;
509
- /** This function gives the command of a server with no set, on its own port. A client of the set cannot reach that server, and a restore writes to it. */
510
- export declare const standaloneCommand: (set: ReplicaSet, port: number) => string;
517
+ export declare const frrConf: (router: Router, fabric: Fabric) => string;
511
518
  /**
512
- * This script waits for the end of the server of a box, and it can stop the server first. `kill -0`
513
- * also succeeds on a zombie, and the shell of the box can leave its child as a zombie for a long
514
- * time. Thus the script reads the state of the process, and a zombie has ended.
519
+ * This function gives the topology file of containerlab. The client and the target are containers
520
+ * of the lab, and the fabric adds a device to each. Each link has the MTU of a Docker network, thus
521
+ * a segment is as long as on layer E1. The default of containerlab is 9500. The management network
522
+ * belongs to the lab, and Docker chooses its subnet.
515
523
  */
516
- export declare const stopScript: (terminate: boolean) => string;
517
- /** An oplog time is the `ts` of an oplog entry: a time in seconds, and the count of the entry in that second. */
518
- interface OplogTime {
519
- readonly t: number;
520
- readonly i: number;
521
- }
522
- /** An oplog read is what an oplog file holds: its last entry, and the highest sequence number that it inserts. */
523
- interface OplogRead {
524
- readonly last: OplogTime | null;
525
- readonly highest: number | null;
524
+ export declare const topologyOf: (lab: string, dir: string, client: string, target: string) => string;
525
+ /** A route line is one line of `ip -ts -o monitor route`, with its time on the wall clock in ms. */
526
+ interface RouteLine {
527
+ readonly wall: number;
528
+ readonly deleted: boolean;
529
+ readonly prefix: string;
530
+ readonly via: string | null;
531
+ readonly dev: string | null;
526
532
  }
527
- /** This function reads an oplog file from the output of `bsondump`. Only an insert into `cells.w` is a write of a client. */
528
- export declare const readOplog: (text: string) => OplogRead;
529
- /** This function gives the highest sequence number of the file of the writes in a dump, from the output of `bsondump`, or null. */
530
- export declare const highestHeld: (text: string) => number | null;
531
- /** This function gives the query of a slice of the oplog: each entry after an oplog time, in Extended JSON. */
532
- export declare const sliceQuery: (after: OplogTime) => string;
533
- /** A recovery measurement is what a drill found, beside the writes of the run. */
534
- interface RecoveryMeasured {
535
- /** This time is from the reply to the last accepted write that the store kept to the fault, or null with no such write. */
536
- readonly rpo: Quantity | null;
537
- /** This time is `rpo` less the age of the drill: what a schedule adds to its interval. It is null for a control and for an election. */
538
- readonly excess: Quantity | null;
539
- /** These are the accepted writes that the store lost, below a write that it kept. A restore must leave none. */
540
- readonly holes: readonly number[];
541
- /** This count is the number of accepted writes after the last write of the last backup, or null without a backup. */
542
- readonly afterBackup: number | null;
543
- /** This flag tells if the tenants have the same data after the recovery, or null when that is not known. */
544
- readonly sameData: boolean | null;
533
+ /** This function reads a line of `ip -ts -o monitor route`, or it gives null for another line. The clock of a container is UTC. */
534
+ export declare const routeLine: (text: string) => RouteLine | null;
535
+ /** A clock pair is one instant on the monotonic clock in ns and on the wall clock in ms. */
536
+ interface ClockPair {
537
+ readonly mono: number;
538
+ readonly wall: number;
545
539
  }
546
- /** This function gives the measurement of a drill, from its run. `t0` is the fault. */
547
- export declare const recoveryOf: (drill: Drill, run: Run, t0: number) => RecoveryMeasured;
548
- /** This function gives the findings of a drill: each rule of a recovery that its run broke. */
549
- export declare const recoveryFindings: (measured: RecoveryMeasured, writes: Writes) => string[];
550
540
  /**
551
- * This module measures a run of a group cell. It gives the first write that a primary accepted
552
- * after the fault, and the timeline of the group. The Sentinels of a group announce its timeline.
553
- * The logs of the members of a replica set or of the nodes of a cluster, and its client, tell it. The
554
- * module also gives what became of each write.
541
+ * This function takes a time on the wall clock to the monotonic clock. The harness runs on the host
542
+ * of the containers, thus `process.hrtime` reads the CLOCK_MONOTONIC of the injector and the
543
+ * prober. The error of the pair is approximately 1 ms, the step of `Date.now`.
555
544
  */
556
- /** These are the stages of a timeline under Sentinels, in their sequence after a fault. */
557
- export declare const STAGES: readonly SentinelStage[];
558
- /** An error on the way is one kind of error that the client met after the fault. It has its first time from the fault, and its count. */
559
- interface ErrorOnTheWay {
560
- readonly name: string;
561
- readonly first: Quantity;
562
- readonly count: number;
545
+ export declare const monotonicAt: (wall: number, pair: ClockPair) => number;
546
+ /** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
547
+ export declare const sessionsOf: (json: string) => {
548
+ readonly up: number;
549
+ readonly established: number;
550
+ };
551
+ /** These are the views of a leaf that tell if a run can start on it. */
552
+ interface LeafViews {
553
+ readonly neighbors: string;
554
+ /** This text is the kernel's route to the far network, from `ip -o route show`. */
555
+ readonly route: string;
556
+ /** This text is `show bgp ipv4 unicast PREFIX json`. */
557
+ readonly paths: string;
558
+ /** This text is `show bfd peers json`, or null when the fabric has no BFD. */
559
+ readonly bfd: string | null;
563
560
  }
564
561
  /**
565
- * A writes record tells what became of the writes of a run, by their sequence numbers:
566
- * - `old` counts the writes that the primary of the start of the run accepted after the fault. A
567
- * cluster counts none: its client publishes through one node, not through the leader of the queue.
568
- * - `lost` are the writes that a primary accepted and the group did not keep. They are the cost
569
- * of a split brain. It is null when the group did not converge after the run.
570
- * - `unknown` are the writes that the client sent and did not see accepted: an error, or no answer.
571
- * `held` tells if the group kept each one, or null when it did not converge.
572
- * - `duplicates` has one entry for each extra copy that the group holds: a write held three times
573
- * has two entries. It is null when the group did not converge. A key holds one copy by
574
- * construction, thus only a list can show a copy.
562
+ * This function tells what a leaf still lacks before a run, or it gives null. The two sessions must
563
+ * be up and the route must be on spine1. Spine2 must hold the other path. Without these, the fault
564
+ * of a run acts on another path, or nothing can take over.
575
565
  */
576
- interface Writes {
577
- readonly sent: number;
578
- readonly acked: number;
579
- readonly old: number;
580
- readonly lost: readonly number[] | null;
581
- readonly unknown: ReadonlyArray<{
582
- readonly n: number;
583
- readonly held: boolean | null;
566
+ export declare const leafLacks: (views: LeafViews) => string | null;
567
+ /**
568
+ * This function gives the later move of the leaves after an instant: for each leaf, the first route
569
+ * to its far network that leaves spine1. It gives null when a leaf has no move. The later move ends
570
+ * the outage in the two directions.
571
+ */
572
+ export declare const laterMove: (routes: readonly RunRoute[], after: number) => number | null;
573
+ /** A fabric lab is the open fabric of a lab. */
574
+ interface FabricLab {
575
+ /** These are the lines of the route monitors of the leaves, on the monotonic clock. */
576
+ readonly routes: readonly RunRoute[];
577
+ /** This method drops each packet of spine1 in one commit, and the links stay up. */
578
+ silence(): Promise<{
579
+ t0: number;
580
+ t1: number;
584
581
  }>;
585
- readonly duplicates?: readonly number[] | null;
586
- /** These are the counts of a pair (`Cell.pair`), from its two final reads. */
587
- readonly sets?: PairSets;
588
- }
589
- /** These are the counts that the bands of `Outcomes` judge: each one has the same name there. */
590
- interface PairSets {
591
- readonly unknown: number;
592
- readonly kept: number;
593
- readonly stranded: number;
594
- readonly absent: number;
595
- readonly missing: number;
596
- readonly warnings: number;
582
+ /** This method ends a silence. */
583
+ clear(): Promise<{
584
+ t0: number;
585
+ t1: number;
586
+ }>;
587
+ /** This method waits until each leaf is on spine1 with each session up. */
588
+ ready(): Promise<void>;
589
+ /** This method gives the count of established sessions of each leaf so far. */
590
+ sessions(): Promise<Readonly<Record<string, number>>>;
591
+ /** This method gives the record of the fabric for a manifest. */
592
+ manifest(): FabricManifest;
593
+ /** This method destroys the routers. */
594
+ close(): Promise<void>;
597
595
  }
598
- /** A group measurement is what one run of a group cell measured, beside its time. */
599
- interface GroupMeasured {
600
- /** These are the member that was the primary at the start, and the member of the first accepted write after the fault. */
601
- readonly from: string;
602
- readonly to: string | null;
603
- /** These are the times of each stage from the fault: the first announcement by any Sentinel. A stage that no Sentinel announced is absent. */
604
- readonly stages: Partial<Record<Stage, Quantity>>;
605
- readonly writes: Writes;
606
- readonly errors: readonly ErrorOnTheWay[];
607
- /** These are the delays of the stamps of the observer after the writes of the Sentinels, for a calibration. */
608
- readonly lags?: readonly Quantity[];
609
- /** This is what a recovery drill measured, for a drill only. */
610
- readonly recovery?: RecoveryMeasured;
596
+ /** These are the parts of a lab that a fabric uses. */
597
+ interface FabricParts {
598
+ readonly fabric: Fabric;
599
+ readonly image: string;
600
+ readonly client: StartedTestContainer;
601
+ readonly server: StartedTestContainer;
602
+ readonly admin: StartedTestContainer;
603
+ readonly injector: StartedTestContainer;
604
+ readonly opened: StartedTestContainer[];
605
+ readonly output: (container: StartedTestContainer, argv: string[]) => Promise<string>;
611
606
  }
612
- /** This function gives the time of each stage of a timeline from an instant: the first announcement of each, after the instant. */
613
- export declare const stagesOf: (timeline: readonly SentinelEvent[], from: number) => Partial<Record<Stage, Quantity>>;
614
- /** These are the stages of the timeline of a replica set, in their usual sequence after a fault. */
615
- export declare const REPLICA_SET_STAGES: readonly ReplicaSetStage[];
616
607
  /**
617
- * A member mark is how a log line of mongod marks a stage: by its id, or by its message. The
618
- * message is the fallback for a version whose ids differ. `at` tells where the line comes from:
619
- * the old primary, or another member.
608
+ * This function deploys the routers of a lab and joins the client and the target to them. It also
609
+ * starts the sidecars: the injector of spine1 and a route monitor on each leaf. The caller stops the
610
+ * sidecars with the other containers of the lab, and it calls `close` first.
620
611
  */
621
- interface MemberMark {
622
- readonly ids: readonly number[];
623
- readonly message: RegExp;
624
- readonly at: "old" | "other";
625
- }
626
- /** These are the log lines of mongod that mark each stage of a member. */
627
- export declare const MEMBER_MARKS: Readonly<Record<Exclude<ReplicaSetStage, "discovered" | "written-off" | "first-write">, MemberMark>>;
612
+ export declare const openFabric: (parts: FabricParts) => Promise<FabricLab>;
613
+ /** These are the names of the images that the harness ships. */
614
+ export declare const SHIPPED_NAMES: readonly [Shipped, ...Shipped[]];
615
+ /** This function gives the source of a shipped image. */
616
+ export declare const shippedSource: (name: Shipped) => ImageSource;
617
+ /** This function gives the version of the package of the harness, from its package.json. */
618
+ export declare const harnessVersion: () => string;
628
619
  /**
629
- * This function gives the time of each stage of a replica set from an instant, in a run. The stages
630
- * of the members come from their log lines (`ev` "mongod"), whose times the lab puts on the
631
- * monotonic clock. The stages of the client come from its lines:
632
- * - `discovered`: a member other than the old primary becomes RSPrimary in the view of the client.
633
- * - `written-off`: the first heartbeat of the client to the old primary that fails.
634
- * - `first-write`: the first write that a primary accepts, of a write that the client sent after
635
- * the commit of the fault (`sentAfter`). It is on a new primary when `lands` is `new`.
620
+ * These are the clients that the harness ships, by their names (`Client`): the image of each, and
621
+ * its command. A cell that names a client gets this image and this command.
636
622
  */
637
- export declare const replicaSetStagesOf: (run: Run, from: number, sentAfter: number, lands: "new" | "same") => Partial<Record<Stage, Quantity>>;
638
- /** These are the stages of the timeline of a cluster of RabbitMQ, in their usual sequence after a fault. */
639
- export declare const CLUSTER_STAGES: readonly ClusterStage[];
623
+ export declare const SHIPPED_CLIENTS: Readonly<Record<Client, ClientImage>>;
624
+ /** These are the names of the clients that the harness ships. */
625
+ export declare const CLIENT_NAMES: readonly [Client, ...Client[]];
626
+ /** This function gives the command of a program of a subject by its role. It fails when the subject has no such program. */
627
+ export declare const programOf: (subject: Subject, role: string) => readonly string[];
640
628
  /**
641
- * These are the log lines of RabbitMQ that mark each stage of a cluster, by their message (ra 3.1.10,
642
- * ra_server_proc.erl:871, :1336-1345 and :1974). `at` tells where the line comes from: the node of the
643
- * old leader, or another node.
629
+ * This function gives the client of a subject for a cell (`Cell.client`): the image of the subject,
630
+ * with the command of a program. A client that the harness ships goes by its name, thus its records
631
+ * stay the same.
644
632
  */
645
- export declare const NODE_MARKS: Readonly<Record<Exclude<ClusterStage, "first-write">, {
646
- readonly message: RegExp;
647
- readonly at: "old" | "other";
648
- }>>;
633
+ export declare const subjectClient: (subject: Subject, role?: string) => Client | ClientImage;
634
+ /** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
635
+ export declare const PINNED: RegExp;
636
+ /** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
637
+ export declare const REPOSITORY: RegExp;
638
+ /** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
639
+ export declare const inContext: (path: string) => boolean;
649
640
  /**
650
- * This function gives the time of each stage of a cluster from an instant, in a run. The stages of
651
- * the nodes come from their log lines (`ev` "rabbit"), whose times the lab puts on the monotonic
652
- * clock. `first-write` is the first confirm of a publish that the client sent after the commit of
653
- * the fault (`sentAfter`), through any node.
641
+ * This function gives the problems of the source of an image, as data. A pinned image names a
642
+ * digest. A build names a repository, a context, and paths that stay in the context. A shipped image
643
+ * is one that the harness ships.
654
644
  */
655
- export declare const clusterStagesOf: (run: Run, from: number, sentAfter: number) => Partial<Record<Stage, Quantity>>;
656
- /** This function gives what became of each write of a run, from the lines of the client and the keys that the group kept. */
657
- export declare const writesOf: (run: Run, after: number, primary: string) => Writes;
658
- /** This function gives the errors that the client met after an instant: each kind, its first time, and its count. */
659
- export declare const errorsOf: (events: readonly ProbeEvent[], after: number) => ErrorOnTheWay[];
645
+ export declare const imageProblems: (source: ImageSource) => string[];
660
646
  /**
661
- * This function gives the delay of each stamp of the observer after the write of its Sentinel that
662
- * the observer read. That write is the latest write of the Sentinel's socket toward the observer,
663
- * at the stamp or before it. The prober records each write (`tx`) on the clock of the stamps.
647
+ * This function gives the problems of a subject, as data. A subject has a name and a base that a
648
+ * digest pins. Its image source has no problems, and each of its programs is a command.
664
649
  */
665
- export declare const lagsOf: (run: Run, kernel: readonly KernelRecord[]) => Quantity[];
666
- /** This type is the measurement of observe.ts, which a group run fills. */
667
- interface GroupReading {
668
- readonly outcome: {
669
- readonly kind: "answered";
670
- } | {
671
- readonly kind: "silent";
672
- };
673
- readonly elapsed: Quantity | null;
674
- readonly socket: Quantity | null;
675
- readonly noticed: Quantity | null;
676
- readonly void: string | null;
677
- readonly finding: string | null;
678
- readonly group: GroupMeasured;
679
- }
650
+ export declare const subjectProblems: (subject: Subject) => string[];
680
651
  /**
681
- * This function reads one run of a group cell.
682
- * - The reference is the start of the commit of the fault, as the injector stamped it. For a
683
- * stall, it is the first write into the fault, as for the stall of a direct pair.
684
- * - The outcome is the first write that a primary accepted after the fault. The prediction says
685
- * which primary: a new one, or the same one after the lift. In a replica set, it is the first
686
- * accepted write of a write that the client sent after the commit of the fault.
687
- * - The stages come from the Sentinels, or from the logs of the members of a replica set and the
688
- * lines of its client (`replicaSetStagesOf`).
689
- * - Its time is the last segment with data that the client's socket to that primary received
690
- * before the client saw the acceptance. The stamp of the client is the fallback.
691
- * - A run is void when the prober lost records, or when the client did not become ready. It is
692
- * also void when a Sentinel entered its TILT mode, or when the election split its votes. A band
693
- * from the fault whose commit took longer than δ_abs is void too. So is a band whose hold lifted
694
- * more than δ_abs late.
652
+ * This function gives each `FROM` of a Dockerfile that no digest pins. A `FROM` of an earlier stage
653
+ * by its name, or of `scratch`, needs no digest. A base from an `ARG` has no digest that the harness
654
+ * can read, thus it is in the list too.
695
655
  */
696
- export declare const measureGroup: (cell: Cell, run: Run) => GroupReading;
697
- /** This record is what a run of a port cell measured. */
698
- interface PortsReading {
699
- /** This count is the rounds of the run, each destination once. */
700
- readonly rounds: number;
701
- /** This record gives the count of searches for each count of connects, by that count. */
702
- readonly counts: Readonly<Record<string, number>>;
703
- /** These offsets from the low port are the ports that the run used, in rising order. */
704
- readonly seen: readonly number[];
705
- /** These errnos ended the searches of the run, each one time. */
706
- readonly errnos: readonly string[];
707
- /** This time is the longest connect that failed. */
708
- readonly refusal: Quantity;
709
- /** This time is from the `closing` line to the first `freed` line. */
710
- readonly firstFreed: Quantity | null;
711
- /** This time is from the `closing` line to the last `freed` line. */
712
- readonly lastFreed: Quantity | null;
713
- /** This count is the `freed` lines of the run. */
714
- readonly freed: number;
715
- /** This count is the connects that failed before the last `freed` line. */
716
- readonly tries: number;
717
- }
656
+ export declare const unpinnedBases: (dockerfile: string) => string[];
718
657
  /**
719
- * This function reads one run of a port cell. The `round` lines give each search. The `closing` and
720
- * `freed` lines give when each held port comes back. The records of the prober give the
721
- * retransmissions.
658
+ * This function gives each base of a Dockerfile, in the sequence of the file. A base is the image of
659
+ * a `FROM` that is not `scratch` or an earlier stage by its name.
722
660
  */
723
- export declare const measurePorts: (run: Run, expected: PortsPrediction) => Measured;
724
- /** This record is what one connection of a queue cell did, from its lines and the records of its socket. */
725
- interface QueueConnectionReading {
726
- readonly name: string;
727
- readonly connected: boolean;
728
- /** These times are the waits of the SYN. The first one counts from the dial. */
729
- readonly syns: readonly Quantity[];
730
- /** These times are the waits of each SYN-ACK sent again. The first one counts from the dial. */
731
- readonly synAcks: readonly Quantity[];
732
- /** This count is the segments that the socket sent again. */
733
- readonly retransmissions: number;
734
- readonly errno: string | null;
735
- /** This time is from the line of the prediction to the end of the connection. It is null for a live connection, or with no prediction. */
736
- readonly ended: Quantity | null;
737
- /** This time is from the last retransmission to the end of the connection. */
738
- readonly afterLast: Quantity | null;
739
- /** This count is the segments of the socket with no acknowledgment at the end of the run. */
740
- readonly unacked: number | null;
741
- }
742
- /** This record is what a run of a queue cell measured. The counts are the changes in the run. */
743
- interface QueueReading {
744
- readonly max: number;
745
- readonly held: number;
746
- readonly connected: number;
747
- readonly overflows: number;
748
- readonly drops: number;
749
- readonly cookies: number;
750
- readonly timeouts: number;
751
- readonly resets: number;
752
- readonly drained: number;
753
- /** This time is from the first dial of the burst to the last `TCPTimeouts` of the prediction. */
754
- readonly expiry: Quantity | null;
755
- /** This time is from the first dial of the burst to the rise of the count of the queue. */
756
- readonly rise: Quantity | null;
757
- readonly connections: readonly QueueConnectionReading[];
758
- }
661
+ export declare const basesOf: (dockerfile: string) => string[];
759
662
  /**
760
- * This function reads one run of a queue cell. The client lines give the connections and the
761
- * counters at the two ends of the run. The target lines give the count of the queue. The records of
762
- * the prober give the waits of each socket.
663
+ * This function gives each manifest of packages in a context (`package.json`, `Cargo.toml`) that
664
+ * has no lockfile in its folder or in a folder above it. The paths are the paths in the context.
763
665
  */
764
- export declare const measureQueue: (run: Run, expected: QueuePrediction) => Measured;
765
- /** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
766
- export declare const requestWords: (outcome: {
767
- readonly connection: "reused" | "new";
768
- readonly retried: boolean;
769
- readonly error: string | null;
770
- readonly pending?: boolean | undefined;
771
- }) => string;
666
+ export declare const unlockedManifests: (paths: readonly string[]) => string[];
772
667
  /**
773
- * This amount is the noise of the pipeline itself, δ_abs, as the calibration measured it. It is
774
- * the 99.9th percentile of the whole latency of a reset, at the concurrency cap or less. Its
775
- * minimum is one jiffy. On 2026-10-12 the worst of 60 resets at 1 and 4 environments took
776
- * 1.141 ms, thus the minimum sets it to 4 ms. The calibration occurs again after each change to
777
- * the harness, the kernel or Docker.
668
+ * An image plan tells how the harness gets the image of a source. It is a pull of an image by its
669
+ * name, or a build of a context. A build has its tag, its Dockerfile, and each file with its path.
778
670
  */
779
- export declare const NOISE: Quantity;
671
+ type ImagePlan = {
672
+ readonly kind: "pull";
673
+ readonly image: string;
674
+ } | {
675
+ readonly kind: "build";
676
+ readonly tag: string;
677
+ readonly dockerfile: string;
678
+ readonly files: ReadonlyArray<{
679
+ readonly file: string;
680
+ readonly at: string;
681
+ }>;
682
+ /** This record tells what the image holds, for the manifest of a run. */
683
+ readonly record: BuildRecord;
684
+ };
780
685
  /**
781
- * This time is how late the injector can commit or lift a fault before the run is void. Stage 0
782
- * measures the commit apart from δ_abs, and the commit is longer. On a hosted runner it took up to
783
- * 2.75 ms at 4 environments, where δ_abs is 1 ms. Thus a cell's δ_abs does not change it.
686
+ * A build record tells what an image that the harness builds holds, for the manifest of a run. The
687
+ * tag is a sha256 of each file of the context. The bases are pinned by digest, and each lockfile
688
+ * has its sha256. Thus the record pins each program of the image. The versions are the part that a
689
+ * person reads.
784
690
  */
785
- export declare const INJECT: Quantity;
786
- /** A time from the fault is one time of a run from the start of the commit of its fault. It has the edges of the band that judges it. */
787
- interface TimeFromFault {
788
- readonly at: Quantity;
789
- readonly low: Quantity;
790
- readonly high: Quantity;
691
+ interface BuildRecord {
692
+ readonly tag: string;
693
+ /** These are the bases of its Dockerfile, each pinned by digest (`basesOf`). */
694
+ readonly bases: readonly string[];
695
+ /** These are the lockfiles of its context by their path, each with the sha256 of its content (`locksOf`). */
696
+ readonly locks: Readonly<Record<string, string>>;
697
+ /** These are the versions of the packages that its manifests name directly, by their names (`versionsOf`). */
698
+ readonly versions: Readonly<Record<string, string>>;
791
699
  }
792
700
  /**
793
- * This function gives the void of a run from the commit of its fault, or null (SYS-99). A fault
794
- * starts somewhere in its commit, thus each time from the start of the commit is too long by the
795
- * commit or less. A commit up to `INJECT` is in the noise. A longer commit voids the run only when
796
- * that shift can move a time across an edge of its band. Thus a drill with a band of minutes keeps
797
- * a run with a commit of 8 ms. `times` holds each time that a band judges, with the edges of the
798
- * verdict. A run with no time is void.
701
+ * This function gives the plan of the image of a source. A stock image by its name, or a pinned
702
+ * image, is a pull. A build or a shipped image is a build. Its tag is its name, then 12 digits of a
703
+ * sha256. The sha256 reads the path of the Dockerfile, and the path and the content of each file.
704
+ * Thus a changed program cannot operate as an old one.
705
+ *
706
+ * A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
707
+ * digest pins, and on a manifest of packages without a lockfile.
799
708
  */
800
- export declare const commitVoid: (commit: Quantity, times: readonly TimeFromFault[]) => string | null;
801
- /** This function gives the δ_abs of a cell: its own, or `NOISE` for a cell that gives none. */
802
- export declare const noiseOf: (cell: {
803
- readonly noise?: Quantity | undefined;
804
- }) => Quantity;
709
+ export declare const planOf: (source: string | ImageSource) => ImagePlan;
805
710
  /**
806
- * A pairing is the window of a run in which a line of its program pairs with the kernel's record
807
- * of its act. `bound` is the jitter of the program that the run measured, or null. `delta` is the
808
- * window: δ_abs of the cell, or the bound when the bound is longer.
711
+ * This function gives an image that a lab can start, from its source. It is the name of a stock
712
+ * image or of a pinned image, which the lab pulls, or the tag of a build. A build goes through the CLI
713
+ * of Docker.
809
714
  */
810
- interface Pairing {
811
- readonly bound: Quantity | null;
812
- readonly delta: Quantity;
813
- }
715
+ export declare const imageOf: (source: string | ImageSource) => Promise<string>;
814
716
  /**
815
- * This function gives the pairing window of a run (SYS-25). On a runner of GitHub, the jitter of
816
- * a program can be longer than the δ_abs of 1 ms. Thus each run measures it before its fault
817
- * (`Run.jitter`), and its own measurement widens its window. A run without a jitter record is
818
- * from before SYS-25. It reads as a bound of null, thus its window is δ_abs. The decision of
819
- * 2026-10-19 keeps the rule of one miss: a pair that a window misses is still a finding.
717
+ * This function gives the build record of the image of a source, for the manifest of a run. A
718
+ * stock image by its name, or a pinned image, is a pull, and it has no build record.
820
719
  */
821
- export declare const pairingOf: (cell: {
822
- readonly noise?: Quantity | undefined;
823
- }, run: Pick<Run, "jitter">) => Pairing;
824
- /**
825
- * This function sums the pairings of the measurements of a cell. It gives the longest bound and
826
- * the longest window. It also counts the pairings whose window is longer than δ_abs (`noise`). It
827
- * is null when no measurement has a pairing.
828
- */
829
- export declare const pairingsOf: (runs: readonly Measured[], noise?: Quantity) => {
830
- readonly bound: Quantity | null;
831
- readonly delta: Quantity;
832
- readonly widened: number;
833
- } | null;
720
+ export declare const buildRecordOf: (source: string | ImageSource) => BuildRecord | undefined;
721
+ /** This function gives the image of the harness: the prober, the TCP client, the injector and the namespace admin. */
722
+ export declare const harnessImage: () => Promise<string>;
723
+ /** This function gives the image of the Node client. */
724
+ export declare const nodeClientImage: () => Promise<string>;
725
+ /** This function gives the image of the router. */
726
+ export declare const routerImage: () => Promise<string>;
727
+ /** This function gives the image of the Go HTTP client. */
728
+ export declare const goHttpImage: () => Promise<string>;
729
+ /** This function gives the image of the Node HTTP clients. */
730
+ export declare const nodeHttpImage: () => Promise<string>;
731
+ /** This function gives the image of the MongoDB client. */
732
+ export declare const mongoClientImage: () => Promise<string>;
733
+ /** This function gives the image of the PostgreSQL client. */
734
+ export declare const pgClientImage: () => Promise<string>;
735
+ /** This function gives the image of the client of HikariCP over pgjdbc. */
736
+ export declare const hikariClientImage: () => Promise<string>;
737
+ /** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
738
+ export declare const amqpClientImage: () => Promise<string>;
739
+ /** This function gives the image of the Kafka client: kafka-clients on Java, with the client and the admin of a Kafka cell. */
740
+ export declare const kafkaClientImage: () => Promise<string>;
741
+ /** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
742
+ export declare const grpcClientImage: () => Promise<string>;
834
743
  /**
835
- * This function tells if a timer firing came late enough to void a run. A firing two jiffies or
836
- * more behind its wheel slot came late because the host stopped a vCPU. With the HZ of the run,
837
- * the rule is in time: the delay must also reach δ_abs, because each band already includes that
838
- * noise. At HZ 250 two jiffies are 8 ms, more than a δ_abs of 4 ms. At HZ 1000 they are 2 ms.
744
+ * This function gives the source of the image that a target operates. It is the image of its
745
+ * subject (`Target.subject`), or its stock image.
839
746
  */
840
- export declare const delayVoids: (behind: number, hz: number | undefined, noise: Quantity) => boolean;
841
- /** This fraction, δ_rel, is how far the median of a cell can be outside the prediction and stay equivalent. */
842
- export declare const RELATIVE = .05;
843
- /** These are the run counts of a cell: 11, then 22 and 44 while its median crosses the edge of the band. */
844
- export declare const STEPS: readonly [11, 22, 44];
747
+ export declare const targetSourceOf: (target: Target) => string | ImageSource;
748
+ /** This function gives the image that a target operates: the image of its subject, or its stock image. */
749
+ export declare const targetImageOf: (target: Target) => Promise<string>;
845
750
  /**
846
- * A decision is the result of a verdict. A cell whose outcome is a distribution has no band, and
847
- * its decision is `measured`: a record, not a test.
751
+ * A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a
752
+ * cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.
753
+ * A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this
754
+ * time.
848
755
  */
849
- type Decision = "holds" | "fails" | "extend" | "inconclusive" | "measured";
850
- /** An interval is a range of times. */
851
- interface Interval {
852
- readonly low: Quantity;
853
- readonly high: Quantity;
854
- }
855
- /** A spread is the distribution of a set of times: its count, its median and its upper quantiles by nearest rank. */
856
- interface Spread {
857
- readonly count: number;
858
- readonly median: Quantity;
859
- readonly p99: Quantity;
860
- readonly p999: Quantity;
861
- readonly max: Quantity;
862
- }
863
- /** A verdict is the judgement of a cell on its runs. */
864
- interface Verdict {
865
- readonly decision: Decision;
866
- readonly counted: number;
867
- readonly voided: number;
868
- /** This band is where each run must land: [T_lo − δ_abs, T_hi + δ_abs]. It is null for a silent prediction. */
869
- readonly band: Interval | null;
870
- /** These are the runs outside the band, and the reason for each. Each is a finding. */
871
- readonly outside: ReadonlyArray<{
872
- readonly run: string;
873
- readonly why: string;
874
- }>;
875
- readonly median: Quantity | null;
876
- /** This interval is the order-statistic interval of the median at 95 %, or the whole range for fewer than six runs. */
877
- readonly medianInterval: Interval | null;
878
- /** This time is the slowest reply of a cell that measures a distribution. A closed loop hides the sends in a stall, thus a quantile is a lower bound, and this maximum is not. */
879
- readonly slowest?: Quantity;
880
- /** This record is the sum of what reordering did in each counted run of a measurement-only cell. */
881
- readonly reordering?: Reordering;
882
- /** This record is the load of an open-loop cell over its counted runs. */
883
- readonly load?: LoadVerdict;
884
- /** This record is the estimate of the open loop of a closed-loop stream over its counted runs (SYS-91). */
885
- readonly estimate?: EstimateVerdict;
886
- /** This record is the time of the proxy of a calibration cell, in each direction. */
887
- readonly proxy?: {
888
- readonly hop: string;
889
- readonly up: Spread | null;
890
- readonly down: Spread | null;
891
- };
892
- /** This record is what the group of a group cell did over the counted runs: its stages, and its writes. */
893
- readonly group?: GroupVerdict;
894
- /**
895
- * These are the outcomes of the second request of an HTTP client over the counted runs, each
896
- * with its count: for example "reused, a retry, a reply". An outcome other than the predicted
897
- * one is a finding of its run.
898
- */
899
- readonly requests?: Readonly<Record<string, number>>;
900
- /** This record is what the client did after the detection over the counted runs, for a prediction that says when it reconnects. */
901
- readonly reconnect?: ReconnectVerdict;
902
- /** These are the outcomes of the call in flight of a WebSocket client over the counted runs, each with its count. */
903
- readonly calls?: Readonly<Record<string, number>>;
904
- /**
905
- * This record is the time from a drop of the program to the close of its socket by its own side,
906
- * over the counted runs. It also counts the runs where the socket did not close itself.
907
- * `exited` is the spread of the end of the client process, for the runs where the socket stayed
908
- * open until that end (`Measured.exited`).
909
- */
910
- readonly left?: {
911
- readonly spread: Spread | null;
912
- readonly stayed: number;
913
- readonly exited?: Spread | null;
914
- };
915
- readonly why: string;
756
+ export declare const LAYERS: readonly ["E0", "E1", "E2", "E3", "E4", "E5", "E6"];
757
+ type Layer = (typeof LAYERS)[number];
758
+ /** A cloud is where the runner operates. GitHub can schedule a standard Linux job on Azure or on AWS. */
759
+ export declare const CLOUDS: readonly ["azure", "aws", "unknown"];
760
+ type Cloud = (typeof CLOUDS)[number];
761
+ /** A host is what a process reads about its own machine. */
762
+ interface Host {
763
+ /** This text is the kernel release. */
764
+ readonly kernel: string | null;
765
+ /** This number is `CONFIG_HZ` from the configuration of the kernel, or null without that file. */
766
+ readonly hz: number | null;
767
+ /** This text is the DMI system vendor, for example `Microsoft Corporation`, or null without that file. */
768
+ readonly vendor: string | null;
769
+ /** This value tells if `/dev/kvm` exists. A later VM layer needs it. */
770
+ readonly kvm: boolean;
771
+ /** This text is `$ImageOS $ImageVersion` of a hosted runner, or null elsewhere. */
772
+ readonly image: string | null;
916
773
  }
917
774
  /**
918
- * A reconnect verdict sums the reconnect of the client over the counted runs. Each wait before a
919
- * try gets its spread. A wait outside its band is a finding of its run, thus it is in `outside`.
920
- * - `syn` is the time from the detection to the first SYN of a new socket.
921
- * - `established` is the time from the detection to the first new socket that became ESTABLISHED.
922
- * - `connect` is the time from a `dial` line to the SYN of its socket: the work of the program.
775
+ * A substrate tells where a record comes from. The rules of comparison in `docs/S7.md` read it: no
776
+ * statistic pools two layers, two kernels or two clouds. The digest of each image stays in the
777
+ * manifest. A value is null in a record from before this block.
923
778
  */
924
- interface ReconnectVerdict {
925
- readonly waits: ReadonlyArray<Spread | null>;
926
- readonly syn: Spread | null;
927
- readonly established: Spread | null;
928
- readonly connect: Spread | null;
779
+ interface Substrate {
780
+ readonly layer: Layer;
781
+ readonly cloud: Cloud;
782
+ readonly vendor: string | null;
783
+ readonly kernel: string | null;
784
+ readonly hz: number | null;
785
+ readonly kvm: boolean | null;
786
+ readonly image: string | null;
929
787
  }
788
+ /** GitHub announced Linux jobs on AWS on this date. Each earlier hosted job ran on Azure. */
789
+ export declare const AWS_FROM = "2026-10-28";
790
+ /** This function gives the cloud of a DMI vendor. A kernel name does not tell: one image can start on each cloud. */
791
+ export declare const cloudOf: (vendor: string | null) => Cloud;
792
+ /** This function reads the host. `root` and `env` are for tests. */
793
+ export declare const readHost: (root?: string, env?: Readonly<Record<string, string | undefined>>, kernel?: string) => Host;
794
+ /** This function gives the substrate of a layer on a host. */
795
+ export declare const substrateOn: (layer: Layer, host?: Host) => Substrate;
930
796
  /**
931
- * A stage verdict is the test of one stage of the timeline of a group against its band. The band
932
- * is [T_lo − δ_abs, T_hi + the error of the stamps + δ_abs]. A run that did not announce the stage
933
- * is outside too.
797
+ * This function gives the substrate of a lab at this place. A guest cannot read its own runner: its
798
+ * DMI vendor is QEMU, and `ImageOS` is not set. Thus the runner writes its host to `LAB_RUNNER`, and
799
+ * the guest keeps only its own kernel and HZ. A value of that variable makes the layer E4.
934
800
  */
935
- interface StageVerdict {
936
- readonly stage: Stage;
937
- readonly band: Interval;
938
- readonly median: Quantity | null;
939
- readonly outside: ReadonlyArray<{
940
- readonly run: string;
941
- readonly why: string;
942
- }>;
943
- readonly decision: "holds" | "fails";
801
+ export declare const substrateHere: (layer: Layer, host?: Host, env?: Readonly<Record<string, string | undefined>>) => Substrate;
802
+ /** A CPU reading is two counters of `/proc/stat`, in ticks of the clock. */
803
+ interface CpuTime {
804
+ /** This count is the time that the host gave to another guest while this one had work. */
805
+ readonly steal: number;
806
+ /** This count is the sum of all states of each CPU. */
807
+ readonly total: number;
944
808
  }
809
+ /** This function reads the CPU time of this machine, or gives null without `/proc/stat`. `root` is for tests. */
810
+ export declare const readCpu: (root?: string) => CpuTime | null;
945
811
  /**
946
- * A group verdict sums what the group of a group cell did in its counted runs:
947
- * - `stages` tests each stage that the prediction gives a band.
948
- * - `medians` is the median of each stage that a run announced, from the fault.
949
- * - `lost` counts the writes that a primary accepted and the group did not keep, in each run.
950
- * - `old` counts the writes that the old primary accepted after the fault, in each run.
951
- * - `unknown` counts the writes whose outcome the client did not see, and how many the group kept.
952
- * - `errors` are the errors on the way: the runs that met each, and the median of its first time.
953
- * - `lags` is the spread of the delays of the stamps, for a calibration.
954
- * - `duplicates` counts the extra copies that the group holds, in each run. A cell with no band of
955
- * copies has no such count.
812
+ * This function gives the share of the CPU time between two readings that the host took. The share
813
+ * goes from zero to one. It is null if no tick passed. A guest sees only the host above it. On a hosted
814
+ * runner that host is itself a guest, and this number does not show the contention of the layer below it.
956
815
  */
957
- interface GroupVerdict {
958
- readonly stages: readonly StageVerdict[];
959
- readonly medians: Partial<Record<Stage, Quantity>>;
960
- readonly lost: {
961
- readonly runs: number;
962
- readonly total: number;
963
- readonly median: number | null;
964
- readonly max: number | null;
965
- };
966
- readonly old: {
967
- readonly median: number | null;
968
- readonly max: number | null;
969
- };
970
- readonly unknown: {
971
- readonly total: number;
972
- readonly held: number;
973
- };
974
- readonly errors: ReadonlyArray<{
975
- readonly name: string;
976
- readonly runs: number;
977
- readonly first: Quantity;
978
- }>;
979
- readonly lags?: Spread | null;
980
- readonly duplicates?: {
981
- readonly runs: number;
982
- readonly total: number;
983
- readonly median: number | null;
984
- readonly max: number | null;
985
- };
816
+ export declare const stealShare: (before: CpuTime, after: CpuTime) => number | null;
817
+ /** A part of a record that can hold a substrate: a manifest of the harness, or the fields of a kind manifest. */
818
+ interface SubstrateSource {
819
+ readonly substrate?: Substrate;
820
+ readonly kernel?: string;
821
+ readonly hz?: string | null;
986
822
  }
987
823
  /**
988
- * This function gives the value at quantile p of sorted values, by nearest rank: x_(⌈p·n⌉). It is
989
- * `quantileSorted` of @mark1russell7/rigor-statistics with the method `"nearest-rank"`.
824
+ * This function reads the substrate of a record, the upgrade of a record from before this block.
825
+ * Nothing rewrites such a record. It reads as the given layer. Its cloud is Azure if the record is
826
+ * from before `AWS_FROM`, and unknown after that date, because its runner did not record the cloud.
990
827
  */
991
- export declare const quantileOf: (sorted: readonly number[], p: number) => number;
992
- /** This function gives the spread of a set of times, or null for none. */
993
- export declare const spreadOf: (times: readonly Quantity[]) => Spread | null;
828
+ export declare const substrateOf: (source: SubstrateSource, at: string, layer?: Layer) => Substrate;
994
829
  /**
995
- * This function gives the distribution-free interval of a median: [x_(k), x_(n+1−k)], for the
996
- * largest k whose two tails each hold 2.5 % or less. For eleven runs, it gives [x_(2), x_(10)],
997
- * at 98.8 %. It is `medianInterval` of @mark1russell7/rigor-statistics at the level 0.95. An
998
- * empty list throws a RangeError.
830
+ * This function tells if a statistic can pool two substrates. They must have one layer, one kernel
831
+ * and one cloud. An unknown value does not refuse a pair, because an old record cannot tell. The
832
+ * reader of such a pair says so with `substrateKey`.
999
833
  */
1000
- export declare const medianInterval: (sorted: readonly number[]) => [number, number];
834
+ export declare const comparable: (a: Substrate, b: Substrate) => boolean;
835
+ /** This function gives the one-line name of a substrate, for a summary. */
836
+ export declare const substrateKey: (substrate: Substrate) => string;
1001
837
  /**
1002
- * This function gives the verdict of a cell, from two tests:
1003
- * - Containment: each run lands in [T_lo − δ_abs, T_hi + δ_abs]. A run outside is a finding.
1004
- * - Median equivalence: the interval of the median is in the band, made wider by δ_rel. An
1005
- * interval outside the band fails. An interval across its edge extends the cell to 22 runs, then
1006
- * 44, and then the verdict is inconclusive.
1007
- *
1008
- * A silent prediction holds only if no run detected the fault in its window. After a stall, the
1009
- * return of the reply gets the same test as a detection, by its interval, and a detection is a
1010
- * finding. The distribution test (a DKW band) needs a predicted distribution from a simulator,
1011
- * which does not exist at this time.
838
+ * This function gives the first two substrates that a statistic cannot pool, or undefined. It
839
+ * examines each pair. An unknown value matches Azure and AWS, thus one comparison with the first
840
+ * substrate can miss a pair.
1012
841
  */
1013
- export declare const verdictOf: (prediction: Prediction, runs: readonly Measured[], noise?: Quantity) => Verdict;
1014
- /** This function sums what the group of a group cell did in its counted runs, and tests each stage that has a band. */
1015
- export declare const groupVerdictOf: (prediction: Prediction, counted: readonly Measured[], delta?: Quantity) => GroupVerdict;
842
+ export declare const unpoolable: (substrates: readonly Substrate[]) => readonly [Substrate, Substrate] | undefined;
1016
843
  /**
1017
- * An outcome tells how the wait of a run ended. The socket failed with an errno, or it read the
1018
- * end of the file. Or nothing came, or the reply came back after a stall. The observer can also
1019
- * close the connection itself (`closed`), or its program can drop it on its own timer (`dropped`).
844
+ * This time is the interval of the listing of a router, when its hop does not set one. A listing
845
+ * evicts each expired flow that it walks past, and the DESTROY event of that flow follows.
1020
846
  */
1021
- type Outcome = {
1022
- readonly kind: "error";
1023
- readonly errno: string;
1024
- } | {
1025
- readonly kind: "eof";
1026
- } | {
1027
- readonly kind: "silent";
1028
- } | {
1029
- readonly kind: "answered";
1030
- } | {
1031
- readonly kind: "closed";
1032
- } | {
1033
- readonly kind: "dropped";
1034
- };
847
+ export declare const PUMP: Quantity;
1035
848
  /**
1036
- * A request reading is what the second request of an HTTP client met, from the lines of the
1037
- * client. It holds the connection of its first try, a new try, and its outcome. `gap` is the time
1038
- * from the end of the first reply to the send of the second request.
849
+ * This time is the longest listing of the conntrack table of a router that a prediction assumes.
850
+ * A DESTROY follows an expiry within the interval of the pump and two listings. On 2026-10-15,
851
+ * the slowest of 500 listings in an idle router took 19.4 ms, and the median took 5.5 ms. A
852
+ * longer listing writes a `pump-slow` line, and a run with one near its detection is void.
1039
853
  */
1040
- interface RequestReading {
1041
- readonly connection: "reused" | "new";
1042
- readonly retried: boolean;
1043
- readonly error: string | null;
1044
- readonly pending: boolean;
1045
- readonly gap: Quantity | null;
1046
- }
1047
- /** A measurement is what one run measured, against the prediction of its cell. */
1048
- interface Measured {
1049
- readonly environment: number;
1050
- readonly index: number;
1051
- readonly outcome: Outcome;
1052
- /**
1053
- * This time is from the reference event of the prediction to the detection, both as the kernel
1054
- * stamped them in the records of the prober. It is null when nothing detected the fault.
1055
- */
1056
- readonly elapsed: Quantity | null;
1057
- /** This time is the same interval from the TCP_INFO samples of the client, the second vantage. */
1058
- readonly socket: Quantity | null;
1059
- /** This time is how long the client took to see the error after the kernel reported it. */
1060
- readonly noticed: Quantity | null;
854
+ export declare const LISTING: Quantity;
855
+ /**
856
+ * This time is how late the pump of a router can be beyond its interval and its two listings. The
857
+ * pump sleeps after each listing, and the sleep can end late. The watcher also reads and stamps each
858
+ * event within a millisecond. Thus a DESTROY follows an expiry within the interval of the pump, two
859
+ * listings and this slack. It is an assumption: in run 39116866471, two of 11 forgets came 1.6 ms
860
+ * and 2.2 ms after the pump and two listings.
861
+ */
862
+ export declare const PUMP_SLACK: Quantity;
863
+ /**
864
+ * A network fault is a fault that the injector applies as a filter rule. It is a black hole (both
865
+ * directions, or one), or a reset on the next segment. It can also be an ICMP unreachable for each
866
+ * segment, or a drop of each segment that is longer than a length. It can also be a drop of the
867
+ * first ACK of each FIN that the namespace sends.
868
+ *
869
+ * A silence drops each packet of the namespace of a hop, in its three chains, and it names no peer.
870
+ * The links stay up and ARP continues, thus a connect through a silent router times out.
871
+ */
872
+ type NetworkFault = "blackhole" | "rst" | "reject" | "mtu" | "fin-ack" | "silence";
873
+ /**
874
+ * These are the options of a network fault: its direction and its protocol. A reject takes a code,
875
+ * an MTU drop a length, and a reset its handshake.
876
+ */
877
+ interface FaultOptions {
1061
878
  /**
1062
- * These are the steps of the kernel after the reference: each keepalive probe, or each firing of
1063
- * the RTO timer. After a stall, they are each retransmission from the send, the loss probe first.
879
+ * This direction is relative to the namespace of the rule: `in` acts on what comes from the peer,
880
+ * `out` on what goes to it. A black hole without it acts on both. A reject without it acts on `in`.
881
+ * At a router, `out` acts on what the router forwards through its device to the peer.
1064
882
  */
1065
- readonly steps: readonly Quantity[];
883
+ readonly direction?: "in" | "out";
1066
884
  /**
1067
- * These are the reply times of a measurement-only cell. For each request after the first, a
1068
- * sample is the time from its send to the first data after it.
885
+ * This protocol limits a black hole or a reject. A black hole without it drops each protocol. A
886
+ * reject without it rejects only TCP. The value `all` acts on each protocol.
1069
887
  */
1070
- readonly samples?: readonly Quantity[];
1071
- /** This measure is the run of an open-loop cell against its schedule (`Run.schedule`), with its failed replies. Its times are in ms. */
1072
- readonly load?: RunLoad;
1073
- /** This estimate is the open loop that a closed-loop stream of the client of the harness hid (SYS-91). Its times are in ms. */
1074
- readonly estimate?: RunEstimate;
1075
- /** This count is the number of keepalive probes that the kernel sent. */
1076
- readonly probes: number;
1077
- /** This count is the number of segments that the kernel sent again. */
1078
- readonly retransmissions: number;
1079
- /** This count is the number of segments that the socket received after the request. */
1080
- readonly acks: number;
1081
- /** This count is the number of bytes that the client read after the request. */
1082
- readonly bytes?: number;
888
+ readonly protocol?: "tcp" | "udp" | "icmp" | "all";
889
+ readonly code?: "host" | "net" | "port" | "admin";
890
+ /** This length is the longest segment in bytes that an MTU drop lets through. */
891
+ readonly above?: number;
1083
892
  /**
1084
- * This time is when a router of the topology forgot the flow of the client. It counts from the
1085
- * last segment that the client received before the fault. It is null when no router forgot the flow.
893
+ * This value lets each SYN of a reset pass. The connect then succeeds, and the next segment of
894
+ * the peer gets the reset. Without it, the SYN also gets the reset.
1086
895
  */
1087
- readonly forgot?: Quantity | null;
896
+ readonly handshake?: "pass";
897
+ /** These are the addresses that the rule faces, in place of the peer of its place. */
898
+ readonly peers?: readonly string[];
899
+ }
900
+ /**
901
+ * A fault side is the namespace that gets the rules of a fault: the namespace of the peer of the
902
+ * observer. For the client, it is the namespace of the target (the injector). For the server, it
903
+ * is the namespace of the client (its privileged admin). Rules in the namespace of the observer
904
+ * make its sends fail locally, with EPERM, and the network does not lose them. Thus its
905
+ * retransmissions do not go out. The retransmission tracepoint of the kernel then records none,
906
+ * because it fires only for a retransmission that went out.
907
+ */
908
+ type FaultSide = "target" | "client";
909
+ /** A hop of a manifest is one hop of a topology, as the lab started it. */
910
+ interface ManifestHop {
911
+ readonly name: string;
912
+ readonly kind: "router" | "proxy";
913
+ readonly image: string;
914
+ readonly id: string;
915
+ /** These are the settings of the hop: the form and the idle timeout of a router, the files and settings of a proxy. */
916
+ readonly settings: Readonly<Record<string, string>>;
917
+ /** These are the sysctls of the namespace of the hop, as read back after the harness set them. */
918
+ readonly sysctls: Readonly<Record<string, string>>;
919
+ }
920
+ /** This record is one sysctl of the host for one environment, as the harness read it. */
921
+ interface HostSetting {
922
+ readonly name: string;
923
+ readonly before: string;
924
+ readonly set: string;
925
+ /** This value is the read after the restore. It is null until the restore. */
926
+ readonly restored: string | null;
927
+ }
928
+ /** A manifest is what a lab records about its machine, its images and its settings. */
929
+ interface Manifest {
930
+ readonly kernel: string;
931
+ /** This text is the architecture of the machine, as uname -m gives it: x86_64. */
932
+ readonly architecture: string;
933
+ readonly hz: string | null;
1088
934
  /**
1089
- * This time is the first round trip of the socket of the observer. It is the smoothed round trip
1090
- * in its first record, which is the sample of the handshake. It is null when no record has it.
935
+ * This text tells where the HZ came from: the configuration of the kernel, or a measurement. A
936
+ * host without /proc/config.gz (a hosted runner) gets a measurement of jiffies against the clock.
1091
937
  */
1092
- readonly rtt?: Quantity | null;
1093
- /** This record tells what reordering did in a run of a measurement-only cell, from the records of its two ends. */
1094
- readonly reordering?: Reordering;
1095
- /** These are the times of the proxy of a calibration cell, one for each request and its reply. */
1096
- readonly crossings?: Crossings;
1097
- /** This record is what a run of a group cell measured: the stages of its timeline, and what became of each write. */
1098
- readonly group?: GroupMeasured;
1099
- /** This record is what a run of a queue cell measured: the count of the queue, its counters, and each connection. */
1100
- readonly queue?: QueueReading;
1101
- /** This record is what a run of a port cell measured: the count of each search, and when each port came back. */
1102
- readonly ports?: PortsReading;
1103
- /** This record is what a run of a conntrack cell measured: the flows, the count, and when a slot came back. */
1104
- readonly conntrack?: ConntrackReading;
1105
- /** This record is what the second request of an HTTP client met, for a cell whose prediction says it. */
1106
- readonly request?: RequestReading | null;
1107
- /** This record is the time of each later band of a driver cell (`DriverBand.then`). */
1108
- readonly driver?: {
1109
- readonly steps: readonly DriverStepTime[];
938
+ readonly hzFrom?: "config" | "measured";
939
+ readonly boot_id: string;
940
+ readonly docker: string;
941
+ /** This block tells the layer, the cloud and the kernel of the record. A record from before it reads through `substrateOf`. */
942
+ readonly substrate?: Substrate;
943
+ /** This record is the fabric of a cell with `Topology.fabric`. */
944
+ readonly fabric?: FabricManifest;
945
+ /** This record is the target, and its settings as it read them back. */
946
+ readonly target: {
947
+ readonly image: string;
948
+ /** This source is the image of the subject that the target operates (`Target.subject`), with its stock base. */
949
+ readonly subject?: ImageSource;
950
+ readonly base?: string;
951
+ readonly id: string;
952
+ readonly settings: Readonly<Record<string, string>>;
953
+ /** These are the sysctls of its namespace, as read back after the harness set them. */
954
+ readonly sysctls: Readonly<Record<string, string>>;
955
+ /** These are the files that went into the target, by their path, each with the sha256 of its content. */
956
+ readonly files?: Readonly<Record<string, string>>;
957
+ /** This line is the first line of a target that writes them: a server that tells its settings as it reads them. */
958
+ readonly first?: ProbeEvent;
959
+ /** This record tells what the image of a target holds when the harness builds it: the image of a subject (`buildRecordOf`). */
960
+ readonly build?: BuildRecord;
1110
961
  };
1111
- /** This record is what the client did after the detection, for a prediction that says when it reconnects. */
1112
- readonly reconnect?: ReconnectReading;
1113
- /** This record is what the call in flight of a WebSocket client met. */
1114
- readonly call?: CallReading;
1115
- /** This record is what a stream that crossed the fault delivered, for a prediction with a delivery law. */
1116
- readonly delivery?: DeliveryReading;
1117
- /**
1118
- * This time is from the drop line of the program to the close of its socket by its own side: a
1119
- * FIN or an abort. A prediction that says how the program drops (`drop`) gets it. It is null
1120
- * when the socket did not close itself in the run. A prediction can say that the client process
1121
- * ends with the run (`exits`). Then a close at that end is no close by the program, and `left` is null.
1122
- */
1123
- readonly left?: Quantity | null;
1124
962
  /**
1125
- * This time is from the drop line of the program to the end of the client process. A socket gets
1126
- * it when it stayed open until that end. The kernel closed it then, not the program (`exits`).
963
+ * This record is the harness: its image, the id of that image and its Alpine packages. It also
964
+ * has the version of the package of the harness, and the build of its image. The record of a
965
+ * cell gives the commit of the code that operated.
1127
966
  */
1128
- readonly exited?: Quantity;
967
+ readonly harness: {
968
+ readonly image: string;
969
+ readonly id: string;
970
+ readonly packages: string[];
971
+ readonly version?: string;
972
+ readonly build?: BuildRecord;
973
+ };
1129
974
  /**
1130
- * This record is the pairing window of the run: the jitter bound that it measured, and the
1131
- * window that its pairings used (`pairingOf`). A run that has a jitter record gets it. Thus a
1132
- * reader can check each pairing of the run again.
975
+ * This record is the client of each run: the TCP client of the harness, a driver, or an image that
976
+ * the cell gives. `source` is the source of its image, when it is not a stock image by its name.
1133
977
  */
1134
- readonly pairing?: Pairing;
1135
- /** This record is what a run of a paused consumer measured. */
1136
- readonly pause?: PauseReading;
1137
- /** This text is the reason that the run cannot count, or null. A void run is not a pass and not a finding. */
1138
- readonly void: string | null;
1139
- /** This text tells what in the run disagrees with the prediction, other than its timing, or null. */
1140
- readonly finding: string | null;
1141
- }
1142
- /**
1143
- * A reordering record is what reordering, duplicates and losses did to the data of a run. The
1144
- * receiver is the client, and the sender is the socket of its peer.
1145
- * - `outOfOrder` counts the arrivals at the client beyond a hole, and `duplicates` counts the
1146
- * arrivals whose data the client had. The prober reads the two from each arrival, against `rcv_nxt`.
1147
- * - An arrival can hold more than one segment. The kernel joins the segments that wait in the
1148
- * backlog of a socket while its owner holds it.
1149
- * - `ooo` is the count of the kernel of the client in segments (`rcv_ooopack`).
1150
- * - `sacked` and `lost` are the most segments that the sender held as SACKed and as lost.
1151
- * - `dsacks` is the DSACK blocks that the sender received, and `fast` its fast retransmissions.
1152
- * - `degree` is the highest reordering degree of the sender (`tp->reordering`), and `seen` the
1153
- * reorderings that it detected (`reord_seen`).
1154
- *
1155
- * The counts of the kernel are null for a record of the prober before version 0.2.
1156
- */
1157
- interface Reordering {
1158
- readonly outOfOrder: number;
1159
- readonly duplicates: number;
1160
- readonly ooo: number | null;
1161
- readonly sacked: number | null;
1162
- readonly lost: number | null;
1163
- readonly dsacks: number | null;
1164
- readonly fast: number;
1165
- readonly degree: number | null;
1166
- readonly seen: number | null;
1167
- }
1168
- /**
1169
- * A crossings record is the time of a proxy for each request (`up`) and for each reply (`down`).
1170
- * The time of a request starts at its arrival on the socket toward the client. It stops at the
1171
- * write on the socket toward the target. The time of a reply goes the other way. A write is a
1172
- * `tx` record of the prober.
1173
- */
1174
- interface Crossings {
1175
- readonly hop: string;
1176
- readonly up: readonly Quantity[];
1177
- readonly down: readonly Quantity[];
978
+ readonly client: {
979
+ readonly kind: Client | "image";
980
+ readonly image: string;
981
+ readonly capabilities?: readonly ClientCapability[];
982
+ readonly source?: ImageSource;
983
+ readonly build?: BuildRecord;
984
+ };
985
+ /** These are the namespaces that the prober watched, by inode. */
986
+ readonly netns: {
987
+ readonly client: number;
988
+ readonly target: number;
989
+ readonly hops?: Readonly<Record<string, number>>;
990
+ };
991
+ /** These are the sysctls of the client namespace, as read back after the harness set them. */
992
+ readonly sysctls: Readonly<Record<string, string>>;
993
+ /** These are the sysctls of the host that the cell set: each value before, as set, and as restored. */
994
+ readonly host?: readonly HostSetting[];
995
+ /** These are the hops of a topology, in sequence from the client. */
996
+ readonly hops?: readonly ManifestHop[];
997
+ /** These are the parts of a group, with their settings as each part read them back. */
998
+ readonly group?: {
999
+ readonly members: ReadonlyArray<{
1000
+ readonly name: string;
1001
+ readonly ip: string;
1002
+ readonly id: string;
1003
+ readonly settings: Readonly<Record<string, string>>;
1004
+ }>;
1005
+ readonly sentinels: ReadonlyArray<{
1006
+ readonly name: string;
1007
+ readonly ip: string;
1008
+ readonly id: string;
1009
+ readonly settings: Readonly<Record<string, string>>;
1010
+ }>;
1011
+ readonly observer: {
1012
+ readonly image: string;
1013
+ };
1014
+ };
1178
1015
  }
1179
- /** A socket place is a socket of a run: its namespace and its cookie. */
1180
- interface SocketPlace {
1016
+ /** These are the JSON lines of a program, as they arrive. */
1017
+ interface Lines<T extends {
1018
+ readonly ev: string;
1019
+ }> {
1020
+ readonly seen: T[];
1021
+ /** These are the other lines that it wrote, for example an error. They explain a program that stopped its output. */
1022
+ readonly other: string[];
1023
+ consume: (stream: NodeJS.ReadableStream) => void;
1024
+ /** This method gives the first line of one of these kinds, or it rejects after `within` ms. */
1025
+ until(kinds: readonly string[], within: number, who: string): Promise<T>;
1026
+ }
1027
+ /** A probe is the client container of one run. */
1028
+ interface Probe {
1029
+ /** This method gives the first event of one of these kinds, or it rejects after `within` ms. */
1030
+ until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
1031
+ /** This method lets an in-flight probe send its request. */
1032
+ go(): Promise<void>;
1033
+ /** This method freezes the client with the cgroup freezer: its process stops, and its kernel continues to answer. */
1034
+ freeze(): Promise<void>;
1035
+ thaw(): Promise<void>;
1036
+ /** This method stops the process of the client with SIGKILL. Its kernel then closes its socket with a FIN, or a reset. */
1037
+ kill(): Promise<void>;
1038
+ readonly events: readonly ProbeEvent[];
1039
+ stop(): Promise<void>;
1040
+ }
1041
+ /** An agent is a container that a lab starts in the namespaces of the target, for example a Node process that signals the server. */
1042
+ interface Agent {
1043
+ /** These are the JSON lines that it wrote, as they arrive. */
1044
+ readonly lines: Lines<{
1045
+ readonly ev: string;
1046
+ }>;
1047
+ /** This method starts a command in the agent, and gives its standard output. */
1048
+ exec(argv: readonly string[]): Promise<string>;
1049
+ stop(): Promise<void>;
1050
+ }
1051
+ /** A sibling is a server that a lab starts on the network of the target, for example a standby. */
1052
+ interface Sibling {
1053
+ readonly ip: string;
1181
1054
  readonly netns: number;
1182
- readonly cookie: number;
1055
+ /** This method starts a command in the sibling, and gives its standard output. */
1056
+ exec(argv: readonly string[]): Promise<string>;
1057
+ }
1058
+ /** A lab is one environment: the target, the client, the hops of a topology, the injectors and the prober. */
1059
+ interface Lab {
1060
+ /** This address is the address of the target on its own network. */
1061
+ readonly serverIp: string;
1062
+ /** This address is the address that the client connects to: the target, or the first proxy of a topology. */
1063
+ readonly targetIp: string;
1064
+ /** This port is the port that the client connects to. */
1065
+ readonly targetPort: number;
1066
+ readonly clientIp: string;
1067
+ readonly netns: {
1068
+ readonly client: number;
1069
+ readonly target: number;
1070
+ readonly hops?: Readonly<Record<string, number>>;
1071
+ };
1072
+ /** This record is where each socket of a topology is, or null for a direct pair. */
1073
+ readonly topology: RunTopology | null;
1074
+ /** These are the lines of the routers of a topology, in sequence, each with the name of its hop. A direct pair has none. */
1075
+ readonly middlebox: readonly MiddleboxEvent[];
1076
+ /** These are the lines of a target that writes them (`Target.lines`), in sequence. Another target has none. */
1077
+ readonly server: readonly ProbeEvent[];
1078
+ /** This method adds a toxic to the Toxiproxy hop of a topology, or removes it with null. The stamps of the injector bracket it. */
1079
+ toxic(toxic: Toxic | null): Promise<{
1080
+ t0: number;
1081
+ t1: number;
1082
+ }>;
1083
+ /** This method makes the target close the connection of each client, with the command of the target. */
1084
+ serverClose(): Promise<void>;
1085
+ /**
1086
+ * This method starts an agent in the network namespace of the target, and in its process
1087
+ * namespace with `pid`. Its command keeps it up, for example `sleep infinity`.
1088
+ */
1089
+ agent(image: string, command: readonly string[], options?: {
1090
+ readonly pid?: boolean;
1091
+ }): Promise<Agent>;
1092
+ /** This method starts a sibling, and waits for a line of its log. */
1093
+ sibling(image: string, command: readonly string[], ready: string): Promise<Sibling>;
1094
+ /** This method starts a command in the target, and gives its standard output. */
1095
+ exec(argv: readonly string[]): Promise<string>;
1096
+ /** These are all the records that the prober wrote, in sequence. */
1097
+ readonly kernel: readonly KernelRecord[];
1098
+ /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
1099
+ sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1100
+ /** This method sets the settings of the target in it before a client connects, and reads them back. */
1101
+ configure(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1102
+ /** This method sets the sysctls of the target namespace through a privileged sidecar there, and reads them back. */
1103
+ targetSysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1104
+ /** This method runs each command in the namespace of the client and in the namespace of the target. */
1105
+ namespaceSetup(commands: readonly (readonly string[])[]): Promise<void>;
1106
+ /** This method sets sysctls of the host through a privileged sidecar on the network of the host, and reads them back. */
1107
+ hostSysctl(settings: readonly HostSysctl[]): Promise<void>;
1108
+ /** This method puts back each value that `hostSysctl` changed, once, and gives the record of each. Closing the lab also does it. */
1109
+ restoreHost(): Promise<readonly HostSetting[]>;
1110
+ /**
1111
+ * This method applies a fault between the client and the target, by default from the namespace
1112
+ * of the target. The fault is a black hole, or a reset that answers the next segment of the
1113
+ * client. At a proxy of a topology, the rules face the peer of the proxy on one side. The stamps
1114
+ * of the injector bracket it.
1115
+ *
1116
+ * A silence at a hop drops each packet of the hop. Thus a router stops its forward and its
1117
+ * answers, and ARP continues.
1118
+ */
1119
+ fault(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<{
1120
+ t0: number;
1121
+ t1: number;
1122
+ }>;
1123
+ /** This method removes a fault. */
1124
+ lift(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<void>;
1125
+ /**
1126
+ * This method puts tc netem on the egress of a namespace, for example "delay 20ms" or "loss 5%",
1127
+ * or removes it with null. At a hop, it is the egress of the device of the hop toward one side.
1128
+ * The stamps of the injector bracket it.
1129
+ */
1130
+ netem(spec: string | null, at?: FaultPlace): Promise<{
1131
+ t0: number;
1132
+ t1: number;
1133
+ }>;
1134
+ /**
1135
+ * This method sets the TSO, GSO and GRO of a namespace. With them off, netem and a length match
1136
+ * act on segments, not on GSO super-packets of up to 64 KB. At a hop, it sets the two devices of the hop.
1137
+ */
1138
+ offload(on: boolean, at?: FaultPlace): Promise<void>;
1139
+ /** This method stops the server process in the target with SIGKILL, with the command of the target. */
1140
+ kill(): Promise<void>;
1141
+ /**
1142
+ * This method resolves the neighbors of the path in the two directions, with a ping from each
1143
+ * namespace. Without it, the first connection of an environment waits for ARP. Under a netem
1144
+ * delay, that wait is one more delayed round, and its round trip and RTO are longer.
1145
+ */
1146
+ warm(): Promise<void>;
1147
+ /** This method runs commands in the target before a client connects, each as argv. */
1148
+ setup(commands: ReadonlyArray<readonly string[]>): Promise<void>;
1149
+ /**
1150
+ * This method stops a black hole at an instant on the monotonic clock of the VM. The injector
1151
+ * waits for that instant in the VM, thus the length of a stall does not include the latency of
1152
+ * a docker exec. Stamps bracket it, as for a fault.
1153
+ */
1154
+ heal(at: FaultPlace, when: number): Promise<{
1155
+ t0: number;
1156
+ t1: number;
1157
+ }>;
1158
+ /**
1159
+ * This method removes what the two kernels learned from their earlier connections. These are
1160
+ * the TCP metrics that each kernel keeps for a peer address when a connection closes. These metrics set the
1161
+ * first round trip of the next connection, and thus its RTO. A run with these metrics is not
1162
+ * independent of the run before it.
1163
+ */
1164
+ forget(): Promise<void>;
1165
+ /** This part is the routed fabric of a lab with `Topology.fabric`. */
1166
+ readonly fabric?: FabricLab;
1167
+ /** This method freezes the target with the cgroup freezer: its process stops, and its kernel continues to answer. */
1168
+ freeze(): Promise<void>;
1169
+ thaw(): Promise<void>;
1170
+ /**
1171
+ * This method sends a signal to the server process of the target (`Target.program`), at once or
1172
+ * at an instant of the VM. A sidecar in the network and process namespaces of the target sends
1173
+ * it, and the injector stamps it. The lab starts that sidecar at the first signal.
1174
+ */
1175
+ signal(signal: "STOP" | "CONT" | "KILL", at?: number): Promise<{
1176
+ t0: number;
1177
+ t1: number;
1178
+ }>;
1179
+ /**
1180
+ * This method applies an event at a proxy hop (`HopEvent`), or its undo. A signal goes from a
1181
+ * sidecar in the network and process namespaces of the hop. The lab starts that sidecar at the
1182
+ * first signal of the hop. A query goes from the injector of the hop to its console on 127.0.0.1. The
1183
+ * injector stamps each one. An event with no undo gives null for its undo. A signal can wait for an
1184
+ * instant on CLOCK_MONOTONIC (`at`), as the thaw at the end of a hold does.
1185
+ */
1186
+ event(event: HopEvent, undo?: boolean, at?: number): Promise<{
1187
+ t0: number;
1188
+ t1: number;
1189
+ } | null>;
1190
+ /** This method starts the client with `args`. Each file is in its container before it starts. */
1191
+ probe(args: readonly string[], files?: ReadonlyArray<{
1192
+ readonly content: string;
1193
+ readonly target: string;
1194
+ }>): Promise<Probe>;
1195
+ /**
1196
+ * This method waits for the next clock line of the prober, which gives the count of lost
1197
+ * records. It gives null when no clock line comes in 5 s, because then nothing tells the count.
1198
+ */
1199
+ settle(): Promise<number | null>;
1200
+ manifest(sysctls: Readonly<Record<string, string>>, settings?: Readonly<Record<string, string>>, targetSysctls?: Readonly<Record<string, string>>): Promise<Manifest>;
1201
+ close(): Promise<void>;
1183
1202
  }
1184
1203
  /**
1185
- * This function finds the socket of the observer of a cell in a run:
1186
- * - the client socket, by the address that it connected from, in its namespace.
1187
- * - the socket of the target for the same connection, in its namespace.
1188
- * - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
1189
- * it is the socket that carries the request, else the first socket that the run opens.
1204
+ * This function gives the content of a file of a proxy. Each {{next}} becomes the address and the
1205
+ * port of the next hop. Each {{next.host}} and {{next.port}} becomes one of the two.
1190
1206
  */
1191
- export declare const socketOf: (cell: Cell, run: Run) => SocketPlace | undefined;
1192
- /** This function gives what reordering did in a run, from the records of the receiver and of the sender. */
1193
- export declare const reorderingOf: (receiver: readonly KernelRecord[], sender: readonly KernelRecord[]) => Reordering;
1207
+ export declare const templated: (content: string, next: string) => string;
1208
+ /** This function gives the JSON body of a toxic for the API of Toxiproxy. Each toxic of a cell has the name `fault`. */
1209
+ export declare const toxicBody: (toxic: Toxic) => string;
1194
1210
  /**
1195
- * This function gives the times of a proxy in a run, for each request after the first. The time
1196
- * of a request starts at its arrival on the socket of the proxy toward the client. It stops at the
1197
- * next write on the socket toward the target. The time of its reply starts at its arrival on the
1198
- * socket toward the target, and it stops at the next write toward the client. A request without
1199
- * each record gives no time.
1211
+ * This function gives the routes of a chain: for each router, the networks after it, which the
1212
+ * element before it reaches through it. Element 0 is the client, and element k is hop k - 1. Network
1213
+ * j is the network between element j and element j + 1.
1214
+ */
1215
+ export declare const routesOf: (hops: readonly Pick<Hop, "kind">[]) => Array<{
1216
+ readonly from: number;
1217
+ readonly via: number;
1218
+ readonly networks: readonly number[];
1219
+ }>;
1220
+ /**
1221
+ * This function gives the endpoint that an element connects to: the first element after it that
1222
+ * is not a router. Element 0 is the client, element k is hop k - 1, and the last element is the target.
1223
+ */
1224
+ export declare const endpointAfter: (hops: readonly Pick<Hop, "kind">[], element: number) => number;
1225
+ /**
1226
+ * This function gives HZ from two readings of /proc/timer_list, one second apart: its `now at`
1227
+ * time in ns and its jiffies. It gives the nearest rate that Linux offers, or null when the
1228
+ * measurement is more than 5 % from each of them.
1229
+ */
1230
+ export declare const hzOf: (first: {
1231
+ now: number;
1232
+ jiffies: number;
1233
+ }, second: {
1234
+ now: number;
1235
+ jiffies: number;
1236
+ }) => string | null;
1237
+ /** This function gives the build record of a source as a part of a manifest: `{ build }`, or nothing for an image that the harness pulls. */
1238
+ export declare const buildOf: (source: Parameters<typeof buildRecordOf>[0]) => {
1239
+ readonly build?: BuildRecord;
1240
+ };
1241
+ /** This function gives the version of the harness and the build of its image, as a part of the harness record of a manifest. */
1242
+ export declare const harnessRecord: () => {
1243
+ readonly version: string;
1244
+ readonly build?: BuildRecord;
1245
+ };
1246
+ /**
1247
+ * This function gives the record of the client of a run that the harness ships, for a manifest:
1248
+ * its kind, its image, and its build.
1249
+ */
1250
+ export declare const shippedClientRecord: (kind: Client, image: string) => Manifest["client"];
1251
+ /** This function gives the device of a route from its line in `ip -o route get`: "10.0.0.2 dev eth0 src …". */
1252
+ export declare const deviceOf: (route: string) => string;
1253
+ /**
1254
+ * This function opens one environment:
1255
+ * - a chain of new networks, and the stock target on the last one. A direct pair has one network.
1256
+ * - a client that holds its own network namespace, with a privileged sidecar in it for its
1257
+ * sysctls and its routes. Docker Desktop keeps /proc/sys read-only in a container that operates
1258
+ * without privileges.
1259
+ * - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
1260
+ * proxy with an injector sidecar in its namespace.
1261
+ * - an injector sidecar in the namespace of the target.
1262
+ * - the prober, a privileged container that loads the kernel program and watches the namespace of
1263
+ * the client, of the target and of each hop.
1264
+ *
1265
+ * The client of each run is its own container in the namespace of the client. It is the TCP
1266
+ * client of the harness, a driver from its own image (ioredis on Node), or an image that the
1267
+ * caller gives. Each prints the same lines.
1268
+ *
1269
+ * The client reaches the networks after a router through that router, by a route that its
1270
+ * privileged sidecar adds. A router translates the address of the side of the client, thus the
1271
+ * target and each later hop see the router as the peer.
1200
1272
  */
1201
- export declare const crossingsOf: (run: Run, hop: string, toClient: SocketPlace | undefined, toTarget: SocketPlace | undefined) => Crossings;
1273
+ export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology) => Promise<Lab>;
1202
1274
  /**
1203
- * This function reads one run against its cell, from the records of the kernel first.
1204
- * - The socket of the run is the socket of its observer. It is the socket that the client connected
1205
- * from, in its namespace, or the socket of the target or of a proxy for that connection.
1206
- * - The fault must hold before the event that it must meet. That is before the request goes into
1207
- * it, and before the first keepalive probe. A live peer answers that probe, and the answer
1208
- * starts the idle time again. A run where the fault was late is void. A run whose records the
1209
- * prober lost is also void.
1210
- * - For an HTTP client, it also reads what the second request met (`requestOf`). An outcome other
1211
- * than the one that the prediction gives is a finding.
1275
+ * This module is the lab of a replicated group: a primary and its replicas, and the Sentinels
1276
+ * that decide which member is the primary. It opens one environment for a group cell, and it does
1277
+ * the runs of the cell in it. Each member and each Sentinel is a container from the stock image of
1278
+ * the group, in its own network namespace. An injector sidecar shares its network and process
1279
+ * namespaces. The client of each run is ioredis in Sentinel mode. An observer subscribes to the
1280
+ * events of each Sentinel, and the prober watches the namespace of the client.
1212
1281
  */
1213
- export declare const measure: (cell: Cell, run: Run) => Measured;
1282
+ /** A stamp is the time of the injector around one commit, on CLOCK_MONOTONIC in nanoseconds. */
1283
+ interface Stamp {
1284
+ readonly t0: number;
1285
+ readonly t1: number;
1286
+ }
1287
+ /** A group network fault is a black hole between a part and its peers, or a reset of each segment from them. */
1288
+ type GroupNetworkFault = "blackhole" | "rst";
1289
+ /** A group client is the client container of one run of a group cell. */
1290
+ interface GroupClient {
1291
+ readonly events: readonly ProbeEvent[];
1292
+ until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
1293
+ stop(): Promise<void>;
1294
+ }
1295
+ /** A group lab is one environment of a group cell. */
1296
+ interface GroupLab {
1297
+ readonly group: Group;
1298
+ readonly clientIp: string;
1299
+ readonly observerIp: string;
1300
+ readonly members: Readonly<Record<string, RunPart>>;
1301
+ readonly sentinels: Readonly<Record<string, RunPart>>;
1302
+ /** These are the namespaces that the prober watches: the client, and the Sentinels for a calibration. */
1303
+ readonly netns: {
1304
+ readonly client: number;
1305
+ readonly watched: readonly number[];
1306
+ };
1307
+ /** These are all the records that the prober wrote, in sequence. */
1308
+ readonly kernel: readonly KernelRecord[];
1309
+ /** These are all the lines of the observer of the Sentinels, in sequence. */
1310
+ readonly timeline: readonly SentinelEvent[];
1311
+ /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
1312
+ sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1313
+ /** This method waits until the group is whole and calm, and gives the name of its primary. */
1314
+ converge(within?: number): Promise<string>;
1315
+ /** This method removes each key from the group, and waits until each replica has the removal. */
1316
+ flush(primary: string): Promise<void>;
1317
+ /** This method makes each Sentinel forget the state of the group (`SENTINEL RESET`): an aborted failover then holds off no later failover. */
1318
+ reset(): Promise<void>;
1319
+ /** This method gives the sequence numbers that the group holds, from its primary. */
1320
+ holds(primary: string): Promise<number[]>;
1321
+ /** This method gives the part that has a role in the group, when `primary` is the primary. */
1322
+ partOf(role: GroupRole, primary: string): string;
1323
+ /** This method starts the client of a run, with the arguments of `client-sentinel.mjs`. */
1324
+ client(args: readonly string[]): Promise<GroupClient>;
1325
+ /** This method applies a network fault between a part and some of its peers, at once or at an instant of the VM. */
1326
+ fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
1327
+ /** This method removes a network fault, at once or at an instant of the VM. */
1328
+ lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
1329
+ /** This method sends a signal to the server process of a part, at once or at an instant of the VM. */
1330
+ signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
1331
+ /** This method starts the server of a member again, after a fin. */
1332
+ restart(member: string): Promise<void>;
1333
+ /** This method asks the first Sentinel for a failover of the group. */
1334
+ failover(coordinated: boolean): Promise<Stamp>;
1335
+ /** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
1336
+ forget(): Promise<void>;
1337
+ /** This method waits for the next clock line of the prober, which gives the count of lost records. */
1338
+ settle(): Promise<number | null>;
1339
+ manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
1340
+ close(): Promise<void>;
1341
+ }
1342
+ /** This function gives the configuration file of a member: its port, its settings, and the primary that a replica follows. */
1343
+ export declare const memberConfig: (group: Group, primary: string | null) => string;
1344
+ /** This function gives the configuration file of a Sentinel: its port, the group that it monitors, and the settings of the group. */
1345
+ export declare const sentinelConfig: (group: Group, primary: string) => string;
1214
1346
  /**
1215
- * This function measures the jitter of the program of the observer in a run, from its records
1216
- * (`Jitter`). The acts count up to the start of the fault, or up to the reply of the client when
1217
- * the fault has no stamp. A run with no lines of a program, or no socket of the observer, has no act.
1347
+ * This function gives the peers that a fault on a part cuts it from, by their addresses. `all` is
1348
+ * each other part and the client, `group` is the other parts, and `clients` and `to-clients` are
1349
+ * the client. `one` and `one-way` are the first other member. The observer is not a peer, thus the timeline of the
1350
+ * group stays whole.
1218
1351
  */
1219
- export declare const jitterOf: (cell: Cell, run: Run) => Jitter;
1352
+ export declare const peersOf: (parts: {
1353
+ readonly members: Readonly<Record<string, RunPart>>;
1354
+ readonly sentinels: Readonly<Record<string, RunPart>>;
1355
+ }, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => string[];
1356
+ /** This function reads the flat reply of a command line client into its fields: name, value, name, value. */
1357
+ export declare const fieldsOf: (text: string) => Array<Record<string, string>>;
1358
+ /** This function reads the INFO of a server into its fields. */
1359
+ export declare const infoOf: (text: string) => Record<string, string>;
1220
1360
  /**
1221
- * This function reads the second request of an HTTP client from its lines. Its first try is its
1222
- * first `request` line, and each `retry` line is a new try. Its end is its `error` line, or its
1223
- * `replied` line. A request with neither is pending. It gives null when the client wrote no try.
1224
- *
1225
- * A new try that gets no connection writes no `retry` line. Its dial writes a `dial-error` line.
1226
- * Thus a `dial-error` line after the first try and before the end is also a new try.
1361
+ * A view of the group is what its parts tell at one time. `healthy` tells if each Sentinel agrees
1362
+ * on one primary with no flag but `master`, and knows each replica and each other Sentinel. Each
1363
+ * replica must follow that primary with its link up, and the primary must have each replica online,
1364
+ * with no failover in progress.
1227
1365
  */
1228
- export declare const requestOf: (events: readonly ProbeEvent[]) => RequestReading | null;
1366
+ interface GroupView {
1367
+ readonly primary: string | null;
1368
+ readonly healthy: boolean;
1369
+ readonly why: string;
1370
+ }
1371
+ /** This function judges the views of the Sentinels and of the members: the primary that they agree on, if the group is healthy. */
1372
+ export declare const viewOf: (group: Group, ips: Readonly<Record<string, string>>, sentinels: ReadonlyArray<{
1373
+ readonly master: Record<string, string>;
1374
+ readonly replicas: ReadonlyArray<Record<string, string>>;
1375
+ }>, members: Readonly<Record<string, Record<string, string>>>) => GroupView;
1376
+ /** This time is the longest that a group takes to converge before a run, or after it. */
1377
+ export declare const CONVERGE_MS = 24e4;
1229
1378
  /**
1230
- * A fabric is a routed network between the client and the target, on layer E3 (docs/S7.md). Four
1231
- * routers of FRRouting, two leaves and two spines, run real BGP over veth pairs that containerlab
1232
- * makes. The client hangs off leaf1 and the target off leaf2. The path between them goes through
1233
- * spine1 by a weight, and spine2 holds the other path. A cell silences spine1, and the routes of
1234
- * the leaves move to spine2 when a detector of the routers fires.
1235
- *
1236
- * This file holds the plan of the fabric as pure functions, and `openFabric` that starts it. A lab
1237
- * opens a fabric with `Topology.fabric`. Thus the client, the target, the prober and the verdict
1238
- * stay the same as on layer E1. The fabric needs a Linux host with containerlab and sudo.
1379
+ * This function opens one environment of a group cell:
1380
+ * - one new network, with each member, each Sentinel, the client and the observer on it.
1381
+ * - each member: the stock image, its server as the child of a shell, thus a fin can stop the
1382
+ * server and the container stays up. The first member is the primary, and the others follow it.
1383
+ * - each Sentinel: the stock image, its Sentinel as the child of a shell, which monitors the first member.
1384
+ * - an injector sidecar for each part, in its network and process namespaces.
1385
+ * - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
1386
+ * - the observer of the Sentinels, in a namespace of its own.
1387
+ * - the prober, which watches the namespace of the client, and of each Sentinel for a calibration.
1239
1388
  */
1240
- /** This image is FRRouting 10.7.1, pinned by digest. */
1241
- export declare const FRR_IMAGE = "quay.io/frrouting/frr:10.7.1@sha256:e995beaa50fdc9edb35eadcfefa29b7f062cc06f2b812613789b68fa541554d2";
1242
- /** This device is the side of the fabric in the client and in the target. Docker keeps eth0. */
1243
- export declare const FABRIC_DEVICE = "eth1";
1244
- /** This address is the client on its network behind leaf1. */
1245
- export declare const FABRIC_CLIENT = "10.1.0.2";
1246
- /** This address is the target on its network behind leaf2. */
1247
- export declare const FABRIC_TARGET = "10.2.0.2";
1248
- /** A router is one box of the fabric, as data. */
1249
- interface Router {
1250
- readonly name: string;
1251
- readonly as: number;
1252
- readonly id: string;
1253
- readonly interfaces: Readonly<Record<string, string>>;
1254
- readonly neighbors: ReadonlyArray<{
1255
- readonly address: string;
1256
- readonly as: number;
1257
- readonly weight?: number;
1258
- }>;
1259
- /** This prefix is the network behind a leaf, which its BGP advertises. */
1260
- readonly network?: string;
1261
- /** This prefix is the network behind the other leaf. A move is a change of its route. */
1262
- readonly remote?: string;
1263
- }
1264
- /** These are the routers. Each leaf prefers spine1 by a weight of 100, thus the path of each run is known. */
1265
- export declare const ROUTERS: readonly Router[];
1266
- /** This text is the `daemons` file of each router: BGP and BFD, on top of what FRRouting always starts. */
1267
- export declare const DAEMONS: string;
1389
+ export declare const openGroupLab: (group: Group, options?: {
1390
+ readonly watchSentinels?: boolean;
1391
+ }) => Promise<GroupLab>;
1392
+ /** This function gives the latest time that a group cell waits for its outcome, in ms from the fault. */
1393
+ export declare const deadlineOf: (cell: Cell) => number;
1394
+ /** This function gives the latest subscription of the observer to each Sentinel, in some lines of the observer. */
1395
+ export declare const subscriptionsOf: (timeline: readonly SentinelEvent[]) => SentinelEvent[];
1268
1396
  /**
1269
- * This function gives the configuration of a router. Graceful restart is off: after a hold expiry,
1270
- * a helper can keep the stale routes, and the move that a cell measures does not come.
1271
- * `maximum-paths 1` keeps one path, thus a move is one change of one route.
1397
+ * This function does one run of a group cell:
1398
+ * - The group converges, and its keys go. The client connects through the Sentinels, and its
1399
+ * stream of writes gets steady.
1400
+ * - The fault occurs on its part, as the primary of this run makes the roles. A fault with a
1401
+ * hold lifts at its instant in the VM. A stall lifts at its length after the first write into it.
1402
+ * - The run waits for its outcome: the first write that a new primary accepts, or the first one
1403
+ * after the lift on the same primary. Then it continues for a moment.
1404
+ * - Each fault goes, the client stops, and the group converges again. The keys that it then holds
1405
+ * tell which writes it kept.
1272
1406
  */
1273
- export declare const frrConf: (router: Router, fabric: Fabric) => string;
1407
+ export declare const groupOnce: (lab: GroupLab, cell: Cell, environment: number, index: number) => Promise<Run>;
1274
1408
  /**
1275
- * This function gives the topology file of containerlab. The client and the target are containers
1276
- * of the lab, and the fabric adds a device to each. Each link has the MTU of a Docker network, thus
1277
- * a segment is as long as on layer E1. The default of containerlab is 9500. The management network
1278
- * belongs to the lab, and Docker chooses its subnet.
1409
+ * This module is the lab of a replica set: a replicated group with no external authority, whose
1410
+ * members elect their own primary. It opens one environment for a replica set cell, for the runs
1411
+ * of the cell. Each member is a container from the stock image of the set, in its own network
1412
+ * namespace. An injector sidecar shares its network and process namespaces.
1413
+ *
1414
+ * The client of each run is the MongoDB driver, which finds the primary with its own monitors. The
1415
+ * timeline comes from the log of each member and from the lines of the client. The prober watches
1416
+ * the namespace of the client.
1279
1417
  */
1280
- export declare const topologyOf: (lab: string, dir: string, client: string, target: string) => string;
1281
- /** A route line is one line of `ip -ts -o monitor route`, with its time on the wall clock in ms. */
1282
- interface RouteLine {
1283
- readonly wall: number;
1284
- readonly deleted: boolean;
1285
- readonly prefix: string;
1286
- readonly via: string | null;
1287
- readonly dev: string | null;
1288
- }
1289
- /** This function reads a line of `ip -ts -o monitor route`, or it gives null for another line. The clock of a container is UTC. */
1290
- export declare const routeLine: (text: string) => RouteLine | null;
1291
- /** A clock pair is one instant on the monotonic clock in ns and on the wall clock in ms. */
1292
- interface ClockPair {
1293
- readonly mono: number;
1294
- readonly wall: number;
1295
- }
1296
1418
  /**
1297
- * This function takes a time on the wall clock to the monotonic clock. The harness runs on the host
1298
- * of the containers, thus `process.hrtime` reads the CLOCK_MONOTONIC of the injector and the
1299
- * prober. The error of the pair is approximately 1 ms, the step of `Date.now`.
1419
+ * A member line is one log line of a member, as mongod writes it in JSON. `real` is its time on
1420
+ * the wall clock in ms, and `t` is its time on the monotonic clock. The run gives `t` from the
1421
+ * clock lines of its client.
1300
1422
  */
1301
- export declare const monotonicAt: (wall: number, pair: ClockPair) => number;
1302
- /** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
1303
- export declare const sessionsOf: (json: string) => {
1304
- readonly up: number;
1305
- readonly established: number;
1306
- };
1307
- /** These are the views of a leaf that tell if a run can start on it. */
1308
- interface LeafViews {
1309
- readonly neighbors: string;
1310
- /** This text is the kernel's route to the far network, from `ip -o route show`. */
1311
- readonly route: string;
1312
- /** This text is `show bgp ipv4 unicast PREFIX json`. */
1313
- readonly paths: string;
1314
- /** This text is `show bfd peers json`, or null when the fabric has no BFD. */
1315
- readonly bfd: string | null;
1423
+ interface MemberLine extends SentinelEvent {
1424
+ readonly ev: "mongod";
1425
+ readonly member: string;
1426
+ readonly real: number;
1427
+ readonly id: number;
1428
+ readonly c: string;
1429
+ readonly msg: string;
1430
+ readonly attr: Readonly<Record<string, unknown>>;
1316
1431
  }
1432
+ /** These are the components of the log of mongod that a run keeps: replication, its heartbeats, the elections, the rollbacks and the commands. */
1433
+ export declare const KEPT: ReadonlySet<string>;
1434
+ /** This function reads one log line of a member, or gives null for a line of another component or a line that is not JSON. */
1435
+ export declare const memberLineOf: (member: string, text: string) => MemberLine | null;
1317
1436
  /**
1318
- * This function tells what a leaf still lacks before a run, or it gives null. The two sessions must
1319
- * be up and the route must be on spine1. Spine2 must hold the other path. Without these, the fault
1320
- * of a run acts on another path, or nothing can take over.
1437
+ * This function gives the offset of the wall clock from the monotonic clock, in ns, from the clock
1438
+ * lines of a client. Each line pairs its stamp with the wall clock in whole ms, which truncates.
1439
+ * Thus each pair is the offset or less, and the largest pair is the nearest. It is null without a clock line.
1321
1440
  */
1322
- export declare const leafLacks: (views: LeafViews) => string | null;
1441
+ export declare const clockOffsetOf: (events: readonly ProbeEvent[]) => number | null;
1442
+ /** This function puts the log lines of the members on the monotonic clock, with the offset of a client. */
1443
+ export declare const onMonotonic: (log: readonly MemberLine[], offset: number | null) => MemberLine[];
1444
+ /** A cut is the peers that a network fault on a part cuts it from, by their addresses, and the direction of the rules. */
1445
+ interface Cut {
1446
+ readonly peers: readonly string[];
1447
+ readonly direction?: "out";
1448
+ }
1323
1449
  /**
1324
- * This function gives the later move of the leaves after an instant: for each leaf, the first route
1325
- * to its far network that leaves spine1. It gives null when a leaf has no move. The later move ends
1326
- * the outage in the two directions.
1450
+ * This function gives the peers that a fault on a member of a replica set cuts it from. `all` is
1451
+ * each other member and the client, `group` is the other members, and `clients` is the client.
1452
+ * `one` is the first other member in the sequence of the set, and `one-way` is the same member for
1453
+ * the segments from the part only.
1327
1454
  */
1328
- export declare const laterMove: (routes: readonly RunRoute[], after: number) => number | null;
1329
- /** A fabric lab is the open fabric of a lab. */
1330
- interface FabricLab {
1331
- /** These are the lines of the route monitors of the leaves, on the monotonic clock. */
1332
- readonly routes: readonly RunRoute[];
1333
- /** This method drops each packet of spine1 in one commit, and the links stay up. */
1334
- silence(): Promise<{
1335
- t0: number;
1336
- t1: number;
1337
- }>;
1338
- /** This method ends a silence. */
1339
- clear(): Promise<{
1340
- t0: number;
1341
- t1: number;
1455
+ export declare const cutOf: (set: ReplicaSet, members: Readonly<Record<string, RunPart>>, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => Cut;
1456
+ /** This function gives the command of the server of each member. The server is the child of a shell, thus a fin can stop it and the container stays up. */
1457
+ export declare const memberCommand: (set: ReplicaSet) => string;
1458
+ /** This function gives the script of the shell that starts the set: each member by its address, and the settings of the set. */
1459
+ export declare const initiateScript: (set: ReplicaSet, ips: Readonly<Record<string, string>>) => string;
1460
+ /** This script prints the view of a member: itself, if it accepts writes, and the state of each member as it sees them. */
1461
+ export declare const STATUS_SCRIPT: string;
1462
+ /** A status is the view of one member, as `STATUS_SCRIPT` prints it. */
1463
+ interface Status {
1464
+ readonly me: string;
1465
+ readonly writable: boolean;
1466
+ readonly members: ReadonlyArray<{
1467
+ readonly name: string;
1468
+ readonly state: string;
1469
+ readonly health: number;
1470
+ readonly optime: number | null;
1342
1471
  }>;
1343
- /** This method waits until each leaf is on spine1 with each session up. */
1344
- ready(): Promise<void>;
1345
- /** This method gives the count of established sessions of each leaf so far. */
1346
- sessions(): Promise<Readonly<Record<string, number>>>;
1347
- /** This method gives the record of the fabric for a manifest. */
1348
- manifest(): FabricManifest;
1349
- /** This method destroys the routers. */
1350
- close(): Promise<void>;
1351
- }
1352
- /** These are the parts of a lab that a fabric uses. */
1353
- interface FabricParts {
1354
- readonly fabric: Fabric;
1355
- readonly image: string;
1356
- readonly client: StartedTestContainer;
1357
- readonly server: StartedTestContainer;
1358
- readonly admin: StartedTestContainer;
1359
- readonly injector: StartedTestContainer;
1360
- readonly opened: StartedTestContainer[];
1361
- readonly output: (container: StartedTestContainer, argv: string[]) => Promise<string>;
1362
1472
  }
1363
1473
  /**
1364
- * This function deploys the routers of a lab and joins the client and the target to them. It also
1365
- * starts the sidecars: the injector of spine1 and a route monitor on each leaf. The caller stops the
1366
- * sidecars with the other containers of the lab, and it calls `close` first.
1474
+ * This function judges the view of a member: the primary of the set, and if the set is healthy.
1475
+ * The set is healthy when the member is the one primary and accepts writes. Each other member must
1476
+ * be a healthy secondary at the optime of the primary.
1367
1477
  */
1368
- export declare const openFabric: (parts: FabricParts) => Promise<FabricLab>;
1369
- /** These are the names of the images that the harness ships. */
1370
- export declare const SHIPPED_NAMES: readonly [Shipped, ...Shipped[]];
1371
- /** This function gives the source of a shipped image. */
1372
- export declare const shippedSource: (name: Shipped) => ImageSource;
1373
- /** This function gives the version of the package of the harness, from its package.json. */
1374
- export declare const harnessVersion: () => string;
1478
+ export declare const statusViewOf: (set: ReplicaSet, ips: Readonly<Record<string, string>>, status: Status) => GroupView;
1479
+ /** A replica set lab is one environment of a replica set cell. */
1480
+ interface ReplicaSetLab {
1481
+ readonly set: ReplicaSet;
1482
+ readonly clientIp: string;
1483
+ readonly members: Readonly<Record<string, RunPart>>;
1484
+ readonly netns: {
1485
+ readonly client: number;
1486
+ };
1487
+ /** These are all the records that the prober wrote, in sequence. */
1488
+ readonly kernel: readonly KernelRecord[];
1489
+ /** These are the log lines of the members that a run keeps, in the sequence of their arrival, with `t` at 0. */
1490
+ readonly log: readonly MemberLine[];
1491
+ /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
1492
+ sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1493
+ /** This method waits until the set is whole and calm, and gives the name of its primary. */
1494
+ converge(within?: number): Promise<string>;
1495
+ /** This method removes each write from the set, and waits until each member has the removal. */
1496
+ flush(primary: string): Promise<void>;
1497
+ /**
1498
+ * This method lets each secondary stand for election again (`rs.freeze(0)`). A step-down holds its
1499
+ * old primary out of the elections for `STEP_DOWN.seconds`. Without it, a run inherits that hold.
1500
+ */
1501
+ unfreeze(primary: string): Promise<void>;
1502
+ /** This method gives the sequence numbers that the set holds, from its primary. */
1503
+ holds(primary: string): Promise<number[]>;
1504
+ /** This method gives the member that has a role in the set, when `primary` is the primary. */
1505
+ partOf(role: GroupRole, primary: string): string;
1506
+ /** This method starts the client of a run, with the arguments of `client-mongo.mjs`. */
1507
+ client(args: readonly string[]): Promise<GroupClient>;
1508
+ /** This method applies a network fault between a member and some of its peers, at once or at an instant of the VM. */
1509
+ fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
1510
+ /** This method removes a network fault, at once or at an instant of the VM. */
1511
+ lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
1512
+ /** This method sends a signal to the server process of a member, at once or at an instant of the VM. */
1513
+ signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
1514
+ /** This method starts the server of a member again, after a fin. */
1515
+ restart(member: string): Promise<void>;
1516
+ /** This method runs a command in the box of a member, and gives its output. */
1517
+ exec(member: string, argv: string[]): Promise<string>;
1518
+ /** This method runs a script of the shell on a member, against its own server only, and gives its output. Another port reads a server with no set. */
1519
+ script(member: string, script: string, port?: number): Promise<string>;
1520
+ /** This method runs a command on the backup host of a drill, and gives its output. A lab without that host refuses it. */
1521
+ vault(argv: string[]): Promise<string>;
1522
+ /** This method sends replSetStepDown to the primary. */
1523
+ stepDown(primary: string): Promise<Stamp>;
1524
+ /** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
1525
+ forget(): Promise<void>;
1526
+ /** This method waits for the next clock line of the prober, which gives the count of lost records. */
1527
+ settle(): Promise<number | null>;
1528
+ manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
1529
+ close(): Promise<void>;
1530
+ }
1531
+ /** This function waits for a time, in ms. */
1532
+ /** These are the arguments of replSetStepDown: the time that the old primary cannot stand again, and the wait for a secondary to catch up. */
1533
+ export declare const STEP_DOWN: {
1534
+ readonly seconds: 60;
1535
+ readonly catchUp: 10;
1536
+ };
1375
1537
  /**
1376
- * These are the clients that the harness ships, by their names (`Client`): the image of each, and
1377
- * its command. A cell that names a client gets this image and this command.
1538
+ * This function opens one environment of a replica set cell:
1539
+ * - one new network, with each member, the client and the sender of a step-down on it.
1540
+ * - each member: the stock image, its server as the child of a shell. A log consumer reads its
1541
+ * JSON log. The first member starts the set with the address of each member, and the lab
1542
+ * waits for a primary.
1543
+ * - an injector sidecar for each member, in its network and process namespaces.
1544
+ * - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
1545
+ * - the prober, which watches the namespace of the client.
1546
+ * - a backup host for a recovery drill: the stock image, for its tools, with no server.
1378
1547
  */
1379
- export declare const SHIPPED_CLIENTS: Readonly<Record<Client, ClientImage>>;
1380
- /** These are the names of the clients that the harness ships. */
1381
- export declare const CLIENT_NAMES: readonly [Client, ...Client[]];
1382
- /** This function gives the command of a program of a subject by its role. It fails when the subject has no such program. */
1383
- export declare const programOf: (subject: Subject, role: string) => readonly string[];
1548
+ export declare const openReplicaSetLab: (set: ReplicaSet, backups?: boolean) => Promise<ReplicaSetLab>;
1549
+ /** This function gives the arguments of the client of a replica set cell: each member, and the stream of writes. */
1550
+ export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<string, RunPart>>) => string[];
1384
1551
  /**
1385
- * This function gives the client of a subject for a cell (`Cell.client`): the image of the subject,
1386
- * with the command of a program. A client that the harness ships goes by its name, thus its records
1387
- * stay the same.
1552
+ * This function does one run of a replica set cell:
1553
+ * - The set converges, and its writes go. The client finds the primary with its monitors, and its
1554
+ * stream of writes gets steady.
1555
+ * - The fault occurs on its member, as the primary of this run makes the roles. A fault with a
1556
+ * hold lifts at its instant in the VM. A stall lifts at its length after the first write into
1557
+ * it. A step-down is replSetStepDown to the primary.
1558
+ * - The run waits for its outcome: the first accepted write of a write sent after the commit of
1559
+ * the fault. It is on a new primary, or on any primary. Then the run waits for the end of the
1560
+ * hold, thus the record shows what the set did in the whole hold.
1561
+ * - Each fault goes, the client stops, and the set converges again. The writes that it then holds
1562
+ * tell which writes it kept. The log lines of the members go onto the monotonic clock.
1388
1563
  */
1389
- export declare const subjectClient: (subject: Subject, role?: string) => Client | ClientImage;
1390
- /** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
1391
- export declare const PINNED: RegExp;
1392
- /** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
1393
- export declare const REPOSITORY: RegExp;
1394
- /** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
1395
- export declare const inContext: (path: string) => boolean;
1564
+ export declare const replicaSetOnce: (lab: ReplicaSetLab, cell: Cell, environment: number, index: number) => Promise<Run>;
1396
1565
  /**
1397
- * This function gives the problems of the source of an image, as data. A pinned image names a
1398
- * digest. A build names a repository, a context, and paths that stay in the context. A shipped image
1399
- * is one that the harness ships.
1566
+ * This module holds the pure parts of a recovery drill. These are the scripts of the shell, the reader
1567
+ * of the output of `bsondump`, and the set check of a recovery. It has no container, thus unit tests
1568
+ * run it. `drill.ts` does the drill on a lab.
1569
+ *
1570
+ * A dump with `--oplog` reads the oplog from the start of the dump to its end. A slice reads the
1571
+ * oplog after the last entry of the backup before it. Thus the backups together hold each write up
1572
+ * to the last entry of the last backup, and no write after it. One writer sends the writes one at a
1573
+ * time, thus the highest sequence number is also the latest write.
1400
1574
  */
1401
- export declare const imageProblems: (source: ImageSource) => string[];
1575
+ /** This size is one document of generated data. A tenant holds as many documents as its size needs. */
1576
+ export declare const SEED_DOCUMENT = 65536;
1577
+ /** This count is how far the lost writes can be from the writes after the last backup: the writes in flight at the fault. */
1578
+ export declare const LOSS_MARGIN = 2;
1402
1579
  /**
1403
- * This function gives the problems of a subject, as data. A subject has a name and a base that a
1404
- * digest pins. Its image source has no problems, and each of its programs is a command.
1580
+ * This function gives the most disk that a drill needs, from the disk that it can use. The peak comes
1581
+ * before the fault. Then each member holds the data and its oplog, and the backup host holds the
1582
+ * dump. The seed goes through the oplog, thus each oplog holds the data up to its own size. The
1583
+ * slices are small: the writes of one client in a few seconds.
1405
1584
  */
1406
- export declare const subjectProblems: (subject: Subject) => string[];
1585
+ export declare const roomNeeded: (drill: Drill, members: number, disk: Quantity) => Quantity;
1586
+ /** This function gives MemAvailable from the text of `/proc/meminfo`. */
1587
+ export declare const memAvailableOf: (meminfo: string) => Quantity;
1588
+ /** This function gives the reason that a drill has no room on its runner, or null. A record from before SYS-97 has no room, and it is not void for this reason. */
1589
+ export declare const roomVoidOf: (room: DrillRoom | undefined) => string | null;
1590
+ /** This function gives the time of a drill from the start of the backups to the fault, in seconds. */
1591
+ export declare const drillSpan: (drill: Drill) => number;
1407
1592
  /**
1408
- * This function gives each `FROM` of a Dockerfile that no digest pins. A `FROM` of an earlier stage
1409
- * by its name, or of `scratch`, needs no digest. A base from an `ARG` has no digest that the harness
1410
- * can read, thus it is in the list too.
1593
+ * This script writes the generated data of each tenant into the collection `tenants`. Each write
1594
+ * waits for `copies` members, thus each member holds the data when the script ends.
1411
1595
  */
1412
- export declare const unpinnedBases: (dockerfile: string) => string[];
1596
+ export declare const seedScript: (drill: Drill, copies: number) => string;
1597
+ /** This script prints the hash of the collection `tenants`. It takes locks, thus a run reads it with no writer. */
1598
+ export declare const HASH_SCRIPT: string;
1599
+ /** This function gives the hash from the output of `HASH_SCRIPT`. */
1600
+ export declare const hashOf: (text: string) => string;
1601
+ /** This function gives the command of a server with no set, on its own port. A client of the set cannot reach that server, and a restore writes to it. */
1602
+ export declare const standaloneCommand: (set: ReplicaSet, port: number) => string;
1413
1603
  /**
1414
- * This function gives each base of a Dockerfile, in the sequence of the file. A base is the image of
1415
- * a `FROM` that is not `scratch` or an earlier stage by its name.
1604
+ * This script waits for the end of the server of a box, and it can stop the server first. `kill -0`
1605
+ * also succeeds on a zombie, and the shell of the box can leave its child as a zombie for a long
1606
+ * time. Thus the script reads the state of the process, and a zombie has ended.
1416
1607
  */
1417
- export declare const basesOf: (dockerfile: string) => string[];
1608
+ export declare const stopScript: (terminate: boolean) => string;
1609
+ /** An oplog time is the `ts` of an oplog entry: a time in seconds, and the count of the entry in that second. */
1610
+ interface OplogTime {
1611
+ readonly t: number;
1612
+ readonly i: number;
1613
+ }
1614
+ /** An oplog read is what an oplog file holds: its last entry, and the highest sequence number that it inserts. */
1615
+ interface OplogRead {
1616
+ readonly last: OplogTime | null;
1617
+ readonly highest: number | null;
1618
+ }
1619
+ /** This function reads an oplog file from the output of `bsondump`. Only an insert into `cells.w` is a write of a client. */
1620
+ export declare const readOplog: (text: string) => OplogRead;
1621
+ /** This function gives the highest sequence number of the file of the writes in a dump, from the output of `bsondump`, or null. */
1622
+ export declare const highestHeld: (text: string) => number | null;
1623
+ /** This function gives the query of a slice of the oplog: each entry after an oplog time, in Extended JSON. */
1624
+ export declare const sliceQuery: (after: OplogTime) => string;
1625
+ /** A recovery measurement is what a drill found, beside the writes of the run. */
1626
+ interface RecoveryMeasured {
1627
+ /** This time is from the reply to the last accepted write that the store kept to the fault, or null with no such write. */
1628
+ readonly rpo: Quantity | null;
1629
+ /** This time is `rpo` less the age of the drill: what a schedule adds to its interval. It is null for a control and for an election. */
1630
+ readonly excess: Quantity | null;
1631
+ /** These are the accepted writes that the store lost, below a write that it kept. A restore must leave none. */
1632
+ readonly holes: readonly number[];
1633
+ /** This count is the number of accepted writes after the last write of the last backup, or null without a backup. */
1634
+ readonly afterBackup: number | null;
1635
+ /** This flag tells if the tenants have the same data after the recovery, or null when that is not known. */
1636
+ readonly sameData: boolean | null;
1637
+ }
1638
+ /** This function gives the measurement of a drill, from its run. `t0` is the fault. */
1639
+ export declare const recoveryOf: (drill: Drill, run: Run, t0: number) => RecoveryMeasured;
1640
+ /** This function gives the findings of a drill: each rule of a recovery that its run broke. */
1641
+ export declare const recoveryFindings: (measured: RecoveryMeasured, writes: Writes) => string[];
1418
1642
  /**
1419
- * This function gives each manifest of packages in a context (`package.json`, `Cargo.toml`) that
1420
- * has no lockfile in its folder or in a folder above it. The paths are the paths in the context.
1643
+ * This module measures a run of a group cell. It gives the first write that a primary accepted
1644
+ * after the fault, and the timeline of the group. The Sentinels of a group announce its timeline.
1645
+ * The logs of the members of a replica set or of the nodes of a cluster, and its client, tell it. The
1646
+ * module also gives what became of each write.
1421
1647
  */
1422
- export declare const unlockedManifests: (paths: readonly string[]) => string[];
1648
+ /** These are the stages of a timeline under Sentinels, in their sequence after a fault. */
1649
+ export declare const STAGES: readonly SentinelStage[];
1650
+ /** An error on the way is one kind of error that the client met after the fault. It has its first time from the fault, and its count. */
1651
+ interface ErrorOnTheWay {
1652
+ readonly name: string;
1653
+ readonly first: Quantity;
1654
+ readonly count: number;
1655
+ }
1423
1656
  /**
1424
- * An image plan tells how the harness gets the image of a source. It is a pull of an image by its
1425
- * name, or a build of a context. A build has its tag, its Dockerfile, and each file with its path.
1657
+ * A writes record tells what became of the writes of a run, by their sequence numbers:
1658
+ * - `old` counts the writes that the primary of the start of the run accepted after the fault. A
1659
+ * cluster counts none: its client publishes through one node, not through the leader of the queue.
1660
+ * - `lost` are the writes that a primary accepted and the group did not keep. They are the cost
1661
+ * of a split brain. It is null when the group did not converge after the run.
1662
+ * - `unknown` are the writes that the client sent and did not see accepted: an error, or no answer.
1663
+ * `held` tells if the group kept each one, or null when it did not converge.
1664
+ * - `duplicates` has one entry for each extra copy that the group holds: a write held three times
1665
+ * has two entries. It is null when the group did not converge. A key holds one copy by
1666
+ * construction, thus only a list can show a copy.
1426
1667
  */
1427
- type ImagePlan = {
1428
- readonly kind: "pull";
1429
- readonly image: string;
1430
- } | {
1431
- readonly kind: "build";
1432
- readonly tag: string;
1433
- readonly dockerfile: string;
1434
- readonly files: ReadonlyArray<{
1435
- readonly file: string;
1436
- readonly at: string;
1668
+ interface Writes {
1669
+ readonly sent: number;
1670
+ readonly acked: number;
1671
+ readonly old: number;
1672
+ readonly lost: readonly number[] | null;
1673
+ readonly unknown: ReadonlyArray<{
1674
+ readonly n: number;
1675
+ readonly held: boolean | null;
1437
1676
  }>;
1438
- /** This record tells what the image holds, for the manifest of a run. */
1439
- readonly record: BuildRecord;
1440
- };
1441
- /**
1442
- * A build record tells what an image that the harness builds holds, for the manifest of a run. The
1443
- * tag is a sha256 of each file of the context. The bases are pinned by digest, and each lockfile
1444
- * has its sha256. Thus the record pins each program of the image. The versions are the part that a
1445
- * person reads.
1446
- */
1447
- interface BuildRecord {
1448
- readonly tag: string;
1449
- /** These are the bases of its Dockerfile, each pinned by digest (`basesOf`). */
1450
- readonly bases: readonly string[];
1451
- /** These are the lockfiles of its context by their path, each with the sha256 of its content (`locksOf`). */
1452
- readonly locks: Readonly<Record<string, string>>;
1453
- /** These are the versions of the packages that its manifests name directly, by their names (`versionsOf`). */
1454
- readonly versions: Readonly<Record<string, string>>;
1677
+ readonly duplicates?: readonly number[] | null;
1678
+ /** These are the counts of a pair (`Cell.pair`), from its two final reads. */
1679
+ readonly sets?: PairSets;
1680
+ }
1681
+ /** These are the counts that the bands of `Outcomes` judge: each one has the same name there. */
1682
+ interface PairSets {
1683
+ readonly unknown: number;
1684
+ readonly kept: number;
1685
+ readonly stranded: number;
1686
+ readonly absent: number;
1687
+ readonly missing: number;
1688
+ readonly warnings: number;
1689
+ }
1690
+ /** A group measurement is what one run of a group cell measured, beside its time. */
1691
+ interface GroupMeasured {
1692
+ /** These are the member that was the primary at the start, and the member of the first accepted write after the fault. */
1693
+ readonly from: string;
1694
+ readonly to: string | null;
1695
+ /** These are the times of each stage from the fault: the first announcement by any Sentinel. A stage that no Sentinel announced is absent. */
1696
+ readonly stages: Partial<Record<Stage, Quantity>>;
1697
+ readonly writes: Writes;
1698
+ readonly errors: readonly ErrorOnTheWay[];
1699
+ /** These are the delays of the stamps of the observer after the writes of the Sentinels, for a calibration. */
1700
+ readonly lags?: readonly Quantity[];
1701
+ /** This is what a recovery drill measured, for a drill only. */
1702
+ readonly recovery?: RecoveryMeasured;
1455
1703
  }
1704
+ /** This function gives the time of each stage of a timeline from an instant: the first announcement of each, after the instant. */
1705
+ export declare const stagesOf: (timeline: readonly SentinelEvent[], from: number) => Partial<Record<Stage, Quantity>>;
1706
+ /** These are the stages of the timeline of a replica set, in their usual sequence after a fault. */
1707
+ export declare const REPLICA_SET_STAGES: readonly ReplicaSetStage[];
1456
1708
  /**
1457
- * This function gives the plan of the image of a source. A stock image by its name, or a pinned
1458
- * image, is a pull. A build or a shipped image is a build. Its tag is its name, then 12 digits of a
1459
- * sha256. The sha256 reads the path of the Dockerfile, and the path and the content of each file.
1460
- * Thus a changed program cannot operate as an old one.
1461
- *
1462
- * A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
1463
- * digest pins, and on a manifest of packages without a lockfile.
1709
+ * A member mark is how a log line of mongod marks a stage: by its id, or by its message. The
1710
+ * message is the fallback for a version whose ids differ. `at` tells where the line comes from:
1711
+ * the old primary, or another member.
1464
1712
  */
1465
- export declare const planOf: (source: string | ImageSource) => ImagePlan;
1713
+ interface MemberMark {
1714
+ readonly ids: readonly number[];
1715
+ readonly message: RegExp;
1716
+ readonly at: "old" | "other";
1717
+ }
1718
+ /** These are the log lines of mongod that mark each stage of a member. */
1719
+ export declare const MEMBER_MARKS: Readonly<Record<Exclude<ReplicaSetStage, "discovered" | "written-off" | "first-write">, MemberMark>>;
1466
1720
  /**
1467
- * This function gives an image that a lab can start, from its source. It is the name of a stock
1468
- * image or of a pinned image, which the lab pulls, or the tag of a build. A build goes through the CLI
1469
- * of Docker.
1721
+ * This function gives the time of each stage of a replica set from an instant, in a run. The stages
1722
+ * of the members come from their log lines (`ev` "mongod"), whose times the lab puts on the
1723
+ * monotonic clock. The stages of the client come from its lines:
1724
+ * - `discovered`: a member other than the old primary becomes RSPrimary in the view of the client.
1725
+ * - `written-off`: the first heartbeat of the client to the old primary that fails.
1726
+ * - `first-write`: the first write that a primary accepts, of a write that the client sent after
1727
+ * the commit of the fault (`sentAfter`). It is on a new primary when `lands` is `new`.
1470
1728
  */
1471
- export declare const imageOf: (source: string | ImageSource) => Promise<string>;
1729
+ export declare const replicaSetStagesOf: (run: Run, from: number, sentAfter: number, lands: "new" | "same") => Partial<Record<Stage, Quantity>>;
1730
+ /** These are the stages of the timeline of a cluster of RabbitMQ, in their usual sequence after a fault. */
1731
+ export declare const CLUSTER_STAGES: readonly ClusterStage[];
1472
1732
  /**
1473
- * This function gives the build record of the image of a source, for the manifest of a run. A
1474
- * stock image by its name, or a pinned image, is a pull, and it has no build record.
1733
+ * These are the log lines of RabbitMQ that mark each stage of a cluster, by their message (ra 3.1.10,
1734
+ * ra_server_proc.erl:871, :1336-1345 and :1974). `at` tells where the line comes from: the node of the
1735
+ * old leader, or another node.
1475
1736
  */
1476
- export declare const buildRecordOf: (source: string | ImageSource) => BuildRecord | undefined;
1477
- /** This function gives the image of the harness: the prober, the TCP client, the injector and the namespace admin. */
1478
- export declare const harnessImage: () => Promise<string>;
1479
- /** This function gives the image of the Node client. */
1480
- export declare const nodeClientImage: () => Promise<string>;
1481
- /** This function gives the image of the router. */
1482
- export declare const routerImage: () => Promise<string>;
1483
- /** This function gives the image of the Go HTTP client. */
1484
- export declare const goHttpImage: () => Promise<string>;
1485
- /** This function gives the image of the Node HTTP clients. */
1486
- export declare const nodeHttpImage: () => Promise<string>;
1487
- /** This function gives the image of the MongoDB client. */
1488
- export declare const mongoClientImage: () => Promise<string>;
1489
- /** This function gives the image of the PostgreSQL client. */
1490
- export declare const pgClientImage: () => Promise<string>;
1491
- /** This function gives the image of the client of HikariCP over pgjdbc. */
1492
- export declare const hikariClientImage: () => Promise<string>;
1493
- /** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
1494
- export declare const amqpClientImage: () => Promise<string>;
1495
- /** This function gives the image of the Kafka client: kafka-clients on Java, with the client and the admin of a Kafka cell. */
1496
- export declare const kafkaClientImage: () => Promise<string>;
1497
- /** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
1498
- export declare const grpcClientImage: () => Promise<string>;
1737
+ export declare const NODE_MARKS: Readonly<Record<Exclude<ClusterStage, "first-write">, {
1738
+ readonly message: RegExp;
1739
+ readonly at: "old" | "other";
1740
+ }>>;
1499
1741
  /**
1500
- * This function gives the source of the image that a target operates. It is the image of its
1501
- * subject (`Target.subject`), or its stock image.
1742
+ * This function gives the time of each stage of a cluster from an instant, in a run. The stages of
1743
+ * the nodes come from their log lines (`ev` "rabbit"), whose times the lab puts on the monotonic
1744
+ * clock. `first-write` is the first confirm of a publish that the client sent after the commit of
1745
+ * the fault (`sentAfter`), through any node.
1502
1746
  */
1503
- export declare const targetSourceOf: (target: Target) => string | ImageSource;
1504
- /** This function gives the image that a target operates: the image of its subject, or its stock image. */
1505
- export declare const targetImageOf: (target: Target) => Promise<string>;
1747
+ export declare const clusterStagesOf: (run: Run, from: number, sentAfter: number) => Partial<Record<Stage, Quantity>>;
1748
+ /** This function gives what became of each write of a run, from the lines of the client and the keys that the group kept. */
1749
+ export declare const writesOf: (run: Run, after: number, primary: string) => Writes;
1750
+ /** This function gives the errors that the client met after an instant: each kind, its first time, and its count. */
1751
+ export declare const errorsOf: (events: readonly ProbeEvent[], after: number) => ErrorOnTheWay[];
1506
1752
  /**
1507
- * A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a
1508
- * cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.
1509
- * A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this
1510
- * time.
1753
+ * This function gives the delay of each stamp of the observer after the write of its Sentinel that
1754
+ * the observer read. That write is the latest write of the Sentinel's socket toward the observer,
1755
+ * at the stamp or before it. The prober records each write (`tx`) on the clock of the stamps.
1511
1756
  */
1512
- export declare const LAYERS: readonly ["E0", "E1", "E2", "E3", "E4", "E5", "E6"];
1513
- type Layer = (typeof LAYERS)[number];
1514
- /** A cloud is where the runner operates. GitHub can schedule a standard Linux job on Azure or on AWS. */
1515
- export declare const CLOUDS: readonly ["azure", "aws", "unknown"];
1516
- type Cloud = (typeof CLOUDS)[number];
1517
- /** A host is what a process reads about its own machine. */
1518
- interface Host {
1519
- /** This text is the kernel release. */
1520
- readonly kernel: string | null;
1521
- /** This number is `CONFIG_HZ` from the configuration of the kernel, or null without that file. */
1522
- readonly hz: number | null;
1523
- /** This text is the DMI system vendor, for example `Microsoft Corporation`, or null without that file. */
1524
- readonly vendor: string | null;
1525
- /** This value tells if `/dev/kvm` exists. A later VM layer needs it. */
1526
- readonly kvm: boolean;
1527
- /** This text is `$ImageOS $ImageVersion` of a hosted runner, or null elsewhere. */
1528
- readonly image: string | null;
1757
+ export declare const lagsOf: (run: Run, kernel: readonly KernelRecord[]) => Quantity[];
1758
+ /** This type is the measurement of observe.ts, which a group run fills. */
1759
+ interface GroupReading {
1760
+ readonly outcome: {
1761
+ readonly kind: "answered";
1762
+ } | {
1763
+ readonly kind: "silent";
1764
+ };
1765
+ readonly elapsed: Quantity | null;
1766
+ readonly socket: Quantity | null;
1767
+ readonly noticed: Quantity | null;
1768
+ readonly void: string | null;
1769
+ readonly finding: string | null;
1770
+ readonly group: GroupMeasured;
1529
1771
  }
1530
1772
  /**
1531
- * A substrate tells where a record comes from. The rules of comparison in `docs/S7.md` read it: no
1532
- * statistic pools two layers, two kernels or two clouds. The digest of each image stays in the
1533
- * manifest. A value is null in a record from before this block.
1773
+ * This function reads one run of a group cell.
1774
+ * - The reference is the start of the commit of the fault, as the injector stamped it. For a
1775
+ * stall, it is the first write into the fault, as for the stall of a direct pair.
1776
+ * - The outcome is the first write that a primary accepted after the fault. The prediction says
1777
+ * which primary: a new one, or the same one after the lift. In a replica set, it is the first
1778
+ * accepted write of a write that the client sent after the commit of the fault.
1779
+ * - The stages come from the Sentinels, or from the logs of the members of a replica set and the
1780
+ * lines of its client (`replicaSetStagesOf`).
1781
+ * - Its time is the last segment with data that the client's socket to that primary received
1782
+ * before the client saw the acceptance. The stamp of the client is the fallback.
1783
+ * - A run is void when the prober lost records, or when the client did not become ready. It is
1784
+ * also void when a Sentinel entered its TILT mode, or when the election split its votes. A band
1785
+ * from the fault whose commit took longer than δ_abs is void too. So is a band whose hold lifted
1786
+ * more than δ_abs late.
1534
1787
  */
1535
- interface Substrate {
1536
- readonly layer: Layer;
1537
- readonly cloud: Cloud;
1538
- readonly vendor: string | null;
1539
- readonly kernel: string | null;
1540
- readonly hz: number | null;
1541
- readonly kvm: boolean | null;
1542
- readonly image: string | null;
1788
+ export declare const measureGroup: (cell: Cell, run: Run) => GroupReading;
1789
+ /** This record is what a run of a port cell measured. */
1790
+ interface PortsReading {
1791
+ /** This count is the rounds of the run, each destination once. */
1792
+ readonly rounds: number;
1793
+ /** This record gives the count of searches for each count of connects, by that count. */
1794
+ readonly counts: Readonly<Record<string, number>>;
1795
+ /** These offsets from the low port are the ports that the run used, in rising order. */
1796
+ readonly seen: readonly number[];
1797
+ /** These errnos ended the searches of the run, each one time. */
1798
+ readonly errnos: readonly string[];
1799
+ /** This time is the longest connect that failed. */
1800
+ readonly refusal: Quantity;
1801
+ /** This time is from the `closing` line to the first `freed` line. */
1802
+ readonly firstFreed: Quantity | null;
1803
+ /** This time is from the `closing` line to the last `freed` line. */
1804
+ readonly lastFreed: Quantity | null;
1805
+ /** This count is the `freed` lines of the run. */
1806
+ readonly freed: number;
1807
+ /** This count is the connects that failed before the last `freed` line. */
1808
+ readonly tries: number;
1543
1809
  }
1544
- /** GitHub announced Linux jobs on AWS on this date. Each earlier hosted job ran on Azure. */
1545
- export declare const AWS_FROM = "2026-10-28";
1546
- /** This function gives the cloud of a DMI vendor. A kernel name does not tell: one image can start on each cloud. */
1547
- export declare const cloudOf: (vendor: string | null) => Cloud;
1548
- /** This function reads the host. `root` and `env` are for tests. */
1549
- export declare const readHost: (root?: string, env?: Readonly<Record<string, string | undefined>>, kernel?: string) => Host;
1550
- /** This function gives the substrate of a layer on a host. */
1551
- export declare const substrateOn: (layer: Layer, host?: Host) => Substrate;
1552
1810
  /**
1553
- * This function gives the substrate of a lab at this place. A guest cannot read its own runner: its
1554
- * DMI vendor is QEMU, and `ImageOS` is not set. Thus the runner writes its host to `LAB_RUNNER`, and
1555
- * the guest keeps only its own kernel and HZ. A value of that variable makes the layer E4.
1811
+ * This function reads one run of a port cell. The `round` lines give each search. The `closing` and
1812
+ * `freed` lines give when each held port comes back. The records of the prober give the
1813
+ * retransmissions.
1556
1814
  */
1557
- export declare const substrateHere: (layer: Layer, host?: Host, env?: Readonly<Record<string, string | undefined>>) => Substrate;
1558
- /** A CPU reading is two counters of `/proc/stat`, in ticks of the clock. */
1559
- interface CpuTime {
1560
- /** This count is the time that the host gave to another guest while this one had work. */
1561
- readonly steal: number;
1562
- /** This count is the sum of all states of each CPU. */
1563
- readonly total: number;
1815
+ export declare const measurePorts: (run: Run, expected: PortsPrediction) => Measured;
1816
+ /** This record is what one connection of a queue cell did, from its lines and the records of its socket. */
1817
+ interface QueueConnectionReading {
1818
+ readonly name: string;
1819
+ readonly connected: boolean;
1820
+ /** These times are the waits of the SYN. The first one counts from the dial. */
1821
+ readonly syns: readonly Quantity[];
1822
+ /** These times are the waits of each SYN-ACK sent again. The first one counts from the dial. */
1823
+ readonly synAcks: readonly Quantity[];
1824
+ /** This count is the segments that the socket sent again. */
1825
+ readonly retransmissions: number;
1826
+ readonly errno: string | null;
1827
+ /** This time is from the line of the prediction to the end of the connection. It is null for a live connection, or with no prediction. */
1828
+ readonly ended: Quantity | null;
1829
+ /** This time is from the last retransmission to the end of the connection. */
1830
+ readonly afterLast: Quantity | null;
1831
+ /** This count is the segments of the socket with no acknowledgment at the end of the run. */
1832
+ readonly unacked: number | null;
1833
+ }
1834
+ /** This record is what a run of a queue cell measured. The counts are the changes in the run. */
1835
+ interface QueueReading {
1836
+ readonly max: number;
1837
+ readonly held: number;
1838
+ readonly connected: number;
1839
+ readonly overflows: number;
1840
+ readonly drops: number;
1841
+ readonly cookies: number;
1842
+ readonly timeouts: number;
1843
+ readonly resets: number;
1844
+ readonly drained: number;
1845
+ /** This time is from the first dial of the burst to the last `TCPTimeouts` of the prediction. */
1846
+ readonly expiry: Quantity | null;
1847
+ /** This time is from the first dial of the burst to the rise of the count of the queue. */
1848
+ readonly rise: Quantity | null;
1849
+ readonly connections: readonly QueueConnectionReading[];
1564
1850
  }
1565
- /** This function reads the CPU time of this machine, or gives null without `/proc/stat`. `root` is for tests. */
1566
- export declare const readCpu: (root?: string) => CpuTime | null;
1567
1851
  /**
1568
- * This function gives the share of the CPU time between two readings that the host took. The share
1569
- * goes from zero to one. It is null if no tick passed. A guest sees only the host above it. On a hosted
1570
- * runner that host is itself a guest, and this number does not show the contention of the layer below it.
1852
+ * This function reads one run of a queue cell. The client lines give the connections and the
1853
+ * counters at the two ends of the run. The target lines give the count of the queue. The records of
1854
+ * the prober give the waits of each socket.
1571
1855
  */
1572
- export declare const stealShare: (before: CpuTime, after: CpuTime) => number | null;
1573
- /** A part of a record that can hold a substrate: a manifest of the harness, or the fields of a kind manifest. */
1574
- interface SubstrateSource {
1575
- readonly substrate?: Substrate;
1576
- readonly kernel?: string;
1577
- readonly hz?: string | null;
1578
- }
1856
+ export declare const measureQueue: (run: Run, expected: QueuePrediction) => Measured;
1857
+ /** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
1858
+ export declare const requestWords: (outcome: {
1859
+ readonly connection: "reused" | "new";
1860
+ readonly retried: boolean;
1861
+ readonly error: string | null;
1862
+ readonly pending?: boolean | undefined;
1863
+ }) => string;
1579
1864
  /**
1580
- * This function reads the substrate of a record, the upgrade of a record from before this block.
1581
- * Nothing rewrites such a record. It reads as the given layer. Its cloud is Azure if the record is
1582
- * from before `AWS_FROM`, and unknown after that date, because its runner did not record the cloud.
1865
+ * This amount is the noise of the pipeline itself, δ_abs, as the calibration measured it. It is
1866
+ * the 99.9th percentile of the whole latency of a reset, at the concurrency cap or less. Its
1867
+ * minimum is one jiffy. On 2026-10-12 the worst of 60 resets at 1 and 4 environments took
1868
+ * 1.141 ms, thus the minimum sets it to 4 ms. The calibration occurs again after each change to
1869
+ * the harness, the kernel or Docker.
1583
1870
  */
1584
- export declare const substrateOf: (source: SubstrateSource, at: string, layer?: Layer) => Substrate;
1871
+ export declare const NOISE: Quantity;
1585
1872
  /**
1586
- * This function tells if a statistic can pool two substrates. They must have one layer, one kernel
1587
- * and one cloud. An unknown value does not refuse a pair, because an old record cannot tell. The
1588
- * reader of such a pair says so with `substrateKey`.
1873
+ * This time is how late the injector can commit or lift a fault before the run is void. Stage 0
1874
+ * measures the commit apart from δ_abs, and the commit is longer. On a hosted runner it took up to
1875
+ * 2.75 ms at 4 environments, where δ_abs is 1 ms. Thus a cell's δ_abs does not change it.
1589
1876
  */
1590
- export declare const comparable: (a: Substrate, b: Substrate) => boolean;
1591
- /** This function gives the one-line name of a substrate, for a summary. */
1592
- export declare const substrateKey: (substrate: Substrate) => string;
1877
+ export declare const INJECT: Quantity;
1878
+ /** A time from the fault is one time of a run from the start of the commit of its fault. It has the edges of the band that judges it. */
1879
+ interface TimeFromFault {
1880
+ readonly at: Quantity;
1881
+ readonly low: Quantity;
1882
+ readonly high: Quantity;
1883
+ }
1593
1884
  /**
1594
- * This function gives the first two substrates that a statistic cannot pool, or undefined. It
1595
- * examines each pair. An unknown value matches Azure and AWS, thus one comparison with the first
1596
- * substrate can miss a pair.
1885
+ * This function gives the void of a run from the commit of its fault, or null (SYS-99). A fault
1886
+ * starts somewhere in its commit, thus each time from the start of the commit is too long by the
1887
+ * commit or less. A commit up to `INJECT` is in the noise. A longer commit voids the run only when
1888
+ * that shift can move a time across an edge of its band. Thus a drill with a band of minutes keeps
1889
+ * a run with a commit of 8 ms. `times` holds each time that a band judges, with the edges of the
1890
+ * verdict. A run with no time is void.
1597
1891
  */
1598
- export declare const unpoolable: (substrates: readonly Substrate[]) => readonly [Substrate, Substrate] | undefined;
1892
+ export declare const commitVoid: (commit: Quantity, times: readonly TimeFromFault[]) => string | null;
1893
+ /** This function gives the δ_abs of a cell: its own, or `NOISE` for a cell that gives none. */
1894
+ export declare const noiseOf: (cell: {
1895
+ readonly noise?: Quantity | undefined;
1896
+ }) => Quantity;
1599
1897
  /**
1600
- * This time is the interval of the listing of a router, when its hop does not set one. A listing
1601
- * evicts each expired flow that it walks past, and the DESTROY event of that flow follows.
1898
+ * A pairing is the window of a run in which a line of its program pairs with the kernel's record
1899
+ * of its act. `bound` is the jitter of the program that the run measured, or null. `delta` is the
1900
+ * window: δ_abs of the cell, or the bound when the bound is longer.
1602
1901
  */
1603
- export declare const PUMP: Quantity;
1902
+ interface Pairing {
1903
+ readonly bound: Quantity | null;
1904
+ readonly delta: Quantity;
1905
+ }
1604
1906
  /**
1605
- * This time is the longest listing of the conntrack table of a router that a prediction assumes.
1606
- * A DESTROY follows an expiry within the interval of the pump and two listings. On 2026-10-15,
1607
- * the slowest of 500 listings in an idle router took 19.4 ms, and the median took 5.5 ms. A
1608
- * longer listing writes a `pump-slow` line, and a run with one near its detection is void.
1907
+ * This function gives the pairing window of a run (SYS-25). On a runner of GitHub, the jitter of
1908
+ * a program can be longer than the δ_abs of 1 ms. Thus each run measures it before its fault
1909
+ * (`Run.jitter`), and its own measurement widens its window. A run without a jitter record is
1910
+ * from before SYS-25. It reads as a bound of null, thus its window is δ_abs. The decision of
1911
+ * 2026-10-19 keeps the rule of one miss: a pair that a window misses is still a finding.
1609
1912
  */
1610
- export declare const LISTING: Quantity;
1913
+ export declare const pairingOf: (cell: {
1914
+ readonly noise?: Quantity | undefined;
1915
+ }, run: Pick<Run, "jitter">) => Pairing;
1611
1916
  /**
1612
- * This time is how late the pump of a router can be beyond its interval and its two listings. The
1613
- * pump sleeps after each listing, and the sleep can end late. The watcher also reads and stamps each
1614
- * event within a millisecond. Thus a DESTROY follows an expiry within the interval of the pump, two
1615
- * listings and this slack. It is an assumption: in run 39116866471, two of 11 forgets came 1.6 ms
1616
- * and 2.2 ms after the pump and two listings.
1917
+ * This function sums the pairings of the measurements of a cell. It gives the longest bound and
1918
+ * the longest window. It also counts the pairings whose window is longer than δ_abs (`noise`). It
1919
+ * is null when no measurement has a pairing.
1617
1920
  */
1618
- export declare const PUMP_SLACK: Quantity;
1921
+ export declare const pairingsOf: (runs: readonly Measured[], noise?: Quantity) => {
1922
+ readonly bound: Quantity | null;
1923
+ readonly delta: Quantity;
1924
+ readonly widened: number;
1925
+ } | null;
1619
1926
  /**
1620
- * A network fault is a fault that the injector applies as a filter rule. It is a black hole (both
1621
- * directions, or one), or a reset on the next segment. It can also be an ICMP unreachable for each
1622
- * segment, or a drop of each segment that is longer than a length. It can also be a drop of the
1623
- * first ACK of each FIN that the namespace sends.
1927
+ * This function tells if a timer firing came late enough to void a run. A firing two jiffies or
1928
+ * more behind its wheel slot came late because the host stopped a vCPU. With the HZ of the run,
1929
+ * the rule is in time: the delay must also reach δ_abs, because each band already includes that
1930
+ * noise. At HZ 250 two jiffies are 8 ms, more than a δ_abs of 4 ms. At HZ 1000 they are 2 ms.
1624
1931
  */
1625
- type NetworkFault = "blackhole" | "rst" | "reject" | "mtu" | "fin-ack";
1626
- /** These are the options of a network fault: the direction of a black hole, the code of a reject, the length of an MTU drop. */
1627
- interface FaultOptions {
1628
- /** This direction is relative to the namespace of the rule: `in` drops what comes from the peer, `out` what goes to it. */
1629
- readonly direction?: "in" | "out";
1630
- readonly code?: "host" | "net" | "port" | "admin";
1631
- /** This length is the longest segment in bytes that an MTU drop lets through. */
1632
- readonly above?: number;
1633
- /** These are the addresses that the rule faces, in place of the peer of its place. */
1634
- readonly peers?: readonly string[];
1635
- }
1932
+ export declare const delayVoids: (behind: number, hz: number | undefined, noise: Quantity) => boolean;
1933
+ /** This fraction, δ_rel, is how far the median of a cell can be outside the prediction and stay equivalent. */
1934
+ export declare const RELATIVE = .05;
1935
+ /** These are the run counts of a cell: 11, then 22 and 44 while its median crosses the edge of the band. */
1936
+ export declare const STEPS: readonly [11, 22, 44];
1636
1937
  /**
1637
- * A fault side is the namespace that gets the rules of a fault: the namespace of the peer of the
1638
- * observer. For the client, it is the namespace of the target (the injector). For the server, it
1639
- * is the namespace of the client (its privileged admin). Rules in the namespace of the observer
1640
- * make its sends fail locally, with EPERM, and the network does not lose them. Thus its
1641
- * retransmissions do not go out. The retransmission tracepoint of the kernel then records none,
1642
- * because it fires only for a retransmission that went out.
1938
+ * A decision is the result of a verdict. A cell whose outcome is a distribution has no band, and
1939
+ * its decision is `measured`: a record, not a test.
1643
1940
  */
1644
- type FaultSide = "target" | "client";
1645
- /** A hop of a manifest is one hop of a topology, as the lab started it. */
1646
- interface ManifestHop {
1647
- readonly name: string;
1648
- readonly kind: "router" | "proxy";
1649
- readonly image: string;
1650
- readonly id: string;
1651
- /** These are the settings of the hop: the form and the idle timeout of a router, the files and settings of a proxy. */
1652
- readonly settings: Readonly<Record<string, string>>;
1653
- /** These are the sysctls of the namespace of the hop, as read back after the harness set them. */
1654
- readonly sysctls: Readonly<Record<string, string>>;
1655
- }
1656
- /** This record is one sysctl of the host for one environment, as the harness read it. */
1657
- interface HostSetting {
1658
- readonly name: string;
1659
- readonly before: string;
1660
- readonly set: string;
1661
- /** This value is the read after the restore. It is null until the restore. */
1662
- readonly restored: string | null;
1941
+ type Decision = "holds" | "fails" | "extend" | "inconclusive" | "measured";
1942
+ /** An interval is a range of times. */
1943
+ interface Interval {
1944
+ readonly low: Quantity;
1945
+ readonly high: Quantity;
1663
1946
  }
1664
- /** A manifest is what a lab records about its machine, its images and its settings. */
1665
- interface Manifest {
1666
- readonly kernel: string;
1667
- /** This text is the architecture of the machine, as uname -m gives it: x86_64. */
1668
- readonly architecture: string;
1669
- readonly hz: string | null;
1670
- /**
1671
- * This text tells where the HZ came from: the configuration of the kernel, or a measurement. A
1672
- * host without /proc/config.gz (a hosted runner) gets a measurement of jiffies against the clock.
1673
- */
1674
- readonly hzFrom?: "config" | "measured";
1675
- readonly boot_id: string;
1676
- readonly docker: string;
1677
- /** This block tells the layer, the cloud and the kernel of the record. A record from before it reads through `substrateOf`. */
1678
- readonly substrate?: Substrate;
1679
- /** This record is the fabric of a cell with `Topology.fabric`. */
1680
- readonly fabric?: FabricManifest;
1681
- /** This record is the target, and its settings as it read them back. */
1682
- readonly target: {
1683
- readonly image: string;
1684
- /** This source is the image of the subject that the target operates (`Target.subject`), with its stock base. */
1685
- readonly subject?: ImageSource;
1686
- readonly base?: string;
1687
- readonly id: string;
1688
- readonly settings: Readonly<Record<string, string>>;
1689
- /** These are the sysctls of its namespace, as read back after the harness set them. */
1690
- readonly sysctls: Readonly<Record<string, string>>;
1691
- /** These are the files that went into the target, by their path, each with the sha256 of its content. */
1692
- readonly files?: Readonly<Record<string, string>>;
1693
- /** This line is the first line of a target that writes them: a server that tells its settings as it reads them. */
1694
- readonly first?: ProbeEvent;
1695
- /** This record tells what the image of a target holds when the harness builds it: the image of a subject (`buildRecordOf`). */
1696
- readonly build?: BuildRecord;
1947
+ /** A spread is the distribution of a set of times: its count, its median and its upper quantiles by nearest rank. */
1948
+ interface Spread {
1949
+ readonly count: number;
1950
+ readonly median: Quantity;
1951
+ readonly p99: Quantity;
1952
+ readonly p999: Quantity;
1953
+ readonly max: Quantity;
1954
+ }
1955
+ /** A verdict is the judgement of a cell on its runs. */
1956
+ interface Verdict {
1957
+ readonly decision: Decision;
1958
+ readonly counted: number;
1959
+ readonly voided: number;
1960
+ /** This band is where each run must land: [T_lo − δ_abs, T_hi + δ_abs]. It is null for a silent prediction. */
1961
+ readonly band: Interval | null;
1962
+ /** These are the runs outside the band, and the reason for each. Each is a finding. */
1963
+ readonly outside: ReadonlyArray<{
1964
+ readonly run: string;
1965
+ readonly why: string;
1966
+ }>;
1967
+ readonly median: Quantity | null;
1968
+ /** This interval is the order-statistic interval of the median at 95 %, or the whole range for fewer than six runs. */
1969
+ readonly medianInterval: Interval | null;
1970
+ /** This time is the slowest reply of a cell that measures a distribution. A closed loop hides the sends in a stall, thus a quantile is a lower bound, and this maximum is not. */
1971
+ readonly slowest?: Quantity;
1972
+ /** This record is the sum of what reordering did in each counted run of a measurement-only cell. */
1973
+ readonly reordering?: Reordering;
1974
+ /** This record is the load of an open-loop cell over its counted runs. */
1975
+ readonly load?: LoadVerdict;
1976
+ /** This record is the estimate of the open loop of a closed-loop stream over its counted runs (SYS-91). */
1977
+ readonly estimate?: EstimateVerdict;
1978
+ /** This record is the time of the proxy of a calibration cell, in each direction. */
1979
+ readonly proxy?: {
1980
+ readonly hop: string;
1981
+ readonly up: Spread | null;
1982
+ readonly down: Spread | null;
1697
1983
  };
1984
+ /** This record is what the group of a group cell did over the counted runs: its stages, and its writes. */
1985
+ readonly group?: GroupVerdict;
1698
1986
  /**
1699
- * This record is the harness: its image, the id of that image and its Alpine packages. It also
1700
- * has the version of the package of the harness, and the build of its image. The record of a
1701
- * cell gives the commit of the code that operated.
1987
+ * These are the outcomes of the second request of an HTTP client over the counted runs, each
1988
+ * with its count: for example "reused, a retry, a reply". An outcome other than the predicted
1989
+ * one is a finding of its run.
1702
1990
  */
1703
- readonly harness: {
1704
- readonly image: string;
1705
- readonly id: string;
1706
- readonly packages: string[];
1707
- readonly version?: string;
1708
- readonly build?: BuildRecord;
1709
- };
1991
+ readonly requests?: Readonly<Record<string, number>>;
1992
+ /** This record is what the client did after the detection over the counted runs, for a prediction that says when it reconnects. */
1993
+ readonly reconnect?: ReconnectVerdict;
1994
+ /** These are the outcomes of the call in flight of a WebSocket client over the counted runs, each with its count. */
1995
+ readonly calls?: Readonly<Record<string, number>>;
1710
1996
  /**
1711
- * This record is the client of each run: the TCP client of the harness, a driver, or an image that
1712
- * the cell gives. `source` is the source of its image, when it is not a stock image by its name.
1997
+ * This record is the time from a drop of the program to the close of its socket by its own side,
1998
+ * over the counted runs. It also counts the runs where the socket did not close itself.
1999
+ * `exited` is the spread of the end of the client process, for the runs where the socket stayed
2000
+ * open until that end (`Measured.exited`).
1713
2001
  */
1714
- readonly client: {
1715
- readonly kind: Client | "image";
1716
- readonly image: string;
1717
- readonly capabilities?: readonly ClientCapability[];
1718
- readonly source?: ImageSource;
1719
- readonly build?: BuildRecord;
1720
- };
1721
- /** These are the namespaces that the prober watched, by inode. */
1722
- readonly netns: {
1723
- readonly client: number;
1724
- readonly target: number;
1725
- readonly hops?: Readonly<Record<string, number>>;
1726
- };
1727
- /** These are the sysctls of the client namespace, as read back after the harness set them. */
1728
- readonly sysctls: Readonly<Record<string, string>>;
1729
- /** These are the sysctls of the host that the cell set: each value before, as set, and as restored. */
1730
- readonly host?: readonly HostSetting[];
1731
- /** These are the hops of a topology, in sequence from the client. */
1732
- readonly hops?: readonly ManifestHop[];
1733
- /** These are the parts of a group, with their settings as each part read them back. */
1734
- readonly group?: {
1735
- readonly members: ReadonlyArray<{
1736
- readonly name: string;
1737
- readonly ip: string;
1738
- readonly id: string;
1739
- readonly settings: Readonly<Record<string, string>>;
1740
- }>;
1741
- readonly sentinels: ReadonlyArray<{
1742
- readonly name: string;
1743
- readonly ip: string;
1744
- readonly id: string;
1745
- readonly settings: Readonly<Record<string, string>>;
1746
- }>;
1747
- readonly observer: {
1748
- readonly image: string;
1749
- };
2002
+ readonly left?: {
2003
+ readonly spread: Spread | null;
2004
+ readonly stayed: number;
2005
+ readonly exited?: Spread | null;
1750
2006
  };
2007
+ readonly why: string;
1751
2008
  }
1752
- /** These are the JSON lines of a program, as they arrive. */
1753
- interface Lines<T extends {
1754
- readonly ev: string;
1755
- }> {
1756
- readonly seen: T[];
1757
- /** These are the other lines that it wrote, for example an error. They explain a program that stopped its output. */
1758
- readonly other: string[];
1759
- consume: (stream: NodeJS.ReadableStream) => void;
1760
- /** This method gives the first line of one of these kinds, or it rejects after `within` ms. */
1761
- until(kinds: readonly string[], within: number, who: string): Promise<T>;
2009
+ /**
2010
+ * A reconnect verdict sums the reconnect of the client over the counted runs. Each wait before a
2011
+ * try gets its spread. A wait outside its band is a finding of its run, thus it is in `outside`.
2012
+ * - `syn` is the time from the detection to the first SYN of a new socket.
2013
+ * - `established` is the time from the detection to the first new socket that became ESTABLISHED.
2014
+ * - `connect` is the time from a `dial` line to the SYN of its socket: the work of the program.
2015
+ */
2016
+ interface ReconnectVerdict {
2017
+ readonly waits: ReadonlyArray<Spread | null>;
2018
+ readonly syn: Spread | null;
2019
+ readonly established: Spread | null;
2020
+ readonly connect: Spread | null;
1762
2021
  }
1763
- /** A probe is the client container of one run. */
1764
- interface Probe {
1765
- /** This method gives the first event of one of these kinds, or it rejects after `within` ms. */
1766
- until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
1767
- /** This method lets an in-flight probe send its request. */
1768
- go(): Promise<void>;
1769
- /** This method freezes the client with the cgroup freezer: its process stops, and its kernel continues to answer. */
1770
- freeze(): Promise<void>;
1771
- thaw(): Promise<void>;
1772
- /** This method stops the process of the client with SIGKILL. Its kernel then closes its socket with a FIN, or a reset. */
1773
- kill(): Promise<void>;
1774
- readonly events: readonly ProbeEvent[];
1775
- stop(): Promise<void>;
2022
+ /**
2023
+ * A stage verdict is the test of one stage of the timeline of a group against its band. The band
2024
+ * is [T_lo − δ_abs, T_hi + the error of the stamps + δ_abs]. A run that did not announce the stage
2025
+ * is outside too.
2026
+ */
2027
+ interface StageVerdict {
2028
+ readonly stage: Stage;
2029
+ readonly band: Interval;
2030
+ readonly median: Quantity | null;
2031
+ readonly outside: ReadonlyArray<{
2032
+ readonly run: string;
2033
+ readonly why: string;
2034
+ }>;
2035
+ readonly decision: "holds" | "fails";
1776
2036
  }
1777
- /** An agent is a container that a lab starts in the namespaces of the target, for example a Node process that signals the server. */
1778
- interface Agent {
1779
- /** These are the JSON lines that it wrote, as they arrive. */
1780
- readonly lines: Lines<{
1781
- readonly ev: string;
2037
+ /**
2038
+ * A group verdict sums what the group of a group cell did in its counted runs:
2039
+ * - `stages` tests each stage that the prediction gives a band.
2040
+ * - `medians` is the median of each stage that a run announced, from the fault.
2041
+ * - `lost` counts the writes that a primary accepted and the group did not keep, in each run.
2042
+ * - `old` counts the writes that the old primary accepted after the fault, in each run.
2043
+ * - `unknown` counts the writes whose outcome the client did not see, and how many the group kept.
2044
+ * - `errors` are the errors on the way: the runs that met each, and the median of its first time.
2045
+ * - `lags` is the spread of the delays of the stamps, for a calibration.
2046
+ * - `duplicates` counts the extra copies that the group holds, in each run. A cell with no band of
2047
+ * copies has no such count.
2048
+ */
2049
+ interface GroupVerdict {
2050
+ readonly stages: readonly StageVerdict[];
2051
+ readonly medians: Partial<Record<Stage, Quantity>>;
2052
+ readonly lost: {
2053
+ readonly runs: number;
2054
+ readonly total: number;
2055
+ readonly median: number | null;
2056
+ readonly max: number | null;
2057
+ };
2058
+ readonly old: {
2059
+ readonly median: number | null;
2060
+ readonly max: number | null;
2061
+ };
2062
+ readonly unknown: {
2063
+ readonly total: number;
2064
+ readonly held: number;
2065
+ };
2066
+ readonly errors: ReadonlyArray<{
2067
+ readonly name: string;
2068
+ readonly runs: number;
2069
+ readonly first: Quantity;
1782
2070
  }>;
1783
- /** This method starts a command in the agent, and gives its standard output. */
1784
- exec(argv: readonly string[]): Promise<string>;
1785
- stop(): Promise<void>;
2071
+ readonly lags?: Spread | null;
2072
+ readonly duplicates?: {
2073
+ readonly runs: number;
2074
+ readonly total: number;
2075
+ readonly median: number | null;
2076
+ readonly max: number | null;
2077
+ };
1786
2078
  }
1787
- /** A sibling is a server that a lab starts on the network of the target, for example a standby. */
1788
- interface Sibling {
1789
- readonly ip: string;
1790
- readonly netns: number;
1791
- /** This method starts a command in the sibling, and gives its standard output. */
1792
- exec(argv: readonly string[]): Promise<string>;
2079
+ /**
2080
+ * This function gives the value at quantile p of sorted values, by nearest rank: x_(⌈p·n⌉). It is
2081
+ * `quantileSorted` of @mark1russell7/rigor-statistics with the method `"nearest-rank"`.
2082
+ */
2083
+ export declare const quantileOf: (sorted: readonly number[], p: number) => number;
2084
+ /** This function gives the spread of a set of times, or null for none. */
2085
+ export declare const spreadOf: (times: readonly Quantity[]) => Spread | null;
2086
+ /**
2087
+ * This function gives the distribution-free interval of a median: [x_(k), x_(n+1−k)], for the
2088
+ * largest k whose two tails each hold 2.5 % or less. For eleven runs, it gives [x_(2), x_(10)],
2089
+ * at 98.8 %. It is `medianInterval` of @mark1russell7/rigor-statistics at the level 0.95. An
2090
+ * empty list throws a RangeError.
2091
+ */
2092
+ export declare const medianInterval: (sorted: readonly number[]) => [number, number];
2093
+ /**
2094
+ * This function gives the verdict of a cell, from two tests:
2095
+ * - Containment: each run lands in [T_lo − δ_abs, T_hi + δ_abs]. A run outside is a finding.
2096
+ * - Median equivalence: the interval of the median is in the band, made wider by δ_rel. An
2097
+ * interval outside the band fails. An interval across its edge extends the cell to 22 runs, then
2098
+ * 44, and then the verdict is inconclusive.
2099
+ *
2100
+ * A silent prediction holds only if no run detected the fault in its window. After a stall, the
2101
+ * return of the reply gets the same test as a detection, by its interval, and a detection is a
2102
+ * finding. The distribution test (a DKW band) needs a predicted distribution from a simulator,
2103
+ * which does not exist at this time.
2104
+ */
2105
+ export declare const verdictOf: (prediction: Prediction, runs: readonly Measured[], noise?: Quantity) => Verdict;
2106
+ /** This function sums what the group of a group cell did in its counted runs, and tests each stage that has a band. */
2107
+ export declare const groupVerdictOf: (prediction: Prediction, counted: readonly Measured[], delta?: Quantity) => GroupVerdict;
2108
+ /**
2109
+ * An outcome tells how the wait of a run ended. The socket failed with an errno, or it read the
2110
+ * end of the file. Or nothing came, or the reply came back after a stall. The observer can also
2111
+ * close the connection itself (`closed`), or its program can drop it on its own timer (`dropped`).
2112
+ */
2113
+ type Outcome = {
2114
+ readonly kind: "error";
2115
+ readonly errno: string;
2116
+ } | {
2117
+ readonly kind: "eof";
2118
+ } | {
2119
+ readonly kind: "silent";
2120
+ } | {
2121
+ readonly kind: "answered";
2122
+ } | {
2123
+ readonly kind: "closed";
2124
+ } | {
2125
+ readonly kind: "dropped";
2126
+ };
2127
+ /**
2128
+ * A request reading is what the second request of an HTTP client met, from the lines of the
2129
+ * client. It holds the connection of its first try, a new try, and its outcome. `gap` is the time
2130
+ * from the end of the first reply to the send of the second request.
2131
+ */
2132
+ interface RequestReading {
2133
+ readonly connection: "reused" | "new";
2134
+ readonly retried: boolean;
2135
+ readonly error: string | null;
2136
+ readonly pending: boolean;
2137
+ readonly gap: Quantity | null;
1793
2138
  }
1794
- /** A lab is one environment: the target, the client, the hops of a topology, the injectors and the prober. */
1795
- interface Lab {
1796
- /** This address is the address of the target on its own network. */
1797
- readonly serverIp: string;
1798
- /** This address is the address that the client connects to: the target, or the first proxy of a topology. */
1799
- readonly targetIp: string;
1800
- /** This port is the port that the client connects to. */
1801
- readonly targetPort: number;
1802
- readonly clientIp: string;
1803
- readonly netns: {
1804
- readonly client: number;
1805
- readonly target: number;
1806
- readonly hops?: Readonly<Record<string, number>>;
1807
- };
1808
- /** This record is where each socket of a topology is, or null for a direct pair. */
1809
- readonly topology: RunTopology | null;
1810
- /** These are the lines of the routers of a topology, in sequence, each with the name of its hop. A direct pair has none. */
1811
- readonly middlebox: readonly MiddleboxEvent[];
1812
- /** These are the lines of a target that writes them (`Target.lines`), in sequence. Another target has none. */
1813
- readonly server: readonly ProbeEvent[];
1814
- /** This method adds a toxic to the Toxiproxy hop of a topology, or removes it with null. The stamps of the injector bracket it. */
1815
- toxic(toxic: Toxic | null): Promise<{
1816
- t0: number;
1817
- t1: number;
1818
- }>;
1819
- /** This method makes the target close the connection of each client, with the command of the target. */
1820
- serverClose(): Promise<void>;
1821
- /**
1822
- * This method starts an agent in the network namespace of the target, and in its process
1823
- * namespace with `pid`. Its command keeps it up, for example `sleep infinity`.
1824
- */
1825
- agent(image: string, command: readonly string[], options?: {
1826
- readonly pid?: boolean;
1827
- }): Promise<Agent>;
1828
- /** This method starts a sibling, and waits for a line of its log. */
1829
- sibling(image: string, command: readonly string[], ready: string): Promise<Sibling>;
1830
- /** This method starts a command in the target, and gives its standard output. */
1831
- exec(argv: readonly string[]): Promise<string>;
1832
- /** These are all the records that the prober wrote, in sequence. */
1833
- readonly kernel: readonly KernelRecord[];
1834
- /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
1835
- sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1836
- /** This method sets the settings of the target in it before a client connects, and reads them back. */
1837
- configure(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1838
- /** This method sets the sysctls of the target namespace through a privileged sidecar there, and reads them back. */
1839
- targetSysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
1840
- /** This method runs each command in the namespace of the client and in the namespace of the target. */
1841
- namespaceSetup(commands: readonly (readonly string[])[]): Promise<void>;
1842
- /** This method sets sysctls of the host through a privileged sidecar on the network of the host, and reads them back. */
1843
- hostSysctl(settings: readonly HostSysctl[]): Promise<void>;
1844
- /** This method puts back each value that `hostSysctl` changed, once, and gives the record of each. Closing the lab also does it. */
1845
- restoreHost(): Promise<readonly HostSetting[]>;
1846
- /**
1847
- * This method applies a fault between the client and the target, by default from the namespace
1848
- * of the target. The fault is a black hole, or a reset that answers the next segment of the
1849
- * client. At a proxy of a topology, the rules face the peer of the proxy on one side. The stamps
1850
- * of the injector bracket it.
1851
- */
1852
- fault(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<{
1853
- t0: number;
1854
- t1: number;
1855
- }>;
1856
- /** This method removes a fault. */
1857
- lift(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<void>;
2139
+ /** A measurement is what one run measured, against the prediction of its cell. */
2140
+ interface Measured {
2141
+ readonly environment: number;
2142
+ readonly index: number;
2143
+ readonly outcome: Outcome;
1858
2144
  /**
1859
- * This method puts tc netem on the egress of a namespace, for example "delay 20ms" or "loss 5%",
1860
- * or removes it with null. At a hop, it is the egress of the device of the hop toward one side.
1861
- * The stamps of the injector bracket it.
2145
+ * This time is from the reference event of the prediction to the detection, both as the kernel
2146
+ * stamped them in the records of the prober. It is null when nothing detected the fault.
1862
2147
  */
1863
- netem(spec: string | null, at?: FaultPlace): Promise<{
1864
- t0: number;
1865
- t1: number;
1866
- }>;
2148
+ readonly elapsed: Quantity | null;
2149
+ /** This time is the same interval from the TCP_INFO samples of the client, the second vantage. */
2150
+ readonly socket: Quantity | null;
2151
+ /** This time is how long the client took to see the error after the kernel reported it. */
2152
+ readonly noticed: Quantity | null;
1867
2153
  /**
1868
- * This method sets the TSO, GSO and GRO of a namespace. With them off, netem and a length match
1869
- * act on segments, not on GSO super-packets of up to 64 KB. At a hop, it sets the two devices of the hop.
2154
+ * These are the steps of the kernel after the reference: each keepalive probe, or each firing of
2155
+ * the RTO timer. After a stall, they are each retransmission from the send, the loss probe first.
1870
2156
  */
1871
- offload(on: boolean, at?: FaultPlace): Promise<void>;
1872
- /** This method stops the server process in the target with SIGKILL, with the command of the target. */
1873
- kill(): Promise<void>;
2157
+ readonly steps: readonly Quantity[];
1874
2158
  /**
1875
- * This method resolves the neighbors of the path in the two directions, with a ping from each
1876
- * namespace. Without it, the first connection of an environment waits for ARP. Under a netem
1877
- * delay, that wait is one more delayed round, and its round trip and RTO are longer.
2159
+ * These are the reply times of a measurement-only cell. For each request after the first, a
2160
+ * sample is the time from its send to the first data after it.
1878
2161
  */
1879
- warm(): Promise<void>;
1880
- /** This method runs commands in the target before a client connects, each as argv. */
1881
- setup(commands: ReadonlyArray<readonly string[]>): Promise<void>;
2162
+ readonly samples?: readonly Quantity[];
2163
+ /** This measure is the run of an open-loop cell against its schedule (`Run.schedule`), with its failed replies. Its times are in ms. */
2164
+ readonly load?: RunLoad;
2165
+ /** This estimate is the open loop that a closed-loop stream of the client of the harness hid (SYS-91). Its times are in ms. */
2166
+ readonly estimate?: RunEstimate;
2167
+ /** This count is the number of keepalive probes that the kernel sent. */
2168
+ readonly probes: number;
2169
+ /** This count is the number of segments that the kernel sent again. */
2170
+ readonly retransmissions: number;
2171
+ /** This count is the number of segments that the socket received after the request. */
2172
+ readonly acks: number;
2173
+ /** This count is the number of bytes that the client read after the request. */
2174
+ readonly bytes?: number;
1882
2175
  /**
1883
- * This method stops a black hole at an instant on the monotonic clock of the VM. The injector
1884
- * waits for that instant in the VM, thus the length of a stall does not include the latency of
1885
- * a docker exec. Stamps bracket it, as for a fault.
2176
+ * This time is when a router of the topology forgot the flow of the client. It counts from the
2177
+ * last segment that the client received before the fault. It is null when no router forgot the flow.
1886
2178
  */
1887
- heal(at: FaultPlace, when: number): Promise<{
1888
- t0: number;
1889
- t1: number;
1890
- }>;
2179
+ readonly forgot?: Quantity | null;
1891
2180
  /**
1892
- * This method removes what the two kernels learned from their earlier connections. These are
1893
- * the TCP metrics that each kernel keeps for a peer address when a connection closes. These metrics set the
1894
- * first round trip of the next connection, and thus its RTO. A run with these metrics is not
1895
- * independent of the run before it.
2181
+ * This time is the first round trip of the socket of the observer. It is the smoothed round trip
2182
+ * in its first record, which is the sample of the handshake. It is null when no record has it.
1896
2183
  */
1897
- forget(): Promise<void>;
1898
- /** This part is the routed fabric of a lab with `Topology.fabric`. */
1899
- readonly fabric?: FabricLab;
1900
- /** This method freezes the target with the cgroup freezer: its process stops, and its kernel continues to answer. */
1901
- freeze(): Promise<void>;
1902
- thaw(): Promise<void>;
2184
+ readonly rtt?: Quantity | null;
2185
+ /** This record tells what reordering did in a run of a measurement-only cell, from the records of its two ends. */
2186
+ readonly reordering?: Reordering;
2187
+ /** These are the times of the proxy of a calibration cell, one for each request and its reply. */
2188
+ readonly crossings?: Crossings;
2189
+ /** This record is what a run of a group cell measured: the stages of its timeline, and what became of each write. */
2190
+ readonly group?: GroupMeasured;
2191
+ /** This record is what a run of a queue cell measured: the count of the queue, its counters, and each connection. */
2192
+ readonly queue?: QueueReading;
2193
+ /** This record is what a run of a port cell measured: the count of each search, and when each port came back. */
2194
+ readonly ports?: PortsReading;
2195
+ /** This record is what a run of a conntrack cell measured: the flows, the count, and when a slot came back. */
2196
+ readonly conntrack?: ConntrackReading;
2197
+ /** This record is what the second request of an HTTP client met, for a cell whose prediction says it. */
2198
+ readonly request?: RequestReading | null;
2199
+ /** This record is the time of each later band of a driver cell (`DriverBand.then`). */
2200
+ readonly driver?: {
2201
+ readonly steps: readonly DriverStepTime[];
2202
+ };
2203
+ /** This record is what the client did after the detection, for a prediction that says when it reconnects. */
2204
+ readonly reconnect?: ReconnectReading;
2205
+ /** This record is what the call in flight of a WebSocket client met. */
2206
+ readonly call?: CallReading;
2207
+ /** This record is what a stream that crossed the fault delivered, for a prediction with a delivery law. */
2208
+ readonly delivery?: DeliveryReading;
1903
2209
  /**
1904
- * This method sends a signal to the server process of the target (`Target.program`), at once or
1905
- * at an instant of the VM. A sidecar in the network and process namespaces of the target sends
1906
- * it, and the injector stamps it. The lab starts that sidecar at the first signal.
2210
+ * This time is from the drop line of the program to the close of its socket by its own side: a
2211
+ * FIN or an abort. A prediction that says how the program drops (`drop`) gets it. It is null
2212
+ * when the socket did not close itself in the run. A prediction can say that the client process
2213
+ * ends with the run (`exits`). Then a close at that end is no close by the program, and `left` is null.
1907
2214
  */
1908
- signal(signal: "STOP" | "CONT" | "KILL", at?: number): Promise<{
1909
- t0: number;
1910
- t1: number;
1911
- }>;
2215
+ readonly left?: Quantity | null;
1912
2216
  /**
1913
- * This method applies an event at a proxy hop (`HopEvent`), or its undo. A signal goes from a
1914
- * sidecar in the network and process namespaces of the hop. The lab starts that sidecar at the
1915
- * first signal of the hop. A query goes from the injector of the hop to its console on 127.0.0.1. The
1916
- * injector stamps each one. An event with no undo gives null for its undo. A signal can wait for an
1917
- * instant on CLOCK_MONOTONIC (`at`), as the thaw at the end of a hold does.
2217
+ * This time is from the drop line of the program to the end of the client process. A socket gets
2218
+ * it when it stayed open until that end. The kernel closed it then, not the program (`exits`).
1918
2219
  */
1919
- event(event: HopEvent, undo?: boolean, at?: number): Promise<{
1920
- t0: number;
1921
- t1: number;
1922
- } | null>;
1923
- /** This method starts the client with `args`. Each file is in its container before it starts. */
1924
- probe(args: readonly string[], files?: ReadonlyArray<{
1925
- readonly content: string;
1926
- readonly target: string;
1927
- }>): Promise<Probe>;
2220
+ readonly exited?: Quantity;
1928
2221
  /**
1929
- * This method waits for the next clock line of the prober, which gives the count of lost
1930
- * records. It gives null when no clock line comes in 5 s, because then nothing tells the count.
2222
+ * This record is the pairing window of the run: the jitter bound that it measured, and the
2223
+ * window that its pairings used (`pairingOf`). A run that has a jitter record gets it. Thus a
2224
+ * reader can check each pairing of the run again.
1931
2225
  */
1932
- settle(): Promise<number | null>;
1933
- manifest(sysctls: Readonly<Record<string, string>>, settings?: Readonly<Record<string, string>>, targetSysctls?: Readonly<Record<string, string>>): Promise<Manifest>;
1934
- close(): Promise<void>;
2226
+ readonly pairing?: Pairing;
2227
+ /** This record is what a run of a paused consumer measured. */
2228
+ readonly pause?: PauseReading;
2229
+ /** This text is the reason that the run cannot count, or null. A void run is not a pass and not a finding. */
2230
+ readonly void: string | null;
2231
+ /** This text tells what in the run disagrees with the prediction, other than its timing, or null. */
2232
+ readonly finding: string | null;
1935
2233
  }
1936
2234
  /**
1937
- * This function gives the content of a file of a proxy. Each {{next}} becomes the address and the
1938
- * port of the next hop. Each {{next.host}} and {{next.port}} becomes one of the two.
2235
+ * A reordering record is what reordering, duplicates and losses did to the data of a run. The
2236
+ * receiver is the client, and the sender is the socket of its peer.
2237
+ * - `outOfOrder` counts the arrivals at the client beyond a hole, and `duplicates` counts the
2238
+ * arrivals whose data the client had. The prober reads the two from each arrival, against `rcv_nxt`.
2239
+ * - An arrival can hold more than one segment. The kernel joins the segments that wait in the
2240
+ * backlog of a socket while its owner holds it.
2241
+ * - `ooo` is the count of the kernel of the client in segments (`rcv_ooopack`).
2242
+ * - `sacked` and `lost` are the most segments that the sender held as SACKed and as lost.
2243
+ * - `dsacks` is the DSACK blocks that the sender received, and `fast` its fast retransmissions.
2244
+ * - `degree` is the highest reordering degree of the sender (`tp->reordering`), and `seen` the
2245
+ * reorderings that it detected (`reord_seen`).
2246
+ *
2247
+ * The counts of the kernel are null for a record of the prober before version 0.2.
1939
2248
  */
1940
- export declare const templated: (content: string, next: string) => string;
1941
- /** This function gives the JSON body of a toxic for the API of Toxiproxy. Each toxic of a cell has the name `fault`. */
1942
- export declare const toxicBody: (toxic: Toxic) => string;
2249
+ interface Reordering {
2250
+ readonly outOfOrder: number;
2251
+ readonly duplicates: number;
2252
+ readonly ooo: number | null;
2253
+ readonly sacked: number | null;
2254
+ readonly lost: number | null;
2255
+ readonly dsacks: number | null;
2256
+ readonly fast: number;
2257
+ readonly degree: number | null;
2258
+ readonly seen: number | null;
2259
+ }
1943
2260
  /**
1944
- * This function gives the routes of a chain: for each router, the networks after it, which the
1945
- * element before it reaches through it. Element 0 is the client, and element k is hop k - 1. Network
1946
- * j is the network between element j and element j + 1.
2261
+ * A crossings record is the time of a proxy for each request (`up`) and for each reply (`down`).
2262
+ * The time of a request starts at its arrival on the socket toward the client. It stops at the
2263
+ * write on the socket toward the target. The time of a reply goes the other way. A write is a
2264
+ * `tx` record of the prober.
2265
+ */
2266
+ interface Crossings {
2267
+ readonly hop: string;
2268
+ readonly up: readonly Quantity[];
2269
+ readonly down: readonly Quantity[];
2270
+ }
2271
+ /** A socket place is a socket of a run: its namespace and its cookie. */
2272
+ interface SocketPlace {
2273
+ readonly netns: number;
2274
+ readonly cookie: number;
2275
+ }
2276
+ /**
2277
+ * This function finds the socket of the observer of a cell in a run:
2278
+ * - the client socket, by the address that it connected from, in its namespace.
2279
+ * - the socket of the target for the same connection, in its namespace.
2280
+ * - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
2281
+ * it is the socket that carries the request, else the first socket that the run opens.
1947
2282
  */
1948
- export declare const routesOf: (hops: readonly Pick<Hop, "kind">[]) => Array<{
1949
- readonly from: number;
1950
- readonly via: number;
1951
- readonly networks: readonly number[];
1952
- }>;
2283
+ export declare const socketOf: (cell: Cell, run: Run) => SocketPlace | undefined;
2284
+ /** This function gives what reordering did in a run, from the records of the receiver and of the sender. */
2285
+ export declare const reorderingOf: (receiver: readonly KernelRecord[], sender: readonly KernelRecord[]) => Reordering;
1953
2286
  /**
1954
- * This function gives the endpoint that an element connects to: the first element after it that
1955
- * is not a router. Element 0 is the client, element k is hop k - 1, and the last element is the target.
2287
+ * This function gives the times of a proxy in a run, for each request after the first. The time
2288
+ * of a request starts at its arrival on the socket of the proxy toward the client. It stops at the
2289
+ * next write on the socket toward the target. The time of its reply starts at its arrival on the
2290
+ * socket toward the target, and it stops at the next write toward the client. A request without
2291
+ * each record gives no time.
1956
2292
  */
1957
- export declare const endpointAfter: (hops: readonly Pick<Hop, "kind">[], element: number) => number;
2293
+ export declare const crossingsOf: (run: Run, hop: string, toClient: SocketPlace | undefined, toTarget: SocketPlace | undefined) => Crossings;
1958
2294
  /**
1959
- * This function gives HZ from two readings of /proc/timer_list, one second apart: its `now at`
1960
- * time in ns and its jiffies. It gives the nearest rate that Linux offers, or null when the
1961
- * measurement is more than 5 % from each of them.
2295
+ * This function reads one run against its cell, from the records of the kernel first.
2296
+ * - The socket of the run is the socket of its observer. It is the socket that the client connected
2297
+ * from, in its namespace, or the socket of the target or of a proxy for that connection.
2298
+ * - The fault must hold before the event that it must meet. That is before the request goes into
2299
+ * it, and before the first keepalive probe. A live peer answers that probe, and the answer
2300
+ * starts the idle time again. A run where the fault was late is void. A run whose records the
2301
+ * prober lost is also void.
2302
+ * - For an HTTP client, it also reads what the second request met (`requestOf`). An outcome other
2303
+ * than the one that the prediction gives is a finding.
1962
2304
  */
1963
- export declare const hzOf: (first: {
1964
- now: number;
1965
- jiffies: number;
1966
- }, second: {
1967
- now: number;
1968
- jiffies: number;
1969
- }) => string | null;
1970
- /** This function gives the build record of a source as a part of a manifest: `{ build }`, or nothing for an image that the harness pulls. */
1971
- export declare const buildOf: (source: Parameters<typeof buildRecordOf>[0]) => {
1972
- readonly build?: BuildRecord;
1973
- };
1974
- /** This function gives the version of the harness and the build of its image, as a part of the harness record of a manifest. */
1975
- export declare const harnessRecord: () => {
1976
- readonly version: string;
1977
- readonly build?: BuildRecord;
1978
- };
2305
+ export declare const measure: (cell: Cell, run: Run) => Measured;
1979
2306
  /**
1980
- * This function gives the record of the client of a run that the harness ships, for a manifest:
1981
- * its kind, its image, and its build.
2307
+ * This function measures the jitter of the program of the observer in a run, from its records
2308
+ * (`Jitter`). The acts count up to the start of the fault, or up to the reply of the client when
2309
+ * the fault has no stamp. A run with no lines of a program, or no socket of the observer, has no act.
1982
2310
  */
1983
- export declare const shippedClientRecord: (kind: Client, image: string) => Manifest["client"];
1984
- /** This function gives the device of a route from its line in `ip -o route get`: "10.0.0.2 dev eth0 src …". */
1985
- export declare const deviceOf: (route: string) => string;
2311
+ export declare const jitterOf: (cell: Cell, run: Run) => Jitter;
1986
2312
  /**
1987
- * This function opens one environment:
1988
- * - a chain of new networks, and the stock target on the last one. A direct pair has one network.
1989
- * - a client that holds its own network namespace, with a privileged sidecar in it for its
1990
- * sysctls and its routes. Docker Desktop keeps /proc/sys read-only in a container that operates
1991
- * without privileges.
1992
- * - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
1993
- * proxy with an injector sidecar in its namespace.
1994
- * - an injector sidecar in the namespace of the target.
1995
- * - the prober, a privileged container that loads the kernel program and watches the namespace of
1996
- * the client, of the target and of each hop.
1997
- *
1998
- * The client of each run is its own container in the namespace of the client. It is the TCP
1999
- * client of the harness, a driver from its own image (ioredis on Node), or an image that the
2000
- * caller gives. Each prints the same lines.
2313
+ * This function reads the second request of an HTTP client from its lines. Its first try is its
2314
+ * first `request` line, and each `retry` line is a new try. Its end is its `error` line, or its
2315
+ * `replied` line. A request with neither is pending. It gives null when the client wrote no try.
2001
2316
  *
2002
- * The client reaches the networks after a router through that router, by a route that its
2003
- * privileged sidecar adds. A router translates the address of the side of the client, thus the
2004
- * target and each later hop see the router as the peer.
2317
+ * A new try that gets no connection writes no `retry` line. Its dial writes a `dial-error` line.
2318
+ * Thus a `dial-error` line after the first try and before the end is also a new try.
2005
2319
  */
2006
- export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology) => Promise<Lab>;
2320
+ export declare const requestOf: (events: readonly ProbeEvent[]) => RequestReading | null;
2007
2321
  /** This text is the line of the log of a standby that serves reads (src/backend/postmaster/postmaster.c:3740). */
2008
2322
  export declare const STANDBY_READY: string;
2009
2323
  /** This text is the write of the client, with its sequence number. */
@@ -2019,385 +2333,94 @@ export declare const pairArgs: (cell: Cell, lab: Pick<Lab, "targetIp" | "targetP
2019
2333
  /** This function gives the instants of the cancels of a hold, in ns from the fault: equal parts of the hold. */
2020
2334
  export declare const cancelsOf: (pair: Pair, holdNs: number) => number[];
2021
2335
  /**
2022
- * This function opens the pair of an environment. The table comes first and the standby next: the
2023
- * base backup has it. A synchronous standby is named last, thus no setup step waits for it.
2024
- */
2025
- export declare const openStandby: (lab: Lab, cell: Cell) => Promise<Sibling>;
2026
- /**
2027
- * This function does one run of a pair. A dry run writes and stops, with no fault: the warm-up of the
2028
- * environment. It removes its rows, thus the numbers of the run start on an empty table.
2029
- */
2030
- export declare const pairOnce: (lab: Lab, standby: Sibling, cell: Cell, environment: number, index: number, dry?: boolean) => Promise<Run>;
2031
- /**
2032
- * This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
2033
- * package that a build installs, thus its sha256 pins the packages that the image holds. The
2034
- * versions of the packages that each manifest names directly are the part that a person reads.
2035
- */
2036
- /** A context file is a file of a build context: its path in the context, and its content. */
2037
- interface ContextFile {
2038
- readonly at: string;
2039
- readonly content: Buffer | string;
2040
- }
2041
- /**
2042
- * These are the names of the lockfiles that the harness records. A `go.mod` is the lockfile of a Go
2043
- * module, because its `require` lines give exact versions. For them, Go selects the same packages
2044
- * each time, and its checksum database examines each package.
2045
- */
2046
- export declare const LOCK_NAMES: ReadonlySet<string>;
2047
- /** This function gives each lockfile of a context by its path, with the sha256 of its content in hex. */
2048
- export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
2049
- /** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
2050
- export declare const npmVersions: (lock: string) => Record<string, string>;
2051
- /**
2052
- * This function gives the version of each direct dependency of the root package of a Cargo.lock: the
2053
- * package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
2054
- * and a version when the lock holds two versions of that name.
2055
- */
2056
- export declare const cargoVersions: (lock: string, manifest: string) => Record<string, string>;
2057
- /** This function gives the version of each direct requirement of a go.mod. A requirement that is `// indirect` is not direct. */
2058
- export declare const goVersions: (mod: string) => Record<string, string>;
2059
- /** This function gives the version of each jar of a list of jars by their SHA-256: `<hex> HikariCP-7.1.0.jar` gives HikariCP 7.1.0. */
2060
- export declare const jarVersions: (list: string) => Record<string, string>;
2061
- /**
2062
- * This function gives the version of each package that the manifests of a context name directly,
2063
- * by its name. It reads each npm lockfile, Cargo.lock, go.mod and list of jars. A package of a
2064
- * workspace in the context is a package of the image too, with the version of its package.json.
2065
- * Such a package has a name and a version, and it is not private. The record has the sha256 of
2066
- * the lockfile of a pnpm, yarn or bun workspace (`locksOf`). This function does not read versions
2067
- * from such a lockfile.
2068
- */
2069
- export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
2070
- /**
2071
- * This function gives each problem of one image of a run outside a manifest of the harness, as the
2072
- * kind lab records its images. A pulled image needs its digest. An image that a build makes needs
2073
- * its build record, with each base by digest. The build record must have the tag of the image.
2074
- */
2075
- export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
2076
- /**
2077
- * This function gives each problem of a manifest that stops it from pinning the programs of its
2078
- * run. An empty list means that the manifest pins each program.
2079
- * - the target: an image by its digest, or the build of a subject with its build record and its base
2080
- * by digest.
2081
- * - the harness: the version of its package, and the build record of its image.
2082
- * - the client: an image by its digest, or a build with its build record.
2083
- * - each hop: an image by its digest, or the tag of a build and the id of its image.
2084
- */
2085
- export declare const manifestProblems: (manifest: Manifest) => string[];
2086
- /** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
2087
- export declare const commitProblems: (commit: string | undefined) => string[];
2088
- /** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
2089
- interface RecordCode {
2090
- readonly commit: string;
2091
- readonly dirty: boolean;
2092
- }
2093
- /** These are the parts of a record that tell if it pins the programs of its runs. */
2094
- interface Pinnable {
2095
- readonly code?: RecordCode | undefined;
2096
- readonly manifests: readonly Manifest[];
2097
- /** A local debug run marks its record so. No page reads such a record. */
2098
- readonly debug?: boolean | undefined;
2099
- }
2100
- /** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
2101
- export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
2102
- /** This problem is the problem of a record of a local debug run. */
2103
- export declare const DEBUG = "the record is of a local debug run, and no page reads it";
2104
- /**
2105
- * This function gives each problem that stops a record from pinning the programs of its runs. A
2106
- * record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
2107
- * of a schedule refuses it. A commit with changes to tracked files is not a pin.
2108
- */
2109
- export declare const recordProblems: (record: Pinnable) => string[];
2110
- /**
2111
- * This module is the lab of a replicated group: a primary and its replicas, and the Sentinels
2112
- * that decide which member is the primary. It opens one environment for a group cell, and it does
2113
- * the runs of the cell in it. Each member and each Sentinel is a container from the stock image of
2114
- * the group, in its own network namespace. An injector sidecar shares its network and process
2115
- * namespaces. The client of each run is ioredis in Sentinel mode. An observer subscribes to the
2116
- * events of each Sentinel, and the prober watches the namespace of the client.
2117
- */
2118
- /** A stamp is the time of the injector around one commit, on CLOCK_MONOTONIC in nanoseconds. */
2119
- interface Stamp {
2120
- readonly t0: number;
2121
- readonly t1: number;
2122
- }
2123
- /** A group network fault is a black hole between a part and its peers, or a reset of each segment from them. */
2124
- type GroupNetworkFault = "blackhole" | "rst";
2125
- /** A group client is the client container of one run of a group cell. */
2126
- interface GroupClient {
2127
- readonly events: readonly ProbeEvent[];
2128
- until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
2129
- stop(): Promise<void>;
2130
- }
2131
- /** A group lab is one environment of a group cell. */
2132
- interface GroupLab {
2133
- readonly group: Group;
2134
- readonly clientIp: string;
2135
- readonly observerIp: string;
2136
- readonly members: Readonly<Record<string, RunPart>>;
2137
- readonly sentinels: Readonly<Record<string, RunPart>>;
2138
- /** These are the namespaces that the prober watches: the client, and the Sentinels for a calibration. */
2139
- readonly netns: {
2140
- readonly client: number;
2141
- readonly watched: readonly number[];
2142
- };
2143
- /** These are all the records that the prober wrote, in sequence. */
2144
- readonly kernel: readonly KernelRecord[];
2145
- /** These are all the lines of the observer of the Sentinels, in sequence. */
2146
- readonly timeline: readonly SentinelEvent[];
2147
- /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
2148
- sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
2149
- /** This method waits until the group is whole and calm, and gives the name of its primary. */
2150
- converge(within?: number): Promise<string>;
2151
- /** This method removes each key from the group, and waits until each replica has the removal. */
2152
- flush(primary: string): Promise<void>;
2153
- /** This method makes each Sentinel forget the state of the group (`SENTINEL RESET`): an aborted failover then holds off no later failover. */
2154
- reset(): Promise<void>;
2155
- /** This method gives the sequence numbers that the group holds, from its primary. */
2156
- holds(primary: string): Promise<number[]>;
2157
- /** This method gives the part that has a role in the group, when `primary` is the primary. */
2158
- partOf(role: GroupRole, primary: string): string;
2159
- /** This method starts the client of a run, with the arguments of `client-sentinel.mjs`. */
2160
- client(args: readonly string[]): Promise<GroupClient>;
2161
- /** This method applies a network fault between a part and some of its peers, at once or at an instant of the VM. */
2162
- fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
2163
- /** This method removes a network fault, at once or at an instant of the VM. */
2164
- lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
2165
- /** This method sends a signal to the server process of a part, at once or at an instant of the VM. */
2166
- signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
2167
- /** This method starts the server of a member again, after a fin. */
2168
- restart(member: string): Promise<void>;
2169
- /** This method asks the first Sentinel for a failover of the group. */
2170
- failover(coordinated: boolean): Promise<Stamp>;
2171
- /** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
2172
- forget(): Promise<void>;
2173
- /** This method waits for the next clock line of the prober, which gives the count of lost records. */
2174
- settle(): Promise<number | null>;
2175
- manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
2176
- close(): Promise<void>;
2177
- }
2178
- /** This function gives the configuration file of a member: its port, its settings, and the primary that a replica follows. */
2179
- export declare const memberConfig: (group: Group, primary: string | null) => string;
2180
- /** This function gives the configuration file of a Sentinel: its port, the group that it monitors, and the settings of the group. */
2181
- export declare const sentinelConfig: (group: Group, primary: string) => string;
2182
- /**
2183
- * This function gives the peers that a fault on a part cuts it from, by their addresses. `all` is
2184
- * each other part and the client, `group` is the other parts, and `clients` and `to-clients` are
2185
- * the client. `one` and `one-way` are the first other member. The observer is not a peer, thus the timeline of the
2186
- * group stays whole.
2187
- */
2188
- export declare const peersOf: (parts: {
2189
- readonly members: Readonly<Record<string, RunPart>>;
2190
- readonly sentinels: Readonly<Record<string, RunPart>>;
2191
- }, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => string[];
2192
- /** This function reads the flat reply of a command line client into its fields: name, value, name, value. */
2193
- export declare const fieldsOf: (text: string) => Array<Record<string, string>>;
2194
- /** This function reads the INFO of a server into its fields. */
2195
- export declare const infoOf: (text: string) => Record<string, string>;
2196
- /**
2197
- * A view of the group is what its parts tell at one time. `healthy` tells if each Sentinel agrees
2198
- * on one primary with no flag but `master`, and knows each replica and each other Sentinel. Each
2199
- * replica must follow that primary with its link up, and the primary must have each replica online,
2200
- * with no failover in progress.
2336
+ * This function opens the pair of an environment. The table comes first and the standby next: the
2337
+ * base backup has it. A synchronous standby is named last, thus no setup step waits for it.
2201
2338
  */
2202
- interface GroupView {
2203
- readonly primary: string | null;
2204
- readonly healthy: boolean;
2205
- readonly why: string;
2206
- }
2207
- /** This function judges the views of the Sentinels and of the members: the primary that they agree on, if the group is healthy. */
2208
- export declare const viewOf: (group: Group, ips: Readonly<Record<string, string>>, sentinels: ReadonlyArray<{
2209
- readonly master: Record<string, string>;
2210
- readonly replicas: ReadonlyArray<Record<string, string>>;
2211
- }>, members: Readonly<Record<string, Record<string, string>>>) => GroupView;
2212
- /** This time is the longest that a group takes to converge before a run, or after it. */
2213
- export declare const CONVERGE_MS = 24e4;
2339
+ export declare const openStandby: (lab: Lab, cell: Cell) => Promise<Sibling>;
2214
2340
  /**
2215
- * This function opens one environment of a group cell:
2216
- * - one new network, with each member, each Sentinel, the client and the observer on it.
2217
- * - each member: the stock image, its server as the child of a shell, thus a fin can stop the
2218
- * server and the container stays up. The first member is the primary, and the others follow it.
2219
- * - each Sentinel: the stock image, its Sentinel as the child of a shell, which monitors the first member.
2220
- * - an injector sidecar for each part, in its network and process namespaces.
2221
- * - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
2222
- * - the observer of the Sentinels, in a namespace of its own.
2223
- * - the prober, which watches the namespace of the client, and of each Sentinel for a calibration.
2341
+ * This function does one run of a pair. A dry run writes and stops, with no fault: the warm-up of the
2342
+ * environment. It removes its rows, thus the numbers of the run start on an empty table.
2224
2343
  */
2225
- export declare const openGroupLab: (group: Group, options?: {
2226
- readonly watchSentinels?: boolean;
2227
- }) => Promise<GroupLab>;
2228
- /** This function gives the latest time that a group cell waits for its outcome, in ms from the fault. */
2229
- export declare const deadlineOf: (cell: Cell) => number;
2230
- /** This function gives the latest subscription of the observer to each Sentinel, in some lines of the observer. */
2231
- export declare const subscriptionsOf: (timeline: readonly SentinelEvent[]) => SentinelEvent[];
2344
+ export declare const pairOnce: (lab: Lab, standby: Sibling, cell: Cell, environment: number, index: number, dry?: boolean) => Promise<Run>;
2232
2345
  /**
2233
- * This function does one run of a group cell:
2234
- * - The group converges, and its keys go. The client connects through the Sentinels, and its
2235
- * stream of writes gets steady.
2236
- * - The fault occurs on its part, as the primary of this run makes the roles. A fault with a
2237
- * hold lifts at its instant in the VM. A stall lifts at its length after the first write into it.
2238
- * - The run waits for its outcome: the first write that a new primary accepts, or the first one
2239
- * after the lift on the same primary. Then it continues for a moment.
2240
- * - Each fault goes, the client stops, and the group converges again. The keys that it then holds
2241
- * tell which writes it kept.
2346
+ * This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
2347
+ * package that a build installs, thus its sha256 pins the packages that the image holds. The
2348
+ * versions of the packages that each manifest names directly are the part that a person reads.
2242
2349
  */
2243
- export declare const groupOnce: (lab: GroupLab, cell: Cell, environment: number, index: number) => Promise<Run>;
2350
+ /** A context file is a file of a build context: its path in the context, and its content. */
2351
+ interface ContextFile {
2352
+ readonly at: string;
2353
+ readonly content: Buffer | string;
2354
+ }
2244
2355
  /**
2245
- * This module is the lab of a replica set: a replicated group with no external authority, whose
2246
- * members elect their own primary. It opens one environment for a replica set cell, for the runs
2247
- * of the cell. Each member is a container from the stock image of the set, in its own network
2248
- * namespace. An injector sidecar shares its network and process namespaces.
2249
- *
2250
- * The client of each run is the MongoDB driver, which finds the primary with its own monitors. The
2251
- * timeline comes from the log of each member and from the lines of the client. The prober watches
2252
- * the namespace of the client.
2356
+ * These are the names of the lockfiles that the harness records. A `go.mod` is the lockfile of a Go
2357
+ * module, because its `require` lines give exact versions. For them, Go selects the same packages
2358
+ * each time, and its checksum database examines each package.
2253
2359
  */
2360
+ export declare const LOCK_NAMES: ReadonlySet<string>;
2361
+ /** This function gives each lockfile of a context by its path, with the sha256 of its content in hex. */
2362
+ export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
2363
+ /** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
2364
+ export declare const npmVersions: (lock: string) => Record<string, string>;
2254
2365
  /**
2255
- * A member line is one log line of a member, as mongod writes it in JSON. `real` is its time on
2256
- * the wall clock in ms, and `t` is its time on the monotonic clock. The run gives `t` from the
2257
- * clock lines of its client.
2366
+ * This function gives the version of each direct dependency of the root package of a Cargo.lock: the
2367
+ * package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
2368
+ * and a version when the lock holds two versions of that name.
2258
2369
  */
2259
- interface MemberLine extends SentinelEvent {
2260
- readonly ev: "mongod";
2261
- readonly member: string;
2262
- readonly real: number;
2263
- readonly id: number;
2264
- readonly c: string;
2265
- readonly msg: string;
2266
- readonly attr: Readonly<Record<string, unknown>>;
2267
- }
2268
- /** These are the components of the log of mongod that a run keeps: replication, its heartbeats, the elections, the rollbacks and the commands. */
2269
- export declare const KEPT: ReadonlySet<string>;
2270
- /** This function reads one log line of a member, or gives null for a line of another component or a line that is not JSON. */
2271
- export declare const memberLineOf: (member: string, text: string) => MemberLine | null;
2370
+ export declare const cargoVersions: (lock: string, manifest: string) => Record<string, string>;
2371
+ /** This function gives the version of each direct requirement of a go.mod. A requirement that is `// indirect` is not direct. */
2372
+ export declare const goVersions: (mod: string) => Record<string, string>;
2373
+ /** This function gives the version of each jar of a list of jars by their SHA-256: `<hex> HikariCP-7.1.0.jar` gives HikariCP 7.1.0. */
2374
+ export declare const jarVersions: (list: string) => Record<string, string>;
2272
2375
  /**
2273
- * This function gives the offset of the wall clock from the monotonic clock, in ns, from the clock
2274
- * lines of a client. Each line pairs its stamp with the wall clock in whole ms, which truncates.
2275
- * Thus each pair is the offset or less, and the largest pair is the nearest. It is null without a clock line.
2376
+ * This function gives the version of each package that the manifests of a context name directly,
2377
+ * by its name. It reads each npm lockfile, Cargo.lock, go.mod and list of jars. A package of a
2378
+ * workspace in the context is a package of the image too, with the version of its package.json.
2379
+ * Such a package has a name and a version, and it is not private. The record has the sha256 of
2380
+ * the lockfile of a pnpm, yarn or bun workspace (`locksOf`). This function does not read versions
2381
+ * from such a lockfile.
2276
2382
  */
2277
- export declare const clockOffsetOf: (events: readonly ProbeEvent[]) => number | null;
2278
- /** This function puts the log lines of the members on the monotonic clock, with the offset of a client. */
2279
- export declare const onMonotonic: (log: readonly MemberLine[], offset: number | null) => MemberLine[];
2280
- /** A cut is the peers that a network fault on a part cuts it from, by their addresses, and the direction of the rules. */
2281
- interface Cut {
2282
- readonly peers: readonly string[];
2283
- readonly direction?: "out";
2284
- }
2383
+ export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
2285
2384
  /**
2286
- * This function gives the peers that a fault on a member of a replica set cuts it from. `all` is
2287
- * each other member and the client, `group` is the other members, and `clients` is the client.
2288
- * `one` is the first other member in the sequence of the set, and `one-way` is the same member for
2289
- * the segments from the part only.
2385
+ * This function gives each problem of one image of a run outside a manifest of the harness, as the
2386
+ * kind lab records its images. A pulled image needs its digest. An image that a build makes needs
2387
+ * its build record, with each base by digest. The build record must have the tag of the image.
2290
2388
  */
2291
- export declare const cutOf: (set: ReplicaSet, members: Readonly<Record<string, RunPart>>, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => Cut;
2292
- /** This function gives the command of the server of each member. The server is the child of a shell, thus a fin can stop it and the container stays up. */
2293
- export declare const memberCommand: (set: ReplicaSet) => string;
2294
- /** This function gives the script of the shell that starts the set: each member by its address, and the settings of the set. */
2295
- export declare const initiateScript: (set: ReplicaSet, ips: Readonly<Record<string, string>>) => string;
2296
- /** This script prints the view of a member: itself, if it accepts writes, and the state of each member as it sees them. */
2297
- export declare const STATUS_SCRIPT: string;
2298
- /** A status is the view of one member, as `STATUS_SCRIPT` prints it. */
2299
- interface Status {
2300
- readonly me: string;
2301
- readonly writable: boolean;
2302
- readonly members: ReadonlyArray<{
2303
- readonly name: string;
2304
- readonly state: string;
2305
- readonly health: number;
2306
- readonly optime: number | null;
2307
- }>;
2308
- }
2389
+ export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
2309
2390
  /**
2310
- * This function judges the view of a member: the primary of the set, and if the set is healthy.
2311
- * The set is healthy when the member is the one primary and accepts writes. Each other member must
2312
- * be a healthy secondary at the optime of the primary.
2391
+ * This function gives each problem of a manifest that stops it from pinning the programs of its
2392
+ * run. An empty list means that the manifest pins each program.
2393
+ * - the target: an image by its digest, or the build of a subject with its build record and its base
2394
+ * by digest.
2395
+ * - the harness: the version of its package, and the build record of its image.
2396
+ * - the client: an image by its digest, or a build with its build record.
2397
+ * - each hop: an image by its digest, or the tag of a build and the id of its image.
2313
2398
  */
2314
- export declare const statusViewOf: (set: ReplicaSet, ips: Readonly<Record<string, string>>, status: Status) => GroupView;
2315
- /** A replica set lab is one environment of a replica set cell. */
2316
- interface ReplicaSetLab {
2317
- readonly set: ReplicaSet;
2318
- readonly clientIp: string;
2319
- readonly members: Readonly<Record<string, RunPart>>;
2320
- readonly netns: {
2321
- readonly client: number;
2322
- };
2323
- /** These are all the records that the prober wrote, in sequence. */
2324
- readonly kernel: readonly KernelRecord[];
2325
- /** These are the log lines of the members that a run keeps, in the sequence of their arrival, with `t` at 0. */
2326
- readonly log: readonly MemberLine[];
2327
- /** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
2328
- sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
2329
- /** This method waits until the set is whole and calm, and gives the name of its primary. */
2330
- converge(within?: number): Promise<string>;
2331
- /** This method removes each write from the set, and waits until each member has the removal. */
2332
- flush(primary: string): Promise<void>;
2333
- /**
2334
- * This method lets each secondary stand for election again (`rs.freeze(0)`). A step-down holds its
2335
- * old primary out of the elections for `STEP_DOWN.seconds`. Without it, a run inherits that hold.
2336
- */
2337
- unfreeze(primary: string): Promise<void>;
2338
- /** This method gives the sequence numbers that the set holds, from its primary. */
2339
- holds(primary: string): Promise<number[]>;
2340
- /** This method gives the member that has a role in the set, when `primary` is the primary. */
2341
- partOf(role: GroupRole, primary: string): string;
2342
- /** This method starts the client of a run, with the arguments of `client-mongo.mjs`. */
2343
- client(args: readonly string[]): Promise<GroupClient>;
2344
- /** This method applies a network fault between a member and some of its peers, at once or at an instant of the VM. */
2345
- fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
2346
- /** This method removes a network fault, at once or at an instant of the VM. */
2347
- lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
2348
- /** This method sends a signal to the server process of a member, at once or at an instant of the VM. */
2349
- signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
2350
- /** This method starts the server of a member again, after a fin. */
2351
- restart(member: string): Promise<void>;
2352
- /** This method runs a command in the box of a member, and gives its output. */
2353
- exec(member: string, argv: string[]): Promise<string>;
2354
- /** This method runs a script of the shell on a member, against its own server only, and gives its output. Another port reads a server with no set. */
2355
- script(member: string, script: string, port?: number): Promise<string>;
2356
- /** This method runs a command on the backup host of a drill, and gives its output. A lab without that host refuses it. */
2357
- vault(argv: string[]): Promise<string>;
2358
- /** This method sends replSetStepDown to the primary. */
2359
- stepDown(primary: string): Promise<Stamp>;
2360
- /** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
2361
- forget(): Promise<void>;
2362
- /** This method waits for the next clock line of the prober, which gives the count of lost records. */
2363
- settle(): Promise<number | null>;
2364
- manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
2365
- close(): Promise<void>;
2399
+ export declare const manifestProblems: (manifest: Manifest) => string[];
2400
+ /** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
2401
+ export declare const commitProblems: (commit: string | undefined) => string[];
2402
+ /** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
2403
+ interface RecordCode {
2404
+ readonly commit: string;
2405
+ readonly dirty: boolean;
2366
2406
  }
2367
- /** This function waits for a time, in ms. */
2368
- /** These are the arguments of replSetStepDown: the time that the old primary cannot stand again, and the wait for a secondary to catch up. */
2369
- export declare const STEP_DOWN: {
2370
- readonly seconds: 60;
2371
- readonly catchUp: 10;
2372
- };
2373
- /**
2374
- * This function opens one environment of a replica set cell:
2375
- * - one new network, with each member, the client and the sender of a step-down on it.
2376
- * - each member: the stock image, its server as the child of a shell. A log consumer reads its
2377
- * JSON log. The first member starts the set with the address of each member, and the lab
2378
- * waits for a primary.
2379
- * - an injector sidecar for each member, in its network and process namespaces.
2380
- * - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
2381
- * - the prober, which watches the namespace of the client.
2382
- * - a backup host for a recovery drill: the stock image, for its tools, with no server.
2383
- */
2384
- export declare const openReplicaSetLab: (set: ReplicaSet, backups?: boolean) => Promise<ReplicaSetLab>;
2385
- /** This function gives the arguments of the client of a replica set cell: each member, and the stream of writes. */
2386
- export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<string, RunPart>>) => string[];
2407
+ /** These are the parts of a record that tell if it pins the programs of its runs. */
2408
+ interface Pinnable {
2409
+ readonly code?: RecordCode | undefined;
2410
+ readonly manifests: readonly Manifest[];
2411
+ /** A local debug run marks its record so. No page reads such a record. */
2412
+ readonly debug?: boolean | undefined;
2413
+ }
2414
+ /** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
2415
+ export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
2416
+ /** This problem is the problem of a record of a local debug run. */
2417
+ export declare const DEBUG = "the record is of a local debug run, and no page reads it";
2387
2418
  /**
2388
- * This function does one run of a replica set cell:
2389
- * - The set converges, and its writes go. The client finds the primary with its monitors, and its
2390
- * stream of writes gets steady.
2391
- * - The fault occurs on its member, as the primary of this run makes the roles. A fault with a
2392
- * hold lifts at its instant in the VM. A stall lifts at its length after the first write into
2393
- * it. A step-down is replSetStepDown to the primary.
2394
- * - The run waits for its outcome: the first accepted write of a write sent after the commit of
2395
- * the fault. It is on a new primary, or on any primary. Then the run waits for the end of the
2396
- * hold, thus the record shows what the set did in the whole hold.
2397
- * - Each fault goes, the client stops, and the set converges again. The writes that it then holds
2398
- * tell which writes it kept. The log lines of the members go onto the monotonic clock.
2419
+ * This function gives each problem that stops a record from pinning the programs of its runs. A
2420
+ * record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
2421
+ * of a schedule refuses it. A commit with changes to tracked files is not a pin.
2399
2422
  */
2400
- export declare const replicaSetOnce: (lab: ReplicaSetLab, cell: Cell, environment: number, index: number) => Promise<Run>;
2423
+ export declare const recordProblems: (record: Pinnable) => string[];
2401
2424
  /**
2402
2425
  * This function does one run of a recovery drill:
2403
2426
  * - The set converges, and it loses its writes. The tenants get their data, and a hash reads it.
@@ -2750,4 +2773,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
2750
2773
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
2751
2774
  */
2752
2775
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
2753
- 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 ContextFile, type CountBand, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, 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 HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, type Lab, type Layer, type LeafViews, type LineCount, type LineMatch, type LoadBand, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, 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, 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 RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, environmentProblems, isHopPlace, latestEndOf };
2776
+ 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 ContextFile, type CountBand, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, 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 HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, type Lab, type Layer, type LeafViews, type LineCount, type LineMatch, type LoadBand, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, 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, 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 RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, environmentProblems, isHopPlace, latestEndOf };