FAILURE MAP
← Case archive

FA-20601 / Assistive announcements / Open access

Cancel removes unrelated pending speech · case 01

The announcement trace violates the stated deadline-scheduler contract.

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

ROOT CAUSE

Fault site: elif e[0]=='cancel': q=[x for x in q if x[0]!=e[1]] is implemented as elif e[0]=='cancel': q=[]

VERIFIED REPAIR

Restore the stated transition: elif e[0]=='cancel': q=[x for x in q if x[0]!=e[1]]

Unsuccessful approach: The attempted repair substitutes elif e[0]=='cancel': q=q[1:] and still violates a regression oracle.

Case contract

Enqueue [id,text,ready,expiry,priority]. Cancel removes all matching IDs. Tick sets monotonic clock; dispatch at most one eligible unexpired item, highest priority then earliest enqueue. Expiry is exclusive. Future items remain. Expired items are purged even without ready work. Successful dispatch removes precisely that entry. Clock reset clears queue. Report spoken IDs/text, pending IDs and clock.

Why this case matters

Deterministic controlled model of assistive announcement delivery.

1 / The failure

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

N = 1
observations = []
def solve(events):
    q=[]; spoken=[]; now=0; seq=0
    for e in events:
        if e[0]=='enqueue':
            seq+=1
            q.append([e[1],e[2],e[3],e[4],e[5],seq])
        elif e[0]=='cancel': q=[]
        elif e[0]=='reset': now=0; q.clear()
        elif e[0]=='tick':
            now=max(now,e[1])
            q=[x for x in q if x[3]>now]
            eligible=[x for x in q if x[2]<=now]
            if eligible:
                chosen=min(eligible,key=lambda x:(-x[4],x[5]))
                spoken.append(chosen[:2])
                q.remove(chosen)
    return [spoken,[x[0] for x in q],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enqueue','a','a'*N,0,100,1],['enqueue','b','b'*N,0,100,3],['enqueue','c','c',0,100,3],['tick',N],['tick',N],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N],['tick',N+1]]", "[['enqueue','a','expired'*N,0,N,1],['tick',N]]", "[['enqueue','a','gone',0,100,1],['enqueue','b','keep'*N,0,100,2],['cancel','missing'],['cancel','a'],['tick',N]]", "[['tick',N+5],['tick',N]]", "[['tick',N+5],['tick',N],['enqueue','a','old',0,100,1],['reset']]", '[]', "[['enqueue','r','first',N,100,1],['enqueue','s','second',0,100,1],['tick',N]]", "[['enqueue','z','first',0,100,1],['enqueue','a','second'*N,0,100,1],['tick',N]]"]
expected = {1: [[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1], [[], ['a'], 1], [[['a', 'wait']], [], 2], [[], [], 1], [[['b', 'keep']], [], 1], [[], [], 6], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 1], [[['z', 'first']], ['a'], 1]], 2: [[[['b', 'bb'], ['c', 'c'], ['a', 'aa']], [], 2], [[], ['a'], 2], [[['a', 'waitwait']], [], 3], [[], [], 2], [[['b', 'keepkeep']], [], 2], [[], [], 7], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 2], [[['z', 'first']], ['a'], 2]], 3: [[[['b', 'bbb'], ['c', 'c'], ['a', 'aaa']], [], 3], [[], ['a'], 3], [[['a', 'waitwaitwait']], [], 4], [[], [], 3], [[['b', 'keepkeepkeep']], [], 3], [[], [], 8], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 3], [[['z', 'first']], ['a'], 3]], 4: [[[['b', 'bbbb'], ['c', 'c'], ['a', 'aaaa']], [], 4], [[], ['a'], 4], [[['a', 'waitwaitwaitwait']], [], 5], [[], [], 4], [[['b', 'keepkeepkeepkeep']], [], 4], [[], [], 9], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 4], [[['z', 'first']], ['a'], 4]], 5: [[[['b', 'bbbbb'], ['c', 'c'], ['a', 'aaaaa']], [], 5], [[], ['a'], 5], [[['a', 'waitwaitwaitwaitwait']], [], 6], [[], [], 5], [[['b', 'keepkeepkeepkeepkeep']], [], 5], [[], [], 10], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 5], [[['z', 'first']], ['a'], 5]]}[N]
for i, expression in enumerate(fixtures):
    check("trace-"+str(i+1), solve(eval(expression)), expected[i])
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
trace-1[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1][[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1]Passed
trace-2[[], ['a'], 1][[], ['a'], 1]Passed
trace-3[[['a', 'wait']], [], 2][[['a', 'wait']], [], 2]Passed
trace-4[[], [], 1][[], [], 1]Passed
trace-5[[], [], 1][[['b', 'keep']], [], 1]Failed
trace-6[[], [], 6][[], [], 6]Passed
trace-7[[], [], 0][[], [], 0]Passed
trace-8[[], [], 0][[], [], 0]Passed
trace-9[[['r', 'first']], ['s'], 1][[['r', 'first']], ['s'], 1]Passed
trace-10[[['z', 'first']], ['a'], 1][[['z', 'first']], ['a'], 1]Passed

SHA-256 / a595a7b4fd3e8902c9e7ec0405f5c9e8d5caddda1e3b7b4d9a4f16d69aa242e6

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    q=[]; spoken=[]; now=0; seq=0
    for e in events:
        if e[0]=='enqueue':
            seq+=1
            q.append([e[1],e[2],e[3],e[4],e[5],seq])
        elif e[0]=='cancel': q=q[1:]
        elif e[0]=='reset': now=0; q.clear()
        elif e[0]=='tick':
            now=max(now,e[1])
            q=[x for x in q if x[3]>now]
            eligible=[x for x in q if x[2]<=now]
            if eligible:
                chosen=min(eligible,key=lambda x:(-x[4],x[5]))
                spoken.append(chosen[:2])
                q.remove(chosen)
    return [spoken,[x[0] for x in q],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enqueue','a','a'*N,0,100,1],['enqueue','b','b'*N,0,100,3],['enqueue','c','c',0,100,3],['tick',N],['tick',N],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N],['tick',N+1]]", "[['enqueue','a','expired'*N,0,N,1],['tick',N]]", "[['enqueue','a','gone',0,100,1],['enqueue','b','keep'*N,0,100,2],['cancel','missing'],['cancel','a'],['tick',N]]", "[['tick',N+5],['tick',N]]", "[['tick',N+5],['tick',N],['enqueue','a','old',0,100,1],['reset']]", '[]', "[['enqueue','r','first',N,100,1],['enqueue','s','second',0,100,1],['tick',N]]", "[['enqueue','z','first',0,100,1],['enqueue','a','second'*N,0,100,1],['tick',N]]"]
expected = {1: [[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1], [[], ['a'], 1], [[['a', 'wait']], [], 2], [[], [], 1], [[['b', 'keep']], [], 1], [[], [], 6], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 1], [[['z', 'first']], ['a'], 1]], 2: [[[['b', 'bb'], ['c', 'c'], ['a', 'aa']], [], 2], [[], ['a'], 2], [[['a', 'waitwait']], [], 3], [[], [], 2], [[['b', 'keepkeep']], [], 2], [[], [], 7], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 2], [[['z', 'first']], ['a'], 2]], 3: [[[['b', 'bbb'], ['c', 'c'], ['a', 'aaa']], [], 3], [[], ['a'], 3], [[['a', 'waitwaitwait']], [], 4], [[], [], 3], [[['b', 'keepkeepkeep']], [], 3], [[], [], 8], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 3], [[['z', 'first']], ['a'], 3]], 4: [[[['b', 'bbbb'], ['c', 'c'], ['a', 'aaaa']], [], 4], [[], ['a'], 4], [[['a', 'waitwaitwaitwait']], [], 5], [[], [], 4], [[['b', 'keepkeepkeepkeep']], [], 4], [[], [], 9], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 4], [[['z', 'first']], ['a'], 4]], 5: [[[['b', 'bbbbb'], ['c', 'c'], ['a', 'aaaaa']], [], 5], [[], ['a'], 5], [[['a', 'waitwaitwaitwaitwait']], [], 6], [[], [], 5], [[['b', 'keepkeepkeepkeepkeep']], [], 5], [[], [], 10], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 5], [[['z', 'first']], ['a'], 5]]}[N]
for i, expression in enumerate(fixtures):
    check("trace-"+str(i+1), solve(eval(expression)), expected[i])
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
trace-1[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1][[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1]Passed
trace-2[[], ['a'], 1][[], ['a'], 1]Passed
trace-3[[['a', 'wait']], [], 2][[['a', 'wait']], [], 2]Passed
trace-4[[], [], 1][[], [], 1]Passed
trace-5[[], [], 1][[['b', 'keep']], [], 1]Failed
trace-6[[], [], 6][[], [], 6]Passed
trace-7[[], [], 0][[], [], 0]Passed
trace-8[[], [], 0][[], [], 0]Passed
trace-9[[['r', 'first']], ['s'], 1][[['r', 'first']], ['s'], 1]Passed
trace-10[[['z', 'first']], ['a'], 1][[['z', 'first']], ['a'], 1]Passed

SHA-256 / 9b288f4b65a51d198f69af26c3c4ed1adb1f937de07ccd610b72c3978a0e5dc8

3 / The verified repair

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

N = 1
observations = []
def solve(events):
    q=[]; spoken=[]; now=0; seq=0
    for e in events:
        if e[0]=='enqueue':
            seq+=1
            q.append([e[1],e[2],e[3],e[4],e[5],seq])
        elif e[0]=='cancel': q=[x for x in q if x[0]!=e[1]]
        elif e[0]=='reset': now=0; q.clear()
        elif e[0]=='tick':
            now=max(now,e[1])
            q=[x for x in q if x[3]>now]
            eligible=[x for x in q if x[2]<=now]
            if eligible:
                chosen=min(eligible,key=lambda x:(-x[4],x[5]))
                spoken.append(chosen[:2])
                q.remove(chosen)
    return [spoken,[x[0] for x in q],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enqueue','a','a'*N,0,100,1],['enqueue','b','b'*N,0,100,3],['enqueue','c','c',0,100,3],['tick',N],['tick',N],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N]]", "[['enqueue','a','wait'*N,N+1,N+5,1],['tick',N],['tick',N+1]]", "[['enqueue','a','expired'*N,0,N,1],['tick',N]]", "[['enqueue','a','gone',0,100,1],['enqueue','b','keep'*N,0,100,2],['cancel','missing'],['cancel','a'],['tick',N]]", "[['tick',N+5],['tick',N]]", "[['tick',N+5],['tick',N],['enqueue','a','old',0,100,1],['reset']]", '[]', "[['enqueue','r','first',N,100,1],['enqueue','s','second',0,100,1],['tick',N]]", "[['enqueue','z','first',0,100,1],['enqueue','a','second'*N,0,100,1],['tick',N]]"]
expected = {1: [[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1], [[], ['a'], 1], [[['a', 'wait']], [], 2], [[], [], 1], [[['b', 'keep']], [], 1], [[], [], 6], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 1], [[['z', 'first']], ['a'], 1]], 2: [[[['b', 'bb'], ['c', 'c'], ['a', 'aa']], [], 2], [[], ['a'], 2], [[['a', 'waitwait']], [], 3], [[], [], 2], [[['b', 'keepkeep']], [], 2], [[], [], 7], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 2], [[['z', 'first']], ['a'], 2]], 3: [[[['b', 'bbb'], ['c', 'c'], ['a', 'aaa']], [], 3], [[], ['a'], 3], [[['a', 'waitwaitwait']], [], 4], [[], [], 3], [[['b', 'keepkeepkeep']], [], 3], [[], [], 8], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 3], [[['z', 'first']], ['a'], 3]], 4: [[[['b', 'bbbb'], ['c', 'c'], ['a', 'aaaa']], [], 4], [[], ['a'], 4], [[['a', 'waitwaitwaitwait']], [], 5], [[], [], 4], [[['b', 'keepkeepkeepkeep']], [], 4], [[], [], 9], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 4], [[['z', 'first']], ['a'], 4]], 5: [[[['b', 'bbbbb'], ['c', 'c'], ['a', 'aaaaa']], [], 5], [[], ['a'], 5], [[['a', 'waitwaitwaitwaitwait']], [], 6], [[], [], 5], [[['b', 'keepkeepkeepkeepkeep']], [], 5], [[], [], 10], [[], [], 0], [[], [], 0], [[['r', 'first']], ['s'], 5], [[['z', 'first']], ['a'], 5]]}[N]
for i, expression in enumerate(fixtures):
    check("trace-"+str(i+1), solve(eval(expression)), expected[i])
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
trace-1[[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1][[['b', 'b'], ['c', 'c'], ['a', 'a']], [], 1]Passed
trace-2[[], ['a'], 1][[], ['a'], 1]Passed
trace-3[[['a', 'wait']], [], 2][[['a', 'wait']], [], 2]Passed
trace-4[[], [], 1][[], [], 1]Passed
trace-5[[['b', 'keep']], [], 1][[['b', 'keep']], [], 1]Passed
trace-6[[], [], 6][[], [], 6]Passed
trace-7[[], [], 0][[], [], 0]Passed
trace-8[[], [], 0][[], [], 0]Passed
trace-9[[['r', 'first']], ['s'], 1][[['r', 'first']], ['s'], 1]Passed
trace-10[[['z', 'first']], ['a'], 1][[['z', 'first']], ['a'], 1]Passed

SHA-256 / b9de4f8d705c0de1a01c39bc7dcf2c74b8ce4c89b1d6dd6f18f12208ca9d3979

Verification & scope

Stipulated bounded policy, not a browser, speech engine, platform API, or standards conformance claim. 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:40:20.543639+00:00.

Case digest / 19befb0d6a026c73b4197fd583416f956af6da76fefd45e42c31184d0ab1f3bc