FAILURE MAP
← Case archive

FA-21151 / Assistive announcements / Open access

Quiet backlog is emitted when any nested scope leaves · case 01

The announcement trace violates the stated quiet-session contract.

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

ROOT CAUSE

Fault site: if was>0 and depth==0: is implemented as if was>0:

VERIFIED REPAIR

Restore the stated transition: if was>0 and depth==0:

Unsuccessful approach: The attempted repair substitutes if was>0 and depth<=1: and still violates a regression oracle.

Case contract

Quiet nesting is a counter. Enter increments; leave decrements without going negative. Ordinary messages during quiet replace a per-topic summary [latest,count], emergency speech always emits immediately. Final leave emits summaries in topic first-seen order as [topic,latest,count]. Remove-topic discards only that summary. Reset quiet silently discards backlog. Ordinary speech outside quiet emits directly with count1. Report output, nesting and pending summaries.

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):
    depth=0; pending={}; out=[]
    for e in events:
        if e[0]=='enter': depth+=1
        elif e[0]=='leave':
            was=depth; depth=max(0,depth-1)
            if was>0:
                out.extend([[k,v[0],v[1]] for k,v in pending.items()])
                pending.clear()
        elif e[0]=='reset': depth=0; pending.clear()
        elif e[0]=='remove': pending.pop(e[1],None)
        elif e[0]=='message':
            if e[3]=='emergency': out.append([e[1],e[2],1])
            elif depth:
                old=pending.get(e[1],['',0])
                pending[e[1]]=[e[2],old[1]+1]
            else: out.append([e[1],e[2],1])
    return [out,depth,[[k]+v for k,v in pending.items()]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enter'],['enter'],['message','a','first'*N,'normal'],['leave']]", "[['enter'],['message','z','old','normal'],['message','a','a'*N,'normal'],['message','z','new','normal'],['leave'],['enter'],['leave']]", "[['enter'],['message','a','urgent'*N,'emergency']]", "[['enter'],['message','a','urgent'*N,'emergency'],['message','b','deferred','normal'],['leave']]", "[['enter'],['message','a','a'*N,'normal'],['message','b','b','normal'],['remove','a']]", "[['enter'],['message','a','x'*N,'normal'],['reset']]", "[['message','a','direct'*N,'normal'],['leave'],['leave']]", "[['enter'],['message','a','x'*N,'normal'],['leave'],['leave']]"]
expected = {1: [[[], 1, [['a', 'first', 1]]], [[['z', 'new', 2], ['a', 'a', 1]], 0, []], [[['a', 'urgent', 1]], 1, []], [[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'direct', 1]], 0, []], [[['a', 'x', 1]], 0, []]], 2: [[[], 1, [['a', 'firstfirst', 1]]], [[['z', 'new', 2], ['a', 'aa', 1]], 0, []], [[['a', 'urgenturgent', 1]], 1, []], [[['a', 'urgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirect', 1]], 0, []], [[['a', 'xx', 1]], 0, []]], 3: [[[], 1, [['a', 'firstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaa', 1]], 0, []], [[['a', 'urgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirect', 1]], 0, []], [[['a', 'xxx', 1]], 0, []]], 4: [[[], 1, [['a', 'firstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirect', 1]], 0, []], [[['a', 'xxxx', 1]], 0, []]], 5: [[[], 1, [['a', 'firstfirstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirectdirect', 1]], 0, []], [[['a', 'xxxxx', 1]], 0, []]]}[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[[['a', 'first', 1]], 1, []][[], 1, [['a', 'first', 1]]]Failed
trace-2[[['z', 'new', 2], ['a', 'a', 1]], 0, []][[['z', 'new', 2], ['a', 'a', 1]], 0, []]Passed
trace-3[[['a', 'urgent', 1]], 1, []][[['a', 'urgent', 1]], 1, []]Passed
trace-4[[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []][[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []]Passed
trace-5[[], 1, [['b', 'b', 1]]][[], 1, [['b', 'b', 1]]]Passed
trace-6[[], 0, []][[], 0, []]Passed
trace-7[[['a', 'direct', 1]], 0, []][[['a', 'direct', 1]], 0, []]Passed
trace-8[[['a', 'x', 1]], 0, []][[['a', 'x', 1]], 0, []]Passed

SHA-256 / 2be70fd3a7f129de2d1b0b171b1d176618dfeefc89c47d4dcde7c1fe7d515db8

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    depth=0; pending={}; out=[]
    for e in events:
        if e[0]=='enter': depth+=1
        elif e[0]=='leave':
            was=depth; depth=max(0,depth-1)
            if was>0 and depth<=1:
                out.extend([[k,v[0],v[1]] for k,v in pending.items()])
                pending.clear()
        elif e[0]=='reset': depth=0; pending.clear()
        elif e[0]=='remove': pending.pop(e[1],None)
        elif e[0]=='message':
            if e[3]=='emergency': out.append([e[1],e[2],1])
            elif depth:
                old=pending.get(e[1],['',0])
                pending[e[1]]=[e[2],old[1]+1]
            else: out.append([e[1],e[2],1])
    return [out,depth,[[k]+v for k,v in pending.items()]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enter'],['enter'],['message','a','first'*N,'normal'],['leave']]", "[['enter'],['message','z','old','normal'],['message','a','a'*N,'normal'],['message','z','new','normal'],['leave'],['enter'],['leave']]", "[['enter'],['message','a','urgent'*N,'emergency']]", "[['enter'],['message','a','urgent'*N,'emergency'],['message','b','deferred','normal'],['leave']]", "[['enter'],['message','a','a'*N,'normal'],['message','b','b','normal'],['remove','a']]", "[['enter'],['message','a','x'*N,'normal'],['reset']]", "[['message','a','direct'*N,'normal'],['leave'],['leave']]", "[['enter'],['message','a','x'*N,'normal'],['leave'],['leave']]"]
expected = {1: [[[], 1, [['a', 'first', 1]]], [[['z', 'new', 2], ['a', 'a', 1]], 0, []], [[['a', 'urgent', 1]], 1, []], [[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'direct', 1]], 0, []], [[['a', 'x', 1]], 0, []]], 2: [[[], 1, [['a', 'firstfirst', 1]]], [[['z', 'new', 2], ['a', 'aa', 1]], 0, []], [[['a', 'urgenturgent', 1]], 1, []], [[['a', 'urgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirect', 1]], 0, []], [[['a', 'xx', 1]], 0, []]], 3: [[[], 1, [['a', 'firstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaa', 1]], 0, []], [[['a', 'urgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirect', 1]], 0, []], [[['a', 'xxx', 1]], 0, []]], 4: [[[], 1, [['a', 'firstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirect', 1]], 0, []], [[['a', 'xxxx', 1]], 0, []]], 5: [[[], 1, [['a', 'firstfirstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirectdirect', 1]], 0, []], [[['a', 'xxxxx', 1]], 0, []]]}[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[[['a', 'first', 1]], 1, []][[], 1, [['a', 'first', 1]]]Failed
trace-2[[['z', 'new', 2], ['a', 'a', 1]], 0, []][[['z', 'new', 2], ['a', 'a', 1]], 0, []]Passed
trace-3[[['a', 'urgent', 1]], 1, []][[['a', 'urgent', 1]], 1, []]Passed
trace-4[[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []][[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []]Passed
trace-5[[], 1, [['b', 'b', 1]]][[], 1, [['b', 'b', 1]]]Passed
trace-6[[], 0, []][[], 0, []]Passed
trace-7[[['a', 'direct', 1]], 0, []][[['a', 'direct', 1]], 0, []]Passed
trace-8[[['a', 'x', 1]], 0, []][[['a', 'x', 1]], 0, []]Passed

SHA-256 / f9ce2c4c0195b906fa32b4a3bce09808977079a00c717216c06a1b188bc7b243

3 / The verified repair

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

N = 1
observations = []
def solve(events):
    depth=0; pending={}; out=[]
    for e in events:
        if e[0]=='enter': depth+=1
        elif e[0]=='leave':
            was=depth; depth=max(0,depth-1)
            if was>0 and depth==0:
                out.extend([[k,v[0],v[1]] for k,v in pending.items()])
                pending.clear()
        elif e[0]=='reset': depth=0; pending.clear()
        elif e[0]=='remove': pending.pop(e[1],None)
        elif e[0]=='message':
            if e[3]=='emergency': out.append([e[1],e[2],1])
            elif depth:
                old=pending.get(e[1],['',0])
                pending[e[1]]=[e[2],old[1]+1]
            else: out.append([e[1],e[2],1])
    return [out,depth,[[k]+v for k,v in pending.items()]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['enter'],['enter'],['message','a','first'*N,'normal'],['leave']]", "[['enter'],['message','z','old','normal'],['message','a','a'*N,'normal'],['message','z','new','normal'],['leave'],['enter'],['leave']]", "[['enter'],['message','a','urgent'*N,'emergency']]", "[['enter'],['message','a','urgent'*N,'emergency'],['message','b','deferred','normal'],['leave']]", "[['enter'],['message','a','a'*N,'normal'],['message','b','b','normal'],['remove','a']]", "[['enter'],['message','a','x'*N,'normal'],['reset']]", "[['message','a','direct'*N,'normal'],['leave'],['leave']]", "[['enter'],['message','a','x'*N,'normal'],['leave'],['leave']]"]
expected = {1: [[[], 1, [['a', 'first', 1]]], [[['z', 'new', 2], ['a', 'a', 1]], 0, []], [[['a', 'urgent', 1]], 1, []], [[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'direct', 1]], 0, []], [[['a', 'x', 1]], 0, []]], 2: [[[], 1, [['a', 'firstfirst', 1]]], [[['z', 'new', 2], ['a', 'aa', 1]], 0, []], [[['a', 'urgenturgent', 1]], 1, []], [[['a', 'urgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirect', 1]], 0, []], [[['a', 'xx', 1]], 0, []]], 3: [[[], 1, [['a', 'firstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaa', 1]], 0, []], [[['a', 'urgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirect', 1]], 0, []], [[['a', 'xxx', 1]], 0, []]], 4: [[[], 1, [['a', 'firstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirect', 1]], 0, []], [[['a', 'xxxx', 1]], 0, []]], 5: [[[], 1, [['a', 'firstfirstfirstfirstfirst', 1]]], [[['z', 'new', 2], ['a', 'aaaaa', 1]], 0, []], [[['a', 'urgenturgenturgenturgenturgent', 1]], 1, []], [[['a', 'urgenturgenturgenturgenturgent', 1], ['b', 'deferred', 1]], 0, []], [[], 1, [['b', 'b', 1]]], [[], 0, []], [[['a', 'directdirectdirectdirectdirect', 1]], 0, []], [[['a', 'xxxxx', 1]], 0, []]]}[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[[], 1, [['a', 'first', 1]]][[], 1, [['a', 'first', 1]]]Passed
trace-2[[['z', 'new', 2], ['a', 'a', 1]], 0, []][[['z', 'new', 2], ['a', 'a', 1]], 0, []]Passed
trace-3[[['a', 'urgent', 1]], 1, []][[['a', 'urgent', 1]], 1, []]Passed
trace-4[[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []][[['a', 'urgent', 1], ['b', 'deferred', 1]], 0, []]Passed
trace-5[[], 1, [['b', 'b', 1]]][[], 1, [['b', 'b', 1]]]Passed
trace-6[[], 0, []][[], 0, []]Passed
trace-7[[['a', 'direct', 1]], 0, []][[['a', 'direct', 1]], 0, []]Passed
trace-8[[['a', 'x', 1]], 0, []][[['a', 'x', 1]], 0, []]Passed

SHA-256 / 1031369a1981ec50576770d1159fc7128c41c2f8c089569f3676f2f11a9da2b7

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:25.908060+00:00.

Case digest / e13217dcde88217f52e3f603b7639631ab8dba30a9b02d8e1c4296434c3db56b