FAILURE MAP
← Case archive

FA-8456 / Assistive semantics / Open access

Accessible relationship resolution: A control can reference itself as its controlled target · case 01

A control can reference itself as its controlled target.

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

ROOT CAUSE

The self operation uses `if False: continue` where the contract requires `if ident == self_id: continue`.

VERIFIED REPAIR

Implement the self operation as `if ident == self_id: continue`.

Unsuccessful approach: Keeping only self references discards valid 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 False: 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['self', 'a']['a']Failed
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 / e24557931766d2f0912dc7efcf05d38e007b7ef2e3672ef019ffc6edf3927de4

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 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['self']['a']Failed
dedup[]['a', 'b']Failed
missing[]['a', 'b']Failed
role[]['a']Failed
hidden[]['a']Failed
parameterized relationship identity[]['1']Failed
repeat hidden[]['a']Failed

SHA-256 / 3ae9055d7c1074f568eed14be07b282281831c3d6c8a8b3a64ef7e59d985501e

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.462138+00:00.

Case digest / 78bc75ca8044291d29e9bae3733b813a1ae7f5983ac795b7477c293f4c17c2f5