feat: implement issue #2141 — dev-lead test-tamper guard treats tests the PR itself added as existing: a pass cannot revise its own new test, and its real fixes get retracted

Merged
DO
1mo ago
+411-24

Problem

dev-lead test-tamper guard treats tests the PR itself added as existing: a pass cannot revise its own new test, and its real fixes get retracted

From the issue: The test-tamper guard from #2013 (scripts/lib/test-tamper-guard.sh) decides what an "existing" test is by comparing against the pre-pass head. A test file the PR itself added in an earlier commit therefore counts as existing. When a reviewer asks for a change to that new test, dev-lead cannot make it without a Test-Change-Justification: trailer; if the model forgets the trailer, the push is refused, the PR is flagged for a human, and every "Fixed" reply the pass posted is retracted, including replies for fixes that had nothing to do with the test.

Risk

Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.

Test plan

Tests added/updated: tests/dev-lead/unit/test_fix_reviews.bats,tests/dev-lead/unit/test_test_tamper_guard.bats. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

This PR's Lint (shellcheck) and bats checks show pass/fail; watch subsequent dev-lead / pr-review runs for behavioral regressions.

Closes #2141