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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[-1].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
URL query secrets enter the fallback document name.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[-1].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Fragment identifiers enter the fallback document name.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'],'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-',1),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Platform language tags retain underscore separators.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Content type metadata includes MIME parameter text.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':x['percent'] if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Completed documents retain stale progress percentages.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(100,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,x['percent']),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Incomplete document loads report completion at one hundred percent.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':bool(x['security']),'actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']!='blocked','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Any nonempty security status is reported as verified.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded']  and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and (not x['private'] or x['loaded']) and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Private documents advertise a forbidden copy action.

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]+scroll[0],point[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Screen hit coordinates are not translated into the native window.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0],point[1]-origin[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Semantic hit testing forgets document scroll displacement.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window and not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Objects from another native window win semantic hit testing.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or (not exposed and transparent) or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Unexposed native records participate in semantic hit testing.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or (transparent and not enabled): continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Transparent semantic overlays mask inspectable objects.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x <= x1 and y0 <= y <= y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 < x <= x1 and y0 < y <= y1): continue
        if clip is not None and not (clip[0] <= x < clip[2] and clip[1] <= y < clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Touching an exclusive object boundary counts as a semantic hit.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access


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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if False: continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    origin,scroll,point,records,window = data
    x,y = point[0]-origin[0]+scroll[0],point[1]-origin[1]+scroll[1]
    hits = []
    for index,(ident,owner,rect,z,exposed,transparent,clip,proxy,enabled) in enumerate(records):
        if owner != window or not exposed or transparent: continue
        x0,y0,x1,y1 = rect
        if not (x0 <= x < x1 and y0 <= y < y1): continue
        if clip is not None and not (clip[0] <= x <= clip[2] and clip[1] <= y <= clip[3]): continue
        hits.append((z,-index,proxy if proxy else ident))
    if not hits: return None
    return [max(hits,key=lambda hit:(hit[0],hit[1]))[2],[x,y]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[N,10],[N+1,3],[N+1,11],[['a','w',[0,0,8,8],1,True,False,None,'',True]],'w'],), ['a',[N+2,4]])
check('contract fixture 2', solve([[0,0],[0,0],[1,1],[['back','w',[0,0,4,4],1,True,False,None,'',True],['front','w',[0,0,4,4],5,True,False,None,'proxy',False]],'w'],), ['proxy',[1,1]])
check('contract fixture 3', solve([[0,0],[0,0],[1,1],[['first','w',[0,0,4,4],2,True,False,None,'',True],['second','w',[0,0,4,4],2,True,False,None,'',True]],'w'],), ['first',[1,1]])
check('contract fixture 4', solve([[0,0],[0,0],[1,1],[['a','other',[0,0,4,4],1,True,False,None,'',True],['b','w',[0,0,4,4],2,False,False,None,'',True],['c','w',[0,0,4,4],3,True,True,None,'',True]],'w'],), None)
check('contract fixture 5', solve([[0,0],[0,0],[4,1],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), None)
check('contract fixture 6', solve([[0,0],[0,0],[2,2],[['a','w',[0,0,4,4],1,True,False,[0,0,2,2],'',True]],'w'],), None)
check('contract fixture 7', solve([[0,0],[0,0],[0,0],[['a','w',[0,0,4,4],1,True,False,None,'',True]],'w'],), ['a',[0,0]])
check('contract fixture 8', solve([[0,0],[0,0],[1,1],[],'w'],), None)
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:
Native clipped regions remain semantically hit-testable.

Input [window_origin,scroll,point,records,expected_window]. Pointer is screen coordinates. Convert to document coordinates by subtracting window_origin and adding scroll. Records [id,window,rect,z,exposed,transparent,clip,proxy,enabled]; rect and optional clip are [x0,y0,x1,y1], half-open. Zero/reversed rectangles never hit. Reject other windows or unexposed records. Transparent records do not themselves hit. Reject points outside clip. Among hits largest z wins, ties retain first input. Disabled semantics remain inspectable. Return proxy ID when nonempty, else own ID, plus [document_x,document_y]. None when no hit. This is semantic hit selection, not pixel rendering or focus navigation.

split: open-access