broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(high,widths[c]+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(high,state.get('draft',state['base'])+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

prompt:
The table resize base delta result violates the stipulated table column resize transaction contract.

A table resize snapshots its starting width and pointer, applies cumulative drag displacement from that snapshot with RTL inversion and bounds, supports live/deferred drawing, rolls back cancel, commits the final pointer displacement, and persists only changed widths.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(high,state['base']+(delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(high,state['base']+(-delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

prompt:
The table rtl column delta result violates the stipulated table column resize transaction contract.

A table resize snapshots its starting width and pointer, applies cumulative drag displacement from that snapshot with RTL inversion and bounds, supports live/deferred drawing, rolls back cancel, commits the final pointer displacement, and persists only changed widths.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(0,min(high,state['base']+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=min(low,min(high,state['base']+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

prompt:
The table resize minimum result violates the stipulated table column resize transaction contract.

A table resize snapshots its starting width and pointer, applies cumulative drag displacement from that snapshot with RTL inversion and bounds, supports live/deferred drawing, rolls back cancel, commits the final pointer displacement, and persists only changed widths.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(10000,state['base']+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(state, event, pointer, delta, widths, constraints, rtl, live):
    out=dict(state); current=dict(widths)
    if event=='start':
        out={'pointer':pointer,'column':state['column'],'base':widths[state['column']],'draft':widths[state['column']]}
        return {'state':out,'widths':current,'persist':None}
    if state.get('pointer')!=pointer: return {'state':out,'widths':current,'persist':None}
    c=state['column']; low,high=constraints[c]
    proposed=max(low,min(low,state['base']+(-delta if rtl else delta)))
    if event=='move':
        out['draft']=proposed
        if live: current[c]=proposed
        return {'state':out,'widths':current,'persist':None}
    if event=='cancel':
        current[c]=state['base']; return {'state':{},'widths':current,'persist':None}
    if event=='end':
        current[c]=proposed
        return {'state':{},'widths':current,'persist':(c,proposed) if proposed!=state['base'] else None}
    return {'state':out,'widths':current,'persist':None}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*1,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 2:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*2,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 20, 'draft': 20}, 'widths': {'a': 20, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 3:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*3,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 30, 'draft': 30}, 'widths': {'a': 30, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 4:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*4,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 40, 'draft': 40}, 'widths': {'a': 40, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

if N == 5:
    check('fresh drag snapshot', solve({'column':'a','base':1,'draft':2}, 'start', 7, 0, {'a':10*5,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 50, 'draft': 50}, 'widths': {'a': 50, 'b': 9}, 'persist': None})
    check('live move absolute delta', solve({'pointer':7,'column':'a','base':10,'draft':13}, 'move', 7, 5, {'a':13,'b':9}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 15}, 'widths': {'a': 15, 'b': 9}, 'persist': None})
    check('deferred rtl move', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'move', 7, 20, {'a':10}, {'a':(5,50)}, True, False), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 5}, 'widths': {'a': 10}, 'persist': None})
    check('other pointer', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 8, 20, {'a':10}, {'a':(5,50)}, False, True), {'state': {'pointer': 7, 'column': 'a', 'base': 10, 'draft': 10}, 'widths': {'a': 10}, 'persist': None})
    check('cancel live', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'cancel', 7, 5, {'a':15}, {'a':(5,50)}, False, True), {'state': {}, 'widths': {'a': 10}, 'persist': None})
    check('end latest delta', solve({'pointer':7,'column':'a','base':10,'draft':15}, 'end', 7, 70, {'a':15}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 50}, 'persist': ('a', 50)})
    check('end shrink', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, -2, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 8}, 'persist': ('a', 8)})
    check('noop end', solve({'pointer':7,'column':'a','base':10,'draft':10}, 'end', 7, 0, {'a':10}, {'a':(5,50)}, False, False), {'state': {}, 'widths': {'a': 10}, 'persist': None})

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)

prompt:
The table resize maximum result violates the stipulated table column resize transaction contract.

A table resize snapshots its starting width and pointer, applies cumulative drag displacement from that snapshot with RTL inversion and bounds, supports live/deferred drawing, rolls back cancel, commits the final pointer displacement, and persists only changed widths.

split: open-access