Skip to content
youdede

Test Assertion Removal Guard

DevelopmentHookv1.0.0

Compares bounded test-file revisions and stops a change when a test that stays in the file loses every recognizable assertion or failure primitive.

Runs on

Scope
$npx @youdede/toolkit add test-assertion-removal-guard --target claude-code

What it does

Block removal of the last recognizable assertion from an existing test file.

When it fires

  • implementation
  • pre-commit

How it behaves

Block removal of the last recognizable assertion from an existing test file.

It does not judge assertion quality or test coverage.

It does not block assertion-preserving refactors recognized by its bounded vocabulary.

It does not govern skipped or deleted test cases.

Configuration

targets/claude-code/test-assertion-removal-guard.mjsnode · read-only

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate blocks removal of the last recognizable assertion from an existing test file; 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 removal of the last recognizable assertion from an existing test file without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained

Often used with

All in Development