FA-25001 / Filter interfaces / Open access
Group operand counts describe direct children rather than descendant leaves · case 01
Group operand counts describe direct children rather than descendant leaves is violated by the widget projection.
ROOT CAUSE
The direct-count decision uses `sum(x['leaves'] for x in d['children'])` instead of the stipulated group-summary projection.
VERIFIED REPAIR
Implement the declared direct-count projection: `len(d['children'])`.
Unsuccessful approach: The attempted correction `sum(x['enabled'] for x in d['children'])` 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: Group operand counts describe direct children rather than descendant leaves.
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':(sum(x['leaves'] for x in 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': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', '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}), ({'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})], 2: [({'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': [{'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': 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': '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': '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}), ({'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': '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': '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}), ({'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': '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': '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': 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': 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': 3, '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} | Failed |
| contract fixture 1 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 2 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 3 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 4 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 5 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 6 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 7 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 8 | {'active-count': 1, 'direct-count': 3, '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} | Failed |
| contract fixture 9 | {'active-count': 1, 'direct-count': 3, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': True} | Failed |
SHA-256 / 8f41a414325257ea694b48ae11dbfb2450f640d842c834f7b83e9fe37c8e149e
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':(sum(x['enabled'] for x in 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': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', '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}), ({'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})], 2: [({'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': [{'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': 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': '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': '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}), ({'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': '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': '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}), ({'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': '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': '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': 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': 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': 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 1 | {'active-count': 1, 'direct-count': 1, '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} | Failed |
| contract fixture 2 | {'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 3 | {'active-count': 1, 'direct-count': 1, '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} | Failed |
| contract fixture 4 | {'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 5 | {'active-count': 1, 'direct-count': 1, '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} | Failed |
| contract fixture 6 | {'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 7 | {'active-count': 1, 'direct-count': 1, '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} | Failed |
| contract fixture 8 | {'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 |
| 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': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': True} | Failed |
SHA-256 / b4e27aa6e6e08f7f400b50cd71d5051a55ec87bc20f9df3edf0a41a752f9cd74
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': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', '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}), ({'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})], 2: [({'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': [{'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': 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': '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': '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}), ({'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': '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': '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}), ({'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': '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': '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': 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': 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': 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 1 | {'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 2 | {'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 3 | {'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 4 | {'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 5 | {'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 6 | {'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 7 | {'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 8 | {'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 |
| contract fixture 9 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'any', 'negation-label': 'not ', 'parentheses': True} | Passed |
SHA-256 / b4135315c8051258e56d2561bb9ab09d6bc2b379ba1c205440db5fe4bee60824
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.617930+00:00.
Case digest / 0ca2bd59994b3eda2920234691f6dc4fbb8baebeff386528ec56fa915245bf3c