FA-25006 / Filter interfaces / Open access
Active operand counts exclude disabled children without counting descendants · case 01
Active operand counts exclude disabled children without counting descendants is violated by the widget projection.
ROOT CAUSE
The active-count decision uses `len(d['children'])` instead of the stipulated group-summary projection.
VERIFIED REPAIR
Implement the declared active-count projection: `sum(x['enabled'] for x in d['children'])`.
Unsuccessful approach: The attempted correction `sum(x['leaves'] for x in d['children'] if x['enabled'])` 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: Active operand counts exclude disabled children without counting descendants.
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':(len(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': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'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': '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': 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': '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': '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})], 3: [({'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': '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': 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': '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': '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': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, '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': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Failed |
| 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': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 2 | {'active-count': 2, '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} | 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': 2, '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} | Failed |
| contract fixture 5 | {'active-count': 2, '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} | 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': 2, '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} | 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': 2, '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} | Failed |
SHA-256 / f0ca47a9f382827ae4e9ff221c7c3bc98662b8e01a52b331892ce02489da14d6
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['leaves'] for x in d['children'] if x['enabled'])), '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': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'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': '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': 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': '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': '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})], 3: [({'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': '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': 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': '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': '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': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, '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': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 1 | {'active-count': 3, '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} | 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': 3, '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} | 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': 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': 3, '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} | Failed |
| 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': 3, '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} | Failed |
| 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 / c3b4b6a61cf1b58d5b3fd5b2a86fb0540d9ce7d19deaa46c9505a13183fd66aa
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': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, 'empty-summary': 'configured', 'parentheses': False}), ({'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': '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': 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': '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': '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})], 3: [({'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': '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': 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': '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': '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': 1, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 0, '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': 'and', 'parent': 'and', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'and', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': False, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': '', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False}), ({'mode': 'and', 'parent': 'or', 'negated': True, 'children': [{'leaves': 1, 'enabled': True}, {'leaves': 2, 'enabled': False}]}, {'join-label': 'all', 'negation-label': 'not ', 'direct-count': 2, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': True}), ({'mode': 'or', 'parent': 'and', 'negated': False, 'children': [{'leaves': 3, 'enabled': True}]}, {'join-label': 'any', 'negation-label': '', 'direct-count': 1, 'active-count': 1, 'empty-summary': 'configured', 'parentheses': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'active-count': 0, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 0, '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': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 2 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': 'not ', 'parentheses': False} | Passed |
| contract fixture 3 | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | {'active-count': 1, 'direct-count': 1, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': False} | Passed |
| contract fixture 4 | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | {'active-count': 1, 'direct-count': 2, 'empty-summary': 'configured', 'join-label': 'all', 'negation-label': '', 'parentheses': True} | Passed |
| contract fixture 5 | {'active-count': 1, 'direct-count': 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 / 7fb8eed1d3fc1f1c7906cd760c467f437cb0281f82e9010234565e2dc1ea8203
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.654881+00:00.
Case digest / 01e7522a12bbc7a7b8bf7ba2ed50fa2ad45a09157386c1dc8129454ced836209