@mark1russell7/harness 0.16.29 → 0.16.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,7 +33,7 @@ A **cell** (`cell.ts`) is all that one measurement needs, as data:
33
33
  - An injector sidecar in the namespace of the target, with NET_ADMIN. Thus the image of the target stays stock.
34
34
  - The manifest of each environment gives the HZ of its kernel, from /proc/config.gz. A host without that file (a hosted runner) gets HZ from two readings of /proc/timer_list, one second apart: its jiffies against the time of the kernel (`hzOf`). `hzFrom` tells which.
35
35
  - The manifest of each environment holds a `substrate` block (`substrate.ts`). It gives the layer, the cloud, the vendor, the kernel, HZ, KVM and the image of the runner. GitHub can schedule one image on Azure or on AWS. Thus the cloud comes from the DMI vendor, not from the name of the kernel. No statistic pools two substrates (`comparable`). A record from before the block reads through `substrateOf`, and nothing rewrites it.
36
- - The layers ([`docs/S7.md`](../../docs/S7.md)) are data in the entry `@mark1russell7/harness/layers`, which imports no `node:` module. `LAYER_FACTS` gives each layer its texts from the table of S7, the faults that its cells inject and the limits that their load fills. The faults of E2 are the triggers of `@mark1russell7/kind`. `layerOf` gives the layer of a lab from its topology.
36
+ - The layers ([`docs/S7.md`](../../docs/S7.md)) are data in the entry `@mark1russell7/harness/layers`, which imports no `node:` module. `LAYER_FACTS` gives each layer its texts from the table of S7, the faults that its cells inject and the limits that their load fills. The faults of E2 are the triggers of `@mark1russell7/kind`. `layerOf` gives the layer of a lab from its topology. `rigTermsOf` gives the pairs of the rig map of rigor that a cell applies (`RIG_TERMS`). A test holds `docs/rigs.json` equal to them.
37
37
  - The prober ([`@mark1russell7/prober`](https://www.npmjs.com/package/@mark1russell7/prober)): a privileged container that loads the kernel program. It watches the namespace of the client, of the target and of each hop. Each run keeps its records from its start to its end. A run whose records the prober lost is void.
38
38
 
39
39
  Each command is an argv array.
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as MemoryStep, $t as latestEndOf, A as Hop, At as RunCpus, B as KafkaPause, Bt as SentinelEvent, C as FabricManifest, Cn as resourceArgs, Ct as ReplicaSetStage, D as GroupPlace, Dt as RttRange, E as Group, En as resourceReadingOf, Et as RouterHop, F as HostSysctl, Ft as RunPause, G as LoadConnections, Gt as StageBand, H as LineCount, Ht as Shipped, I as HttpProbe, It as RunResources, J as LoadStream, Jt as Topology, K as LoadPlan, Kt as Subject, L as ImageSource, Lt as RunRoute, M as HopPlace, Mt as RunFabric, N as HopSignal, Nt as RunGroup, O as GroupPrediction, Ot as Run, P as HopWrite, Pt as RunPart, Q as MemoryPrediction, Qt as isHopPlace, R as Jitter, Rt as RunStream, S as Fabric, Sn as networkOf, St as ReplicaSet, T as FaultPlace, Tn as resourceReadingIn, Tt as RequestPrediction, U as LineMatch, Ut as ShippedImage, V as KernelRecord, Vt as SentinelStage, W as LoadBand, Wt as Stage, X as MemoryOomPrediction, Xt as WsProbe, Y as MemoryLimits, Yt as Toxic, Z as MemoryOomTask, Zt as environmentProblems, _ as DriverBand, _n as cpuStatOf, _t as QueueEnd, a as ClientCapability, an as ResourceDevice, at as Outcomes, b as EgressPacketLaw, bn as limitsProblems, bt as Recovers, c as ClusterClientAt, cn as ResourceNetwork, ct as PausePrediction, d as ContainerLimits, dn as ResourceReading, dt as Prediction, en as HostLimits, et as MemoryThrottlePrediction, f as CountBand, fn as ResourceTraffic, ft as ProbeEvent, g as DrillRoom, gn as cpuMaxOf, gt as QueueConnection, h as Drill, hn as cgroupNumber, ht as QueueBand, i as Client, in as ResourceCpu, it as Observer, j as HopEvent, jt as RunDrill, k as GroupRole, kt as RunBackup, l as ClusterStage, ln as ResourceOptions, lt as PinnedImage, m as DeliveryPrediction, mn as cgroupLimit, mt as ProxyTime, n as CLIENT_CAPABILITIES, nn as RESOURCES_PROGRAM, nt as MiddleboxExpectation, o as ClientImage, on as ResourceLimits, ot as Pair, p as CpuShares, pn as cgroupKeyed, pt as ProxyHop, q as LoadPrediction, qt as Target, r as Cell, rn as ResourceChange, rt as MiddleboxForm, s as Cluster, sn as ResourceMemory, st as PauseBand, t as BuildImage, tn as RESOURCES_EVENT, tt as MiddleboxEvent, u as ConntrackPrediction, un as ResourceReader, ut as PortsPrediction, v as DriverStep, vn as cpusOfList, vt as QueuePrediction, w as Fault, wn as resourceChange, wt as Replies, x as EgressPrediction, xn as memoryStatOf, xt as Reference, y as EgressBurst, yn as hostLimitsOf, yt as Reconnects, z as Kafka, zt as RunTopology } from "./cell-DjDNdbuB.js";
2
- import { LAYERS, LAYER_FACTS, LIMITS, Layer, LayerFacts, LayerState, Limit, layerOf, limitsOf } from "./layers.js";
2
+ import { LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, Layer, LayerFacts, LayerState, Limit, RIG_TERMS, RigTerm, RigTermCell, TOXIC_RIG_TERMS, layerOf, limitsOf, rigTermsOf } from "./layers.js";
3
3
  import { Quantity } from "@mark1russell7/quantity";
4
4
  import { DiskFault, DiskFaultKind, LoadMeasure, Schedule } from "@mark1russell7/rigor-chaos";
5
5
  import { StartedTestContainer } from "testcontainers";
@@ -3122,4 +3122,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
3122
3122
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
3123
3123
  */
3124
3124
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
3125
- export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf };
3125
+ export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, RIG_TERMS, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RigTerm, type RigTermCell, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, TOXIC_RIG_TERMS, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf, rigTermsOf };
package/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as cpusOfList, A as targetSourceOf, B as versionsOf, C as programOf, D as subjectClient, E as sources, F as goVersions, G as requestFirst, H as environmentProblems, I as jarVersions, J as cgroupKeyed, K as RESOURCES_EVENT, L as locksOf, M as unpinnedBases, N as LOCK_NAMES, O as subjectProblems, P as cargoVersions, Q as cpuStatOf, R as npmDrift, S as planOf, T as shippedSource, U as isHopPlace, V as CLIENT_CAPABILITIES, W as latestEndOf, X as cgroupNumber, Y as cgroupLimit, Z as cpuMaxOf, _ as kafkaClientImage, _t as loadOf, a as SHIPPED_NAMES, at as resourceChange, b as nodeHttpImage, bt as poolOf, c as buildRecordOf, ct as CLOSED_TOLERANCE, d as harnessImage, dt as LOAD_POOL_LIMIT, et as hostLimitsOf, f as harnessVersion, ft as SCHEDULE_PATH, g as inContext, gt as loadEnds, h as imageProblems, ht as estimateVerdict, i as SHIPPED_CLIENTS, it as resourceArgs, j as unlockedManifests, k as targetImageOf, l as goHttpImage, lt as LOAD_FORMAT, m as imageOf, mt as estimateOf, n as PINNED, nt as memoryStatOf, o as amqpClientImage, ot as resourceReadingIn, p as hikariClientImage, pt as connectionsProblems, q as RESOURCES_PROGRAM, r as REPOSITORY, rt as networkOf, s as basesOf, st as resourceReadingOf, t as CLIENT_NAMES, tt as limitsProblems, u as grpcClientImage, ut as LOAD_PATH, v as mongoClientImage, vt as loadPlanOf, w as routerImage, x as pgClientImage, xt as streamsLoadOf, y as nodeClientImage, yt as loadVerdict, z as npmVersions } from "./image-B1jai9Lq.js";
2
- import { LAYERS, LAYER_FACTS, LIMITS, layerOf, limitsOf } from "./layers.js";
2
+ import { LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, RIG_TERMS, TOXIC_RIG_TERMS, layerOf, limitsOf, rigTermsOf } from "./layers.js";
3
3
  import { quantity, valueIn } from "@mark1russell7/quantity";
