piped-command-exit-code-masks-primary-script-result

When spot-checking script exit codes by piping output through tail or similar tools, the shell captures the last command’s exit code, not the primary script’s. This caused a false-positive C2 finding: both frontend-integrity-lint.py and frontend-integration-test.sh correctly exit 1 on failure, but the check script | tail -20; echo $? returned tail’s exit 0. Always capture exit code before piping: script; echo "exit=$?" or use ${PIPESTATUS[0]}.