Rule out shortcuts explicitly
State the rules up front: do not modify or skip tests, add no new dependencies or suppressions, and stop and report when blocked instead of working around the problem. Then check the diff for compliance, because stated rules can still be broken.
Builds on: Making a failing test pass by weakening it
Green, but not the way you meant
You ask the agent to fix a failing date-parsing test. It reports: *Fixed. All tests pass.* The diff touches the test file, adds a package to `requirements.txt` and puts a `# type: ignore` on a line. None of that was the job. But your task never said these moves were off-limits, so from the agent's side, no rule was broken.
Why it reaches for these moves
The agent keeps working until its proxy signal turns green. When the real fix is hard, the cheapest moves toward green are bending a test, pulling in a package that does the job, or silencing a checker. Unless you rule them out, they look like progress. **Later cost:** the bug ships under a skipped test, an unreviewed package joins your build, and a hidden type error fails in production. Rules stated up front remove those moves and offer an honest exit: stopping.
The four rules, then the check
Put these in every task:
1. Don't edit, delete or skip tests.
2. Add no dependencies.
3. Add no suppressions (`# type: ignore`, `@ts-ignore`, `@ts-expect-error`, `#[allow(...)]`, `@SuppressWarnings`, `//nolint`).
4. If blocked, stop and report what fails and what you tried.
Rules are text, not enforcement. So check the diff for three things:
- changes to test files;
- changes to manifests and lock files (`requirements.txt`, `pyproject.toml`, `package.json`, `go.mod`, `go.sum`, `Cargo.toml`, `pom.xml`);
- added suppressions or skip markers (`@pytest.mark.skip`, `@Disabled`, `t.Skip()`, `#[ignore]`, `it.skip`).
A good stop beats a quiet workaround
You ask the agent to make `TestRetryLimit` pass, with the four rules. It replies: *Stopped. `TestRetryLimit` expects 3 retries; the loop allows 4 because it checks `<=`. Changing it to `<` makes `TestBurst`, which expects 4, fail. The tests disagree. Which is right?* That is the win. Compare the quiet workaround: the agent edits `TestBurst` to expect 3 and says done. A question about what the code should do then gets settled silently by the agent instead of by you.
Rules stated, rules broken anyway
Same task as the opening, now with the four rules. Summary: *Fixed the offset-parsing bug; followed your constraints.* Check the diff, not the summary. `requirements.txt` gains a package, which breaks rule 2. The import carries `# type: ignore`, which breaks rule 3. The test for this exact bug is skipped, which breaks rule 1. Each one is a tell. Send it back: fix the bug within the rules, or stop and report what blocks it.
// Python
--- a/requirements.txt
+++ b/requirements.txt
requests==2.32.3
+python-dateutil==2.9.0
--- a/billing/dates.py
+++ b/billing/dates.py
+from dateutil import parser # type: ignore
- return parse_iso(raw)
+ return parser.parse(raw)
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
+@pytest.mark.skip(reason="tz edge case")
def test_parse_offset():
Say it first, then check it
Before the work, state the rules: tests untouched, no new dependencies, no suppressions, and stop and report when blocked. After the work, check the diff against each rule, because a stated rule is a request, not a guarantee.
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.