FA-25016 / Filter interfaces / Open access
Mixed multi-operand groups require summary parentheses · case 01
Mixed multi-operand groups require summary parentheses is violated by the widget projection.
ROOT CAUSE
The parentheses decision uses `len(d['children'])>1` instead of the stipulated group-summary projection.
VERIFIED REPAIR
Implement the declared parentheses projection: `len(d['children'])>1 and d['mode']!=d['parent']`.
Unsuccessful approach: The attempted correction `d['mode']!=d['parent']` 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: Mixed multi-operand groups require summary parentheses.
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':('empty' if not d['children'] else 'configured'), 'parentheses':(len(d['children'])>1)}
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': [{'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': 'or', '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': 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': [{'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': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', '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': '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': 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})], 3: [({'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': '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': 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': 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}), ({'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})], 4: [({'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': 'or', 'negated': False, 'children': []}, {'join-label': 'all', '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}), ({'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': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False})], 5: [({'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': 'or', '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': 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}), ({'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})]}
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': 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': False} | Failed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', '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': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Failed |
| 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 / a5e1a376195780ffe2fc552491f712105b3ede4677be239353085a669c80e48f
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 d['children'] else 'configured'), 'parentheses':(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': [{'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': 'or', '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': 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': [{'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': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', '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': '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': 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})], 3: [({'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': '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': 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': 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}), ({'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})], 4: [({'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': 'or', 'negated': False, 'children': []}, {'join-label': 'all', '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}), ({'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': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False})], 5: [({'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': 'or', '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': 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}), ({'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})]}
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': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', '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': True} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Failed |
| 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': True} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Failed |
| 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': True} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': '', 'parentheses': False} | Failed |
| 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': True} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': False} | Failed |
SHA-256 / 727c3925c26a878129683f268f8a9c856d1df32d380694fd9deb6be6b8519fd3
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': [{'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': 'or', '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': 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': [{'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': 'or', 'parent': 'and', 'negated': False, 'children': []}, {'join-label': 'any', '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': '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': 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})], 3: [({'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': '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': 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': 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}), ({'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})], 4: [({'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': 'or', 'negated': False, 'children': []}, {'join-label': 'all', '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}), ({'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': [{'leaves': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': []}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 0, 'active-count': 0, 'empty-summary': 'empty', 'parentheses': False})], 5: [({'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': 'or', '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': 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}), ({'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})]}
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': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 1 | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 0, 'direct-count': 0, 'empty-summary': 'empty', '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 / 1274cbbafdfd3fb209c16c48c27dbb751a383304bf9fa51dc477fad91b1ebad7
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.793437+00:00.
Case digest / aff3c79d96b775eb86b4a779ce9abcbf2a46afab40f5d4c3afb0a5435ce9856f