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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = start,min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(-1,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hyperlink offsets begin before document text.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),end
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length+1,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hyperlink spans exceed document extent.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start > end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start == end and start == 0: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Zero-length hyperlink spans pollute indexed link counts.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:x[2])
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hyperlink indices follow backend delivery order.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],-x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[2],x[1]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A wide hyperlink masks a narrower coincident text link.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if False: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen and not url: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Repeated hyperlink IDs yield multiple indexed descriptors.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start <= offset <= end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url])
    hit = next((ident for ident,start,end,url in rows if start < offset <= end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Text position at a link end still resolves to that link.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url.split('#')[0]])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(data):
    length,links,offset = data
    valid = []
    for i,(ident,start,end,url,enabled) in enumerate(links):
        if not enabled or not url: continue
        start,end = max(0,start),min(length,end)
        if start >= end: continue
        valid.append((start,end-start,i,ident,end,url))
    valid.sort(key=lambda x:(x[0],x[1],x[2]))
    seen = set()
    rows = []
    for start,width,i,ident,end,url in valid:
        if ident in seen: continue
        seen.add(ident)
        rows.append([ident,start,end,url.rstrip('#xy')])
    hit = next((ident for ident,start,end,url in rows if start <= offset < end),None)
    return [rows,hit]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+5,[['wide',N,N+4,'/a#x',True],['small',N,N+2,'/a#y',True]],N+1],), [[['small',N,N+2,'/a#y'],['wide',N,N+4,'/a#x']],'small'])
check('contract fixture 2', solve([5,[['a',-3,2,'/a',True],['b',2,8,'/b',True]],2],), [[['a',0,2,'/a'],['b',2,5,'/b']],'b'])
check('contract fixture 3', solve([5,[['a',1,1,'/a',True],['b',4,2,'/b',True],['c',0,3,'',True],['d',0,3,'/d',False]],0],), [[],None])
check('contract fixture 4', solve([6,[['a',3,6,'later',True],['a',0,2,'early',True]],1],), [[['a',0,2,'early']],'a'])
check('contract fixture 5', solve([3,[['a',0,3,'/same',True],['b',0,3,'/same',True]],3],), [[['a',0,3,'/same'],['b',0,3,'/same']],None])
check('contract fixture 6', solve([0,[],0],), [[],None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hyperlink destinations lose their fragment identity.

Input [text_length,links,offset] where links [id,start,end,url,enabled]. Admit only nonempty URL, enabled and nonempty interval after clamping. Sort by start then shorter interval then input order; dedupe IDs after sorting. Query offset resolves the first matching half-open span, or None. Return [ordered descriptors,hit_id]. URLs remain exact including fragments; IDs are retained even when URL is shared.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if len(items) < 2: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if len(items) == 1: return []
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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 singleton semantic reading flow is dropped as already complete.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if True))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded or x == start))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Excluded semantic objects enter reading flow.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or False or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target is None or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Reading flow reaches nonexisting semantic targets.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links[source] = target
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links[source] = target if target in items else links.get(source)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Later reading-flow declarations replace the first override.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start == items[0] else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Reading-flow start ignores the requested semantic object.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in sorted(items) if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in reversed(items) if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Unlinked reading flow uses lexical order.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set(items[:items.index(current)])
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set(items[:max(0,items.index(current)-1)])
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Starting late drops earlier objects from reading order.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current not in (None,''):
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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 but valid object identifiers terminate reading flow.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else None
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = None if nxt in seen else (nxt if nxt is not None else next((x for x in items if x not in seen),None))
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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 reading-flow cycle truncates unrelated remaining objects.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        if current != start: result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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):
    natural,edges,excluded,start = data
    items = list(dict.fromkeys(x for x in natural if x not in excluded))
    if not items: return []
    links = {}
    for source,target in edges:
        if source not in items or target not in items or source == target: continue
        links.setdefault(source,target)
    current = start if start in items else items[0]
    seen = set()
    result = []
    while current is not None:
        if current not in links: result.append(current)
        seen.add(current)
        nxt = links.get(current)
        current = nxt if nxt is not None and nxt not in seen else next((x for x in items if x not in seen),None)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([['a','b','c',str(N)],[['a','c'],['c','a']],[],'a'],), ['a','c','b',str(N)])
check('contract fixture 2', solve([['a','b','c'],[['a','c'],['a','b']],[],'a'],), ['a','c','b'])
check('contract fixture 3', solve([['a','b','c'],[['a','b'],['a','missing']],['b'],'a'],), ['a','c'])
check('contract fixture 4', solve([['a','b','c'],[],[],'c'],), ['c','a','b'])
check('contract fixture 5', solve([['b','a','b'],[['b','b']],[],'missing'],), ['b','a'])
check('contract fixture 6', solve([['a'],[['a','missing']],['a'],'a'],), [])
check('contract fixture 7', solve([['','a'],[['','a']],[],''],), ['','a'])
check('contract fixture 8', solve([['only'],[],[],'only'],), ['only'])
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:
Current semantic object is omitted from traversal output.

