FA-25806 / Filter interfaces / Open access
A drag must originate from a group containing the criterion · case 01
A drag must originate from a group containing the criterion is violated by the widget projection.
ROOT CAUSE
The source-membership decision uses `True` instead of the stipulated group-reparent projection.
VERIFIED REPAIR
Implement the declared source-membership projection: `d['criterion'] in d['source_rows']`.
Unsuccessful approach: The attempted correction `d['criterion'] in d['target_rows']` still violates the explicit contract fixtures.
Case contract
A filter-builder drag moves a criterion between explicit group identities, rejects descendant cycles, and retains operator grouping when flattening is unsafe. This example checks: A drag must originate from a group containing the criterion.
Why this case matters
Filter-widget state and serialization must preserve user constraints while the view changes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'cycle-block':(d['target'] in d['descendants'] or d['target']==d['source']), 'source-membership':(True), 'destination-duplicate':(d['criterion'] in d['target_rows'] and d['target']!=d['source']), 'source-removal':([x for x in d['source_rows'] if x!=d['criterion']]), 'destination-insert':(d['target_rows'][:d['index']]+[d['criterion']]+d['target_rows'][d['index']:]), 'flatten-safe':(d['source_mode']==d['target_mode'] and not d['negated'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})], 2: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False})], 3: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True})], 4: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False})], 5: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
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 |
|---|---|---|---|
| contract fixture 0 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 1 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 2 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 3 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 4 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 5 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 6 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 7 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 8 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 9 | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
SHA-256 / afe85e4c59ba9ba60e0ca429cf16c1762e184c76aeca565b2a1e8d1b46562451
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'cycle-block':(d['target'] in d['descendants'] or d['target']==d['source']), 'source-membership':(d['criterion'] in d['target_rows']), 'destination-duplicate':(d['criterion'] in d['target_rows'] and d['target']!=d['source']), 'source-removal':([x for x in d['source_rows'] if x!=d['criterion']]), 'destination-insert':(d['target_rows'][:d['index']]+[d['criterion']]+d['target_rows'][d['index']:]), 'flatten-safe':(d['source_mode']==d['target_mode'] and not d['negated'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})], 2: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False})], 3: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True})], 4: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False})], 5: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
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 |
|---|---|---|---|
| contract fixture 0 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 1 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Failed |
| contract fixture 2 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Failed |
| contract fixture 3 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | Failed |
| contract fixture 4 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 5 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 6 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 7 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 8 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Failed |
| contract fixture 9 | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Failed |
SHA-256 / 0bef02c9befdad2bb73af4479cc4d760ff7f97971eca587f43271ede25860e96
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'cycle-block':(d['target'] in d['descendants'] or d['target']==d['source']), 'source-membership':(d['criterion'] in d['source_rows']), 'destination-duplicate':(d['criterion'] in d['target_rows'] and d['target']!=d['source']), 'source-removal':([x for x in d['source_rows'] if x!=d['criterion']]), 'destination-insert':(d['target_rows'][:d['index']]+[d['criterion']]+d['target_rows'][d['index']:]), 'flatten-safe':(d['source_mode']==d['target_mode'] and not d['negated'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})], 2: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False})], 3: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': True})], 4: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False})], 5: [({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False}), ({'target': 's', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': True, 'source-membership': True, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 0, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False}), ({'target': 'child', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': ['a'], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': True}, {'cycle-block': True, 'source-membership': False, 'destination-duplicate': True, 'source-removal': ['b'], 'destination-insert': ['a', 'a'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'and', 'negated': False}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': True}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['a', 'b'], 'target_rows': ['x', 'y'], 'index': 0, 'source_mode': 'and', 'target_mode': 'and', 'negated': True}, {'cycle-block': False, 'source-membership': True, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a', 'x', 'y'], 'flatten-safe': False}), ({'target': 'other', 'source': 's', 'descendants': ['child'], 'criterion': 'a', 'source_rows': ['b'], 'target_rows': [], 'index': 1, 'source_mode': 'and', 'target_mode': 'or', 'negated': False}, {'cycle-block': False, 'source-membership': False, 'destination-duplicate': False, 'source-removal': ['b'], 'destination-insert': ['a'], 'flatten-safe': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
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 |
|---|---|---|---|
| contract fixture 0 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 1 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 2 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 3 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': True, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 4 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 5 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['x', 'a', 'y'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 6 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
| contract fixture 7 | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': True, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 8 | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | {'cycle-block': True, 'destination-duplicate': True, 'destination-insert': ['a', 'a'], 'flatten-safe': False, 'source-membership': False, 'source-removal': ['b']} | Passed |
| contract fixture 9 | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | {'cycle-block': False, 'destination-duplicate': False, 'destination-insert': ['a'], 'flatten-safe': False, 'source-membership': True, 'source-removal': ['b']} | Passed |
SHA-256 / a927ae0d39bf0731f67f4e31256e9e27949bd1cda01a7a6a22f75caa4bc31d09
Verification & scope
Deterministic bounded UI-state model only; no browser, query engine, network, or production-standard conformance is claimed. 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:41:10.074012+00:00.
Case digest / b265c555342e5d32569d427ded4220d4fa5d9c3d06caed203def92972f389058