@feigi/fleet-ctl 0.0.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/.claude-plugin/plugin.json +9 -0
- package/LICENSE +202 -0
- package/NOTICE +18 -0
- package/agents/fleet-finisher.agent.md +7 -0
- package/agents/fleet-implementer-alt.agent.md +210 -0
- package/agents/fleet-implementer.agent.md +210 -0
- package/agents/fleet-merge-bot.agent.md +7 -0
- package/agents/fleet-review-comments.agent.md +40 -0
- package/agents/fleet-review-correctness.agent.md +43 -0
- package/agents/fleet-review-runner.agent.md +73 -0
- package/agents/fleet-review-silent-failure.agent.md +49 -0
- package/agents/fleet-review-simplify.agent.md +46 -0
- package/agents/fleet-review-snapshot.agent.md +24 -0
- package/agents/fleet-review-tests.agent.md +46 -0
- package/agents/fleet-review-types.agent.md +41 -0
- package/agents/fleet-review-verifier.agent.md +29 -0
- package/commands/review-and-fix.md +98 -0
- package/commands/run-merge-bot.md +357 -0
- package/commands/run-team-help.md +17 -0
- package/package.json +23 -0
- package/scripts/agent-test-dir-prose.test.mjs +59 -0
- package/scripts/agent-test.test.mjs +1636 -0
- package/scripts/ambient-git-vars-mjs-prose.test.mjs +354 -0
- package/scripts/ambient-git-vars-prose.test.mjs +192 -0
- package/scripts/ancestry-check-position-prose.test.mjs +175 -0
- package/scripts/apply-ruleset.test.mjs +420 -0
- package/scripts/arg-header-probes-prose.test.mjs +393 -0
- package/scripts/arg.mjs +600 -0
- package/scripts/arg.test.mjs +1354 -0
- package/scripts/board-cli.test.mjs +694 -0
- package/scripts/board-identity.test.mjs +429 -0
- package/scripts/board-liveness-banner.test.mjs +119 -0
- package/scripts/board-prev-shape.test.mjs +229 -0
- package/scripts/board-tryparse-null.test.mjs +119 -0
- package/scripts/board.html +471 -0
- package/scripts/board.mjs +2037 -0
- package/scripts/board.test.mjs +3086 -0
- package/scripts/brief-after-cut-prose.test.mjs +53 -0
- package/scripts/candidates-exit3-prose.test.mjs +302 -0
- package/scripts/candidates.mjs +674 -0
- package/scripts/candidates.test.mjs +2101 -0
- package/scripts/caveat-unification-prose.test.mjs +98 -0
- package/scripts/ci-comment-rot-prose.test.mjs +2025 -0
- package/scripts/ci-completes-premise-prose.test.mjs +257 -0
- package/scripts/ci-state-prose.test.mjs +113 -0
- package/scripts/ci-state.mjs +761 -0
- package/scripts/ci-state.test.mjs +1640 -0
- package/scripts/ci-vacuous-green.test.mjs +368 -0
- package/scripts/citation-sweep-prose.test.mjs +1572 -0
- package/scripts/claim-lifecycle.test.mjs +185 -0
- package/scripts/claim-ticket.sh +417 -0
- package/scripts/claim-ticket.test.mjs +1121 -0
- package/scripts/closing-keyword-prose.test.mjs +193 -0
- package/scripts/cockpit-launch-idempotent-prose.test.mjs +165 -0
- package/scripts/cockpit-tick-nonblocking.test.mjs +210 -0
- package/scripts/compute-board.mjs +579 -0
- package/scripts/compute-board.test.mjs +1060 -0
- package/scripts/compute-spend.mjs +329 -0
- package/scripts/compute-spend.test.mjs +451 -0
- package/scripts/cross-repo-citation-prose.test.mjs +156 -0
- package/scripts/cwd-isolation-pins.mjs +83 -0
- package/scripts/dedupe-guard-prose.test.mjs +243 -0
- package/scripts/derive-testcmd.sh +239 -0
- package/scripts/derive-testcmd.test.mjs +380 -0
- package/scripts/diff-stats.mjs +231 -0
- package/scripts/diff-stats.test.mjs +408 -0
- package/scripts/dispatch-block-golden-prose.test.mjs +1024 -0
- package/scripts/dispatch-block-pins-prose.test.mjs +615 -0
- package/scripts/drop-merged-label.sh +173 -0
- package/scripts/drop-merged-label.test.mjs +480 -0
- package/scripts/expected-jobs-prose.test.mjs +80 -0
- package/scripts/filing-bar-seat-prose.test.mjs +242 -0
- package/scripts/filing-claim-bar-prose.test.mjs +166 -0
- package/scripts/finisher-dispatch-premise-prose.test.mjs +312 -0
- package/scripts/finisher-halt-prose.test.mjs +106 -0
- package/scripts/finisher-name-prose.test.mjs +134 -0
- package/scripts/finisher-own-tree-prose.test.mjs +285 -0
- package/scripts/finisher-pin-race-prose.test.mjs +339 -0
- package/scripts/fix-applier-correction-rules-prose.test.mjs +201 -0
- package/scripts/fix-applier-result-file-prose.test.mjs +100 -0
- package/scripts/fleet-bootstrap +155 -0
- package/scripts/fleet-heartbeat.mjs +272 -0
- package/scripts/fleet-heartbeat.test.mjs +450 -0
- package/scripts/fleet-provenance +207 -0
- package/scripts/fleet-provenance.test.mjs +64 -0
- package/scripts/fleet-run +148 -0
- package/scripts/fleet-run.test.mjs +90 -0
- package/scripts/fleet-state.mjs +400 -0
- package/scripts/fleet-state.test.mjs +373 -0
- package/scripts/fleet-tick-prose.test.mjs +299 -0
- package/scripts/fleet-tick.mjs +832 -0
- package/scripts/fleet-tick.test.mjs +1332 -0
- package/scripts/force-with-lease-reason-prose.test.mjs +184 -0
- package/scripts/frontmatter-allowlist.json +64 -0
- package/scripts/frontmatter-check.mjs +256 -0
- package/scripts/frontmatter-check.test.mjs +436 -0
- package/scripts/git-env.mjs +124 -0
- package/scripts/git-env.test.mjs +149 -0
- package/scripts/git-status-untracked-mode-sweep.test.mjs +216 -0
- package/scripts/gone-walk.test.mjs +213 -0
- package/scripts/gp-sep-invariant-prose.test.mjs +188 -0
- package/scripts/head-moved-after-label-prose.test.mjs +233 -0
- package/scripts/immutable-body-claim-prose.test.mjs +413 -0
- package/scripts/implementer-model-tier.test.mjs +643 -0
- package/scripts/inflight-citation-prose.test.mjs +144 -0
- package/scripts/inflight-exit2-prose.test.mjs +81 -0
- package/scripts/inflight-probe-guard-prose.test.mjs +109 -0
- package/scripts/inflight-scan-scope-prose.test.mjs +57 -0
- package/scripts/inflight.sh +1106 -0
- package/scripts/inflight.test.mjs +2984 -0
- package/scripts/injection-control-prose.test.mjs +404 -0
- package/scripts/install-root-audit.test.mjs +464 -0
- package/scripts/instrument-check-prose.test.mjs +235 -0
- package/scripts/instruments.sh +394 -0
- package/scripts/instruments.test.mjs +787 -0
- package/scripts/issue-tracker-prose.test.mjs +71 -0
- package/scripts/json.sh +248 -0
- package/scripts/json.test.mjs +364 -0
- package/scripts/ledger-dispatch.test.mjs +516 -0
- package/scripts/ledger-grammar.mjs +85 -0
- package/scripts/ledger-grammar.test.mjs +142 -0
- package/scripts/ledger-read-require-file.test.mjs +197 -0
- package/scripts/ledger.mjs +1753 -0
- package/scripts/ledger.test.mjs +3554 -0
- package/scripts/line-distance-prose.test.mjs +245 -0
- package/scripts/liveness-rationale-prose.test.mjs +83 -0
- package/scripts/locale-pin-prose.test.mjs +189 -0
- package/scripts/member-outcome-prose.test.mjs +167 -0
- package/scripts/member-outcomes-header.test.mjs +148 -0
- package/scripts/member-outcomes-prose.test.mjs +63 -0
- package/scripts/member-outcomes.mjs +231 -0
- package/scripts/member-outcomes.test.mjs +507 -0
- package/scripts/member-prompt-prose.test.mjs +161 -0
- package/scripts/member-record.mjs +605 -0
- package/scripts/member-record.test.mjs +516 -0
- package/scripts/member-write-guard.mjs +279 -0
- package/scripts/member-write-guard.test.mjs +211 -0
- package/scripts/merge-commit-probe-prose.test.mjs +122 -0
- package/scripts/merge-gate.mjs +262 -0
- package/scripts/merge-gate.test.mjs +613 -0
- package/scripts/muted-git-guard-sweep.test.mjs +493 -0
- package/scripts/net-ssh-precedence-prose.test.mjs +91 -0
- package/scripts/net-watchdog-prose.test.mjs +79 -0
- package/scripts/net.sh +409 -0
- package/scripts/net.test.mjs +211 -0
- package/scripts/no-ci-gate-prose.test.mjs +108 -0
- package/scripts/no-undo-audit.sh +1134 -0
- package/scripts/no-undo-audit.test.mjs +3965 -0
- package/scripts/no-wave.test.mjs +138 -0
- package/scripts/node-floor-sweep.test.mjs +611 -0
- package/scripts/pointer-target-prose.test.mjs +186 -0
- package/scripts/pr-overlap.mjs +417 -0
- package/scripts/pr-overlap.test.mjs +695 -0
- package/scripts/printf-die-sweep.test.mjs +384 -0
- package/scripts/prompt-renderer.mjs +39 -0
- package/scripts/prompt-renderer.test.mjs +68 -0
- package/scripts/prose-pin.mjs +808 -0
- package/scripts/prose-pin.test.mjs +1034 -0
- package/scripts/prove-merge.sh +228 -0
- package/scripts/prove-merge.test.mjs +995 -0
- package/scripts/pull-table-relabel-prose.test.mjs +60 -0
- package/scripts/quiet-payload-prose.test.mjs +222 -0
- package/scripts/reap.sh +1768 -0
- package/scripts/reap.test.mjs +4395 -0
- package/scripts/reaping-prose.test.mjs +159 -0
- package/scripts/refuter-scratch-prose.test.mjs +135 -0
- package/scripts/release-label-required-prose.test.mjs +71 -0
- package/scripts/release-label-split-prose.test.mjs +169 -0
- package/scripts/release-ticket.sh +1716 -0
- package/scripts/release-ticket.test.mjs +5106 -0
- package/scripts/renovate-release-contract.test.mjs +379 -0
- package/scripts/repo-root.mjs +544 -0
- package/scripts/repo-root.test.mjs +873 -0
- package/scripts/reporter-output-rule-prose.test.mjs +208 -0
- package/scripts/review-agent-report-only.test.mjs +49 -0
- package/scripts/review-core-cwd-isolation.test.mjs +374 -0
- package/scripts/review-core-reads.test.mjs +478 -0
- package/scripts/review-core-refuter-scratch.test.mjs +148 -0
- package/scripts/review-core-snapshot-path.test.mjs +777 -0
- package/scripts/review-core-specialist-scratch.test.mjs +189 -0
- package/scripts/review-core-testcmd.test.mjs +288 -0
- package/scripts/review-core-unrun.test.mjs +530 -0
- package/scripts/review-core-unverified-discriminant.test.mjs +208 -0
- package/scripts/review-core.mjs +1028 -0
- package/scripts/review-eval-resolver-path.test.mjs +55 -0
- package/scripts/review-eval.mjs +197 -0
- package/scripts/review-host-fixture.mjs +73 -0
- package/scripts/review-in-run-retry.test.mjs +187 -0
- package/scripts/review-no-vendor-dispatch.test.mjs +45 -0
- package/scripts/review-path-default.test.mjs +796 -0
- package/scripts/review-runner-spawns.test.mjs +93 -0
- package/scripts/review-runner.test.mjs +155 -0
- package/scripts/review-tier-audit.test.mjs +140 -0
- package/scripts/run-artifact-pr-prose.test.mjs +341 -0
- package/scripts/run-merge-bot-prose.test.mjs +1391 -0
- package/scripts/scratch-partition-invariant-prose.test.mjs +74 -0
- package/scripts/scripts-path-citation-sweep.test.mjs +73 -0
- package/scripts/section-between-guard-prose.test.mjs +378 -0
- package/scripts/select-dimensions.test.mjs +674 -0
- package/scripts/shared-refusal.test.mjs +388 -0
- package/scripts/shell-traps-prose.test.mjs +507 -0
- package/scripts/shortlist.mjs +355 -0
- package/scripts/shortlist.test.mjs +366 -0
- package/scripts/slow-transport.mjs +72 -0
- package/scripts/snapshot-repo.test.mjs +772 -0
- package/scripts/snapshot-runner-audience-prose.test.mjs +129 -0
- package/scripts/spend-view.test.mjs +312 -0
- package/scripts/staleness-qualifier-prose.test.mjs +251 -0
- package/scripts/staleness-verdict-prose.test.mjs +142 -0
- package/scripts/staleness.mjs +414 -0
- package/scripts/staleness.test.mjs +893 -0
- package/scripts/stalled-member-liveness-prose.test.mjs +219 -0
- package/scripts/stash-prohibition-prose.test.mjs +313 -0
- package/scripts/strip-comments.mjs +44 -0
- package/scripts/tier-check.mjs +468 -0
- package/scripts/tier-check.test.mjs +726 -0
- package/scripts/tier-guard-gate-prose.test.mjs +216 -0
- package/scripts/tier-outcomes-header.test.mjs +586 -0
- package/scripts/tier-outcomes.mjs +441 -0
- package/scripts/tier-outcomes.test.mjs +342 -0
- package/scripts/tier-roles.mjs +250 -0
- package/scripts/tier-roles.test.mjs +316 -0
- package/scripts/tracker-block-copy-prose.test.mjs +288 -0
- package/scripts/triage-labels-gloss-prose.test.mjs +97 -0
- package/scripts/unattended-git-sweep.test.mjs +142 -0
- package/scripts/verify-sha-exit2-prose.test.mjs +269 -0
- package/scripts/verify-sha.sh +117 -0
- package/scripts/verify-sha.test.mjs +693 -0
- package/scripts/watcher-degraded-block.test.mjs +372 -0
- package/scripts/watcher-key-prose.test.mjs +106 -0
- package/scripts/within-run-pair-prose.test.mjs +208 -0
- package/scripts/worktree-audit.sh +482 -0
- package/scripts/worktree-audit.test.mjs +1407 -0
- package/scripts/worktree-head-prose.test.mjs +276 -0
- package/scripts/worktree-listing-sweep.test.mjs +217 -0
- package/scripts/worktree-model-prose.test.mjs +216 -0
- package/scripts/worktree.sh +470 -0
- package/skills/next-ticket/SKILL.md +138 -0
- package/skills/run-team/SKILL.md +3603 -0
- package/skills/run-team/references/ci-and-staleness.md +75 -0
- package/skills/run-team/references/correction-tickets.md +37 -0
- package/skills/run-team/references/isolation.md +23 -0
- package/skills/run-team/references/member-lifecycle.md +73 -0
- package/skills/run-team/references/reaping.md +73 -0
- package/skills/sizing-a-ticket/SKILL.md +39 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// #1856, ruled on #1821 (map #1768). The map's standing rule is that the word
|
|
2
|
+
// "wave" is gone: the fleet loop has no waves (ADR 0012), and a word that
|
|
3
|
+
// survives in a comment, a notice or a fixture name keeps teaching the unit
|
|
4
|
+
// that was retired. #1821 measured 58 lines in 37 files still carrying it after
|
|
5
|
+
// the prose tree was clean, and the sweep that emptied that list is only as
|
|
6
|
+
// durable as whatever notices the next one. This file is what notices.
|
|
7
|
+
//
|
|
8
|
+
// SCOPE is every tracked file except the records, which are kept as written:
|
|
9
|
+
// `docs/adr/`, `docs/specs/`, `docs/research/` and `docs/metrics/`, matched as
|
|
10
|
+
// path PREFIXES from the repo root, so a lookalike directory elsewhere
|
|
11
|
+
// (`docs/adrs/`, `plugin/docs/adr/`) is live text and swept. New ADRs and
|
|
12
|
+
// dated specs land under those prefixes, so writing history stays free.
|
|
13
|
+
//
|
|
14
|
+
// EXEMPTIONS are exactly two, and nothing else is one: `CONTEXT.md` lines that
|
|
15
|
+
// START with `_Avoid_:` (the glossary names the word in order to retire it),
|
|
16
|
+
// and this file, which has to spell the word to look for it. Neither widens
|
|
17
|
+
// to its neighbours — an `_Avoid_:` line in any other file, an indented one,
|
|
18
|
+
// or a CONTEXT.md body line is still a hit.
|
|
19
|
+
//
|
|
20
|
+
// The PATTERN is #1821's, case-insensitive: `\bwav(e|es|ed|ing)\b`. The
|
|
21
|
+
// boundaries are what keep `microwave`, `wavelength` and `waveform` out; the
|
|
22
|
+
// suffix list is what keeps `waves`, `waved` and `waving` in. A tracked file
|
|
23
|
+
// NAME is matched too, because every path that cites such a file repeats the
|
|
24
|
+
// word; it is reported without a line number.
|
|
25
|
+
//
|
|
26
|
+
// repo-root.mjs's `trackedPaths`, never a directory walk, for the reason
|
|
27
|
+
// scripts-path-citation-sweep.test.mjs states: an untracked scratch file must
|
|
28
|
+
// never become a false positive. It is the one discovery every sweep here
|
|
29
|
+
// shares, for the reasons repo-root.mjs's `trackedFiles` states: `-z`, since
|
|
30
|
+
// git C-quotes an unusual path in its default form; a scrubbed env, since an
|
|
31
|
+
// ambient GIT_DIR silently answers for another repository; and no path the
|
|
32
|
+
// working tree holds no file at, since reading one aborted the whole sweep
|
|
33
|
+
// (#1910).
|
|
34
|
+
//
|
|
35
|
+
// KNOWN LIMIT, same as those siblings: needs an ambient `.git` to ask what is
|
|
36
|
+
// tracked. Absent one the tree sweep DECLINES with a reason; the scanner's own
|
|
37
|
+
// tests below still run.
|
|
38
|
+
//
|
|
39
|
+
// Zero deps: `node --test plugin/scripts/no-wave.test.mjs`.
|
|
40
|
+
|
|
41
|
+
import { test } from "node:test";
|
|
42
|
+
import assert from "node:assert/strict";
|
|
43
|
+
import { readFileSync } from "node:fs";
|
|
44
|
+
import { join } from "node:path";
|
|
45
|
+
import { fileURLToPath } from "node:url";
|
|
46
|
+
import { repoRoot, skipWithoutRepo, trackedPaths } from "./repo-root.mjs";
|
|
47
|
+
|
|
48
|
+
const DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
49
|
+
const ROOT = repoRoot(DIR);
|
|
50
|
+
const SKIP_WITHOUT_REPO = skipWithoutRepo(ROOT, "the no-wave sweep over the tracked tree");
|
|
51
|
+
|
|
52
|
+
const WAVE = /\bwav(?:e|es|ed|ing)\b/i;
|
|
53
|
+
const RECORDS = ["docs/adr/", "docs/specs/", "docs/research/", "docs/metrics/"];
|
|
54
|
+
// Hardcoded rather than derived: if this file moves, the exemption goes stale
|
|
55
|
+
// and the sweep reds on this file's own spelling of the word — loudly, and in
|
|
56
|
+
// the direction that gets it fixed.
|
|
57
|
+
const SELF = "plugin/scripts/no-wave.test.mjs";
|
|
58
|
+
const GLOSSARY = "CONTEXT.md";
|
|
59
|
+
const AVOID = "_Avoid_:";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Every hit in one tracked file, as `path:line: text` (or `path: file name`
|
|
63
|
+
* for the name itself). Empty for a record or for this file.
|
|
64
|
+
*/
|
|
65
|
+
function waveHits(path, text) {
|
|
66
|
+
if (path === SELF || RECORDS.some((prefix) => path.startsWith(prefix))) return [];
|
|
67
|
+
const hits = [];
|
|
68
|
+
if (WAVE.test(path)) hits.push(`${path}: file name`);
|
|
69
|
+
text.split("\n").forEach((line, i) => {
|
|
70
|
+
if (!WAVE.test(line)) return;
|
|
71
|
+
if (path === GLOSSARY && line.startsWith(AVOID)) return;
|
|
72
|
+
hits.push(`${path}:${i + 1}: ${line.trim()}`);
|
|
73
|
+
});
|
|
74
|
+
return hits;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
test("scanner: every word form, in any case, is a hit named by file:line", () => {
|
|
78
|
+
const text = ["clean line", "Wave one", "a per-wave rate", "two waves", "waved it on", "waving", "merge-bot-<WAVE#>"].join("\n");
|
|
79
|
+
assert.deepEqual(waveHits("plugin/x.md", text), [
|
|
80
|
+
"plugin/x.md:2: Wave one",
|
|
81
|
+
"plugin/x.md:3: a per-wave rate",
|
|
82
|
+
"plugin/x.md:4: two waves",
|
|
83
|
+
"plugin/x.md:5: waved it on",
|
|
84
|
+
"plugin/x.md:6: waving",
|
|
85
|
+
"plugin/x.md:7: merge-bot-<WAVE#>",
|
|
86
|
+
]);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("scanner: a word that merely contains the letters is not a hit", () => {
|
|
90
|
+
// The ACCEPT half. Without the boundaries the gate would refuse ordinary
|
|
91
|
+
// English, and the obvious way to quiet a gate like that is to delete it.
|
|
92
|
+
assert.deepEqual(waveHits("plugin/x.md", "microwave\nwavelength\nwaveform\nwavy\nwaver"), []);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("scanner: the records and CONTEXT.md's _Avoid_: lines are exempt, and nothing that merely resembles them", () => {
|
|
96
|
+
for (const record of ["docs/adr/0012-x.md", "docs/specs/x.md", "docs/research/x.md", "docs/metrics/x.tsv"]) {
|
|
97
|
+
assert.deepEqual(waveHits(record, "no waves"), [], `${record} is a record and must be kept as written`);
|
|
98
|
+
}
|
|
99
|
+
assert.deepEqual(waveHits(SELF, "wave"), [], "this file has to spell the word to look for it");
|
|
100
|
+
assert.deepEqual(waveHits(GLOSSARY, "_Avoid_: queue, pool, wave"), [], "the glossary retires the word by naming it");
|
|
101
|
+
|
|
102
|
+
assert.deepEqual(waveHits("docs/adrs/x.md", "wave"), ["docs/adrs/x.md:1: wave"], "a lookalike of a record prefix is live text");
|
|
103
|
+
assert.deepEqual(waveHits("plugin/docs/adr/x.md", "wave"), ["plugin/docs/adr/x.md:1: wave"], "a record prefix matches from the repo root only");
|
|
104
|
+
assert.deepEqual(waveHits("docs/agents/x.md", "wave"), ["docs/agents/x.md:1: wave"], "docs/ outside the four record paths is live text");
|
|
105
|
+
assert.deepEqual(waveHits(GLOSSARY, "The wave is gone."), ["CONTEXT.md:1: The wave is gone."], "a glossary body line is live text");
|
|
106
|
+
assert.deepEqual(waveHits(GLOSSARY, " _Avoid_: wave"), ["CONTEXT.md:1: _Avoid_: wave"], "only a line that STARTS with _Avoid_: is exempt");
|
|
107
|
+
assert.deepEqual(waveHits("README.md", "_Avoid_: wave"), ["README.md:1: _Avoid_: wave"], "the _Avoid_: exemption is CONTEXT.md's alone");
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test("scanner: a tracked file whose name carries the word is a hit even when its content is clean", () => {
|
|
111
|
+
assert.deepEqual(waveHits("plugin/workflows/merge-wave.js", "export const meta = {};\n"), [
|
|
112
|
+
"plugin/workflows/merge-wave.js: file name",
|
|
113
|
+
]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/** Every tracked path, repo-relative — what the rule governs. */
|
|
117
|
+
const FILES = ROOT === null ? [] : trackedPaths(ROOT);
|
|
118
|
+
|
|
119
|
+
test("the sweep sees the tree it is supposed to police", { skip: SKIP_WITHOUT_REPO }, () => {
|
|
120
|
+
// A guard on the guard: a `git ls-files` that answers nothing turns the
|
|
121
|
+
// sweep below into a vacuous pass over an empty list — green, and blind.
|
|
122
|
+
assert.ok(
|
|
123
|
+
FILES.length > 200,
|
|
124
|
+
`trackedPaths(ROOT) returned only ${FILES.length} entries — too few to be this repo's real tree, and the sweep below would pass vacuously`,
|
|
125
|
+
);
|
|
126
|
+
assert.ok(FILES.includes(SELF), `${SELF} is not a tracked path, so its self-exemption names nothing — update SELF`);
|
|
127
|
+
assert.ok(FILES.includes(GLOSSARY), `${GLOSSARY} is not a tracked path, so the _Avoid_: exemption names nothing — update GLOSSARY`);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("no tracked file outside the records carries the word", { skip: SKIP_WITHOUT_REPO }, () => {
|
|
131
|
+
const hits = FILES.flatMap((path) => waveHits(path, readFileSync(join(ROOT, path), "utf8")));
|
|
132
|
+
// `ok` rather than `deepEqual`: the message already lists every hit, one per
|
|
133
|
+
// line, and a structural diff would print the same list a second time.
|
|
134
|
+
assert.ok(
|
|
135
|
+
hits.length === 0,
|
|
136
|
+
`the word is retired outside docs/adr/, docs/specs/, docs/research/ and docs/metrics/ (#1821) — reword each hit:\n${hits.join("\n")}`,
|
|
137
|
+
);
|
|
138
|
+
});
|