test: printf %02d read 08 as octal and killed the suite before its control
printf '%02d' 08 in bash is "invalid octal number". It prints 00 AND returns non-zero, so under set -e the sabotage suite died immediately after leg 8 emitted a mislabelled SD_P8_SABOTAGE_00 marker -- and leg 9, the positive control that is the only leg proving the gate can stand DOWN, never ran.
It worked for legs 01-07 because those are valid octal, and failed for exactly 08 and 09. A formatting call that is correct for seven of nine inputs and wrong for the two that matter most is not something reading it was ever going to find.
leg_red formats the label with %s, since callers already pass it padded. pass keeps %02d -- its markers are matched by name elsewhere -- but coerces with 10# so a future padded caller cannot reacquire the bug.
Legs 1-7 all red at the assertion their expectations name, run against the seven-arm gate:
01 the base profile reverts to (chapter) -> the pinned literals
02 the genre profile is misnamed -> arm 01
03 the parser stops enforcing multiplicity -> arm 04, a required red flips
04 the model accepts kind book again -> arm 02
05 a migrated manuscript gains a word -> UNEXPECTED minimal.sgd
06 the normalization is disabled -> the identical-floor, with 17
unexpected and ROOT-ONLY intact
07 a probe case is deleted -> arm 04's denominator test/gate-sd-p8.sh | 7 ++++++-
test/sabotage-sd-p8.sh | 16 ++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)test/gate-sd-p8.shmodified
export SIGIL_REDIRECTS="$redirects"export XDG_CACHE_HOME="$gate_dir/cache"pass() { printf 'SD_P8_GATE_%02d %s\n' "$1" "$2"; }# ZERO-PADDED OUTPUT, BASE-10 INPUT. `%02d` on a zero-padded argument is a trap:# bash reads `08` as octal, raises "invalid octal number", prints 00 and returns# NON-ZERO -- which under `set -e` killed the sabotage suite immediately after# leg 8 printed a mislabelled marker, so leg 9 (the positive control) never ran.# `10#` forces base 10, so the markers stay padded and a padded caller is safe.pass() { printf 'SD_P8_GATE_%02d %s\n' "$((10#$1))" "$2"; }die() { echo "$*" >&2; exit 1; }# An absent tool does not announce itself -- it impersonates a result. Everytest/sabotage-sd-p8.shmodified
return $rc}leg_red() { # $1 = leg number, $2 = log, $3 = required substring# `%s`, NOT `%02d`, AND THE REASON IS WORTH THE LINE.## Callers pass ZERO-PADDED labels (`01` … `09`). `printf '%02d' 08` in bash is# "invalid octal number": it prints `00` and RETURNS NON-ZERO. Under `set -e`# that killed this suite immediately after leg 8 printed a MISLABELLED marker# (`SD_P8_SABOTAGE_00`), so leg 9 -- the positive control, the only leg that# proves the gate can stand DOWN -- never ran.## The shape is worth more than the fix: the call worked for legs 01-07 because# those are valid octal, and failed for exactly 08 and 09. A formatting bug that# is correct for seven of nine inputs and wrong for the two that matter most is# not going to be found by reading it.leg_red() { # $1 = leg label, $2 = log, $3 = required substring rg -qF -- "$3" "$2" || { echo "LEG $1: expected a red naming '$3'; got:" >&2 tail -25 "$2" >&2 exit 1; } printf 'SD_P8_SABOTAGE_%02d RED %s\n' "$1" "$3" printf 'SD_P8_SABOTAGE_%s RED %s\n' "$1" "$3"}# ---------------------------------------------------------------- LEG 01