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

N = 1
observations = []
def solve(dependencies, changed):
    return bool(changed)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ancestor changed', solve(['user.name'],['user']), True)
check('descendant changed', solve(['user'],['user.name']), True)
check('segment boundary', solve(['user'],['username']), False)
check('unrelated', solve(['user.name'],['count']), False)
check('empty change', solve(['a'],[]), False)
check('parameterized descendant', solve(['a'],['a.'+'.'.join(['x']*N)]), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(dependencies, changed):
    return any(d==c for d in dependencies for c in changed)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ancestor changed', solve(['user.name'],['user']), True)
check('descendant changed', solve(['user'],['user.name']), True)
check('segment boundary', solve(['user'],['username']), False)
check('unrelated', solve(['user.name'],['count']), False)
check('empty change', solve(['a'],[]), False)
check('parameterized descendant', solve(['a'],['a.'+'.'.join(['x']*N)]), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
External-store selectors rerun for unrelated changed paths.

A selector invalidates only when a changed dot-separated path equals, contains, or is contained by one of its declared dependency paths at a segment boundary.

split: open-access


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

N = 1
observations = []
def solve(routes, resolved):
    return [key for key,parent in routes if key not in resolved]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('root ready only', solve([('root',None),('child','root')],[]), ['root'])
check('child after parent', solve([('root',None),('child','root')],['root']), ['child'])
check('siblings', solve([('a','root'),('b','root')],['root']), ['a','b'])
check('all settled', solve([('a',None)],['a']), [])
check('missing parent', solve([('a','missing')],[]), [])
check('parameterized chain', solve([(str(i),None if i==0 else str(i-1)) for i in range(N+2)],[str(i) for i in range(N)]), [str(N)])
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(routes, resolved):
    return [key for key,parent in routes if key not in resolved and parent is None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('root ready only', solve([('root',None),('child','root')],[]), ['root'])
check('child after parent', solve([('root',None),('child','root')],['root']), ['child'])
check('siblings', solve([('a','root'),('b','root')],['root']), ['a','b'])
check('all settled', solve([('a',None)],['a']), [])
check('missing parent', solve([('a','missing')],[]), [])
check('parameterized chain', solve([(str(i),None if i==0 else str(i-1)) for i in range(N+2)],[str(i) for i in range(N)]), [str(N)])
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:
A child loader is started before its parent route data is available.

A route loader starts only after its immediate parent data is resolved; settled loaders do not restart, and siblings preserve declaration order.

split: open-access


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

N = 1
observations = []
def solve(events, dwell):
    return list(dict.fromkeys(key for time,kind,key in events if kind=='enter'))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leave cancels', solve([(0,'enter','a'),(1,'leave','a'),(5,'tick','')],3), [])
check('dwell threshold', solve([(0,'enter','a'),(N,'tick','')],N), ['a'])
check('not yet due', solve([(0,'enter','a'),(1,'tick','')],2), [])
check('one launch', solve([(0,'enter','a'),(3,'tick',''),(5,'tick','')],2), ['a'])
check('reentry resets dwell', solve([(0,'enter','a'),(1,'leave','a'),(3,'enter','a'),(4,'tick','')],2), [])
check('independent links', solve([(0,'enter','a'),(1,'enter','b'),(2,'leave','a'),(3,'tick','')],2), ['b'])
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, dwell):
    active={}
    started=[]
    for time,kind,key in events:
        if kind=='enter': active[key]=time
        elif kind=='tick':
            for candidate,start in list(active.items()):
                if time-start>=dwell:
                    started.append(candidate); del active[candidate]
    return started
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leave cancels', solve([(0,'enter','a'),(1,'leave','a'),(5,'tick','')],3), [])
check('dwell threshold', solve([(0,'enter','a'),(N,'tick','')],N), ['a'])
check('not yet due', solve([(0,'enter','a'),(1,'tick','')],2), [])
check('one launch', solve([(0,'enter','a'),(3,'tick',''),(5,'tick','')],2), ['a'])
check('reentry resets dwell', solve([(0,'enter','a'),(1,'leave','a'),(3,'enter','a'),(4,'tick','')],2), [])
check('independent links', solve([(0,'enter','a'),(1,'enter','b'),(2,'leave','a'),(3,'tick','')],2), ['b'])
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:
A pointer leaves a link but its speculative prefetch still starts.

Pointer dwell schedules per-link prefetch intent; leave cancels it, reentry restarts its clock, and each uninterrupted dwell starts at most once.

split: open-access


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

N = 1
observations = []
def solve(disposers):
    done=[]; errors=[]
    for name,failed in reversed(disposers):
        done.append(name)
        if failed: errors.append(name); break
    return done,errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('failure does not stop', solve([('outer',False),('inner',True)]), (['inner','outer'],['inner']))
check('multiple failures', solve([('a',True),('b',True)]), (['b','a'],['b','a']))
check('normal lifo', solve([('a',False),('b',False)]), (['b','a'],[]))
check('none registered', solve([]), ([],[]))
check('one failed', solve([('a',True)]), (['a'],['a']))
check('parameterized stack', solve([(str(i),False) for i in range(N+2)]), ([str(i) for i in reversed(range(N+2))],[]))
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(disposers):
    return [name for name,failed in disposers],[name for name,failed in disposers if failed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('failure does not stop', solve([('outer',False),('inner',True)]), (['inner','outer'],['inner']))
check('multiple failures', solve([('a',True),('b',True)]), (['b','a'],['b','a']))
check('normal lifo', solve([('a',False),('b',False)]), (['b','a'],[]))
check('none registered', solve([]), ([],[]))
check('one failed', solve([('a',True)]), (['a'],['a']))
check('parameterized stack', solve([(str(i),False) for i in range(N+2)]), ([str(i) for i in reversed(range(N+2))],[]))
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:
Effect teardown stops after one disposer fails.

Effect resources dispose in reverse registration order. Every disposer runs even when an earlier one fails; failure identities are reported in disposal order.

split: open-access


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

N = 1
observations = []
def solve(current, allowed, recent, default):
    return current
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent allowed preferred', solve('gone',['a','b'],['gone','b','a'],'a'), 'b')
check('current retained', solve('a',['a','b'],['b'],'b'), 'a')
check('default allowed', solve('gone',['a'],[],'a'), 'a')
check('default forbidden', solve('gone',['a'],[],'bad'), None)
check('no workspaces', solve('gone',[],['a'],'a'), None)
check('skip many inaccessible recent', solve('gone',['ok'],['bad'+str(i) for i in range(N)]+['ok'],'bad'), 'ok')
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(current, allowed, recent, default):
    return current if current in allowed else default
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent allowed preferred', solve('gone',['a','b'],['gone','b','a'],'a'), 'b')
check('current retained', solve('a',['a','b'],['b'],'b'), 'a')
check('default allowed', solve('gone',['a'],[],'a'), 'a')
check('default forbidden', solve('gone',['a'],[],'bad'), None)
check('no workspaces', solve('gone',[],['a'],'a'), None)
check('skip many inaccessible recent', solve('gone',['ok'],['bad'+str(i) for i in range(N)]+['ok'],'bad'), 'ok')
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:
A removed workspace leaves the client on an inaccessible last-visited workspace.

If the current workspace becomes inaccessible, select the first accessible recent workspace, then an accessible default, otherwise no workspace.

split: open-access


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

N = 1
observations = []
def solve(events):
    return [v for kind,v in events if kind=='write'],[]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('coalesce prehydrate writes', solve([('write',1),('write',2),('hydrate',None)]), ([2],[]))
check('still hydrating', solve([('write',N)]), ([],[N]))
check('writes after release', solve([('hydrate',None),('write',N)]), ([N],[]))
check('no writes', solve([('hydrate',None)]), ([],[]))
check('repeat hydration no duplicate', solve([('write',0),('hydrate',None),('hydrate',None)]), ([0],[]))
check('posthydrate ordering', solve([('write',1),('write',2),('hydrate',None),('write',3)]), ([2,3],[]))
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):
    hydrating=True; held=[]; delivered=[]
    for kind,value in events:
        if kind=='write':
            if hydrating: held.append(value)
            else: delivered.append(value)
        elif kind=='hydrate':
            hydrating=False; delivered+=held; held=[]
    return delivered,held
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('coalesce prehydrate writes', solve([('write',1),('write',2),('hydrate',None)]), ([2],[]))
check('still hydrating', solve([('write',N)]), ([],[N]))
check('writes after release', solve([('hydrate',None),('write',N)]), ([N],[]))
check('no writes', solve([('hydrate',None)]), ([],[]))
check('repeat hydration no duplicate', solve([('write',0),('hydrate',None),('hydrate',None)]), ([0],[]))
check('posthydrate ordering', solve([('write',1),('write',2),('hydrate',None),('write',3)]), ([2,3],[]))
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:
Store writes notify a hydrating consumer before its server snapshot is released.

Before hydration release a consumer queues store snapshots; release delivers only the latest held snapshot, and subsequent writes deliver in order. Repeated release is idempotent.

split: open-access


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

N = 1
observations = []
def solve(cache, consumer, version, selector, result):
    key=(consumer,version,selector)
    old=next((v for (c,n,s),v in cache.items() if n==version),result)
    return old,list({**cache,key:old}.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('different selector', solve({('a',1,'left'):2},'a',1,'right',3), (3, list({('a', 1, 'left'): 2, ('a', 1, 'right'): 3}.items())))
check('different consumer', solve({('a',1,'left'):2},'b',1,'left',N), (N, list({('a', 1, 'left'): 2, ('b', 1, 'left'): N}.items())))
check('same cache key', solve({('a',1,'left'):0},'a',1,'left',9), (0, list({('a', 1, 'left'): 0}.items())))
check('new version', solve({('a',1,'left'):2},'a',2,'left',3), (3, list({('a', 1, 'left'): 2, ('a', 2, 'left'): 3}.items())))
check('empty cache', solve({},'a',N,'left',False), (False, list({('a', N, 'left'): False}.items())))
check('null cached', solve({('a',1,'left'):None},'a',1,'left',3), (None, list({('a', 1, 'left'): None}.items())))
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(cache, consumer, version, selector, result):
    key=(consumer,version,selector)
    old=next((v for (c,n,s),v in cache.items() if c==consumer and n==version),result)
    return old,list({**cache,key:old}.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('different selector', solve({('a',1,'left'):2},'a',1,'right',3), (3, list({('a', 1, 'left'): 2, ('a', 1, 'right'): 3}.items())))
check('different consumer', solve({('a',1,'left'):2},'b',1,'left',N), (N, list({('a', 1, 'left'): 2, ('b', 1, 'left'): N}.items())))
check('same cache key', solve({('a',1,'left'):0},'a',1,'left',9), (0, list({('a', 1, 'left'): 0}.items())))
check('new version', solve({('a',1,'left'):2},'a',2,'left',3), (3, list({('a', 1, 'left'): 2, ('a', 2, 'left'): 3}.items())))
check('empty cache', solve({},'a',N,'left',False), (False, list({('a', N, 'left'): False}.items())))
check('null cached', solve({('a',1,'left'):None},'a',1,'left',3), (None, list({('a', 1, 'left'): None}.items())))
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:
A selector cache leaks one consumer selector result into another consumer.

Selector memoization is scoped by consumer, committed version and selector identity. Cached null and false results are hits. A miss installs only the exact composite key.

split: open-access


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

N = 1
observations = []
def solve(updates, allowed, initial):
    value=initial
    for kind,operation,argument in updates:
        if operation=='set': value=argument
        else: value+=argument
    return value,[]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent after deferred', solve([('deferred','set',10),('urgent','add',N)],['urgent'],1), (N+1,[('deferred','set',10)]))
check('urgent set after add', solve([('urgent','add',2),('urgent','set',3)],['urgent'],1), (3,[]))
check('all lanes', solve([('deferred','set',10),('urgent','add',N)],['urgent','deferred'],1), (10+N,[]))
check('none allowed', solve([('urgent','add',2),('deferred','set',3)],[],1), (1,[('urgent','add',2),('deferred','set',3)]))
check('no updates', solve([],['urgent'],N), (N,[]))
check('zero replace', solve([('urgent','set',0),('urgent','add',1)],['urgent'],9), (1,[]))
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(updates, allowed, initial):
    value=initial; skipped=[]
    for kind,operation,argument in updates:
        if kind not in allowed: skipped.append((kind,operation,argument)); break
        if operation=='set': value=argument
        else: value+=argument
    return value,skipped
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent after deferred', solve([('deferred','set',10),('urgent','add',N)],['urgent'],1), (N+1,[('deferred','set',10)]))
check('urgent set after add', solve([('urgent','add',2),('urgent','set',3)],['urgent'],1), (3,[]))
check('all lanes', solve([('deferred','set',10),('urgent','add',N)],['urgent','deferred'],1), (10+N,[]))
check('none allowed', solve([('urgent','add',2),('deferred','set',3)],[],1), (1,[('urgent','add',2),('deferred','set',3)]))
check('no updates', solve([],['urgent'],N), (N,[]))
check('zero replace', solve([('urgent','set',0),('urgent','add',1)],['urgent'],9), (1,[]))
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:
Skipping deferred updates changes the order of a later urgent replay.

A client render pass applies only eligible priority updates in original order, skips ineligible updates without blocking later urgent work, and retains every skipped update for later replay.

split: open-access


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

N = 1
observations = []
def solve(events):
    pending=False; errors=[]
    for kind,task in events:
        pending=kind=='start'
        if kind=='fail': errors.append(task)
    return (['pending'] if pending else []),errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('sibling remains', solve([('start','a'),('start','b'),('finish','a')]), (['b'],[]))
check('failed child releases only itself', solve([('start','a'),('start','b'),('fail','a')]), (['b'],['a']))
check('all finished', solve([('start','a'),('finish','a')]), ([],[]))
check('unknown finish', solve([('start','a'),('finish','x')]), (['a'],[]))
check('duplicate completion', solve([('start','a'),('finish','a'),('finish','a')]), ([],[]))
check('parameterized children', solve([('start',str(i)) for i in range(N+1)]+[('finish','0')]), (sorted(str(i) for i in range(1,N+1)),[]))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(events):
    pending=set(); errors=[]
    for kind,task in events:
        if kind=='start': pending.add(task)
        elif kind in ('finish','fail'): pending.clear()
        if kind=='fail': errors.append(task)
    return sorted(pending),errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('sibling remains', solve([('start','a'),('start','b'),('finish','a')]), (['b'],[]))
check('failed child releases only itself', solve([('start','a'),('start','b'),('fail','a')]), (['b'],['a']))
check('all finished', solve([('start','a'),('finish','a')]), ([],[]))
check('unknown finish', solve([('start','a'),('finish','x')]), (['a'],[]))
check('duplicate completion', solve([('start','a'),('finish','a'),('finish','a')]), ([],[]))
check('parameterized children', solve([('start',str(i)) for i in range(N+1)]+[('finish','0')]), (sorted(str(i) for i in range(1,N+1)),[]))
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:
A transition disappears while one of its spawned child tasks remains unresolved.

A transition owns a set of child task identities. A finish/failure settles only its child; unknown or repeated completion cannot clear siblings; failures are reported separately from remaining work.

split: open-access


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

N = 1
observations = []
def solve(drafts, capacity):
    return drafts[-capacity:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty older than clean', solve([('dirty',True),('a',False),('b',False)],2), [('dirty',True),('b',False)])
check('dirty exceeds cap', solve([('a',True),('b',True)],1), [('a',True),('b',True)])
check('zero cap keeps dirty', solve([('a',False),('b',True)],0), [('b',True)])
check('all clean newest', solve([('a',False),('b',False)],1), [('b',False)])
check('empty', solve([],2), [])
check('parameterized clean cap', solve([(str(i),False) for i in range(N+2)],N), [(str(i),False) for i in range(2,N+2)])
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(drafts, capacity):
    return [x for x in drafts if x[1]][-capacity:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty older than clean', solve([('dirty',True),('a',False),('b',False)],2), [('dirty',True),('b',False)])
check('dirty exceeds cap', solve([('a',True),('b',True)],1), [('a',True),('b',True)])
check('zero cap keeps dirty', solve([('a',False),('b',True)],0), [('b',True)])
check('all clean newest', solve([('a',False),('b',False)],1), [('b',False)])
check('empty', solve([],2), [])
check('parameterized clean cap', solve([(str(i),False) for i in range(N+2)],N), [(str(i),False) for i in range(2,N+2)])
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:
Workspace draft eviction discards unsaved work to meet a retention cap.

Retention preserves every dirty workspace draft even above capacity, then fills any remaining slots with the most recently visited clean drafts while preserving source order.

split: open-access


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

N = 1
observations = []
def solve(before, after):
    return [('set',k,after.get(k)) for k in before if before[k]!=after.get(k)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('delete override', solve({'theme':'dark'},{}), [('remove','theme')])
check('explicit null set', solve({}, {'theme':None}), [('set','theme',None)])
check('false vs zero', solve({'size':False},{'size':0}), [('set','size',0)])
check('unchanged', solve({'size':N},{'size':N}), [])
check('new value', solve({'size':1},{'size':N+1}), [('set','size',N+1)])
check('mixed removals additions', solve({'a':1,'b':2},{'b':2,'c':3}), [('remove','a'),('set','c',3)])
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(before, after):
    return [('set',k,v) for k,v in after.items() if before.get(k)!=v]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('delete override', solve({'theme':'dark'},{}), [('remove','theme')])
check('explicit null set', solve({}, {'theme':None}), [('set','theme',None)])
check('false vs zero', solve({'size':False},{'size':0}), [('set','size',0)])
check('unchanged', solve({'size':N},{'size':N}), [])
check('new value', solve({'size':1},{'size':N+1}), [('set','size',N+1)])
check('mixed removals additions', solve({'a':1,'b':2},{'b':2,'c':3}), [('remove','a'),('set','c',3)])
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:
Preference reset is serialized as a null assignment instead of removing the override.

Device preference patches explicitly remove absent overrides and set added or type/value-changed overrides. Null remains a set value; removals precede sets in each mapping insertion order.

split: open-access


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

N = 1
observations = []
def solve(generations, active, readers):
    return [url for generation,url in generations if generation!=active]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('old generation still read', solve([(1,'old'),(2,'new')],2,{'preview':1}), [])
check('old unreferenced', solve([(1,'old'),(2,'new')],2,{}), ['old'])
check('active no reader', solve([(1,'active')],1,{}), [])
check('multiple stale generations', solve([(1,'a'),(2,'b'),(3,'c')],3,{'save':2}), ['a'])
check('empty', solve([],0,{}), [])
check('parameterized generations', solve([(i,str(i)) for i in range(N+2)],N+1,{'preview':N}), [str(i) for i in range(N)])
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(generations, active, readers):
    return [url for generation,url in generations if generation not in readers.values()]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('old generation still read', solve([(1,'old'),(2,'new')],2,{'preview':1}), [])
check('old unreferenced', solve([(1,'old'),(2,'new')],2,{}), ['old'])
check('active no reader', solve([(1,'active')],1,{}), [])
check('multiple stale generations', solve([(1,'a'),(2,'b'),(3,'c')],3,{'save':2}), ['a'])
check('empty', solve([],0,{}), [])
check('parameterized generations', solve([(i,str(i)) for i in range(N+2)],N+1,{'preview':N}), [str(i) for i in range(N)])
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:
Replacing generated file content revokes the blob URL still used by a reader.

Generated-file URL retirement preserves the active generation and every generation referenced by a reader; only unreferenced inactive generations are revoked.

split: open-access


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

N = 1
observations = []
def solve(inflight, edits):
    return [(field,value) for field,value in edits if field not in inflight]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('edited same field', solve({'a':1},[('a',2)]), [('a',2)])
check('coalesce same field', solve({},[('a',1),('a',N+2)]), [('a',N+2)])
check('returned to inflight value', solve({'a':1},[('a',2),('a',1)]), [])
check('new null', solve({},[('a',None)]), [('a',None)])
check('type distinction', solve({'a':False},[('a',0)]), [('a',0)])
check('stable first-edit field order', solve({},[('b',1),('a',2),('b',3)]), [('b',3),('a',2)])
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(inflight, edits):
    return [(field,value) for field,value in edits if inflight.get(field)!=value]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('edited same field', solve({'a':1},[('a',2)]), [('a',2)])
check('coalesce same field', solve({},[('a',1),('a',N+2)]), [('a',N+2)])
check('returned to inflight value', solve({'a':1},[('a',2),('a',1)]), [])
check('new null', solve({},[('a',None)]), [('a',None)])
check('type distinction', solve({'a':False},[('a',0)]), [('a',0)])
check('stable first-edit field order', solve({},[('b',1),('a',2),('b',3)]), [('b',3),('a',2)])
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:
Autosave coalescing drops a field edit made while its preceding value is in flight.

While one autosave is in flight, coalesce newer edits to each field latest value, preserve first-edit field order, and remove a queued field only if its latest type/value equals the in-flight snapshot.

split: open-access


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

N = 1
observations = []
def solve(bindings, leaving, entering, incoming_tags):
    return {**bindings,entering:incoming_tags}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove outgoing retain side route', solve({'a':['x'],'side':['s']},'a','b',['y']), {'side':['s'],'b':['y']})
check('same route refresh', solve({'a':['old']},'a','a',['new']), {'a':['new']})
check('new route no outgoing', solve({},'a','b',[]), {'b':[]})
check('shared resource tag preserved other route', solve({'a':['x'],'side':['x']},'a','b',['x']), {'side':['x'],'b':['x']})
check('duplicate incoming tags', solve({},'a','b',['x','x','y']), {'b':['x','y']})
check('parameterized resource tags', solve({'old':['gone'],'side':['s']},'old','new',[str(i) for i in range(N)]), {'side':['s'],'new':[str(i) for i in range(N)]})
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(bindings, leaving, entering, incoming_tags):
    return {entering:list(dict.fromkeys(incoming_tags))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove outgoing retain side route', solve({'a':['x'],'side':['s']},'a','b',['y']), {'side':['s'],'b':['y']})
check('same route refresh', solve({'a':['old']},'a','a',['new']), {'a':['new']})
check('new route no outgoing', solve({},'a','b',[]), {'b':[]})
check('shared resource tag preserved other route', solve({'a':['x'],'side':['x']},'a','b',['x']), {'side':['x'],'b':['x']})
check('duplicate incoming tags', solve({},'a','b',['x','x','y']), {'b':['x','y']})
check('parameterized resource tags', solve({'old':['gone'],'side':['s']},'old','new',[str(i) for i in range(N)]), {'side':['s'],'new':[str(i) for i in range(N)]})
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:
Navigating between routes retains resource tags from the abandoned route.

Route resource-tag adoption removes the leaving route binding, replaces the entering binding with stable deduplicated incoming tags, and preserves independently mounted route bindings.

split: open-access


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

N = 1
observations = []
def solve(state, persistent, event):
    return dict(state)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('push drops transient', solve({'notice':'saved','context':N},['context'],'push'), {'context':N})
check('pop restores transient', solve({'notice':'saved','context':N},['context'],'pop'), {'notice':'saved','context':N})
check('replace cleans', solve({'notice':''},[],'replace'), {})
check('persistent null', solve({'context':None},['context'],'push'), {'context':None})
check('unknown persistent key', solve({'notice':'x'},['missing'],'push'), {})
check('empty state', solve({},['context'],'pop'), {})
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(state, persistent, event):
    return {k:v for k,v in state.items() if k in persistent}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('push drops transient', solve({'notice':'saved','context':N},['context'],'push'), {'context':N})
check('pop restores transient', solve({'notice':'saved','context':N},['context'],'pop'), {'notice':'saved','context':N})
check('replace cleans', solve({'notice':''},[],'replace'), {})
check('persistent null', solve({'context':None},['context'],'push'), {'context':None})
check('unknown persistent key', solve({'notice':'x'},['missing'],'push'), {})
check('empty state', solve({},['context'],'pop'), {})
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:
A new navigation inherits transient route-state notices from the previous entry.

The stipulated navigation state policy preserves all entry-local state on pop, but push/replace carry forward only declared persistent keys including null/falsy values.

split: open-access


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

N = 1
observations = []
def solve(initial, writes, observed_keys):
    state=dict(initial); notices=[]
    for key,value in writes:
        state[key]=value; notices.append([state.get(key) for key in observed_keys])
    return notices
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('atomic multi-key change', solve({'a':1,'b':2},[('a',N),('b',N+1)],['a','b']), [[N,N+1]])
check('no writes no notify', solve({'a':1},[],['a']), [])
check('last write wins', solve({},[('a',1),('a',2)],['a']), [[2]])
check('missing observed field', solve({},[('a',1)],['b']), [[None]])
check('empty observer projection', solve({},[('a',1)],[]), [[]])
check('false value delivered', solve({},[('a',False)],['a']), [[False]])
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(initial, writes, observed_keys):
    state=dict(initial)
    for key,value in writes: state[key]=value
    return [[state.get(key) for key in observed_keys]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('atomic multi-key change', solve({'a':1,'b':2},[('a',N),('b',N+1)],['a','b']), [[N,N+1]])
check('no writes no notify', solve({'a':1},[],['a']), [])
check('last write wins', solve({},[('a',1),('a',2)],['a']), [[2]])
check('missing observed field', solve({},[('a',1)],['b']), [[None]])
check('empty observer projection', solve({},[('a',1)],[]), [[]])
check('false value delivered', solve({},[('a',False)],['a']), [[False]])
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:
Batched store updates notify consumers before all writes become observable.

A client-store commit applies the entire write batch then emits exactly one selector projection; empty batches emit nothing and selectors observe the final value of repeated writes.

split: open-access


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

N = 1
observations = []
def solve(tasks, cancelled):
    return [task for task,parent in tasks if task not in cancelled]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested descendants', solve([('a',None),('b','a'),('c','b'),('side',None)],['a']), ['side'])
check('child cancellation keeps parent', solve([('a',None),('b','a')],['b']), ['a'])
check('no cancellation', solve([('a',None)],[]), ['a'])
check('unknown root cancellation', solve([('a','missing')],['missing']), [])
check('separate trees', solve([('a',None),('b',None),('c','b')],['a']), ['b','c'])
check('parameterized deep chain', solve([(str(i),None if i==0 else str(i-1)) for i in range(N+3)],['0']), [])
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(tasks, cancelled):
    return [task for task,parent in tasks if task not in cancelled and parent not in cancelled]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested descendants', solve([('a',None),('b','a'),('c','b'),('side',None)],['a']), ['side'])
check('child cancellation keeps parent', solve([('a',None),('b','a')],['b']), ['a'])
check('no cancellation', solve([('a',None)],[]), ['a'])
check('unknown root cancellation', solve([('a','missing')],['missing']), [])
check('separate trees', solve([('a',None),('b',None),('c','b')],['a']), ['b','c'])
check('parameterized deep chain', solve([(str(i),None if i==0 else str(i-1)) for i in range(N+3)],['0']), [])
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:
Cancelling a parent render transition leaves nested work attached.

Cancelling a render transition cancels its descendant task tree transitively, including descendants of an already-removed parent, without cancelling ancestors or unrelated roots.

split: open-access


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

N = 1
observations = []
def solve(first, latest, delay, maximum, now):
    deadline=latest+delay
    return deadline,now>=deadline
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('max wait caps chatter', solve(0,N+5,3,5,5), (5,True))
check('quiet delay first', solve(0,1,2,10,2), (3,False))
check('inclusive deadline', solve(0,1,2,10,3), (3,True))
check('zero delay', solve(1,2,0,10,2), (2,True))
check('zero max wait', solve(3,3,2,0,3), (3,True))
check('shifted origin', solve(N,N+1,2,10,N+2), (N+3,False))
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(first, latest, delay, maximum, now):
    deadline=first+maximum
    return deadline,now>deadline
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('max wait caps chatter', solve(0,N+5,3,5,5), (5,True))
check('quiet delay first', solve(0,1,2,10,2), (3,False))
check('inclusive deadline', solve(0,1,2,10,3), (3,True))
check('zero delay', solve(1,2,0,10,2), (2,True))
check('zero max wait', solve(3,3,2,0,3), (3,True))
check('shifted origin', solve(N,N+1,2,10,N+2), (N+3,False))
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:
Continuous client edits postpone a debounced effect forever.

A debounced effect deadline is the earlier of latest edit plus quiet delay and first edit plus maximum wait; execution is eligible at the deadline, including zero durations.

split: open-access


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

N = 1
observations = []
def solve(events):
    return events[-1][1] if events else 'light'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual shields system event', solve([('choose','dark'),('system','light')]), 'dark')
check('system mode follows', solve([('system','dark')]), 'dark')
check('return to system', solve([('system','dark'),('choose','light'),('choose','system')]), 'dark')
check('initial default', solve([]), 'light')
check('manual empty preference valid', solve([('choose',''),('system','dark')]), '')
check('parameterized repeated system events', solve([('choose','dark')]+[('system','light')]*N), 'dark')
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):
    mode='light'
    for kind,value in events:
        if kind=='choose' and value!='system': mode=value
    return mode
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual shields system event', solve([('choose','dark'),('system','light')]), 'dark')
check('system mode follows', solve([('system','dark')]), 'dark')
check('return to system', solve([('system','dark'),('choose','light'),('choose','system')]), 'dark')
check('initial default', solve([]), 'light')
check('manual empty preference valid', solve([('choose',''),('system','dark')]), '')
check('parameterized repeated system events', solve([('choose','dark')]+[('system','light')]*N), 'dark')
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:
A manual appearance choice is overwritten by a subsequent system preference event.

Appearance begins in system mode. A manual choice masks system changes without forgetting them; choosing system again reveals the latest system preference.

split: open-access


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

N = 1
observations = []
def solve(resource, observers, previous):
    return [(name,dict(resource)) for name,fields in observers]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selectors differ', solve({'a':N,'b':2},[('one',['a']),('two',['b'])],{}), [('one',{'a':N}),('two',{'b':2})])
check('unchanged observer suppressed', solve({'a':1},[('one',['a'])],{'one':{'a':1}}), [])
check('empty projection changed', solve({'a':1},[('one',['missing'])],{}), [('one',{})])
check('empty projection stable', solve({},[('one',[])],{'one':{}}), [])
check('missing vs null', solve({'a':None},[('one',['a'])],{'one':{}}), [('one',{'a':None})])
check('no observers', solve({'a':N},[],{}), [])
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(resource, observers, previous):
    return [(name,{k:resource[k] for k in fields if k in resource}) for name,fields in observers]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selectors differ', solve({'a':N,'b':2},[('one',['a']),('two',['b'])],{}), [('one',{'a':N}),('two',{'b':2})])
check('unchanged observer suppressed', solve({'a':1},[('one',['a'])],{'one':{'a':1}}), [])
check('empty projection changed', solve({'a':1},[('one',['missing'])],{}), [('one',{})])
check('empty projection stable', solve({},[('one',[])],{'one':{}}), [])
check('missing vs null', solve({'a':None},[('one',['a'])],{'one':{}}), [('one',{'a':None})])
check('no observers', solve({'a':N},[],{}), [])
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:
A resource observer receives fields that belong to another observer selector.

Each cache observer receives only its declared existing fields and is notified only when that projection differs from its own previous snapshot; missing fields differ from explicit null.

split: open-access


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

N = 1
observations = []
def solve(views, transfer_views):
    return [(name,name not in transfer_views) for name,buffer in views]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two views one buffer', solve([('a','buf'),('b','buf'),('c','other')],['a']), [('a',False),('b',False),('c',True)])
check('no transfer', solve([('a','buf')],[]), [('a',True)])
check('unknown view', solve([('a','buf')],['missing']), [('a',True)])
check('separate buffer transferred', solve([('a','x'),('b','y')],['b']), [('a',True),('b',False)])
check('empty views', solve([],['a']), [])
check('parameterized aliases', solve([(str(i),'shared') for i in range(N+1)],['0']), [(str(i),False) for i in range(N+1)])
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(views, transfer_views):
    return [(name,not transfer_views) for name,buffer in views]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two views one buffer', solve([('a','buf'),('b','buf'),('c','other')],['a']), [('a',False),('b',False),('c',True)])
check('no transfer', solve([('a','buf')],[]), [('a',True)])
check('unknown view', solve([('a','buf')],['missing']), [('a',True)])
check('separate buffer transferred', solve([('a','x'),('b','y')],['b']), [('a',True),('b',False)])
check('empty views', solve([],['a']), [])
check('parameterized aliases', solve([(str(i),'shared') for i in range(N+1)],['0']), [(str(i),False) for i in range(N+1)])
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:
Transferring one buffer view leaves another alias marked readable on the main thread.

Transferring a view detaches every main-thread view sharing its backing buffer, but leaves views of other buffers readable; unknown view names transfer nothing.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'open-copy':([]), 'dirty-order':(set(d['draft']) != set(d['committed'])), 'apply-gate':(d['valid'] and d['revision']==d['base']), 'cancel-target':({'draft':list(d['committed']),'errors':[],'open':False}), 'conflict-banner':(d['revision']!=d['base'] and set(d['draft'])!=set(d['committed'])), 'apply-payload':(list(d['draft']) if d['valid'] and d['revision']==d['base'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a', 'b'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None})], 2: [({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None})], 3: [({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b']}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b']})], 4: [({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': [], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None})], 5: [({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': [], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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(d):
    return {'open-copy':(list(d['draft'])), 'dirty-order':(set(d['draft']) != set(d['committed'])), 'apply-gate':(d['valid'] and d['revision']==d['base']), 'cancel-target':({'draft':list(d['committed']),'errors':[],'open':False}), 'conflict-banner':(d['revision']!=d['base'] and set(d['draft'])!=set(d['committed'])), 'apply-payload':(list(d['draft']) if d['valid'] and d['revision']==d['base'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a', 'b'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None})], 2: [({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None})], 3: [({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b']}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b']})], 4: [({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': True, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': [], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': ['b', 'a']}), ({'committed': ['a'], 'draft': [], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None})], 5: [({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a', 'b'], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': ['a', 'b'], 'dirty-order': False, 'apply-gate': False, 'cancel-target': {'draft': ['a', 'b'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': False, 'apply-gate': True, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': [], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None}), ({'committed': [], 'draft': ['b', 'a'], 'valid': True, 'revision': 2, 'base': 1}, {'open-copy': [], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': [], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': [], 'valid': True, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': True, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': []}), ({'committed': ['a'], 'draft': ['b'], 'valid': False, 'revision': 2, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': True, 'apply-payload': None}), ({'committed': ['a'], 'draft': ['b', 'a'], 'valid': False, 'revision': 1, 'base': 1}, {'open-copy': ['a'], 'dirty-order': True, 'apply-gate': False, 'cancel-target': {'draft': ['a'], 'errors': [], 'open': False}, 'conflict-banner': False, 'apply-payload': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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:
Opening a panel seeds its draft from committed constraints is violated by the widget projection.

An Apply/Cancel filter panel keeps draft and committed constraints separate; validation and revision determine whether a draft may be published. This example checks: Opening a panel seeds its draft from committed constraints.

split: open-access