@sabaiway/agent-workflow-kit 20.2.0 → 21.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/CHANGELOG.md +39 -0
- package/README.md +7 -5
- package/SKILL.md +1 -1
- package/bin/install.mjs +10 -11
- package/capability.json +1 -1
- package/launchers/windsurf-workflow.md +3 -1
- package/package.json +5 -2
- package/references/contracts.md +9 -9
- package/references/modes/bootstrap.md +3 -3
- package/references/modes/commit-guard.md +1 -1
- package/references/modes/recommendations.md +2 -2
- package/references/modes/upgrade.md +4 -4
- package/references/scripts/{archive-caps.mjs → archives/archive-caps.mjs} +1 -1
- package/references/scripts/{archive-changelog.mjs → archives/archive-changelog.mjs} +7 -9
- package/references/scripts/{archive-decisions.mjs → archives/archive-decisions.mjs} +13 -10
- package/references/scripts/{archive-issues.mjs → archives/archive-issues.mjs} +7 -8
- package/references/scripts/{check-docs-size.mjs → docs-size/check-docs-size.mjs} +3 -4
- package/references/scripts/docs-size/index.mjs +2 -0
- package/references/scripts/family.json +43 -0
- package/references/scripts/family.mjs +90 -0
- package/references/scripts/gates/kit-command-gates.mjs +117 -0
- package/references/scripts/{migrate-gates.mjs → gates/migrate-gates.mjs} +30 -13
- package/references/scripts/{install-git-hooks.mjs → git-hooks/install-git-hooks.mjs} +50 -38
- package/references/scripts/run.mjs +74 -0
- package/references/scripts/shared/index.mjs +3 -0
- package/references/scripts/shared/project-root.mjs +11 -0
- package/references/scripts/spec-schema/index.mjs +2 -0
- package/references/shared/composition-handoff.md +1 -1
- package/references/shared/deploy-tail.md +2 -2
- package/references/templates/SPEC_TEMPLATE.md +1 -1
- package/references/templates/adr-record.md +3 -3
- package/tools/apply-danger-check.mjs +9 -5
- package/tools/atomic-write.mjs +3 -1
- package/tools/direct-run.mjs +2 -0
- package/tools/distribution-files/retired.mjs +99 -0
- package/tools/distribution-files/scripts.mjs +67 -52
- package/tools/ensure-configs.mjs +21 -21
- package/tools/ensure-ops.mjs +60 -18
- package/tools/ensure-specs.mjs +82 -47
- package/tools/ensure-vocabulary.mjs +4 -4
- package/tools/epic-shape-cli.mjs +1 -1
- package/tools/epic-shape-ledger.mjs +1 -1
- package/tools/epic-shape.mjs +1 -1
- package/tools/family-registry.mjs +3 -1
- package/tools/feedback-record-cli.mjs +1 -1
- package/tools/fold-scope.mjs +2 -2
- package/tools/git-hooks.mjs +90 -65
- package/tools/jev-connect.mjs +1 -1
- package/tools/jev-guide.mjs +1 -1
- package/tools/jev-skill.mjs +1 -1
- package/tools/known-footprint.mjs +7 -29
- package/tools/node-evidence.mjs +29 -15
- package/tools/now-cli.mjs +1 -1
- package/tools/payload-prune.mjs +53 -58
- package/tools/plan-shape-cli.mjs +1 -1
- package/tools/plan-shape.mjs +1 -1
- package/tools/project-rules/rules-record.mjs +1 -1
- package/tools/queue-audit-cli.mjs +1 -1
- package/tools/queue-audit.mjs +2 -2
- package/tools/queue-purge-archive.mjs +1 -1
- package/tools/queue-purge-cli.mjs +1 -1
- package/tools/queue-purge.mjs +1 -1
- package/tools/recommendations.mjs +22 -19
- package/tools/script-priors.mjs +31 -3
- package/tools/source-size/piles.mjs +1 -1
- package/tools/spec-adoption.mjs +1 -1
- package/tools/spec-check-ops.mjs +2 -2
- package/tools/spec-check.mjs +2 -2
- package/tools/spec-coverage.mjs +1 -1
- package/tools/tier-guide.mjs +1 -1
- package/tools/transition/index.mjs +1 -1
- package/tools/upgrade-runlist.mjs +1 -1
- package/tools/write-lanes.mjs +2 -2
- package/references/scripts/_expect-shim.mjs +0 -41
- package/references/scripts/archive-caps.test.mjs +0 -321
- package/references/scripts/archive-changelog.test.mjs +0 -560
- package/references/scripts/archive-conservation.test.mjs +0 -466
- package/references/scripts/archive-decisions.test.mjs +0 -1503
- package/references/scripts/archive-issues.test.mjs +0 -825
- package/references/scripts/archiver-structure.test.mjs +0 -84
- package/references/scripts/check-docs-size-cli.test.mjs +0 -325
- package/references/scripts/check-docs-size-ensure.test.mjs +0 -360
- package/references/scripts/check-docs-size.test.mjs +0 -395
- package/references/scripts/install-git-hooks-repo-exec.test.mjs +0 -185
- package/references/scripts/install-git-hooks.test.mjs +0 -241
- package/references/scripts/markdown-blocks.test.mjs +0 -310
- package/references/scripts/migrate-gates-branches.test.mjs +0 -302
- package/references/scripts/migrate-gates.test.mjs +0 -517
- package/references/scripts/spec-schema.test.mjs +0 -352
- /package/references/scripts/{markdown-blocks.mjs → shared/markdown-blocks.mjs} +0 -0
- /package/references/scripts/{spec-schema.mjs → spec-schema/spec-schema.mjs} +0 -0
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import { readFileSync, writeFileSync, mkdirSync, mkdtempSync, rmSync, readdirSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { expect } from './_expect-shim.mjs';
|
|
6
|
-
import { runCli } from './archive-changelog.mjs';
|
|
7
|
-
|
|
8
|
-
// RED-FIRST, and deliberately a DYNAMIC import: `archive-caps.mjs` does not exist when these arms
|
|
9
|
-
// are first recorded, and a STATIC import of an absent module makes the WHOLE file unloadable — every
|
|
10
|
-
// arm would then be recorded as "unresolvable" rather than as failing, which proves nothing about the
|
|
11
|
-
// behaviour it pins. Imported this way the file still loads and each arm fails on its own missing
|
|
12
|
-
// symbol.
|
|
13
|
-
const caps = await import('./archive-caps.mjs').catch(() => ({}));
|
|
14
|
-
|
|
15
|
-
// The tier table, restated here on purpose. A test that imports the table it is checking agrees with
|
|
16
|
-
// the source by construction and pins nothing; these three rows are the frozen contract, and moving a
|
|
17
|
-
// number in the module must break this file.
|
|
18
|
-
const TABLE = [
|
|
19
|
-
['cold', 1500, 3000],
|
|
20
|
-
['warm', 3500, 7000],
|
|
21
|
-
['meta', 1500, 3000],
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
// Every arm builds its own corpus under a temp root and passes a fixed `--today`, so nothing here
|
|
25
|
-
// reads the project's own `docs/ai` — these pass in a clean checkout where that tree is absent.
|
|
26
|
-
const TODAY = '2026-06-15';
|
|
27
|
-
const FM = '---\ntype: history\nlastUpdated: 2026-06-15\nscope: permanent\nstaleAfter: never\nowner: none\nmaxLines: 700\n---\n';
|
|
28
|
-
|
|
29
|
-
const makeRoot = () => {
|
|
30
|
-
const root = mkdtempSync(join(tmpdir(), 'archive-caps-'));
|
|
31
|
-
mkdirSync(join(root, 'docs', 'ai', 'history'), { recursive: true });
|
|
32
|
-
return root;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// TALL entries carry a files block and a metric, so compression keeps eight lines of them; MINIMAL
|
|
36
|
-
// entries keep three. The difference is how a tier is driven to a chosen size: COLD/WARM need height,
|
|
37
|
-
// META needs COUNT (one line per archived entry) with every month's own COLD file left small.
|
|
38
|
-
const entryBlock = (dateStr, n, tall) =>
|
|
39
|
-
tall
|
|
40
|
-
? `## ${dateStr} — synthetic ${n}\n\n**Goal:** synthetic session ${n}.\n\n**Files:**\n- \`src/f${n}.mjs\`\n\n**Result:** ${n} tests\n`
|
|
41
|
-
: `## ${dateStr} — synthetic ${n}\n\n**Goal:** synthetic session ${n}.\n`;
|
|
42
|
-
|
|
43
|
-
const seed = (root, dates, tall = true) => {
|
|
44
|
-
const body = dates.map((d, i) => entryBlock(d, i + 1, tall)).join('\n');
|
|
45
|
-
writeFileSync(join(root, 'docs', 'ai', 'changelog.md'), `${FM}\n# Changelog\n\n${body}`, 'utf8');
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const day = (i) => String((i % 28) + 1).padStart(2, '0');
|
|
49
|
-
|
|
50
|
-
// One month, well behind the WARM cutoff — everything lands in that month's COLD file.
|
|
51
|
-
const oneMonth = (count) => Array.from({ length: count }, (_, i) => `2026.03.${day(i)}`);
|
|
52
|
-
|
|
53
|
-
// Inside the WARM window (older than today-3, newer than today-30 = 2026-05-16).
|
|
54
|
-
const warmWindow = (count) =>
|
|
55
|
-
Array.from({ length: count }, (_, i) => `2026.05.${String(17 + (i % 14)).padStart(2, '0')}`);
|
|
56
|
-
|
|
57
|
-
// Spread across many CLOSED months so META grows by count while no single COLD file gets near its
|
|
58
|
-
// own ceiling — the only shape in which META can be the tier that refuses.
|
|
59
|
-
const manyMonths = (months, perMonth) => {
|
|
60
|
-
const dates = [];
|
|
61
|
-
for (let m = 0; m < months; m += 1) {
|
|
62
|
-
const year = 2019 + Math.floor(m / 12);
|
|
63
|
-
const month = String((m % 12) + 1).padStart(2, '0');
|
|
64
|
-
for (let i = 0; i < perMonth; i += 1) dates.push(`${year}.${month}.${day(i)}`);
|
|
65
|
-
}
|
|
66
|
-
return dates;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const run = (root, argv) => {
|
|
70
|
-
const out = [];
|
|
71
|
-
const err = [];
|
|
72
|
-
const code = runCli([...argv, `--today=${TODAY}`], {
|
|
73
|
-
root,
|
|
74
|
-
log: (m) => out.push(String(m)),
|
|
75
|
-
logError: (m) => err.push(String(m)),
|
|
76
|
-
});
|
|
77
|
-
return { code, out: out.join('\n'), err: err.join('\n') };
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const historyDir = (root) => join(root, 'docs', 'ai', 'history');
|
|
81
|
-
const emitted = (root, name) => readFileSync(join(historyDir(root), name), 'utf8');
|
|
82
|
-
|
|
83
|
-
// A refusal must leave the tree BYTE-unchanged, and "the history dir is still empty" does not say
|
|
84
|
-
// that: it would miss a rewritten changelog.md. Snapshot every file under docs/ai instead.
|
|
85
|
-
// Built with fromCharCode, not an escape literal: the separator only has to be deterministic, and
|
|
86
|
-
// spelling it in code points keeps a stray byte out of a file the NUL guard scans.
|
|
87
|
-
const SEP = String.fromCharCode(10, 64, 64, 10);
|
|
88
|
-
const snapshot = (root) => {
|
|
89
|
-
const base = join(root, 'docs', 'ai');
|
|
90
|
-
const walk = (dir, prefix) =>
|
|
91
|
-
readdirSync(dir, { withFileTypes: true })
|
|
92
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
93
|
-
.flatMap((entry) =>
|
|
94
|
-
entry.isDirectory()
|
|
95
|
-
? walk(join(dir, entry.name), `${prefix}${entry.name}/`)
|
|
96
|
-
: [`${prefix}${entry.name}:${readFileSync(join(dir, entry.name), 'utf8')}`],
|
|
97
|
-
);
|
|
98
|
-
return walk(base, '').join(SEP);
|
|
99
|
-
};
|
|
100
|
-
const stampOf = (text) => Number(/^maxLines: (\d+)$/m.exec(text)[1]);
|
|
101
|
-
const countOf = (text) => text.split('\n').length - (text.endsWith('\n') ? 1 : 0);
|
|
102
|
-
|
|
103
|
-
const refusal = (fn) => {
|
|
104
|
-
try {
|
|
105
|
-
fn();
|
|
106
|
-
return null;
|
|
107
|
-
} catch (err) {
|
|
108
|
-
return err;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const withRoot = (body) => {
|
|
113
|
-
const root = makeRoot();
|
|
114
|
-
try {
|
|
115
|
-
body(root);
|
|
116
|
-
} finally {
|
|
117
|
-
rmSync(root, { recursive: true, force: true });
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
describe('capFor — the frozen tier table', () => {
|
|
122
|
-
for (const [tier, floor, ceiling] of TABLE) {
|
|
123
|
-
it(`capFor: ${tier} stamps the floor below it, its own count inside the band, and the ceiling itself`, () => {
|
|
124
|
-
expect(caps.capFor({ tier, count: 0 })).toBe(floor);
|
|
125
|
-
expect(caps.capFor({ tier, count: floor - 1 })).toBe(floor);
|
|
126
|
-
expect(caps.capFor({ tier, count: floor })).toBe(floor);
|
|
127
|
-
expect(caps.capFor({ tier, count: floor + 1 })).toBe(floor + 1);
|
|
128
|
-
expect(caps.capFor({ tier, count: ceiling - 1 })).toBe(ceiling - 1);
|
|
129
|
-
// The boundary ACCEPTS. A cap equal to the count is a cap the file honours, so the ceiling is
|
|
130
|
-
// the LAST count that can be stamped, never the first that refuses — and stamping the count
|
|
131
|
-
// (not the ceiling) here is what separates this from a `Math.min(count, ceiling)` that would
|
|
132
|
-
// pass the boundary arm while getting the whole band wrong.
|
|
133
|
-
expect(caps.capFor({ tier, count: ceiling })).toBe(ceiling);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it(`capFor: ${tier} refuses one line past its ceiling`, () => {
|
|
137
|
-
const err = refusal(() => caps.capFor({ tier, count: ceiling + 1 }));
|
|
138
|
-
expect(err).not.toBeNull();
|
|
139
|
-
expect(err.message).toContain(`${ceiling}-line ceiling`);
|
|
140
|
-
expect(err.exitCode).toBe(1);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
it('capFor: an unknown tier and a nonsense count both refuse rather than stamp a default', () => {
|
|
145
|
-
expect(refusal(() => caps.capFor({ tier: 'lukewarm', count: 10 })).message).toContain('unknown archive tier');
|
|
146
|
-
expect(refusal(() => caps.capFor({ tier: 'cold', count: -1 })).message).toContain('non-negative integer');
|
|
147
|
-
expect(refusal(() => caps.capFor({ tier: 'cold', count: 1.5 })).message).toContain('non-negative integer');
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('countLines: counts the docs gate its own way — a trailing newline ends a line, it never opens one', () => {
|
|
151
|
-
expect(caps.countLines('a\nb\n')).toBe(2);
|
|
152
|
-
expect(caps.countLines('a\nb')).toBe(2);
|
|
153
|
-
expect(caps.countLines('a\n')).toBe(1);
|
|
154
|
-
expect(caps.countLines('a\n\n')).toBe(2);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it('shardingWarning: silent under the floor, and past it names the tier, the count and the remedy', () => {
|
|
158
|
-
expect(caps.shardingWarning({ tier: 'meta', count: 1500 })).toBeNull();
|
|
159
|
-
const warning = caps.shardingWarning({ tier: 'meta', count: 1501 });
|
|
160
|
-
expect(warning).toContain('1501');
|
|
161
|
-
expect(warning).toContain('1500-line floor');
|
|
162
|
-
expect(warning).toContain('condensed-index-YYYY.md');
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
describe('the archiver stamps a cap it can honour', () => {
|
|
167
|
-
it('cold: a band-sized month stamps its own count and round-trips byte-identically', () => {
|
|
168
|
-
withRoot((root) => {
|
|
169
|
-
seed(root, oneMonth(160));
|
|
170
|
-
expect(run(root, []).code).toBe(0);
|
|
171
|
-
|
|
172
|
-
const first = emitted(root, '2026-03.md');
|
|
173
|
-
const count = countOf(first);
|
|
174
|
-
// Strictly inside the band: below the floor the tier would stamp the floor and this arm would
|
|
175
|
-
// pin nothing; at or above the ceiling it would refuse.
|
|
176
|
-
expect(count).toBeGreaterThan(1500);
|
|
177
|
-
expect(count).toBeLessThan(3001);
|
|
178
|
-
expect(stampOf(first)).toBe(count);
|
|
179
|
-
|
|
180
|
-
// The byte fixed point, under the new stamp: run two re-reads what run one wrote — including
|
|
181
|
-
// the cap it stamped — and must reproduce it exactly.
|
|
182
|
-
expect(run(root, []).code).toBe(0);
|
|
183
|
-
expect(emitted(root, '2026-03.md')).toBe(first);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
it('warm: a band-sized window stamps its own count and round-trips byte-identically', () => {
|
|
188
|
-
withRoot((root) => {
|
|
189
|
-
seed(root, warmWindow(400));
|
|
190
|
-
expect(run(root, []).code).toBe(0);
|
|
191
|
-
|
|
192
|
-
const first = emitted(root, 'recent.md');
|
|
193
|
-
const count = countOf(first);
|
|
194
|
-
expect(count).toBeGreaterThan(3500);
|
|
195
|
-
expect(count).toBeLessThan(7001);
|
|
196
|
-
expect(stampOf(first)).toBe(count);
|
|
197
|
-
|
|
198
|
-
expect(run(root, []).code).toBe(0);
|
|
199
|
-
expect(emitted(root, 'recent.md')).toBe(first);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
it('meta: a band-sized corpus stamps its own count and round-trips byte-identically', () => {
|
|
204
|
-
withRoot((root) => {
|
|
205
|
-
seed(root, manyMonths(32, 50), false);
|
|
206
|
-
expect(run(root, []).code).toBe(0);
|
|
207
|
-
|
|
208
|
-
const first = emitted(root, 'condensed-index.md');
|
|
209
|
-
const count = countOf(first);
|
|
210
|
-
expect(count).toBeGreaterThan(1500);
|
|
211
|
-
expect(count).toBeLessThan(3001);
|
|
212
|
-
expect(stampOf(first)).toBe(count);
|
|
213
|
-
|
|
214
|
-
expect(run(root, []).code).toBe(0);
|
|
215
|
-
expect(emitted(root, 'condensed-index.md')).toBe(first);
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('a tier under its floor still stamps the floor — the cap never shrinks to the corpus', () => {
|
|
220
|
-
withRoot((root) => {
|
|
221
|
-
seed(root, oneMonth(4));
|
|
222
|
-
expect(run(root, []).code).toBe(0);
|
|
223
|
-
const cold = emitted(root, '2026-03.md');
|
|
224
|
-
expect(countOf(cold)).toBeLessThan(1500);
|
|
225
|
-
expect(stampOf(cold)).toBe(1500);
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
describe('the archiver refuses past a ceiling, identically in every mode', () => {
|
|
231
|
-
// The refusal has to fire in --check and --dry-run as well as the default run, or the standing
|
|
232
|
-
// `--check` gate would go green on a corpus the next real run cannot write. That is only true if
|
|
233
|
-
// every output is BUILT before the mode branch — which is what these three arms pin.
|
|
234
|
-
const modes = [[], ['--dry-run'], ['--check']];
|
|
235
|
-
|
|
236
|
-
// Each mode gets its OWN fixture: sharing one root lets an earlier mode's write hide inside a
|
|
237
|
-
// later mode's assertion. And the tree is compared WHOLE before and after, so a rewritten
|
|
238
|
-
// changelog.md is caught as well as a written archive.
|
|
239
|
-
const refusesInEveryMode = (dates, tall, ceiling) => {
|
|
240
|
-
for (const argv of modes) {
|
|
241
|
-
withRoot((root) => {
|
|
242
|
-
seed(root, dates, tall);
|
|
243
|
-
const before = snapshot(root);
|
|
244
|
-
const result = run(root, argv);
|
|
245
|
-
expect(result.code).toBe(1);
|
|
246
|
-
expect(result.err).toContain(`${ceiling}-line ceiling`);
|
|
247
|
-
expect(snapshot(root)).toBe(before);
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
it('cold: a month past the ceiling refuses in all three modes', () => {
|
|
253
|
-
refusesInEveryMode(oneMonth(400), true, 3000);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
it('warm: a window past the ceiling refuses in all three modes', () => {
|
|
257
|
-
refusesInEveryMode(warmWindow(700), true, 7000);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it('meta: a corpus past the ceiling refuses in all three modes', () => {
|
|
261
|
-
refusesInEveryMode(manyMonths(62, 50), false, 3000);
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
// Two arms, deliberately separate: this one pins that a refusal is ACTIONABLE at all — it names
|
|
265
|
-
// the tier, the measured size and a remedy clause, rather than a bare number the reader has to
|
|
266
|
-
// interpret.
|
|
267
|
-
it('the refusal names the tier and the remedy, not just the number', () => {
|
|
268
|
-
withRoot((root) => {
|
|
269
|
-
seed(root, oneMonth(400));
|
|
270
|
-
const cold = run(root, ['--check']);
|
|
271
|
-
expect(cold.err).toContain('cold archive is');
|
|
272
|
-
expect(cold.err).toContain('-line ceiling');
|
|
273
|
-
expect(cold.err).toContain('Remedy:');
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
// And this one pins that the remedy is RIGHT for the tier it is printed for. One piece of advice
|
|
278
|
-
// would be wrong for two of the three: COLD is already one file per month, and WARM's size is a
|
|
279
|
-
// flag rather than a layout. A remedy must also never name a layout the archiver cannot read back.
|
|
280
|
-
it('the refusal names the tier and a remedy that fits THAT tier', () => {
|
|
281
|
-
withRoot((root) => {
|
|
282
|
-
seed(root, oneMonth(400));
|
|
283
|
-
const cold = run(root, ['--check']);
|
|
284
|
-
expect(cold.err).toContain('already one file per month');
|
|
285
|
-
expect(cold.err).toContain('NOT implemented');
|
|
286
|
-
});
|
|
287
|
-
withRoot((root) => {
|
|
288
|
-
seed(root, warmWindow(700));
|
|
289
|
-
const warm = run(root, ['--check']);
|
|
290
|
-
expect(warm.err).toContain('warm archive is');
|
|
291
|
-
expect(warm.err).toContain('--warm-days');
|
|
292
|
-
});
|
|
293
|
-
withRoot((root) => {
|
|
294
|
-
seed(root, manyMonths(62, 50), false);
|
|
295
|
-
const meta = run(root, ['--check']);
|
|
296
|
-
expect(meta.err).toContain('meta archive is');
|
|
297
|
-
expect(meta.err).toContain('condensed-index-YYYY.md');
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
describe('the sharding tripwire', () => {
|
|
303
|
-
it('meta past its floor warns while still passing, so the remedy lands before the ceiling', () => {
|
|
304
|
-
withRoot((root) => {
|
|
305
|
-
seed(root, manyMonths(32, 50), false);
|
|
306
|
-
const result = run(root, []);
|
|
307
|
-
expect(result.code).toBe(0);
|
|
308
|
-
expect(result.err).toContain('past its 1500-line floor');
|
|
309
|
-
expect(result.err).toContain('condensed-index-YYYY.md');
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
it('meta under its floor says nothing at all', () => {
|
|
314
|
-
withRoot((root) => {
|
|
315
|
-
seed(root, oneMonth(4));
|
|
316
|
-
const result = run(root, []);
|
|
317
|
-
expect(result.code).toBe(0);
|
|
318
|
-
expect(result.err).not.toMatch(/floor/);
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
});
|