FA-37451 / Table interactions / Open access
Table expandable detail rows: detail eligibility · case 01
The table detail eligibility result violates the stipulated table expandable detail rows contract.
ROOT CAUSE
The detail eligibility decision uses 'key not in expanded' instead of 'key not in expanded or key not in can_expand'.
VERIFIED REPAIR
Apply the complete detail eligibility rule: key not in expanded or key not in can_expand.
Unsuccessful approach: The attempted repair 'key not in can_expand' 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: 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}, {'height': 9, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}], 'total': 12} | {'data_count': 1, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}], 'total': 3} | Failed |
| 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 / f68f94a015889ffbf34f31984927bbfca081ceffb4a53c61f1b402c848f340a2
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 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}, {'height': 9, 'key': ['detail', 'b'], 'kind': 'detail', 'owner': 'b', 'selectable': False}], 'total': 22} | {'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': 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}, {'height': 9, 'key': ['detail', 'c'], 'kind': 'detail', 'owner': 'c', 'selectable': False}], 'total': 14} | {'data_count': 1, 'expanded': [], 'items': [{'height': 5, 'key': ['data', 'c'], 'kind': 'data', 'owner': 'c', 'selectable': True}], 'total': 5} | Failed |
| collapsed rows | {'data_count': 2, 'expanded': [], 'items': [{'height': 3, 'key': ['data', 'a'], 'kind': 'data', 'owner': 'a', 'selectable': True}, {'height': 9, 'key': ['detail', 'a'], 'kind': 'detail', 'owner': 'a', 'selectable': False}, {'height': 4, 'key': ['data', 'b'], 'kind': 'data', 'owner': 'b', 'selectable': True}, {'height': 9, 'key': ['detail', 'b'], 'kind': 'detail', 'owner': 'b', 'selectable': False}], 'total': 25} | {'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} | Failed |
| empty | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | {'data_count': 0, 'expanded': [], 'items': [], 'total': 0} | Passed |
SHA-256 / bfadab2d38acd5c3ce82273220a540777d743a8ca071d07a963249d2cea638fa
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.301170+00:00.
Case digest / 4d24fea73675daca587d3077a56437e849fcf34a58d4add2f7a79c99f6fef387