#!/usr/bin/env bash # Contract tests for the release parity gate. These fixtures keep the real # matrix untouched while proving that release-blocking classifications cannot # accidentally be reported as a passing gauntlet. set -euo pipefail root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" temporary_dir="$(mktemp -d)" trap 'rm -rf "$temporary_dir"' EXIT write_matrix() { local path="$1" local status="$2" local evidence="$3" cat >"$path" <"$log" 2>&1 local status_code=$? set -e if [[ "$status_code" -eq 0 ]]; then echo "parity gate unexpectedly accepted $name" >&2 cat "$log" >&2 exit 1 fi } assert_gate_passes "ported" "ported" 'G1 — `test_fixture.gd`' assert_gate_passes "replaced" "replaced" 'G1 — `test_fixture.gd`' assert_gate_passes "not-applicable" "not_applicable" 'Justified: graphical port has no terminal-only equivalent.' assert_gate_fails "blocked" "blocked" "G6 — pending" assert_gate_fails "unowned" "replaced" "" assert_gate_fails "unjustified-not-applicable" "not_applicable" "No equivalent" assert_gate_fails "unknown-status" "pending" "G6 — pending" echo "parity gauntlet matrix gate contracts passed"