4
4
  import { checkDiskFault, schedule, stopTriggerOf } from "@mark1russell7/rigor-chaos";
5
5
  import { median, medianInterval as medianInterval$1, quantileSorted } from "@mark1russell7/rigor-statistics";
@@ -9887,6 +9887,6 @@ const runCell = async (cell, say = () => {}) => {
9887
9887
  target = larger;
9888
9888
  }
9889
9889
  };
9890
- export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, CPU_STATES, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DISK_TIER_KINDS, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOAD_POOL_LIMIT, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, connectionsProblems, controllerEnv, cpuMaxOf, cpuShares, cpuStatOf, cpusOfList, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, diskTornCommand, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readCpus, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runCpusOf, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9890
+ export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, CPU_STATES, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DISK_TIER_KINDS, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOAD_POOL_LIMIT, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, RIG_TERMS, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, TOXIC_RIG_TERMS, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, connectionsProblems, controllerEnv, cpuMaxOf, cpuShares, cpuStatOf, cpusOfList, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, diskTornCommand, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readCpus, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, rigTermsOf, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runCpusOf, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9891
9891
 
9892
9892
  //# sourceMappingURL=index.js.map
package/build/layers.d.ts CHANGED
@@ -51,4 +51,37 @@ export declare const layerOf: (topology: Topology | undefined) => Layer;
51
51
  */
