FA-10316 / Observability / Open access
Alert evaluation state transition: Missing observations clear alert history · case 01
Missing observations clear alert history.
ROOT CAUSE
The implementation substitutes if value is None: return ('ok', 0) for if value is None: return ('no-data', count), so missing observations clear alert history.
VERIFIED REPAIR
Keep a distinct no-data state without resetting count.
Unsuccessful approach: The attempted repair substitutes if value is None: return ('no-data', 0). Fixture 3 still yields ('no-data', 0) instead of ('no-data', 2).
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 ('ok', 0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | ['disabled', 0] | ['disabled', 0] | Passed |
| fixture 2 | ['error', 2] | ['error', 2] | Passed |
| fixture 3 | ['ok', 0] | ['no-data', 2] | Failed |
| 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 / ed049d3ab1edccfa45cf744653f4ba7823dcfa6063a11f2e135d79030bf8979b
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', 0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | ['disabled', 0] | ['disabled', 0] | Passed |
| fixture 2 | ['error', 2] | ['error', 2] | Passed |
| fixture 3 | ['no-data', 0] | ['no-data', 2] | Failed |
| 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 / e9128b916937c3fdba3092536e4b370b18a8b4271388f5fec63857cbfc6af8ea
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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:37.986369+00:00.
Case digest / 8878fbfe57213dea7d3e22807300d8deda3b847df56038c33d4f9ac2d6610dde