FA-41398 / Listener lifecycle / Member archive
Scope exit claims ownership of borrowed listeners · case 03
Scope exit claims ownership of borrowed listeners; the returned lifecycle plan violates the stated transition contract.
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.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| transition 0 | {"adoption": false, "borrowed": [], "closed": "closed", "continue": 3, "errors": ["first", "second"], "order": ["c", "a"], "parent_refs": 6, "parent_release": [["p", "sibling"], ["q", "other"]], "pending": 0, "remaining": 2} | {"adoption": false, "borrowed": ["b"], "closed": "closed", "continue": 3, "errors": ["first", "second"], "order": ["c", "a"], "parent_refs": 6, "parent_release": [["p", "sibling"], ["q", "other"]], "pending": 0, "remaining": 2} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