From 273b0d5ecb6765d11754e00c0421273f01fd663c Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 28 Aug 2026 00:41:21 +0300 Subject: [PATCH] test: the backend mutant follows the registry convention (#329 r2-H1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reviewer is right twice over. My previous commit fixed the red CI by relaxing the contract — a guard could name a `.py` file — when the registry already had a convention for exactly this case: every backend mutant runs `node scripts/backend-test-guard.mjs `, which owns the python executable choice and the `-k` selection. Bending a rule to fit my one-off is the worse of the two possible fixes, so the contract goes back to demanding a `.mjs` guard, and junction-limit-backend-raw-baseline now uses the helper and targets the one test that proves the migration (test_legacy_baseline_is_judged_after_the_same_migration). Re-verified: registry --check clean, the mutant still catches its regression 1/1, npm test 1390 passed / 0 failed. Issue: #329 User-Visible: no --- scripts/mutation-gate.mjs | 4 +++- test/mutation-gate.test.mjs | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/mutation-gate.mjs b/scripts/mutation-gate.mjs index 436ce2e3..6e17ddbc 100644 --- a/scripts/mutation-gate.mjs +++ b/scripts/mutation-gate.mjs @@ -539,7 +539,9 @@ export const MUTANTS = [ }, { id: 'junction-limit-backend-raw-baseline', - guard: 'python3 -m pytest tests_backend/test_junction_limits.py -q', + guard: 'node scripts/backend-test-guard.mjs ' + + 'test_legacy_baseline_is_judged_after_the_same_migration ' + + 'tests_backend/test_junction_limits.py', because: 'a legacy baseline carries no wall catalogue, so judging it raw reports "no ' + 'violations" whatever its geometry and turns every inherited one into a refusal of ' + 'an unrelated edit (#329 §3, code review r1 H1)', diff --git a/test/mutation-gate.test.mjs b/test/mutation-gate.test.mjs index 730ce133..82b41318 100644 --- a/test/mutation-gate.test.mjs +++ b/test/mutation-gate.test.mjs @@ -32,11 +32,7 @@ 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) { - // Гвард — не обязательно node: бэкенд-зеркала (#329) красит pytest, и - // окружение мутант-джоба его ставит. Проверяем одно: команда называет - // существующий файл, а не выдуманный путь. - const script = mutant.guard.split(' ') - .find((part) => part.endsWith('.mjs') || part.endsWith('.py')); + const script = mutant.guard.split(' ').find((part) => part.endsWith('.mjs')); assert.ok(script, `${mutant.id}: guard не называет исполняемый файл`); assert.ok(existsSync(join(repoRoot, script)), `${mutant.id}: guard-файла ${script} не существует`);