FA-37851 / Table interactions / Open access
Table grouped row projection: group key namespace · case 01
The table group key namespace result violates the stipulated table grouped row projection contract.
ROOT CAUSE
The group key namespace decision uses 'key' instead of "('group',key)".
VERIFIED REPAIR
Apply the complete group key namespace rule: ('group',key).
Unsuccessful approach: The attempted repair "('group',g['label'])" 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':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': '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': '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}] | Failed |
| collapsed group | [{'checked': True, 'count': 1, 'key': 'g', 'kind': 'group', 'label': 'Label', 'mixed': False}] | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | Failed |
| hidden members | [{'checked': False, 'count': 1, 'key': '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}] | Failed |
| empty shown | [{'checked': False, 'count': 0, 'key': 'g', 'kind': 'group', 'label': '', 'mixed': False}] | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | Failed |
| empty removed | [] | [] | Passed |
| no groups | [] | [] | Passed |
SHA-256 / c21b5c3d7e3528b25341b68fd3e3d07c3dc6c3ebc75095ea2465547765b0ebd3
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',g['label']),'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', 'Group'], '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', 'Group'], '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}] | Failed |
| collapsed group | [{'checked': True, 'count': 1, 'key': ['group', 'Label'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | [{'checked': True, 'count': 1, 'key': ['group', 'g'], 'kind': 'group', 'label': 'Label', 'mixed': False}] | Failed |
| 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}] | Failed |
| empty shown | [{'checked': False, 'count': 0, 'key': ['group', ''], 'kind': 'group', 'label': '', 'mixed': False}] | [{'checked': False, 'count': 0, 'key': ['group', 'g'], 'kind': 'group', 'label': '', 'mixed': False}] | Failed |
| empty removed | [] | [] | Passed |
| no groups | [] | [] | Passed |
SHA-256 / cfaedc1515e5b412f5bf14b508e62f947b898525d3edd4bcf7741de18c2f1196
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.296809+00:00.
Case digest / 19d5aa73e110bdda249cc159142e001e0ea4e14a19d5f2bd3741a4d605ea7736