Input [natural_ids,edges,excluded,start] where edges are directed reading-flow overrides. Keep unique natural IDs in original order excluding excluded IDs. Admit edges between eligible distinct IDs; first outgoing edge wins. Reading starts at specified eligible ID otherwise first eligible. Follow override if target unvisited; otherwise take earliest unvisited natural node. Include each eligible object exactly once, prevent cycles, and return list of IDs. Explicit start does not remove earlier unvisited nodes.

split: open-access


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

N = 1
observations = []
def solve(data):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base <= revision and nxt > base
        valid = valid and all(k in {'name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base != revision and nxt > base
        valid = valid and all(k in {'name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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:
Outdated semantic property updates overwrite current values.

Input [initial,revision,updates]. Updates [base_revision,next_revision,changes] apply atomically only if base matches current and next is greater; updates cannot change immutable id or role. Allowed dynamic keys name,description,value,help,language; unknown keys reject whole update. None deletes a property, empty string is retained; values must be strings or None. Return [state,revision,accepted_flags]. Copy initial. Revision advances even for no-op changes.

split: open-access


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

N = 1
observations = []
def solve(data):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt >= base
        valid = valid and all(k in {'name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt != base
        valid = valid and all(k in {'name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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:
Nonadvancing accessibility revisions are accepted.

Input [initial,revision,updates]. Updates [base_revision,next_revision,changes] apply atomically only if base matches current and next is greater; updates cannot change immutable id or role. Allowed dynamic keys name,description,value,help,language; unknown keys reject whole update. None deletes a property, empty string is retained; values must be strings or None. Return [state,revision,accepted_flags]. Copy initial. Revision advances even for no-op changes.

split: open-access


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

N = 1
observations = []
def solve(data):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and all(k in {'id','name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and all(k in {'id','role','name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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:
Patch updates alter stable accessibility object identifiers.

Input [initial,revision,updates]. Updates [base_revision,next_revision,changes] apply atomically only if base matches current and next is greater; updates cannot change immutable id or role. Allowed dynamic keys name,description,value,help,language; unknown keys reject whole update. None deletes a property, empty string is retained; values must be strings or None. Return [state,revision,accepted_flags]. Copy initial. Revision advances even for no-op changes.

split: open-access


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

N = 1
observations = []
def solve(data):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and all(k in {'role','name','description','value','help','language'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and all(k in {'role','name','description','value','help','language','unknown'} for k in changes)
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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 property-only patch changes the object interface role.

Input [initial,revision,updates]. Updates [base_revision,next_revision,changes] apply atomically only if base matches current and next is greater; updates cannot change immutable id or role. Allowed dynamic keys name,description,value,help,language; unknown keys reject whole update. None deletes a property, empty string is retained; values must be strings or None. Return [state,revision,accepted_flags]. Copy initial. Revision advances even for no-op changes.

split: open-access


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

N = 1
observations = []
def solve(data):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and True
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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):
    initial,revision,updates = data
    state = dict(initial)
    accepted = []
    for base,nxt,changes in updates:
        valid = base == revision and nxt > base
        valid = valid and any(k in {'name','description','value','help','language'} for k in changes) or not changes
        valid = valid and all(v is None or isinstance(v,str) for v in changes.values())
        accepted.append(valid)
        if not valid: continue
        for key,value in changes.items():
            if value is None: state.pop(key,None)
            else: state[key] = value
        revision = nxt
    return [state,revision,accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([{'id':'x','role':'image','name':'old'},N,[[N,N+1,{'name':'new','help':''}],[N,N+2,{'name':'stale'}]]],), [{'id':'x','role':'image','name':'new','help':''},N+1,[True,False]])
check('contract fixture 2', solve([{'name':'x','help':'h'},N,[[N,N+1,{'name':None}],[N+1,N+2,{'absent':'bad','help':'bad'}]]],), [{'help':'h'},N+1,[True,False]])
check('contract fixture 3', solve([{'id':'x','role':'image'},N,[[N,N+1,{'id':'y'}],[N,N+1,{'role':'button'}]]],), [{'id':'x','role':'image'},N,[False,False]])
check('contract fixture 4', solve([{},N,[[N,N,{'name':'bad'}],[N,N-1,{}],[N,N+1,{}]]],), [{},N+1,[False,False,True]])
check('contract fixture 5', solve([{'name':'x'},N,[[N,N+1,{'name':42,'help':'partial'}]]],), [{'name':'x'},N,[False]])
check('contract fixture 6', solve([{},N,[[N,N+1,{'name':None,'description':'D','value':'0','language':'en'}]]],), [{'description':'D','value':'0','language':'en'},N+1,[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:
Unknown accessibility keys bypass atomic patch rejection.

Input [initial,revision,updates]. Updates [base_revision,next_revision,changes] apply atomically only if base matches current and next is greater; updates cannot change immutable id or role. Allowed dynamic keys name,description,value,help,language; unknown keys reject whole update. None deletes a property, empty string is retained; values must be strings or None. Return [state,revision,accepted_flags]. Copy initial. Revision advances even for no-op changes.

split: open-access