FAILURE MAP
← Case archive

FA-44671 / Data systems / Open access

Update filtering uses the after predicate for its before image · case 01

Update filtering uses the after predicate for its before image.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

delta-filter-before-after: Update filtering uses the after predicate for its before image.

THE FAILURE

delta-filter-before-after: Update filtering uses the after predicate for its before image.

Unsuccessful approach: Requiring an after-image still loses deletion retractions.

Case contract

Convert a sequence of [id,before,after] updates into signed filtered rows, with None denoting absent row. The predicate is value>=cutoff. Emit qualifying before-images negatively before qualifying after-images positively; suppress unchanged qualifying values.

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:
        cutoff,updates=d
        out=[]
        for ident,before,after in updates:
            old=after is not None and after>=cutoff and before is not None
            new=after is not None and after>=cutoff
            if old and new and before==after: continue
            if old: out.append([ident,before,-1])
            if new: out.append([ident,after,1])
        return out
    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('leaves filter', solve([1, [[7, 3, 0]]]), [[7, 3, -1]])
    check('enters filter', solve([1, [[7, 0, 3]]]), [[7, 3, 1]])
    check('changes within filter', solve([1, [[7, 2, 3]]]), [[7, 2, -1], [7, 3, 1]])
    check('unchanged', solve([1, [[7, 1, 1]]]), [])
    check('insert', solve([1, [[7, None, 2]]]), [[7, 2, 1]])
    check('delete', solve([1, [[7, 2, None]]]), [[7, 2, -1]])
    check('outside both', solve([1, [[7, -1, 0]]]), [])
    check('no updates', solve([1, []]), [])
elif N == 2:
    check('leaves filter', solve([2, [[7, 4, 1]]]), [[7, 4, -1]])
    check('enters filter', solve([2, [[7, 1, 4]]]), [[7, 4, 1]])
    check('changes within filter', solve([2, [[7, 3, 4]]]), [[7, 3, -1], [7, 4, 1]])
    check('unchanged', solve([2, [[7, 2, 2]]]), [])
    check('insert', solve([2, [[7, None, 3]]]), [[7, 3, 1]])
    check('delete', solve([2, [[7, 3, None]]]), [[7, 3, -1]])
    check('outside both', solve([2, [[7, 0, 1]]]), [])
    check('no updates', solve([2, []]), [])
elif N == 3:
    check('leaves filter', solve([3, [[7, 5, 2]]]), [[7, 5, -1]])
    check('enters filter', solve([3, [[7, 2, 5]]]), [[7, 5, 1]])
    check('changes within filter', solve([3, [[7, 4, 5]]]), [[7, 4, -1], [7, 5, 1]])
    check('unchanged', solve([3, [[7, 3, 3]]]), [])
    check('insert', solve([3, [[7, None, 4]]]), [[7, 4, 1]])
    check('delete', solve([3, [[7, 4, None]]]), [[7, 4, -1]])
    check('outside both', solve([3, [[7, 1, 2]]]), [])
    check('no updates', solve([3, []]), [])
elif N == 4:
    check('leaves filter', solve([4, [[7, 6, 3]]]), [[7, 6, -1]])
    check('enters filter', solve([4, [[7, 3, 6]]]), [[7, 6, 1]])
    check('changes within filter', solve([4, [[7, 5, 6]]]), [[7, 5, -1], [7, 6, 1]])
    check('unchanged', solve([4, [[7, 4, 4]]]), [])
    check('insert', solve([4, [[7, None, 5]]]), [[7, 5, 1]])
    check('delete', solve([4, [[7, 5, None]]]), [[7, 5, -1]])
    check('outside both', solve([4, [[7, 2, 3]]]), [])
    check('no updates', solve([4, []]), [])
elif N == 5:
    check('leaves filter', solve([5, [[7, 7, 4]]]), [[7, 7, -1]])
    check('enters filter', solve([5, [[7, 4, 7]]]), [[7, 7, 1]])
    check('changes within filter', solve([5, [[7, 6, 7]]]), [[7, 6, -1], [7, 7, 1]])
    check('unchanged', solve([5, [[7, 5, 5]]]), [])
    check('insert', solve([5, [[7, None, 6]]]), [[7, 6, 1]])
    check('delete', solve([5, [[7, 6, None]]]), [[7, 6, -1]])
    check('outside both', solve([5, [[7, 3, 4]]]), [])
    check('no updates', solve([5, []]), [])
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 fixtureActualExpectedOutcome
leaves filter[][[7, 3, -1]]Failed
enters filter[[7, 0, -1], [7, 3, 1]][[7, 3, 1]]Failed
changes within filter[[7, 2, -1], [7, 3, 1]][[7, 2, -1], [7, 3, 1]]Passed
unchanged[][]Passed
insert[[7, 2, 1]][[7, 2, 1]]Passed
delete[][[7, 2, -1]]Failed
outside both[][]Passed
no updates[][]Passed

