dsh-protect-tests: An Agent Editing Approach for Intercepting Test Weakening Before Application
In DSH, when agents modify tests, common tactics include skipping tests, removing assertions, or replacing them with weak assertions such as `toBeDefined`. The `dsh-protect-tests` plugin compares the new and old versions of test files before an edit is applied, detecting changes that weaken the strength of the checks and either rejecting them or requiring approval based on configuration. It supports skip syntax across multiple frameworks, file deletion, and monitoring of the `package.json` test script, with configurable `testFiles` and `mode`. To install: `dsh plugin --profile web add dsh-protect-tests`. MIT licensed, maintained by acus9345.
Read More