FA-25056 / Filter interfaces / Open access
URL filter reset preserves every nonowned route parameter · case 01
URL filter reset preserves every nonowned route parameter is violated by the widget projection.
ROOT CAUSE
The preserve-route decision uses `[]` instead of the stipulated url-ownership projection.
VERIFIED REPAIR
Implement the declared preserve-route projection: `[k for k in d['keys'] if not k.startswith('f.')]`.
Unsuccessful approach: The attempted correction `[k for k in d['keys'] if not k.startswith('f')]` still violates the explicit contract fixtures.
Case contract
A filter widget owns query keys with the exact f. prefix; it must preserve route parameters and distinguish repeated values from comma-containing literals. This example checks: URL filter reset preserves every nonowned route parameter.
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 {'owned-prefix':([k for k in d['keys'] if k.startswith('f.')]), 'preserve-route':([]), 'multi-serialize':([(d['field'],x) for x in d['values']]), 'literal-comma':(list(d['values'])), 'empty-scalar':([(d['field'],d['text'])] if d['present'] else []), 'scope-key':(d['scope']+'.'+d['field'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'})], 2: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'})], 3: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'})], 4: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'})], 5: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'})]}
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 | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'left.tag'} | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | Failed |
| contract fixture 1 | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 2 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 3 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 4 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 5 | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 6 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 7 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': [], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 8 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 9 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': [], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Failed |
SHA-256 / 1ee347fcce9dd218725ff2992114bb85f0619d1dae5dab29ed25a7eaaea81ad9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'owned-prefix':([k for k in d['keys'] if k.startswith('f.')]), 'preserve-route':([k for k in d['keys'] if not k.startswith('f')]), 'multi-serialize':([(d['field'],x) for x in d['values']]), 'literal-comma':(list(d['values'])), 'empty-scalar':([(d['field'],d['text'])] if d['present'] else []), 'scope-key':(d['scope']+'.'+d['field'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'})], 2: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'})], 3: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'})], 4: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'})], 5: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'})]}
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 | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'left.tag'} | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | Failed |
| contract fixture 1 | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 2 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 3 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 4 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 5 | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 6 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 7 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Failed |
| contract fixture 8 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': ['xf.y'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Failed |
| contract fixture 9 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': ['xf.y'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Failed |
SHA-256 / 3f3741ed7c0424deecb18755d8672d1cc191d3c2c48c212b25a300bbfe390f21
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'owned-prefix':([k for k in d['keys'] if k.startswith('f.')]), 'preserve-route':([k for k in d['keys'] if not k.startswith('f.')]), 'multi-serialize':([(d['field'],x) for x in d['values']]), 'literal-comma':(list(d['values'])), 'empty-scalar':([(d['field'],d['text'])] if d['present'] else []), 'scope-key':(d['scope']+'.'+d['field'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'})], 2: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', 'x')], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'left.tag'})], 3: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'right.status'})], 4: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [], 'scope-key': 'left.status'})], 5: [({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': [], 'text': 'x', 'present': False, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [], 'scope-key': 'left.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'tag', 'values': ['a'], 'text': 'x', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', 'x')], 'scope-key': 'right.tag'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f.color', 'ref.x', 'foo', 'q'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'tag', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('tag', 'a,b'), ('tag', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('tag', '')], 'scope-key': 'right.tag'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': [], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [], 'literal-comma': [], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'}), ({'keys': ['f', 'f.x', 'xf.y'], 'field': 'status', 'values': ['a,b', 'c'], 'text': '', 'present': True, 'scope': 'right'}, {'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'multi-serialize': [('status', 'a,b'), ('status', 'c')], 'literal-comma': ['a,b', 'c'], 'empty-scalar': [('status', '')], 'scope-key': 'right.status'})]}
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 | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | Passed |
| contract fixture 1 | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Passed |
| contract fixture 2 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Passed |
| contract fixture 3 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Passed |
| contract fixture 4 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['tag', 'a,b'], ['tag', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | Passed |
| contract fixture 5 | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Passed |
| contract fixture 6 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['status', 'a']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Passed |
| contract fixture 7 | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | {'empty-scalar': [['status', 'x']], 'literal-comma': ['a,b', 'c'], 'multi-serialize': [['status', 'a,b'], ['status', 'c']], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.status'} | Passed |
| contract fixture 8 | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Passed |
| contract fixture 9 | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | {'empty-scalar': [['tag', 'x']], 'literal-comma': ['a'], 'multi-serialize': [['tag', 'a']], 'owned-prefix': ['f.x'], 'preserve-route': ['f', 'xf.y'], 'scope-key': 'right.tag'} | Passed |
SHA-256 / 6cf7884ed4c2bf4c24ccd040aa6a2dd0d20a86d5addf85b87fb2bd0b83a84376
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:03.199799+00:00.
Case digest / 2116346ff250c48c0167ea04291e139fded51a1e4399169a84cd04ba6bde0c5f