FA-38226 / Table interactions / Open access
Table row action targeting: empty target action · case 01
The table empty target action result violates the stipulated table row action targeting contract.
ROOT CAUSE
The empty target action decision uses 'if False:' instead of 'if not ids:'.
VERIFIED REPAIR
Apply the complete empty target action rule: if not ids:.
Unsuccessful approach: The attempted repair 'if not rows:' 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 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 False: 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 | {'action': 'open', 'status': 'ready', 'targets': []} | {'status': 'empty', 'targets': []} | Failed |
| missing row | {'status': 'missing', 'targets': []} | {'status': 'missing', 'targets': []} | Passed |
SHA-256 / cae7a3163727b533d1afa0ec074b1a197d57adbe7519c0e265498ee17f382129
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 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 rows: 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 | {'action': 'open', 'status': 'ready', 'targets': []} | {'status': 'empty', 'targets': []} | Failed |
| missing row | {'status': 'missing', 'targets': []} | {'status': 'missing', 'targets': []} | Passed |
SHA-256 / 6aed2a50bf608bdc95dc8d0c47ff16e4ad9cb38f66706e49558ff1e4d18cd865
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:09.028299+00:00.
Case digest / c49c239bb03c265234e91d4448c60d2d56a3fa84f95e6368e7801d84db33a8d4