ENG-49Avoid
Reusing an old flag for new behaviour
Never give a retired flag name, or a still-present flag, a new meaning. A new behaviour gets a new flag.
How to do it
Any server still running old code reads the flag with its old meaning. In 2012 Knight Capital repurposed a flag that had once turned on retired trading code. One of eight servers missed the new code, ran the old path, and the firm lost more than 460 million dollars in about 45 minutes. Keep retired names in the flag register as retired, so nobody picks them again. Delete old code with its flag, as Remove flags that never change says.
How to check
A diff of the flag register finds no flag that kept its name while its description changed. No new flag uses a name marked retired.
Sources
Related rules
- ENG-45 Keep every flag in one register in Engineering
- ARC-60 Remove flags that never change in Clean code and architecture
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/feature-flags/reused-flag-names">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.