# Fix Loop Rules

When tests fail the AI may attempt fixes.

Maximum fix iterations: 3

After 3 failed attempts the AI must:

1. stop modifying code
2. analyze the failure
3. produce a diagnosis instead of more edits