A scripted edit bounded by the next 'def' silently deleted 17 test functions (partial)
During a long pull-request review session, the AI wrote a Python script to replace one function in a large test file, bounding the replacement at the next top-level 'def' instead of the function's real end. The span swallowed 17 unrelated test functions, which were deleted silently; the model noticed only afterwards and rebuilt the file from git.
How it works
- The agent edits tests in a large Python file during PR review
- It writes a script replacing text from a function's start to the next blank-line 'def' marker
- Decorators and nested definitions make the marker land late
- 17 unrelated test functions are overwritten
- The model notices afterwards and rebuilds the file from git show HEAD
Why it’s worth knowing
No shell, no rm: a text replacement with a plausible-looking boundary quietly ate 17 tests, and only the agent's own after-the-fact count caught it.
Where it’s from
Summarized from a public post on github.com. See the original ↗