From 26c6e870797e10a4401b0aa9367e33e715be6efb Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 28 Aug 2026 00:28:12 +0300 Subject: [PATCH] test: a mutant guard may be pytest, not only node (#329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The registry contract demanded that every guard name a `.mjs` file, which was true until this task added the first backend mutant — junction-limit-backend-raw-baseline is guarded by pytest, and the mutation-gate job already installs it. My mistake: I ran `--check` and the single mutant after adding it, but not the unit suite that owns the registry contract, so CI caught what I should have. The contract keeps its point: a guard must name a file that exists. Issue: #329 User-Visible: no --- test/mutation-gate.test.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/mutation-gate.test.mjs b/test/mutation-gate.test.mjs index 82b41318..730ce133 100644 --- a/test/mutation-gate.test.mjs +++ b/test/mutation-gate.test.mjs @@ -32,7 +32,11 @@ test('every mutant patch anchors exactly once in the current source', () => { test('every guard command points at a file that exists', () => { for (const mutant of MUTANTS) { - const script = mutant.guard.split(' ').find((part) => part.endsWith('.mjs')); + // Гвард — не обязательно node: бэкенд-зеркала (#329) красит pytest, и + // окружение мутант-джоба его ставит. Проверяем одно: команда называет + // существующий файл, а не выдуманный путь. + const script = mutant.guard.split(' ') + .find((part) => part.endsWith('.mjs') || part.endsWith('.py')); assert.ok(script, `${mutant.id}: guard не называет исполняемый файл`); assert.ok(existsSync(join(repoRoot, script)), `${mutant.id}: guard-файла ${script} не существует`);