acus9345/dsh-protect-tests

dsh-protect-tests inspects every edit to a test file before it is applied and refuses changes that make the tests check less: it catches new skips (it.skip, test.only, xit, @pytest.mark.skip/xfail and equivalents across xUnit, RSpec, PHPUnit and XCTest), removed tests or assertions, assertions that cannot fail, commented-out assertions, swallowed failures, weaker assertions that swap a specific check for toBeDefined/toBeTruthy/is not None, deleted test files and a test script neutered to echo/exit 0/|| true, telling the model exactly what it did so it fixes the implementation instead.

dsh-protect-tests stops an agent from making a test suite pass by weakening it. Ask an agent to 'make the tests pass' and sometimes it adds .skip to a failing test, comments out an assertion, or turns expect(total).toBe(42) into expect(total).toBeDefined() - the run goes green and the bug remains. This plugin inspects every edit to a test file before it is applied and refuses changes that make the tests check less: new skips (it.skip, test.only, xit, xdescribe, @pytest.mark.skip / xfail, @unittest.skip, t.Skip(), @Disabled, #[ignore] and equivalents in xUnit, RSpec, PHPUnit and XCTest), removed test cases or two-or-more removed assertions, assertions that cannot fail (expect(true).toBe(true), assert True, assertEquals(x, x), assert!(true)), commented-out assertions, swallowed failures (empty catch {} or except AssertionError: pass), weaker assertions that swap a specific check for toBeDefined/toBeTruthy/is not None, deleted test files via rm/git rm/unlink, and a test script neutered to echo, exit 0, '... || true' or --passWithNoTests.

Agent Capabilities ★ 1
View on GitHub ↗

Install

dsh plugin --profile web add dsh-protect-tests

Copied verbatim from the README's Install block (the web profile; the README notes using headless or acp instead if you run DSH another way, one plugin list per profile). npm package dsh-protect-tests at 0.1.0 (registry check 2026-10-15; the registry repository field resolves back to this repo).

Compatibility

It is a check on the model's edits to test files, not a test runner: it compares the old and new text of every proposed edit before it is applied and refuses an edit that makes the tests check less, then tells the model exactly what it did and how to fix it. Two thresholds (fewer tests, and fewer assertions) are configurable, the block message instructs the model to fix the implementation or - if the test itself is wrong - to explain which test it is changing and why and then repeat the identical call once to confirm, so an intentional change is never permanently blocked. Works across multiple test frameworks and ecosystem skip/only/ignore idioms.

Details

Alternatives

030611/dsh-telemetry-redactor · 173787247/dsh-wsl-env · acnlabs/dsh-plugin-acn

More plugins in Agent Capabilities

Browse more in Agent Capabilities

Guides for Agent Capabilities plugins