feat(check-versions): name ungated stat axes instead of skipping them silently
A stat-line axis the plugin does not badge was skipped in silence, so "checked and right" and "never checked" printed the same thing. Each plugin now gets an INFO line naming its ungated axes, and the run ends with "stat claims - N gated - M NOT gated (no badge)". INFO never changes status or exit code, not even under --strict. Suggested by repo-standard (reply on BADGE-COUNT, 2026-11-03); operator decision 2026-11-04. First live run: voyage 0 gated / 5 not gated. Suite 244/244. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e52805e317
commit
af4a3cce32
3 changed files with 123 additions and 3 deletions
|
|
@ -12,6 +12,8 @@ import {
|
|||
pickStatSource,
|
||||
extractCatalogStats,
|
||||
gateOutcome,
|
||||
statCoverage,
|
||||
coverageSummary,
|
||||
} from './check-versions.mjs';
|
||||
|
||||
test('normalizeVersion strips a leading v', () => {
|
||||
|
|
@ -399,3 +401,69 @@ test('homepage omitted entirely (legacy callers) → check skipped, stays OK', (
|
|||
});
|
||||
assert.equal(r.status, 'OK');
|
||||
});
|
||||
|
||||
// --- Ungated stat claims are NAMED, not silent (operator decision 2026-11-04) -------------
|
||||
// repo-standard's point, accepted: a mirror that skips a badge-less axis in silence says the
|
||||
// same thing as a mirror that checked it and found it right — "SKIP is never a pass", one
|
||||
// level up. The ungated axes are now reported as INFO. INFO never changes a plugin's status
|
||||
// or the gate's exit code: the catalog may legitimately state a number no badge carries.
|
||||
|
||||
test('statCoverage: splits the catalog\'s stated axes into badge-gated and ungated', () => {
|
||||
const catalogStats = new Map([['agent', 6], ['scanner', 23], ['test', 2013]]);
|
||||
const statBadges = new Map([['scanner', 23], ['knowledge doc', 22]]);
|
||||
assert.deepEqual(statCoverage(catalogStats, statBadges), { gated: ['scanner'], ungated: ['agent', 'test'] });
|
||||
});
|
||||
|
||||
test('statCoverage: nothing to say when either side is unknown', () => {
|
||||
assert.deepEqual(statCoverage(null, new Map()), { gated: [], ungated: [] });
|
||||
assert.deepEqual(statCoverage(new Map([['agent', 6]]), null), { gated: [], ungated: [] });
|
||||
});
|
||||
|
||||
test('classifyPlugin: ungated axes are named in an INFO finding, and the plugin stays OK', () => {
|
||||
const r = classifyPlugin({
|
||||
name: 'p', catalogRef: 'v1.0.0', pluginVersion: '1.0.0', readmeBadge: '1.0.0', tags: ['v1.0.0'],
|
||||
catalogLabel: '1.0.0',
|
||||
catalogStats: new Map([['agent', 6], ['scanner', 23], ['hook', 9]]),
|
||||
statBadges: new Map([['scanner', 23]]),
|
||||
});
|
||||
assert.equal(r.status, 'OK');
|
||||
const info = r.findings.filter(f => f.level === 'INFO');
|
||||
assert.equal(info.length, 1);
|
||||
assert.equal(info[0].kind, 'coverage');
|
||||
assert.deepEqual(info[0].axes, ['agent', 'hook']);
|
||||
assert.match(info[0].msg, /agent, hook/);
|
||||
assert.match(info[0].msg, /not gated/);
|
||||
assert.ok(r.findings.some(f => f.level === 'OK'), 'the consistent-at line is kept alongside the INFO');
|
||||
});
|
||||
|
||||
test('classifyPlugin: no INFO finding when every stated axis is badge-gated', () => {
|
||||
const r = classifyPlugin({
|
||||
name: 'p', catalogRef: 'v1.0.0', pluginVersion: '1.0.0', readmeBadge: '1.0.0', tags: ['v1.0.0'],
|
||||
catalogLabel: '1.0.0',
|
||||
catalogStats: new Map([['scanner', 23]]),
|
||||
statBadges: new Map([['scanner', 23]]),
|
||||
});
|
||||
assert.equal(r.findings.filter(f => f.level === 'INFO').length, 0);
|
||||
});
|
||||
|
||||
test('gateOutcome: INFO (ungated) never fails the gate, not even under --strict', () => {
|
||||
const r = classifyPlugin({
|
||||
name: 'p', catalogRef: 'v1.0.0', pluginVersion: '1.0.0', readmeBadge: '1.0.0', tags: ['v1.0.0'],
|
||||
catalogLabel: '1.0.0', catalogStats: new Map([['agent', 6]]), statBadges: new Map(),
|
||||
});
|
||||
assert.equal(gateOutcome([r], { strict: true }).failed, false);
|
||||
});
|
||||
|
||||
test('coverageSummary: counts gated and ungated claims across plugins, and names the plugins', () => {
|
||||
const mk = (name, stats, badges) => classifyPlugin({
|
||||
name, catalogRef: 'v1.0.0', pluginVersion: '1.0.0', readmeBadge: '1.0.0', tags: ['v1.0.0'],
|
||||
catalogLabel: '1.0.0', catalogStats: new Map(stats), statBadges: new Map(badges),
|
||||
});
|
||||
const results = [
|
||||
mk('a', [['agent', 6], ['scanner', 23]], [['scanner', 23]]),
|
||||
mk('b', [['test', 5]], [['test', 5]]),
|
||||
mk('c', [['hook', 3], ['command', 16]], []),
|
||||
{ name: 'd', status: 'SKIP', findings: [{ level: 'SKIP', msg: 'x' }] },
|
||||
];
|
||||
assert.deepEqual(coverageSummary(results), { gated: 2, ungated: 3, plugins: ['a', 'c'] });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue