tscircuit's printed-circuit-board (PCB) autorouter had a dangerous definition of improvement: accept a repair whenever the design-rule-checking (DRC) error count fell. On one A13 board fixture, the repair moved traces away from existing overlaps and into memory pads on other electrical nets. The total got smaller while the board acquired new shorts.
The router now records which two copper objects participate in every zero-clearance contact. Its final refinement and safe-layer cleanup reject any candidate that introduces a pair absent from the current route, even if other errors disappear. Tests cover trace-to-trace, trace-to-pad, trace-to-via, and via-to-pad contacts, plus malformed reports that can't identify both objects.
Optimization scores are compact, but they erase which failure became worse. Any automated board repair should carry a small set of non-negotiable conditions beside its score: no new short, no missing connection, and no newly blocked keepout. tscircuit's bug shows why those conditions need named object pairs that a regression can compare, rather than another weight in the objective function.