FAILURE MAP
← Case archive

FA-21241 / Assistive announcements / Open access

New speech turn adds budget left from previous turn · case 01

The announcement trace violates the stated speech-time-budget contract.

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

ROOT CAUSE

Fault site: if e[0]=='begin': remaining=min(cap,max(0,e[1])) is implemented as if e[0]=='begin': remaining=min(cap,remaining+max(0,e[1]))

THE FAILURE

Fault site: if e[0]=='begin': remaining=min(cap,max(0,e[1])) is implemented as if e[0]=='begin': remaining=min(cap,remaining+max(0,e[1]))

Unsuccessful approach: The attempted repair substitutes if e[0]=='begin': remaining=max(0,e[1]) and still violates a regression oracle.

Case contract

Each turn has a spoken-character budget. Enqueue [id,text,cost] with positive cost. Begin replaces remaining budget. Pump selects first queued job that fits, allowing later small jobs to bypass large ones; sends one and subtracts its cost. Refund restores cost of a sent ID once, without requeueing. Cancel removes only unsent ID. Cap limits remaining credit immediately. Reset clears queue and refund ledger. Return speech IDs, queue IDs, remaining, cap.

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):
    remaining=0; cap=100; q=[]; spent={}; out=[]
    for e in events:
        if e[0]=='begin': remaining=min(cap,remaining+max(0,e[1]))
        elif e[0]=='enqueue': q.append(e[1:])
        elif e[0]=='cap': cap=max(0,e[1]); remaining=min(remaining,cap)
        elif e[0]=='cancel': q=[x for x in q if x[0]!=e[1]]
        elif e[0]=='refund' and e[1] in spent:
            remaining=min(cap,remaining+spent.pop(e[1]))
        elif e[0]=='reset': q=[]; spent={}; remaining=0
        elif e[0]=='pump':
            index=next((i for i,x in enumerate(q) if x[2]<=remaining),None)
            if index is not None:
                ident,text,cost=q.pop(index)
                remaining-=cost
                spent[ident]=cost
                out.append([ident,text])
    return [out,[x[0] for x in q],remaining,cap]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',N+4],['enqueue','big','large',N+8],['enqueue','small','tiny',N+1],['pump'],['refund','small'],['refund','small']]", "[['begin',N],['enqueue','exact','x'*N,N],['pump']]", "[['begin',N+5],['begin',2]]", "[['begin',N+5],['begin',2],['cap',1],['cap',8]]", "[['cap',3],['begin',N+10]]", "[['enqueue','a','alpha'*N,2],['enqueue','b','beta',1],['cancel','b']]", "[['begin',N+10],['enqueue','a','alpha',2],['pump'],['refund','a']]", "[['begin',N+5],['enqueue','a','alpha',2],['pump']]", "[['begin',N+5],['enqueue','a','alpha',2],['enqueue','b','beta',1],['pump'],['reset'],['refund','a']]", '[]']
