fix(openings): preserve gate flip turn direction

Address code review H1 by keeping gate flip direction observable without a second vertical mirror. Add fail-closed golden contracts, smoke coverage, and a mutation guard for the affected opening-symbol geometry.

Issue: #242
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-08-22 21:14:37 +03:00
parent 2af7b0b5a2
commit a65db3985d
17 changed files with 609 additions and 53 deletions
+13
View File
@@ -1598,6 +1598,19 @@ export const MUTANTS = [
replace: " if (!flipV || type === 'passage') return { ox: 0, oy: 0 };",
}],
},
{
id: 'opening-gate-flip-cancels-turn',
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
+ '&& node --test --test-name-pattern="shared renderer centres defaults" '
+ 'test/opening-symbol.test.mjs',
because: 'restoring the second flip_v inversion makes shared and partition gates emit '
+ 'the same first-leaf turn sign for both saved values even though their origin stays centred',
patches: [{
file: 'src/render/opening-symbol.ts',
find: ' const gateAngle = spec.face.side * 10 * amount;',
replace: ' const gateAngle = spec.face.side * sy * 10 * amount;',
}],
},
];
// --- механика ---------------------------------------------------------------