{"abstract":"Transaction coalescing replaces the original before-image on every update.","category":"Data systems","checks":7,"contract":"Coalesce an ordered transaction of [id,before,after] changes to one net before/after per identity. Keep the first before-image and last after-image, order identities by first touch, suppress equal net states including insert-then-delete, and retain None as absence.","contract_signature":"d","evaluation_group":"s3-data-systems-cdc-transaction-coalesce","failed_approach":"Updating both fields still loses the transaction entry state.","family":"s3-data-systems-cdc-transaction-coalesce-first-before","id":"FA-45511","implementations":{"attempt":{"sha256":"2c2655136a7e632098912abb3761c7da25391ac86345f04265f051b968e58c27","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        changes=d\n        state={}; order=[]\n        for ident,before,after in changes:\n            if ident not in state:\n                state[ident]=[before,after]; order.append(ident)\n            else:\n                state[ident][0]=before; state[ident][1]=after\n        return [[ident,state[ident][0],state[ident][1]] for ident in order if state[ident][0]!=state[ident][1]]\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('two updates', solve([[10, 1, 2], [10, 2, 3]]), [[10, 1, 3]])\n    check('insert delete', solve([[10, None, 1], [10, 1, None]]), [])\n    check('change revert', solve([[10, 1, 2], [10, 2, 1]]), [])\n    check('touch order', solve([[20, 1, 2], [10, 3, 4]]), [[20, 1, 2], [10, 3, 4]])\n    check('delete', solve([[10, 1, None]]), [[10, 1, None]])\n    check('insert', solve([[10, None, 1]]), [[10, None, 1]])\n    check('no transaction', solve([]), [])\nelif N == 2:\n    check('two updates', solve([[10, 2, 3], [10, 3, 4]]), [[10, 2, 4]])\n    check('insert delete', solve([[10, None, 2], [10, 2, None]]), [])\n    check('change revert', solve([[10, 2, 3], [10, 3, 2]]), [])\n    check('touch order', solve([[20, 2, 3], [10, 4, 5]]), [[20, 2, 3], [10, 4, 5]])\n    check('delete', solve([[10, 2, None]]), [[10, 2, None]])\n    check('insert', solve([[10, None, 2]]), [[10, None, 2]])\n    check('no transaction', solve([]), [])\nelif N == 3:\n    check('two updates', solve([[10, 3, 4], [10, 4, 5]]), [[10, 3, 5]])\n    check('insert delete', solve([[10, None, 3], [10, 3, None]]), [])\n    check('change revert', solve([[10, 3, 4], [10, 4, 3]]), [])\n    check('touch order', solve([[20, 3, 4], [10, 5, 6]]), [[20, 3, 4], [10, 5, 6]])\n    check('delete', solve([[10, 3, None]]), [[10, 3, None]])\n    check('insert', solve([[10, None, 3]]), [[10, None, 3]])\n    check('no transaction', solve([]), [])\nelif N == 4:\n    check('two updates', solve([[10, 4, 5], [10, 5, 6]]), [[10, 4, 6]])\n    check('insert delete', solve([[10, None, 4], [10, 4, None]]), [])\n    check('change revert', solve([[10, 4, 5], [10, 5, 4]]), [])\n    check('touch order', solve([[20, 4, 5], [10, 6, 7]]), [[20, 4, 5], [10, 6, 7]])\n    check('delete', solve([[10, 4, None]]), [[10, 4, None]])\n    check('insert', solve([[10, None, 4]]), [[10, None, 4]])\n    check('no transaction', solve([]), [])\nelif N == 5:\n    check('two updates', solve([[10, 5, 6], [10, 6, 7]]), [[10, 5, 7]])\n    check('insert delete', solve([[10, None, 5], [10, 5, None]]), [])\n    check('change revert', solve([[10, 5, 6], [10, 6, 5]]), [])\n    check('touch order', solve([[20, 5, 6], [10, 7, 8]]), [[20, 5, 6], [10, 7, 8]])\n    check('delete', solve([[10, 5, None]]), [[10, 5, None]])\n    check('insert', solve([[10, None, 5]]), [[10, None, 5]])\n    check('no transaction', solve([]), [])\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":"66965864551c8e16ecbbb53811bfff42b4c95a019563a2fa145027eaef682f05","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        changes=d\n        state={}; order=[]\n        for ident,before,after in changes:\n            if ident not in state:\n                state[ident]=[before,after]; order.append(ident)\n            else:\n                state[ident]=[before,after]\n        return [[ident,state[ident][0],state[ident][1]] for ident in order if state[ident][0]!=state[ident][1]]\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('two updates', solve([[10, 1, 2], [10, 2, 3]]), [[10, 1, 3]])\n    check('insert delete', solve([[10, None, 1], [10, 1, None]]), [])\n    check('change revert', solve([[10, 1, 2], [10, 2, 1]]), [])\n    check('touch order', solve([[20, 1, 2], [10, 3, 4]]), [[20, 1, 2], [10, 3, 4]])\n    check('delete', solve([[10, 1, None]]), [[10, 1, None]])\n    check('insert', solve([[10, None, 1]]), [[10, None, 1]])\n    check('no transaction', solve([]), [])\nelif N == 2:\n    check('two updates', solve([[10, 2, 3], [10, 3, 4]]), [[10, 2, 4]])\n    check('insert delete', solve([[10, None, 2], [10, 2, None]]), [])\n    check('change revert', solve([[10, 2, 3], [10, 3, 2]]), [])\n    check('touch order', solve([[20, 2, 3], [10, 4, 5]]), [[20, 2, 3], [10, 4, 5]])\n    check('delete', solve([[10, 2, None]]), [[10, 2, None]])\n    check('insert', solve([[10, None, 2]]), [[10, None, 2]])\n    check('no transaction', solve([]), [])\nelif N == 3:\n    check('two updates', solve([[10, 3, 4], [10, 4, 5]]), [[10, 3, 5]])\n    check('insert delete', solve([[10, None, 3], [10, 3, None]]), [])\n    check('change revert', solve([[10, 3, 4], [10, 4, 3]]), [])\n    check('touch order', solve([[20, 3, 4], [10, 5, 6]]), [[20, 3, 4], [10, 5, 6]])\n    check('delete', solve([[10, 3, None]]), [[10, 3, None]])\n    check('insert', solve([[10, None, 3]]), [[10, None, 3]])\n    check('no transaction', solve([]), [])\nelif N == 4:\n    check('two updates', solve([[10, 4, 5], [10, 5, 6]]), [[10, 4, 6]])\n    check('insert delete', solve([[10, None, 4], [10, 4, None]]), [])\n    check('change revert', solve([[10, 4, 5], [10, 5, 4]]), [])\n    check('touch order', solve([[20, 4, 5], [10, 6, 7]]), [[20, 4, 5], [10, 6, 7]])\n    check('delete', solve([[10, 4, None]]), [[10, 4, None]])\n    check('insert', solve([[10, None, 4]]), [[10, None, 4]])\n    check('no transaction', solve([]), [])\nelif N == 5:\n    check('two updates', solve([[10, 5, 6], [10, 6, 7]]), [[10, 5, 7]])\n    check('insert delete', solve([[10, None, 5], [10, 5, None]]), [])\n    check('change revert', solve([[10, 5, 6], [10, 6, 5]]), [])\n    check('touch order', solve([[20, 5, 6], [10, 7, 8]]), [[20, 5, 6], [10, 7, 8]])\n    check('delete', solve([[10, 5, None]]), [[10, 5, None]])\n    check('insert', solve([[10, None, 5]]), [[10, None, 5]])\n    check('no transaction', solve([]), [])\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":"Offline stipulated semantics over valid small inputs; no performance, concurrency, or production-engine conformance claim. 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":"s3-data-systems-cdc-transaction-coalesce-first-before","generated_at":"2026-09-29T14:44:23.250783+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A bounded deterministic data engine model makes representation and changelog faults reproducible.","root_cause":"cdc-transaction-coalesce: Transaction coalescing replaces the original before-image on every update.","sha256":"d7abada8167c4df948201311402fbe0752370a44241cb33d0d761b96dffb3384","title":"Transaction coalescing replaces the original before-image on every update · 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":49.221,"exit_code":1,"observations":[{"actual":[[10,2,3]],"check":"two updates","expected":[[10,1,3]],"passed":false},{"actual":[[10,1,null]],"check":"insert delete","expected":[],"passed":false},{"actual":[[10,2,1]],"check":"change revert","expected":[],"passed":false},{"actual":[[20,1,2],[10,3,4]],"check":"touch order","expected":[[20,1,2],[10,3,4]],"passed":true},{"actual":[[10,1,null]],"check":"delete","expected":[[10,1,null]],"passed":true},{"actual":[[10,null,1]],"check":"insert","expected":[[10,null,1]],"passed":true},{"actual":[],"check":"no transaction","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two updates\", \"actual\": [[10, 2, 3]], \"expected\": [[10, 1, 3]], \"passed\": false}, {\"check\": \"insert delete\", \"actual\": [[10, 1, null]], \"expected\": [], \"passed\": false}, {\"check\": \"change revert\", \"actual\": [[10, 2, 1]], \"expected\": [], \"passed\": false}, {\"check\": \"touch order\", \"actual\": [[20, 1, 2], [10, 3, 4]], \"expected\": [[20, 1, 2], [10, 3, 4]], \"passed\": true}, {\"check\": \"delete\", \"actual\": [[10, 1, null]], \"expected\": [[10, 1, null]], \"passed\": true}, {\"check\": \"insert\", \"actual\": [[10, null, 1]], \"expected\": [[10, null, 1]], \"passed\": true}, {\"check\": \"no transaction\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.752,"exit_code":1,"observations":[{"actual":[[10,2,3]],"check":"two updates","expected":[[10,1,3]],"passed":false},{"actual":[[10,1,null]],"check":"insert delete","expected":[],"passed":false},{"actual":[[10,2,1]],"check":"change revert","expected":[],"passed":false},{"actual":[[20,1,2],[10,3,4]],"check":"touch order","expected":[[20,1,2],[10,3,4]],"passed":true},{"actual":[[10,1,null]],"check":"delete","expected":[[10,1,null]],"passed":true},{"actual":[[10,null,1]],"check":"insert","expected":[[10,null,1]],"passed":true},{"actual":[],"check":"no transaction","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two updates\", \"actual\": [[10, 2, 3]], \"expected\": [[10, 1, 3]], \"passed\": false}, {\"check\": \"insert delete\", \"actual\": [[10, 1, null]], \"expected\": [], \"passed\": false}, {\"check\": \"change revert\", \"actual\": [[10, 2, 1]], \"expected\": [], \"passed\": false}, {\"check\": \"touch order\", \"actual\": [[20, 1, 2], [10, 3, 4]], \"expected\": [[20, 1, 2], [10, 3, 4]], \"passed\": true}, {\"check\": \"delete\", \"actual\": [[10, 1, null]], \"expected\": [[10, 1, null]], \"passed\": true}, {\"check\": \"insert\", \"actual\": [[10, null, 1]], \"expected\": [[10, null, 1]], \"passed\": true}, {\"check\": \"no transaction\", \"actual\": [], \"expected\": [], \"passed\": true}], \"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."}}