#!/bin/bash # R-16 FOR THE CI NEGATIVE CONTROLS THEMSELVES: a control-run smoke test. # # BRIEF-P5 13 (R-16) says a negative control must assert its own failure reason and that every gate # carries a line saying "I made it red once, by doing X". The two controls this file exercises ARE # gates, and until ID-46 finding 8 nobody could make either of them red, because a workflow `run:` # block only executes on a runner. The wave-1 verification agent had to hand-copy the blocks into # throwaway harnesses to show they were broken (wave1-codex-verify.md 8). This file is that # experiment, kept: it runs the REAL control scripts - the same files .github/workflows/test.yml # invokes, not copies of them - against a stubbed ctest, and checks that each one passes exactly # when it should. # # The case that matters is the first one. A stubbed ctest reports a NON-EMPTY selection and then # fails with UNRELATED_CONTROL_FAILURE: a reason that has nothing to do with the knob the control # turns. Before ID-48's fix both controls printed their success message and the step exited 0. They # must now report FAILED. # # usage: control_smoke_test.sh set -u HERE="$(cd "$(dirname "$0")" && pwd)" WORK="$(mktemp -d)" || exit 1 trap 'rm -rf "${WORK}"' EXIT STUB_DIR="${WORK}/stub" mkdir -p "${STUB_DIR}" cp "${HERE}/testdata/stub_ctest.sh" "${STUB_DIR}/ctest" chmod +x "${STUB_DIR}/ctest" passes=0 failures=0 # expect