FA-25071 / Filter interfaces / Open access
Explicit empty text is serialized while an absent filter is omitted · case 01
Explicit empty text is serialized while an absent filter is omitted is violated by the widget projection.
ROOT CAUSE
The empty-scalar decision uses `[(d['field'],d['text'])] if d['text'] else []` instead of the stipulated url-ownership projection.
VERIFIED REPAIR
Implement the declared empty-scalar projection: `[(d['field'],d['text'])] if d['present'] else []`.
Unsuccessful approach: The attempted correction `[(d['field'],d['text'])]` 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: Explicit empty text is serialized while an absent filter is omitted.
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':([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['text'] 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': 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': [], '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.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': 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': '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': '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,b', 'c'], 'text': '', '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': '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': 'x', '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': 'status', '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.status'}), ({'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': ['a'], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'left.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': '', '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': [['tag', '']], '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', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [], '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', '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 / 9602ccf4e482f10437dcd13cc4892acbdeb50df96103c4273dd41d48a86ebf2b
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'])]), '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': 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': [], '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.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': 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': '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': '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,b', 'c'], 'text': '', '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': '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': 'x', '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': 'status', '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.status'}), ({'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': ['a'], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'left.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': '', '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': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | {'empty-scalar': [['tag', '']], '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', 'x']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [], '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', '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 / cf4271bfa7dd58ae923f9aba2698817422b4b1bfc05c5134902396c60210f6c6
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': 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': [], '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.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': 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': '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': '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,b', 'c'], 'text': '', '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': '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': 'x', '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': 'status', '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.status'}), ({'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': ['a'], 'text': '', 'present': True, 'scope': 'left'}, {'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'multi-serialize': [('tag', 'a')], 'literal-comma': ['a'], 'empty-scalar': [('tag', '')], 'scope-key': 'left.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': '', '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': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | {'empty-scalar': [['tag', '']], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'left.tag'} | Passed |
| contract fixture 1 | {'empty-scalar': [], 'literal-comma': [], 'multi-serialize': [], 'owned-prefix': ['f.color'], 'preserve-route': ['ref.x', 'foo', 'q'], 'scope-key': 'right.tag'} | {'empty-scalar': [], '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 / ad613c4000aaa9023f45d99a473de03e76e2e4bb2912c3d4d30122a38c5e17df
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.273109+00:00.
Case digest / 2b36a1aae8c24fa679c24524ceab7caa141da021d287676c8c7efb2cf3c6e6c3