52
52
  export declare const limitsOf: (cell: {
53
53
  readonly prediction: object;
54
- }) => readonly Limit[];
54
+ }) => readonly Limit[];
55
+ /**
56
+ * A rig term is one pair of the space of the rig map of rigor: a fault and the layer that the fault acts on. It uses
57
+ * the words of that map. The rig records of this repository (`docs/rigs.json`) name these pairs.
58
+ */
59
+ export interface RigTerm {
60
+ readonly fault: string;
61
+ readonly layer: string;
62
+ }
63
+ /** These are the environments of the rig map for the layers. E0 has no environment: it runs no lab. */
64
+ export declare const LAYER_RIG_ENV: Readonly<Record<Layer, string | undefined>>;
65
+ /**
66
+ * These are the rig terms of each fault name of the labs: the faults of the harness and the kinds of the triggers of
67
+ * `@mark1russell7/kind`. The two vocabularies share the names that they share. An empty list is a fault that the rig
68
+ * map has no word for at this time. Examples are a stop with its grace, a planned failover, a drain and an ICMP
69
+ * unreachable. The terms of `netem` and `toxic` come from the settings of the cell (`rigTermsOf`).
70
+ */
71
+ export declare const RIG_TERMS: Readonly<Record<string, readonly RigTerm[]>>;
72
+ /** These are the rig terms of each type of a toxic of Toxiproxy. A slow close and a limit of bandwidth have no word in the rig map. */
73
+ export declare const TOXIC_RIG_TERMS: Readonly<Record<string, readonly RigTerm[]>>;
74
+ /** These parts of a cell tell its rig terms. A cell of kind gives the kind of its trigger as `fault`. */
75
+ export interface RigTermCell {
76
+ readonly fault: string;
77
+ readonly toxic?: {
78
+ readonly type: string;
79
+ } | undefined;
80
+ readonly netem?: string | undefined;
81
+ }
82
+ /**
83
+ * This function gives the rig terms of a cell. The terms of `netem` come from the words of its setting, and the terms
84
+ * of `toxic` from the type of its toxic. This function throws a `RangeError` for a fault name that `RIG_TERMS` does
85
+ * not have, thus a new fault gets its terms in the same change.
86
+ */
87
+ export declare function rigTermsOf(cell: RigTermCell): readonly RigTerm[];
package/build/layers.js CHANGED
@@ -154,6 +154,105 @@ const limitsOf = (cell) => {
154
154
  const laws = new Map(Object.entries(cell.prediction));
155
155
  return LIMITS.filter((limit) => laws.get(limit) !== void 0);
156
156
  };
157
- export { LAYERS, LAYER_FACTS, LIMITS, layerOf, limitsOf };
157
+ /** These are the environments of the rig map for the layers. E0 has no environment: it runs no lab. */
158
+ const LAYER_RIG_ENV = {
159
+ E0: void 0,
160
+ E1: "container",
161
+ E2: "kind",
162
+ E3: "fabric",
163
+ E4: "vm",
164
+ E5: "vendor",
165
+ E6: "hardware"
166
+ };
167
+ const term = (fault, layer) => ({
168
+ fault,
169
+ layer
170
+ });
171
+ /**
172
+ * These are the rig terms of each fault name of the labs: the faults of the harness and the kinds of the triggers of
173
+ * `@mark1russell7/kind`. The two vocabularies share the names that they share. An empty list is a fault that the rig
174
+ * map has no word for at this time. Examples are a stop with its grace, a planned failover, a drain and an ICMP
175
+ * unreachable. The terms of `netem` and `toxic` come from the settings of the cell (`rigTermsOf`).
176
+ */
177
+ const RIG_TERMS = {
178
+ blackhole: [term("blackhole", "L3")],
179
+ "freeze-process": [term("freeze", "process")],
180
+ rst: [term("reset", "L4")],
181
+ stall: [term("stall", "L3")],
182
+ fin: [term("kill", "process")],
183
+ unreachable: [],
184
+ simplex: [term("blackhole", "L3")],
185
+ "mtu-blackhole": [term("mtu", "L3")],
186
+ netem: [],
187
+ "fin-ack": [term("loss", "L4")],
188
+ "middlebox-forget": [term("cut", "L4")],
189
+ "proxy-idle": [term("cut", "L7")],
190
+ toxic: [],
191
+ "server-close": [term("cut", "L7")],
192
+ partition: [term("partition", "L3")],
193
+ "planned-failover": [],
194
+ "app-stall": [term("stall", "L7")],
195
+ "step-down": [],
196
+ drain: [],
197
+ "hop-event": [],
198
+ silence: [term("blackhole", "L3")],
199
+ none: [],
200
+ "pod-deletion": [],
201
+ "rolling-update": [],
202
+ "node-drain": [],
203
+ "scale-in": [],
204
+ crash: [term("kill", "process")],
205
+ "liveness-restart": [term("kill", "process")],
206
+ "peer-gone-without-close": [term("blackhole", "L3")],
207
+ rollout: [],
208
+ "cpu-throttle": [term("cpu", "process")],
209
+ "authorization-policy": [],
210
+ idle: [],
211
+ "ztunnel-restart": [],
212
+ "certificate-expiry": [term("cert-bad", "TLS")],
213
+ "cannot-serve": [],
214
+ "zone-loss": [term("node-loss", "process")],
215
+ latency: [term("delay", "L3")],
216
+ "dns-blackhole": [term("dns", "L7")]
217
+ };
218
+ /** These are the rig terms of each type of a toxic of Toxiproxy. A slow close and a limit of bandwidth have no word in the rig map. */
219
+ const TOXIC_RIG_TERMS = {
220
+ latency: [term("delay", "L4")],
221
+ timeout: [term("stall", "L4")],
222
+ reset_peer: [term("reset", "L4")],
223
+ slow_close: [],
224
+ bandwidth: [],
225
+ limit_data: [term("cut", "L4")],
226
+ slicer: [term("split-frame", "L7")]
227
+ };
228
+ /** These are the words of tc netem that the rig map names, each with its fault of the map. */
229
+ const NETEM_TERMS = [
230
+ ["delay", "delay"],
231
+ ["loss", "loss"],
232
+ ["duplicate", "duplicate"],
233
+ ["reorder", "reorder"],
234
+ ["corrupt", "corrupt"]
235
+ ];
236
+ /**
237
+ * This function gives the rig terms of a cell. The terms of `netem` come from the words of its setting, and the terms
238
+ * of `toxic` from the type of its toxic. This function throws a `RangeError` for a fault name that `RIG_TERMS` does
239
+ * not have, thus a new fault gets its terms in the same change.
240
+ */
241
+ function rigTermsOf(cell) {
242
+ const own = RIG_TERMS[cell.fault];
243
+ if (own === void 0) throw new RangeError(`rigTermsOf: the fault ${cell.fault} has no entry in RIG_TERMS.`);
244
+ if (cell.fault === "netem") {
245
+ const words = (cell.netem ?? "").split(/\s+/);
246
+ return NETEM_TERMS.filter(([word]) => words.includes(word)).map(([, fault]) => term(fault, "L3"));
247
+ }
248
+ if (cell.fault === "toxic") {
249
+ if (cell.toxic === void 0) return [];
250
+ const terms = TOXIC_RIG_TERMS[cell.toxic.type];
251
+ if (terms === void 0) throw new RangeError(`rigTermsOf: the toxic ${cell.toxic.type} has no entry in TOXIC_RIG_TERMS.`);
252
+ return terms;
253
+ }
254
+ return own;
255
+ }
256
+ export { LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, RIG_TERMS, TOXIC_RIG_TERMS, layerOf, limitsOf, rigTermsOf };
158
257
 
