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[e[1]]=e[2]
        elif e[0]=='remove': words.clear()
        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[2]
        elif e[0]=='remove': words.pop(e[1].lower(),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[e[1]]=e[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'; lang='en'
        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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'; words.clear()
        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[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[2]
        elif e[0]=='remove': words.pop(e[1],None)
        elif e[0]=='reset-voice': voice='default'
        elif e[0]=='queue':
            tokens=e[1].strip().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[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.lower(),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[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.upper(),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[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,'default',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[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(['en',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[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(reversed(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[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[-1:])
            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[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)
            pass
    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[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[:]=q[:1]
    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):
    floors={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='floor': floors[e[1]]=max(floors.get(e[1],0),e[2])
        elif e[0]=='enqueue': q.append(e[1:])
        elif e[0]=='drop':
            q=[x for x in q if x[1]!=e[1]]
            floors.pop(e[1],None)
        elif e[0]=='move':
            for x in q:
                if x[0]==e[1]: x[1]=e[2]
        elif e[0]=='reset': floors.pop(e[1],None)
        elif e[0]=='drain' and q:
            scores=[max(x[2],floors.get(x[1],0)) for x in q]
            index=scores.index(max(scores))
            chosen=q.pop(index)
            spoken.append([chosen[0],chosen[3]])
    return [spoken,[x[:2] for x in q],sorted(floors.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['floor','g',4],['enqueue','a','g',N+1,'alpha'],['enqueue','b','h',6,'beta'],['drain'],['drain']]", "[['enqueue','a','g',1,'first'*N],['enqueue','b','g',1,'second'],['drain']]", "[['floor','g',9],['floor','g',1],['enqueue','a','g',2,'a'*N],['enqueue','b','h',3,'b'],['drain']]", "[['floor','g',9],['floor','h',3],['enqueue','a','g',1,'x'*N],['enqueue','foreign','h',2,'foreign'],['drop','g'],['enqueue','b','g',1,'new'],['enqueue','c','h',2,'keep'],['drain']]", "[['floor','g',9],['floor','h',4],['enqueue','a','g',1,'a'*N],['enqueue','b','h',2,'b'],['move','a','h'],['reset','g'],['drain']]", '[]', "[['floor','g',2],['enqueue','a','g',8,'a'*N],['enqueue','b','h',7,'b'],['drain']]"]
expected = {1: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'first']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'a']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'a']], [['b', 'h']], [('g', 2)]]], 2: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aa']], [['b', 'h']], [('g', 2)]]], 3: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaa']], [['b', 'h']], [('g', 2)]]], 4: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaaa']], [['b', 'h']], [('g', 2)]]], 5: [[[['a', 'alpha'], ['b', 'beta']], [], [('g', 4)]], [[['a', 'firstfirstfirstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaaaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaaaa']], [['b', 'h']], [('g', 2)]]]}[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):
    floors={}; q=[]; spoken=[]
    for e in events:
        if e[0]=='floor': floors.setdefault(e[1],e[2])
        elif e[0]=='enqueue': q.append(e[1:])
        elif e[0]=='drop':
            q=[x for x in q if x[1]!=e[1]]
            floors.pop(e[1],None)
        elif e[0]=='move':
            for x in q:
                if x[0]==e[1]: x[1]=e[2]
        elif e[0]=='reset': floors.pop(e[1],None)
        elif e[0]=='drain' and q:
            scores=[max(x[2],floors.get(x[1],0)) for x in q]
            index=scores.index(max(scores))
            chosen=q.pop(index)
            spoken.append([chosen[0],chosen[3]])
    return [spoken,[x[:2] for x in q],sorted(floors.items())]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['floor','g',4],['enqueue','a','g',N+1,'alpha'],['enqueue','b','h',6,'beta'],['drain'],['drain']]", "[['enqueue','a','g',1,'first'*N],['enqueue','b','g',1,'second'],['drain']]", "[['floor','g',9],['floor','g',1],['enqueue','a','g',2,'a'*N],['enqueue','b','h',3,'b'],['drain']]", "[['floor','g',9],['floor','h',3],['enqueue','a','g',1,'x'*N],['enqueue','foreign','h',2,'foreign'],['drop','g'],['enqueue','b','g',1,'new'],['enqueue','c','h',2,'keep'],['drain']]", "[['floor','g',9],['floor','h',4],['enqueue','a','g',1,'a'*N],['enqueue','b','h',2,'b'],['move','a','h'],['reset','g'],['drain']]", '[]', "[['floor','g',2],['enqueue','a','g',8,'a'*N],['enqueue','b','h',7,'b'],['drain']]"]
expected = {1: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'first']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'a']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'a']], [['b', 'h']], [('g', 2)]]], 2: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aa']], [['b', 'h']], [('g', 2)]]], 3: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaa']], [['b', 'h']], [('g', 2)]]], 4: [[[['b', 'beta'], ['a', 'alpha']], [], [('g', 4)]], [[['a', 'firstfirstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaaa']], [['b', 'h']], [('g', 2)]]], 5: [[[['a', 'alpha'], ['b', 'beta']], [], [('g', 4)]], [[['a', 'firstfirstfirstfirstfirst']], [['b', 'g']], []], [[['b', 'b']], [['a', 'g']], [('g', 1)]], [[['foreign', 'foreign']], [['b', 'g'], ['c', 'h']], [('h', 3)]], [[['a', 'aaaaa']], [['b', 'h']], [('h', 4)]], [[], [], []], [[['a', 'aaaaa']], [['b', 'h']], [('g', 2)]]]}[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 priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


prompt:
The announcement trace violates the stated priority-inheritance contract.

Messages belong to groups. Set group priority affects future selection, not stored base. Enqueue [id,group,base,text]. Group floor combines with base using max. Drain picks largest effective priority, then earliest position; repeat drains remove only winner. Drop-group removes its messages and floor. Move changes only a message group. Reset-floor removes inheritance but retains messages. Report spoken IDs and pending [id,group].

split: open-access


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

N = 1
observations = []
def solve(events):
    window=3; now=0; pending={}; spoken=[]
    for e in events:
        if e[0]=='window': window=e[1]
        elif e[0]=='update':
            if e[1] in pending:
                pending[e[1]][1]=e[2]
                pending[e[1]][2]+=1
            else: pending[e[1]]=[now+window,e[2],1]
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif e[0]=='force' and e[1] in pending:
            row=pending.pop(e[1]); spoken.append([e[1],row[1],row[2]])
        elif e[0]=='tick':
            now=max(now,e[1])
            ready=sorted([k for k,v in pending.items() if v[0]<=now],key=lambda k:pending[k][0])
            for k in ready:
                row=pending.pop(k)
                spoken.append([k,row[1],row[2]])
    return [spoken,[[k]+v for k,v in pending.items()],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['window',N],['update','z','first'],['update','z','last'*N],['tick',N]]", "[['tick',N+3],['window',2],['update','a','x'*N]]", "[['tick',N+3],['window',2],['update','a','x'*N],['tick',N+4],['tick',N+5]]", "[['window',0],['update','a','x'*N],['tick',0]]", "[['update','a','first'*N],['update','b','keep'],['cancel','b']]", "[['update','a','x'],['update','a','y'*N],['force','a'],['tick',10]]", "[['window',1],['update','z','early'*N],['window',3],['update','a','late'],['tick',N+4],['tick',0]]", '[]']
expected = {1: [[[['z', 'last', 2]], [], 1], [[], [['a', 6, 'x', 1]], 4], [[['a', 'x', 1]], [], 6], [[], [['a', 1, 'x', 1]], 0], [[], [['a', 3, 'first', 1]], 0], [[['a', 'y', 2]], [], 10], [[['z', 'early', 1], ['a', 'late', 1]], [], 5], [[], [], 0]], 2: [[[['z', 'lastlast', 2]], [], 2], [[], [['a', 7, 'xx', 1]], 5], [[['a', 'xx', 1]], [], 7], [[], [['a', 1, 'xx', 1]], 0], [[], [['a', 3, 'firstfirst', 1]], 0], [[['a', 'yy', 2]], [], 10], [[['z', 'earlyearly', 1], ['a', 'late', 1]], [], 6], [[], [], 0]], 3: [[[['z', 'lastlastlast', 2]], [], 3], [[], [['a', 8, 'xxx', 1]], 6], [[['a', 'xxx', 1]], [], 8], [[], [['a', 1, 'xxx', 1]], 0], [[], [['a', 3, 'firstfirstfirst', 1]], 0], [[['a', 'yyy', 2]], [], 10], [[['z', 'earlyearlyearly', 1], ['a', 'late', 1]], [], 7], [[], [], 0]], 4: [[[['z', 'lastlastlastlast', 2]], [], 4], [[], [['a', 9, 'xxxx', 1]], 7], [[['a', 'xxxx', 1]], [], 9], [[], [['a', 1, 'xxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirst', 1]], 0], [[['a', 'yyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearly', 1], ['a', 'late', 1]], [], 8], [[], [], 0]], 5: [[[['z', 'lastlastlastlastlast', 2]], [], 5], [[], [['a', 10, 'xxxxx', 1]], 8], [[['a', 'xxxxx', 1]], [], 10], [[], [['a', 1, 'xxxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirstfirst', 1]], 0], [[['a', 'yyyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearlyearly', 1], ['a', 'late', 1]], [], 9], [[], [], 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):
    window=3; now=0; pending={}; spoken=[]
    for e in events:
        if e[0]=='window': window=3
        elif e[0]=='update':
            if e[1] in pending:
                pending[e[1]][1]=e[2]
                pending[e[1]][2]+=1
            else: pending[e[1]]=[now+window,e[2],1]
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif e[0]=='force' and e[1] in pending:
            row=pending.pop(e[1]); spoken.append([e[1],row[1],row[2]])
        elif e[0]=='tick':
            now=max(now,e[1])
            ready=sorted([k for k,v in pending.items() if v[0]<=now],key=lambda k:pending[k][0])
            for k in ready:
                row=pending.pop(k)
                spoken.append([k,row[1],row[2]])
    return [spoken,[[k]+v for k,v in pending.items()],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['window',N],['update','z','first'],['update','z','last'*N],['tick',N]]", "[['tick',N+3],['window',2],['update','a','x'*N]]", "[['tick',N+3],['window',2],['update','a','x'*N],['tick',N+4],['tick',N+5]]", "[['window',0],['update','a','x'*N],['tick',0]]", "[['update','a','first'*N],['update','b','keep'],['cancel','b']]", "[['update','a','x'],['update','a','y'*N],['force','a'],['tick',10]]", "[['window',1],['update','z','early'*N],['window',3],['update','a','late'],['tick',N+4],['tick',0]]", '[]']
expected = {1: [[[['z', 'last', 2]], [], 1], [[], [['a', 6, 'x', 1]], 4], [[['a', 'x', 1]], [], 6], [[], [['a', 1, 'x', 1]], 0], [[], [['a', 3, 'first', 1]], 0], [[['a', 'y', 2]], [], 10], [[['z', 'early', 1], ['a', 'late', 1]], [], 5], [[], [], 0]], 2: [[[['z', 'lastlast', 2]], [], 2], [[], [['a', 7, 'xx', 1]], 5], [[['a', 'xx', 1]], [], 7], [[], [['a', 1, 'xx', 1]], 0], [[], [['a', 3, 'firstfirst', 1]], 0], [[['a', 'yy', 2]], [], 10], [[['z', 'earlyearly', 1], ['a', 'late', 1]], [], 6], [[], [], 0]], 3: [[[['z', 'lastlastlast', 2]], [], 3], [[], [['a', 8, 'xxx', 1]], 6], [[['a', 'xxx', 1]], [], 8], [[], [['a', 1, 'xxx', 1]], 0], [[], [['a', 3, 'firstfirstfirst', 1]], 0], [[['a', 'yyy', 2]], [], 10], [[['z', 'earlyearlyearly', 1], ['a', 'late', 1]], [], 7], [[], [], 0]], 4: [[[['z', 'lastlastlastlast', 2]], [], 4], [[], [['a', 9, 'xxxx', 1]], 7], [[['a', 'xxxx', 1]], [], 9], [[], [['a', 1, 'xxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirst', 1]], 0], [[['a', 'yyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearly', 1], ['a', 'late', 1]], [], 8], [[], [], 0]], 5: [[[['z', 'lastlastlastlastlast', 2]], [], 5], [[], [['a', 10, 'xxxxx', 1]], 8], [[['a', 'xxxxx', 1]], [], 10], [[], [['a', 1, 'xxxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirstfirst', 1]], 0], [[['a', 'yyyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearlyearly', 1], ['a', 'late', 1]], [], 9], [[], [], 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 coalescing-window contract.

Per-source announcements coalesce during an explicit tick window. First update opens [deadline=now+window,text,count]. Further updates replace text, increment count, and never slide deadline. Tick monotonically advances now and emits due sources by deadline then source insertion order as [source,text,count]. Force emits one source immediately. Cancel removes one source. Changing window affects future openings only. Return spoken, pending and now.

split: open-access


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

N = 1
observations = []
def solve(events):
    window=3; now=0; pending={}; spoken=[]
    for e in events:
        if e[0]=='window': window=max(1,e[1])
        elif e[0]=='update':
            if e[1] in pending:
                pending[e[1]][1]+=e[2]
                pending[e[1]][2]+=1
            else: pending[e[1]]=[now+window,e[2],1]
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif e[0]=='force' and e[1] in pending:
            row=pending.pop(e[1]); spoken.append([e[1],row[1],row[2]])
        elif e[0]=='tick':
            now=max(now,e[1])
            ready=sorted([k for k,v in pending.items() if v[0]<=now],key=lambda k:pending[k][0])
            for k in ready:
                row=pending.pop(k)
                spoken.append([k,row[1],row[2]])
    return [spoken,[[k]+v for k,v in pending.items()],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['window',N],['update','z','first'],['update','z','last'*N],['tick',N]]", "[['tick',N+3],['window',2],['update','a','x'*N]]", "[['tick',N+3],['window',2],['update','a','x'*N],['tick',N+4],['tick',N+5]]", "[['window',0],['update','a','x'*N],['tick',0]]", "[['update','a','first'*N],['update','b','keep'],['cancel','b']]", "[['update','a','x'],['update','a','y'*N],['force','a'],['tick',10]]", "[['window',1],['update','z','early'*N],['window',3],['update','a','late'],['tick',N+4],['tick',0]]", '[]']
expected = {1: [[[['z', 'last', 2]], [], 1], [[], [['a', 6, 'x', 1]], 4], [[['a', 'x', 1]], [], 6], [[], [['a', 1, 'x', 1]], 0], [[], [['a', 3, 'first', 1]], 0], [[['a', 'y', 2]], [], 10], [[['z', 'early', 1], ['a', 'late', 1]], [], 5], [[], [], 0]], 2: [[[['z', 'lastlast', 2]], [], 2], [[], [['a', 7, 'xx', 1]], 5], [[['a', 'xx', 1]], [], 7], [[], [['a', 1, 'xx', 1]], 0], [[], [['a', 3, 'firstfirst', 1]], 0], [[['a', 'yy', 2]], [], 10], [[['z', 'earlyearly', 1], ['a', 'late', 1]], [], 6], [[], [], 0]], 3: [[[['z', 'lastlastlast', 2]], [], 3], [[], [['a', 8, 'xxx', 1]], 6], [[['a', 'xxx', 1]], [], 8], [[], [['a', 1, 'xxx', 1]], 0], [[], [['a', 3, 'firstfirstfirst', 1]], 0], [[['a', 'yyy', 2]], [], 10], [[['z', 'earlyearlyearly', 1], ['a', 'late', 1]], [], 7], [[], [], 0]], 4: [[[['z', 'lastlastlastlast', 2]], [], 4], [[], [['a', 9, 'xxxx', 1]], 7], [[['a', 'xxxx', 1]], [], 9], [[], [['a', 1, 'xxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirst', 1]], 0], [[['a', 'yyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearly', 1], ['a', 'late', 1]], [], 8], [[], [], 0]], 5: [[[['z', 'lastlastlastlastlast', 2]], [], 5], [[], [['a', 10, 'xxxxx', 1]], 8], [[['a', 'xxxxx', 1]], [], 10], [[], [['a', 1, 'xxxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirstfirst', 1]], 0], [[['a', 'yyyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearlyearly', 1], ['a', 'late', 1]], [], 9], [[], [], 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):
    window=3; now=0; pending={}; spoken=[]
    for e in events:
        if e[0]=='window': window=max(1,e[1])
        elif e[0]=='update':
            if e[1] in pending:
                pending[e[1]][1]=e[2][:1]
                pending[e[1]][2]+=1
            else: pending[e[1]]=[now+window,e[2],1]
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif e[0]=='force' and e[1] in pending:
            row=pending.pop(e[1]); spoken.append([e[1],row[1],row[2]])
        elif e[0]=='tick':
            now=max(now,e[1])
            ready=sorted([k for k,v in pending.items() if v[0]<=now],key=lambda k:pending[k][0])
            for k in ready:
                row=pending.pop(k)
                spoken.append([k,row[1],row[2]])
    return [spoken,[[k]+v for k,v in pending.items()],now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['window',N],['update','z','first'],['update','z','last'*N],['tick',N]]", "[['tick',N+3],['window',2],['update','a','x'*N]]", "[['tick',N+3],['window',2],['update','a','x'*N],['tick',N+4],['tick',N+5]]", "[['window',0],['update','a','x'*N],['tick',0]]", "[['update','a','first'*N],['update','b','keep'],['cancel','b']]", "[['update','a','x'],['update','a','y'*N],['force','a'],['tick',10]]", "[['window',1],['update','z','early'*N],['window',3],['update','a','late'],['tick',N+4],['tick',0]]", '[]']
expected = {1: [[[['z', 'last', 2]], [], 1], [[], [['a', 6, 'x', 1]], 4], [[['a', 'x', 1]], [], 6], [[], [['a', 1, 'x', 1]], 0], [[], [['a', 3, 'first', 1]], 0], [[['a', 'y', 2]], [], 10], [[['z', 'early', 1], ['a', 'late', 1]], [], 5], [[], [], 0]], 2: [[[['z', 'lastlast', 2]], [], 2], [[], [['a', 7, 'xx', 1]], 5], [[['a', 'xx', 1]], [], 7], [[], [['a', 1, 'xx', 1]], 0], [[], [['a', 3, 'firstfirst', 1]], 0], [[['a', 'yy', 2]], [], 10], [[['z', 'earlyearly', 1], ['a', 'late', 1]], [], 6], [[], [], 0]], 3: [[[['z', 'lastlastlast', 2]], [], 3], [[], [['a', 8, 'xxx', 1]], 6], [[['a', 'xxx', 1]], [], 8], [[], [['a', 1, 'xxx', 1]], 0], [[], [['a', 3, 'firstfirstfirst', 1]], 0], [[['a', 'yyy', 2]], [], 10], [[['z', 'earlyearlyearly', 1], ['a', 'late', 1]], [], 7], [[], [], 0]], 4: [[[['z', 'lastlastlastlast', 2]], [], 4], [[], [['a', 9, 'xxxx', 1]], 7], [[['a', 'xxxx', 1]], [], 9], [[], [['a', 1, 'xxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirst', 1]], 0], [[['a', 'yyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearly', 1], ['a', 'late', 1]], [], 8], [[], [], 0]], 5: [[[['z', 'lastlastlastlastlast', 2]], [], 5], [[], [['a', 10, 'xxxxx', 1]], 8], [[['a', 'xxxxx', 1]], [], 10], [[], [['a', 1, 'xxxxx', 1]], 0], [[], [['a', 3, 'firstfirstfirstfirstfirst', 1]], 0], [[['a', 'yyyyy', 2]], [], 10], [[['z', 'earlyearlyearlyearlyearly', 1], ['a', 'late', 1]], [], 9], [[], [], 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 coalescing-window contract.

Per-source announcements coalesce during an explicit tick window. First update opens [deadline=now+window,text,count]. Further updates replace text, increment count, and never slide deadline. Tick monotonically advances now and emits due sources by deadline then source insertion order as [source,text,count]. Force emits one source immediately. Cancel removes one source. Changing window affects future openings only. Return spoken, pending and now.

split: open-access