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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None and cap > 0: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A zero length cap leaks the entire protected value.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap+1]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:max(0,cap-1)]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The value cap leaks one extra character.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal or permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not reveal:
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Either reveal or permission independently unmasks a value.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if not permission:
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An unprotected control is unnecessarily masked.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join(' ' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Protected line separators are replaced by bullets.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder, 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if not protected else '', 'length':length,'editable':not readonly,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Placeholder text replaces a nonempty accessible value hint.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':True,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly or reveal,'protected':protected}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Read-only values are exposed as editable.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected and not reveal}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    raw,protected,reveal,permission,readonly,multiline,cap,placeholder = data
    value = raw.replace('\r\n','\n')
    if not multiline: value = value.replace('\n',' ')
    if cap is not None: value = value[:cap]
    length = len(value)
    if protected and not (reveal and permission):
        value = ''.join('\n' if c == '\n' else '•' for c in value)
    return {'text':value,'placeholder':placeholder if length == 0 else '', 'length':length,'editable':not readonly,'protected':protected and not permission}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('redacted multiline', solve(['A'*N+'\r\nB',True,False,True,False,True,None,'hint'],), {'text':'•'*N+'\n•','placeholder':'','length':N+2,'editable':True,'protected':True})
check('reveal lacks permission', solve(['A'*N,True,True,False,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('permission lacks reveal', solve(['A'*N,True,False,True,False,False,None,'hint'],), {'text':'•'*N,'placeholder':'','length':N,'editable':True,'protected':True})
check('authorized reveal readonly', solve(['secret',True,True,True,True,False,None,'hint'],), {'text':'secret','placeholder':'','length':6,'editable':False,'protected':True})
check('single line cap', solve(['A\r\nBC',False,False,False,False,False,3,'hint'],), {'text':'A B','placeholder':'','length':3,'editable':True,'protected':False})
check('zero cap placeholder', solve(['secret',True,False,False,False,False,0,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':True,'protected':True})
check('empty value', solve(['',False,False,False,True,False,None,'hint'],), {'text':'','placeholder':'hint','length':0,'editable':False,'protected':False})
check('unicode codepoints', solve(['😀é',True,False,False,False,True,None,''],), {'text':'••','placeholder':'','length':2,'editable':True,'protected':True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Revealed values lose their protected semantic flag.

Input [raw,protected,reveal,permission,readonly,multiline,max_length,placeholder]. Raw is a string; max_length is None or nonnegative. Normalize CRLF before applying codepoint cap. In single line replace LF with space. Protected text reveals only when reveal and permission; otherwise one bullet per capped codepoint excluding LF, which is retained. Empty values retain empty text and expose placeholder separately. Return {text,placeholder,length,editable,protected}; length is the length after cap, editable is not readonly, protected reports input flag even when revealed.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if False: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead and not loaded: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Destroyed frame hosts retain semantic children.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = (loaded or same) and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Unloaded embedded documents expose cached children.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and (allowed or same) and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and same and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Same origin is mistaken for accessibility permission.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed  and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and child is not None and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Empty child document IDs are traversable.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child)
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != host
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A document embeds itself in the semantic bridge.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if True]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != doc]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The frame host reappears among its own descendants.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':title if can else name,'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if not can else title,'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Child document title overwrites the authored frame name.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else title,'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if loaded else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Unreadable embedded documents leak their title.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':False,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded and not allowed,'unavailable':loaded and not can,'children':[child+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Loading frames are exposed as available and idle.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access


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

N = 1
observations = []
def solve(data):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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):
    host,doc,child,loaded,same,allowed,name,title,children,dead = data
    if dead: return None
    can = loaded and allowed and bool(child) and child != doc
    safe = [ident for ident in children if ident != host]
    return {'id':host,'name':name if name else (title if can else ''),'busy':not loaded,'unavailable':loaded and not can,'children':[doc+':'+ident for ident in safe] if can else [],'relation':[host,child] if can else None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('allowed foreign document', solve(['host','d','c',True,False,True,'','Title'+str(N),['a','b','a'],False],), {'id':'host','name':'Title'+str(N),'busy':False,'unavailable':False,'children':['c:a','c:b','c:a'],'relation':['host','c']})
check('same origin no permission', solve(['host','d','c',True,True,False,'','Secret',['a'],False],), {'id':'host','name':'','busy':False,'unavailable':True,'children':[],'relation':None})
check('not loaded', solve(['host','d','c',False,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':True,'unavailable':False,'children':[],'relation':None})
check('dead host', solve(['host','d','c',True,True,True,'Frame','Title',['a'],True],), None)
check('self document', solve(['host','d','d',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('empty child identifier', solve(['host','d','',True,True,True,'Frame','Title',['a'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':True,'children':[],'relation':None})
check('host filtered', solve(['host','d','c',True,True,True,'Frame','Title',['a','host','b'],False],), {'id':'host','name':'Frame','busy':False,'unavailable':False,'children':['c:a','c:b'],'relation':['host','c']})
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:
Embedded child IDs collide with host document IDs.

Input [host_id,host_doc,child_doc,loaded,same_origin,allow_read,host_name,child_title,children,defunct]. Return None if defunct. Otherwise return a host bridge object. Child document may only be traversed when loaded and allow_read; same_origin alone grants no reading. Expose children in original order, including repeated distinct IDs, prefixed with child_doc and colon; child document ID cannot be empty or equal to host document. Name prefers a nonempty host name, then child title only if traversal allowed, otherwise empty. Busy means not loaded; unavailable means loaded but traversal forbidden. Relation is [host_id,child_doc] only for traversable children. Source lists never include the host itself.

split: open-access