FA-25941 / Filter interfaces / Open access
Equal-count facets retain the supplied option order · case 01
Equal-count facets retain the supplied option order is violated by the widget projection.
ROOT CAUSE
The stable-count-ties decision uses `sorted(d['options'],key=lambda x:(-(d['counts'][x] if d['counts'][x] is not None else -1),x))` instead of the stipulated facet-ordering projection.
THE FAILURE
The stable-count-ties decision uses `sorted(d['options'],key=lambda x:(-(d['counts'][x] if d['counts'][x] is not None else -1),x))` instead of the stipulated facet-ordering projection.
Unsuccessful approach: The attempted correction `sorted(d['options'],key=lambda x:(-(d['counts'][x] if d['counts'][x] is not None else -1),-d['options'].index(x)))` still violates the explicit contract fixtures.
Case contract
Facet ordering uses pinned then selected priority, descending known counts, and stable server order for ties; unknown counts sort behind known counts. This example checks: Equal-count facets retain the supplied option order.
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 {'pin-priority':([x for x in d['options'] if x in d['pinned']]+[x for x in d['options'] if x not in d['pinned']]), 'selection-priority':([x for x in d['options'] if x in d['selected']]+[x for x in d['options'] if x not in d['selected']]), 'unknown-last':(sorted(d['options'],key=lambda x:d['counts'][x] is None)), 'descending-count':(sorted(d['options'],key=lambda x:-(d['counts'][x] if d['counts'][x] is not None else -1))), 'stable-count-ties':(sorted(d['options'],key=lambda x:(-(d['counts'][x] if d['counts'][x] is not None else -1),x))), 'pin-visible-only':([x for x in d['pinned'] if x in d['options']])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']})], 2: [({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']})], 3: [({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []})], 4: [({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']})], 5: [({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []})]}
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 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 1 | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | Passed |
| contract fixture 2 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 3 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['a', 'c', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['a', 'c', 'b']} | Passed |
| contract fixture 4 | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | Passed |
| contract fixture 5 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 6 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | Passed |
| contract fixture 7 | {'descending-count': ['c', 'b', 'a'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['c', 'b', 'a']} | {'descending-count': ['c', 'b', 'a'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a']} | Failed |
| contract fixture 8 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 9 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | Passed |
SHA-256 / 0b669b6d4e6ca3556cccb1e0617cc981b6459cdcb3e982b4259a34a697bf28a0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'pin-priority':([x for x in d['options'] if x in d['pinned']]+[x for x in d['options'] if x not in d['pinned']]), 'selection-priority':([x for x in d['options'] if x in d['selected']]+[x for x in d['options'] if x not in d['selected']]), 'unknown-last':(sorted(d['options'],key=lambda x:d['counts'][x] is None)), 'descending-count':(sorted(d['options'],key=lambda x:-(d['counts'][x] if d['counts'][x] is not None else -1))), 'stable-count-ties':(sorted(d['options'],key=lambda x:(-(d['counts'][x] if d['counts'][x] is not None else -1),-d['options'].index(x)))), 'pin-visible-only':([x for x in d['pinned'] if x in d['options']])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']})], 2: [({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']})], 3: [({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []})], 4: [({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']})], 5: [({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['c', 'b', 'a'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a'], 'descending-count': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'pin-visible-only': []}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'c', 'b'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b']}), ({'options': ['c', 'b', 'a'], 'pinned': ['a', 'z', 'b'], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['c', 'b', 'a'], 'unknown-last': ['c', 'a', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': ['a', 'b']}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['a'], 'counts': {'a': 2, 'b': 2, 'c': None}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c'], 'descending-count': ['b', 'a', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': 0, 'b': None, 'c': 3}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['a', 'c', 'b'], 'descending-count': ['c', 'a', 'b'], 'stable-count-ties': ['c', 'a', 'b'], 'pin-visible-only': []}), ({'options': ['b', 'a', 'c'], 'pinned': [], 'selected': ['b', 'c'], 'counts': {'a': None, 'b': 0, 'c': 0}}, {'pin-priority': ['b', 'a', 'c'], 'selection-priority': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a'], 'descending-count': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'pin-visible-only': []})]}
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 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 1 | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'unknown-last': ['b', 'c', 'a']} | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': [], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | Failed |
| contract fixture 2 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'b', 'c'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 3 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['a', 'c', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['a', 'c', 'b']} | Passed |
| contract fixture 4 | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'unknown-last': ['b', 'c', 'a']} | {'descending-count': ['b', 'c', 'a'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['b', 'c', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['b', 'c', 'a']} | Failed |
| contract fixture 5 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 6 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | Passed |
| contract fixture 7 | {'descending-count': ['c', 'b', 'a'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['b', 'c', 'a'], 'unknown-last': ['c', 'b', 'a']} | {'descending-count': ['c', 'b', 'a'], 'pin-priority': ['c', 'b', 'a'], 'pin-visible-only': [], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'b', 'a'], 'unknown-last': ['c', 'b', 'a']} | Failed |
| contract fixture 8 | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['a', 'b', 'c'], 'unknown-last': ['b', 'a', 'c']} | {'descending-count': ['b', 'a', 'c'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['a', 'c', 'b'], 'stable-count-ties': ['b', 'a', 'c'], 'unknown-last': ['b', 'a', 'c']} | Failed |
| contract fixture 9 | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | {'descending-count': ['c', 'a', 'b'], 'pin-priority': ['b', 'a', 'c'], 'pin-visible-only': ['a', 'b'], 'selection-priority': ['c', 'b', 'a'], 'stable-count-ties': ['c', 'a', 'b'], 'unknown-last': ['c', 'a', 'b']} | Passed |
SHA-256 / 2a4be4e9de1c97a5bd54fca19520e1f90cdd721add3f36952c65eb8ae839c246
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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:11.339478+00:00.
Case digest / 3bd95fdbd93e57b39b2121e88c50daf9dac4e1e2dfc041f893d492c280bbc587