broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'target':
        return p['captured']
    if action == 'point':
        return [p['client'][0]+p['scroll'][0],p['client'][1]+p['scroll'][1]]
    if action == 'revision':
        return p['snapshot']==p['current']
    if action == 'capabilities':
        return sorted(set(p['captured']) & set(p['current']))
    if action == 'objects':
        return list(p['current'])
    if action == 'locale':
        return p['opened']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('target contract', solve('target', {'captured':'doc'+str(N),'hover':'other','active':'third'}), 'doc'+str(N))
check('point contract', solve('point', {'client':[N,2*N],'scroll':[3*N,4*N]}), [4*N,6*N])
check('revision contract', solve('revision', {'snapshot':N,'current':N+1}), False)
check('capabilities contract', solve('capabilities', {'captured':['read','delete'+str(N)],'current':['read','share']}), ['read'])
check('objects contract', solve('objects', {'captured':['a'+str(N),'b'],'current':['c']}), ['a'+str(N),'b'])
check('locale contract', solve('locale', {'opened':'locale'+str(N),'ambient':'other','default':'default'}), 'locale'+str(N))
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'target':
        return p['captured']
    if action == 'point':
        return [p['client'][0]+p['scroll'][0],p['client'][1]+p['scroll'][1]]
    if action == 'revision':
        return p['snapshot']==p['current']
    if action == 'capabilities':
        return sorted(set(p['captured']) & set(p['current']))
    if action == 'objects':
        return list(p['captured'])+list(p['current'])
    if action == 'locale':
        return p['opened']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('target contract', solve('target', {'captured':'doc'+str(N),'hover':'other','active':'third'}), 'doc'+str(N))
check('point contract', solve('point', {'client':[N,2*N],'scroll':[3*N,4*N]}), [4*N,6*N])
check('revision contract', solve('revision', {'snapshot':N,'current':N+1}), False)
check('capabilities contract', solve('capabilities', {'captured':['read','delete'+str(N)],'current':['read','share']}), ['read'])
check('objects contract', solve('objects', {'captured':['a'+str(N),'b'],'current':['c']}), ['a'+str(N),'b'])
check('locale contract', solve('locale', {'opened':'locale'+str(N),'ambient':'other','default':'default'}), 'locale'+str(N))
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Context batch command substitutes newer document objects.

A context-menu invocation snapshots target, document coordinates, revision, capabilities, document objects and parsing locale.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'target':
        return p['captured']
    if action == 'point':
        return [p['client'][0]+p['scroll'][0],p['client'][1]+p['scroll'][1]]
    if action == 'revision':
        return p['snapshot']==p['current']
    if action == 'capabilities':
        return sorted(set(p['captured']) & set(p['current']))
    if action == 'objects':
        return list(p['captured'])
    if action == 'locale':
        return p['ambient']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('target contract', solve('target', {'captured':'doc'+str(N),'hover':'other','active':'third'}), 'doc'+str(N))
check('point contract', solve('point', {'client':[N,2*N],'scroll':[3*N,4*N]}), [4*N,6*N])
check('revision contract', solve('revision', {'snapshot':N,'current':N+1}), False)
check('capabilities contract', solve('capabilities', {'captured':['read','delete'+str(N)],'current':['read','share']}), ['read'])
check('objects contract', solve('objects', {'captured':['a'+str(N),'b'],'current':['c']}), ['a'+str(N),'b'])
check('locale contract', solve('locale', {'opened':'locale'+str(N),'ambient':'other','default':'default'}), 'locale'+str(N))
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'target':
        return p['captured']
    if action == 'point':
        return [p['client'][0]+p['scroll'][0],p['client'][1]+p['scroll'][1]]
    if action == 'revision':
        return p['snapshot']==p['current']
    if action == 'capabilities':
        return sorted(set(p['captured']) & set(p['current']))
    if action == 'objects':
        return list(p['captured'])
    if action == 'locale':
        return p['default']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('target contract', solve('target', {'captured':'doc'+str(N),'hover':'other','active':'third'}), 'doc'+str(N))
