@feigi/fleet-ctl 3.23.36 → 3.23.38
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/package.json +1 -1
- package/scripts/cell-readout.mjs +38 -11
- package/scripts/main-checkout.mjs +1 -1
- package/scripts/member-write-guard.mjs +1 -1
- package/scripts/repo-root.mjs +1 -1
- package/skills/run-team/references/reaping.md +1 -1
- package/scripts/agent-test-dir-prose.test.mjs +0 -59
- package/scripts/agent-test.test.mjs +0 -1640
- package/scripts/ambient-git-vars-mjs-prose.test.mjs +0 -397
- package/scripts/ambient-git-vars-prose.test.mjs +0 -192
- package/scripts/ancestry-check-position-prose.test.mjs +0 -175
- package/scripts/apply-ruleset.test.mjs +0 -421
- package/scripts/arg-header-probes-prose.test.mjs +0 -394
- package/scripts/arg.test.mjs +0 -1354
- package/scripts/board-cli.test.mjs +0 -710
- package/scripts/board-identity.test.mjs +0 -429
- package/scripts/board-liveness-banner.test.mjs +0 -119
- package/scripts/board-prev-shape.test.mjs +0 -228
- package/scripts/board-tryparse-null.test.mjs +0 -119
- package/scripts/board.test.mjs +0 -3121
- package/scripts/brief-after-cut-prose.test.mjs +0 -53
- package/scripts/candidates-exit3-prose.test.mjs +0 -302
- package/scripts/candidates.test.mjs +0 -2312
- package/scripts/caveat-unification-prose.test.mjs +0 -98
- package/scripts/cell-readout.test.mjs +0 -615
- package/scripts/ci-comment-rot-prose.test.mjs +0 -2025
- package/scripts/ci-completes-premise-prose.test.mjs +0 -257
- package/scripts/ci-state-prose.test.mjs +0 -113
- package/scripts/ci-state.test.mjs +0 -1933
- package/scripts/ci-vacuous-green.test.mjs +0 -368
- package/scripts/citation-sweep-prose.test.mjs +0 -1712
- package/scripts/claim-lifecycle.test.mjs +0 -187
- package/scripts/claim-ticket.test.mjs +0 -1122
- package/scripts/closing-keyword-prose.test.mjs +0 -193
- package/scripts/cockpit-launch-idempotent-prose.test.mjs +0 -165
- package/scripts/cockpit-tick-nonblocking.test.mjs +0 -210
- package/scripts/compute-board.test.mjs +0 -1214
- package/scripts/compute-spend.test.mjs +0 -517
- package/scripts/consumer-technology-prose.test.mjs +0 -126
- package/scripts/cross-repo-citation-prose.test.mjs +0 -155
- package/scripts/cwd-isolation-pins.mjs +0 -83
- package/scripts/dedupe-guard-prose.test.mjs +0 -243
- package/scripts/delete-merged-branch.test.mjs +0 -576
- package/scripts/derive-testcmd.test.mjs +0 -595
- package/scripts/diff-stats.test.mjs +0 -404
- package/scripts/dispatch-block-golden-prose.test.mjs +0 -1130
- package/scripts/dispatch-block-pins-prose.test.mjs +0 -615
- package/scripts/dispositions-check.test.mjs +0 -936
- package/scripts/dispositions-gate-prose.test.mjs +0 -129
- package/scripts/drop-merged-label.test.mjs +0 -479
- package/scripts/exec-stub.mjs +0 -93
- package/scripts/exec-stub.test.mjs +0 -69
- package/scripts/expected-jobs-prose.test.mjs +0 -80
- package/scripts/fan-out-authorization-prose.test.mjs +0 -80
- package/scripts/filing-bar-seat-prose.test.mjs +0 -242
- package/scripts/filing-claim-bar-prose.test.mjs +0 -166
- package/scripts/finisher-died-prose.test.mjs +0 -31
- package/scripts/finisher-dispatch-premise-prose.test.mjs +0 -312
- package/scripts/finisher-halt-prose.test.mjs +0 -106
- package/scripts/finisher-name-prose.test.mjs +0 -134
- package/scripts/finisher-own-tree-prose.test.mjs +0 -299
- package/scripts/finisher-pin-race-prose.test.mjs +0 -339
- package/scripts/finisher-test-verdict-prose.test.mjs +0 -102
- package/scripts/fix-applier-correction-rules-prose.test.mjs +0 -202
- package/scripts/fix-applier-result-file-prose.test.mjs +0 -149
- package/scripts/fleet-bootstrap.test.mjs +0 -75
- package/scripts/fleet-heartbeat.test.mjs +0 -450
- package/scripts/fleet-provenance.test.mjs +0 -138
- package/scripts/fleet-run.test.mjs +0 -90
- package/scripts/fleet-state.test.mjs +0 -460
- package/scripts/fleet-tick-prose.test.mjs +0 -300
- package/scripts/fleet-tick.test.mjs +0 -2444
- package/scripts/force-with-lease-reason-prose.test.mjs +0 -184
- package/scripts/frontmatter-check.test.mjs +0 -436
- package/scripts/git-env.test.mjs +0 -149
- package/scripts/git-status-untracked-mode-sweep.test.mjs +0 -216
- package/scripts/gone-walk.test.mjs +0 -213
- package/scripts/gp-sep-invariant-prose.test.mjs +0 -188
- package/scripts/head-moved-after-label-prose.test.mjs +0 -233
- package/scripts/immutable-body-claim-prose.test.mjs +0 -204
- package/scripts/implementer-model-tier.test.mjs +0 -235
- package/scripts/inflight-citation-prose.test.mjs +0 -144
- package/scripts/inflight-exit2-prose.test.mjs +0 -81
- package/scripts/inflight-probe-guard-prose.test.mjs +0 -109
- package/scripts/inflight-scan-scope-prose.test.mjs +0 -57
- package/scripts/inflight.test.mjs +0 -2882
- package/scripts/injection-control-prose.test.mjs +0 -404
- package/scripts/install-root-audit.test.mjs +0 -464
- package/scripts/instrument-check-prose.test.mjs +0 -235
- package/scripts/instruments.test.mjs +0 -787
- package/scripts/is-cli.test.mjs +0 -99
- package/scripts/issue-tracker-prose.test.mjs +0 -71
- package/scripts/json.test.mjs +0 -364
- package/scripts/ledger-dispatch.test.mjs +0 -927
- package/scripts/ledger-grammar.test.mjs +0 -227
- package/scripts/ledger-read-require-file.test.mjs +0 -197
- package/scripts/ledger-rotate.test.mjs +0 -142
- package/scripts/ledger.test.mjs +0 -3436
- package/scripts/line-distance-prose.test.mjs +0 -245
- package/scripts/liveness-rationale-prose.test.mjs +0 -83
- package/scripts/locale-pin-prose.test.mjs +0 -189
- package/scripts/main-checkout.test.mjs +0 -332
- package/scripts/member-outcome-prose.test.mjs +0 -167
- package/scripts/member-outcomes-header.test.mjs +0 -129
- package/scripts/member-outcomes-prose.test.mjs +0 -63
- package/scripts/member-outcomes.test.mjs +0 -638
- package/scripts/member-prompt-prose.test.mjs +0 -165
- package/scripts/member-record.test.mjs +0 -541
- package/scripts/member-write-guard.test.mjs +0 -214
- package/scripts/merge-commit-probe-prose.test.mjs +0 -122
- package/scripts/merge-gate.test.mjs +0 -613
- package/scripts/muted-git-guard-sweep.test.mjs +0 -493
- package/scripts/net-ssh-precedence-prose.test.mjs +0 -91
- package/scripts/net-watchdog-prose.test.mjs +0 -79
- package/scripts/net.test.mjs +0 -211
- package/scripts/no-ci-gate-prose.test.mjs +0 -108
- package/scripts/no-undo-audit.test.mjs +0 -3961
- package/scripts/no-wave.test.mjs +0 -138
- package/scripts/node-floor-sweep.test.mjs +0 -611
- package/scripts/pointer-target-prose.test.mjs +0 -186
- package/scripts/pr-cost.test.mjs +0 -521
- package/scripts/pr-overlap.test.mjs +0 -692
- package/scripts/printf-die-sweep.test.mjs +0 -384
- package/scripts/prompt-renderer.mjs +0 -40
- package/scripts/prompt-renderer.test.mjs +0 -68
- package/scripts/prose-pin.mjs +0 -807
- package/scripts/prose-pin.test.mjs +0 -1034
- package/scripts/prove-merge.test.mjs +0 -995
- package/scripts/pull-table-relabel-prose.test.mjs +0 -60
- package/scripts/quiet-payload-prose.test.mjs +0 -222
- package/scripts/reap-cherry-check-prose.test.mjs +0 -80
- package/scripts/reap.test.mjs +0 -4432
- package/scripts/reaping-prose.test.mjs +0 -239
- package/scripts/reaping-reap-authorizers-prose.test.mjs +0 -112
- package/scripts/reaping-release-authorizers-prose.test.mjs +0 -85
- package/scripts/recipe-derivation-prose.test.mjs +0 -112
- package/scripts/recipe-prove.test.mjs +0 -1042
- package/scripts/refuter-scratch-prose.test.mjs +0 -135
- package/scripts/release-label-required-prose.test.mjs +0 -71
- package/scripts/release-label-split-prose.test.mjs +0 -184
- package/scripts/release-ticket-reap-pairing-prose.test.mjs +0 -63
- package/scripts/release-ticket.test.mjs +0 -5099
- package/scripts/renovate-release-contract.test.mjs +0 -379
- package/scripts/repo-root.test.mjs +0 -873
- package/scripts/reporter-output-rule-prose.test.mjs +0 -208
- package/scripts/review-agent-report-only.test.mjs +0 -49
- package/scripts/review-core-booking.test.mjs +0 -35
- package/scripts/review-core-cwd-isolation.test.mjs +0 -374
- package/scripts/review-core-reads.test.mjs +0 -478
- package/scripts/review-core-refuter-scratch.test.mjs +0 -148
- package/scripts/review-core-scratch-refusal.test.mjs +0 -64
- package/scripts/review-core-shared-test-run.test.mjs +0 -275
- package/scripts/review-core-snapshot-path.test.mjs +0 -830
- package/scripts/review-core-specialist-scratch.test.mjs +0 -191
- package/scripts/review-core-testcmd.test.mjs +0 -335
- package/scripts/review-core-unrun.test.mjs +0 -566
- package/scripts/review-core-unverified-discriminant.test.mjs +0 -208
- package/scripts/review-eval-resolver-path.test.mjs +0 -55
- package/scripts/review-host-fixture.mjs +0 -89
- package/scripts/review-in-run-retry.test.mjs +0 -211
- package/scripts/review-no-vendor-dispatch.test.mjs +0 -45
- package/scripts/review-path-default.test.mjs +0 -796
- package/scripts/review-runner-spawns.test.mjs +0 -95
- package/scripts/review-runner.test.mjs +0 -166
- package/scripts/review-tier-audit.test.mjs +0 -140
- package/scripts/run-artifact-pr-prose.test.mjs +0 -341
- package/scripts/run-merge-bot-prose.test.mjs +0 -1413
- package/scripts/run-team-local-hook.test.mjs +0 -442
- package/scripts/scratch-partition-invariant-prose.test.mjs +0 -74
- package/scripts/scripts-path-citation-sweep.test.mjs +0 -73
- package/scripts/section-between-guard-prose.test.mjs +0 -379
- package/scripts/select-dimensions.test.mjs +0 -674
- package/scripts/shared-refusal.test.mjs +0 -388
- package/scripts/shell-traps-prose.test.mjs +0 -504
- package/scripts/shortlist.test.mjs +0 -380
- package/scripts/slow-transport.mjs +0 -72
- package/scripts/snapshot-repo.test.mjs +0 -1006
- package/scripts/snapshot-runner-audience-prose.test.mjs +0 -130
- package/scripts/spend-view.test.mjs +0 -312
- package/scripts/staleness-qualifier-prose.test.mjs +0 -251
- package/scripts/staleness-verdict-prose.test.mjs +0 -142
- package/scripts/staleness.test.mjs +0 -893
- package/scripts/stalled-member-liveness-prose.test.mjs +0 -219
- package/scripts/stash-prohibition-prose.test.mjs +0 -313
- package/scripts/strip-comments.mjs +0 -44
- package/scripts/temp-dir.mjs +0 -47
- package/scripts/ticket-router.test.mjs +0 -981
- package/scripts/tier-check.test.mjs +0 -828
- package/scripts/tier-outcomes-header.test.mjs +0 -518
- package/scripts/tier-outcomes.test.mjs +0 -572
- package/scripts/tier-roles.test.mjs +0 -535
- package/scripts/tracker-block-copy-prose.test.mjs +0 -288
- package/scripts/triage-labels-gloss-prose.test.mjs +0 -97
- package/scripts/unattended-git-sweep.test.mjs +0 -142
- package/scripts/verify-sha-exit2-prose.test.mjs +0 -269
- package/scripts/verify-sha.test.mjs +0 -692
- package/scripts/watcher-degraded-block.test.mjs +0 -369
- package/scripts/watcher-key-prose.test.mjs +0 -106
- package/scripts/within-run-pair-prose.test.mjs +0 -212
- package/scripts/worktree-audit.test.mjs +0 -1408
- package/scripts/worktree-head-prose.test.mjs +0 -276
- package/scripts/worktree-listing-sweep.test.mjs +0 -217
- package/scripts/worktree-model-prose.test.mjs +0 -216
- package/scripts/worktree-porcelain.mjs +0 -35
- package/scripts/worktree-porcelain.test.mjs +0 -102
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
import { test } from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { stripComments } from "./strip-comments.mjs";
|
|
6
|
-
import { between, paragraph, phrase, stripSlashGutter } from "./prose-pin.mjs";
|
|
7
|
-
import { unrunReason, unrunEntries, unrunCrashed, sharedRunNote, FINDINGS_SCHEMA, CRASHED_REASON } from "./review-core.mjs";
|
|
8
|
-
|
|
9
|
-
// A dimension that crashed and a dimension that ran clean returned BYTE-
|
|
10
|
-
// IDENTICAL shapes: `findings: []` either way, with the key listed in
|
|
11
|
-
// `dimensionsRun` regardless (#137, #138). Nothing in this suite could see
|
|
12
|
-
// that mode — no test touched `FINDINGS_SCHEMA` or the verify stage's falsy-
|
|
13
|
-
// review branch at all — so a green run said nothing about it. This file is
|
|
14
|
-
// that missing eye.
|
|
15
|
-
//
|
|
16
|
-
// #2315: every run-quality verdict reads the review's ONE shared test run —
|
|
17
|
-
// `unrunReason(run, findings)`, `findings` being every finding that reached
|
|
18
|
-
// the payload, across all selected dimensions — because no specialist runs the
|
|
19
|
-
// full suite any more. The fixtures below are that run's shape: the caller's
|
|
20
|
-
// `command` plus the test-run agent's exit status and counts.
|
|
21
|
-
//
|
|
22
|
-
// Pins read CODE, not SOURCE, wherever they read source text at all:
|
|
23
|
-
// `stripComments` exists because two pins in this directory were MEASURED
|
|
24
|
-
// vacuous against a field commented out with `/* */` (see strip-comments.mjs),
|
|
25
|
-
// and a schema pin written against raw source passes with the field dead under
|
|
26
|
-
// `additionalProperties: false`.
|
|
27
|
-
const REPO = join(import.meta.dirname, "..");
|
|
28
|
-
const SOURCE = readFileSync(join(REPO, "scripts", "review-core.mjs"), "utf8");
|
|
29
|
-
const CODE = stripComments(SOURCE);
|
|
30
|
-
|
|
31
|
-
// #2315's no-counts case, from its two causes: the test-run dispatch returned
|
|
32
|
-
// nothing at all, or it returned without a count (crash, deadline, no
|
|
33
|
-
// summary). Neither is ever a pass.
|
|
34
|
-
test("a shared run that returned nothing is unrun, and says why", () => {
|
|
35
|
-
for (const dead of [null, undefined, false, 0, ""]) {
|
|
36
|
-
const reason = unrunReason(dead, []);
|
|
37
|
-
assert.equal(typeof reason, "string", `a falsy shared run (${JSON.stringify(dead)}) must yield a reason`);
|
|
38
|
-
assert.match(reason, /returned nothing/, "the reason no longer names a test run that returned nothing");
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// #137's case: the `'tests 0'` reading rule, given somewhere to land. The
|
|
43
|
-
// reason names the COMMAND, because "0 tests" without it sends a reader
|
|
44
|
-
// hunting for which command produced them.
|
|
45
|
-
test("a zero-test run is unrun, naming the command that produced no tests", () => {
|
|
46
|
-
const reason = unrunReason({ command: "npm test --", tests: 0, pass: 0, fail: 0 }, []);
|
|
47
|
-
assert.equal(typeof reason, "string", "a zero-test run must yield a reason");
|
|
48
|
-
assert.match(reason, /npm test --/, "the reason no longer names the command that produced no tests");
|
|
49
|
-
assert.match(reason, /0 tests/);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// ABSENT or null is "no counts", not `tests: 0`: the test-run agent is told to
|
|
53
|
-
// omit a count the log does not state, so an absent one is a run that printed
|
|
54
|
-
// no summary — and its `error` says why, which the reason must carry.
|
|
55
|
-
test("a shared run that reported no count at all is unrun, carrying the agent's error", () => {
|
|
56
|
-
for (const run of [{ command: "npm test --" }, { command: "npm test --", tests: null }]) {
|
|
57
|
-
const reason = unrunReason(run, [{ severity: "critical", claim: "x", evidence: "y" }]);
|
|
58
|
-
assert.equal(typeof reason, "string", `a countless run (${JSON.stringify(run)}) must yield a reason`);
|
|
59
|
-
assert.match(reason, /no counts/);
|
|
60
|
-
}
|
|
61
|
-
assert.match(unrunReason({ command: "npm test --", error: "hit the 1800 s deadline" }, []), /hit the 1800 s deadline/);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// THE REFUSAL SURFACE, and the half a suite fed only broken input cannot pin.
|
|
65
|
-
// A new required field and a new unrun predicate are both refusal surfaces: a
|
|
66
|
-
// review that legitimately has nothing to report must still come back
|
|
67
|
-
// clean. Marking a genuinely clean dimension unrun re-runs work that was done
|
|
68
|
-
// and teaches a controller to ignore the field — the same end state as not
|
|
69
|
-
// having it.
|
|
70
|
-
test("a clean run with every dimension's findings list empty is NOT unrun", () => {
|
|
71
|
-
assert.equal(
|
|
72
|
-
unrunReason({ command: "npm test --", exitCode: 0, tests: 12, pass: 12, fail: 0 }, []),
|
|
73
|
-
null,
|
|
74
|
-
"a review whose shared run passed and found nothing is clean, not unrun",
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// A suite with real failures RAN. Reading `fail > 0` as unrun would hide the
|
|
79
|
-
// one class of test result that most needs reporting.
|
|
80
|
-
test("a run with failing tests is NOT unrun", () => {
|
|
81
|
-
assert.equal(
|
|
82
|
-
unrunReason({ command: "npm test --", exitCode: 1, tests: 14, pass: 11, fail: 3 }, [{ severity: "critical", claim: "x", evidence: "y" }]),
|
|
83
|
-
null,
|
|
84
|
-
"a suite that reported failures still ran",
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// #143's all-skipped case, and the reason the clause reads `pass === 0 && !fail`
|
|
89
|
-
// rather than the bare "zero passes" #143's body proposes: a run where every
|
|
90
|
-
// test skipped arrives as `pass: 0` with `fail` zero or absent (the shared run
|
|
91
|
-
// may also report `skipped`, but the verdict never needs it). Nothing passed
|
|
92
|
-
// and nothing failed is no work done.
|
|
93
|
-
// BOTH arms of `findings`, because this clause is findings-INDEPENDENT by
|
|
94
|
-
// design and only a non-empty fixture says so. The sibling `fail > 0` clause
|
|
95
|
-
// below is the one that reads `findings`; ANDing a findings check in here too
|
|
96
|
-
// would let a review that reports 0 passes and 0 fails and attaches one filler
|
|
97
|
-
// finding read as clean — the loophole #143 exists to close. Every fixture
|
|
98
|
-
// here once sent `[]`, so that mutation survived the whole suite.
|
|
99
|
-
test("a run where nothing passed and nothing failed is unrun — every test skipped", () => {
|
|
100
|
-
for (const findings of [[], [{ severity: "suggestion", claim: "x", evidence: "y" }]]) {
|
|
101
|
-
for (const run of [
|
|
102
|
-
{ command: "node --test", tests: 2, pass: 0, fail: 0 },
|
|
103
|
-
{ command: "node --test", tests: 2, pass: 0 },
|
|
104
|
-
]) {
|
|
105
|
-
const reason = unrunReason(run, findings);
|
|
106
|
-
const where = `${JSON.stringify(run)} with ${findings.length} findings`;
|
|
107
|
-
assert.equal(typeof reason, "string", `an all-skipped run (${where}) must yield a reason`);
|
|
108
|
-
assert.match(reason, /node --test/, "the reason no longer names the command that did no work");
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// #651: the clause above fired at EXACTLY zero, so one executed test bought a
|
|
114
|
-
// clean read — `tests 937 / pass 1 / fail 0` is a crash mid-suite, not a pass.
|
|
115
|
-
// The `pass` variants are the two shapes a no-failure run arrives in (`fail: 0`
|
|
116
|
-
// and `fail` absent, both falsy); the fixture with a finding attached is there
|
|
117
|
-
// for the same reason the all-skipped one is — this clause is findings-
|
|
118
|
-
// INDEPENDENT, and every fixture sending `[]` is how that mutation survives.
|
|
119
|
-
test("a run that executed a fraction of what it collected is unrun, not clean", () => {
|
|
120
|
-
for (const findings of [[], [{ severity: "suggestion", claim: "x", evidence: "y" }]]) {
|
|
121
|
-
for (const run of [
|
|
122
|
-
{ command: "node --test", tests: 937, pass: 1, fail: 0 },
|
|
123
|
-
{ command: "node --test", tests: 937, pass: 1 },
|
|
124
|
-
{ command: "node --test", tests: 937, pass: 468, fail: 0 },
|
|
125
|
-
]) {
|
|
126
|
-
const reason = unrunReason(run, findings);
|
|
127
|
-
const where = `${JSON.stringify(run)} with ${findings.length} findings`;
|
|
128
|
-
assert.equal(typeof reason, "string", `a mostly-unexecuted run (${where}) must yield a reason`);
|
|
129
|
-
assert.match(reason, /node --test/, "the reason no longer names the command that ran a fraction of its collection");
|
|
130
|
-
assert.match(reason, new RegExp(`${run.pass}\\b.*\\b${run.tests}\\b`), "the reason no longer reports both counts");
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// THE ACCEPT SIDE of #651's ratio, and the half a refuse-only pin cannot hold. A
|
|
136
|
-
// small suite is not a partial one: 3 of 3 is every test the tree has. The `todo`
|
|
137
|
-
// fixture is the MEASURED hazard the issue names — `node --test` counts a todo
|
|
138
|
-
// outside `pass` (tests 2 / pass 1 / fail 0 / todo 1), so a strict
|
|
139
|
-
// `pass + fail === tests` rule would refuse any host repo carrying one, and a
|
|
140
|
-
// floor at exactly half is what keeps it clean. `pass: null` is the optional
|
|
141
|
-
// field arriving explicitly empty: `null * 2 < tests` is 0 < tests, so only the
|
|
142
|
-
// `typeof` guard stops that from reading as no work.
|
|
143
|
-
test("a small-but-complete run, a half-todo run, and one that omitted pass are NOT unrun", () => {
|
|
144
|
-
for (const run of [
|
|
145
|
-
{ command: "node --test", exitCode: 0, tests: 3, pass: 3, fail: 0 },
|
|
146
|
-
{ command: "node --test", exitCode: 0, tests: 937, pass: 937, fail: 0 },
|
|
147
|
-
{ command: "node --test", exitCode: 0, tests: 2, pass: 1, fail: 0 },
|
|
148
|
-
{ command: "node --test", exitCode: 0, tests: 937, pass: null },
|
|
149
|
-
]) {
|
|
150
|
-
assert.equal(
|
|
151
|
-
unrunReason(run, []),
|
|
152
|
-
null,
|
|
153
|
-
`a run that did its work (${JSON.stringify(run)}) must stay clean`,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// The ratio must not swallow a failing suite that actually EXECUTED its whole
|
|
159
|
-
// collection: pass+fail equals tests here, so every test collected ran, and
|
|
160
|
-
// refusing it would be the over-refusal #137 removed — reached only because
|
|
161
|
-
// this fixture files findings, which is what keeps the sibling clause below
|
|
162
|
-
// off it.
|
|
163
|
-
test("a fully-executed failing run is NOT unrun by the ratio — a suite that failed ran", () => {
|
|
164
|
-
assert.equal(
|
|
165
|
-
unrunReason({ command: "node --test", exitCode: 1, tests: 10, pass: 4, fail: 6 }, [{ severity: "critical", claim: "x", evidence: "y" }]),
|
|
166
|
-
null,
|
|
167
|
-
"a suite that reported failures still ran, having executed everything it collected",
|
|
168
|
-
);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// #651 CONTINUED: the ratio clause above was gated on `!run.fail`, so a crash
|
|
172
|
-
// that left even ONE failing test alongside its one pass skipped it entirely
|
|
173
|
-
// and fell to the CONJUNCTION clause below, which one filed finding defeats —
|
|
174
|
-
// `{tests:937, pass:1, fail:1}` plus a finding read clean, 935 of 937 never
|
|
175
|
-
// run. The ratio now sums pass AND fail against the same half floor, findings-
|
|
176
|
-
// INDEPENDENT for the same reason the fail-free ratio test above is.
|
|
177
|
-
test("a run that executed a fraction of what it collected through a MIX of pass and fail is unrun", () => {
|
|
178
|
-
for (const findings of [[], [{ severity: "suggestion", claim: "x", evidence: "y" }]]) {
|
|
179
|
-
for (const run of [
|
|
180
|
-
{ command: "node --test", tests: 937, pass: 1, fail: 1 },
|
|
181
|
-
{ command: "node --test", tests: 937, pass: 200, fail: 200 },
|
|
182
|
-
]) {
|
|
183
|
-
const reason = unrunReason(run, findings);
|
|
184
|
-
const where = `${JSON.stringify(run)} with ${findings.length} findings`;
|
|
185
|
-
assert.equal(typeof reason, "string", `a mostly-unexecuted mixed run (${where}) must yield a reason`);
|
|
186
|
-
assert.match(reason, /node --test/, "the reason no longer names the command that ran a fraction of its collection");
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// THE ACCEPT SIDE of the mixed-ratio test above: pass+fail reaching past half
|
|
192
|
-
// of tests is work done, whatever the split between the two. A finding is
|
|
193
|
-
// attached so the sibling CONJUNCTION clause (`fail > 0 && no findings`)
|
|
194
|
-
// cannot be the thing keeping this clean — only the ratio is under test here.
|
|
195
|
-
test("a mixed pass/fail run that executed past half its collection is NOT unrun", () => {
|
|
196
|
-
assert.equal(
|
|
197
|
-
unrunReason({ command: "node --test", exitCode: 1, tests: 937, pass: 300, fail: 300 }, [{ severity: "critical", claim: "x", evidence: "y" }]),
|
|
198
|
-
null,
|
|
199
|
-
"a mixed run past the half floor did its work",
|
|
200
|
-
);
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
// THE ACCEPT SIDE of the clause above, and the case a bare `pass 0` rule gets
|
|
204
|
-
// wrong: a suite where every test failed also reports zero passes, and it is the
|
|
205
|
-
// run that most needs reporting — refusing it is the over-refusal #137 removed.
|
|
206
|
-
// The `fail > 0` pin above cannot stand in for this one. Its fixture passes 11
|
|
207
|
-
// tests, so it stays clean whether the clause reads `pass === 0` or
|
|
208
|
-
// `pass === 0 && !fail`; only a fixture with BOTH zero passes and failures can
|
|
209
|
-
// tell those two apart.
|
|
210
|
-
test("a run where every test failed is NOT unrun, even though nothing passed", () => {
|
|
211
|
-
assert.equal(
|
|
212
|
-
unrunReason({ command: "npm test --", exitCode: 1, tests: 3, pass: 0, fail: 3 }, [{ severity: "critical", claim: "x", evidence: "y" }]),
|
|
213
|
-
null,
|
|
214
|
-
"a suite that reported only failures still ran",
|
|
215
|
-
);
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
// #143's third case, deferred there from the #526 review. `fail > 0` on its own
|
|
219
|
-
// is a suite that ran, pinned clean above and deliberately so; the contradiction
|
|
220
|
-
// is the CONJUNCTION with no findings — the suite ran, it reported failures,
|
|
221
|
-
// and nobody filed anything about them. #2315 widened "nobody" from one
|
|
222
|
-
// dimension to the whole review: the shared run's failures are the review's,
|
|
223
|
-
// so EVERY finding that reached the payload is read — and a refuted one does
|
|
224
|
-
// not count, because the review rejected it (an unrelated claim its verifiers
|
|
225
|
-
// threw out is not a report of the failures). Cancelled tests are failures
|
|
226
|
-
// too: node's runner exits 1 on one with `fail 0`.
|
|
227
|
-
test("a run with failing or cancelled tests and no kept finding from ANY dimension is unrun", () => {
|
|
228
|
-
const refutedOnly = [{ severity: "critical", claim: "x", evidence: "y", verdict: "refuted" }];
|
|
229
|
-
for (const findings of [[], [null], refutedOnly]) {
|
|
230
|
-
const reason = unrunReason({ command: "node --test", exitCode: 1, tests: 744, pass: 738, fail: 6 }, findings);
|
|
231
|
-
assert.equal(typeof reason, "string", `fail>0 with findings ${JSON.stringify(findings)} must yield a reason`);
|
|
232
|
-
assert.match(reason, /6 failing tests/, "the reason no longer says how many tests failed unreported");
|
|
233
|
-
assert.match(reason, /no selected dimension/);
|
|
234
|
-
}
|
|
235
|
-
const cancelled = unrunReason({ command: "node --test", exitCode: 1, tests: 744, pass: 743, fail: 0, cancelled: 1 }, refutedOnly);
|
|
236
|
-
assert.match(cancelled ?? "", /0 failing and 1 cancelled tests and no selected dimension/, "a cancelled test nobody reported must not read clean");
|
|
237
|
-
// The boundary: ONE failing test is failures nobody reported, and one kept
|
|
238
|
-
// finding settles it — a `> 1` threshold would read the first clean.
|
|
239
|
-
const one = { command: "node --test", exitCode: 1, tests: 10, pass: 9, fail: 1 };
|
|
240
|
-
assert.match(unrunReason(one, []) ?? "", /1 failing tests and no selected dimension/, "a single failing test nobody reported read clean");
|
|
241
|
-
assert.equal(unrunReason(one, [{ severity: "suggestion", claim: "x", evidence: "y", verdict: "unverified" }]), null);
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// The ACCEPT side, and #2315's ownership rule: one finding from ANY dimension
|
|
245
|
-
// satisfies the check for the whole review — the other dimensions are told not
|
|
246
|
-
// to file a duplicate, so reading each dimension's own list would mark every
|
|
247
|
-
// one of them unrun for obeying that.
|
|
248
|
-
test("a run with failing tests and a finding from ONE dimension is NOT unrun", () => {
|
|
249
|
-
const run = { command: "node --test", exitCode: 1, tests: 744, pass: 738, fail: 6 };
|
|
250
|
-
for (const verdict of [undefined, "survived", "unverified"]) {
|
|
251
|
-
const one = [{ severity: "critical", claim: "x", evidence: "y", verdict }];
|
|
252
|
-
assert.equal(unrunReason(run, one), null, `a ${verdict ?? "bare"} finding about the failures must satisfy every dimension`);
|
|
253
|
-
assert.deepEqual(unrunEntries(run, one, ["correctness", "tests", "types"]), []);
|
|
254
|
-
}
|
|
255
|
-
// A cancelled test routes the same way: one kept finding settles it.
|
|
256
|
-
assert.equal(unrunReason({ ...run, fail: 0, cancelled: 2, pass: 742 }, [{ severity: "suggestion", claim: "x", evidence: "y", verdict: "unverified" }]), null);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// `pass`/`fail` are optional, so a run that reported only a count must still
|
|
260
|
-
// come back clean rather than tripping the predicate on a field the runner
|
|
261
|
-
// never printed.
|
|
262
|
-
test("a run that reported tests but not pass/fail is NOT unrun", () => {
|
|
263
|
-
assert.equal(unrunReason({ command: "node --test", exitCode: 0, tests: 7 }, []), null, "an optional field's absence must not mark a real run unrun");
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
// The exit status is the command's own verdict, and the counts must account
|
|
267
|
-
// for it. A run reporting none, or exiting non-zero with nothing failing or
|
|
268
|
-
// cancelled, is unusable whatever its counts say — and findings cannot buy it
|
|
269
|
-
// clean, because nothing in it names a failure to report.
|
|
270
|
-
test("a run whose exit status is missing, or non-zero with no failing count, is unrun", () => {
|
|
271
|
-
const finding = [{ severity: "critical", claim: "x", evidence: "y", verdict: "survived" }];
|
|
272
|
-
for (const [run, pattern] of [
|
|
273
|
-
[{ command: "node --test", tests: 10, pass: 10, fail: 0 }, /no exit status/],
|
|
274
|
-
[{ command: "node --test", exitCode: null, tests: 10, pass: 10 }, /no exit status/],
|
|
275
|
-
[{ command: "node --test", exitCode: 1, tests: 10, pass: 10, fail: 0 }, /exited 1 but reported no failing or cancelled tests/],
|
|
276
|
-
[{ command: "node --test", exitCode: 137, tests: 10, pass: 10 }, /exited 137/],
|
|
277
|
-
]) {
|
|
278
|
-
for (const findings of [[], finding]) {
|
|
279
|
-
const reason = unrunReason(run, findings);
|
|
280
|
-
assert.equal(typeof reason, "string", `${JSON.stringify(run)} must yield a reason`);
|
|
281
|
-
assert.match(reason, pattern);
|
|
282
|
-
assert.match(reason, /node --test/, "the reason no longer names the command");
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
// #139: the description at `:37` called `scope_searched` **Required** while the
|
|
288
|
-
// `required` array omitted it, so a specialist that skipped it validated clean —
|
|
289
|
-
// reproducing the exact failure the description exists to prevent. Both halves
|
|
290
|
-
// pinned, because either one alone re-opens the ticket.
|
|
291
|
-
test("scope_searched is in the required array, not only in its own description", () => {
|
|
292
|
-
const { required } = FINDINGS_SCHEMA;
|
|
293
|
-
assert.ok(Array.isArray(required), "FINDINGS_SCHEMA no longer has a top-level required array — update this test");
|
|
294
|
-
assert.ok(required.includes("scope_searched"), "scope_searched is documented Required and is not in the required array (#139)");
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
// The review's ONE shared run is the single record of the test run: a
|
|
298
|
-
// specialist is not asked to copy it, so the payload neither requires nor
|
|
299
|
-
// declares a field for the copy. Both halves pinned together, because under
|
|
300
|
-
// `additionalProperties: false` either one re-added alone is a contract the
|
|
301
|
-
// specialist cannot meet — a required field the schema rejects, or a declared
|
|
302
|
-
// one nothing reads.
|
|
303
|
-
test("FINDINGS_SCHEMA neither requires nor declares a specialist copy of the test run", () => {
|
|
304
|
-
assert.deepEqual(
|
|
305
|
-
[...FINDINGS_SCHEMA.required].sort(),
|
|
306
|
-
["dimension", "findings", "scope_searched"],
|
|
307
|
-
"FINDINGS_SCHEMA's required list changed — a specialist must return exactly these",
|
|
308
|
-
);
|
|
309
|
-
assert.ok(!Object.hasOwn(FINDINGS_SCHEMA.properties, "test_run"), "FINDINGS_SCHEMA declares test_run again — nothing reads a specialist's copy of the shared run");
|
|
310
|
-
assert.equal(FINDINGS_SCHEMA.additionalProperties, false);
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
// The entry, not the call site. `unrunEntries` returns zero entries or one per
|
|
314
|
-
// key, so its writer `push(...)`es it with no guard of its own — and a guard is
|
|
315
|
-
// exactly what the predecessor of this test could not see: it compared the
|
|
316
|
-
// source positions of two substrings, so wrapping the recording in
|
|
317
|
-
// `if (review && why)` left both in place, kept the suite green, and silently
|
|
318
|
-
// dropped every crashed dimension.
|
|
319
|
-
test("an unrun classification becomes one entry per key, with no guard for a caller to get wrong", () => {
|
|
320
|
-
const entries = unrunEntries(null, [], ["correctness", "tests"]);
|
|
321
|
-
assert.deepEqual(entries.map((e) => e.dimension), ["correctness", "tests"], "a dead shared run must name EVERY key it was asked about");
|
|
322
|
-
for (const e of entries) assert.match(e.reason, /returned nothing/, "the entry no longer carries the classifier's reason");
|
|
323
|
-
assert.deepEqual(
|
|
324
|
-
unrunEntries({ command: "npm test --", exitCode: 0, tests: 9 }, [], ["tests"]),
|
|
325
|
-
[],
|
|
326
|
-
"a covered review must yield NO entry — an empty push is what lets the call site stay unguarded",
|
|
327
|
-
);
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
// #138's ACTUAL case, and the one its first attempt could not reach. `pipeline()`
|
|
331
|
-
// short-circuits between stages — the harness runs `if (result === null) break`
|
|
332
|
-
// before the next stage — so a reviewer that returned null never enters the verify
|
|
333
|
-
// closure, and a recording living there sees every dimension except the dead one.
|
|
334
|
-
// The pipeline's RESULT still shows it: one slot per dimension, in order, null
|
|
335
|
-
// where the chain died. This runs that derivation rather than reading it.
|
|
336
|
-
test("a dimension whose chain died is recorded unrun, by index, from the pipeline result", () => {
|
|
337
|
-
const dimensions = [{ key: "correctness" }, { key: "tests" }, { key: "types" }];
|
|
338
|
-
const unrun = unrunCrashed([[], null, []], dimensions);
|
|
339
|
-
assert.deepEqual(
|
|
340
|
-
unrun.map((u) => u.dimension),
|
|
341
|
-
["tests"],
|
|
342
|
-
"a null pipeline slot must record ITS dimension unrun, and only it (#138)",
|
|
343
|
-
);
|
|
344
|
-
assert.equal(unrun[0].reason, CRASHED_REASON, "the crashed dimension's reason no longer names a reviewer that returned nothing");
|
|
345
|
-
assert.match(CRASHED_REASON, /returned nothing/);
|
|
346
|
-
assert.deepEqual(
|
|
347
|
-
unrunCrashed([[], [], []], dimensions),
|
|
348
|
-
[],
|
|
349
|
-
"a dimension that reached the verify stage is not crashed — this must not re-refuse a clean run",
|
|
350
|
-
);
|
|
351
|
-
// An empty findings array is the SHAPE a clean dimension returns, and it is
|
|
352
|
-
// falsy nowhere; reading emptiness as death is the over-refusal #137 removed.
|
|
353
|
-
assert.deepEqual(unrunCrashed([[]], [{ key: "types" }]), [], "an empty findings list from a live dimension is not a crash");
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
// The adjacent case, which is about this derivation rather than about a reviewer:
|
|
357
|
-
// it runs after every specialist and refuter has finished, so a throw here costs
|
|
358
|
-
// the entire run's findings. A slot it cannot name must still come back named.
|
|
359
|
-
test("a null slot the dimension list cannot explain is still reported, never thrown on", () => {
|
|
360
|
-
const unrun = unrunCrashed([null], []);
|
|
361
|
-
assert.equal(unrun.length, 1, "a slot with no matching dimension must still be recorded unrun");
|
|
362
|
-
assert.match(unrun[0].dimension, /slot 0/, "an unnameable slot must say which slot it was");
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
// Wiring, not classification — and textual, because it has to be. Both writers
|
|
366
|
-
// are executable above; whether runReview calls them is pinned here. Stated
|
|
367
|
-
// ceiling: this sees a call deleted or moved, and does not see one wrapped in a
|
|
368
|
-
// guard of its own. That is why the classification moved behind lifted
|
|
369
|
-
// functions — the pin it replaced had source positions as its only evidence.
|
|
370
|
-
// runReview's own behaviour over a scripted host is review-core-shared-test-run.test.mjs's.
|
|
371
|
-
test("both writers are wired in AFTER the pipeline, the failing-tests check reading the payload's findings", () => {
|
|
372
|
-
// AFTER the pipeline returns, never inside a stage: a stage cannot observe its
|
|
373
|
-
// own absence (#138), and the failing-tests check needs every dimension's
|
|
374
|
-
// findings at once (#2315).
|
|
375
|
-
const call = CODE.indexOf("const reviewed = await pipeline(");
|
|
376
|
-
assert.notEqual(call, -1, "the pipeline call moved — update this test");
|
|
377
|
-
for (const writer of [
|
|
378
|
-
"dimensionsUnrun.push(...unrunEntries(sharedRun, all, live))",
|
|
379
|
-
"dimensionsUnrun.push(...unrunCrashed(reviewed, dimensions))",
|
|
380
|
-
]) {
|
|
381
|
-
const at = CODE.indexOf(writer);
|
|
382
|
-
assert.notEqual(at, -1, `\`${writer}\` is gone — a half of dimensionsUnrun is unreachable again`);
|
|
383
|
-
assert.ok(call < at, `\`${writer}\` runs before the pipeline returns, where its input does not exist yet`);
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
|
|
387
|
-
test("the returned object carries dimensionsUnrun alongside dimensionsRun", () => {
|
|
388
|
-
assert.match(CODE, /const dimensionsUnrun = \[\]/, "dimensionsUnrun is never declared — the return would throw");
|
|
389
|
-
const at = CODE.lastIndexOf("return {");
|
|
390
|
-
assert.notEqual(at, -1, "review-core.mjs no longer ends in a return literal — update this test");
|
|
391
|
-
const tail = CODE.slice(at);
|
|
392
|
-
// BOTH, adjacent. `dimensionsRun` keeps its meaning and its value — the
|
|
393
|
-
// dispatched set after the size trim — because a consumer diffing it against
|
|
394
|
-
// DEFAULT_DIMENSIONS to spot a trim would otherwise read a crashed dimension
|
|
395
|
-
// as a trimmed one: the same conflation this ticket set closes, one field over.
|
|
396
|
-
// The new list is what subtracts from it, which only works if it ships too.
|
|
397
|
-
assert.match(tail, /dimensionsRun: dimensions\.map\(\(d\) => d\.key\)/, "dimensionsRun no longer reports the dispatched set");
|
|
398
|
-
assert.match(tail, /dimensionsUnrun/, "the return never surfaces dimensionsUnrun — the classification dies in the script (#137, #138)");
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
// The note hands every specialist the shared run and tells it not to run the
|
|
402
|
-
// full command itself — and nothing more about the run: the shared run is the
|
|
403
|
-
// single record of it, so no specialist is told to report or copy it anywhere.
|
|
404
|
-
// Every rendering the note has is checked — usable, each reason a run is NOT
|
|
405
|
-
// usable (each reason's own text is interpolated into that paragraph), and
|
|
406
|
-
// failing or cancelled tests for the owner and for a non-owner — because each
|
|
407
|
-
// appends a different paragraph to the same opening one.
|
|
408
|
-
//
|
|
409
|
-
// The no-copy check reads the whole note with its line wrapping flattened, so
|
|
410
|
-
// a request appended after the opening paragraph, or one the hard wrap splits
|
|
411
|
-
// across two lines, is still one sentence to it. It is a bounded word list, not
|
|
412
|
-
// a proof: a request worded with a verb or noun outside the lists passes it.
|
|
413
|
-
// COPY_REQUEST matches three shapes: a copy verb followed within a few words
|
|
414
|
-
// by the run, its counts, its log or its result; a copy verb followed in the
|
|
415
|
-
// same sentence by a destination in the specialist's own output ("in your
|
|
416
|
-
// result", "to the payload"); and the run, counts or log said to "must be"
|
|
417
|
-
// reported, returned, included and the like. The verbs are whole words, so
|
|
418
|
-
// inflected ones never match as written — and must not be widened to
|
|
419
|
-
// inflections, because the "no exit status" rendering's own "reported counts
|
|
420
|
-
// but no exit status" would then match. The word window is what keeps the
|
|
421
|
-
// opening paragraph's "your own copy of the snapshot are still yours to run"
|
|
422
|
-
// green: it uses `copy` as a noun and ends on `run` in the same sentence.
|
|
423
|
-
// Every rendering below must pass it. The run-is-null reason ("returned
|
|
424
|
-
// nothing") is not rendered here: sharedRunNote dereferences run.command, and
|
|
425
|
-
// that text reaches a note only as the "(the test-run agent returned nothing)"
|
|
426
|
-
// error suffix runReview sets.
|
|
427
|
-
const COPY_VERB = "report|copy|echo|record|return|repeat|restate|include|paste|attach|quote|put|add|list";
|
|
428
|
-
const COPY_OBJECT = "run|counts?|logs?|results?";
|
|
429
|
-
const COPY_REQUEST = new RegExp(
|
|
430
|
-
[
|
|
431
|
-
String.raw`\b(?:${COPY_VERB})\b(?:\s+[^\s.]+){0,4}?\s+(?:${COPY_OBJECT})\b`,
|
|
432
|
-
String.raw`\b(?:${COPY_VERB})\b[^.]*\b(?:in|to|into)\s+(?:your|the)\s+(?:\w+\s+)?(?:result|payload|scope_searched|summary|findings?)\b`,
|
|
433
|
-
String.raw`\b(?:${COPY_OBJECT})\b(?:\s+[^\s.]+){0,3}?\s+(?:must|should|shall)\s+be\s+(?:report|return|includ|record|cop|attach|quot|past|echo|list|add|put)\w*`,
|
|
434
|
-
].join("|"),
|
|
435
|
-
"i",
|
|
436
|
-
);
|
|
437
|
-
test("the shared-run note hands over the run and forbids a rerun, and asks for no copy of it in any rendering", () => {
|
|
438
|
-
const base = { command: "node --test", logPath: "/r/test-run.log" };
|
|
439
|
-
const usable = { ...base, exitCode: 0, tests: 5, pass: 5, fail: 0 };
|
|
440
|
-
const failing = { ...base, exitCode: 1, tests: 5, pass: 3, fail: 2 };
|
|
441
|
-
const cancelled = { ...base, exitCode: 1, tests: 5, pass: 4, fail: 0, cancelled: 1 };
|
|
442
|
-
const unusable = (why) => new RegExp(`This run is NOT usable: \`node --test\` ${why}`);
|
|
443
|
-
for (const [name, run, key, paragraph] of [
|
|
444
|
-
["usable", usable, "tests", null],
|
|
445
|
-
["no counts", { ...base, error: "no summary" }, "tests", unusable("produced no counts")],
|
|
446
|
-
["0 tests", { ...base, exitCode: 0, tests: 0, pass: 0, fail: 0 }, "tests", unusable("produced 0 tests")],
|
|
447
|
-
["every test skipped", { ...base, exitCode: 0, tests: 5, pass: 0, fail: 0 }, "tests", unusable("passed nothing and failed nothing")],
|
|
448
|
-
["most never ran", { ...base, exitCode: 0, tests: 10, pass: 2, fail: 0 }, "tests", unusable("passed 2 and failed 0 of the 10")],
|
|
449
|
-
["no exit status", { ...base, tests: 5, pass: 5, fail: 0 }, "tests", unusable("reported counts but no exit status")],
|
|
450
|
-
["non-zero exit, nothing failing", { ...base, exitCode: 1, tests: 5, pass: 5, fail: 0 }, "tests", unusable("exited 1 but reported no failing")],
|
|
451
|
-
["failing, owner", failing, "correctness", /filing them is YOUR job in this review/],
|
|
452
|
-
["failing, non-owner", failing, "tests", /the correctness dimension files the finding/],
|
|
453
|
-
["cancelled, owner", cancelled, "correctness", /cancelled tests, and filing them is YOUR job/],
|
|
454
|
-
["cancelled, non-owner", cancelled, "tests", /cancelled tests, and the correctness dimension files/],
|
|
455
|
-
]) {
|
|
456
|
-
const note = sharedRunNote(run, "correctness", key);
|
|
457
|
-
assert.doesNotMatch(note, /test_run/, `${name}: the note still names test_run`);
|
|
458
|
-
assert.match(note, /Do NOT run that full command yourself/, `${name}: the note no longer forbids a rerun`);
|
|
459
|
-
assert.match(note, /\n {2}command: node --test\n/, `${name}: the note lacks the command line`);
|
|
460
|
-
assert.match(note, /\n {2}counts: {2}\S/, `${name}: the note lacks the counts line`);
|
|
461
|
-
assert.match(note, /\n {2}exit: {4}\S/, `${name}: the note lacks the exit line`);
|
|
462
|
-
assert.match(note, /\n {2}log: {5}\/r\/test-run\.log\n/, `${name}: the note lacks the log line`);
|
|
463
|
-
// The opening paragraph ends on the log instruction: nothing after it
|
|
464
|
-
// asks the specialist to report the run.
|
|
465
|
-
const first = note.split(/\n(?=This run is NOT usable|It has )/)[0];
|
|
466
|
-
assert.match(first, /Read the log for anything the counts do not say\.$/, `${name}: the opening paragraph says more after the log instruction`);
|
|
467
|
-
// ...and no paragraph this rendering appends asks for one either.
|
|
468
|
-
assert.doesNotMatch(note.replace(/\s+/g, " "), COPY_REQUEST, `${name}: the note asks the specialist to report or copy the run`);
|
|
469
|
-
if (paragraph) assert.match(note, paragraph, `${name}: the paragraph this rendering appends is missing`);
|
|
470
|
-
}
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
// The workflow's return shape is documented in one place a controller actually
|
|
474
|
-
// reads, and this repo's recurring defect is a second copy disconnecting in one
|
|
475
|
-
// token. A `dimensionsUnrun` nobody is told to read is a field nobody reads.
|
|
476
|
-
test("run-team's Reviewers section documents dimensionsUnrun, not only dimensionsRun", () => {
|
|
477
|
-
const doc = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
478
|
-
assert.match(doc, /dimensionsUnrun/, "run-team/SKILL.md still documents a return shape without dimensionsUnrun");
|
|
479
|
-
// The superseded workaround must be GONE, not merely accompanied. It reads
|
|
480
|
-
// every zero-finding dimension as unrun — including one that ran clean — so
|
|
481
|
-
// leaving it in place next to the real field teaches the opposite rule.
|
|
482
|
-
assert.doesNotMatch(
|
|
483
|
-
doc,
|
|
484
|
-
/a dimension listed\s+in `dimensionsRun` with nothing in `survived`\/`refuted`\/`unverified` is \*\*unrun,\s+not clean\*\*/,
|
|
485
|
-
"run-team/SKILL.md still states the pre-#137 workaround, which marks a clean dimension unrun",
|
|
486
|
-
);
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
// What the absence of an unrun classification ESTABLISHES is that a suite ran —
|
|
490
|
-
// never that the dimension is covered. `unrunReason` above reads the shared
|
|
491
|
-
// run's counts and quotes its `command` into its message; it never judges what
|
|
492
|
-
// that command covers, so a narrower runner reports a non-zero count, is not
|
|
493
|
-
// classified unrun, and reads as covered having validated a fraction of the
|
|
494
|
-
// suite. Comparing that command against the dispatched one was refuted 2-0 and
|
|
495
|
-
// stays refuted (#535) — the doc claiming only what the classifier can see is
|
|
496
|
-
// the remedy, and nothing pinned the word it turns on.
|
|
497
|
-
//
|
|
498
|
-
// The positive pin carries the claim: sliced to the paragraph so a failure
|
|
499
|
-
// prints it rather than the whole 2000-line doc, matched through `phrase` so a
|
|
500
|
-
// reflow of the hard wrap cannot fire it, and run out to the sentence's `;` so
|
|
501
|
-
// the clause has to END there. That terminator is what catches the likelier
|
|
502
|
-
// regression — an editor softening rather than reverting, `ran a suite AND IS
|
|
503
|
-
// THEREFORE COVERED` — which a pin on the anchor alone reads as still present.
|
|
504
|
-
// The exclusion then has nothing left to guess at, so it stays whole-doc and
|
|
505
|
-
// case-insensitive: the retracted claim is caught wherever in the file it comes
|
|
506
|
-
// back, and in the lowercase paraphrase a `phrase` pin on `NOT` walks past.
|
|
507
|
-
// Measured both ways — each form reds, and a reflow, a `; every` → `; each`
|
|
508
|
-
// reword, and a correctly negated coverage sentence in the paragraph stay green.
|
|
509
|
-
test("run-team claims a suite RAN from a key's absence from dimensionsUnrun, never that it is covered", () => {
|
|
510
|
-
const doc = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
511
|
-
const para = between(doc, "**`dimensionsRun` is the dispatch", "The rule this replaces", "run-team/SKILL.md");
|
|
512
|
-
assert.match(
|
|
513
|
-
para,
|
|
514
|
-
phrase("and NOT in `dimensionsUnrun` ran a suite;"),
|
|
515
|
-
"run-team/SKILL.md no longer says a key absent from dimensionsUnrun ran a suite, full stop",
|
|
516
|
-
);
|
|
517
|
-
assert.doesNotMatch(
|
|
518
|
-
doc,
|
|
519
|
-
/in\s+`dimensionsUnrun`\s+is\s+covered/i,
|
|
520
|
-
"run-team/SKILL.md reads a key's absence from dimensionsUnrun as coverage — the classifier never checked the command that ran",
|
|
521
|
-
);
|
|
522
|
-
});
|
|
523
|
-
|
|
524
|
-
// The same claim on the OTHER surface, and the half nothing was watching. The
|
|
525
|
-
// pin above reads run-team/SKILL.md only, so when #535 corrected the doc, the
|
|
526
|
-
// classifier's own comment kept asserting the retracted equivalence — "a key in
|
|
527
|
-
// the first and not the second is the only thing that means covered" — and this
|
|
528
|
-
// suite stayed green on it (#1143). Source is where a reader arrives BEFORE the
|
|
529
|
-
// doc, so it is the copy that gets to mislead first.
|
|
530
|
-
//
|
|
531
|
-
// Reads SOURCE, not CODE — inverting this file's header rule, for that rule's
|
|
532
|
-
// own reason. `stripComments` exists so that no pin can be satisfied by
|
|
533
|
-
// commented-out text; here the comment IS the subject, and CODE has it stripped
|
|
534
|
-
// to nothing, which would make this pin unsatisfiable rather than vacuous.
|
|
535
|
-
//
|
|
536
|
-
// `stripSlashGutter` first, and it buys BOTH halves: the clause wraps
|
|
537
|
-
// mid-sentence at a `// ` that `phrase`'s `\s+` cannot span, and the block's
|
|
538
|
-
// bare `//` separator line becomes a real blank line — which is what lets the
|
|
539
|
-
// SHARED `paragraph` bound apply here instead of a local copy of
|
|
540
|
-
// quiet-payload-prose.test.mjs's comment-block-above slicer, `paragraph`'s own
|
|
541
|
-
// doc-comment being where this repo says a local copy is the defect, not a
|
|
542
|
-
// style choice. Slice and anchor are then the sibling pin's exactly:
|
|
543
|
-
// `anchorAt`'s exactly-once guarantee, and an end bound at the paragraph rather
|
|
544
|
-
// than one running past the block into the `return` below it.
|
|
545
|
-
//
|
|
546
|
-
// The positive pin runs out through `(#535).` for the SKILL.md pin's reason —
|
|
547
|
-
// the likelier regression is an editor softening rather than reverting, and a
|
|
548
|
-
// pin stopping at `ran a suite` reads `ran a suite and is therefore covered` as
|
|
549
|
-
// still present. The exclusion is whole-file and case-insensitive so the
|
|
550
|
-
// retracted wording is caught wherever it comes back, and it targets `only
|
|
551
|
-
// thing that means covered` rather than `covered` alone so the paragraph's own
|
|
552
|
-
// correct denials — which must keep saying the word — stay green.
|
|
553
|
-
test("review-core.mjs's own comment claims a suite RAN from a key's absence from dimensionsUnrun, never that it is covered", () => {
|
|
554
|
-
const prose = stripSlashGutter(SOURCE);
|
|
555
|
-
const para = paragraph(prose, "`dimensionsRun` names what was DISPATCHED", "review-core.mjs");
|
|
556
|
-
assert.match(
|
|
557
|
-
para,
|
|
558
|
-
phrase("A key in the first and NOT in the second ran a suite — not that it is covered (#535)."),
|
|
559
|
-
"review-core.mjs's dimensionsRun/dimensionsUnrun comment no longer says a key absent from dimensionsUnrun ran a suite, full stop",
|
|
560
|
-
);
|
|
561
|
-
assert.doesNotMatch(
|
|
562
|
-
prose,
|
|
563
|
-
/only\s+thing\s+that\s+means\s+covered/i,
|
|
564
|
-
"review-core.mjs is back to reading a key's absence from dimensionsUnrun as coverage — `unrunReason` never compares `run.command` against the command the dispatch handed out (#535)",
|
|
565
|
-
);
|
|
566
|
-
});
|