SHA-256 / 8d3954b18c9ef2da0b0f85d06e514969536c9ad63fdd5220c1d4cd77c1bdc60a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        cutoff,updates=d
        out=[]
        for ident,before,after in updates:
            old=before is not None and after is not None and before>=cutoff
            new=after is not None and after>=cutoff
            if old and new and before==after: continue
            if old: out.append([ident,before,-1])
            if new: out.append([ident,after,1])
        return out
    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('leaves filter', solve([1, [[7, 3, 0]]]), [[7, 3, -1]])
    check('enters filter', solve([1, [[7, 0, 3]]]), [[7, 3, 1]])
    check('changes within filter', solve([1, [[7, 2, 3]]]), [[7, 2, -1], [7, 3, 1]])
    check('unchanged', solve([1, [[7, 1, 1]]]), [])
    check('insert', solve([1, [[7, None, 2]]]), [[7, 2, 1]])
    check('delete', solve([1, [[7, 2, None]]]), [[7, 2, -1]])
    check('outside both', solve([1, [[7, -1, 0]]]), [])
    check('no updates', solve([1, []]), [])
elif N == 2:
    check('leaves filter', solve([2, [[7, 4, 1]]]), [[7, 4, -1]])
    check('enters filter', solve([2, [[7, 1, 4]]]), [[7, 4, 1]])
    check('changes within filter', solve([2, [[7, 3, 4]]]), [[7, 3, -1], [7, 4, 1]])
    check('unchanged', solve([2, [[7, 2, 2]]]), [])
    check('insert', solve([2, [[7, None, 3]]]), [[7, 3, 1]])
    check('delete', solve([2, [[7, 3, None]]]), [[7, 3, -1]])
    check('outside both', solve([2, [[7, 0, 1]]]), [])
    check('no updates', solve([2, []]), [])
elif N == 3:
    check('leaves filter', solve([3, [[7, 5, 2]]]), [[7, 5, -1]])
    check('enters filter', solve([3, [[7, 2, 5]]]), [[7, 5, 1]])
    check('changes within filter', solve([3, [[7, 4, 5]]]), [[7, 4, -1], [7, 5, 1]])
    check('unchanged', solve([3, [[7, 3, 3]]]), [])
    check('insert', solve([3, [[7, None, 4]]]), [[7, 4, 1]])
    check('delete', solve([3, [[7, 4, None]]]), [[7, 4, -1]])
    check('outside both', solve([3, [[7, 1, 2]]]), [])
    check('no updates', solve([3, []]), [])
elif N == 4:
    check('leaves filter', solve([4, [[7, 6, 3]]]), [[7, 6, -1]])
    check('enters filter', solve([4, [[7, 3, 6]]]), [[7, 6, 1]])
    check('changes within filter', solve([4, [[7, 5, 6]]]), [[7, 5, -1], [7, 6, 1]])
    check('unchanged', solve([4, [[7, 4, 4]]]), [])
    check('insert', solve([4, [[7, None, 5]]]), [[7, 5, 1]])
    check('delete', solve([4, [[7, 5, None]]]), [[7, 5, -1]])
    check('outside both', solve([4, [[7, 2, 3]]]), [])
    check('no updates', solve([4, []]), [])
elif N == 5:
    check('leaves filter', solve([5, [[7, 7, 4]]]), [[7, 7, -1]])
    check('enters filter', solve([5, [[7, 4, 7]]]), [[7, 7, 1]])
    check('changes within filter', solve([5, [[7, 6, 7]]]), [[7, 6, -1], [7, 7, 1]])
    check('unchanged', solve([5, [[7, 5, 5]]]), [])
    check('insert', solve([5, [[7, None, 6]]]), [[7, 6, 1]])
    check('delete', solve([5, [[7, 6, None]]]), [[7, 6, -1]])
    check('outside both', solve([5, [[7, 3, 4]]]), [])
    check('no updates', solve([5, []]), [])
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 fixtureActualExpectedOutcome
leaves filter[[7, 3, -1]][[7, 3, -1]]Passed
enters filter[[7, 3, 1]][[7, 3, 1]]Passed
changes within filter[[7, 2, -1], [7, 3, 1]][[7, 2, -1], [7, 3, 1]]Passed
unchanged[][]Passed
insert[[7, 2, 1]][[7, 2, 1]]Passed
delete[][[7, 2, -1]]Failed
outside both[][]Passed
no updates[][]Passed

SHA-256 / 1d3a6b203947be0d40a6a4d7027a83c2df76d4c0876d663583593604a6c2d87e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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:14.755280+00:00.

Case digest / c6952e77e6a33ff2c6341a98b52eb3682e0c5f1f015b45f3b5d13c5d8e5fd303