Test integrity guard
A deterministic Claude Code PreToolUse gate for Bash, Write, and Edit that compares bounded test-source changes for newly introduced skip, expected-failure, or ignore markers and rejects statically recognizable shell deletion or rename-away of test files without duplicating focused-test checks.
Runs on
What it does
Block newly introduced test suppressions and explicit shell removal of test sources.
When it fires
- implementation
- pre-commit
- review
How it behaves
Compare bounded test changes and reject new suppressions or explicit static test-source removal.
It does not run tests, measure coverage, repair a test, or decide whether a suppression is justified.
It does not inspect or block focused-test markers because that boundary belongs to debug-artifact-guard.
It does not infer a test deletion from arbitrary scripts, dynamic paths, interpreters, build tools, or unsupported shell constructs.
It does not expose a project-writable allowlist, inline bypass, environment override, or agent-controlled approval mechanism.
Configuration
targets/claude-code/test-integrity-guard.mjs
- Version
- 1.0.0
- Requires
- Shell command guard
- Licence
- RiskThis automatic gate blocks newly introduced test suppressions and explicit shell removal of test sources; a false denial can interrupt legitimate work, but it does not execute the blocked action.
- Medium
- ModeHow it works: fixed rules, model instructions, or both.
- Deterministic only
- Behaviour
- Enforces, blocks on violation
- On failure
- Denies and blocks
- LatencyThe entrypoint handles one intercepted event to block newly introduced test suppressions and explicit shell removal of test sources without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Development