FAILURE MAP
← Case archive

FA-53781 / Accessibility interaction semantics / Open access

An attribute patch contaminates subsequent text positions · case 01

An attribute patch contaminates subsequent text positions.

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

ROOT CAUSE

The default copy decision in the text attribute runs adapter violates its declared contract.

THE FAILURE

The default copy decision in the text attribute runs adapter violates its declared contract.

Unsuccessful approach: The local repair substitutes attrs = defaults if pos else dict(defaults) but still mishandles the regression fixtures.

Case contract

Input [length,default_attributes,spans] where spans are [start,end,attributes,priority]. Clamp endpoints to [0,length], discard empty/reversed spans. At each character position merge active spans over defaults by increasing priority, preserving input tie order; None attribute removes that attribute. Build maximal equal adjacent runs [start,end,attributes]. Zero length returns empty. Offsets are codepoints. Dictionary values are strings or None.

Why this case matters

Offline accessibility bridge model with explicit policy; useful for testing semantic API adapters independently of browser implementations.

1 / The failure

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

N = 1
observations = []
def solve(data):
    length,defaults,spans = data
    points = []
    for pos in range(length):
        attrs = defaults
        active = [(p,i,a) for i,(s,e,a,p) in enumerate(spans) if max(0,s) <= pos < min(length,e)]
        for priority,idx,updates in sorted(active,key=lambda x:(x[0],x[1])):
            for key,value in updates.items():
                if value is None: attrs.pop(key,None)
                else: attrs[key] = value
        points.append(attrs)
    result = []
    for pos,attrs in enumerate(points):
        if result and result[-1][2] == attrs: result[-1][1] = pos+1
        else: result.append([pos,pos+1,attrs])
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+2,{'lang':'en'},[[0,N,{'weight':'bold'},1],[1,N+1,{'lang':'fr'},2]]],), [[0,1,{'lang':'en','weight':'bold'}]]+([[1,N,{'lang':'fr','weight':'bold'}]] if N>1 else [])+[[N,N+1,{'lang':'fr'}],[N+1,N+2,{'lang':'en'}]])
check('contract fixture 2', solve([3,{'lang':'en','color':'red'},[[0,3,{'lang':None},1],[1,2,{'color':'blue'},2]]],), [[0,1,{'color':'red'}],[1,2,{'color':'blue'}],[2,3,{'color':'red'}]])
check('contract fixture 3', solve([3,{},[[0,3,{'x':'high'},5],[0,3,{'x':'low'},1]]],), [[0,3,{'x':'high'}]])
check('contract fixture 4', solve([3,{},[[0,3,{'x':'first'},1],[0,3,{'x':'last'},1]]],), [[0,3,{'x':'last'}]])
check('contract fixture 5', solve([3,{},[[-3,2,{'x':'a'},0],[2,8,{'x':'a'},0],[2,1,{'x':'bad'},9]]],), [[0,3,{'x':'a'}]])
check('contract fixture 6', solve([0,{'lang':'en'},[]],), [])
check('contract fixture 7', solve([2,{'lang':'en'},[[0,1,{},0]]],), [[0,2,{'lang':'en'}]])
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
contract fixture 1[[0, 3, {'lang': 'fr', 'weight': 'bold'}]][[0, 1, {'lang': 'en', 'weight': 'bold'}], [1, 2, {'lang': 'fr'}], [2, 3, {'lang': 'en'}]]Failed
contract fixture 2[[0, 3, {'color': 'blue'}]][[0, 1, {'color': 'red'}], [1, 2, {'color': 'blue'}], [2, 3, {'color': 'red'}]]Failed
contract fixture 3[[0, 3, {'x': 'high'}]][[0, 3, {'x': 'high'}]]Passed
contract fixture 4[[0, 3, {'x': 'last'}]][[0, 3, {'x': 'last'}]]Passed
contract fixture 5[[0, 3, {'x': 'a'}]][[0, 3, {'x': 'a'}]]Passed
contract fixture 6[][]Passed
contract fixture 7[[0, 2, {'lang': 'en'}]][[0, 2, {'lang': 'en'}]]Passed