check('point contract', solve('point', {'client':[N,2*N],'scroll':[3*N,4*N]}), [4*N,6*N])
check('revision contract', solve('revision', {'snapshot':N,'current':N+1}), False)
check('capabilities contract', solve('capabilities', {'captured':['read','delete'+str(N)],'current':['read','share']}), ['read'])
check('objects contract', solve('objects', {'captured':['a'+str(N),'b'],'current':['c']}), ['a'+str(N),'b'])
check('locale contract', solve('locale', {'opened':'locale'+str(N),'ambient':'other','default':'default'}), 'locale'+str(N))
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Context argument parsing changes locale mid-session.

A context-menu invocation snapshots target, document coordinates, revision, capabilities, document objects and parsing locale.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']<=p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Retired submenu response overwrites a reopened popup.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['request']>=p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Deferred response resurrects a closed menu.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return 0
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Reopened popup reuses its retired incarnation.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']<=p['live_parent']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Child callback survives replacement of its parent popup.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return []
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']==p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':[]}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Closing one popup cancels another popup provider.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation'],'anchor':p['anchor'],'requests':p['requests']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'response':
        return p['request']==p['live'] and p['open']
    if action == 'closed':
        return p['open'] and p['request']==p['live']
    if action == 'reopen':
        return p['generation']+1
    if action == 'parent':
        return p['parent']==p['live_parent'] and p['child']==p['live_child']
    if action == 'cancel':
        return [x for x in p['requests'] if x['session']!=p['closed']]
    if action == 'transfer':
        return {'generation':p['generation']+1,'anchor':p['anchor'],'requests':p['requests']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('response contract', solve('response', {'request':N,'live':N+1,'open':True}), False)
check('closed contract', solve('closed', {'request':N,'live':N,'open':False}), False)
check('reopen contract', solve('reopen', {'generation':N}), N+1)
check('parent contract', solve('parent', {'parent':N,'live_parent':N+1,'child':3,'live_child':3}), False)
check('cancel contract', solve('cancel', {'requests':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}],'closed':N}), [{'session':N+1,'id':'b'}])
check('transfer contract', solve('transfer', {'generation':N,'anchor':'next','requests':['old']}), {'generation':N+1,'anchor':'next','requests':[]})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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 a menu anchor retains requests from the old session.

Deferred menu work belongs to an open popup generation and its parent generation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+p['page']
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['page']
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Overlapping lazy submenu pages duplicate commands.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return str(len(p['items']))
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['previous']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Submenu continuation cursor is synthesized from row count.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return not p['items']
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return len(p['items'])<p['limit']
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Short lazy menu page is mistaken for exhaustion.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return ['loading'] if not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return ['more'] if not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Completed empty submenu retains a loading control.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['next']
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return None
    if action == 'footer':
        return p['rows'][:-1]+p['page']+[p['rows'][-1]]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Submenu retry skips the failed page cursor.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['rows']+p['page']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'append':
        return p['old']+[x for x in p['page'] if x not in p['old']]
    if action == 'cursor':
        return p['next']
    if action == 'done':
        return p['next'] is None
    if action == 'empty':
        return [] if p['done'] and not p['items'] else p['items']
    if action == 'retry':
        return p['failed']
    if action == 'footer':
        return p['page']+p['rows']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('append contract', solve('append', {'old':[N],'page':[N,N+1]}), [N,N+1])
