---
title: "Keep known bugs pinned until their own fix · Agent Wranglers"
url: https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/pin-known-bugs
id: TKO-9
level: Recommended
updated: 2026-10-22
tokens: 621
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep known bugs pinned until their own fix

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Characterization tests](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: TKO-9
- Level: Recommended
- Chapter: [Characterization tests](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests.md)
- Rule: When a characterization test records a bug, keep the buggy output as expected and link the test to a ticket. Fix the bug in a separate change that updates that one test.
- Check: No pull request both restructures code and changes a characterization test's expected output. Every characterization test whose name says bug links a ticket ID.
- How: A refactor that also fixes bugs cannot show that it changed nothing else. Some customers may depend on the bug, such as a report that rounds the wrong way. Name the test after the behaviour, such as `charges VAT twice on gift cards (bug ORD-112)`. The fix then changes one expected value and nothing more, as [Explain every difference in an intended change](https://agentwranglers.se/playbook/testing/output-comparison/expected-differences.md) says.

## Related rules

- TST-43 [Explain every difference in an intended change](https://agentwranglers.se/playbook/testing/output-comparison/expected-differences.md) in Testing
- TKO-17 [Compare old and new answers before switching a route](https://agentwranglers.se/playbook/codebase-takeover/leaving-an-ai-builder/shadow-compare.md) in Codebase takeover

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/pin-known-bugs">Agent Wranglers codebase takeover playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Pin today's behaviour before changing code](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/pin-behaviour-first.md)
- Next: [Cut a seam before testing hard code](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/cut-a-seam.md)
- [Characterization tests](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests.md)