159
258
  //# sourceMappingURL=layers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layers.js","names":[],"sources":["../src/layers.ts"],"sourcesContent":["import type { Fault, Topology } from \"./cell.ts\";\n\n// This module imports no `node:` module, thus a page in a browser can read the layers (`@mark1russell7/harness/layers`).\n\n/**\n * A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a\n * cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.\n * A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this\n * time.\n */\nexport const LAYERS = [\"E0\", \"E1\", \"E2\", \"E3\", \"E4\", \"E5\", \"E6\"] as const;\nexport type Layer = (typeof LAYERS)[number];\n\n/** A layer state is the column \"State\" of the table of the layers in `docs/S7.md`, by its first word. */\nexport type LayerState = \"today\" | \"new\" | \"later\" | \"waiting\";\n\n/**\n * A limit is a resource that the load of a cell fills, with no fault. The five limits are the accept\n * queue, the port range, the conntrack table, the memory of a cgroup and the egress queue of an\n * interface. The name of a limit is the key of its law in `Prediction`.\n */\nexport const LIMITS = [\"queue\", \"ports\", \"conntrack\", \"memory\", \"egress\"] as const;\nexport type Limit = (typeof LIMITS)[number];\n\n/**\n * The layer facts are one row of the table of the layers in `docs/S7.md`, and what the cells of the\n * harness apply on the layer. A test holds each text equal to the table. A test of the cells holds\n * `faults` and `limits` equal to the cells of each layer.\n */\nexport interface LayerFacts {\n /** This text is the column \"What it is\". */\n readonly name: string;\n /** This text is the column \"What it proves\". */\n readonly proves: string;\n /** These texts are the column \"What it cannot prove\", one for each thing. The list is empty for \"Nothing that this plan covers\". */\n readonly cannot: readonly string[];\n /** These names are the column \"Tools\". */\n readonly tools: readonly string[];\n readonly state: LayerState;\n /**\n * These names are the faults that the cells of the layer inject, each one time. A name is in the\n * vocabulary of the lab of the layer. The cells of E1 and E3 name a `Fault` of the harness. The cells of\n * E2 are in `@mark1russell7/kind`, and they name the kind of their trigger (`TriggerKind`). The two\n * vocabularies share the names of the faults that they share, for example `blackhole` and `rst`.\n */\n readonly faults: readonly string[];\n /** These limits are the resources that the load of the cells of the layer fills, in the order of `LIMITS`. */\n readonly limits: readonly Limit[];\n}\n\n/** These are the faults of a cell of one kernel: each fault of the harness except the silence of a fabric. */\nconst ONE_KERNEL: readonly Fault[] = [\n \"blackhole\",\n \"freeze-process\",\n \"rst\",\n \"stall\",\n \"fin\",\n \"unreachable\",\n \"simplex\",\n \"mtu-blackhole\",\n \"netem\",\n \"fin-ack\",\n \"middlebox-forget\",\n \"proxy-idle\",\n \"toxic\",\n \"server-close\",\n \"partition\",\n \"planned-failover\",\n \"app-stall\",\n \"step-down\",\n \"drain\",\n \"hop-event\",\n];\n\n/** These are the faults of a cell of kind: each kind of a trigger of `@mark1russell7/kind`, in the order of `TriggerKind`. */\nconst ON_KIND: readonly string[] = [\n \"pod-deletion\",\n \"rolling-update\",\n \"node-drain\",\n \"scale-in\",\n \"crash\",\n \"liveness-restart\",\n \"freeze-process\",\n \"rst\",\n \"blackhole\",\n \"peer-gone-without-close\",\n \"app-stall\",\n \"rollout\",\n \"cpu-throttle\",\n \"authorization-policy\",\n \"idle\",\n \"ztunnel-restart\",\n \"certificate-expiry\",\n \"cannot-serve\",\n \"zone-loss\",\n \"latency\",\n \"dns-blackhole\",\n];\n\n/** These are the facts of each layer. The texts come from the table of the layers in `docs/S7.md`. */\nexport const LAYER_FACTS: Readonly<Record<Layer, LayerFacts>> = {\n E0: {\n name: \"Code on a false clock\",\n proves: \"The logic of a state machine and each order of its events\",\n cannot: [\"Any real time\"],\n tools: [\"algebra\", \"the service conformance kit\"],\n state: \"today\",\n faults: [],\n limits: [],\n },\n E1: {\n name: \"Processes and containers on one kernel\",\n proves: \"Linux TCP timers, stock servers and their clients, proxies, conntrack\",\n cannot: [\"A second kernel\", \"A separate clock\", \"A reboot\", \"A loss of power\"],\n tools: [\"The harness\"],\n state: \"today\",\n faults: ONE_KERNEL,\n limits: LIMITS,\n },\n E2: {\n name: \"A cluster of containers on one kernel\",\n proves: \"The control plane, Service rules, CNI and the lifecycle of a pod\",\n cannot: [\"A kernel for each node\", \"A loss of a node with no signal\"],\n tools: [\"kind\", \"k3d\"],\n state: \"today\",\n faults: ON_KIND,\n limits: [],\n },\n E3: {\n name: \"A routed fabric of containers on one kernel\",\n proves: \"Routing protocol timers, equal-cost paths, a change of route, sites with real delay\",\n cannot: [\"The kernel or the forwarding hardware of a router\"],\n tools: [\"containerlab with FRR\"],\n state: \"new\",\n faults: [\"blackhole\", \"stall\", \"silence\"] satisfies readonly Fault[],\n limits: [],\n },\n E4: {\n name: \"Virtual machines, each with its own kernel\",\n proves: \"A chosen kernel and HZ, a clock for each node, a loss of power, a disk, a reboot\",\n cannot: [\"A physical NIC\", \"Real zones\"],\n tools: [\"QEMU\", \"k3s in a VM\"],\n state: \"new\",\n faults: [],\n limits: [],\n },\n E5: {\n name: \"Images of vendor routers in virtual machines\",\n proves: \"The defaults and the state machines of a vendor's control plane\",\n cannot: [\"The forwarding chip of the router\"],\n tools: [\"vrnetlab\"],\n state: \"later\",\n faults: [],\n limits: [],\n },\n E6: {\n name: \"Real hardware and clouds\",\n proves: \"A physical NIC, firmware, managed load balancers, real zones\",\n cannot: [],\n tools: [\"HW-1\"],\n state: \"waiting\",\n faults: [],\n limits: [],\n },\n};\n\n/** This function gives the layer of a lab of the harness from its topology: E3 with a fabric, E1 without one. */\nexport const layerOf = (topology: Topology | undefined): Layer => (topology?.fabric === undefined ? \"E1\" : \"E3\");\n\n/**\n * This function gives the limits that the prediction of a cell names, in the order of `LIMITS`. It reads\n * a cell of the harness or of `@mark1russell7/kind`.\n */\nexport const limitsOf = (cell: { readonly prediction: object }): readonly Limit[] => {\n const laws = new Map(Object.entries(cell.prediction));\n return LIMITS.filter((limit) => laws.get(limit) !== undefined);\n};\n"],"mappings":";;;;;;;AAUA,MAAa,SAAS;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;AAAI;;;;;;AAW/D,MAAa,SAAS;CAAC;CAAS;CAAS;CAAa;CAAU;AAAQ;;AA+ExE,MAAa,cAAmD;CAC9D,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC,eAAe;EACxB,OAAO,CAAC,WAAW,6BAA6B;EAChD,OAAO;EACP,QAAQ,CAAC;EACT,QAAQ,CAAC;CACX;CACA,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ;GAAC;GAAmB;GAAoB;GAAY;EAAiB;EAC7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
