@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.
- package/README.md +1 -3
- package/cli.mjs +167 -5
- package/commands.mjs +2 -0
- package/package.json +1 -1
- package/src/analysis/kotlin.mjs +60 -0
- package/src/analysis/python.mjs +124 -73
- package/src/commands/diff.mjs +15 -7
- package/src/commands/discover.mjs +40 -0
- package/src/commands/explain.mjs +11 -0
- package/src/commands/impact-statement.mjs +308 -0
- package/src/commands/impact.mjs +9 -0
- package/src/commands/rules.mjs +3 -1
- package/src/commands/scenario-evaluation.mjs +515 -0
- package/src/commands/scenario.mjs +184 -0
- package/src/report/evidence.mjs +13 -0
package/src/report/evidence.mjs
CHANGED
|
@@ -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(
|