@ecoma-io/archkeep 0.18.0 → 0.19.0

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.
@@ -97,6 +97,19 @@ export function buildDecision(run) {
97
97
  );
98
98
  }
99
99
 
100
+ // The `findings` count is the cardinal evidence number — a non-negative
101
+ // integer that the I1–I5 invariants all rely on. A missing, non-numeric, or
102
+ // negative value would silently falsify every comparison (`undefined > 0` is
103
+ // `false`), producing a clean verdict over a run whose counts were never set
104
+ // or are logically impossible — the exact silent direction this module exists
105
+ // to refuse.
106
+ if (typeof run.findings !== "number" || !Number.isFinite(run.findings) || run.findings < 0) {
107
+ throw new Error(
108
+ `archkeep: refusing to build a decision where findings is ${JSON.stringify(run.findings)} ` +
109
+ `— findings must be a non-negative number, or the verdict invariants cannot be enforced. ` +
110
+ `This is a bug in the command that built the decision.`,
111
+ );
112
+ }
100
113
  if (verdict === "pass") {
101
114
  if (run.coverageComplete !== true) {
102
115
  throw new Error(