#!/usr/bin/env bash # tests/fix-round-4-5a-red.sh # The red proof of fix round 4-5a (brief: the last Success Criterion), as a # wrapper over the shared red script tests/helpers/red-round.sh. Every id of # the round has tests whose names start with "[id]"; each of them must fail on # an assertion at the round's start point ab6b32c, or, for DJ, under its # mutations. # This wrapper passes the shared script: # --base BASE, --ids IDS (the round's 30 ids), the round's FILES; # --other-ids: the ids of fix round 4-5b, read with sed from the IDS= line # of tests/fix-round-4-5b-red.sh (a tag on that list is not judged); # --mutations tests/fix-round-4-5a-mutations.mjs: DJ-A deletes the # copy-through span in commands/trekreview.md, DJ-B both spans in # agents/review-coordinator.md (DJ's defect is a missing test, its # sentences exist at ab6b32c, so DJ is a pass-id at the start point). # The shared script clones the start point outside the repo, puts the working # tree's tests/ in it, runs every tagged test of the files once, lets # tests/helpers/red-judge.mjs decide, then applies each mutation, runs DJ's # tests, judges and restores. # Exit 0 all red, 1 a rule broken (the judge names it), 2 a setup failure # (also: no ids on the 4-5b IDS= line); never 0 on a setup failure. # bash 3.2 compatible, ASCII only, no arrays. set -u set -f cd "$(dirname "$0")/.." || { echo "red script: setup failure: cannot cd to the repo root" >&2; exit 2; } ROOT="$(pwd -P)" BASE=ab6b32c9304534b77c7ca2b36e7c993682c9efde IDS='#52 #47 #48 #46 #2 #26 #33 #1 #30 #28 R6 D67 #15 #12 #66 #102 #57 #67 #113 #111 #24 #23 F9 F4a F4b F4c WF CL ORD DJ' FILES='tests/lib/fix-round-4-5a-prose.test.mjs tests/lib/verdict-gate.test.mjs tests/lib/park-attempt-files.test.mjs tests/lib/autonomy-gate.test.mjs tests/lib/arg-parser.test.mjs tests/scripts/trekreview-armb-workflow.test.mjs tests/lib/coordinator-contract.test.mjs tests/validators/next-session-prompt-validator.test.mjs' OTHER=$(sed -n "s/^IDS='\(.*\)'\$/\1/p" "$ROOT/tests/fix-round-4-5b-red.sh") if [ -z "$OTHER" ]; then echo "red script: setup failure: no ids on the IDS= line of $ROOT/tests/fix-round-4-5b-red.sh" >&2 exit 2 fi exec /bin/bash "$ROOT/tests/helpers/red-round.sh" --base "$BASE" --ids "$IDS" --other-ids "$OTHER" --mutations "$ROOT/tests/fix-round-4-5a-mutations.mjs" $FILES