FAILURE MAP
← Case archive

FA-8461 / Assistive semantics / Open access

Accessible relationship resolution: Duplicate target IDs are announced repeatedly · case 01

Duplicate target IDs are announced repeatedly.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The duplicates operation uses `if False: continue` where the contract requires `if ident in seen: continue`.

VERIFIED REPAIR

Implement the duplicates operation as `if ident in seen: continue`.

Unsuccessful approach: Allowing only one target truncates multi-target relationships.

Case contract

Resolve target IDs in caller order, deduplicate, and exclude self references, missing nodes, incompatible roles and hidden targets.

Why this case matters

A deterministic model of accessible relationship resolution; this isolates one interface invariant without requiring a browser.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(ids, registry, role, required_role, self_id):
    seen = set()
    result = []
    for ident in ids:
        if ident == self_id: continue
        if False: continue
        if ident not in registry: continue
        if registry[ident]['role'] != required_role: continue
        if registry[ident]['hidden']: continue
        seen.add(ident)
        result.append(ident)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self', solve(['self','a'], {'self':{'role':'panel','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('dedup', solve(['a','a','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('missing', solve(['a','gone','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('role', solve(['bad','a'], {'bad':{'role':'button','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('parameterized relationship identity', solve([str(N)], {str(N):dict(role='panel',hidden=False)}, 'tab', 'panel', 'self'), [str(N)])
for repetition in range(N):
    check('repeat hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
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)
Boundary fixtureActualExpectedOutcome
self['a']['a']Passed
dedup['a', 'a', 'b']['a', 'b']Failed
missing['a', 'b']['a', 'b']Passed
role['a']['a']Passed
hidden['a']['a']Passed
parameterized relationship identity['1']['1']Passed
repeat hidden['a']['a']Passed

SHA-256 / 6ed20625c3611bdeeb2a87ccde41372974854392108db0a3c603097dfbfad9c5

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(ids, registry, role, required_role, self_id):
    seen = set()
    result = []
    for ident in ids:
        if ident == self_id: continue
        if result: continue
        if ident not in registry: continue
        if registry[ident]['role'] != required_role: continue
        if registry[ident]['hidden']: continue
        seen.add(ident)
        result.append(ident)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self', solve(['self','a'], {'self':{'role':'panel','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('dedup', solve(['a','a','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('missing', solve(['a','gone','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('role', solve(['bad','a'], {'bad':{'role':'button','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('parameterized relationship identity', solve([str(N)], {str(N):dict(role='panel',hidden=False)}, 'tab', 'panel', 'self'), [str(N)])
for repetition in range(N):
    check('repeat hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
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)
Boundary fixtureActualExpectedOutcome
self['a']['a']Passed
dedup['a']['a', 'b']Failed
missing['a']['a', 'b']Failed
role['a']['a']Passed
hidden['a']['a']Passed
parameterized relationship identity['1']['1']Passed
repeat hidden['a']['a']Passed

SHA-256 / 5bbef4c14b51f649ff33bfc5226238335cbabcfd3d623ba371d2c53a851dab41

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(ids, registry, role, required_role, self_id):
    seen = set()
    result = []
    for ident in ids:
        if ident == self_id: continue
        if ident in seen: continue
        if ident not in registry: continue
        if registry[ident]['role'] != required_role: continue
        if registry[ident]['hidden']: continue
        seen.add(ident)
        result.append(ident)
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self', solve(['self','a'], {'self':{'role':'panel','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('dedup', solve(['a','a','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('missing', solve(['a','gone','b'], {'a':{'role':'panel','hidden':False},'b':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a', 'b'])
check('role', solve(['bad','a'], {'bad':{'role':'button','hidden':False},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
check('parameterized relationship identity', solve([str(N)], {str(N):dict(role='panel',hidden=False)}, 'tab', 'panel', 'self'), [str(N)])
for repetition in range(N):
    check('repeat hidden', solve(['bad','a'], {'bad':{'role':'panel','hidden':True},'a':{'role':'panel','hidden':False}}, 'tab', 'panel', 'self'), ['a'])
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)
Boundary fixtureActualExpectedOutcome
self['a']['a']Passed
dedup['a', 'b']['a', 'b']Passed
missing['a', 'b']['a', 'b']Passed
role['a']['a']Passed
hidden['a']['a']Passed
parameterized relationship identity['1']['1']Passed
repeat hidden['a']['a']Passed

SHA-256 / 35c8f31361a84cc49c4586cbfae276274bf94ce235f540c7055c04419979d112

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:21.505379+00:00.

Case digest / 0528e2c75c8147c8896d71c88cd299b32cdaf850a9c2a73ee67d5fa27f0c4007