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

N = 1
observations = []
def solve(events):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[0]=e[2]
            elif e[0]=='commit':
                if not(row[1] and row[2]): continue
                out.append(row[0])
                del pending[e[1]]
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[:]=[e[2],False,False]
            elif e[0]=='commit':
                if not(row[1] and row[2]): continue
                out.append(row[0])
                del pending[e[1]]
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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 dual-channel-barrier contract.

An announcement delivery couples speech and braille with per-message receipts. Submit creates [text,speechDone=False,brailleDone=False]. Speech and braille ACK set only their channel. Commit emits completion once only when both acknowledged and removes message. Disable-braille marks pending braille complete and affects future submissions; enable only affects future submissions. Replace text resets both receipts according to current enabled channels. Cancel drops one pending item. Report completion text, pending receipts and braille enabled.

split: open-access


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

N = 1
observations = []
def solve(events):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[:]=[e[2],False,not braille]
            elif e[0]=='commit':
                if not(row[1] or row[2]): continue
                out.append(row[0])
                del pending[e[1]]
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[:]=[e[2],False,not braille]
            elif e[0]=='commit':
                if not row[1]: continue
                out.append(row[0])
                del pending[e[1]]
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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 dual-channel-barrier contract.

An announcement delivery couples speech and braille with per-message receipts. Submit creates [text,speechDone=False,brailleDone=False]. Speech and braille ACK set only their channel. Commit emits completion once only when both acknowledged and removes message. Disable-braille marks pending braille complete and affects future submissions; enable only affects future submissions. Replace text resets both receipts according to current enabled channels. Cancel drops one pending item. Report completion text, pending receipts and braille enabled.

split: open-access


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

N = 1
observations = []
def solve(events):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[:]=[e[2],False,not braille]
            elif e[0]=='commit':
                if not(row[1] and row[2]): continue
                out.append(row[0])
                pass
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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):
    pending={}; braille=True; out=[]
    for e in events:
        if e[0]=='submit': pending[e[1]]=[e[2],False,not braille]
        elif e[0]=='disable-braille':
            braille=False
            for row in pending.values(): row[2]=True
        elif e[0]=='enable-braille': braille=True
        elif e[0]=='cancel': pending.pop(e[1],None)
        elif len(e)>1 and e[1] in pending:
            row=pending[e[1]]
            if e[0]=='speech': row[1]=True
            elif e[0]=='braille': row[2]=True
            elif e[0]=='replace': row[:]=[e[2],False,not braille]
            elif e[0]=='commit':
                if not(row[1] and row[2]): continue
                out.append(row[0])
                pending.clear()
    return [out,[[k]+v for k,v in pending.items()],braille]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['submit','a','hello'*N],['speech','a'],['commit','a']]", "[['submit','a','hello'*N],['braille','a'],['commit','a']]", "[['submit','a','hello'*N],['speech','a'],['braille','a'],['submit','b','keep'],['commit','a'],['commit','a']]", "[['submit','a','old'],['speech','a'],['braille','a'],['replace','a','new'*N],['commit','a']]", "[['submit','a','pending'*N],['disable-braille'],['commit','a'],['submit','b','future'],['speech','b'],['commit','b'],['enable-braille']]", "[['disable-braille'],['submit','a','new'*N],['commit','a']]", "[['disable-braille'],['submit','a','old'],['replace','a','new'*N],['speech','a'],['commit','a']]", "[['submit','a','a'*N],['submit','b','b'],['cancel','a']]", '[]']
expected = {1: [[[], [['a', 'hello', True, False]], True], [[], [['a', 'hello', False, True]], True], [['hello'], [['b', 'keep', False, False]], True], [[], [['a', 'new', False, False]], True], [['future'], [['a', 'pending', False, True]], True], [[], [['a', 'new', False, True]], False], [['new'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 2: [[[], [['a', 'hellohello', True, False]], True], [[], [['a', 'hellohello', False, True]], True], [['hellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnew', False, False]], True], [['future'], [['a', 'pendingpending', False, True]], True], [[], [['a', 'newnew', False, True]], False], [['newnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 3: [[[], [['a', 'hellohellohello', True, False]], True], [[], [['a', 'hellohellohello', False, True]], True], [['hellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpending', False, True]], True], [[], [['a', 'newnewnew', False, True]], False], [['newnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 4: [[[], [['a', 'hellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohello', False, True]], True], [['hellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnew', False, True]], False], [['newnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]], 5: [[[], [['a', 'hellohellohellohellohello', True, False]], True], [[], [['a', 'hellohellohellohellohello', False, True]], True], [['hellohellohellohellohello'], [['b', 'keep', False, False]], True], [[], [['a', 'newnewnewnewnew', False, False]], True], [['future'], [['a', 'pendingpendingpendingpendingpending', False, True]], True], [[], [['a', 'newnewnewnewnew', False, True]], False], [['newnewnewnewnew'], [], False], [[], [['b', 'b', False, False]], True], [[], [], True]]}[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 dual-channel-barrier contract.

An announcement delivery couples speech and braille with per-message receipts. Submit creates [text,speechDone=False,brailleDone=False]. Speech and braille ACK set only their channel. Commit emits completion once only when both acknowledged and removes message. Disable-braille marks pending braille complete and affects future submissions; enable only affects future submissions. Replace text resets both receipts according to current enabled channels. Cancel drops one pending item. Report completion text, pending receipts and braille enabled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['preedit'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':'','composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 start completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['preedit']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['query'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 preedit completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [d['preedit']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return []
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 schedule completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['preedit'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 finalize completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['preedit'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':True}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 cancel completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return d['preedit']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 candidate completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [d['preedit']]
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 visibility completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':d['pending'],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 invalidate completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['preedit']+d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['query']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 display-end completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':d['active'],'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['final']
    if event == 'rebase': return {'active':None,'query':d['preedit']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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 rebase completion transition produces an incorrect observable state.

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

split: open-access