The fixture set is only as good as its source of truth. If your retry policy hardcodes a set of reason codes in a switch statement and your tests hardcode a different set in a fixture file, you have two lists that will disagree within a quarter. The fix is to define one machine-readable list (a JSON or YAML file, or an enum generated from it) and have both the policy and the fixture generator compile from it.
That single list should carry more than the code string. Each entry needs the classification (retryable, terminal, or retry-after-guidance), the escalation target, and a human description. This mirrors how typed contracts prevent drift between agents: if a payload violates the schema, it fails validation instead of silently corrupting downstream state, which is the argument made in MLflow's orchestration guidance. The same logic applies to error classification: an unclassified code is a contract gap, not a surprise.
A minimal entry looks like this:
{
"code": "RATE_LIMITED",
"retryable": true,
"max_attempts": 5,
"escalate_to": "queue",
"description": "Short-term quota exhausted"
}
Keep this file in version control next to the policy. When someone adds a code, they add an entry, and the build check described later forces them to add a fixture in the same change.