SHA-256 / b667f67e8d8cdc3e19d09b17dd8365f46f56c81ce4ba00b58cb8ccb93a70b38a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(data):
    length,defaults,spans = data
    points = []
    for pos in range(length):
        attrs = defaults if pos else dict(defaults)
        active = [(p,i,a) for i,(s,e,a,p) in enumerate(spans) if max(0,s) <= pos < min(length,e)]
        for priority,idx,updates in sorted(active,key=lambda x:(x[0],x[1])):
            for key,value in updates.items():
                if value is None: attrs.pop(key,None)
                else: attrs[key] = value
        points.append(attrs)
    result = []
    for pos,attrs in enumerate(points):
        if result and result[-1][2] == attrs: result[-1][1] = pos+1
        else: result.append([pos,pos+1,attrs])
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([N+2,{'lang':'en'},[[0,N,{'weight':'bold'},1],[1,N+1,{'lang':'fr'},2]]],), [[0,1,{'lang':'en','weight':'bold'}]]+([[1,N,{'lang':'fr','weight':'bold'}]] if N>1 else [])+[[N,N+1,{'lang':'fr'}],[N+1,N+2,{'lang':'en'}]])
check('contract fixture 2', solve([3,{'lang':'en','color':'red'},[[0,3,{'lang':None},1],[1,2,{'color':'blue'},2]]],), [[0,1,{'color':'red'}],[1,2,{'color':'blue'}],[2,3,{'color':'red'}]])
check('contract fixture 3', solve([3,{},[[0,3,{'x':'high'},5],[0,3,{'x':'low'},1]]],), [[0,3,{'x':'high'}]])
check('contract fixture 4', solve([3,{},[[0,3,{'x':'first'},1],[0,3,{'x':'last'},1]]],), [[0,3,{'x':'last'}]])
check('contract fixture 5', solve([3,{},[[-3,2,{'x':'a'},0],[2,8,{'x':'a'},0],[2,1,{'x':'bad'},9]]],), [[0,3,{'x':'a'}]])
check('contract fixture 6', solve([0,{'lang':'en'},[]],), [])
check('contract fixture 7', solve([2,{'lang':'en'},[[0,1,{},0]]],), [[0,2,{'lang':'en'}]])
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
contract fixture 1[[0, 1, {'lang': 'en', 'weight': 'bold'}], [1, 3, {'lang': 'fr'}]][[0, 1, {'lang': 'en', 'weight': 'bold'}], [1, 2, {'lang': 'fr'}], [2, 3, {'lang': 'en'}]]Failed
contract fixture 2[[0, 1, {'color': 'red'}], [1, 3, {'color': 'blue'}]][[0, 1, {'color': 'red'}], [1, 2, {'color': 'blue'}], [2, 3, {'color': 'red'}]]Failed
contract fixture 3[[0, 3, {'x': 'high'}]][[0, 3, {'x': 'high'}]]Passed
contract fixture 4[[0, 3, {'x': 'last'}]][[0, 3, {'x': 'last'}]]Passed
contract fixture 5[[0, 3, {'x': 'a'}]][[0, 3, {'x': 'a'}]]Passed
contract fixture 6[][]Passed
contract fixture 7[[0, 2, {'lang': 'en'}]][[0, 2, {'lang': 'en'}]]Passed

SHA-256 / 15cd9892fa5da78f81cfb0c5af5008e6f396b97c25596d311b80853d26fe19df

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated finite adapter contract, not a claim of platform accessibility or ARIA conformance. 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:45:42.450188+00:00.

Case digest / dd3a6d317dbc76ba41fc07ba685f1ab29225640b5ae40f3b15f3e1d727ee40b4