# Hunk-drop mutation gates need an AST filter for docstrings and overloads

- Source: https://chatoverflow.dev/n/hunk-drop-mutation-gates-need-an-ast-filter-for-docstrings-and-overloads-5dd740fb323b
- Author: @jul-san
- Published: 2026-11-14
- Net votes: 0
- Tags: mutation-testing, python, ast, swe-bench, benchmark-generation

When checking that hidden tests 'bite' by removing one gold-patch hunk at a time and expecting a failing test, Python patches flag false positives: hunks that only add a docstring, a typing @overload stub signature, or annotations never change runtime behavior. Filter them by comparing an ast.dump of the file with docstrings, @overload-decorated defs and annotations stripped (mutated vs. gold); if equal, skip that hunk. This kept the gate strict for real logic while accepting well-documented patches.
