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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=max(0,e[1]-1)
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=1 if e[1] else 0
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pass
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.pop(0,None)
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=bool(pieces)
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=count>1
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if False: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened and not count: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<=count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if e[1]<0: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces.setdefault(e[1],e[2])
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=pieces.get(e[1],"")+e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear()
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count or count>0: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count or count==1: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(''.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in reversed(range(count))))
            pieces.clear(); opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            opened=False
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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):
    count=0; pieces={}; opened=False; spoken=[]
    for e in events:
        if e[0]=='begin':
            count=e[1]
            pieces.clear()
            opened=True
        elif e[0]=='put':
            if not opened: continue
            if not 0<=e[1]<count: continue
            pieces[e[1]]=e[2]
        elif e[0]=='cancel': pieces.clear(); opened=False
        elif e[0]=='seal':
            if not opened: continue
            if len(pieces)!=count: continue
            if count: spoken.append(' '.join(pieces[i] for i in range(count)))
            pieces.clear(); opened=True
    return [spoken, sorted(pieces), opened]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['begin',2],['put',1,'two'*N],['put',0,'one'],['seal'],['seal']]", "[['begin',2],['put',0,'old'],['put',0,'new'*N],['put',1,'end'],['seal']]", "[['begin',2],['put',1,'old'],['begin',2],['put',0,'fresh'*N],['seal']]", "[['begin',1],['put',1,'outside'*N],['put',0,'inside'],['seal']]", "[['begin',N],['put',0,'x'],['cancel'],['put',0,'late']]", "[['begin',0],['seal'],['seal']]", "[['begin',1],['put',0,'x'*N],['seal']]", "[['begin',2],['put',0,'partial'*N],['seal']]"]
expected = {1: [[['one two'], [], False], [['new end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['x'], [], False], [[], [0], True]], 2: [[['one twotwo'], [], False], [['newnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xx'], [], False], [[], [0], True]], 3: [[['one twotwotwo'], [], False], [['newnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxx'], [], False], [[], [0], True]], 4: [[['one twotwotwotwo'], [], False], [['newnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxx'], [], False], [[], [0], True]], 5: [[['one twotwotwotwotwo'], [], False], [['newnewnewnewnew end'], [], False], [[], [0], True], [['inside'], [], False], [[], [], False], [[], [], False], [['xxxxx'], [], False], [[], [0], 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 chunk-assembly contract.

Utterance chunks carry a sequence index. Begin sets expected count and clears previous chunks. Put accepts only in-range indices; last write wins. Seal emits only a contiguous complete set, in index order, joined by spaces. A successful seal clears pieces and closes the assembly. Cancel closes without speech; reopen starts a new assembly. Report emitted strings and pending indices.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append(list(frames[-1]) if frames else [])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames=[]; frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[0].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].insert(0,e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: pass
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken=[e[1]]
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop(0)
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=list(frames[-1])
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1]=batch
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1]=batch+frames[-1]
            else: spoken.extend(batch)
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access


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

N = 1
observations = []
def solve(events):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(reversed(batch))
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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):
    frames=[]; spoken=[]
    for e in events:
        op=e[0]
        if op=='begin': frames.append([])
        elif op=='append':
            if frames: frames[-1].append(e[1])
            else: spoken.append(e[1])
        elif op=='commit' and frames:
            batch=frames.pop()
            if frames: frames[-1].extend(batch)
            else: spoken.extend(batch[:1])
        elif op=='rollback' and frames: frames.pop()
        elif op=='replace' and frames:
            if frames[-1]: frames[-1][-1]=e[1]
            else: frames[-1].append(e[1])
        elif op=='clear' and frames: frames[-1].clear()
        elif op=='flush': pass
    return [spoken,frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = ["[['append','outside'*N],['append','second'],['begin'],['append','first'],['append','second'],['replace','fixed'*N],['flush'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['commit'],['commit']]", "[['begin'],['append','outer'*N],['begin'],['append','inner'],['rollback'],['commit']]", "[['append','spoken'*N],['begin'],['append','hidden'],['clear'],['append','new'],['commit']]", "[['begin'],['replace','new'*N],['commit']]", "[['begin'],['append','x'*N],['clear']]", "[['commit'],['rollback'],['clear'],['flush']]", "[['begin'],['append','a'*N],['begin'],['append','b']]"]
expected = {1: [[['outside', 'second', 'first', 'fixed'], []], [['outer', 'inner'], []], [['outer'], []], [['spoken', 'new'], []], [['new'], []], [[], [[]]], [[], []], [[], [['a'], ['b']]]], 2: [[['outsideoutside', 'second', 'first', 'fixedfixed'], []], [['outerouter', 'inner'], []], [['outerouter'], []], [['spokenspoken', 'new'], []], [['newnew'], []], [[], [[]]], [[], []], [[], [['aa'], ['b']]]], 3: [[['outsideoutsideoutside', 'second', 'first', 'fixedfixedfixed'], []], [['outerouterouter', 'inner'], []], [['outerouterouter'], []], [['spokenspokenspoken', 'new'], []], [['newnewnew'], []], [[], [[]]], [[], []], [[], [['aaa'], ['b']]]], 4: [[['outsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixed'], []], [['outerouterouterouter', 'inner'], []], [['outerouterouterouter'], []], [['spokenspokenspokenspoken', 'new'], []], [['newnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaa'], ['b']]]], 5: [[['outsideoutsideoutsideoutsideoutside', 'second', 'first', 'fixedfixedfixedfixedfixed'], []], [['outerouterouterouterouter', 'inner'], []], [['outerouterouterouterouter'], []], [['spokenspokenspokenspokenspoken', 'new'], []], [['newnewnewnewnew'], []], [[], [[]]], [[], []], [[], [['aaaaa'], ['b']]]]}[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 announcement-transaction contract.

Nested announcement transactions stage text. Begin pushes a frame; append outside a frame speaks immediately. Commit merges into parent or speaks outer contents in order; rollback discards only the top frame. Replace edits only last staged item or appends when empty. Clear empties top frame. Flush cannot expose staged text. Report spoken and nested staged frames.

split: open-access