FA-42665 / Listener lifecycle / Member archive
Merge outer completion discards queued inner subscriptions · case 05
Merge outer completion discards queued inner subscriptions; the returned lifecycle plan violates the stated transition contract.
Case contract
Plan a bounded-concurrency merge observer. Active inner IDs occupy slots, reserved synchronous starts also occupy slots, and pending outer items are FIFO. Fill only free slots; completion removes the matching inner ID. Outer completion waits for active, reserved and pending work. Fail-fast cancels siblings; delay-error retains them and accumulates errors until all work drains. New delayed-error entries are [failing_inner_id,error] records; preserve the supplied done identity instead of storing only the message. 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: slots = max(0,s['limit']-len(s['active'])-s['reserved']); starts = s['pending'][:max(0,s['limit']-len(s['active'])-s['reserved'])]; pending = s['pending'][max(0,s['limit']-len(s['active'])-s['reserved']):]; active = [x for x in s['active'] if x!=s['done']]; finish = s['outer_done'] and not s['active'] and not s['pending'] and s['reserved']==0; cancel_siblings = s['cancel'] or (s['error'] is not None and not s['delay_error']); errors = list(s['errors'])+([[s['done'],s['error']]] if s['error'] is not None else []); report_delayed = s['delay_error'] and bool(s['errors']) and s['outer_done'] and not s['active'] and not s['pending'] and s['reserved']==0; unknown_completion = s['done'] is not None and s['done'] not in s['active']; release_slots = int(s['done'] is not None and s['done'] in s['active'])
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 1 | {"active": [], "cancel_siblings": true, "errors": ["old"], "finish": true, "pending": [], "release_slots": 0, "report_delayed": false, "slots": 14, "starts": [], "unknown_completion": false} | {"active": [], "cancel_siblings": true, "errors": ["old"], "finish": false, "pending": [], "release_slots": 0, "report_delayed": false, "slots": 14, "starts": [], "unknown_completion": false} | 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 ↗