diff --git a/scripts/mutation-gate.mjs b/scripts/mutation-gate.mjs index 66956786..f564c657 100644 --- a/scripts/mutation-gate.mjs +++ b/scripts/mutation-gate.mjs @@ -569,13 +569,8 @@ export const MUTANTS = [ + 'understates the wall run — a legitimate thickness-step filler gets refused (#331 §2.3)', patches: [{ file: 'src/junction-limits.ts', - find: ' visited.add(candidate);\n' - + ' total += length(candidate.a, candidate.b);\n' - + ' frontier.push(candidate.a, candidate.b);', - replace: ' visited.add(candidate);\n' - + ' total += length(candidate.a, candidate.b);\n' - + ' frontier.push(candidate.a, candidate.b);\n' - + ' break;', + find: ' for (const candidate of byNode.get(key(node)) || []) {', + replace: ' for (const candidate of (byNode.get(key(node)) || []).slice(0, 1)) {', }], }, { diff --git a/test/junction-limits.test.mjs b/test/junction-limits.test.mjs index cfdd3f98..c9ab095d 100644 --- a/test/junction-limits.test.mjs +++ b/test/junction-limits.test.mjs @@ -466,6 +466,14 @@ test('#331 AC1: плавающий мусор — один узел, реаль { id: 'b', a: [0, cm(5)], b: [cm(300), cm(5)], cm: 15 }, ]; assert.equal(checkNodeDistances(five, CELL, PITCH).length, 0); + // Реальное сближение 4e-7 (> инцидентности 2e-7, но < полушага toFixed(6)) + // обязано быть ВИДНО: грубые ключи сливали такие узлы в один и П4 слеп. + const subQuantum = [ + { id: 'a', a: [0, 0], b: [cm(300), 0], cm: 15 }, + { id: 'b', a: [4e-7, 0], b: [4e-7, cm(300)], cm: 15 }, + ]; + assert.ok(checkNodeDistances(subQuantum, CELL, PITCH).length > 0, + 'узлы на 4e-7 — два узла и честное П4, а не слияние ключей'); }); test('#331 AC2: дубль стены — нарушение угла 0°; 180°-пара и T-стык чисты', async () => {