@mark1russell7/harness 0.14.0 → 0.14.1

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.
@@ -429,6 +429,9 @@ interface StageBand {
429
429
  * - `errors` are the errors that the client must meet on the way, each with the band of its
430
430
  * first occurrence. An example is the error of the offline queue when it gives up.
431
431
  * - `quiet` are the stages that must not occur after the fault. Each one that a run shows is a finding.
432
+ * - `lost` is the band of the count of accepted writes that the group did not keep, in each run. A
433
+ * count outside it is a finding. A measurement-only cell with this band gets its decision from
434
+ * the findings of its runs, thus the law of the count judges the cell.
432
435
  */
433
436
  interface GroupPrediction {
434
437
  readonly lands: "new" | "same";
@@ -441,6 +444,10 @@ interface GroupPrediction {
441
444
  readonly high: Quantity;
442
445
  }>;
443
446
  readonly quiet?: readonly Stage[];
447
+ readonly lost?: {
448
+ readonly low: number;
449
+ readonly high: number;
450
+ };
444
451
  }
445
452
  /**
446
453
  * A middlebox expectation tells what the router of a topology does with the flow in the window of
@@ -1163,4 +1170,4 @@ interface RunTopology {
1163
1170
  }
1164
1171
  //#endregion
1165
1172
  export { StageBand as $, PinnedImage as A, Replies as B, Jitter as C, MiddleboxExpectation as D, MiddleboxEvent as E, Reconnects as F, RunGroup as G, RouterHop as H, Recovers as I, SentinelEvent as J, RunPart as K, Reference as L, ProbeEvent as M, ProxyHop as N, MiddleboxForm as O, ProxyTime as P, Stage as Q, ReplicaSet as R, ImageSource as S, LineMatch as T, RttRange as U, RequestPrediction as V, Run as W, Shipped as X, SentinelStage as Y, ShippedImage as Z, HopEvent as _, Cluster as a, isHopPlace as at, HopWrite as b, DriverBand as c, FaultPlace as d, Subject as et, Group as f, Hop as g, GroupRole as h, ClientImage as i, WsProbe as it, Prediction as j, Observer as k, DriverStep as l, GroupPrediction as m, Cell as n, Topology as nt, ClusterClientAt as o, latestEndOf as ot, GroupPlace as p, RunTopology as q, Client as r, Toxic as rt, ClusterStage as s, BuildImage as t, Target as tt, Fault as u, HopPlace as v, KernelRecord as w, HttpProbe as x, HopSignal as y, ReplicaSetStage as z };
1166
- //# sourceMappingURL=cell-D2QNOxE8.d.ts.map
1173
+ //# sourceMappingURL=cell-BccWKiXh.d.ts.map
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as StageBand, A as PinnedImage, B as Replies, C as Jitter, D as MiddleboxExpectation, E as MiddleboxEvent, F as Reconnects, G as RunGroup, H as RouterHop, I as Recovers, J as SentinelEvent, K as RunPart, L as Reference, M as ProbeEvent, N as ProxyHop, O as MiddleboxForm, P as ProxyTime, Q as Stage, R as ReplicaSet, S as ImageSource, T as LineMatch, U as RttRange, V as RequestPrediction, W as Run, X as Shipped, Y as SentinelStage, Z as ShippedImage, _ as HopEvent, a as Cluster, at as isHopPlace, b as HopWrite, c as DriverBand, d as FaultPlace, et as Subject, f as Group, g as Hop, h as GroupRole, i as ClientImage, it as WsProbe, j as Prediction, k as Observer, l as DriverStep, m as GroupPrediction, n as Cell, nt as Topology, o as ClusterClientAt, ot as latestEndOf, p as GroupPlace, q as RunTopology, r as Client, rt as Toxic, s as ClusterStage, t as BuildImage, tt as Target, u as Fault, v as HopPlace, w as KernelRecord, x as HttpProbe, y as HopSignal, z as ReplicaSetStage } from "./cell-D2QNOxE8.js";
1
+ import { $ as StageBand, A as PinnedImage, B as Replies, C as Jitter, D as MiddleboxExpectation, E as MiddleboxEvent, F as Reconnects, G as RunGroup, H as RouterHop, I as Recovers, J as SentinelEvent, K as RunPart, L as Reference, M as ProbeEvent, N as ProxyHop, O as MiddleboxForm, P as ProxyTime, Q as Stage, R as ReplicaSet, S as ImageSource, T as LineMatch, U as RttRange, V as RequestPrediction, W as Run, X as Shipped, Y as SentinelStage, Z as ShippedImage, _ as HopEvent, a as Cluster, at as isHopPlace, b as HopWrite, c as DriverBand, d as FaultPlace, et as Subject, f as Group, g as Hop, h as GroupRole, i as ClientImage, it as WsProbe, j as Prediction, k as Observer, l as DriverStep, m as GroupPrediction, n as Cell, nt as Topology, o as ClusterClientAt, ot as latestEndOf, p as GroupPlace, q as RunTopology, r as Client, rt as Toxic, s as ClusterStage, t as BuildImage, tt as Target, u as Fault, v as HopPlace, w as KernelRecord, x as HttpProbe, y as HopSignal, z as ReplicaSetStage } from "./cell-BccWKiXh.js";
2
2
  import { Quantity } from "@mark1russell7/quantity";
3
3
  import "testcontainers";
4
4
  //#region src/application.d.ts
package/build/index.js CHANGED
@@ -358,6 +358,18 @@ const verdictOfBand = (prediction, runs, delta = NOISE) => {
358
358
  }
359
359
  const outcomes = [...kinds].map(([kind, n]) => `${n} ${kind}`).join(", ");
360
360
  const timed = times.length === 0 ? "no time" : `median ${s(median(times)).value} s from ${prediction.from}, range [${s(times[0]).value}, ${s(times.at(-1)).value}] s`;
361
+ const counts = prediction.group?.lost;
362
+ if (counts !== void 0) {
363
+ const off = new Set(outside.map((each) => each.run)).size;
364
+ return {
365
+ ...empty,
366
+ decision: off === 0 ? "holds" : "fails",
367
+ band: null,
368
+ outside,
369
+ median: times.length === 0 ? null : s(median(times)),
370
+ why: `${counted.length - off} of ${counted.length} runs inside the band of lost writes [${counts.low}, ${counts.high}]; ${outcomes}; ${timed}. ${prediction.why}`
371
+ };
372
+ }
361
373
  const missed = outside.filter((each) => counted.some((run) => name(run) === each.run && run.reconnect !== void 0));
362
374
  const late = missed.length === 0 ? "" : ` ${missed.length} runs had a wait of the reconnect outside its band.`;
363
375
  return {
@@ -1520,6 +1532,12 @@ const measureGroup = (cell, run) => {
1520
1532
  if (met === void 0) findings.push(`the client never met ${error.name}`);
1521
1533
  else if (met.first.value < valueIn(error.low, "s") - noise || met.first.value > valueIn(error.high, "s") + noise) findings.push(`the client met ${error.name} ${met.first.value} s after the fault, outside [${valueIn(error.low, "s")}, ${valueIn(error.high, "s")}] s`);
1522
1534
  }
1535
+ if (expected?.lost !== void 0) {
1536
+ const { low, high } = expected.lost;
1537
+ const lost = group.writes.lost;
1538
+ if (lost === null) findings.push("the group did not converge, thus the count of its lost writes is not known");
1539
+ else if (lost.length < low || lost.length > high) findings.push(`the group lost ${lost.length} accepted writes, outside [${low}, ${high}]`);
1540
+ }
1523
1541
  if (accepted === void 0) {
1524
1542
  if (prediction.detects !== null) findings.push(lands === "new" ? "the client never wrote to a new primary in the window" : "the client never wrote again in the window");
1525
1543
  return {