broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    leases={}; epochs={}; queue=[]; spoken=[]
    for e in events:
        if e[0]=='register':
            epochs[e[1]]=epochs.get(e[1],0)+1
            leases[e[1]]=[epochs[e[1]],'']
        elif e[0]=='publish':
            if e[1] not in leases: continue
            if e[2]!=leases[e[1]][0]: continue
            leases[e[1]][1]=e[3]
        elif e[0]=='queue' and e[1] in leases:
            queue.append([e[1],leases[e[1]][0],leases[e[1]][1]])
        elif e[0]=='remove': leases.pop(e[1],None)
        elif e[0]=='rename' and e[1] in leases:
            leases[e[2]]=leases.pop(e[1])
        elif e[0]=='drain':
            for source,epoch,text in queue:
                if source not in leases: continue
                if leases[source][0]!=epoch: continue
                if text: spoken.append(text)
            pass
    return [spoken,len(queue),sorted((k,v) for k,v in leases.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['register','a'],['publish','a',1,'old'*N],['queue','a'],['publish','a',1,'new'],['drain'],['drain']]", "[['register','a'],['publish','a',1,'old'],['queue','a'],['register','a'],['publish','a',1,'stale'*N],['queue','a'],['drain']]", "[['register','a'],['register','b'],['publish','b',1,'keep'*N],['remove','a'],['queue','b'],['drain']]", "[['register','a'],['publish','a',1,'hello'*N],['queue','a'],['rename','a','b'],['queue','b'],['drain']]", "[['register','a'],['queue','a'],['drain'],['publish','a',1,'  x  '*N],['queue','a'],['drain']]", "[['publish','missing',1,'x'*N],['remove','missing'],['drain']]", "[['register','a'],['publish','a',1,'x'*N],['queue','a'],['remove','a'],['drain']]"]
expected = {1: [[['old'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keep'], 0, [('b', [1, 'keep'])]], [['hello'], 0, [('b', [1, 'hello'])]], [['  x  '], 0, [('a', [1, '  x  '])]], [[], 0, []], [[], 0, []]], 2: [[['oldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeep'], 0, [('b', [1, 'keepkeep'])]], [['hellohello'], 0, [('b', [1, 'hellohello'])]], [['  x    x  '], 0, [('a', [1, '  x    x  '])]], [[], 0, []], [[], 0, []]], 3: [[['oldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeep'], 0, [('b', [1, 'keepkeepkeep'])]], [['hellohellohello'], 0, [('b', [1, 'hellohellohello'])]], [['  x    x    x  '], 0, [('a', [1, '  x    x    x  '])]], [[], 0, []], [[], 0, []]], 4: [[['oldoldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeepkeep'], 0, [('b', [1, 'keepkeepkeepkeep'])]], [['hellohellohellohello'], 0, [('b', [1, 'hellohellohellohello'])]], [['  x    x    x    x  '], 0, [('a', [1, '  x    x    x    x  '])]], [[], 0, []], [[], 0, []]], 5: [[['oldoldoldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeepkeepkeep'], 0, [('b', [1, 'keepkeepkeepkeepkeep'])]], [['hellohellohellohellohello'], 0, [('b', [1, 'hellohellohellohellohello'])]], [['  x    x    x    x    x  '], 0, [('a', [1, '  x    x    x    x    x  '])]], [[], 0, []], [[], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    leases={}; epochs={}; queue=[]; spoken=[]
    for e in events:
        if e[0]=='register':
            epochs[e[1]]=epochs.get(e[1],0)+1
            leases[e[1]]=[epochs[e[1]],'']
        elif e[0]=='publish':
            if e[1] not in leases: continue
            if e[2]!=leases[e[1]][0]: continue
            leases[e[1]][1]=e[3]
        elif e[0]=='queue' and e[1] in leases:
            queue.append([e[1],leases[e[1]][0],leases[e[1]][1]])
        elif e[0]=='remove': leases.pop(e[1],None)
        elif e[0]=='rename' and e[1] in leases:
            leases[e[2]]=leases.pop(e[1])
        elif e[0]=='drain':
            for source,epoch,text in queue:
                if source not in leases: continue
                if leases[source][0]!=epoch: continue
                if text: spoken.append(text)
            queue[:]=queue[-1:]
    return [spoken,len(queue),sorted((k,v) for k,v in leases.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['register','a'],['publish','a',1,'old'*N],['queue','a'],['publish','a',1,'new'],['drain'],['drain']]", "[['register','a'],['publish','a',1,'old'],['queue','a'],['register','a'],['publish','a',1,'stale'*N],['queue','a'],['drain']]", "[['register','a'],['register','b'],['publish','b',1,'keep'*N],['remove','a'],['queue','b'],['drain']]", "[['register','a'],['publish','a',1,'hello'*N],['queue','a'],['rename','a','b'],['queue','b'],['drain']]", "[['register','a'],['queue','a'],['drain'],['publish','a',1,'  x  '*N],['queue','a'],['drain']]", "[['publish','missing',1,'x'*N],['remove','missing'],['drain']]", "[['register','a'],['publish','a',1,'x'*N],['queue','a'],['remove','a'],['drain']]"]
expected = {1: [[['old'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keep'], 0, [('b', [1, 'keep'])]], [['hello'], 0, [('b', [1, 'hello'])]], [['  x  '], 0, [('a', [1, '  x  '])]], [[], 0, []], [[], 0, []]], 2: [[['oldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeep'], 0, [('b', [1, 'keepkeep'])]], [['hellohello'], 0, [('b', [1, 'hellohello'])]], [['  x    x  '], 0, [('a', [1, '  x    x  '])]], [[], 0, []], [[], 0, []]], 3: [[['oldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeep'], 0, [('b', [1, 'keepkeepkeep'])]], [['hellohellohello'], 0, [('b', [1, 'hellohellohello'])]], [['  x    x    x  '], 0, [('a', [1, '  x    x    x  '])]], [[], 0, []], [[], 0, []]], 4: [[['oldoldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeepkeep'], 0, [('b', [1, 'keepkeepkeepkeep'])]], [['hellohellohellohello'], 0, [('b', [1, 'hellohellohellohello'])]], [['  x    x    x    x  '], 0, [('a', [1, '  x    x    x    x  '])]], [[], 0, []], [[], 0, []]], 5: [[['oldoldoldoldold'], 0, [('a', [1, 'new'])]], [[], 0, [('a', [2, ''])]], [['keepkeepkeepkeepkeep'], 0, [('b', [1, 'keepkeepkeepkeepkeep'])]], [['hellohellohellohellohello'], 0, [('b', [1, 'hellohellohellohellohello'])]], [['  x    x    x    x    x  '], 0, [('a', [1, '  x    x    x    x    x  '])]], [[], 0, []], [[], 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)

prompt:
The announcement trace violates the stated context-lease contract.

Announcement context leases map source to [epoch,text]. Register increments the source epoch and clears its text; publish requires a live source and matching epoch. Queue snapshots text plus source epoch. Drain speaks only still-live matching leases. Remove revokes source. Rename transfers a source lease and invalidates queued old-source messages. Report spoken and queue depth.

split: open-access


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


prompt:
The announcement trace violates the stated deadline-scheduler 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value=text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private and text else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=value+': '+label
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value=value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+text
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(total)+' of '+str(pos)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>=0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value=role
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' '+role
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language='en'
        out.append([language,value])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([value,language])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    out=[]
    for text,role,pos,total,unit,negative,lang,private,label,detail in events:
        if not text and not private: continue
        value='hidden' if private else text
        if label: value=label+': '+value
        if negative: value='not '+value
        if unit and not private: value+=' '+unit
        if total>0: value=str(pos)+' of '+str(total)+': '+value
        if role: value+=' ('+role+')'
        if detail and detail!=text and not private: value+='; '+detail
        language=lang if lang else 'en'
        out.append([language,value.strip()])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['value'*N,'status',2,N+3,'items',True,'fr',False,'Count','detail']]", "[['secret'*N,'status',1,3,'kg',False,'en',True,'Weight','private detail']]", "[['','',0,0,'',False,'',False,'Label',''],['','',0,0,'',False,'',True,'','']]", "[['same'*N,'',0,-1,'',False,'de',False,'','same'*N]]", "[['  x  '*N,'',0,0,'',False,'',False,'','']]", '[]']
expected = {1: [[['fr', '2 of 4: not Count: value items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'same']], [['en', '  x  ']], []], 2: [[['fr', '2 of 5: not Count: valuevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesame']], [['en', '  x    x  ']], []], 3: [[['fr', '2 of 6: not Count: valuevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesame']], [['en', '  x    x    x  ']], []], 4: [[['fr', '2 of 7: not Count: valuevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesame']], [['en', '  x    x    x    x  ']], []], 5: [[['fr', '2 of 8: not Count: valuevaluevaluevaluevalue items (status); detail']], [['en', '1 of 3: Weight: hidden (status)']], [['en', 'hidden']], [['de', 'samesamesamesamesame']], [['en', '  x    x    x    x    x  ']], []]}[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)

prompt:
The announcement trace violates the stated speech-envelope contract.

Each input row is [text,role,ordinal,total,unit,negated,language,private,label,detail]. Compose a speech envelope: redact private values, prefix label, apply negation, append units, prepend ordinal of known positive total, append role, append nonempty detail once, preserve language fallback en, and omit empty nonprivate values. Return [language,spoken] pairs. This is an explicit product grammar, not natural language localization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]
        elif e[0]=='voice': voice=e[1]
        elif e[0]=='define': words[e[1]]=e[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]; words.pop(next(iter(words)),None) if words else None
        elif e[0]=='voice': voice=e[1]
        elif e[0]=='define': words[e[1]]=e[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

prompt:
The announcement trace violates the stated locale-snapshot contract.

Configure a current language, voice, and pronunciation dictionary. Queue captures text rendered with whole whitespace-delimited token substitutions plus current language and voice. Dictionary edits affect future queues only. Remove deletes one pronunciation. Voice reset restores default without changing language. Flush speaks queued envelopes FIFO. Language switch clears dictionary. Report spoken and queued envelopes.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]; words.clear()
        elif e[0]=='voice': lang=e[1]
        elif e[0]=='define': words[e[1]]=e[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]; words.clear()
        elif e[0]=='voice': voice=e[1]; words.clear()
        elif e[0]=='define': words[e[1]]=e[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

prompt:
The announcement trace violates the stated locale-snapshot contract.

Configure a current language, voice, and pronunciation dictionary. Queue captures text rendered with whole whitespace-delimited token substitutions plus current language and voice. Dictionary edits affect future queues only. Remove deletes one pronunciation. Voice reset restores default without changing language. Flush speaks queued envelopes FIFO. Language switch clears dictionary. Report spoken and queued envelopes.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]; words.clear()
        elif e[0]=='voice': voice=e[1]
        elif e[0]=='define': words.setdefault(e[1],e[2])
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    lang='en'; voice='default'; words={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='language': lang=e[1]; words.clear()
        elif e[0]=='voice': voice=e[1]
        elif e[0]=='define': words[e[1]]=e[1]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].split(' ')
            rendered=' '.join(words.get(token,token) for token in tokens)
            q.append([lang,voice,rendered])
        elif e[0]=='flush':
            spoken.extend(q)
            q.clear()
    return [spoken,q,lang,voice,sorted(words.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['language','fr'],['voice','alto'],['define','AI','A I'],['queue','AI '*N],['voice','bass'],['queue','AI'],['flush'],['flush']]", "[['define','a','first'],['define','a','second'],['queue','a '*N],['flush']]", "[['define','A','upper'],['define','a','lower'],['queue','A a Aa '*N],['remove','A'],['queue','A a'],['flush']]", "[['define','a','one'],['define','b','two'],['language','de'],['queue','a b '*N],['flush']]", "[['language','fr'],['define','a','ah'],['voice','alto'],['reset-voice'],['queue','a '*N],['flush']]", "[['queue','  x  '*N],['flush']]", '[]']
expected = {1: [[[['fr', 'alto', 'A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 2: [[[['fr', 'alto', 'A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 3: [[[['fr', 'alto', 'A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 4: [[[['fr', 'alto', 'A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]], 5: [[[['fr', 'alto', 'A I A I A I A I A I '], ['fr', 'bass', 'A I']], [], 'fr', 'bass', [('AI', 'A I')]], [[['en', 'default', 'second second second second second ']], [], 'en', 'default', [('a', 'second')]], [[['en', 'default', 'upper lower Aa upper lower Aa upper lower Aa upper lower Aa upper lower Aa '], ['en', 'default', 'A lower']], [], 'en', 'default', [('a', 'lower')]], [[['de', 'default', 'a b a b a b a b a b ']], [], 'de', 'default', []], [[['fr', 'default', 'ah ah ah ah ah ']], [], 'fr', 'default', [('a', 'ah')]], [[['en', 'default', '  x    x    x    x    x  ']], [], 'en', 'default', []], [[], [], 'en', 'default', []]]}[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)

prompt:
The announcement trace violates the stated locale-snapshot contract.

Configure a current language, voice, and pronunciation dictionary. Queue captures text rendered with whole whitespace-delimited token substitutions plus current language and voice. Dictionary edits affect future queues only. Remove deletes one pronunciation. Voice reset restores default without changing language. Flush speaks queued envelopes FIFO. Language switch clears dictionary. Report spoken and queued envelopes.

split: open-access