test: check-docs mutant guard judges docs, not screenshot freshness

Run 2793 (changed_mutants 2/3): the clean run of
`resource-docs-flatten-current-yaml` was red before any mutation because the
screenshot fingerprint is stale after #490 — strict mode, which #479 reserves
for the beta candidate. The guard now runs `--screenshots=warn`; a test keeps
every check-docs guard in that mode.

Issue: #496
User-Visible: no
This commit is contained in:
Claude
2026-09-09 01:20:06 +03:00
parent f0c8ae24ba
commit 71aeb86079
2 changed files with 13 additions and 1 deletions
+4 -1
View File
@@ -559,7 +559,10 @@ const MUTANT_DEFINITIONS = [
},
{
id: 'resource-docs-flatten-current-yaml',
guard: 'node scripts/check-docs.mjs',
// Свежесть скриншотов — предупреждение (#479): мутант проверяет YAML-сниппет
// README, а не отпечаток кадров; строгий режим красил чистый прогон на любом
// src-диффе без пересъёмки (run 2793, #496).
guard: 'node scripts/check-docs.mjs --screenshots=warn',
because: 'the supported HA 2026.2+ resource snippet must stay nested under lovelace; '
+ 'a plausible-looking top-level resources block is the user-facing defect from #462 AC1',
patches: [{
+9
View File
@@ -551,3 +551,12 @@ test('#492 §6.4: реестр базы читается из git без поб
const leftovers = (await import('node:fs')).readdirSync(join(repoRoot, 'scripts')).filter((f) => f.startsWith('.mutation-gate.base-'));
assert.deepEqual(leftovers, [], 'временный модуль удалён');
});
// #496 (run 2793): гвард на check-docs в строгом режиме красил ЧИСТЫЙ прогон на
// любом src-диффе без пересъёмки скриншотов — свежесть кадров с #479 судится на
// кандидате, а мутант проверяет содержимое документации.
test('#496: гварды check-docs не требуют свежих скриншотов', () => {
const strict = MUTANTS.filter((m) => /check-docs\.mjs/.test(m.guard) && !/--screenshots=warn/.test(m.guard));
assert.deepEqual(strict.map((m) => m.id), []);
assert.ok(MUTANTS.some((m) => /check-docs\.mjs --screenshots=warn/.test(m.guard)), 'хотя бы один гвард check-docs есть');
});