FAILURE MAP
← Case archive

FA-24731 / Client state / Open access

A successful background refresh leaves the preceding error attempt visible · case 01

A successful background refresh leaves the preceding error attempt visible.

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

ROOT CAUSE

The faulty implementation violates Failure appends an error to a bounded history, success clears it, other events retain it, and capacity zero retains no errors.

VERIFIED REPAIR

Failure appends an error to a bounded history, success clears it, other events retain it, and capacity zero retains no errors.

Unsuccessful approach: The partial repair still violates at least one explicit regression oracle.

Case contract

Failure appends an error to a bounded history, success clears it, other events retain it, and capacity zero retains no errors.

Why this case matters

A bounded offline client-state transition with explicit lifecycle inputs.

1 / The failure

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

N = 1
observations = []
def solve(history, event, payload, capacity):
    return (history+[payload])[-capacity:] if event=='failure' else history
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success clears', solve(['old'],'success',None,N), [])
check('failure bound', solve(list(range(N+1)),'failure',99,N), (list(range(N+1))+[99])[-N:])
check('zero history budget', solve(['old'],'failure','new',0), [])
check('start does not add error', solve(['old'],'start',None,2), ['old'])
check('empty text retained', solve([],'failure','',2), [''])
check('idle truncates existing', solve(['a','b'],'idle',None,1), ['b'])
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
success clears['old'][]Failed
failure bound[99][99]Passed
zero history budget['old', 'new'][]Failed
start does not add error['old']['old']Passed
empty text retained['']['']Passed
idle truncates existing['a', 'b']['b']Failed

SHA-256 / b70fca9fb8790ac6896c1171f58743b7a7801edcb2f40ac8050604f55774f581

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(history, event, payload, capacity):
    return [] if event=='success' else (history+[payload])[-capacity:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success clears', solve(['old'],'success',None,N), [])
check('failure bound', solve(list(range(N+1)),'failure',99,N), (list(range(N+1))+[99])[-N:])
check('zero history budget', solve(['old'],'failure','new',0), [])
check('start does not add error', solve(['old'],'start',None,2), ['old'])
check('empty text retained', solve([],'failure','',2), [''])
check('idle truncates existing', solve(['a','b'],'idle',None,1), ['b'])
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
success clears[][]Passed
failure bound[99][99]Passed
zero history budget['old', 'new'][]Failed
start does not add error['old', None]['old']Failed
empty text retained['']['']Passed
idle truncates existing[None]['b']Failed

SHA-256 / 40f8f39b794f7cdc61cad7c87b98d72e0588c397d343c9070058a6e63402dc81

3 / The verified repair

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

N = 1
observations = []
def solve(history, event, payload, capacity):
    updated=history+[payload] if event=='failure' else ([] if event=='success' else list(history))
    return updated[-capacity:] if capacity>0 else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success clears', solve(['old'],'success',None,N), [])
check('failure bound', solve(list(range(N+1)),'failure',99,N), (list(range(N+1))+[99])[-N:])
check('zero history budget', solve(['old'],'failure','new',0), [])
check('start does not add error', solve(['old'],'start',None,2), ['old'])
check('empty text retained', solve([],'failure','',2), [''])
check('idle truncates existing', solve(['a','b'],'idle',None,1), ['b'])
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
success clears[][]Passed
failure bound[99][99]Passed
zero history budget[][]Passed
start does not add error['old']['old']Passed
empty text retained['']['']Passed
idle truncates existing['b']['b']Passed

SHA-256 / f7c299e1091a4b3835e9e5e37ea394385cc2b295ae6dfe6335be56881fb6a4e3

Verification & scope

This models the stated application policy only; no browser or framework conformance is claimed. 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:41:00.161012+00:00.

Case digest / 820c20930d832055f1620a5d93d31db668f766ed2086dc6ca8f53c5532ff628a