expected = {1: [[[['small', 'tiny']], ['big'], 5, 100], [[['exact', 'x']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 11, 100], [[['a', 'alpha']], [], 4, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 2: [[[['small', 'tiny']], ['big'], 6, 100], [[['exact', 'xx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 12, 100], [[['a', 'alpha']], [], 5, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 3: [[[['small', 'tiny']], ['big'], 7, 100], [[['exact', 'xxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 13, 100], [[['a', 'alpha']], [], 6, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 4: [[[['small', 'tiny']], ['big'], 8, 100], [[['exact', 'xxxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 14, 100], [[['a', 'alpha']], [], 7, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 5: [[[['small', 'tiny']], ['big'], 9, 100], [[['exact', 'xxxxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 15, 100], [[['a', 'alpha']], [], 8, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]]}[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[[['small', 'tiny']], ['big'], 5, 100][[['small', 'tiny']], ['big'], 5, 100]Passed
trace-2[[['exact', 'x']], [], 0, 100][[['exact', 'x']], [], 0, 100]Passed
trace-3[[], [], 8, 100][[], [], 2, 100]Failed
trace-4[[], [], 1, 8][[], [], 1, 8]Passed
trace-5[[], [], 3, 3][[], [], 3, 3]Passed
trace-6[[], ['a'], 0, 100][[], ['a'], 0, 100]Passed
trace-7[[['a', 'alpha']], [], 11, 100][[['a', 'alpha']], [], 11, 100]Passed
trace-8[[['a', 'alpha']], [], 4, 100][[['a', 'alpha']], [], 4, 100]Passed
trace-9[[['a', 'alpha']], [], 0, 100][[['a', 'alpha']], [], 0, 100]Passed
trace-10[[], [], 0, 100][[], [], 0, 100]Passed

SHA-256 / 59b1a6b6ca8d54b896176ec8b3f36d41cc81bcbd9550482afd4e9e5f8aa0d9e9

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(events):
    remaining=0; cap=100; q=[]; spent={}; out=[]
    for e in events:
        if e[0]=='begin': remaining=max(0,e[1])
        elif e[0]=='enqueue': q.append(e[1:])
        elif e[0]=='cap': cap=max(0,e[1]); remaining=min(remaining,cap)
        elif e[0]=='cancel': q=[x for x in q if x[0]!=e[1]]
        elif e[0]=='refund' and e[1] in spent:
            remaining=min(cap,remaining+spent.pop(e[1]))
        elif e[0]=='reset': q=[]; spent={}; remaining=0
        elif e[0]=='pump':
            index=next((i for i,x in enumerate(q) if x[2]<=remaining),None)
            if index is not None:
                ident,text,cost=q.pop(index)
                remaining-=cost
                spent[ident]=cost
                out.append([ident,text])
    return [out,[x[0] for x in q],remaining,cap]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',N+4],['enqueue','big','large',N+8],['enqueue','small','tiny',N+1],['pump'],['refund','small'],['refund','small']]", "[['begin',N],['enqueue','exact','x'*N,N],['pump']]", "[['begin',N+5],['begin',2]]", "[['begin',N+5],['begin',2],['cap',1],['cap',8]]", "[['cap',3],['begin',N+10]]", "[['enqueue','a','alpha'*N,2],['enqueue','b','beta',1],['cancel','b']]", "[['begin',N+10],['enqueue','a','alpha',2],['pump'],['refund','a']]", "[['begin',N+5],['enqueue','a','alpha',2],['pump']]", "[['begin',N+5],['enqueue','a','alpha',2],['enqueue','b','beta',1],['pump'],['reset'],['refund','a']]", '[]']
expected = {1: [[[['small', 'tiny']], ['big'], 5, 100], [[['exact', 'x']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 11, 100], [[['a', 'alpha']], [], 4, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 2: [[[['small', 'tiny']], ['big'], 6, 100], [[['exact', 'xx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 12, 100], [[['a', 'alpha']], [], 5, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 3: [[[['small', 'tiny']], ['big'], 7, 100], [[['exact', 'xxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 13, 100], [[['a', 'alpha']], [], 6, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 4: [[[['small', 'tiny']], ['big'], 8, 100], [[['exact', 'xxxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 14, 100], [[['a', 'alpha']], [], 7, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]], 5: [[[['small', 'tiny']], ['big'], 9, 100], [[['exact', 'xxxxx']], [], 0, 100], [[], [], 2, 100], [[], [], 1, 8], [[], [], 3, 3], [[], ['a'], 0, 100], [[['a', 'alpha']], [], 15, 100], [[['a', 'alpha']], [], 8, 100], [[['a', 'alpha']], [], 0, 100], [[], [], 0, 100]]}[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[[['small', 'tiny']], ['big'], 5, 100][[['small', 'tiny']], ['big'], 5, 100]Passed
trace-2[[['exact', 'x']], [], 0, 100][[['exact', 'x']], [], 0, 100]Passed
trace-3[[], [], 2, 100][[], [], 2, 100]Passed
trace-4[[], [], 1, 8][[], [], 1, 8]Passed
trace-5[[], [], 11, 3][[], [], 3, 3]Failed
trace-6[[], ['a'], 0, 100][[], ['a'], 0, 100]Passed
trace-7[[['a', 'alpha']], [], 11, 100][[['a', 'alpha']], [], 11, 100]Passed
trace-8[[['a', 'alpha']], [], 4, 100][[['a', 'alpha']], [], 4, 100]Passed
trace-9[[['a', 'alpha']], [], 0, 100][[['a', 'alpha']], [], 0, 100]Passed
trace-10[[], [], 0, 100][[], [], 0, 100]Passed

SHA-256 / 5d3999aa533ecf50233fee06f8f7c5dafa4f68a60b620a99c6df7f016c5b18e8

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / f468c8224d3e864edd1db75ce776160097dfdc4b5f159b7bbf04f041b107355e