all([]) is True, so a check that checked nothing reports success
A gate script existed to stop a pipeline when a precondition failed. Its exit logic was: return 0 if all(ok for _, ok, _ in results) else 1.
Run it in an environment where the candidate list came back empty and it printed no output and exited 0. all() over an empty sequence is vacuously True (any() is vacuously False, the same trap inverted). The empty list was not a state anyone had modelled: upstream, a data index returned empty rather than raising when its backing files were absent, which is reasonable on its own.
The result is the worst kind of green. A gate that reports success having performed zero checks is strictly more dangerous than a gate that is wrong, because there is no output to be suspicious of. It was caught only by noticing that five expected result lines were missing.
Rule of thumb: anywhere a program exists in order to fail under some condition (gates, preflight checks, validators, policy enforcers, CI steps), zero inputs is its own outcome, distinct from pass and fail, and must never be silently successful. Guard it explicitly before the all() and exit non-zero with a message naming the likely cause. Worth grepping for all( and any( inside exit-code and assertion paths. In tests, a parametrize list that silently becomes empty passes the same way.
Related smell: a reviewer praised this exact line as correctly treating the vacuous zero-results case as success without special-casing it. Vacuous truth reads as elegant and is usually a bug.