FA-23921 / Client state / Open access
Component subscription registration: Last listener resource close · case 01
Last listener resource close.
ROOT CAUSE
The last-listener-resource-close client decision evaluates `not registrations` instead of `not any(k!=removed for k,t in registrations)`.
VERIFIED REPAIR
Apply the modeled last-listener-resource-close rule: `not any(k!=removed for k,t in registrations)`.
Unsuccessful approach: The partial repair `len(registrations)==1` still violates the explicit fixture contract.
Case contract
Registration handles differ from topic names. Removing a handle removes all its registrations while preserving other handles and topic reference counts; unmounted consumers receive nothing and discard buffered events. Operation last-listener-resource-close has the six explicit input/output oracles below.
Why this case matters
An offline client lifecycle model that isolates a state-management defect without DOM rendering or network services.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
registrations, removed, event, mounted, buffered = s
if operation == 'unsubscribe-by-registration':
return [(k,t) for k,t in registrations if k!=removed]
if operation == 'topic-recipient-routing':
return [k for k,t in registrations if t==event]
if operation == 'unmounted-event-delivery':
return [k for k,t in registrations if t==event] if mounted else []
if operation == 'last-listener-resource-close':
return not registrations
if operation == 'registration-topic-index':
return sorted({t for k,t in registrations})
if operation == 'unmount-buffer-discard':
return buffered if mounted else []
if operation == 'buffered-delivery-order':
return buffered+[event]
if operation == 'unknown-unsubscribe-noop':
return removed not in [k for k,t in registrations]
if operation == 'registration-removal-count':
return sum(k==removed for k,t in registrations)
if operation == 'remaining-topic-reference-count':
return sum(t==event and k!=removed for k,t in registrations)
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unsubscribe-by-registration scenario 1', solve('unsubscribe-by-registration', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), [('b','x'),('c','y')])
check('unsubscribe-by-registration scenario 2', solve('unsubscribe-by-registration', ([],'a','x',True,[])), [])
check('unsubscribe-by-registration scenario 3', solve('unsubscribe-by-registration', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unsubscribe-by-registration scenario 4', solve('unsubscribe-by-registration', ([('a','x')],'z','x',True,[])), [('a','x')])
check('unsubscribe-by-registration scenario 5', solve('unsubscribe-by-registration', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [('a','x')])
check('unsubscribe-by-registration scenario 6', solve('unsubscribe-by-registration', ([('a','x'),('b','x')],'b','x',False,[])), [('a','x')])
check('topic-recipient-routing scenario 1', solve('topic-recipient-routing', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('topic-recipient-routing scenario 2', solve('topic-recipient-routing', ([],'a','x',True,[])), [])
check('topic-recipient-routing scenario 3', solve('topic-recipient-routing', ([('a','x'),('a','y')],'a','y',False,['old'])), ['a'])
check('topic-recipient-routing scenario 4', solve('topic-recipient-routing', ([('a','x')],'z','x',True,[])), ['a'])
check('topic-recipient-routing scenario 5', solve('topic-recipient-routing', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('topic-recipient-routing scenario 6', solve('topic-recipient-routing', ([('a','x'),('b','x')],'b','x',False,[])), ['a','b'])
check('unmounted-event-delivery scenario 1', solve('unmounted-event-delivery', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('unmounted-event-delivery scenario 2', solve('unmounted-event-delivery', ([],'a','x',True,[])), [])
check('unmounted-event-delivery scenario 3', solve('unmounted-event-delivery', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmounted-event-delivery scenario 4', solve('unmounted-event-delivery', ([('a','x')],'z','x',True,[])), ['a'])
check('unmounted-event-delivery scenario 5', solve('unmounted-event-delivery', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('unmounted-event-delivery scenario 6', solve('unmounted-event-delivery', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('last-listener-resource-close scenario 1', solve('last-listener-resource-close', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('last-listener-resource-close scenario 2', solve('last-listener-resource-close', ([],'a','x',True,[])), True)
check('last-listener-resource-close scenario 3', solve('last-listener-resource-close', ([('a','x'),('a','y')],'a','y',False,['old'])), True)
check('last-listener-resource-close scenario 4', solve('last-listener-resource-close', ([('a','x')],'z','x',True,[])), False)
check('last-listener-resource-close scenario 5', solve('last-listener-resource-close', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('last-listener-resource-close scenario 6', solve('last-listener-resource-close', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-topic-index scenario 1', solve('registration-topic-index', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['x','y'])
check('registration-topic-index scenario 2', solve('registration-topic-index', ([],'a','x',True,[])), [])
check('registration-topic-index scenario 3', solve('registration-topic-index', ([('a','x'),('a','y')],'a','y',False,['old'])), ['x','y'])
check('registration-topic-index scenario 4', solve('registration-topic-index', ([('a','x')],'z','x',True,[])), ['x'])
check('registration-topic-index scenario 5', solve('registration-topic-index', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['x','y'])
check('registration-topic-index scenario 6', solve('registration-topic-index', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unmount-buffer-discard scenario 1', solve('unmount-buffer-discard', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N)])
check('unmount-buffer-discard scenario 2', solve('unmount-buffer-discard', ([],'a','x',True,[])), [])
check('unmount-buffer-discard scenario 3', solve('unmount-buffer-discard', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmount-buffer-discard scenario 4', solve('unmount-buffer-discard', ([('a','x')],'z','x',True,[])), [])
check('unmount-buffer-discard scenario 5', solve('unmount-buffer-discard', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b'])
check('unmount-buffer-discard scenario 6', solve('unmount-buffer-discard', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('buffered-delivery-order scenario 1', solve('buffered-delivery-order', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N),'x'])
check('buffered-delivery-order scenario 2', solve('buffered-delivery-order', ([],'a','x',True,[])), ['x'])
check('buffered-delivery-order scenario 3', solve('buffered-delivery-order', ([('a','x'),('a','y')],'a','y',False,['old'])), ['old','y'])
check('buffered-delivery-order scenario 4', solve('buffered-delivery-order', ([('a','x')],'z','x',True,[])), ['x'])
check('buffered-delivery-order scenario 5', solve('buffered-delivery-order', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b','z'])
check('buffered-delivery-order scenario 6', solve('buffered-delivery-order', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unknown-unsubscribe-noop scenario 1', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('unknown-unsubscribe-noop scenario 2', solve('unknown-unsubscribe-noop', ([],'a','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 3', solve('unknown-unsubscribe-noop', ([('a','x'),('a','y')],'a','y',False,['old'])), False)
check('unknown-unsubscribe-noop scenario 4', solve('unknown-unsubscribe-noop', ([('a','x')],'z','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 5', solve('unknown-unsubscribe-noop', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('unknown-unsubscribe-noop scenario 6', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-removal-count scenario 1', solve('registration-removal-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('registration-removal-count scenario 2', solve('registration-removal-count', ([],'a','x',True,[])), 0)
check('registration-removal-count scenario 3', solve('registration-removal-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 2)
check('registration-removal-count scenario 4', solve('registration-removal-count', ([('a','x')],'z','x',True,[])), 0)
check('registration-removal-count scenario 5', solve('registration-removal-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 1)
check('registration-removal-count scenario 6', solve('registration-removal-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
check('remaining-topic-reference-count scenario 1', solve('remaining-topic-reference-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('remaining-topic-reference-count scenario 2', solve('remaining-topic-reference-count', ([],'a','x',True,[])), 0)
check('remaining-topic-reference-count scenario 3', solve('remaining-topic-reference-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 0)
check('remaining-topic-reference-count scenario 4', solve('remaining-topic-reference-count', ([('a','x')],'z','x',True,[])), 1)
check('remaining-topic-reference-count scenario 5', solve('remaining-topic-reference-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 0)
check('remaining-topic-reference-count scenario 6', solve('remaining-topic-reference-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
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 |
|---|---|---|---|
| unsubscribe-by-registration scenario 1 | [['b', 'x'], ['c', 'y']] | [['b', 'x'], ['c', 'y']] | Passed |
| unsubscribe-by-registration scenario 2 | [] | [] | Passed |
| unsubscribe-by-registration scenario 3 | [] | [] | Passed |
| unsubscribe-by-registration scenario 4 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 5 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 6 | [['a', 'x']] | [['a', 'x']] | Passed |
| topic-recipient-routing scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| topic-recipient-routing scenario 2 | [] | [] | Passed |
| topic-recipient-routing scenario 3 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 4 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 5 | [] | [] | Passed |
| topic-recipient-routing scenario 6 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 2 | [] | [] | Passed |
| unmounted-event-delivery scenario 3 | [] | [] | Passed |
| unmounted-event-delivery scenario 4 | ['a'] | ['a'] | Passed |
| unmounted-event-delivery scenario 5 | [] | [] | Passed |
| unmounted-event-delivery scenario 6 | [] | [] | Passed |
| last-listener-resource-close scenario 1 | False | False | Passed |
| last-listener-resource-close scenario 2 | True | True | Passed |
| last-listener-resource-close scenario 3 | False | True | Failed |
| last-listener-resource-close scenario 4 | False | False | Passed |
| last-listener-resource-close scenario 5 | False | False | Passed |
| last-listener-resource-close scenario 6 | False | False | Passed |
| registration-topic-index scenario 1 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 2 | [] | [] | Passed |
| registration-topic-index scenario 3 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 4 | ['x'] | ['x'] | Passed |
| registration-topic-index scenario 5 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 6 | ['x'] | ['x'] | Passed |
| unmount-buffer-discard scenario 1 | ['old1'] | ['old1'] | Passed |
| unmount-buffer-discard scenario 2 | [] | [] | Passed |
| unmount-buffer-discard scenario 3 | [] | [] | Passed |
| unmount-buffer-discard scenario 4 | [] | [] | Passed |
| unmount-buffer-discard scenario 5 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmount-buffer-discard scenario 6 | [] | [] | Passed |
| buffered-delivery-order scenario 1 | ['old1', 'x'] | ['old1', 'x'] | Passed |
| buffered-delivery-order scenario 2 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 3 | ['old', 'y'] | ['old', 'y'] | Passed |
| buffered-delivery-order scenario 4 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 5 | ['a', 'b', 'z'] | ['a', 'b', 'z'] | Passed |
| buffered-delivery-order scenario 6 | ['x'] | ['x'] | Passed |
| unknown-unsubscribe-noop scenario 1 | False | False | Passed |
| unknown-unsubscribe-noop scenario 2 | True | True | Passed |
| unknown-unsubscribe-noop scenario 3 | False | False | Passed |
| unknown-unsubscribe-noop scenario 4 | True | True | Passed |
| unknown-unsubscribe-noop scenario 5 | False | False | Passed |
| unknown-unsubscribe-noop scenario 6 | False | False | Passed |
| registration-removal-count scenario 1 | 1 | 1 | Passed |
| registration-removal-count scenario 2 | 0 | 0 | Passed |
| registration-removal-count scenario 3 | 2 | 2 | Passed |
| registration-removal-count scenario 4 | 0 | 0 | Passed |
| registration-removal-count scenario 5 | 1 | 1 | Passed |
| registration-removal-count scenario 6 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 1 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 2 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 3 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 4 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 5 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 6 | 1 | 1 | Passed |
SHA-256 / 8b2f31fcdeff7d7456908091a19a476e93acf802386ab224eb9161219aeccc95
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
registrations, removed, event, mounted, buffered = s
if operation == 'unsubscribe-by-registration':
return [(k,t) for k,t in registrations if k!=removed]
if operation == 'topic-recipient-routing':
return [k for k,t in registrations if t==event]
if operation == 'unmounted-event-delivery':
return [k for k,t in registrations if t==event] if mounted else []
if operation == 'last-listener-resource-close':
return len(registrations)==1
if operation == 'registration-topic-index':
return sorted({t for k,t in registrations})
if operation == 'unmount-buffer-discard':
return buffered if mounted else []
if operation == 'buffered-delivery-order':
return buffered+[event]
if operation == 'unknown-unsubscribe-noop':
return removed not in [k for k,t in registrations]
if operation == 'registration-removal-count':
return sum(k==removed for k,t in registrations)
if operation == 'remaining-topic-reference-count':
return sum(t==event and k!=removed for k,t in registrations)
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unsubscribe-by-registration scenario 1', solve('unsubscribe-by-registration', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), [('b','x'),('c','y')])
check('unsubscribe-by-registration scenario 2', solve('unsubscribe-by-registration', ([],'a','x',True,[])), [])
check('unsubscribe-by-registration scenario 3', solve('unsubscribe-by-registration', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unsubscribe-by-registration scenario 4', solve('unsubscribe-by-registration', ([('a','x')],'z','x',True,[])), [('a','x')])
check('unsubscribe-by-registration scenario 5', solve('unsubscribe-by-registration', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [('a','x')])
check('unsubscribe-by-registration scenario 6', solve('unsubscribe-by-registration', ([('a','x'),('b','x')],'b','x',False,[])), [('a','x')])
check('topic-recipient-routing scenario 1', solve('topic-recipient-routing', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('topic-recipient-routing scenario 2', solve('topic-recipient-routing', ([],'a','x',True,[])), [])
check('topic-recipient-routing scenario 3', solve('topic-recipient-routing', ([('a','x'),('a','y')],'a','y',False,['old'])), ['a'])
check('topic-recipient-routing scenario 4', solve('topic-recipient-routing', ([('a','x')],'z','x',True,[])), ['a'])
check('topic-recipient-routing scenario 5', solve('topic-recipient-routing', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('topic-recipient-routing scenario 6', solve('topic-recipient-routing', ([('a','x'),('b','x')],'b','x',False,[])), ['a','b'])
check('unmounted-event-delivery scenario 1', solve('unmounted-event-delivery', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('unmounted-event-delivery scenario 2', solve('unmounted-event-delivery', ([],'a','x',True,[])), [])
check('unmounted-event-delivery scenario 3', solve('unmounted-event-delivery', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmounted-event-delivery scenario 4', solve('unmounted-event-delivery', ([('a','x')],'z','x',True,[])), ['a'])
check('unmounted-event-delivery scenario 5', solve('unmounted-event-delivery', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('unmounted-event-delivery scenario 6', solve('unmounted-event-delivery', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('last-listener-resource-close scenario 1', solve('last-listener-resource-close', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('last-listener-resource-close scenario 2', solve('last-listener-resource-close', ([],'a','x',True,[])), True)
check('last-listener-resource-close scenario 3', solve('last-listener-resource-close', ([('a','x'),('a','y')],'a','y',False,['old'])), True)
check('last-listener-resource-close scenario 4', solve('last-listener-resource-close', ([('a','x')],'z','x',True,[])), False)
check('last-listener-resource-close scenario 5', solve('last-listener-resource-close', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('last-listener-resource-close scenario 6', solve('last-listener-resource-close', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-topic-index scenario 1', solve('registration-topic-index', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['x','y'])
check('registration-topic-index scenario 2', solve('registration-topic-index', ([],'a','x',True,[])), [])
check('registration-topic-index scenario 3', solve('registration-topic-index', ([('a','x'),('a','y')],'a','y',False,['old'])), ['x','y'])
check('registration-topic-index scenario 4', solve('registration-topic-index', ([('a','x')],'z','x',True,[])), ['x'])
check('registration-topic-index scenario 5', solve('registration-topic-index', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['x','y'])
check('registration-topic-index scenario 6', solve('registration-topic-index', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unmount-buffer-discard scenario 1', solve('unmount-buffer-discard', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N)])
check('unmount-buffer-discard scenario 2', solve('unmount-buffer-discard', ([],'a','x',True,[])), [])
check('unmount-buffer-discard scenario 3', solve('unmount-buffer-discard', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmount-buffer-discard scenario 4', solve('unmount-buffer-discard', ([('a','x')],'z','x',True,[])), [])
check('unmount-buffer-discard scenario 5', solve('unmount-buffer-discard', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b'])
check('unmount-buffer-discard scenario 6', solve('unmount-buffer-discard', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('buffered-delivery-order scenario 1', solve('buffered-delivery-order', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N),'x'])
check('buffered-delivery-order scenario 2', solve('buffered-delivery-order', ([],'a','x',True,[])), ['x'])
check('buffered-delivery-order scenario 3', solve('buffered-delivery-order', ([('a','x'),('a','y')],'a','y',False,['old'])), ['old','y'])
check('buffered-delivery-order scenario 4', solve('buffered-delivery-order', ([('a','x')],'z','x',True,[])), ['x'])
check('buffered-delivery-order scenario 5', solve('buffered-delivery-order', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b','z'])
check('buffered-delivery-order scenario 6', solve('buffered-delivery-order', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unknown-unsubscribe-noop scenario 1', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('unknown-unsubscribe-noop scenario 2', solve('unknown-unsubscribe-noop', ([],'a','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 3', solve('unknown-unsubscribe-noop', ([('a','x'),('a','y')],'a','y',False,['old'])), False)
check('unknown-unsubscribe-noop scenario 4', solve('unknown-unsubscribe-noop', ([('a','x')],'z','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 5', solve('unknown-unsubscribe-noop', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('unknown-unsubscribe-noop scenario 6', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-removal-count scenario 1', solve('registration-removal-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('registration-removal-count scenario 2', solve('registration-removal-count', ([],'a','x',True,[])), 0)
check('registration-removal-count scenario 3', solve('registration-removal-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 2)
check('registration-removal-count scenario 4', solve('registration-removal-count', ([('a','x')],'z','x',True,[])), 0)
check('registration-removal-count scenario 5', solve('registration-removal-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 1)
check('registration-removal-count scenario 6', solve('registration-removal-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
check('remaining-topic-reference-count scenario 1', solve('remaining-topic-reference-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('remaining-topic-reference-count scenario 2', solve('remaining-topic-reference-count', ([],'a','x',True,[])), 0)
check('remaining-topic-reference-count scenario 3', solve('remaining-topic-reference-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 0)
check('remaining-topic-reference-count scenario 4', solve('remaining-topic-reference-count', ([('a','x')],'z','x',True,[])), 1)
check('remaining-topic-reference-count scenario 5', solve('remaining-topic-reference-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 0)
check('remaining-topic-reference-count scenario 6', solve('remaining-topic-reference-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
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 |
|---|---|---|---|
| unsubscribe-by-registration scenario 1 | [['b', 'x'], ['c', 'y']] | [['b', 'x'], ['c', 'y']] | Passed |
| unsubscribe-by-registration scenario 2 | [] | [] | Passed |
| unsubscribe-by-registration scenario 3 | [] | [] | Passed |
| unsubscribe-by-registration scenario 4 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 5 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 6 | [['a', 'x']] | [['a', 'x']] | Passed |
| topic-recipient-routing scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| topic-recipient-routing scenario 2 | [] | [] | Passed |
| topic-recipient-routing scenario 3 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 4 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 5 | [] | [] | Passed |
| topic-recipient-routing scenario 6 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 2 | [] | [] | Passed |
| unmounted-event-delivery scenario 3 | [] | [] | Passed |
| unmounted-event-delivery scenario 4 | ['a'] | ['a'] | Passed |
| unmounted-event-delivery scenario 5 | [] | [] | Passed |
| unmounted-event-delivery scenario 6 | [] | [] | Passed |
| last-listener-resource-close scenario 1 | False | False | Passed |
| last-listener-resource-close scenario 2 | False | True | Failed |
| last-listener-resource-close scenario 3 | False | True | Failed |
| last-listener-resource-close scenario 4 | True | False | Failed |
| last-listener-resource-close scenario 5 | False | False | Passed |
| last-listener-resource-close scenario 6 | False | False | Passed |
| registration-topic-index scenario 1 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 2 | [] | [] | Passed |
| registration-topic-index scenario 3 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 4 | ['x'] | ['x'] | Passed |
| registration-topic-index scenario 5 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 6 | ['x'] | ['x'] | Passed |
| unmount-buffer-discard scenario 1 | ['old1'] | ['old1'] | Passed |
| unmount-buffer-discard scenario 2 | [] | [] | Passed |
| unmount-buffer-discard scenario 3 | [] | [] | Passed |
| unmount-buffer-discard scenario 4 | [] | [] | Passed |
| unmount-buffer-discard scenario 5 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmount-buffer-discard scenario 6 | [] | [] | Passed |
| buffered-delivery-order scenario 1 | ['old1', 'x'] | ['old1', 'x'] | Passed |
| buffered-delivery-order scenario 2 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 3 | ['old', 'y'] | ['old', 'y'] | Passed |
| buffered-delivery-order scenario 4 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 5 | ['a', 'b', 'z'] | ['a', 'b', 'z'] | Passed |
| buffered-delivery-order scenario 6 | ['x'] | ['x'] | Passed |
| unknown-unsubscribe-noop scenario 1 | False | False | Passed |
| unknown-unsubscribe-noop scenario 2 | True | True | Passed |
| unknown-unsubscribe-noop scenario 3 | False | False | Passed |
| unknown-unsubscribe-noop scenario 4 | True | True | Passed |
| unknown-unsubscribe-noop scenario 5 | False | False | Passed |
| unknown-unsubscribe-noop scenario 6 | False | False | Passed |
| registration-removal-count scenario 1 | 1 | 1 | Passed |
| registration-removal-count scenario 2 | 0 | 0 | Passed |
| registration-removal-count scenario 3 | 2 | 2 | Passed |
| registration-removal-count scenario 4 | 0 | 0 | Passed |
| registration-removal-count scenario 5 | 1 | 1 | Passed |
| registration-removal-count scenario 6 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 1 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 2 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 3 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 4 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 5 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 6 | 1 | 1 | Passed |
SHA-256 / fd4de02b096c98bb2e2867af74c45951acfeced54ed686f55219b6ed2b3f193e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
registrations, removed, event, mounted, buffered = s
if operation == 'unsubscribe-by-registration':
return [(k,t) for k,t in registrations if k!=removed]
if operation == 'topic-recipient-routing':
return [k for k,t in registrations if t==event]
if operation == 'unmounted-event-delivery':
return [k for k,t in registrations if t==event] if mounted else []
if operation == 'last-listener-resource-close':
return not any(k!=removed for k,t in registrations)
if operation == 'registration-topic-index':
return sorted({t for k,t in registrations})
if operation == 'unmount-buffer-discard':
return buffered if mounted else []
if operation == 'buffered-delivery-order':
return buffered+[event]
if operation == 'unknown-unsubscribe-noop':
return removed not in [k for k,t in registrations]
if operation == 'registration-removal-count':
return sum(k==removed for k,t in registrations)
if operation == 'remaining-topic-reference-count':
return sum(t==event and k!=removed for k,t in registrations)
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unsubscribe-by-registration scenario 1', solve('unsubscribe-by-registration', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), [('b','x'),('c','y')])
check('unsubscribe-by-registration scenario 2', solve('unsubscribe-by-registration', ([],'a','x',True,[])), [])
check('unsubscribe-by-registration scenario 3', solve('unsubscribe-by-registration', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unsubscribe-by-registration scenario 4', solve('unsubscribe-by-registration', ([('a','x')],'z','x',True,[])), [('a','x')])
check('unsubscribe-by-registration scenario 5', solve('unsubscribe-by-registration', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [('a','x')])
check('unsubscribe-by-registration scenario 6', solve('unsubscribe-by-registration', ([('a','x'),('b','x')],'b','x',False,[])), [('a','x')])
check('topic-recipient-routing scenario 1', solve('topic-recipient-routing', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('topic-recipient-routing scenario 2', solve('topic-recipient-routing', ([],'a','x',True,[])), [])
check('topic-recipient-routing scenario 3', solve('topic-recipient-routing', ([('a','x'),('a','y')],'a','y',False,['old'])), ['a'])
check('topic-recipient-routing scenario 4', solve('topic-recipient-routing', ([('a','x')],'z','x',True,[])), ['a'])
check('topic-recipient-routing scenario 5', solve('topic-recipient-routing', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('topic-recipient-routing scenario 6', solve('topic-recipient-routing', ([('a','x'),('b','x')],'b','x',False,[])), ['a','b'])
check('unmounted-event-delivery scenario 1', solve('unmounted-event-delivery', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['a','b'])
check('unmounted-event-delivery scenario 2', solve('unmounted-event-delivery', ([],'a','x',True,[])), [])
check('unmounted-event-delivery scenario 3', solve('unmounted-event-delivery', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmounted-event-delivery scenario 4', solve('unmounted-event-delivery', ([('a','x')],'z','x',True,[])), ['a'])
check('unmounted-event-delivery scenario 5', solve('unmounted-event-delivery', ([('a','x'),('b','y')],'b','z',True,['a','b'])), [])
check('unmounted-event-delivery scenario 6', solve('unmounted-event-delivery', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('last-listener-resource-close scenario 1', solve('last-listener-resource-close', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('last-listener-resource-close scenario 2', solve('last-listener-resource-close', ([],'a','x',True,[])), True)
check('last-listener-resource-close scenario 3', solve('last-listener-resource-close', ([('a','x'),('a','y')],'a','y',False,['old'])), True)
check('last-listener-resource-close scenario 4', solve('last-listener-resource-close', ([('a','x')],'z','x',True,[])), False)
check('last-listener-resource-close scenario 5', solve('last-listener-resource-close', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('last-listener-resource-close scenario 6', solve('last-listener-resource-close', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-topic-index scenario 1', solve('registration-topic-index', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['x','y'])
check('registration-topic-index scenario 2', solve('registration-topic-index', ([],'a','x',True,[])), [])
check('registration-topic-index scenario 3', solve('registration-topic-index', ([('a','x'),('a','y')],'a','y',False,['old'])), ['x','y'])
check('registration-topic-index scenario 4', solve('registration-topic-index', ([('a','x')],'z','x',True,[])), ['x'])
check('registration-topic-index scenario 5', solve('registration-topic-index', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['x','y'])
check('registration-topic-index scenario 6', solve('registration-topic-index', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unmount-buffer-discard scenario 1', solve('unmount-buffer-discard', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N)])
check('unmount-buffer-discard scenario 2', solve('unmount-buffer-discard', ([],'a','x',True,[])), [])
check('unmount-buffer-discard scenario 3', solve('unmount-buffer-discard', ([('a','x'),('a','y')],'a','y',False,['old'])), [])
check('unmount-buffer-discard scenario 4', solve('unmount-buffer-discard', ([('a','x')],'z','x',True,[])), [])
check('unmount-buffer-discard scenario 5', solve('unmount-buffer-discard', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b'])
check('unmount-buffer-discard scenario 6', solve('unmount-buffer-discard', ([('a','x'),('b','x')],'b','x',False,[])), [])
check('buffered-delivery-order scenario 1', solve('buffered-delivery-order', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), ['old'+str(N),'x'])
check('buffered-delivery-order scenario 2', solve('buffered-delivery-order', ([],'a','x',True,[])), ['x'])
check('buffered-delivery-order scenario 3', solve('buffered-delivery-order', ([('a','x'),('a','y')],'a','y',False,['old'])), ['old','y'])
check('buffered-delivery-order scenario 4', solve('buffered-delivery-order', ([('a','x')],'z','x',True,[])), ['x'])
check('buffered-delivery-order scenario 5', solve('buffered-delivery-order', ([('a','x'),('b','y')],'b','z',True,['a','b'])), ['a','b','z'])
check('buffered-delivery-order scenario 6', solve('buffered-delivery-order', ([('a','x'),('b','x')],'b','x',False,[])), ['x'])
check('unknown-unsubscribe-noop scenario 1', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), False)
check('unknown-unsubscribe-noop scenario 2', solve('unknown-unsubscribe-noop', ([],'a','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 3', solve('unknown-unsubscribe-noop', ([('a','x'),('a','y')],'a','y',False,['old'])), False)
check('unknown-unsubscribe-noop scenario 4', solve('unknown-unsubscribe-noop', ([('a','x')],'z','x',True,[])), True)
check('unknown-unsubscribe-noop scenario 5', solve('unknown-unsubscribe-noop', ([('a','x'),('b','y')],'b','z',True,['a','b'])), False)
check('unknown-unsubscribe-noop scenario 6', solve('unknown-unsubscribe-noop', ([('a','x'),('b','x')],'b','x',False,[])), False)
check('registration-removal-count scenario 1', solve('registration-removal-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('registration-removal-count scenario 2', solve('registration-removal-count', ([],'a','x',True,[])), 0)
check('registration-removal-count scenario 3', solve('registration-removal-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 2)
check('registration-removal-count scenario 4', solve('registration-removal-count', ([('a','x')],'z','x',True,[])), 0)
check('registration-removal-count scenario 5', solve('registration-removal-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 1)
check('registration-removal-count scenario 6', solve('registration-removal-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
check('remaining-topic-reference-count scenario 1', solve('remaining-topic-reference-count', ([('a','x'),('b','x'),('c','y')],'a','x',True,['old'+str(N)])), 1)
check('remaining-topic-reference-count scenario 2', solve('remaining-topic-reference-count', ([],'a','x',True,[])), 0)
check('remaining-topic-reference-count scenario 3', solve('remaining-topic-reference-count', ([('a','x'),('a','y')],'a','y',False,['old'])), 0)
check('remaining-topic-reference-count scenario 4', solve('remaining-topic-reference-count', ([('a','x')],'z','x',True,[])), 1)
check('remaining-topic-reference-count scenario 5', solve('remaining-topic-reference-count', ([('a','x'),('b','y')],'b','z',True,['a','b'])), 0)
check('remaining-topic-reference-count scenario 6', solve('remaining-topic-reference-count', ([('a','x'),('b','x')],'b','x',False,[])), 1)
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 |
|---|---|---|---|
| unsubscribe-by-registration scenario 1 | [['b', 'x'], ['c', 'y']] | [['b', 'x'], ['c', 'y']] | Passed |
| unsubscribe-by-registration scenario 2 | [] | [] | Passed |
| unsubscribe-by-registration scenario 3 | [] | [] | Passed |
| unsubscribe-by-registration scenario 4 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 5 | [['a', 'x']] | [['a', 'x']] | Passed |
| unsubscribe-by-registration scenario 6 | [['a', 'x']] | [['a', 'x']] | Passed |
| topic-recipient-routing scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| topic-recipient-routing scenario 2 | [] | [] | Passed |
| topic-recipient-routing scenario 3 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 4 | ['a'] | ['a'] | Passed |
| topic-recipient-routing scenario 5 | [] | [] | Passed |
| topic-recipient-routing scenario 6 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 1 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmounted-event-delivery scenario 2 | [] | [] | Passed |
| unmounted-event-delivery scenario 3 | [] | [] | Passed |
| unmounted-event-delivery scenario 4 | ['a'] | ['a'] | Passed |
| unmounted-event-delivery scenario 5 | [] | [] | Passed |
| unmounted-event-delivery scenario 6 | [] | [] | Passed |
| last-listener-resource-close scenario 1 | False | False | Passed |
| last-listener-resource-close scenario 2 | True | True | Passed |
| last-listener-resource-close scenario 3 | True | True | Passed |
| last-listener-resource-close scenario 4 | False | False | Passed |
| last-listener-resource-close scenario 5 | False | False | Passed |
| last-listener-resource-close scenario 6 | False | False | Passed |
| registration-topic-index scenario 1 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 2 | [] | [] | Passed |
| registration-topic-index scenario 3 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 4 | ['x'] | ['x'] | Passed |
| registration-topic-index scenario 5 | ['x', 'y'] | ['x', 'y'] | Passed |
| registration-topic-index scenario 6 | ['x'] | ['x'] | Passed |
| unmount-buffer-discard scenario 1 | ['old1'] | ['old1'] | Passed |
| unmount-buffer-discard scenario 2 | [] | [] | Passed |
| unmount-buffer-discard scenario 3 | [] | [] | Passed |
| unmount-buffer-discard scenario 4 | [] | [] | Passed |
| unmount-buffer-discard scenario 5 | ['a', 'b'] | ['a', 'b'] | Passed |
| unmount-buffer-discard scenario 6 | [] | [] | Passed |
| buffered-delivery-order scenario 1 | ['old1', 'x'] | ['old1', 'x'] | Passed |
| buffered-delivery-order scenario 2 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 3 | ['old', 'y'] | ['old', 'y'] | Passed |
| buffered-delivery-order scenario 4 | ['x'] | ['x'] | Passed |
| buffered-delivery-order scenario 5 | ['a', 'b', 'z'] | ['a', 'b', 'z'] | Passed |
| buffered-delivery-order scenario 6 | ['x'] | ['x'] | Passed |
| unknown-unsubscribe-noop scenario 1 | False | False | Passed |
| unknown-unsubscribe-noop scenario 2 | True | True | Passed |
| unknown-unsubscribe-noop scenario 3 | False | False | Passed |
| unknown-unsubscribe-noop scenario 4 | True | True | Passed |
| unknown-unsubscribe-noop scenario 5 | False | False | Passed |
| unknown-unsubscribe-noop scenario 6 | False | False | Passed |
| registration-removal-count scenario 1 | 1 | 1 | Passed |
| registration-removal-count scenario 2 | 0 | 0 | Passed |
| registration-removal-count scenario 3 | 2 | 2 | Passed |
| registration-removal-count scenario 4 | 0 | 0 | Passed |
| registration-removal-count scenario 5 | 1 | 1 | Passed |
| registration-removal-count scenario 6 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 1 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 2 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 3 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 4 | 1 | 1 | Passed |
| remaining-topic-reference-count scenario 5 | 0 | 0 | Passed |
| remaining-topic-reference-count scenario 6 | 1 | 1 | Passed |
SHA-256 / 022e0cc47bdb2bf8d37fe3052c321be8797849fb64de9a5fb88d79d9f97f7fee
Verification & scope
Only the explicitly specified operations and finite deterministic records are modeled; no browser or framework 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:40:52.400879+00:00.
Case digest / 8728cc2e4c3e1c11110e7abb543aa7c8ba14d1e6093c021e8dc4a5936331223d