FA-24146 / Client state / Open access
Visibility-aware client polling: Foreground tick admission · case 01
Foreground tick admission.
ROOT CAUSE
The foreground-tick-admission client decision evaluates `online and now>=due` instead of `online and (visible or policy=='background') and not in_flight and now>=due`.
VERIFIED REPAIR
Apply the modeled foreground-tick-admission rule: `online and (visible or policy=='background') and not in_flight and now>=due`.
Unsuccessful approach: The partial repair `visible and online and not in_flight and now>=due` still violates the explicit fixture contract.
Case contract
Only one poll may be in flight. Foreground polling pauses offline or hidden; a background policy permits hidden work. Missed ticks coalesce into one catch-up request and scheduling restarts relative to the current clock. Operation foreground-tick-admission 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):
visible, online, interval, due, now, in_flight, queued, policy = s
if operation == 'foreground-tick-admission':
return online and now>=due
if operation == 'resume-catchup-coalescing':
return int(queued>0)
if operation == 'next-tick-from-now':
return now+interval
if operation == 'remaining-delay-clamp':
return max(0,due-now)
if operation == 'offline-poll-reason':
return 'offline' if not online else ('hidden' if not visible and policy!='background' else None)
if operation == 'inflight-reconnect-dedup':
return online and not in_flight and queued>0
if operation == 'hidden-backlog-cap':
return min(queued,1) if not visible else queued
if operation == 'background-policy-override':
return visible or policy=='background'
if operation == 'timer-install-when-online':
return interval if online and (visible or policy=='background') else None
if operation == 'poll-transition-state':
return 'running' if in_flight else ('waiting' if online and (visible or policy=='background') else 'paused')
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('foreground-tick-admission scenario 1', solve('foreground-tick-admission', (True,True,N+2,5,5,False,3,'foreground')), True)
check('foreground-tick-admission scenario 2', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'foreground')), False)
check('foreground-tick-admission scenario 3', solve('foreground-tick-admission', (True,False,3,5,9,False,1,'foreground')), False)
check('foreground-tick-admission scenario 4', solve('foreground-tick-admission', (True,True,3,5,9,True,0,'foreground')), False)
check('foreground-tick-admission scenario 5', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'background')), True)
check('foreground-tick-admission scenario 6', solve('foreground-tick-admission', (True,True,3,12,9,False,0,'foreground')), False)
check('resume-catchup-coalescing scenario 1', solve('resume-catchup-coalescing', (True,True,N+2,5,5,False,3,'foreground')), 1)
check('resume-catchup-coalescing scenario 2', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'foreground')), 1)
check('resume-catchup-coalescing scenario 3', solve('resume-catchup-coalescing', (True,False,3,5,9,False,1,'foreground')), 1)
check('resume-catchup-coalescing scenario 4', solve('resume-catchup-coalescing', (True,True,3,5,9,True,0,'foreground')), 0)
check('resume-catchup-coalescing scenario 5', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'background')), 1)
check('resume-catchup-coalescing scenario 6', solve('resume-catchup-coalescing', (True,True,3,12,9,False,0,'foreground')), 0)
check('next-tick-from-now scenario 1', solve('next-tick-from-now', (True,True,N+2,5,5,False,3,'foreground')), N+7)
check('next-tick-from-now scenario 2', solve('next-tick-from-now', (False,True,3,5,9,False,2,'foreground')), 12)
check('next-tick-from-now scenario 3', solve('next-tick-from-now', (True,False,3,5,9,False,1,'foreground')), 12)
check('next-tick-from-now scenario 4', solve('next-tick-from-now', (True,True,3,5,9,True,0,'foreground')), 12)
check('next-tick-from-now scenario 5', solve('next-tick-from-now', (False,True,3,5,9,False,2,'background')), 12)
check('next-tick-from-now scenario 6', solve('next-tick-from-now', (True,True,3,12,9,False,0,'foreground')), 12)
check('remaining-delay-clamp scenario 1', solve('remaining-delay-clamp', (True,True,N+2,5,5,False,3,'foreground')), 0)
check('remaining-delay-clamp scenario 2', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'foreground')), 0)
check('remaining-delay-clamp scenario 3', solve('remaining-delay-clamp', (True,False,3,5,9,False,1,'foreground')), 0)
check('remaining-delay-clamp scenario 4', solve('remaining-delay-clamp', (True,True,3,5,9,True,0,'foreground')), 0)
check('remaining-delay-clamp scenario 5', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'background')), 0)
check('remaining-delay-clamp scenario 6', solve('remaining-delay-clamp', (True,True,3,12,9,False,0,'foreground')), 3)
check('offline-poll-reason scenario 1', solve('offline-poll-reason', (True,True,N+2,5,5,False,3,'foreground')), None)
check('offline-poll-reason scenario 2', solve('offline-poll-reason', (False,True,3,5,9,False,2,'foreground')), 'hidden')
check('offline-poll-reason scenario 3', solve('offline-poll-reason', (True,False,3,5,9,False,1,'foreground')), 'offline')
check('offline-poll-reason scenario 4', solve('offline-poll-reason', (True,True,3,5,9,True,0,'foreground')), None)
check('offline-poll-reason scenario 5', solve('offline-poll-reason', (False,True,3,5,9,False,2,'background')), None)
check('offline-poll-reason scenario 6', solve('offline-poll-reason', (True,True,3,12,9,False,0,'foreground')), None)
check('inflight-reconnect-dedup scenario 1', solve('inflight-reconnect-dedup', (True,True,N+2,5,5,False,3,'foreground')), True)
check('inflight-reconnect-dedup scenario 2', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'foreground')), True)
check('inflight-reconnect-dedup scenario 3', solve('inflight-reconnect-dedup', (True,False,3,5,9,False,1,'foreground')), False)
check('inflight-reconnect-dedup scenario 4', solve('inflight-reconnect-dedup', (True,True,3,5,9,True,0,'foreground')), False)
check('inflight-reconnect-dedup scenario 5', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'background')), True)
check('inflight-reconnect-dedup scenario 6', solve('inflight-reconnect-dedup', (True,True,3,12,9,False,0,'foreground')), False)
check('hidden-backlog-cap scenario 1', solve('hidden-backlog-cap', (True,True,N+2,5,5,False,3,'foreground')), 3)
check('hidden-backlog-cap scenario 2', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'foreground')), 1)
check('hidden-backlog-cap scenario 3', solve('hidden-backlog-cap', (True,False,3,5,9,False,1,'foreground')), 1)
check('hidden-backlog-cap scenario 4', solve('hidden-backlog-cap', (True,True,3,5,9,True,0,'foreground')), 0)
check('hidden-backlog-cap scenario 5', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'background')), 1)
check('hidden-backlog-cap scenario 6', solve('hidden-backlog-cap', (True,True,3,12,9,False,0,'foreground')), 0)
check('background-policy-override scenario 1', solve('background-policy-override', (True,True,N+2,5,5,False,3,'foreground')), True)
check('background-policy-override scenario 2', solve('background-policy-override', (False,True,3,5,9,False,2,'foreground')), False)
check('background-policy-override scenario 3', solve('background-policy-override', (True,False,3,5,9,False,1,'foreground')), True)
check('background-policy-override scenario 4', solve('background-policy-override', (True,True,3,5,9,True,0,'foreground')), True)
check('background-policy-override scenario 5', solve('background-policy-override', (False,True,3,5,9,False,2,'background')), True)
check('background-policy-override scenario 6', solve('background-policy-override', (True,True,3,12,9,False,0,'foreground')), True)
check('timer-install-when-online scenario 1', solve('timer-install-when-online', (True,True,N+2,5,5,False,3,'foreground')), N+2)
check('timer-install-when-online scenario 2', solve('timer-install-when-online', (False,True,3,5,9,False,2,'foreground')), None)
check('timer-install-when-online scenario 3', solve('timer-install-when-online', (True,False,3,5,9,False,1,'foreground')), None)
check('timer-install-when-online scenario 4', solve('timer-install-when-online', (True,True,3,5,9,True,0,'foreground')), 3)
check('timer-install-when-online scenario 5', solve('timer-install-when-online', (False,True,3,5,9,False,2,'background')), 3)
check('timer-install-when-online scenario 6', solve('timer-install-when-online', (True,True,3,12,9,False,0,'foreground')), 3)
check('poll-transition-state scenario 1', solve('poll-transition-state', (True,True,N+2,5,5,False,3,'foreground')), 'waiting')
check('poll-transition-state scenario 2', solve('poll-transition-state', (False,True,3,5,9,False,2,'foreground')), 'paused')
check('poll-transition-state scenario 3', solve('poll-transition-state', (True,False,3,5,9,False,1,'foreground')), 'paused')
check('poll-transition-state scenario 4', solve('poll-transition-state', (True,True,3,5,9,True,0,'foreground')), 'running')
check('poll-transition-state scenario 5', solve('poll-transition-state', (False,True,3,5,9,False,2,'background')), 'waiting')
check('poll-transition-state scenario 6', solve('poll-transition-state', (True,True,3,12,9,False,0,'foreground')), 'waiting')
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 |
|---|---|---|---|
| foreground-tick-admission scenario 1 | True | True | Passed |
| foreground-tick-admission scenario 2 | True | False | Failed |
| foreground-tick-admission scenario 3 | False | False | Passed |
| foreground-tick-admission scenario 4 | True | False | Failed |
| foreground-tick-admission scenario 5 | True | True | Passed |
| foreground-tick-admission scenario 6 | False | False | Passed |
| resume-catchup-coalescing scenario 1 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 2 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 3 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 4 | 0 | 0 | Passed |
| resume-catchup-coalescing scenario 5 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 6 | 0 | 0 | Passed |
| next-tick-from-now scenario 1 | 8 | 8 | Passed |
| next-tick-from-now scenario 2 | 12 | 12 | Passed |
| next-tick-from-now scenario 3 | 12 | 12 | Passed |
| next-tick-from-now scenario 4 | 12 | 12 | Passed |
| next-tick-from-now scenario 5 | 12 | 12 | Passed |
| next-tick-from-now scenario 6 | 12 | 12 | Passed |
| remaining-delay-clamp scenario 1 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 2 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 3 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 4 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 5 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 6 | 3 | 3 | Passed |
| offline-poll-reason scenario 1 | None | None | Passed |
| offline-poll-reason scenario 2 | hidden | hidden | Passed |
| offline-poll-reason scenario 3 | offline | offline | Passed |
| offline-poll-reason scenario 4 | None | None | Passed |
| offline-poll-reason scenario 5 | None | None | Passed |
| offline-poll-reason scenario 6 | None | None | Passed |
| inflight-reconnect-dedup scenario 1 | True | True | Passed |
| inflight-reconnect-dedup scenario 2 | True | True | Passed |
| inflight-reconnect-dedup scenario 3 | False | False | Passed |
| inflight-reconnect-dedup scenario 4 | False | False | Passed |
| inflight-reconnect-dedup scenario 5 | True | True | Passed |
| inflight-reconnect-dedup scenario 6 | False | False | Passed |
| hidden-backlog-cap scenario 1 | 3 | 3 | Passed |
| hidden-backlog-cap scenario 2 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 3 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 4 | 0 | 0 | Passed |
| hidden-backlog-cap scenario 5 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 6 | 0 | 0 | Passed |
| background-policy-override scenario 1 | True | True | Passed |
| background-policy-override scenario 2 | False | False | Passed |
| background-policy-override scenario 3 | True | True | Passed |
| background-policy-override scenario 4 | True | True | Passed |
| background-policy-override scenario 5 | True | True | Passed |
| background-policy-override scenario 6 | True | True | Passed |
| timer-install-when-online scenario 1 | 3 | 3 | Passed |
| timer-install-when-online scenario 2 | None | None | Passed |
| timer-install-when-online scenario 3 | None | None | Passed |
| timer-install-when-online scenario 4 | 3 | 3 | Passed |
| timer-install-when-online scenario 5 | 3 | 3 | Passed |
| timer-install-when-online scenario 6 | 3 | 3 | Passed |
| poll-transition-state scenario 1 | waiting | waiting | Passed |
| poll-transition-state scenario 2 | paused | paused | Passed |
| poll-transition-state scenario 3 | paused | paused | Passed |
| poll-transition-state scenario 4 | running | running | Passed |
| poll-transition-state scenario 5 | waiting | waiting | Passed |
| poll-transition-state scenario 6 | waiting | waiting | Passed |
SHA-256 / baf8fc54443f0d024cdfb793849307351a4bb352d8bac8df51d9b749cbc925b8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
visible, online, interval, due, now, in_flight, queued, policy = s
if operation == 'foreground-tick-admission':
return visible and online and not in_flight and now>=due
if operation == 'resume-catchup-coalescing':
return int(queued>0)
if operation == 'next-tick-from-now':
return now+interval
if operation == 'remaining-delay-clamp':
return max(0,due-now)
if operation == 'offline-poll-reason':
return 'offline' if not online else ('hidden' if not visible and policy!='background' else None)
if operation == 'inflight-reconnect-dedup':
return online and not in_flight and queued>0
if operation == 'hidden-backlog-cap':
return min(queued,1) if not visible else queued
if operation == 'background-policy-override':
return visible or policy=='background'
if operation == 'timer-install-when-online':
return interval if online and (visible or policy=='background') else None
if operation == 'poll-transition-state':
return 'running' if in_flight else ('waiting' if online and (visible or policy=='background') else 'paused')
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('foreground-tick-admission scenario 1', solve('foreground-tick-admission', (True,True,N+2,5,5,False,3,'foreground')), True)
check('foreground-tick-admission scenario 2', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'foreground')), False)
check('foreground-tick-admission scenario 3', solve('foreground-tick-admission', (True,False,3,5,9,False,1,'foreground')), False)
check('foreground-tick-admission scenario 4', solve('foreground-tick-admission', (True,True,3,5,9,True,0,'foreground')), False)
check('foreground-tick-admission scenario 5', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'background')), True)
check('foreground-tick-admission scenario 6', solve('foreground-tick-admission', (True,True,3,12,9,False,0,'foreground')), False)
check('resume-catchup-coalescing scenario 1', solve('resume-catchup-coalescing', (True,True,N+2,5,5,False,3,'foreground')), 1)
check('resume-catchup-coalescing scenario 2', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'foreground')), 1)
check('resume-catchup-coalescing scenario 3', solve('resume-catchup-coalescing', (True,False,3,5,9,False,1,'foreground')), 1)
check('resume-catchup-coalescing scenario 4', solve('resume-catchup-coalescing', (True,True,3,5,9,True,0,'foreground')), 0)
check('resume-catchup-coalescing scenario 5', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'background')), 1)
check('resume-catchup-coalescing scenario 6', solve('resume-catchup-coalescing', (True,True,3,12,9,False,0,'foreground')), 0)
check('next-tick-from-now scenario 1', solve('next-tick-from-now', (True,True,N+2,5,5,False,3,'foreground')), N+7)
check('next-tick-from-now scenario 2', solve('next-tick-from-now', (False,True,3,5,9,False,2,'foreground')), 12)
check('next-tick-from-now scenario 3', solve('next-tick-from-now', (True,False,3,5,9,False,1,'foreground')), 12)
check('next-tick-from-now scenario 4', solve('next-tick-from-now', (True,True,3,5,9,True,0,'foreground')), 12)
check('next-tick-from-now scenario 5', solve('next-tick-from-now', (False,True,3,5,9,False,2,'background')), 12)
check('next-tick-from-now scenario 6', solve('next-tick-from-now', (True,True,3,12,9,False,0,'foreground')), 12)
check('remaining-delay-clamp scenario 1', solve('remaining-delay-clamp', (True,True,N+2,5,5,False,3,'foreground')), 0)
check('remaining-delay-clamp scenario 2', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'foreground')), 0)
check('remaining-delay-clamp scenario 3', solve('remaining-delay-clamp', (True,False,3,5,9,False,1,'foreground')), 0)
check('remaining-delay-clamp scenario 4', solve('remaining-delay-clamp', (True,True,3,5,9,True,0,'foreground')), 0)
check('remaining-delay-clamp scenario 5', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'background')), 0)
check('remaining-delay-clamp scenario 6', solve('remaining-delay-clamp', (True,True,3,12,9,False,0,'foreground')), 3)
check('offline-poll-reason scenario 1', solve('offline-poll-reason', (True,True,N+2,5,5,False,3,'foreground')), None)
check('offline-poll-reason scenario 2', solve('offline-poll-reason', (False,True,3,5,9,False,2,'foreground')), 'hidden')
check('offline-poll-reason scenario 3', solve('offline-poll-reason', (True,False,3,5,9,False,1,'foreground')), 'offline')
check('offline-poll-reason scenario 4', solve('offline-poll-reason', (True,True,3,5,9,True,0,'foreground')), None)
check('offline-poll-reason scenario 5', solve('offline-poll-reason', (False,True,3,5,9,False,2,'background')), None)
check('offline-poll-reason scenario 6', solve('offline-poll-reason', (True,True,3,12,9,False,0,'foreground')), None)
check('inflight-reconnect-dedup scenario 1', solve('inflight-reconnect-dedup', (True,True,N+2,5,5,False,3,'foreground')), True)
check('inflight-reconnect-dedup scenario 2', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'foreground')), True)
check('inflight-reconnect-dedup scenario 3', solve('inflight-reconnect-dedup', (True,False,3,5,9,False,1,'foreground')), False)
check('inflight-reconnect-dedup scenario 4', solve('inflight-reconnect-dedup', (True,True,3,5,9,True,0,'foreground')), False)
check('inflight-reconnect-dedup scenario 5', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'background')), True)
check('inflight-reconnect-dedup scenario 6', solve('inflight-reconnect-dedup', (True,True,3,12,9,False,0,'foreground')), False)
check('hidden-backlog-cap scenario 1', solve('hidden-backlog-cap', (True,True,N+2,5,5,False,3,'foreground')), 3)
check('hidden-backlog-cap scenario 2', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'foreground')), 1)
check('hidden-backlog-cap scenario 3', solve('hidden-backlog-cap', (True,False,3,5,9,False,1,'foreground')), 1)
check('hidden-backlog-cap scenario 4', solve('hidden-backlog-cap', (True,True,3,5,9,True,0,'foreground')), 0)
check('hidden-backlog-cap scenario 5', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'background')), 1)
check('hidden-backlog-cap scenario 6', solve('hidden-backlog-cap', (True,True,3,12,9,False,0,'foreground')), 0)
check('background-policy-override scenario 1', solve('background-policy-override', (True,True,N+2,5,5,False,3,'foreground')), True)
check('background-policy-override scenario 2', solve('background-policy-override', (False,True,3,5,9,False,2,'foreground')), False)
check('background-policy-override scenario 3', solve('background-policy-override', (True,False,3,5,9,False,1,'foreground')), True)
check('background-policy-override scenario 4', solve('background-policy-override', (True,True,3,5,9,True,0,'foreground')), True)
check('background-policy-override scenario 5', solve('background-policy-override', (False,True,3,5,9,False,2,'background')), True)
check('background-policy-override scenario 6', solve('background-policy-override', (True,True,3,12,9,False,0,'foreground')), True)
check('timer-install-when-online scenario 1', solve('timer-install-when-online', (True,True,N+2,5,5,False,3,'foreground')), N+2)
check('timer-install-when-online scenario 2', solve('timer-install-when-online', (False,True,3,5,9,False,2,'foreground')), None)
check('timer-install-when-online scenario 3', solve('timer-install-when-online', (True,False,3,5,9,False,1,'foreground')), None)
check('timer-install-when-online scenario 4', solve('timer-install-when-online', (True,True,3,5,9,True,0,'foreground')), 3)
check('timer-install-when-online scenario 5', solve('timer-install-when-online', (False,True,3,5,9,False,2,'background')), 3)
check('timer-install-when-online scenario 6', solve('timer-install-when-online', (True,True,3,12,9,False,0,'foreground')), 3)
check('poll-transition-state scenario 1', solve('poll-transition-state', (True,True,N+2,5,5,False,3,'foreground')), 'waiting')
check('poll-transition-state scenario 2', solve('poll-transition-state', (False,True,3,5,9,False,2,'foreground')), 'paused')
check('poll-transition-state scenario 3', solve('poll-transition-state', (True,False,3,5,9,False,1,'foreground')), 'paused')
check('poll-transition-state scenario 4', solve('poll-transition-state', (True,True,3,5,9,True,0,'foreground')), 'running')
check('poll-transition-state scenario 5', solve('poll-transition-state', (False,True,3,5,9,False,2,'background')), 'waiting')
check('poll-transition-state scenario 6', solve('poll-transition-state', (True,True,3,12,9,False,0,'foreground')), 'waiting')
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 |
|---|---|---|---|
| foreground-tick-admission scenario 1 | True | True | Passed |
| foreground-tick-admission scenario 2 | False | False | Passed |
| foreground-tick-admission scenario 3 | False | False | Passed |
| foreground-tick-admission scenario 4 | False | False | Passed |
| foreground-tick-admission scenario 5 | False | True | Failed |
| foreground-tick-admission scenario 6 | False | False | Passed |
| resume-catchup-coalescing scenario 1 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 2 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 3 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 4 | 0 | 0 | Passed |
| resume-catchup-coalescing scenario 5 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 6 | 0 | 0 | Passed |
| next-tick-from-now scenario 1 | 8 | 8 | Passed |
| next-tick-from-now scenario 2 | 12 | 12 | Passed |
| next-tick-from-now scenario 3 | 12 | 12 | Passed |
| next-tick-from-now scenario 4 | 12 | 12 | Passed |
| next-tick-from-now scenario 5 | 12 | 12 | Passed |
| next-tick-from-now scenario 6 | 12 | 12 | Passed |
| remaining-delay-clamp scenario 1 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 2 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 3 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 4 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 5 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 6 | 3 | 3 | Passed |
| offline-poll-reason scenario 1 | None | None | Passed |
| offline-poll-reason scenario 2 | hidden | hidden | Passed |
| offline-poll-reason scenario 3 | offline | offline | Passed |
| offline-poll-reason scenario 4 | None | None | Passed |
| offline-poll-reason scenario 5 | None | None | Passed |
| offline-poll-reason scenario 6 | None | None | Passed |
| inflight-reconnect-dedup scenario 1 | True | True | Passed |
| inflight-reconnect-dedup scenario 2 | True | True | Passed |
| inflight-reconnect-dedup scenario 3 | False | False | Passed |
| inflight-reconnect-dedup scenario 4 | False | False | Passed |
| inflight-reconnect-dedup scenario 5 | True | True | Passed |
| inflight-reconnect-dedup scenario 6 | False | False | Passed |
| hidden-backlog-cap scenario 1 | 3 | 3 | Passed |
| hidden-backlog-cap scenario 2 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 3 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 4 | 0 | 0 | Passed |
| hidden-backlog-cap scenario 5 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 6 | 0 | 0 | Passed |
| background-policy-override scenario 1 | True | True | Passed |
| background-policy-override scenario 2 | False | False | Passed |
| background-policy-override scenario 3 | True | True | Passed |
| background-policy-override scenario 4 | True | True | Passed |
| background-policy-override scenario 5 | True | True | Passed |
| background-policy-override scenario 6 | True | True | Passed |
| timer-install-when-online scenario 1 | 3 | 3 | Passed |
| timer-install-when-online scenario 2 | None | None | Passed |
| timer-install-when-online scenario 3 | None | None | Passed |
| timer-install-when-online scenario 4 | 3 | 3 | Passed |
| timer-install-when-online scenario 5 | 3 | 3 | Passed |
| timer-install-when-online scenario 6 | 3 | 3 | Passed |
| poll-transition-state scenario 1 | waiting | waiting | Passed |
| poll-transition-state scenario 2 | paused | paused | Passed |
| poll-transition-state scenario 3 | paused | paused | Passed |
| poll-transition-state scenario 4 | running | running | Passed |
| poll-transition-state scenario 5 | waiting | waiting | Passed |
| poll-transition-state scenario 6 | waiting | waiting | Passed |
SHA-256 / db43c521b2f74d69962bde1cccfa4a9218a544cdc3a83fa4c614524f874e4a8d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
visible, online, interval, due, now, in_flight, queued, policy = s
if operation == 'foreground-tick-admission':
return online and (visible or policy=='background') and not in_flight and now>=due
if operation == 'resume-catchup-coalescing':
return int(queued>0)
if operation == 'next-tick-from-now':
return now+interval
if operation == 'remaining-delay-clamp':
return max(0,due-now)
if operation == 'offline-poll-reason':
return 'offline' if not online else ('hidden' if not visible and policy!='background' else None)
if operation == 'inflight-reconnect-dedup':
return online and not in_flight and queued>0
if operation == 'hidden-backlog-cap':
return min(queued,1) if not visible else queued
if operation == 'background-policy-override':
return visible or policy=='background'
if operation == 'timer-install-when-online':
return interval if online and (visible or policy=='background') else None
if operation == 'poll-transition-state':
return 'running' if in_flight else ('waiting' if online and (visible or policy=='background') else 'paused')
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('foreground-tick-admission scenario 1', solve('foreground-tick-admission', (True,True,N+2,5,5,False,3,'foreground')), True)
check('foreground-tick-admission scenario 2', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'foreground')), False)
check('foreground-tick-admission scenario 3', solve('foreground-tick-admission', (True,False,3,5,9,False,1,'foreground')), False)
check('foreground-tick-admission scenario 4', solve('foreground-tick-admission', (True,True,3,5,9,True,0,'foreground')), False)
check('foreground-tick-admission scenario 5', solve('foreground-tick-admission', (False,True,3,5,9,False,2,'background')), True)
check('foreground-tick-admission scenario 6', solve('foreground-tick-admission', (True,True,3,12,9,False,0,'foreground')), False)
check('resume-catchup-coalescing scenario 1', solve('resume-catchup-coalescing', (True,True,N+2,5,5,False,3,'foreground')), 1)
check('resume-catchup-coalescing scenario 2', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'foreground')), 1)
check('resume-catchup-coalescing scenario 3', solve('resume-catchup-coalescing', (True,False,3,5,9,False,1,'foreground')), 1)
check('resume-catchup-coalescing scenario 4', solve('resume-catchup-coalescing', (True,True,3,5,9,True,0,'foreground')), 0)
check('resume-catchup-coalescing scenario 5', solve('resume-catchup-coalescing', (False,True,3,5,9,False,2,'background')), 1)
check('resume-catchup-coalescing scenario 6', solve('resume-catchup-coalescing', (True,True,3,12,9,False,0,'foreground')), 0)
check('next-tick-from-now scenario 1', solve('next-tick-from-now', (True,True,N+2,5,5,False,3,'foreground')), N+7)
check('next-tick-from-now scenario 2', solve('next-tick-from-now', (False,True,3,5,9,False,2,'foreground')), 12)
check('next-tick-from-now scenario 3', solve('next-tick-from-now', (True,False,3,5,9,False,1,'foreground')), 12)
check('next-tick-from-now scenario 4', solve('next-tick-from-now', (True,True,3,5,9,True,0,'foreground')), 12)
check('next-tick-from-now scenario 5', solve('next-tick-from-now', (False,True,3,5,9,False,2,'background')), 12)
check('next-tick-from-now scenario 6', solve('next-tick-from-now', (True,True,3,12,9,False,0,'foreground')), 12)
check('remaining-delay-clamp scenario 1', solve('remaining-delay-clamp', (True,True,N+2,5,5,False,3,'foreground')), 0)
check('remaining-delay-clamp scenario 2', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'foreground')), 0)
check('remaining-delay-clamp scenario 3', solve('remaining-delay-clamp', (True,False,3,5,9,False,1,'foreground')), 0)
check('remaining-delay-clamp scenario 4', solve('remaining-delay-clamp', (True,True,3,5,9,True,0,'foreground')), 0)
check('remaining-delay-clamp scenario 5', solve('remaining-delay-clamp', (False,True,3,5,9,False,2,'background')), 0)
check('remaining-delay-clamp scenario 6', solve('remaining-delay-clamp', (True,True,3,12,9,False,0,'foreground')), 3)
check('offline-poll-reason scenario 1', solve('offline-poll-reason', (True,True,N+2,5,5,False,3,'foreground')), None)
check('offline-poll-reason scenario 2', solve('offline-poll-reason', (False,True,3,5,9,False,2,'foreground')), 'hidden')
check('offline-poll-reason scenario 3', solve('offline-poll-reason', (True,False,3,5,9,False,1,'foreground')), 'offline')
check('offline-poll-reason scenario 4', solve('offline-poll-reason', (True,True,3,5,9,True,0,'foreground')), None)
check('offline-poll-reason scenario 5', solve('offline-poll-reason', (False,True,3,5,9,False,2,'background')), None)
check('offline-poll-reason scenario 6', solve('offline-poll-reason', (True,True,3,12,9,False,0,'foreground')), None)
check('inflight-reconnect-dedup scenario 1', solve('inflight-reconnect-dedup', (True,True,N+2,5,5,False,3,'foreground')), True)
check('inflight-reconnect-dedup scenario 2', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'foreground')), True)
check('inflight-reconnect-dedup scenario 3', solve('inflight-reconnect-dedup', (True,False,3,5,9,False,1,'foreground')), False)
check('inflight-reconnect-dedup scenario 4', solve('inflight-reconnect-dedup', (True,True,3,5,9,True,0,'foreground')), False)
check('inflight-reconnect-dedup scenario 5', solve('inflight-reconnect-dedup', (False,True,3,5,9,False,2,'background')), True)
check('inflight-reconnect-dedup scenario 6', solve('inflight-reconnect-dedup', (True,True,3,12,9,False,0,'foreground')), False)
check('hidden-backlog-cap scenario 1', solve('hidden-backlog-cap', (True,True,N+2,5,5,False,3,'foreground')), 3)
check('hidden-backlog-cap scenario 2', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'foreground')), 1)
check('hidden-backlog-cap scenario 3', solve('hidden-backlog-cap', (True,False,3,5,9,False,1,'foreground')), 1)
check('hidden-backlog-cap scenario 4', solve('hidden-backlog-cap', (True,True,3,5,9,True,0,'foreground')), 0)
check('hidden-backlog-cap scenario 5', solve('hidden-backlog-cap', (False,True,3,5,9,False,2,'background')), 1)
check('hidden-backlog-cap scenario 6', solve('hidden-backlog-cap', (True,True,3,12,9,False,0,'foreground')), 0)
check('background-policy-override scenario 1', solve('background-policy-override', (True,True,N+2,5,5,False,3,'foreground')), True)
check('background-policy-override scenario 2', solve('background-policy-override', (False,True,3,5,9,False,2,'foreground')), False)
check('background-policy-override scenario 3', solve('background-policy-override', (True,False,3,5,9,False,1,'foreground')), True)
check('background-policy-override scenario 4', solve('background-policy-override', (True,True,3,5,9,True,0,'foreground')), True)
check('background-policy-override scenario 5', solve('background-policy-override', (False,True,3,5,9,False,2,'background')), True)
check('background-policy-override scenario 6', solve('background-policy-override', (True,True,3,12,9,False,0,'foreground')), True)
check('timer-install-when-online scenario 1', solve('timer-install-when-online', (True,True,N+2,5,5,False,3,'foreground')), N+2)
check('timer-install-when-online scenario 2', solve('timer-install-when-online', (False,True,3,5,9,False,2,'foreground')), None)
check('timer-install-when-online scenario 3', solve('timer-install-when-online', (True,False,3,5,9,False,1,'foreground')), None)
check('timer-install-when-online scenario 4', solve('timer-install-when-online', (True,True,3,5,9,True,0,'foreground')), 3)
check('timer-install-when-online scenario 5', solve('timer-install-when-online', (False,True,3,5,9,False,2,'background')), 3)
check('timer-install-when-online scenario 6', solve('timer-install-when-online', (True,True,3,12,9,False,0,'foreground')), 3)
check('poll-transition-state scenario 1', solve('poll-transition-state', (True,True,N+2,5,5,False,3,'foreground')), 'waiting')
check('poll-transition-state scenario 2', solve('poll-transition-state', (False,True,3,5,9,False,2,'foreground')), 'paused')
check('poll-transition-state scenario 3', solve('poll-transition-state', (True,False,3,5,9,False,1,'foreground')), 'paused')
check('poll-transition-state scenario 4', solve('poll-transition-state', (True,True,3,5,9,True,0,'foreground')), 'running')
check('poll-transition-state scenario 5', solve('poll-transition-state', (False,True,3,5,9,False,2,'background')), 'waiting')
check('poll-transition-state scenario 6', solve('poll-transition-state', (True,True,3,12,9,False,0,'foreground')), 'waiting')
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 |
|---|---|---|---|
| foreground-tick-admission scenario 1 | True | True | Passed |
| foreground-tick-admission scenario 2 | False | False | Passed |
| foreground-tick-admission scenario 3 | False | False | Passed |
| foreground-tick-admission scenario 4 | False | False | Passed |
| foreground-tick-admission scenario 5 | True | True | Passed |
| foreground-tick-admission scenario 6 | False | False | Passed |
| resume-catchup-coalescing scenario 1 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 2 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 3 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 4 | 0 | 0 | Passed |
| resume-catchup-coalescing scenario 5 | 1 | 1 | Passed |
| resume-catchup-coalescing scenario 6 | 0 | 0 | Passed |
| next-tick-from-now scenario 1 | 8 | 8 | Passed |
| next-tick-from-now scenario 2 | 12 | 12 | Passed |
| next-tick-from-now scenario 3 | 12 | 12 | Passed |
| next-tick-from-now scenario 4 | 12 | 12 | Passed |
| next-tick-from-now scenario 5 | 12 | 12 | Passed |
| next-tick-from-now scenario 6 | 12 | 12 | Passed |
| remaining-delay-clamp scenario 1 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 2 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 3 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 4 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 5 | 0 | 0 | Passed |
| remaining-delay-clamp scenario 6 | 3 | 3 | Passed |
| offline-poll-reason scenario 1 | None | None | Passed |
| offline-poll-reason scenario 2 | hidden | hidden | Passed |
| offline-poll-reason scenario 3 | offline | offline | Passed |
| offline-poll-reason scenario 4 | None | None | Passed |
| offline-poll-reason scenario 5 | None | None | Passed |
| offline-poll-reason scenario 6 | None | None | Passed |
| inflight-reconnect-dedup scenario 1 | True | True | Passed |
| inflight-reconnect-dedup scenario 2 | True | True | Passed |
| inflight-reconnect-dedup scenario 3 | False | False | Passed |
| inflight-reconnect-dedup scenario 4 | False | False | Passed |
| inflight-reconnect-dedup scenario 5 | True | True | Passed |
| inflight-reconnect-dedup scenario 6 | False | False | Passed |
| hidden-backlog-cap scenario 1 | 3 | 3 | Passed |
| hidden-backlog-cap scenario 2 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 3 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 4 | 0 | 0 | Passed |
| hidden-backlog-cap scenario 5 | 1 | 1 | Passed |
| hidden-backlog-cap scenario 6 | 0 | 0 | Passed |
| background-policy-override scenario 1 | True | True | Passed |
| background-policy-override scenario 2 | False | False | Passed |
| background-policy-override scenario 3 | True | True | Passed |
| background-policy-override scenario 4 | True | True | Passed |
| background-policy-override scenario 5 | True | True | Passed |
| background-policy-override scenario 6 | True | True | Passed |
| timer-install-when-online scenario 1 | 3 | 3 | Passed |
| timer-install-when-online scenario 2 | None | None | Passed |
| timer-install-when-online scenario 3 | None | None | Passed |
| timer-install-when-online scenario 4 | 3 | 3 | Passed |
| timer-install-when-online scenario 5 | 3 | 3 | Passed |
| timer-install-when-online scenario 6 | 3 | 3 | Passed |
| poll-transition-state scenario 1 | waiting | waiting | Passed |
| poll-transition-state scenario 2 | paused | paused | Passed |
| poll-transition-state scenario 3 | paused | paused | Passed |
| poll-transition-state scenario 4 | running | running | Passed |
| poll-transition-state scenario 5 | waiting | waiting | Passed |
| poll-transition-state scenario 6 | waiting | waiting | Passed |
SHA-256 / ba9d5f3d70d9da61e2b87133d4b4679650e5176bf30106c112706a2cc6175fe2
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:54.486158+00:00.
Case digest / 7b12825ce872ba9e090b3c1ce7be800562d5eca0cf321709de085b79f5fca5de