FA-38191 / Table interactions / Open access
Table row action targeting: clicked selected scope · case 01
The table clicked selected scope result violates the stipulated table row action targeting contract.
ROOT CAUSE
The clicked selected scope decision uses "action['bulk']" instead of "clicked in selected and action['bulk']".
VERIFIED REPAIR
Apply the complete clicked selected scope rule: clicked in selected and action['bulk'].
Unsuccessful approach: The attempted repair 'clicked in selected' still loses a required part of the table contract.
Case contract
A row action uses current row order, bulk selection only when the clicked row belongs to it and the action permits bulk, optional visible scope, default-deny per-action permissions, atomic busy/permission rejection, explicit empty scope, confirmation policy, and per-row revision snapshots.
Why this case matters
An offline table UI model isolates table row action targeting, 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, clicked, selected, action, permissions, pending, include_hidden, visible, revision):
by={r['id']:r for r in rows}
if clicked not in by: return {'status':'missing','targets':[]}
ids=[r['id'] for r in rows if r['id'] in selected] if action['bulk'] else [clicked]
if not include_hidden: ids=[k for k in ids if k in visible]
blocked=[k for k in ids if not permissions.get(k,{}).get(action['id'],False)]
busy=[k for k in ids if k in pending]
if blocked: return {'status':'forbidden','targets':[],'blocked':blocked}
if busy: return {'status':'busy','targets':[],'blocked':busy}
if not ids: return {'status':'empty','targets':[]}
return {'status':'confirm' if action.get('confirm') else 'ready','targets':[{'id':k,'revision':revision.get(k),'payload':{f:by[k].get(f) for f in action.get('fields',[])}} for k in ids],'action':action['id']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('ordered bulk selection', solve([{'id':'a','v':1},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 1}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 2:
check('ordered bulk selection', solve([{'id':'a','v':2},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 2}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 3:
check('ordered bulk selection', solve([{'id':'a','v':3},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 3}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 4:
check('ordered bulk selection', solve([{'id':'a','v':4},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 4}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 5:
check('ordered bulk selection', solve([{'id':'a','v':5},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 5}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
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 |
|---|---|---|---|
| ordered bulk selection | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | Passed |
| clicked outside selection | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': 1}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'b', 'payload': {}, 'revision': 2}]} | Failed |
| single action selected | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Passed |
| one forbidden member | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | Passed |
| one busy member | {'blocked': ['b'], 'status': 'busy', 'targets': []} | {'blocked': ['b'], 'status': 'busy', 'targets': []} | Passed |
| hidden targets excluded | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Passed |
| empty visible scope | {'status': 'empty', 'targets': []} | {'status': 'empty', 'targets': []} | Passed |
| missing row | {'status': 'missing', 'targets': []} | {'status': 'missing', 'targets': []} | Passed |
SHA-256 / 8f38e0fa25541a62f0285f8aeef6eaed8275b192be8ef07de478ec8aa856f22f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, clicked, selected, action, permissions, pending, include_hidden, visible, revision):
by={r['id']:r for r in rows}
if clicked not in by: return {'status':'missing','targets':[]}
ids=[r['id'] for r in rows if r['id'] in selected] if clicked in selected else [clicked]
if not include_hidden: ids=[k for k in ids if k in visible]
blocked=[k for k in ids if not permissions.get(k,{}).get(action['id'],False)]
busy=[k for k in ids if k in pending]
if blocked: return {'status':'forbidden','targets':[],'blocked':blocked}
if busy: return {'status':'busy','targets':[],'blocked':busy}
if not ids: return {'status':'empty','targets':[]}
return {'status':'confirm' if action.get('confirm') else 'ready','targets':[{'id':k,'revision':revision.get(k),'payload':{f:by[k].get(f) for f in action.get('fields',[])}} for k in ids],'action':action['id']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('ordered bulk selection', solve([{'id':'a','v':1},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 1}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 2:
check('ordered bulk selection', solve([{'id':'a','v':2},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 2}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 3:
check('ordered bulk selection', solve([{'id':'a','v':3},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 3}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 4:
check('ordered bulk selection', solve([{'id':'a','v':4},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 4}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 5:
check('ordered bulk selection', solve([{'id':'a','v':5},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 5}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
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 |
|---|---|---|---|
| ordered bulk selection | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | Passed |
| clicked outside selection | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'b', 'payload': {}, 'revision': 2}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'b', 'payload': {}, 'revision': 2}]} | Passed |
| single action selected | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}, {'id': 'b', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Failed |
| one forbidden member | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | Passed |
| one busy member | {'blocked': ['b'], 'status': 'busy', 'targets': []} | {'blocked': ['b'], 'status': 'busy', 'targets': []} | Passed |
| hidden targets excluded | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Passed |
| empty visible scope | {'status': 'empty', 'targets': []} | {'status': 'empty', 'targets': []} | Passed |
| missing row | {'status': 'missing', 'targets': []} | {'status': 'missing', 'targets': []} | Passed |
SHA-256 / e2b8f4a1ef8cf6ab46b6cdce02d4296f969c246cda64c9e1d30e92e9975dee41
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, clicked, selected, action, permissions, pending, include_hidden, visible, revision):
by={r['id']:r for r in rows}
if clicked not in by: return {'status':'missing','targets':[]}
ids=[r['id'] for r in rows if r['id'] in selected] if clicked in selected and action['bulk'] else [clicked]
if not include_hidden: ids=[k for k in ids if k in visible]
blocked=[k for k in ids if not permissions.get(k,{}).get(action['id'],False)]
busy=[k for k in ids if k in pending]
if blocked: return {'status':'forbidden','targets':[],'blocked':blocked}
if busy: return {'status':'busy','targets':[],'blocked':busy}
if not ids: return {'status':'empty','targets':[]}
return {'status':'confirm' if action.get('confirm') else 'ready','targets':[{'id':k,'revision':revision.get(k),'payload':{f:by[k].get(f) for f in action.get('fields',[])}} for k in ids],'action':action['id']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('ordered bulk selection', solve([{'id':'a','v':1},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 1}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 2:
check('ordered bulk selection', solve([{'id':'a','v':2},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 2}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 3:
check('ordered bulk selection', solve([{'id':'a','v':3},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 3}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 4:
check('ordered bulk selection', solve([{'id':'a','v':4},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 4}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
if N == 5:
check('ordered bulk selection', solve([{'id':'a','v':5},{'id':'b','v':2},{'id':'c','v':3}], 'a', ['c','a'], {'id':'delete','bulk':True,'confirm':True,'fields':['v']}, {'a':{'delete':True},'c':{'delete':True}}, [], True, ['a','b'], {'a':1,'b':2,'c':3}), {'status': 'confirm', 'targets': [{'id': 'a', 'revision': 1, 'payload': {'v': 5}}, {'id': 'c', 'revision': 3, 'payload': {'v': 3}}], 'action': 'delete'})
check('clicked outside selection', solve([{'id':'a'},{'id':'b'}], 'b', ['a'], {'id':'open','bulk':True,'confirm':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {'a':1,'b':2}), {'status': 'ready', 'targets': [{'id': 'b', 'revision': 2, 'payload': {}}], 'action': 'open'})
check('single action selected', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':False}, {'a':{'open':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('one forbidden member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'open':True}}, [], True, ['a','b'], {}), {'status': 'forbidden', 'targets': [], 'blocked': ['b']})
check('one busy member', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'delete','bulk':True}, {'a':{'delete':True},'b':{'delete':True}}, ['unrelated','b'], True, ['a','b'], {}), {'status': 'busy', 'targets': [], 'blocked': ['b']})
check('hidden targets excluded', solve([{'id':'a'},{'id':'b'}], 'a', ['a','b'], {'id':'open','bulk':True}, {'a':{'open':True},'b':{'open':True}}, [], False, ['a'], {}), {'status': 'ready', 'targets': [{'id': 'a', 'revision': None, 'payload': {}}], 'action': 'open'})
check('empty visible scope', solve([{'id':'a'}], 'a', [], {'id':'open','bulk':False}, {'a':{'open':True}}, [], False, [], {}), {'status': 'empty', 'targets': []})
check('missing row', solve([], 'a', [], {'id':'open','bulk':False}, {}, [], True, [], {}), {'status': 'missing', 'targets': []})
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 |
|---|---|---|---|
| ordered bulk selection | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | {'action': 'delete', 'status': 'confirm', 'targets': [{'id': 'a', 'payload': {'v': 1}, 'revision': 1}, {'id': 'c', 'payload': {'v': 3}, 'revision': 3}]} | Passed |
| clicked outside selection | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'b', 'payload': {}, 'revision': 2}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'b', 'payload': {}, 'revision': 2}]} | Passed |
| single action selected | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Passed |
| one forbidden member | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | {'blocked': ['b'], 'status': 'forbidden', 'targets': []} | Passed |
| one busy member | {'blocked': ['b'], 'status': 'busy', 'targets': []} | {'blocked': ['b'], 'status': 'busy', 'targets': []} | Passed |
| hidden targets excluded | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | {'action': 'open', 'status': 'ready', 'targets': [{'id': 'a', 'payload': {}, 'revision': None}]} | Passed |
| empty visible scope | {'status': 'empty', 'targets': []} | {'status': 'empty', 'targets': []} | Passed |
| missing row | {'status': 'missing', 'targets': []} | {'status': 'missing', 'targets': []} | Passed |
SHA-256 / 1fd041e3b20282a80cff41fe1641de6952a9b31714e3826153bead4ef663ce81
Verification & scope
Source row IDs are unique; permission maps hold per-action booleans and revision snapshots are explicit. 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:08.725250+00:00.
Case digest / 4be2e61a4e54d89cd6fb775b34fbad6cd5c06e581057fdc82353a1206331021a