FA-37471 / Table interactions / Open access
Table expandable detail rows: detail selectability · case 01
The table detail selectability result violates the stipulated table expandable detail rows contract.
ROOT CAUSE
The detail selectability decision uses "'selectable':True" instead of "'selectable':False".
VERIFIED REPAIR
Apply the complete detail selectability rule: 'selectable':False.
Unsuccessful approach: The attempted repair "'selectable':key in expanded" still loses a required part of the table contract.
Case contract
Detail rows have namespaced stable render keys, follow their visible expandable owner, never count as selectable data rows, use measured heights including zero, and contribute to total content height while expansion state output excludes hidden or ineligible rows.
Why this case matters
An offline table UI model isolates table expandable detail rows, including adversarial row/column relationships.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, expanded, hidden, can_expand, heights, default_height):
out=[]
for row in rows:
key=row['id']
if key in hidden: continue
out.append({'key':('data',key),'kind':'data','owner':key,'height':row['height'],'selectable':True})
if key not in expanded or key not in can_expand: continue
out.append({'key':('detail',key),'kind':'detail','owner':key,'height':heights.get(key,default_height),'selectable':True})
return {'items':out,'total':sum(x['height'] for x in out),'data_count':sum(x['kind']=='data' for x in out),'expanded': [r['id'] for r in rows if r['id'] in expanded and r['id'] in can_expand and r['id'] not in hidden]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':1+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 6, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 13, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 2:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':2+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 7, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 14, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 3:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':3+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 8, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 15, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 4:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':4+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 9, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 16, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 5:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':5+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 10, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 17, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| expanded detail | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | Failed |
| zero measured detail | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': True}], 'total': 3} | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}], 'total': 3} | Failed |
| nonexpandable row | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | Passed |
| hidden expanded owners | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | Passed |
| collapsed rows | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | Passed |
| empty | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | Passed |
SHA-256 / 7f0152e547ecabeec4abc73f6ef98d7b9dfa5e5f05790eee99752e2f7cb034e0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, expanded, hidden, can_expand, heights, default_height):
out=[]
for row in rows:
key=row['id']
if key in hidden: continue
out.append({'key':('data',key),'kind':'data','owner':key,'height':row['height'],'selectable':True})
if key not in expanded or key not in can_expand: continue
out.append({'key':('detail',key),'kind':'detail','owner':key,'height':heights.get(key,default_height),'selectable':key in expanded})
return {'items':out,'total':sum(x['height'] for x in out),'data_count':sum(x['kind']=='data' for x in out),'expanded': [r['id'] for r in rows if r['id'] in expanded and r['id'] in can_expand and r['id'] not in hidden]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':1+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 6, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 13, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 2:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':2+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 7, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 14, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 3:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':3+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 8, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 15, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 4:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':4+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 9, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 16, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 5:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':5+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 10, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 17, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| expanded detail | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | Failed |
| zero measured detail | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': True}], 'total': 3} | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}], 'total': 3} | Failed |
| nonexpandable row | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | Passed |
| hidden expanded owners | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | Passed |
| collapsed rows | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | Passed |
| empty | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | Passed |
SHA-256 / d2a64acef22e636d2fa208cb1004bbcd59c80ec1b67869b43a83f59b5d8958a9
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, expanded, hidden, can_expand, heights, default_height):
out=[]
for row in rows:
key=row['id']
if key in hidden: continue
out.append({'key':('data',key),'kind':'data','owner':key,'height':row['height'],'selectable':True})
if key not in expanded or key not in can_expand: continue
out.append({'key':('detail',key),'kind':'detail','owner':key,'height':heights.get(key,default_height),'selectable':False})
return {'items':out,'total':sum(x['height'] for x in out),'data_count':sum(x['kind']=='data' for x in out),'expanded': [r['id'] for r in rows if r['id'] in expanded and r['id'] in can_expand and r['id'] not in hidden]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':1+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 6, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 13, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 2:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':2+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 7, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 14, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 3:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':3+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 8, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 15, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 4:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':4+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 9, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 16, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
if N == 5:
check('expanded detail', solve([{'id':'a','height':3},{'id':'b','height':4}], ['a'], [], ['a','b'], {'a':5+5}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 10, 'selectable': False}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 17, 'data_count': 2, 'expanded': ['a']})
check('zero measured detail', solve([{'id':'a','height':3}], ['a'], [], ['a'], {'a':0}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('detail', 'a'), 'kind': 'detail', 'owner': 'a', 'height': 0, 'selectable': False}], 'total': 3, 'data_count': 1, 'expanded': ['a']})
check('nonexpandable row', solve([{'id':'a','height':3}], ['a'], [], [], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}], 'total': 3, 'data_count': 1, 'expanded': []})
check('hidden expanded owners', solve([{'id':'a','height':3},{'id':'b','height':4},{'id':'c','height':5}], ['a','b'], ['a','b'], ['a','b','c'], {}, 9), {'items': [{'key': ('data', 'c'), 'kind': 'data', 'owner': 'c', 'height': 5, 'selectable': True}], 'total': 5, 'data_count': 1, 'expanded': []})
check('collapsed rows', solve([{'id':'a','height':3},{'id':'b','height':4}], [], [], ['a','b'], {}, 9), {'items': [{'key': ('data', 'a'), 'kind': 'data', 'owner': 'a', 'height': 3, 'selectable': True}, {'key': ('data', 'b'), 'kind': 'data', 'owner': 'b', 'height': 4, 'selectable': True}], 'total': 7, 'data_count': 2, 'expanded': []})
check('empty', solve([], ['missing'], [], [], {}, 9), {'items': [], 'total': 0, 'data_count': 0, 'expanded': []})
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| expanded detail | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | {'data_count': 2, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 6, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 13} | Passed |
| zero measured detail | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}], 'total': 3} | {'data_count': 1, 'expanded': ['a'], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 0, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}], 'total': 3} | Passed |
| nonexpandable row | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | Passed |
| hidden expanded owners | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | Passed |
| collapsed rows | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}], 'total': 7} | Passed |
| empty | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | Passed |
SHA-256 / ed4d33fa6741af701d1c722b1ba240aa4ee739df6368b7e1eb9582561240bbc9
Verification & scope
Base row IDs are unique; base/detail heights are nonnegative, including valid measured zero. Deterministic offline table UI model; no browser, DOM, framework, or standards conformance is claimed. 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:43:01.482187+00:00.
Case digest / 65b6b8b7e03f48772769972c92ceefe52f86e42f2df01429d3c29bda0d4e3bba