Pre-commit runner: a timeout is a skip, not a failure

The CC pre-commit hook runs vitest related / tsc / eslint as a fast advisory pre-flight. Tool cold-start here is ~5.6s, but the cap was 5000ms — so execFileSync SIGKILLed a passing run mid-startup, and the kill was reported as related-tests FAILED, blocking the commit. Toggle below.

related-tests run vs the timeout cap

actual run
cap (timeout)

Outcome


  

Commit:

The fix (root cause: timeout ≠ failure)

const CHECK_TIMEOUT_MS = 8000;   // was 5000 — under the ~5.6s cold start

const e = err as { killed?: boolean; signal?: string; code?: string };
const timedOut = e?.killed === true || e?.signal === 'SIGTERM' || e?.code === 'ETIMEDOUT';
// a killed check produced no verdict → advisory skip, never blocks:
const failures = checks.filter(c => !c.passed && !c.timedOut);