FA-41396 / Listener lifecycle / Open access
Scope exit claims ownership of borrowed listeners · case 01
Scope exit claims ownership of borrowed listeners; the returned lifecycle plan violates the stated transition contract.
ROOT CAUSE
The borrowed decision in the scope-exit listener model is computed as [], losing a required lifecycle condition.
VERIFIED REPAIR
Compute the borrowed decision from the complete contract: [x for x in s['children'] if x in s['borrowed']].
Unsuccessful approach: The partial repair uses s['borrowed']; a retained regression distinguishes it from the full transition.
Case contract
Plan closing an observer ownership scope. Owned children close in reverse acquisition order, borrowed children remain alive. Every cleanup executes even if prior cleanup failed; aggregate the errors. Closed scopes reject adoption, preserve their terminal marker and release their parent link exactly once. Ownership edges are [parent,child]; detaching a scope removes edges targeting that scope, not siblings from the same parent. Scope lifecycle is monotonic open < closing < closed; delayed requests cannot regress it and closing is not already closed. Inputs are finite state snapshots, including transitional and stale states; output fields are the exact independent actions/metadata defined by the corrected expression table. Numeric fixture capacities and counts vary with N. Field definitions, each independently computed from the input snapshot: order = list(reversed([x for x in s['children'] if x not in s['borrowed']])); borrowed = [x for x in s['children'] if x in s['borrowed']]; errors = list(s['errors']); adoption = s['adopt'] and not s['closed'] and not s['closing']; parent_release = [r for r in s['ownership_edges'] if r[1]!=s['scope_id']]; closed = max((s['phase'],s['requested_phase']),key=['open','closing','closed'].index); pending = 0 if s['closing'] or s['closed'] else s['pending']; remaining = len([x for x in s['children'] if x not in s['borrowed']]); continue = len(s['children']); parent_refs = max(0,s['refs']-int(s['parent'] and not s['already_released']))
Why this case matters
Observer implementations need to preserve this state while subscriptions enter, execute, and leave their lifecycle.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return {
'order': list(reversed([x for x in s['children'] if x not in s['borrowed']])),
'borrowed': [],
'errors': list(s['errors']),
'adoption': s['adopt'] and not s['closed'] and not s['closing'],
'parent_release': [r for r in s['ownership_edges'] if r[1]!=s['scope_id']],
'closed': max((s['phase'],s['requested_phase']),key=['open','closing','closed'].index),
'pending': 0 if s['closing'] or s['closed'] else s['pending'],
'remaining': len([x for x in s['children'] if x not in s['borrowed']]),
'continue': len(s['children']),
'parent_refs': max(0,s['refs']-int(s['parent'] and not s['already_released'])),
}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 1}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': True, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2})], 2: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': ['a'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': True, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 6, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b', 'a'], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 3, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4})], 3: [({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 5}), ({'children': ['a'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 6}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6})], 4: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 12, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 8}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 8}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': True, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 8})], 5: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 9}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['a'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 10, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': ['a'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 10}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 9}), ({'children': [], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 10})]}
for i,(state,expected) in enumerate(fixtures[N]):
check("transition "+str(i), solve(state), 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 |
|---|---|---|---|
| transition 0 | {'adoption': False, 'borrowed': [], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Failed |
| transition 1 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Passed |
| transition 2 | {'adoption': False, 'borrowed': [], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Failed |
| transition 3 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Passed |
| transition 4 | {'adoption': True, 'borrowed': [], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | {'adoption': True, 'borrowed': [], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | Passed |
| transition 5 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Failed |
| transition 6 | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | Passed |
| transition 7 | {'adoption': False, 'borrowed': [], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Failed |
SHA-256 / 936d78bc40c4d890a52e76488d1447f5828e1468849eee5f999c6fb8d7e59089
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return {
'order': list(reversed([x for x in s['children'] if x not in s['borrowed']])),
'borrowed': s['borrowed'],
'errors': list(s['errors']),
'adoption': s['adopt'] and not s['closed'] and not s['closing'],
'parent_release': [r for r in s['ownership_edges'] if r[1]!=s['scope_id']],
'closed': max((s['phase'],s['requested_phase']),key=['open','closing','closed'].index),
'pending': 0 if s['closing'] or s['closed'] else s['pending'],
'remaining': len([x for x in s['children'] if x not in s['borrowed']]),
'continue': len(s['children']),
'parent_refs': max(0,s['refs']-int(s['parent'] and not s['already_released'])),
}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 1}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': True, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2})], 2: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': ['a'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': True, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 6, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b', 'a'], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 3, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4})], 3: [({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 5}), ({'children': ['a'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 6}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6})], 4: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 12, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 8}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 8}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': True, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 8})], 5: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 9}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['a'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 10, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': ['a'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 10}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 9}), ({'children': [], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 10})]}
for i,(state,expected) in enumerate(fixtures[N]):
check("transition "+str(i), solve(state), 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 |
|---|---|---|---|
| transition 0 | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 1 | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Failed |
| transition 2 | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 3 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Passed |
| transition 4 | {'adoption': True, 'borrowed': ['a'], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | {'adoption': True, 'borrowed': [], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | Failed |
| transition 5 | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 6 | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | Passed |
| transition 7 | {'adoption': False, 'borrowed': ['b'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
SHA-256 / 764fd2d3afd01f684fda522e5c64944beca268dc57c1828fca5b4e4629cf723a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return {
'order': list(reversed([x for x in s['children'] if x not in s['borrowed']])),
'borrowed': [x for x in s['children'] if x in s['borrowed']],
'errors': list(s['errors']),
'adoption': s['adopt'] and not s['closed'] and not s['closing'],
'parent_release': [r for r in s['ownership_edges'] if r[1]!=s['scope_id']],
'closed': max((s['phase'],s['requested_phase']),key=['open','closing','closed'].index),
'pending': 0 if s['closing'] or s['closed'] else s['pending'],
'remaining': len([x for x in s['children'] if x not in s['borrowed']]),
'continue': len(s['children']),
'parent_refs': max(0,s['refs']-int(s['parent'] and not s['already_released'])),
}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 1}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': True, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 3, 'refs': 2, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 2})], 2: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': ['a'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': False, 'parent': True, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 6, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a'], 'borrowed': [], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 6, 'refs': 4, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 4}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 0, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b', 'a'], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 3, 'continue': 3, 'parent_refs': 4}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 6, 'refs': 4, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 4})], 3: [({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': True, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 5}), ({'children': ['a'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 6, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 6}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 9, 'refs': 6, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 6})], 4: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 12, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['b'], 'errors': ['first'], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': ['a'], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 8}), ({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first'], 'adoption': False, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 0}), ({'children': [], 'borrowed': ['a'], 'errors': ['first'], 'closed': True, 'closing': True, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': ['first'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 8}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 0, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': True, 'parent_release': [], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 12, 'refs': 8, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 8})], 5: [({'children': ['a', 'b', 'c'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'self', 'parent_id': 'q', 'phase': 'open', 'requested_phase': 'closing'}, {'order': ['c', 'b'], 'borrowed': ['a'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 9}), ({'children': [], 'borrowed': ['b'], 'errors': [], 'closed': True, 'closing': False, 'parent': False, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closing', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closing', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 0, 'already_released': False, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a'], 'borrowed': ['a'], 'errors': [], 'closed': False, 'closing': True, 'parent': False, 'adopt': True, 'pending': 0, 'refs': 10, 'already_released': True, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closing'}, {'order': [], 'borrowed': ['a'], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 1, 'parent_refs': 10}), ({'children': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'closed': False, 'closing': True, 'parent': True, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': False, 'ownership_edges': [], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'open'}, {'order': ['a'], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [], 'closed': 'closed', 'pending': 0, 'remaining': 1, 'continue': 1, 'parent_refs': 9}), ({'children': [], 'borrowed': [], 'errors': ['first', 'second'], 'closed': True, 'closing': False, 'parent': False, 'adopt': False, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'p', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': [], 'borrowed': [], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 10}), ({'children': [], 'borrowed': [], 'errors': [], 'closed': False, 'closing': False, 'parent': False, 'adopt': False, 'pending': 0, 'refs': 0, 'already_released': False, 'ownership_edges': [], 'scope_id': 'self', 'parent_id': 'p', 'phase': 'open', 'requested_phase': 'open'}, {'order': [], 'borrowed': [], 'errors': [], 'adoption': False, 'parent_release': [], 'closed': 'open', 'pending': 0, 'remaining': 0, 'continue': 0, 'parent_refs': 0}), ({'children': ['a', 'b', 'c'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'closed': True, 'closing': True, 'parent': True, 'adopt': True, 'pending': 15, 'refs': 10, 'already_released': True, 'ownership_edges': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'scope_id': 'missing', 'parent_id': 'q', 'phase': 'closed', 'requested_phase': 'closed'}, {'order': ['c', 'a'], 'borrowed': ['b'], 'errors': ['first', 'second'], 'adoption': False, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'closed': 'closed', 'pending': 0, 'remaining': 2, 'continue': 3, 'parent_refs': 10})]}
for i,(state,expected) in enumerate(fixtures[N]):
check("transition "+str(i), solve(state), 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 |
|---|---|---|---|
| transition 0 | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 1 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first'], 'order': ['a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Passed |
| transition 2 | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['a'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'b'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 3 | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | {'adoption': False, 'borrowed': [], 'closed': 'closing', 'continue': 1, 'errors': ['first', 'second'], 'order': ['a'], 'parent_refs': 1, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 1} | Passed |
| transition 4 | {'adoption': True, 'borrowed': [], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | {'adoption': True, 'borrowed': [], 'closed': 'closed', 'continue': 0, 'errors': ['first'], 'order': [], 'parent_refs': 0, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 0} | Passed |
| transition 5 | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closing', 'continue': 3, 'errors': [], 'order': ['c', 'a'], 'parent_refs': 0, 'parent_release': [['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
| transition 6 | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | {'adoption': False, 'borrowed': [], 'closed': 'open', 'continue': 0, 'errors': [], 'order': [], 'parent_refs': 0, 'parent_release': [], 'pending': 0, 'remaining': 0} | Passed |
| transition 7 | {'adoption': False, 'borrowed': ['b'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | {'adoption': False, 'borrowed': ['b'], 'closed': 'closed', 'continue': 3, 'errors': ['first', 'second'], 'order': ['c', 'a'], 'parent_refs': 2, 'parent_release': [['p', 'self'], ['p', 'sibling'], ['q', 'other']], 'pending': 0, 'remaining': 2} | Passed |
SHA-256 / 31b4db81ddde23c0fa8b96687b305f6582bea9f457226a27d782d30956d8a7bb
Verification & scope
A deterministic, bounded, single-threaded transition planner. Returned plans model state changes; they do not implement a production event framework. 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:43:40.559059+00:00.
Case digest / 96473732bb55056a734116cef0b924753a41788dc1127ca70ee3354d8cfb396a