FA-45536 / Data systems / Open access
Transaction coalescing appends an output identity on every update · case 01
Transaction coalescing appends an output identity on every update.
ROOT CAUSE
cdc-transaction-coalesce: Transaction coalescing appends an output identity on every update.
VERIFIED REPAIR
Preserve the stated physical representation and operation order: 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.
Unsuccessful approach: Moving extra identities to the front still emits duplicate net changes.
Case 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.
Why this case matters
A bounded deterministic data engine model makes representation and changelog faults reproducible.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
changes=d
state={}; order=[]
for ident,before,after in changes:
if ident not in state:
state[ident]=[before,after]; order.append(ident)
else:
state[ident][1]=after; order.append(ident)
return [[ident,state[ident][0],state[ident][1]] for ident in order if state[ident][0]!=state[ident][1]]
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('two updates', solve([[10, 1, 2], [10, 2, 3]]), [[10, 1, 3]])
check('insert delete', solve([[10, None, 1], [10, 1, None]]), [])
check('change revert', solve([[10, 1, 2], [10, 2, 1]]), [])
check('touch order', solve([[20, 1, 2], [10, 3, 4]]), [[20, 1, 2], [10, 3, 4]])
check('delete', solve([[10, 1, None]]), [[10, 1, None]])
check('insert', solve([[10, None, 1]]), [[10, None, 1]])
check('no transaction', solve([]), [])
elif N == 2:
check('two updates', solve([[10, 2, 3], [10, 3, 4]]), [[10, 2, 4]])
check('insert delete', solve([[10, None, 2], [10, 2, None]]), [])
check('change revert', solve([[10, 2, 3], [10, 3, 2]]), [])
check('touch order', solve([[20, 2, 3], [10, 4, 5]]), [[20, 2, 3], [10, 4, 5]])
check('delete', solve([[10, 2, None]]), [[10, 2, None]])
check('insert', solve([[10, None, 2]]), [[10, None, 2]])
check('no transaction', solve([]), [])
elif N == 3:
check('two updates', solve([[10, 3, 4], [10, 4, 5]]), [[10, 3, 5]])
check('insert delete', solve([[10, None, 3], [10, 3, None]]), [])
check('change revert', solve([[10, 3, 4], [10, 4, 3]]), [])
check('touch order', solve([[20, 3, 4], [10, 5, 6]]), [[20, 3, 4], [10, 5, 6]])
check('delete', solve([[10, 3, None]]), [[10, 3, None]])
check('insert', solve([[10, None, 3]]), [[10, None, 3]])
check('no transaction', solve([]), [])
elif N == 4:
check('two updates', solve([[10, 4, 5], [10, 5, 6]]), [[10, 4, 6]])
check('insert delete', solve([[10, None, 4], [10, 4, None]]), [])
check('change revert', solve([[10, 4, 5], [10, 5, 4]]), [])
check('touch order', solve([[20, 4, 5], [10, 6, 7]]), [[20, 4, 5], [10, 6, 7]])
check('delete', solve([[10, 4, None]]), [[10, 4, None]])
check('insert', solve([[10, None, 4]]), [[10, None, 4]])
check('no transaction', solve([]), [])
elif N == 5:
check('two updates', solve([[10, 5, 6], [10, 6, 7]]), [[10, 5, 7]])
check('insert delete', solve([[10, None, 5], [10, 5, None]]), [])
check('change revert', solve([[10, 5, 6], [10, 6, 5]]), [])
check('touch order', solve([[20, 5, 6], [10, 7, 8]]), [[20, 5, 6], [10, 7, 8]])
check('delete', solve([[10, 5, None]]), [[10, 5, None]])
check('insert', solve([[10, None, 5]]), [[10, None, 5]])
check('no transaction', solve([]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| two updates | [[10, 1, 3], [10, 1, 3]] | [[10, 1, 3]] | Failed |
| insert delete | [] | [] | Passed |
| change revert | [] | [] | Passed |
| touch order | [[20, 1, 2], [10, 3, 4]] | [[20, 1, 2], [10, 3, 4]] | Passed |
| delete | [[10, 1, None]] | [[10, 1, None]] | Passed |
| insert | [[10, None, 1]] | [[10, None, 1]] | Passed |
| no transaction | [] | [] | Passed |
SHA-256 / acf0874876aecc3ef0ffcbb32a052ea58efceec93fbd9f8f5be0e4f5acf8efd9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
changes=d
state={}; order=[]
for ident,before,after in changes:
if ident not in state:
state[ident]=[before,after]; order.append(ident)
else:
state[ident][1]=after; order.insert(0,ident)
return [[ident,state[ident][0],state[ident][1]] for ident in order if state[ident][0]!=state[ident][1]]
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('two updates', solve([[10, 1, 2], [10, 2, 3]]), [[10, 1, 3]])
check('insert delete', solve([[10, None, 1], [10, 1, None]]), [])
check('change revert', solve([[10, 1, 2], [10, 2, 1]]), [])
check('touch order', solve([[20, 1, 2], [10, 3, 4]]), [[20, 1, 2], [10, 3, 4]])
check('delete', solve([[10, 1, None]]), [[10, 1, None]])
check('insert', solve([[10, None, 1]]), [[10, None, 1]])
check('no transaction', solve([]), [])
elif N == 2:
check('two updates', solve([[10, 2, 3], [10, 3, 4]]), [[10, 2, 4]])
check('insert delete', solve([[10, None, 2], [10, 2, None]]), [])
check('change revert', solve([[10, 2, 3], [10, 3, 2]]), [])
check('touch order', solve([[20, 2, 3], [10, 4, 5]]), [[20, 2, 3], [10, 4, 5]])
check('delete', solve([[10, 2, None]]), [[10, 2, None]])
check('insert', solve([[10, None, 2]]), [[10, None, 2]])
check('no transaction', solve([]), [])
elif N == 3:
check('two updates', solve([[10, 3, 4], [10, 4, 5]]), [[10, 3, 5]])
check('insert delete', solve([[10, None, 3], [10, 3, None]]), [])
check('change revert', solve([[10, 3, 4], [10, 4, 3]]), [])
check('touch order', solve([[20, 3, 4], [10, 5, 6]]), [[20, 3, 4], [10, 5, 6]])
check('delete', solve([[10, 3, None]]), [[10, 3, None]])
check('insert', solve([[10, None, 3]]), [[10, None, 3]])
check('no transaction', solve([]), [])
elif N == 4:
check('two updates', solve([[10, 4, 5], [10, 5, 6]]), [[10, 4, 6]])
check('insert delete', solve([[10, None, 4], [10, 4, None]]), [])
check('change revert', solve([[10, 4, 5], [10, 5, 4]]), [])
check('touch order', solve([[20, 4, 5], [10, 6, 7]]), [[20, 4, 5], [10, 6, 7]])
check('delete', solve([[10, 4, None]]), [[10, 4, None]])
check('insert', solve([[10, None, 4]]), [[10, None, 4]])
check('no transaction', solve([]), [])
elif N == 5:
check('two updates', solve([[10, 5, 6], [10, 6, 7]]), [[10, 5, 7]])
check('insert delete', solve([[10, None, 5], [10, 5, None]]), [])
check('change revert', solve([[10, 5, 6], [10, 6, 5]]), [])
check('touch order', solve([[20, 5, 6], [10, 7, 8]]), [[20, 5, 6], [10, 7, 8]])
check('delete', solve([[10, 5, None]]), [[10, 5, None]])
check('insert', solve([[10, None, 5]]), [[10, None, 5]])
check('no transaction', solve([]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| two updates | [[10, 1, 3], [10, 1, 3]] | [[10, 1, 3]] | Failed |
| insert delete | [] | [] | Passed |
| change revert | [] | [] | Passed |
| touch order | [[20, 1, 2], [10, 3, 4]] | [[20, 1, 2], [10, 3, 4]] | Passed |
| delete | [[10, 1, None]] | [[10, 1, None]] | Passed |
| insert | [[10, None, 1]] | [[10, None, 1]] | Passed |
| no transaction | [] | [] | Passed |
SHA-256 / a2f4a030e37f7f4b3eefe6c4096761e9b0496e912afeb1797746e5fa6fce05e2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
changes=d
state={}; order=[]
for ident,before,after in changes:
if ident not in state:
state[ident]=[before,after]; order.append(ident)
else:
state[ident][1]=after
return [[ident,state[ident][0],state[ident][1]] for ident in order if state[ident][0]!=state[ident][1]]
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('two updates', solve([[10, 1, 2], [10, 2, 3]]), [[10, 1, 3]])
check('insert delete', solve([[10, None, 1], [10, 1, None]]), [])
check('change revert', solve([[10, 1, 2], [10, 2, 1]]), [])
check('touch order', solve([[20, 1, 2], [10, 3, 4]]), [[20, 1, 2], [10, 3, 4]])
check('delete', solve([[10, 1, None]]), [[10, 1, None]])
check('insert', solve([[10, None, 1]]), [[10, None, 1]])
check('no transaction', solve([]), [])
elif N == 2:
check('two updates', solve([[10, 2, 3], [10, 3, 4]]), [[10, 2, 4]])
check('insert delete', solve([[10, None, 2], [10, 2, None]]), [])
check('change revert', solve([[10, 2, 3], [10, 3, 2]]), [])
check('touch order', solve([[20, 2, 3], [10, 4, 5]]), [[20, 2, 3], [10, 4, 5]])
check('delete', solve([[10, 2, None]]), [[10, 2, None]])
check('insert', solve([[10, None, 2]]), [[10, None, 2]])
check('no transaction', solve([]), [])
elif N == 3:
check('two updates', solve([[10, 3, 4], [10, 4, 5]]), [[10, 3, 5]])
check('insert delete', solve([[10, None, 3], [10, 3, None]]), [])
check('change revert', solve([[10, 3, 4], [10, 4, 3]]), [])
check('touch order', solve([[20, 3, 4], [10, 5, 6]]), [[20, 3, 4], [10, 5, 6]])
check('delete', solve([[10, 3, None]]), [[10, 3, None]])
check('insert', solve([[10, None, 3]]), [[10, None, 3]])
check('no transaction', solve([]), [])
elif N == 4:
check('two updates', solve([[10, 4, 5], [10, 5, 6]]), [[10, 4, 6]])
check('insert delete', solve([[10, None, 4], [10, 4, None]]), [])
check('change revert', solve([[10, 4, 5], [10, 5, 4]]), [])
check('touch order', solve([[20, 4, 5], [10, 6, 7]]), [[20, 4, 5], [10, 6, 7]])
check('delete', solve([[10, 4, None]]), [[10, 4, None]])
check('insert', solve([[10, None, 4]]), [[10, None, 4]])
check('no transaction', solve([]), [])
elif N == 5:
check('two updates', solve([[10, 5, 6], [10, 6, 7]]), [[10, 5, 7]])
check('insert delete', solve([[10, None, 5], [10, 5, None]]), [])
check('change revert', solve([[10, 5, 6], [10, 6, 5]]), [])
check('touch order', solve([[20, 5, 6], [10, 7, 8]]), [[20, 5, 6], [10, 7, 8]])
check('delete', solve([[10, 5, None]]), [[10, 5, None]])
check('insert', solve([[10, None, 5]]), [[10, None, 5]])
check('no transaction', solve([]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| two updates | [[10, 1, 3]] | [[10, 1, 3]] | Passed |
| insert delete | [] | [] | Passed |
| change revert | [] | [] | Passed |
| touch order | [[20, 1, 2], [10, 3, 4]] | [[20, 1, 2], [10, 3, 4]] | Passed |
| delete | [[10, 1, None]] | [[10, 1, None]] | Passed |
| insert | [[10, None, 1]] | [[10, None, 1]] | Passed |
| no transaction | [] | [] | Passed |
SHA-256 / 839bb75bbe57fb86088cc99852e5a86ced2878c151442de50eb9894c6ffe83d1
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:44:23.250783+00:00.
Case digest / 57ae2e8f038437d22d9fba0a3fba0016d8a234dbd618f66902906553baa5a8b8