{"abstract":"The same conflict seen from the other branch must be resolved by hand again.","category":"Text diff and three-way merge","checks":7,"contract":"Scan conflict blocks (\"<<<<<<<\" optionally followed by a label, optional \"|||||||\" base section, \"=======\", \">>>>>>>\" optionally labelled). A block matches a recorded [side1, side2, resolution] when its two sides equal the recorded sides in either order; base lines are ignored. Matched blocks are replaced by the resolution; unmatched blocks are re-emitted as bare \"<<<<<<<\", ours, \"=======\", theirs, \">>>>>>>\" and counted. Return lines and the unresolved count.","contract_signature":"lines, recorded","evaluation_group":"w2-text-diff-merge-conflict-resolution-reuse","failed_approach":"Sorting only the recorded pair matches a conflict only when its sides happen to be in sorted order.","family":"w2-text-diff-merge-conflict-resolution-reuse-side-normalization","id":"FA-75806","implementations":{"attempt":{"sha256":"1d2ee18b689afb2625999417a83c1b0610f423b822bbc398904a70d066d4c341","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lines, recorded):\n    out = []\n    state = None\n    o, t = [], []\n    unresolved = 0\n    for ln in lines:\n        if state is None:\n            if ln.startswith('<<<<<<<'):\n                state = 'o'\n                o, t = [], []\n            else:\n                out.append(ln)\n        elif state == 'o' and ln.startswith('|||||||'):\n            state = 'b'\n        elif state in ('o', 'b') and ln == '=======':\n            state = 't'\n        elif state == 't' and ln.startswith('>>>>>>>'):\n            key = [o, t]\n            match = next((r[2] for r in recorded if sorted([r[0], r[1]]) == key), None)\n            if match is not None:\n                out.extend(match)\n            else:\n                unresolved += 1\n                out.extend(['<<<<<<<'] + o + ['======='] + t + ['>>>>>>>'])\n            state = None\n        elif state == 'o':\n            o.append(ln)\n        elif state == 't':\n            t.append(ln)\n    return {'lines': out, 'unresolved': unresolved}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic1'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p1', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p1', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    2: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic2'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p2', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p2', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    3: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic3'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p3', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p3', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    4: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic4'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p4', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p4', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    5: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic5'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p5', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p5', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n}[N]\nfor label, args, expected in cases:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"9a6ddace98c638369dc4422ba13040f3fa02cd4155de762c455af958c909917f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lines, recorded):\n    out = []\n    state = None\n    o, t = [], []\n    unresolved = 0\n    for ln in lines:\n        if state is None:\n            if ln.startswith('<<<<<<<'):\n                state = 'o'\n                o, t = [], []\n            else:\n                out.append(ln)\n        elif state == 'o' and ln.startswith('|||||||'):\n            state = 'b'\n        elif state in ('o', 'b') and ln == '=======':\n            state = 't'\n        elif state == 't' and ln.startswith('>>>>>>>'):\n            key = [o, t]\n            match = next((r[2] for r in recorded if [r[0], r[1]] == key), None)\n            if match is not None:\n                out.extend(match)\n            else:\n                unresolved += 1\n                out.extend(['<<<<<<<'] + o + ['======='] + t + ['>>>>>>>'])\n            state = None\n        elif state == 'o':\n            o.append(ln)\n        elif state == 't':\n            t.append(ln)\n    return {'lines': out, 'unresolved': unresolved}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic1'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p1', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p1', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    2: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic2'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p2', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p2', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    3: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic3'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p3', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p3', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    4: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic4'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p4', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p4', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n    5: [('recorded resolution reused', [['pre', '<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'post'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['pre', 'x = 3', 'post'], 'unresolved': 0}), ('sides swapped still match', [['<<<<<<< HEAD', 'x = 2', '=======', 'x = 1', '>>>>>>> topic5'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0}), ('base section does not affect the fingerprint', [['<<<<<<< ours', 'c', '||||||| base', 'orig', '=======', 'a', 'b', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('unknown conflict stays unresolved', [['<<<<<<< ours', 'p5', '=======', 'q', '>>>>>>> theirs', 'tail'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['<<<<<<<', 'p5', '=======', 'q', '>>>>>>>', 'tail'], 'unresolved': 1}), ('unlabelled markers', [['<<<<<<<', 'a', 'b', '=======', 'c', '>>>>>>>'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['abc'], 'unresolved': 0}), ('two conflicts, one known', [['<<<<<<< ours', 'x = 1', '=======', 'x = 2', '>>>>>>> theirs', 'mid', '<<<<<<< ours', 'm', '=======', 'n', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3', 'mid', '<<<<<<<', 'm', '=======', 'n', '>>>>>>>'], 'unresolved': 1}), ('labelled base marker', [['<<<<<<< ours', 'x = 2', '||||||| base', 'x = 0', '=======', 'x = 1', '>>>>>>> theirs'], [[['x = 1'], ['x = 2'], ['x = 3']], [['a', 'b'], ['c'], ['abc']]]], {'lines': ['x = 3'], 'unresolved': 0})],\n}[N]\nfor label, args, expected in cases:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model of one diff, patch or merge rule with stipulated conventions; it is not a production diff or version-control implementation and makes no claim of conformance to any specific tool. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-text-diff-merge-conflict-resolution-reuse-side-normalization","generated_at":"2026-09-29T14:49:10.354162+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Reusing recorded conflict resolutions saves repeating the same manual merge during rebases.","root_cause":"The fingerprint keeps the sides in ours/theirs order.","sha256":"4df3292b464681f611382a42613e2134036b4671f32e5bf80efc5ae748160a4d","title":"Conflict resolution reuse: a conflict with swapped sides is not recognized · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":38.187,"exit_code":1,"observations":[{"actual":{"lines":["pre","x = 3","post"],"unresolved":0},"check":"recorded resolution reused","expected":{"lines":["pre","x = 3","post"],"unresolved":0},"passed":true},{"actual":{"lines":["<<<<<<<","x = 2","=======","x = 1",">>>>>>>"],"unresolved":1},"check":"sides swapped still match","expected":{"lines":["x = 3"],"unresolved":0},"passed":false},{"actual":{"lines":["<<<<<<<","c","=======","a","b",">>>>>>>"],"unresolved":1},"check":"base section does not affect the fingerprint","expected":{"lines":["abc"],"unresolved":0},"passed":false},{"actual":{"lines":["<<<<<<<","p1","=======","q",">>>>>>>","tail"],"unresolved":1},"check":"unknown conflict stays unresolved","expected":{"lines":["<<<<<<<","p1","=======","q",">>>>>>>","tail"],"unresolved":1},"passed":true},{"actual":{"lines":["abc"],"unresolved":0},"check":"unlabelled markers","expected":{"lines":["abc"],"unresolved":0},"passed":true},{"actual":{"lines":["x = 3","mid","<<<<<<<","m","=======","n",">>>>>>>"],"unresolved":1},"check":"two conflicts, one known","expected":{"lines":["x = 3","mid","<<<<<<<","m","=======","n",">>>>>>>"],"unresolved":1},"passed":true},{"actual":{"lines":["<<<<<<<","x = 2","=======","x = 1",">>>>>>>"],"unresolved":1},"check":"labelled base marker","expected":{"lines":["x = 3"],"unresolved":0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"recorded resolution reused\", \"actual\": {\"lines\": [\"pre\", \"x = 3\", \"post\"], \"unresolved\": 0}, \"expected\": {\"lines\": [\"pre\", \"x = 3\", \"post\"], \"unresolved\": 0}, \"passed\": true}, {\"check\": \"sides swapped still match\", \"actual\": {\"lines\": [\"<<<<<<<\", \"x = 2\", \"=======\", \"x = 1\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\"], \"unresolved\": 0}, \"passed\": false}, {\"check\": \"base section does not affect the fingerprint\", \"actual\": {\"lines\": [\"<<<<<<<\", \"c\", \"=======\", \"a\", \"b\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"passed\": false}, {\"check\": \"unknown conflict stays unresolved\", \"actual\": {\"lines\": [\"<<<<<<<\", \"p1\", \"=======\", \"q\", \">>>>>>>\", \"tail\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"<<<<<<<\", \"p1\", \"=======\", \"q\", \">>>>>>>\", \"tail\"], \"unresolved\": 1}, \"passed\": true}, {\"check\": \"unlabelled markers\", \"actual\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"expected\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"passed\": true}, {\"check\": \"two conflicts, one known\", \"actual\": {\"lines\": [\"x = 3\", \"mid\", \"<<<<<<<\", \"m\", \"=======\", \"n\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\", \"mid\", \"<<<<<<<\", \"m\", \"=======\", \"n\", \">>>>>>>\"], \"unresolved\": 1}, \"passed\": true}, {\"check\": \"labelled base marker\", \"actual\": {\"lines\": [\"<<<<<<<\", \"x = 2\", \"=======\", \"x = 1\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\"], \"unresolved\": 0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.254,"exit_code":1,"observations":[{"actual":{"lines":["pre","x = 3","post"],"unresolved":0},"check":"recorded resolution reused","expected":{"lines":["pre","x = 3","post"],"unresolved":0},"passed":true},{"actual":{"lines":["<<<<<<<","x = 2","=======","x = 1",">>>>>>>"],"unresolved":1},"check":"sides swapped still match","expected":{"lines":["x = 3"],"unresolved":0},"passed":false},{"actual":{"lines":["<<<<<<<","c","=======","a","b",">>>>>>>"],"unresolved":1},"check":"base section does not affect the fingerprint","expected":{"lines":["abc"],"unresolved":0},"passed":false},{"actual":{"lines":["<<<<<<<","p1","=======","q",">>>>>>>","tail"],"unresolved":1},"check":"unknown conflict stays unresolved","expected":{"lines":["<<<<<<<","p1","=======","q",">>>>>>>","tail"],"unresolved":1},"passed":true},{"actual":{"lines":["abc"],"unresolved":0},"check":"unlabelled markers","expected":{"lines":["abc"],"unresolved":0},"passed":true},{"actual":{"lines":["x = 3","mid","<<<<<<<","m","=======","n",">>>>>>>"],"unresolved":1},"check":"two conflicts, one known","expected":{"lines":["x = 3","mid","<<<<<<<","m","=======","n",">>>>>>>"],"unresolved":1},"passed":true},{"actual":{"lines":["<<<<<<<","x = 2","=======","x = 1",">>>>>>>"],"unresolved":1},"check":"labelled base marker","expected":{"lines":["x = 3"],"unresolved":0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"recorded resolution reused\", \"actual\": {\"lines\": [\"pre\", \"x = 3\", \"post\"], \"unresolved\": 0}, \"expected\": {\"lines\": [\"pre\", \"x = 3\", \"post\"], \"unresolved\": 0}, \"passed\": true}, {\"check\": \"sides swapped still match\", \"actual\": {\"lines\": [\"<<<<<<<\", \"x = 2\", \"=======\", \"x = 1\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\"], \"unresolved\": 0}, \"passed\": false}, {\"check\": \"base section does not affect the fingerprint\", \"actual\": {\"lines\": [\"<<<<<<<\", \"c\", \"=======\", \"a\", \"b\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"passed\": false}, {\"check\": \"unknown conflict stays unresolved\", \"actual\": {\"lines\": [\"<<<<<<<\", \"p1\", \"=======\", \"q\", \">>>>>>>\", \"tail\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"<<<<<<<\", \"p1\", \"=======\", \"q\", \">>>>>>>\", \"tail\"], \"unresolved\": 1}, \"passed\": true}, {\"check\": \"unlabelled markers\", \"actual\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"expected\": {\"lines\": [\"abc\"], \"unresolved\": 0}, \"passed\": true}, {\"check\": \"two conflicts, one known\", \"actual\": {\"lines\": [\"x = 3\", \"mid\", \"<<<<<<<\", \"m\", \"=======\", \"n\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\", \"mid\", \"<<<<<<<\", \"m\", \"=======\", \"n\", \">>>>>>>\"], \"unresolved\": 1}, \"passed\": true}, {\"check\": \"labelled base marker\", \"actual\": {\"lines\": [\"<<<<<<<\", \"x = 2\", \"=======\", \"x = 1\", \">>>>>>>\"], \"unresolved\": 1}, \"expected\": {\"lines\": [\"x = 3\"], \"unresolved\": 0}, \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}