FA-37881 / Table interactions / Open access
Table grouped row projection: group row key · case 01
The table group row key result violates the stipulated table grouped row projection contract.
ROOT CAUSE
The group row key decision uses "('row',i)" instead of "('row',r['id'])".
VERIFIED REPAIR
Apply the complete group row key rule: ('row',r['id']).
Unsuccessful approach: The attempted repair "('row',key,i)" still loses a required part of the table contract.
Case contract
Table group headers retain stable namespaced group keys distinct from labels, count visible members, derive tri-state selection over visible children, honor empty/collapsed group policies, and reset row striping within each group.
Why this case matters
An offline table UI model isolates table grouped row projection, 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(groups, collapsed, hidden, selected, show_empty):
out=[]
for g in groups:
children=[r for r in g['rows'] if r['id'] not in hidden]
if not children and not show_empty: continue
key=g['key']
picked=[r for r in children if r['id'] in selected]
out.append({'kind':'group','key':('group',key),'label':g['label'],'count':len(children),'checked':bool(children) and len(picked)==len(children),'mixed':0<len(picked)<len(children)})
if key in collapsed: continue
out += [{'kind':'row','key':('row',i),'group':key,'row':r,'stripe':i%2} for i,r in enumerate(children)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':1},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 2:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':2},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 2}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 3:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':3},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 3}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 4:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':4},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 4}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 5:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':5},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 5}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
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 |
|---|---|---|---|
| partial selected group | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 0], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 1], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 0], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 1], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | Failed |
| collapsed group | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | Passed |
| hidden members | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 0], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | Failed |
| empty shown | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | Passed |
| empty removed | [] | [] | Passed |
| no groups | [] | [] | Passed |
SHA-256 / 608a3304adf940dfae85a72ccf6218a22221ca087a40344afb391e6d1908b886
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(groups, collapsed, hidden, selected, show_empty):
out=[]
for g in groups:
children=[r for r in g['rows'] if r['id'] not in hidden]
if not children and not show_empty: continue
key=g['key']
picked=[r for r in children if r['id'] in selected]
out.append({'kind':'group','key':('group',key),'label':g['label'],'count':len(children),'checked':bool(children) and len(picked)==len(children),'mixed':0<len(picked)<len(children)})
if key in collapsed: continue
out += [{'kind':'row','key':('row',key,i),'group':key,'row':r,'stripe':i%2} for i,r in enumerate(children)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':1},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 2:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':2},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 2}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 3:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':3},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 3}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 4:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':4},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 4}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 5:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':5},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 5}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
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 |
|---|---|---|---|
| partial selected group | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 'g1', 0], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 'g1', 1], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 'g2', 0], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 'g2', 1], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | Failed |
| collapsed group | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | Passed |
| hidden members | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 'g', 0], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | Failed |
| empty shown | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | Passed |
| empty removed | [] | [] | Passed |
| no groups | [] | [] | Passed |
SHA-256 / 0781251319ff93b77a21fdf4af532fda8cf22921ca84ba258e2742dff537780e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(groups, collapsed, hidden, selected, show_empty):
out=[]
for g in groups:
children=[r for r in g['rows'] if r['id'] not in hidden]
if not children and not show_empty: continue
key=g['key']
picked=[r for r in children if r['id'] in selected]
out.append({'kind':'group','key':('group',key),'label':g['label'],'count':len(children),'checked':bool(children) and len(picked)==len(children),'mixed':0<len(picked)<len(children)})
if key in collapsed: continue
out += [{'kind':'row','key':('row',r['id']),'group':key,'row':r,'stripe':i%2} for i,r in enumerate(children)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':1},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 2:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':2},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 2}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 3:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':3},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 3}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 4:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':4},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 4}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
if N == 5:
check('partial selected group', solve([{'key':'g1','label':'Group','rows':[{'id':'a','v':5},{'id':'b'}]},{'key':'g2','label':'Group','rows':[{'id':'c'},{'id':'d'}]}], [], [], ['a','c','d'], False), [{'kind': 'group', 'key': ('group', 'g1'), 'label': 'Group', 'count': 2, 'checked': False, 'mixed': True}, {'kind': 'row', 'key': ('row', 'a'), 'group': 'g1', 'row': {'id': 'a', 'v': 5}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'b'), 'group': 'g1', 'row': {'id': 'b'}, 'stripe': 1}, {'kind': 'group', 'key': ('group', 'g2'), 'label': 'Group', 'count': 2, 'checked': True, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g2', 'row': {'id': 'c'}, 'stripe': 0}, {'kind': 'row', 'key': ('row', 'd'), 'group': 'g2', 'row': {'id': 'd'}, 'stripe': 1}])
check('collapsed group', solve([{'key':'g','label':'Label','rows':[{'id':'a'}]}], ['g'], [], ['a'], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'Label', 'count': 1, 'checked': True, 'mixed': False}])
check('hidden members', solve([{'key':'g','label':'G','rows':[{'id':'a'},{'id':'b'},{'id':'c'}]}], [], ['a','b'], [], False), [{'kind': 'group', 'key': ('group', 'g'), 'label': 'G', 'count': 1, 'checked': False, 'mixed': False}, {'kind': 'row', 'key': ('row', 'c'), 'group': 'g', 'row': {'id': 'c'}, 'stripe': 0}])
check('empty shown', solve([{'key':'g','label':'','rows':[]}], [], [], [], True), [{'kind': 'group', 'key': ('group', 'g'), 'label': '', 'count': 0, 'checked': False, 'mixed': False}])
check('empty removed', solve([{'key':'g','label':'G','rows':[]}], [], [], [], False), [])
check('no groups', solve([], [], [], [], False), [])
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 |
|---|---|---|---|
| partial selected group | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | [{'checked': False, 'count': 2, 'key': ['group', 'g1'], 'kind': 'group', 'label': 'Group', 'mixed': True}, {'group': 'g1', 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a', 'v': 1}, 'stripe': 0}, {'group': 'g1', 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'stripe': 1}, {'checked': True, 'count': 2, 'key': ['group', 'g2'], 'kind': 'group', 'label': 'Group', 'mixed': False}, {'group': 'g2', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}, {'group': 'g2', 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'stripe': 1}] | Passed |
| collapsed group | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | Passed |
| hidden members | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | [{'checked': False, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'G', 'mixed': False}, {'group': 'g', 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'stripe': 0}] | Passed |
| empty shown | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | Passed |
| empty removed | [] | [] | Passed |
| no groups | [] | [] | Passed |
SHA-256 / 0efa1b8931fc2ac0fda3ec681533f2cc051b10309dbe939c5dc57ce50f3f342d
Verification & scope
Group keys and member row IDs are stable and unique; group label strings may be equal or empty. 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:05.601665+00:00.
Case digest / 73553f1e04395055f541f57433f96ac52cdff3c4d2ed71caf160ccbaf7f6762a