FA-25011 / Filter interfaces / Open access
Empty and disabled-only groups have different summaries · case 01
Empty and disabled-only groups have different summaries is violated by the widget projection.
ROOT CAUSE
The empty-summary decision uses `'configured'` instead of the stipulated group-summary projection.
VERIFIED REPAIR
Implement the declared empty-summary projection: `'empty' if not d['children'] else 'configured'`.
Unsuccessful approach: The attempted correction `'empty' if not any(x['enabled'] for x in d['children']) else 'configured'` still violates the explicit contract fixtures.
Case contract
Filter groups summarize direct children with explicit all/any combination and a negation badge, retaining empty-group state without inventing operands. This example checks: Empty and disabled-only groups have different summaries.
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 {'join-label':('all' if d['mode']=='and' else 'any'), 'negation-label':('not ' if d['negated'] else ''), 'direct-count':(len(d['children'])), 'active-count':(sum(x['enabled'] for x in d['children'])), 'empty-summary':('configured'), 'parentheses':(len(d['children'])>1 and d['mode']!=d['parent'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 2: [({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 3: [({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 4: [({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 5: [({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Failed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 2 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 3 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 4 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 5 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 6 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | Passed |
| contract fixture 7 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 8 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 9 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | Passed |
SHA-256 / 78196ffe10fd37f3a2fcdb041b07d788125e32da68c8acc954f770126422b6f8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'join-label':('all' if d['mode']=='and' else 'any'), 'negation-label':('not ' if d['negated'] else ''), 'direct-count':(len(d['children'])), 'active-count':(sum(x['enabled'] for x in d['children'])), 'empty-summary':('empty' if not any(x['enabled'] for x in d['children']) else 'configured'), 'parentheses':(len(d['children'])>1 and d['mode']!=d['parent'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 2: [({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 3: [({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 4: [({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 5: [({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Failed |
| contract fixture 2 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 3 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 4 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 5 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 6 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | Passed |
| contract fixture 7 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 8 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 9 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | Passed |
SHA-256 / 09c40784a823315c6285bcb8623daf50ee324f01cd5829ee73504122ebbd4ece
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'join-label':('all' if d['mode']=='and' else 'any'), 'negation-label':('not ' if d['negated'] else ''), 'direct-count':(len(d['children'])), 'active-count':(sum(x['enabled'] for x in d['children'])), 'empty-summary':('empty' if not d['children'] else 'configured'), 'parentheses':(len(d['children'])>1 and d['mode']!=d['parent'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 2: [({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 3: [({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})], 4: [({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': []}, {'join-label': 'all', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False})], 5: [({'mode': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', 'negation-label': '', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False}), ({'mode': 'or', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'any', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 2 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 3 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 4 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 5 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 6 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | Passed |
| contract fixture 7 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 8 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 9 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | Passed |
SHA-256 / ba434c1579b8bc7952907dd4629b11ed49c608c3f64f1df4eeea162bc1ad6ec8
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:02.703071+00:00.
Case digest / 5e54adc16582c62c6b5fb2236d9c77902a995af78356b2795ff9238d55007bf5