test: golden acceptance keeps environment witnesses (#355)

Declaring the whole matrix in --expect-change could accept a completely
foreign capture (different font stack, different machine): no undeclared
passed scenes would remain, and undeclared passed scenes are exactly what
proves the capture environment equals the accepted baseline's. The
realistic failure is fatigue, not malice — a mass framing change where the
author lists "everything that went red", accidentally sweeping in scenes
that diverged because of the environment.

Acceptance now requires a witness floor: after subtracting
--expect-change/--expect-new, at least min(10, 10% of baseline scenes)
undeclared scenes must match their accepted baselines BYTE-FOR-BYTE (a
sub-threshold 'passed' proves nothing about the environment — #351). A
truly total repaint passes only with an explicit
--no-witnesses --reason="…", and the reason is written into the baseline
manifest — a trace in the artifact and its git history, not just in the
shell history. A first-ever capture with no baselines requires no
witnesses: every frame there is declared in --expect-new anyway.

Issue: #355
User-Visible: no
This commit is contained in:
Codex
2026-08-28 18:18:24 +03:00
parent 4808426369
commit 7c285d25b7
4 changed files with 166 additions and 0 deletions
+7
View File
@@ -4,6 +4,13 @@
*
* node scripts/golden-accept.mjs --reviewed --expect-change=<id,id>
* node scripts/golden-accept.mjs --reviewed --expect-new=<id,id>
* node scripts/golden-accept.mjs --reviewed --expect-change=… --no-witnesses --reason="…"
*
* Floor свидетелей (#355): после вычета объявленных сцен должно остаться
* достаточно необъявленных, совпавших с эталоном байт-в-байт, — они доказывают,
* что среда съёмки та же, что у принятого эталона. Тотальная перерисовка
* обходится только явным `--no-witnesses --reason="…"`; причина уезжает в
* манифест эталонов.
*
* Обёртка появилась потому, что до #344 любой `.mjs` из `demo/golden` входил в
* корпус отпечатка, и правка инструмента приёмки объявляла устаревшими бандл и