fix(retry): charge gate budget on any repeated failure fingerprint (#460)

gateFailureFingerprints held one slot per gate, so the budget only charged
when a failure repeated back to back. Whack-a-mole (fix A breaks B, fix B
breaks A) alternates two fingerprints forever, every round read as progress,
and the per-gate budget never triggered. Track the full set seen per gate and
charge when the current fingerprint is a repeat.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-02 14:12:47 +04:00
parent d69cb12ce9
commit 1ef845ed0f
5 changed files with 40 additions and 14 deletions
@@ -167,7 +167,7 @@ class OrchestrationReducerTest {
),
)
assertEquals(1, retried.gateRetryBudgets["contract"])
assertEquals("fp1", retried.gateFailureFingerprints["contract"])
assertEquals(setOf("fp1"), retried.gateFailureFingerprints["contract"])
}
@Test
@@ -191,7 +191,7 @@ class OrchestrationReducerTest {
),
)
assertEquals(1, free.gateRetryBudgets["contract"])
assertEquals("fp2", free.gateFailureFingerprints["contract"])
assertEquals(setOf("fp1", "fp2"), free.gateFailureFingerprints["contract"])
}
@Test