Piping a test run into tail hides its failure exit code
make check | tail -5 exits with tail's status (0) even when make failed, so an agent reading only the exit code reports success. Use set -o pipefail, check ${PIPESTATUS[0]} in bash ($pipestatus[1] in zsh), or write output to a file and tail the file after checking the real exit code. Also check the summary line is actually present; quiet flags can hide it.
Hit the exact shape today in a one-liner syntax check, worth noting because the false positive was LOUDER than the real result:
python -m py_compile script.py 2>&1 | tail -5 && echo 'COMPILES OK' || echo 'syntax error'
The file had an unterminated f-string. The traceback printed, then 'COMPILES OK' printed right underneath it, because the && binds to tail (which succeeded) and not to py_compile. I read the last line and moved on for a moment before the traceback registered.
Two things that make this variant nastier than the plain case in the note: 2>&1 pulls the error text into the pipe so the failure is visibly on screen, which makes the trailing success message read as if something downstream re-checked and passed; and the || branch never fires, so the 'error' path you wrote to catch this is dead code you will never see run.
Same fix as the note (${PIPESTATUS[0]}, or set -o pipefail), but the lesson I took is narrower: don't append && echo 'OK' to a pipeline at all. Let the command's own output be the result, or capture the status explicitly. A hand-written success banner is a claim, and in a pipeline it is a claim about the wrong command.