check('cursor contract', solve('cursor', {'next':'cursor'+str(N),'previous':'old','items':[1,2]}), 'cursor'+str(N))
check('done contract', solve('done', {'next':'next'+str(N),'items':[],'limit':20}), False)
check('empty contract', solve('empty', {'done':True,'items':[],'request':N}), [])
check('retry contract', solve('retry', {'failed':'failed'+str(N),'next':'next'}), 'failed'+str(N))
check('footer contract', solve('footer', {'rows':['existing','footer'],'page':['new'+str(N)]}), ['existing','new'+str(N),'footer'])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('retain earlier page', solve('append', {'old':[N-1,N], 'page':[N,N+1]}), [N-1,N,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:
Lazy menu rows appear after the pinned footer.

Lazy submenu pages retain provider order, unique IDs and opaque cursors; loading indicators disappear on final empty results.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return p
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['title']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Empty menu section leaves an orphaned header.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum((g+[{'separator':True}] for g in p),[])
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p),[])
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Menu section assembly emits an edge separator.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return p['items']+[{'header':p['title']}]
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Menu group heading is attached after its commands.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return p
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return sorted(p,key=lambda x:x['pin'])
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Pinned menu sections stay below dynamic content.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [x['group'] for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['group'],x['provider']) for x in p]
    if action == 'count':
        return sum(len(g['items']) for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Provider-local menu section identifiers lose namespace ownership.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return len(p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'empty-group':
        return [g for g in p if g['items']]
    if action == 'separators':
        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []
    if action == 'header':
        return [{'header':p['title']}]+p['items']
    if action == 'pin-top':
        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']
    if action == 'group-key':
        return [(x['provider'],x['group']) for x in p]
    if action == 'count':
        return sum(len(g['items'])+1 for g in p)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])
check('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])
check('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])
check('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])
check('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])
check('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Menu capacity counts group headers as commands.

Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Menu extension command IDs collide across providers.

Contributed menu commands are namespaced, rank-stable, and replaceable only by their provider; removals retain unrelated content.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'],reverse=True)
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['id'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Contribution priority is ordered by label instead of rank.

Contributed menu commands are namespaced, rank-stable, and replaceable only by their provider; removals retain unrelated content.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return []
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['id']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Unloading an extension removes unrelated menu commands.

Contributed menu commands are namespaced, rank-stable, and replaceable only by their provider; removals retain unrelated content.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return p['rows']+[p['new']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] not in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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 one extension command overwrites a peer command.

Contributed menu commands are namespaced, rank-stable, and replaceable only by their provider; removals retain unrelated content.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return p['rows']
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'namespace':
        return p['provider']+':'+p['id']
    if action == 'rank':
        return sorted(p,key=lambda x:x['rank'])
    if action == 'unload':
        return [x for x in p['rows'] if x['provider']!=p['provider']]
    if action == 'replace':
        return [p['new'] if x['provider']==p['new']['provider'] and x['id']==p['new']['id'] else x for x in p['rows']]
    if action == 'disabled-provider':
        return [x for x in p['rows'] if x['provider'] in p['disabled']]
    if action == 'revision-owner':
        return p['revision'].get(p['provider'],0)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('namespace contract', solve('namespace', {'provider':'ext'+str(N),'id':'open'}), 'ext'+str(N)+':open')
check('rank contract', solve('rank', [{'id':'z','rank':N},{'id':'a','rank':N+1}]), [{'id':'z','rank':N},{'id':'a','rank':N+1}])
check('unload contract', solve('unload', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'provider':'a'}), [{'provider':'b','id':N+1}])
check('replace contract', solve('replace', {'rows':[{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':0}],'new':{'provider':'b','id':N,'v':1}}), [{'provider':'a','id':N,'v':0},{'provider':'b','id':N,'v':1}])
check('disabled-provider contract', solve('disabled-provider', {'rows':[{'provider':'off','id':N},{'provider':'on','id':N+1}],'disabled':['off']}), [{'provider':'on','id':N+1}])
check('revision-owner contract', solve('revision-owner', {'provider':'a','revision':{'a':N,'b':N+10}}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
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:
Disabled extension keeps contributing menu content.

Contributed menu commands are namespaced, rank-stable, and replaceable only by their provider; removals retain unrelated content.

split: open-access