FAILURE MAP
← Case archive

FA-10326 / Observability / Open access

Alert evaluation state transition: Firing is delayed by an extra observation · case 01

Firing is delayed by an extra observation.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation substitutes count > required for count >= required, so firing is delayed by an extra observation.

VERIFIED REPAIR

Fire at and beyond the required consecutive observation count.

Unsuccessful approach: The attempted repair substitutes count == required. Fixture 8 still yields ('pending', 4) instead of ('firing', 4).

Case contract

Disabled rules become disabled; absent observations become no-data; explicit evaluation error becomes error; values above threshold become firing after required consecutive count, otherwise pending; healthy observations reset count to zero.

Why this case matters

An offline model of alert evaluation state transition, suitable for testing build and release tooling without external services.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(enabled, value, error, threshold, count, required):
    if not enabled: return ('disabled', 0)
    if error: return ('error', count)
    if value is None: return ('no-data', count)
    if value <= threshold: return ('ok', 0)
    count += 1
    return ('firing' if count > required else 'pending', count)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(False, 9, False, 5, 2, 3), ('disabled', 0))
check('fixture 2', solve(True, 9, True, 5, 2, 3), ('error', 2))
check('fixture 3', solve(True, None, False, 5, 2, 3), ('no-data', 2))
check('fixture 4', solve(True, 5, False, 5, 2, 3), ('ok', 0))
check('fixture 5', solve(True, 4, False, 5, 2, 3), ('ok', 0))
check('fixture 6', solve(True, 6, False, 5, 1, 3), ('pending', 2))
check('fixture 7', solve(True, 6, False, 5, 2, 3), ('firing', 3))
check('fixture 8', solve(True, 6, False, 5, 3, 3), ('firing', 4))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['disabled', 0]['disabled', 0]Passed
fixture 2['error', 2]['error', 2]Passed
fixture 3['no-data', 2]['no-data', 2]Passed
fixture 4['ok', 0]['ok', 0]Passed
fixture 5['ok', 0]['ok', 0]Passed
fixture 6['pending', 2]['pending', 2]Passed
fixture 7['pending', 3]['firing', 3]Failed
fixture 8['firing', 4]['firing', 4]Passed

SHA-256 / 602c08e6f6bc5a09eda293b9cd61d5c2d7fde375775be84f6d1077c3baa3481c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(enabled, value, error, threshold, count, required):
    if not enabled: return ('disabled', 0)
    if error: return ('error', count)
    if value is None: return ('no-data', count)
    if value <= threshold: return ('ok', 0)
    count += 1
    return ('firing' if count == required else 'pending', count)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(False, 9, False, 5, 2, 3), ('disabled', 0))
check('fixture 2', solve(True, 9, True, 5, 2, 3), ('error', 2))
check('fixture 3', solve(True, None, False, 5, 2, 3), ('no-data', 2))
check('fixture 4', solve(True, 5, False, 5, 2, 3), ('ok', 0))
check('fixture 5', solve(True, 4, False, 5, 2, 3), ('ok', 0))
check('fixture 6', solve(True, 6, False, 5, 1, 3), ('pending', 2))
check('fixture 7', solve(True, 6, False, 5, 2, 3), ('firing', 3))
check('fixture 8', solve(True, 6, False, 5, 3, 3), ('firing', 4))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['disabled', 0]['disabled', 0]Passed
fixture 2['error', 2]['error', 2]Passed
fixture 3['no-data', 2]['no-data', 2]Passed
fixture 4['ok', 0]['ok', 0]Passed
fixture 5['ok', 0]['ok', 0]Passed
fixture 6['pending', 2]['pending', 2]Passed
fixture 7['firing', 3]['firing', 3]Passed
fixture 8['pending', 4]['firing', 4]Failed

SHA-256 / d09f9d401282161f0143637f7c4c0273399fd4bdfffdc3c2a2b2209b1bb14bd2

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(enabled, value, error, threshold, count, required):
    if not enabled: return ('disabled', 0)
    if error: return ('error', count)
    if value is None: return ('no-data', count)
    if value <= threshold: return ('ok', 0)
    count += 1
    return ('firing' if count >= required else 'pending', count)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(False, 9, False, 5, 2, 3), ('disabled', 0))
check('fixture 2', solve(True, 9, True, 5, 2, 3), ('error', 2))
check('fixture 3', solve(True, None, False, 5, 2, 3), ('no-data', 2))
check('fixture 4', solve(True, 5, False, 5, 2, 3), ('ok', 0))
check('fixture 5', solve(True, 4, False, 5, 2, 3), ('ok', 0))
check('fixture 6', solve(True, 6, False, 5, 1, 3), ('pending', 2))
check('fixture 7', solve(True, 6, False, 5, 2, 3), ('firing', 3))
check('fixture 8', solve(True, 6, False, 5, 3, 3), ('firing', 4))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1['disabled', 0]['disabled', 0]Passed
fixture 2['error', 2]['error', 2]Passed
fixture 3['no-data', 2]['no-data', 2]Passed
fixture 4['ok', 0]['ok', 0]Passed
fixture 5['ok', 0]['ok', 0]Passed
fixture 6['pending', 2]['pending', 2]Passed
fixture 7['firing', 3]['firing', 3]Passed
fixture 8['firing', 4]['firing', 4]Passed

SHA-256 / 35c4b559190c1ca2e050e8d7eb5ff1ba4510b8a78cb28644c58185ff701d959c

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:38.005466+00:00.

Case digest / 2adedb5ab32d4183209c4acc8a805170b84c05d81cc5d45dede6a6df68643cf3