1
+ {"version":3,"file":"layers.js","names":[],"sources":["../src/layers.ts"],"sourcesContent":["import type { Fault, Topology } from \"./cell.ts\";\n\n// This module imports no `node:` module, thus a page in a browser can read the layers (`@mark1russell7/harness/layers`).\n\n/**\n * A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a\n * cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.\n * A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this\n * time.\n */\nexport const LAYERS = [\"E0\", \"E1\", \"E2\", \"E3\", \"E4\", \"E5\", \"E6\"] as const;\nexport type Layer = (typeof LAYERS)[number];\n\n/** A layer state is the column \"State\" of the table of the layers in `docs/S7.md`, by its first word. */\nexport type LayerState = \"today\" | \"new\" | \"later\" | \"waiting\";\n\n/**\n * A limit is a resource that the load of a cell fills, with no fault. The five limits are the accept\n * queue, the port range, the conntrack table, the memory of a cgroup and the egress queue of an\n * interface. The name of a limit is the key of its law in `Prediction`.\n */\nexport const LIMITS = [\"queue\", \"ports\", \"conntrack\", \"memory\", \"egress\"] as const;\nexport type Limit = (typeof LIMITS)[number];\n\n/**\n * The layer facts are one row of the table of the layers in `docs/S7.md`, and what the cells of the\n * harness apply on the layer. A test holds each text equal to the table. A test of the cells holds\n * `faults` and `limits` equal to the cells of each layer.\n */\nexport interface LayerFacts {\n /** This text is the column \"What it is\". */\n readonly name: string;\n /** This text is the column \"What it proves\". */\n readonly proves: string;\n /** These texts are the column \"What it cannot prove\", one for each thing. The list is empty for \"Nothing that this plan covers\". */\n readonly cannot: readonly string[];\n /** These names are the column \"Tools\". */\n readonly tools: readonly string[];\n readonly state: LayerState;\n /**\n * These names are the faults that the cells of the layer inject, each one time. A name is in the\n * vocabulary of the lab of the layer. The cells of E1 and E3 name a `Fault` of the harness. The cells of\n * E2 are in `@mark1russell7/kind`, and they name the kind of their trigger (`TriggerKind`). The two\n * vocabularies share the names of the faults that they share, for example `blackhole` and `rst`.\n */\n readonly faults: readonly string[];\n /** These limits are the resources that the load of the cells of the layer fills, in the order of `LIMITS`. */\n readonly limits: readonly Limit[];\n}\n\n/** These are the faults of a cell of one kernel: each fault of the harness except the silence of a fabric. */\nconst ONE_KERNEL: readonly Fault[] = [\n \"blackhole\",\n \"freeze-process\",\n \"rst\",\n \"stall\",\n \"fin\",\n \"unreachable\",\n \"simplex\",\n \"mtu-blackhole\",\n \"netem\",\n \"fin-ack\",\n \"middlebox-forget\",\n \"proxy-idle\",\n \"toxic\",\n \"server-close\",\n \"partition\",\n \"planned-failover\",\n \"app-stall\",\n \"step-down\",\n \"drain\",\n \"hop-event\",\n];\n\n/** These are the faults of a cell of kind: each kind of a trigger of `@mark1russell7/kind`, in the order of `TriggerKind`. */\nconst ON_KIND: readonly string[] = [\n \"pod-deletion\",\n \"rolling-update\",\n \"node-drain\",\n \"scale-in\",\n \"crash\",\n \"liveness-restart\",\n \"freeze-process\",\n \"rst\",\n \"blackhole\",\n \"peer-gone-without-close\",\n \"app-stall\",\n \"rollout\",\n \"cpu-throttle\",\n \"authorization-policy\",\n \"idle\",\n \"ztunnel-restart\",\n \"certificate-expiry\",\n \"cannot-serve\",\n \"zone-loss\",\n \"latency\",\n \"dns-blackhole\",\n];\n\n/** These are the facts of each layer. The texts come from the table of the layers in `docs/S7.md`. */\nexport const LAYER_FACTS: Readonly<Record<Layer, LayerFacts>> = {\n E0: {\n name: \"Code on a false clock\",\n proves: \"The logic of a state machine and each order of its events\",\n cannot: [\"Any real time\"],\n tools: [\"algebra\", \"the service conformance kit\"],\n state: \"today\",\n faults: [],\n limits: [],\n },\n E1: {\n name: \"Processes and containers on one kernel\",\n proves: \"Linux TCP timers, stock servers and their clients, proxies, conntrack\",\n cannot: [\"A second kernel\", \"A separate clock\", \"A reboot\", \"A loss of power\"],\n tools: [\"The harness\"],\n state: \"today\",\n faults: ONE_KERNEL,\n limits: LIMITS,\n },\n E2: {\n name: \"A cluster of containers on one kernel\",\n proves: \"The control plane, Service rules, CNI and the lifecycle of a pod\",\n cannot: [\"A kernel for each node\", \"A loss of a node with no signal\"],\n tools: [\"kind\", \"k3d\"],\n state: \"today\",\n faults: ON_KIND,\n limits: [],\n },\n E3: {\n name: \"A routed fabric of containers on one kernel\",\n proves: \"Routing protocol timers, equal-cost paths, a change of route, sites with real delay\",\n cannot: [\"The kernel or the forwarding hardware of a router\"],\n tools: [\"containerlab with FRR\"],\n state: \"new\",\n faults: [\"blackhole\", \"stall\", \"silence\"] satisfies readonly Fault[],\n limits: [],\n },\n E4: {\n name: \"Virtual machines, each with its own kernel\",\n proves: \"A chosen kernel and HZ, a clock for each node, a loss of power, a disk, a reboot\",\n cannot: [\"A physical NIC\", \"Real zones\"],\n tools: [\"QEMU\", \"k3s in a VM\"],\n state: \"new\",\n faults: [],\n limits: [],\n },\n E5: {\n name: \"Images of vendor routers in virtual machines\",\n proves: \"The defaults and the state machines of a vendor's control plane\",\n cannot: [\"The forwarding chip of the router\"],\n tools: [\"vrnetlab\"],\n state: \"later\",\n faults: [],\n limits: [],\n },\n E6: {\n name: \"Real hardware and clouds\",\n proves: \"A physical NIC, firmware, managed load balancers, real zones\",\n cannot: [],\n tools: [\"HW-1\"],\n state: \"waiting\",\n faults: [],\n limits: [],\n },\n};\n\n/** This function gives the layer of a lab of the harness from its topology: E3 with a fabric, E1 without one. */\nexport const layerOf = (topology: Topology | undefined): Layer => (topology?.fabric === undefined ? \"E1\" : \"E3\");\n\n/**\n * This function gives the limits that the prediction of a cell names, in the order of `LIMITS`. It reads\n * a cell of the harness or of `@mark1russell7/kind`.\n */\nexport const limitsOf = (cell: { readonly prediction: object }): readonly Limit[] => {\n const laws = new Map(Object.entries(cell.prediction));\n return LIMITS.filter((limit) => laws.get(limit) !== undefined);\n};\n\n/**\n * A rig term is one pair of the space of the rig map of rigor: a fault and the layer that the fault acts on. It uses\n * the words of that map. The rig records of this repository (`docs/rigs.json`) name these pairs.\n */\nexport interface RigTerm {\n readonly fault: string;\n readonly layer: string;\n}\n\n/** These are the environments of the rig map for the layers. E0 has no environment: it runs no lab. */\nexport const LAYER_RIG_ENV: Readonly<Record<Layer, string | undefined>> = {\n E0: undefined,\n E1: \"container\",\n E2: \"kind\",\n E3: \"fabric\",\n E4: \"vm\",\n E5: \"vendor\",\n E6: \"hardware\",\n};\n\nconst term = (fault: string, layer: string): RigTerm => ({ fault, layer });\n\n/**\n * These are the rig terms of each fault name of the labs: the faults of the harness and the kinds of the triggers of\n * `@mark1russell7/kind`. The two vocabularies share the names that they share. An empty list is a fault that the rig\n * map has no word for at this time. Examples are a stop with its grace, a planned failover, a drain and an ICMP\n * unreachable. The terms of `netem` and `toxic` come from the settings of the cell (`rigTermsOf`).\n */\nexport const RIG_TERMS: Readonly<Record<string, readonly RigTerm[]>> = {\n // The faults of the harness.\n blackhole: [term(\"blackhole\", \"L3\")],\n \"freeze-process\": [term(\"freeze\", \"process\")],\n rst: [term(\"reset\", \"L4\")],\n stall: [term(\"stall\", \"L3\")],\n fin: [term(\"kill\", \"process\")],\n unreachable: [],\n simplex: [term(\"blackhole\", \"L3\")],\n \"mtu-blackhole\": [term(\"mtu\", \"L3\")],\n netem: [],\n \"fin-ack\": [term(\"loss\", \"L4\")],\n \"middlebox-forget\": [term(\"cut\", \"L4\")],\n \"proxy-idle\": [term(\"cut\", \"L7\")],\n toxic: [],\n \"server-close\": [term(\"cut\", \"L7\")],\n partition: [term(\"partition\", \"L3\")],\n \"planned-failover\": [],\n \"app-stall\": [term(\"stall\", \"L7\")],\n \"step-down\": [],\n drain: [],\n \"hop-event\": [],\n silence: [term(\"blackhole\", \"L3\")],\n // A calibration cell injects nothing.\n none: [],\n // The kinds of the triggers of kind that the harness does not name.\n \"pod-deletion\": [],\n \"rolling-update\": [],\n \"node-drain\": [],\n \"scale-in\": [],\n crash: [term(\"kill\", \"process\")],\n \"liveness-restart\": [term(\"kill\", \"process\")],\n \"peer-gone-without-close\": [term(\"blackhole\", \"L3\")],\n rollout: [],\n \"cpu-throttle\": [term(\"cpu\", \"process\")],\n \"authorization-policy\": [],\n idle: [],\n \"ztunnel-restart\": [],\n \"certificate-expiry\": [term(\"cert-bad\", \"TLS\")],\n \"cannot-serve\": [],\n \"zone-loss\": [term(\"node-loss\", \"process\")],\n latency: [term(\"delay\", \"L3\")],\n \"dns-blackhole\": [term(\"dns\", \"L7\")],\n};\n\n/** These are the rig terms of each type of a toxic of Toxiproxy. A slow close and a limit of bandwidth have no word in the rig map. */\nexport const TOXIC_RIG_TERMS: Readonly<Record<string, readonly RigTerm[]>> = {\n latency: [term(\"delay\", \"L4\")],\n timeout: [term(\"stall\", \"L4\")],\n reset_peer: [term(\"reset\", \"L4\")],\n slow_close: [],\n bandwidth: [],\n limit_data: [term(\"cut\", \"L4\")],\n slicer: [term(\"split-frame\", \"L7\")],\n};\n\n/** These are the words of tc netem that the rig map names, each with its fault of the map. */\nconst NETEM_TERMS: readonly (readonly [string, string])[] = [\n [\"delay\", \"delay\"],\n [\"loss\", \"loss\"],\n [\"duplicate\", \"duplicate\"],\n [\"reorder\", \"reorder\"],\n [\"corrupt\", \"corrupt\"],\n];\n\n/** These parts of a cell tell its rig terms. A cell of kind gives the kind of its trigger as `fault`. */\nexport interface RigTermCell {\n readonly fault: string;\n readonly toxic?: { readonly type: string } | undefined;\n readonly netem?: string | undefined;\n}\n\n/**\n * This function gives the rig terms of a cell. The terms of `netem` come from the words of its setting, and the terms\n * of `toxic` from the type of its toxic. This function throws a `RangeError` for a fault name that `RIG_TERMS` does\n * not have, thus a new fault gets its terms in the same change.\n */\nexport function rigTermsOf(cell: RigTermCell): readonly RigTerm[] {\n const own = RIG_TERMS[cell.fault];\n if (own === undefined) throw new RangeError(`rigTermsOf: the fault ${cell.fault} has no entry in RIG_TERMS.`);\n if (cell.fault === \"netem\") {\n const words = (cell.netem ?? \"\").split(/\\s+/);\n return NETEM_TERMS.filter(([word]) => words.includes(word)).map(([, fault]) => term(fault, \"L3\"));\n }\n if (cell.fault === \"toxic\") {\n if (cell.toxic === undefined) return [];\n const terms = TOXIC_RIG_TERMS[cell.toxic.type];\n if (terms === undefined) throw new RangeError(`rigTermsOf: the toxic ${cell.toxic.type} has no entry in TOXIC_RIG_TERMS.`);\n return terms;\n }\n return own;\n}\n"],"mappings":";;;;;;;AAUA,MAAa,SAAS;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;AAAI;;;;;;AAW/D,MAAa,SAAS;CAAC;CAAS;CAAS;CAAa;CAAU;AAAQ;;AA+ExE,MAAa,cAAmD;CAC9D,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC,eAAe;EACxB,OAAO,CAAC,WAAW,6BAA6B;EAChD,OAAO;EACP,QAAQ,CAAC;EACT,QAAQ,CAAC;CACX;CACA,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ;GAAC;GAAmB;GAAoB;GAAY;EAAiB;EAC7E,OAAO,CAAC,aAAa;EACrB,OAAO;EACP,QAAQ;GAhEV;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EA6CU;EACR,QAAQ;CACV;CACA,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC,0BAA0B,iCAAiC;EACpE,OAAO,CAAC,QAAQ,KAAK;EACrB,OAAO;EACP,QAAQ;GAjDV;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EA6BU;EACR,QAAQ,CAAC;CACX;CACA,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC,mDAAmD;EAC5D,OAAO,CAAC,uBAAuB;EAC/B,OAAO;EACP,QAAQ;GAAC;GAAa;GAAS;EAAS;EACxC,QAAQ,CAAC;CACX;CACA,IAAI;EACF,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC,kBAAkB,YAAY;EACvC,OAAO,CAAC,QAAQ,aAAa;EAC7B,OAAO;EACP,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CAChE,MAAM,MAAM,UAAU,KAAK;CAC3B,IAAI,QAAQ,KAAA,GAAW,MAAM,IAAI,WAAW,yBAAyB,KAAK,MAAM,4BAA4B;CAC5G,IAAI,KAAK,UAAU,SAAS;EAC1B,MAAM,SAAS,KAAK,SAAS,GAAA,CAAI,MAAM,KAAK;EAC5C,OAAO,YAAY,QAAQ,CAAC,UAAU,MAAM,SAAS,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,WAAW,KAAK,OAAO,IAAI,CAAC;CAClG;CACA,IAAI,KAAK,UAAU,SAAS;EAC1B,IAAI,KAAK,UAAU,KAAA,GAAW,OAAO,CAAC;EACtC,MAAM,QAAQ,gBAAgB,KAAK,MAAM;EACzC,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,WAAW,yBAAyB,KAAK,MAAM,KAAK,kCAAkC;EACzH,OAAO;CACT;CACA,OAAO;AACT"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@mark1russell7/harness",
4
- "version": "0.16.29",
4
+ "version": "0.16.30",
5
5
  "description": "Network labs in Docker, declared as data. A cell builds a topology of networks, routers and proxies around a stock target. It injects a fault at layer 3 or 4 from a NET_ADMIN sidecar, measures the records of the kernel and judges a prediction. The faults are black holes, resets, ICMP unreachable, one-way and MTU drops, tc netem, the toxics of Toxiproxy and frozen processes. Its disk tier cuts the power of a program on LazyFS: the disk loses each write after the last fsync. Its memory tier sets the limits of the cgroup of a client, and judges its throttle above memory.high and the choice of the OOM killer. Its egress tier puts a netem or tbf qdisc on the interface of a client, and judges the departure of each datagram from the stamps of the kernel. Its replicated groups are Redis with Sentinels, MongoDB replica sets, PostgreSQL standbys, Kafka, RabbitMQ and BGP fabrics with BFD. A lab can also operate in a QEMU guest. Its first use is connection timers: keep-alive, TCP retransmission, heartbeats and reconnects.",
6
6
  "keywords": [
7
7
  "fault-injection",