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['alias']['id']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['parent']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Alias menu entry dispatches its presentation ID as a command.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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['alias']['target']
    if action == 'label-override':
        return p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['target']
    if action == 'label-override':
        return p['alias']['id']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Alias-specific menu label is overwritten by target label.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return True
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['alias'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Dangling alias menu entry is considered executable.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return True
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id'] in p['registry']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Self-referential menu alias is admitted into resolution.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return p['target_args']
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['alias_args'],**p['target_args'])
    if action == 'owner':
        return p['alias_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Menu alias loses bound argument overrides.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['target_parent']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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['alias']['target']
    if action == 'label-override':
        return p['alias']['label'] if 'label' in p['alias'] else p['target']['label']
    if action == 'missing-target':
        return p['target'] in p['registry']
    if action == 'self-alias':
        return p['id']!=p['target']
    if action == 'arguments':
        return dict(p['target_args'],**p['alias_args'])
    if action == 'owner':
        return p['root']
    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', {'alias':{'target':'cmd'+str(N),'id':'shortcut','parent':'tools'}}), 'cmd'+str(N))
check('label-override contract', solve('label-override', {'alias':{'label':'Quick '+str(N),'id':'shortcut'},'target':{'label':'Full'}}), 'Quick '+str(N))
check('missing-target contract', solve('missing-target', {'target':'missing'+str(N),'alias':'shortcut','registry':['shortcut']}), False)
check('self-alias contract', solve('self-alias', {'id':N,'target':N,'registry':[N]}), False)
check('arguments contract', solve('arguments', {'target_args':{'mode':'normal','count':1},'alias_args':{'count':N+1}}), {'mode':'normal','count':N+1})
check('owner contract', solve('owner', {'alias_parent':'quick'+str(N),'target_parent':'full','root':'r'}), 'quick'+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:
Alias submenu attaches to the target command parent.

Menu aliases preserve display ownership while resolving an explicit one-level target; alias overrides affect presentation but never command identity.

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 == 'acquire':
        return sorted(p['holders'])
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return [p['id']]
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Opening another menu drops existing provider lease holders.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return []
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders'])
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Closing one menu disposes a provider still used by another surface.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return True
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return len(p['holders'])<=1
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Single remaining menu subscriber loses its shared provider.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hidden menu surface receives an unnecessary provider redraw.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return bool(p['next']) and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] and not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Shared submenu provider exposes duplicate Load More actions while a page is pending.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'acquire':
        return sorted(p['holders'] | {p['id']})
    if action == 'release':
        return sorted(p['holders']-{p['id']})
    if action == 'dispose':
        return not p['holders']
    if action == 'visible-recipients':
        return [x['id'] for x in p if x['visible'] and x['attached']]
    if action == 'load-more':
        return p['next'] is not None and not p['pending_page']
    if action == 'new-load':
        return not p['loaded'] or not p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('acquire contract', solve('acquire', {'holders':{'a'},'id':'b'+str(N)}), ['a','b'+str(N)])
check('release contract', solve('release', {'holders':{'a','b'+str(N)},'id':'a'}), ['b'+str(N)])
check('dispose contract', solve('dispose', {'holders':['menu'+str(N)]}), False)
check('visible-recipients contract', solve('visible-recipients', [{'id':N,'visible':False,'attached':True},{'id':N+1,'visible':True,'attached':False}]), [])
check('load-more contract', solve('load-more', {'next':'cursor'+str(N),'pending_page':True}), False)
check('new-load contract', solve('new-load', {'loaded':False,'pending':True,'leases':N}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('empty opaque cursor is valid',solve('load-more',{'next':'','pending_page':False,'generation':N}),True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Concurrent menu subscribers start duplicate provider loads.

Providers can be shared by multiple menu surfaces; leases control attachment lifetime and only visible subscribers receive presentation updates.

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 == 'copy-context':
        return {}
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['ambient'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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:
Tearing off a menu discards its invocation context.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return p['parent_session']
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return p['root_session']
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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:
Tear-off menu remains tied to its source popup lifetime.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return p['popup']
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return p['offset']
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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:
Tear-off initial window position omits popup host offset.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['source']
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 source menu incorrectly closes an independent tear-off.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':True,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':None}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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:
Reattached tear-off keeps an independent lifetime flag.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':p['context']}
    if action == 'closed-record':
        return p['windows']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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 tear-off erases unrelated menu windows.

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'armed-switch':
        return p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] or p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hovering a closed menubar opens an unrelated root menu.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

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 == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return p['chain']+[p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]+p['chain'][1:]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Switching menubar owner preserves descendants of the previous root.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

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 == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return []
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Repeated menubar owner event closes an already-open submenu chain.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

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 == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer']
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Pressed drag pointer switches menu roots during a command gesture.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

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 == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target']),None)
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return p['roots'][0]
    if action == 'session-context':
        return p['existing_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menubar transfer targets an unavailable menu owner.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

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 == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return p['hover_context']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'armed-switch':
        return p['active_session'] and p['different_owner']
    if action == 'replace-root':
        return [p['new_root']]
    if action == 'same-root':
        return p['chain'] if p['chain'][0]==p['root'] else [p['root']]
    if action == 'captured-pointer':
        return p['pointer']==p['owner_pointer'] and p['buttons']==0
    if action == 'disabled-root':
        return next((x for x in p['roots'] if x['id']==p['target'] and x['available']),None)
    if action == 'session-context':
        return None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('armed-switch contract', solve('armed-switch', {'active_session':False,'different_owner':True,'owner':N}), False)
check('replace-root contract', solve('replace-root', {'new_root':'new'+str(N),'chain':['old','child']}), ['new'+str(N)])
check('same-root contract', solve('same-root', {'chain':['root','child'+str(N)],'root':'root'}), ['root','child'+str(N)])
check('captured-pointer contract', solve('captured-pointer', {'pointer':N,'owner_pointer':N,'buttons':1}), False)
check('disabled-root contract', solve('disabled-root', {'roots':[{'id':N,'available':False}],'target':N}), None)
check('session-context contract', solve('session-context', {'existing_context':N,'hover_context':N+1}), N)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('idle foreign pointer',solve('captured-pointer',{'pointer':N+1,'owner_pointer':N,'buttons':0}),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menubar root transfer replaces the captured command context.

Pointer-driven menubar ownership transfers only during an active menu session; switching root owners replaces descendants and respects ownership identity.

split: open-access