textmachine/platform/docs/p8-review/run-round2.sh

30 lines
1.6 KiB
Bash
Executable file

#!/usr/bin/env bash
# Round 2, after the senior review: the three verdicts whose evidence was not reproducible from the
# artifacts (M1/M2/M9) and six re-checks of "survived" verdicts on the FULL battery rather than a
# package subset. Every mutation here is judged against the SAME copy's clean baseline.
set -u
cd "${P8_COPY:?set P8_COPY to a COPY of platform/}"
: "${TM_PLATFORM_TEST_DSN:?}" "${TM_PLATFORM_TEST_ENGINE_BIN:?}" "${TM_PLATFORM_TEST_BOOK_TEMPLATE:?}"
OUT=${P8_OUT:-.}/mutations-round2.log
: > $OUT
echo "=== чистая базовая линия ЭТОЙ копии ===" >> $OUT
go test ./... -count=1 > /tmp/r2.base.log 2>&1
grep -- '--- FAIL' /tmp/r2.base.log | sort > /tmp/r2.base.fails
echo "падений на чистой копии: $(wc -l < /tmp/r2.base.fails)" >> $OUT
cat /tmp/r2.base.fails >> $OUT
echo >> $OUT
for m in M1 M2 M9 M11 M12 M13 M14 M15 M16; do
python3 "${P8_HERE:-$(dirname "$0")}/plant.py" $m plant >> $OUT
if ! go build ./... >> $OUT 2>&1; then echo "$m: BUILD FAILED" >> $OUT; python3 "${P8_HERE:-$(dirname "$0")}/plant.py" $m revert >> $OUT; echo "---" >> $OUT; continue; fi
go test ./... -count=1 > /tmp/r2.$m.log 2>&1
grep -- '--- FAIL' /tmp/r2.$m.log | sort > /tmp/r2.$m.fails
d=$(comm -13 /tmp/r2.base.fails /tmp/r2.$m.fails)
if [ -n "$d" ]; then
echo "$m: RED (пойман) — дельта против чистой копии:" >> $OUT; echo "$d" >> $OUT
else
echo "$m: GREEN (ВЫЖИЛ) — ПОЛНАЯ батарея, дельта против чистой копии пуста" >> $OUT
fi
python3 "${P8_HERE:-$(dirname "$0")}/plant.py" $m revert >> $OUT
echo "---" >> $OUT
done
echo DONE >> $OUT