Files
lucisv/scripts/corpus_gate.sh
lucioandClaude Fable 5 c556a13857
ci / checks (push) Successful in 36s
ci / corpus (push) Successful in 26s
release / build-and-publish (push) Successful in 3m7s
CI: corpus score is a gate, releases audit their artifacts; v0.7.2
The corpus job scores the pinned-rev corpus (cached at
~/.cache/lucisv-corpus on the runner, fetched once on a miss) on every
push and fails below scripts/corpus-baseline (813) or on any
verification error / crash. The release workflow now runs
tools/audit_artifacts.sh before publishing: musl must be fully static,
linux-gnu's glibc ceiling must stay <= 2.28 (RHEL 8), every file must be
the object format its name claims — verified against the 10 real v0.7.1
release binaries. Linux execution under Docker was considered and
declined: no container runtime on the runner. Version 0.7.2 with a
changelog covering this, the printer column fix and the README truth
pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 02:13:04 -07:00

35 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# CI gate over the corpus score: fail on any regression from the recorded
# baseline. `scripts/corpus-baseline` holds the passing-file count the tree
# must sustain; a verification error or a crash fails regardless of the
# count — those are formatter bugs by definition (see tools/corpus_check.sh).
#
# Usage: scripts/corpus_gate.sh [corpus-dir]
#
# An improvement does not fail, it nags: bump the baseline in the same
# change that earns it, so the gate ratchets and never slides back.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
corpus=${1:-corpus}
baseline=$(cat "$here/corpus-baseline")
json=$("$here/score.sh" "$corpus")
printf '%s\n' "$json"
passing=$(printf '%s' "$json" | jq .passing)
verr=$(printf '%s' "$json" | jq '.failures_by_category["verification-error"] // 0')
crash=$(printf '%s' "$json" | jq '.failures_by_category.crash // 0')
status=0
[ "$verr" -eq 0 ] || { echo "FAIL: $verr verification error(s) — always a formatter bug" >&2; status=1; }
[ "$crash" -eq 0 ] || { echo "FAIL: $crash crash(es) — always a formatter bug" >&2; status=1; }
if [ "$passing" -lt "$baseline" ]; then
echo "FAIL: corpus regression — $passing passing, baseline is $baseline" >&2
status=1
elif [ "$passing" -gt "$baseline" ]; then
echo "note: $passing passing beats the baseline $baseline — bump scripts/corpus-baseline"
fi
exit $status