FA-23736 / Client state / Open access
Per-history-entry scroll restoration: Layout ready deferral · case 01
Layout ready deferral.
ROOT CAUSE
The layout-ready-deferral client decision evaluates `positions.get(entry,0)` instead of `positions.get(entry,0) if ready else None`.
VERIFIED REPAIR
Apply the modeled layout-ready-deferral rule: `positions.get(entry,0) if ready else None`.
Unsuccessful approach: The partial repair `positions.get(entry,0) if ready and positions else None` still violates the explicit fixture contract.
Case contract
Scroll state belongs to a history entry, not its repeated URL. Pop restores after layout, pushes start at top, explicit anchors including the empty anchor take precedence, and positions clamp to the scrollable extent. Operation layout-ready-deferral 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):
positions, entry, path, event, ready, anchor, height, viewport = s
if operation == 'entry-key-lookup':
return positions.get(entry,0)
if operation == 'push-resets-position':
return positions.get(entry,0) if event=='pop' else 0
if operation == 'layout-ready-deferral':
return positions.get(entry,0)
if operation == 'clamp-restored-position':
return min(max(0,positions.get(entry,0)),max(0,height-viewport))
if operation == 'anchor-precedes-saved-position':
return anchor if anchor is not None else positions.get(entry,0)
if operation == 'missing-entry-detection':
return entry not in positions
if operation == 'restoration-mode':
return 'manual' if event=='pop' else 'auto'
if operation == 'saved-position-prune':
return {k:v for k,v in positions.items() if k!=entry}
if operation == 'anchor-layout-gate':
return anchor if ready and anchor is not None else None
if operation == 'restore-command':
return 'wait' if not ready else ('anchor' if anchor is not None else ('saved' if event=='pop' else 'top'))
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('entry-key-lookup scenario 1', solve('entry-key-lookup', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('entry-key-lookup scenario 2', solve('entry-key-lookup', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('entry-key-lookup scenario 3', solve('entry-key-lookup', ({},'e2','/a','pop',True,None,10,20)), 0)
check('entry-key-lookup scenario 4', solve('entry-key-lookup', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('entry-key-lookup scenario 5', solve('entry-key-lookup', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('entry-key-lookup scenario 6', solve('entry-key-lookup', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('push-resets-position scenario 1', solve('push-resets-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('push-resets-position scenario 2', solve('push-resets-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('push-resets-position scenario 3', solve('push-resets-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('push-resets-position scenario 4', solve('push-resets-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('push-resets-position scenario 5', solve('push-resets-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('push-resets-position scenario 6', solve('push-resets-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('layout-ready-deferral scenario 1', solve('layout-ready-deferral', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('layout-ready-deferral scenario 2', solve('layout-ready-deferral', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('layout-ready-deferral scenario 3', solve('layout-ready-deferral', ({},'e2','/a','pop',True,None,10,20)), 0)
check('layout-ready-deferral scenario 4', solve('layout-ready-deferral', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('layout-ready-deferral scenario 5', solve('layout-ready-deferral', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('layout-ready-deferral scenario 6', solve('layout-ready-deferral', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('clamp-restored-position scenario 1', solve('clamp-restored-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('clamp-restored-position scenario 2', solve('clamp-restored-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('clamp-restored-position scenario 3', solve('clamp-restored-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('clamp-restored-position scenario 4', solve('clamp-restored-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 80)
check('clamp-restored-position scenario 5', solve('clamp-restored-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('clamp-restored-position scenario 6', solve('clamp-restored-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('anchor-precedes-saved-position scenario 1', solve('anchor-precedes-saved-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('anchor-precedes-saved-position scenario 2', solve('anchor-precedes-saved-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-precedes-saved-position scenario 3', solve('anchor-precedes-saved-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('anchor-precedes-saved-position scenario 4', solve('anchor-precedes-saved-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('anchor-precedes-saved-position scenario 5', solve('anchor-precedes-saved-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-precedes-saved-position scenario 6', solve('anchor-precedes-saved-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('missing-entry-detection scenario 1', solve('missing-entry-detection', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), False)
check('missing-entry-detection scenario 2', solve('missing-entry-detection', ({'e1':0},'e1','/a','push',True,'section',100,20)), False)
check('missing-entry-detection scenario 3', solve('missing-entry-detection', ({},'e2','/a','pop',True,None,10,20)), True)
check('missing-entry-detection scenario 4', solve('missing-entry-detection', ({'e1':90},'e1','/a','pop',False,None,100,20)), False)
check('missing-entry-detection scenario 5', solve('missing-entry-detection', ({'e1':-5},'e1','/b','replace',True,'',100,20)), False)
check('missing-entry-detection scenario 6', solve('missing-entry-detection', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), False)
check('restoration-mode scenario 1', solve('restoration-mode', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'manual')
check('restoration-mode scenario 2', solve('restoration-mode', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'auto')
check('restoration-mode scenario 3', solve('restoration-mode', ({},'e2','/a','pop',True,None,10,20)), 'manual')
check('restoration-mode scenario 4', solve('restoration-mode', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'manual')
check('restoration-mode scenario 5', solve('restoration-mode', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'auto')
check('restoration-mode scenario 6', solve('restoration-mode', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'manual')
check('saved-position-prune scenario 1', solve('saved-position-prune', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), {'e2':50})
check('saved-position-prune scenario 2', solve('saved-position-prune', ({'e1':0},'e1','/a','push',True,'section',100,20)), {})
check('saved-position-prune scenario 3', solve('saved-position-prune', ({},'e2','/a','pop',True,None,10,20)), {})
check('saved-position-prune scenario 4', solve('saved-position-prune', ({'e1':90},'e1','/a','pop',False,None,100,20)), {})
check('saved-position-prune scenario 5', solve('saved-position-prune', ({'e1':-5},'e1','/b','replace',True,'',100,20)), {})
check('saved-position-prune scenario 6', solve('saved-position-prune', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), {'/a':70})
check('anchor-layout-gate scenario 1', solve('anchor-layout-gate', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), None)
check('anchor-layout-gate scenario 2', solve('anchor-layout-gate', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-layout-gate scenario 3', solve('anchor-layout-gate', ({},'e2','/a','pop',True,None,10,20)), None)
check('anchor-layout-gate scenario 4', solve('anchor-layout-gate', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('anchor-layout-gate scenario 5', solve('anchor-layout-gate', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-layout-gate scenario 6', solve('anchor-layout-gate', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('restore-command scenario 1', solve('restore-command', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'saved')
check('restore-command scenario 2', solve('restore-command', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'anchor')
check('restore-command scenario 3', solve('restore-command', ({},'e2','/a','pop',True,None,10,20)), 'saved')
check('restore-command scenario 4', solve('restore-command', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'wait')
check('restore-command scenario 5', solve('restore-command', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'anchor')
check('restore-command scenario 6', solve('restore-command', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'anchor')
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 |
|---|---|---|---|
| entry-key-lookup scenario 1 | 10 | 10 | Passed |
| entry-key-lookup scenario 2 | 0 | 0 | Passed |
| entry-key-lookup scenario 3 | 0 | 0 | Passed |
| entry-key-lookup scenario 4 | 90 | 90 | Passed |
| entry-key-lookup scenario 5 | -5 | -5 | Passed |
| entry-key-lookup scenario 6 | 15 | 15 | Passed |
| push-resets-position scenario 1 | 10 | 10 | Passed |
| push-resets-position scenario 2 | 0 | 0 | Passed |
| push-resets-position scenario 3 | 0 | 0 | Passed |
| push-resets-position scenario 4 | 90 | 90 | Passed |
| push-resets-position scenario 5 | 0 | 0 | Passed |
| push-resets-position scenario 6 | 15 | 15 | Passed |
| layout-ready-deferral scenario 1 | 10 | 10 | Passed |
| layout-ready-deferral scenario 2 | 0 | 0 | Passed |
| layout-ready-deferral scenario 3 | 0 | 0 | Passed |
| layout-ready-deferral scenario 4 | 90 | None | Failed |
| layout-ready-deferral scenario 5 | -5 | -5 | Passed |
| layout-ready-deferral scenario 6 | 15 | 15 | Passed |
| clamp-restored-position scenario 1 | 10 | 10 | Passed |
| clamp-restored-position scenario 2 | 0 | 0 | Passed |
| clamp-restored-position scenario 3 | 0 | 0 | Passed |
| clamp-restored-position scenario 4 | 80 | 80 | Passed |
| clamp-restored-position scenario 5 | 0 | 0 | Passed |
| clamp-restored-position scenario 6 | 15 | 15 | Passed |
| anchor-precedes-saved-position scenario 1 | 10 | 10 | Passed |
| anchor-precedes-saved-position scenario 2 | section | section | Passed |
| anchor-precedes-saved-position scenario 3 | 0 | 0 | Passed |
| anchor-precedes-saved-position scenario 4 | 90 | 90 | Passed |
| anchor-precedes-saved-position scenario 5 | | | Passed |
| anchor-precedes-saved-position scenario 6 | section | section | Passed |
| missing-entry-detection scenario 1 | False | False | Passed |
| missing-entry-detection scenario 2 | False | False | Passed |
| missing-entry-detection scenario 3 | True | True | Passed |
| missing-entry-detection scenario 4 | False | False | Passed |
| missing-entry-detection scenario 5 | False | False | Passed |
| missing-entry-detection scenario 6 | False | False | Passed |
| restoration-mode scenario 1 | manual | manual | Passed |
| restoration-mode scenario 2 | auto | auto | Passed |
| restoration-mode scenario 3 | manual | manual | Passed |
| restoration-mode scenario 4 | manual | manual | Passed |
| restoration-mode scenario 5 | auto | auto | Passed |
| restoration-mode scenario 6 | manual | manual | Passed |
| saved-position-prune scenario 1 | {'e2': 50} | {'e2': 50} | Passed |
| saved-position-prune scenario 2 | {} | {} | Passed |
| saved-position-prune scenario 3 | {} | {} | Passed |
| saved-position-prune scenario 4 | {} | {} | Passed |
| saved-position-prune scenario 5 | {} | {} | Passed |
| saved-position-prune scenario 6 | {'/a': 70} | {'/a': 70} | Passed |
| anchor-layout-gate scenario 1 | None | None | Passed |
| anchor-layout-gate scenario 2 | section | section | Passed |
| anchor-layout-gate scenario 3 | None | None | Passed |
| anchor-layout-gate scenario 4 | None | None | Passed |
| anchor-layout-gate scenario 5 | | | Passed |
| anchor-layout-gate scenario 6 | section | section | Passed |
| restore-command scenario 1 | saved | saved | Passed |
| restore-command scenario 2 | anchor | anchor | Passed |
| restore-command scenario 3 | saved | saved | Passed |
| restore-command scenario 4 | wait | wait | Passed |
| restore-command scenario 5 | anchor | anchor | Passed |
| restore-command scenario 6 | anchor | anchor | Passed |
SHA-256 / 7e4445164a375da6afb3944de08743b924899111003041052df2f456d6c810e7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
positions, entry, path, event, ready, anchor, height, viewport = s
if operation == 'entry-key-lookup':
return positions.get(entry,0)
if operation == 'push-resets-position':
return positions.get(entry,0) if event=='pop' else 0
if operation == 'layout-ready-deferral':
return positions.get(entry,0) if ready and positions else None
if operation == 'clamp-restored-position':
return min(max(0,positions.get(entry,0)),max(0,height-viewport))
if operation == 'anchor-precedes-saved-position':
return anchor if anchor is not None else positions.get(entry,0)
if operation == 'missing-entry-detection':
return entry not in positions
if operation == 'restoration-mode':
return 'manual' if event=='pop' else 'auto'
if operation == 'saved-position-prune':
return {k:v for k,v in positions.items() if k!=entry}
if operation == 'anchor-layout-gate':
return anchor if ready and anchor is not None else None
if operation == 'restore-command':
return 'wait' if not ready else ('anchor' if anchor is not None else ('saved' if event=='pop' else 'top'))
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('entry-key-lookup scenario 1', solve('entry-key-lookup', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('entry-key-lookup scenario 2', solve('entry-key-lookup', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('entry-key-lookup scenario 3', solve('entry-key-lookup', ({},'e2','/a','pop',True,None,10,20)), 0)
check('entry-key-lookup scenario 4', solve('entry-key-lookup', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('entry-key-lookup scenario 5', solve('entry-key-lookup', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('entry-key-lookup scenario 6', solve('entry-key-lookup', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('push-resets-position scenario 1', solve('push-resets-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('push-resets-position scenario 2', solve('push-resets-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('push-resets-position scenario 3', solve('push-resets-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('push-resets-position scenario 4', solve('push-resets-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('push-resets-position scenario 5', solve('push-resets-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('push-resets-position scenario 6', solve('push-resets-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('layout-ready-deferral scenario 1', solve('layout-ready-deferral', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('layout-ready-deferral scenario 2', solve('layout-ready-deferral', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('layout-ready-deferral scenario 3', solve('layout-ready-deferral', ({},'e2','/a','pop',True,None,10,20)), 0)
check('layout-ready-deferral scenario 4', solve('layout-ready-deferral', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('layout-ready-deferral scenario 5', solve('layout-ready-deferral', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('layout-ready-deferral scenario 6', solve('layout-ready-deferral', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('clamp-restored-position scenario 1', solve('clamp-restored-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('clamp-restored-position scenario 2', solve('clamp-restored-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('clamp-restored-position scenario 3', solve('clamp-restored-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('clamp-restored-position scenario 4', solve('clamp-restored-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 80)
check('clamp-restored-position scenario 5', solve('clamp-restored-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('clamp-restored-position scenario 6', solve('clamp-restored-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('anchor-precedes-saved-position scenario 1', solve('anchor-precedes-saved-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('anchor-precedes-saved-position scenario 2', solve('anchor-precedes-saved-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-precedes-saved-position scenario 3', solve('anchor-precedes-saved-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('anchor-precedes-saved-position scenario 4', solve('anchor-precedes-saved-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('anchor-precedes-saved-position scenario 5', solve('anchor-precedes-saved-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-precedes-saved-position scenario 6', solve('anchor-precedes-saved-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('missing-entry-detection scenario 1', solve('missing-entry-detection', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), False)
check('missing-entry-detection scenario 2', solve('missing-entry-detection', ({'e1':0},'e1','/a','push',True,'section',100,20)), False)
check('missing-entry-detection scenario 3', solve('missing-entry-detection', ({},'e2','/a','pop',True,None,10,20)), True)
check('missing-entry-detection scenario 4', solve('missing-entry-detection', ({'e1':90},'e1','/a','pop',False,None,100,20)), False)
check('missing-entry-detection scenario 5', solve('missing-entry-detection', ({'e1':-5},'e1','/b','replace',True,'',100,20)), False)
check('missing-entry-detection scenario 6', solve('missing-entry-detection', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), False)
check('restoration-mode scenario 1', solve('restoration-mode', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'manual')
check('restoration-mode scenario 2', solve('restoration-mode', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'auto')
check('restoration-mode scenario 3', solve('restoration-mode', ({},'e2','/a','pop',True,None,10,20)), 'manual')
check('restoration-mode scenario 4', solve('restoration-mode', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'manual')
check('restoration-mode scenario 5', solve('restoration-mode', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'auto')
check('restoration-mode scenario 6', solve('restoration-mode', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'manual')
check('saved-position-prune scenario 1', solve('saved-position-prune', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), {'e2':50})
check('saved-position-prune scenario 2', solve('saved-position-prune', ({'e1':0},'e1','/a','push',True,'section',100,20)), {})
check('saved-position-prune scenario 3', solve('saved-position-prune', ({},'e2','/a','pop',True,None,10,20)), {})
check('saved-position-prune scenario 4', solve('saved-position-prune', ({'e1':90},'e1','/a','pop',False,None,100,20)), {})
check('saved-position-prune scenario 5', solve('saved-position-prune', ({'e1':-5},'e1','/b','replace',True,'',100,20)), {})
check('saved-position-prune scenario 6', solve('saved-position-prune', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), {'/a':70})
check('anchor-layout-gate scenario 1', solve('anchor-layout-gate', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), None)
check('anchor-layout-gate scenario 2', solve('anchor-layout-gate', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-layout-gate scenario 3', solve('anchor-layout-gate', ({},'e2','/a','pop',True,None,10,20)), None)
check('anchor-layout-gate scenario 4', solve('anchor-layout-gate', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('anchor-layout-gate scenario 5', solve('anchor-layout-gate', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-layout-gate scenario 6', solve('anchor-layout-gate', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('restore-command scenario 1', solve('restore-command', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'saved')
check('restore-command scenario 2', solve('restore-command', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'anchor')
check('restore-command scenario 3', solve('restore-command', ({},'e2','/a','pop',True,None,10,20)), 'saved')
check('restore-command scenario 4', solve('restore-command', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'wait')
check('restore-command scenario 5', solve('restore-command', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'anchor')
check('restore-command scenario 6', solve('restore-command', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'anchor')
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 |
|---|---|---|---|
| entry-key-lookup scenario 1 | 10 | 10 | Passed |
| entry-key-lookup scenario 2 | 0 | 0 | Passed |
| entry-key-lookup scenario 3 | 0 | 0 | Passed |
| entry-key-lookup scenario 4 | 90 | 90 | Passed |
| entry-key-lookup scenario 5 | -5 | -5 | Passed |
| entry-key-lookup scenario 6 | 15 | 15 | Passed |
| push-resets-position scenario 1 | 10 | 10 | Passed |
| push-resets-position scenario 2 | 0 | 0 | Passed |
| push-resets-position scenario 3 | 0 | 0 | Passed |
| push-resets-position scenario 4 | 90 | 90 | Passed |
| push-resets-position scenario 5 | 0 | 0 | Passed |
| push-resets-position scenario 6 | 15 | 15 | Passed |
| layout-ready-deferral scenario 1 | 10 | 10 | Passed |
| layout-ready-deferral scenario 2 | 0 | 0 | Passed |
| layout-ready-deferral scenario 3 | None | 0 | Failed |
| layout-ready-deferral scenario 4 | None | None | Passed |
| layout-ready-deferral scenario 5 | -5 | -5 | Passed |
| layout-ready-deferral scenario 6 | 15 | 15 | Passed |
| clamp-restored-position scenario 1 | 10 | 10 | Passed |
| clamp-restored-position scenario 2 | 0 | 0 | Passed |
| clamp-restored-position scenario 3 | 0 | 0 | Passed |
| clamp-restored-position scenario 4 | 80 | 80 | Passed |
| clamp-restored-position scenario 5 | 0 | 0 | Passed |
| clamp-restored-position scenario 6 | 15 | 15 | Passed |
| anchor-precedes-saved-position scenario 1 | 10 | 10 | Passed |
| anchor-precedes-saved-position scenario 2 | section | section | Passed |
| anchor-precedes-saved-position scenario 3 | 0 | 0 | Passed |
| anchor-precedes-saved-position scenario 4 | 90 | 90 | Passed |
| anchor-precedes-saved-position scenario 5 | | | Passed |
| anchor-precedes-saved-position scenario 6 | section | section | Passed |
| missing-entry-detection scenario 1 | False | False | Passed |
| missing-entry-detection scenario 2 | False | False | Passed |
| missing-entry-detection scenario 3 | True | True | Passed |
| missing-entry-detection scenario 4 | False | False | Passed |
| missing-entry-detection scenario 5 | False | False | Passed |
| missing-entry-detection scenario 6 | False | False | Passed |
| restoration-mode scenario 1 | manual | manual | Passed |
| restoration-mode scenario 2 | auto | auto | Passed |
| restoration-mode scenario 3 | manual | manual | Passed |
| restoration-mode scenario 4 | manual | manual | Passed |
| restoration-mode scenario 5 | auto | auto | Passed |
| restoration-mode scenario 6 | manual | manual | Passed |
| saved-position-prune scenario 1 | {'e2': 50} | {'e2': 50} | Passed |
| saved-position-prune scenario 2 | {} | {} | Passed |
| saved-position-prune scenario 3 | {} | {} | Passed |
| saved-position-prune scenario 4 | {} | {} | Passed |
| saved-position-prune scenario 5 | {} | {} | Passed |
| saved-position-prune scenario 6 | {'/a': 70} | {'/a': 70} | Passed |
| anchor-layout-gate scenario 1 | None | None | Passed |
| anchor-layout-gate scenario 2 | section | section | Passed |
| anchor-layout-gate scenario 3 | None | None | Passed |
| anchor-layout-gate scenario 4 | None | None | Passed |
| anchor-layout-gate scenario 5 | | | Passed |
| anchor-layout-gate scenario 6 | section | section | Passed |
| restore-command scenario 1 | saved | saved | Passed |
| restore-command scenario 2 | anchor | anchor | Passed |
| restore-command scenario 3 | saved | saved | Passed |
| restore-command scenario 4 | wait | wait | Passed |
| restore-command scenario 5 | anchor | anchor | Passed |
| restore-command scenario 6 | anchor | anchor | Passed |
SHA-256 / 4ffa036d5446f238b952bde6fccab57d8b74def51cf4636a0019774de5e24761
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, s):
positions, entry, path, event, ready, anchor, height, viewport = s
if operation == 'entry-key-lookup':
return positions.get(entry,0)
if operation == 'push-resets-position':
return positions.get(entry,0) if event=='pop' else 0
if operation == 'layout-ready-deferral':
return positions.get(entry,0) if ready else None
if operation == 'clamp-restored-position':
return min(max(0,positions.get(entry,0)),max(0,height-viewport))
if operation == 'anchor-precedes-saved-position':
return anchor if anchor is not None else positions.get(entry,0)
if operation == 'missing-entry-detection':
return entry not in positions
if operation == 'restoration-mode':
return 'manual' if event=='pop' else 'auto'
if operation == 'saved-position-prune':
return {k:v for k,v in positions.items() if k!=entry}
if operation == 'anchor-layout-gate':
return anchor if ready and anchor is not None else None
if operation == 'restore-command':
return 'wait' if not ready else ('anchor' if anchor is not None else ('saved' if event=='pop' else 'top'))
raise ValueError('unknown modeled operation')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('entry-key-lookup scenario 1', solve('entry-key-lookup', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('entry-key-lookup scenario 2', solve('entry-key-lookup', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('entry-key-lookup scenario 3', solve('entry-key-lookup', ({},'e2','/a','pop',True,None,10,20)), 0)
check('entry-key-lookup scenario 4', solve('entry-key-lookup', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('entry-key-lookup scenario 5', solve('entry-key-lookup', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('entry-key-lookup scenario 6', solve('entry-key-lookup', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('push-resets-position scenario 1', solve('push-resets-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('push-resets-position scenario 2', solve('push-resets-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('push-resets-position scenario 3', solve('push-resets-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('push-resets-position scenario 4', solve('push-resets-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('push-resets-position scenario 5', solve('push-resets-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('push-resets-position scenario 6', solve('push-resets-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('layout-ready-deferral scenario 1', solve('layout-ready-deferral', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('layout-ready-deferral scenario 2', solve('layout-ready-deferral', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('layout-ready-deferral scenario 3', solve('layout-ready-deferral', ({},'e2','/a','pop',True,None,10,20)), 0)
check('layout-ready-deferral scenario 4', solve('layout-ready-deferral', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('layout-ready-deferral scenario 5', solve('layout-ready-deferral', ({'e1':-5},'e1','/b','replace',True,'',100,20)), -5)
check('layout-ready-deferral scenario 6', solve('layout-ready-deferral', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('clamp-restored-position scenario 1', solve('clamp-restored-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('clamp-restored-position scenario 2', solve('clamp-restored-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 0)
check('clamp-restored-position scenario 3', solve('clamp-restored-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('clamp-restored-position scenario 4', solve('clamp-restored-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 80)
check('clamp-restored-position scenario 5', solve('clamp-restored-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 0)
check('clamp-restored-position scenario 6', solve('clamp-restored-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 15)
check('anchor-precedes-saved-position scenario 1', solve('anchor-precedes-saved-position', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), N*10)
check('anchor-precedes-saved-position scenario 2', solve('anchor-precedes-saved-position', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-precedes-saved-position scenario 3', solve('anchor-precedes-saved-position', ({},'e2','/a','pop',True,None,10,20)), 0)
check('anchor-precedes-saved-position scenario 4', solve('anchor-precedes-saved-position', ({'e1':90},'e1','/a','pop',False,None,100,20)), 90)
check('anchor-precedes-saved-position scenario 5', solve('anchor-precedes-saved-position', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-precedes-saved-position scenario 6', solve('anchor-precedes-saved-position', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('missing-entry-detection scenario 1', solve('missing-entry-detection', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), False)
check('missing-entry-detection scenario 2', solve('missing-entry-detection', ({'e1':0},'e1','/a','push',True,'section',100,20)), False)
check('missing-entry-detection scenario 3', solve('missing-entry-detection', ({},'e2','/a','pop',True,None,10,20)), True)
check('missing-entry-detection scenario 4', solve('missing-entry-detection', ({'e1':90},'e1','/a','pop',False,None,100,20)), False)
check('missing-entry-detection scenario 5', solve('missing-entry-detection', ({'e1':-5},'e1','/b','replace',True,'',100,20)), False)
check('missing-entry-detection scenario 6', solve('missing-entry-detection', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), False)
check('restoration-mode scenario 1', solve('restoration-mode', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'manual')
check('restoration-mode scenario 2', solve('restoration-mode', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'auto')
check('restoration-mode scenario 3', solve('restoration-mode', ({},'e2','/a','pop',True,None,10,20)), 'manual')
check('restoration-mode scenario 4', solve('restoration-mode', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'manual')
check('restoration-mode scenario 5', solve('restoration-mode', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'auto')
check('restoration-mode scenario 6', solve('restoration-mode', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'manual')
check('saved-position-prune scenario 1', solve('saved-position-prune', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), {'e2':50})
check('saved-position-prune scenario 2', solve('saved-position-prune', ({'e1':0},'e1','/a','push',True,'section',100,20)), {})
check('saved-position-prune scenario 3', solve('saved-position-prune', ({},'e2','/a','pop',True,None,10,20)), {})
check('saved-position-prune scenario 4', solve('saved-position-prune', ({'e1':90},'e1','/a','pop',False,None,100,20)), {})
check('saved-position-prune scenario 5', solve('saved-position-prune', ({'e1':-5},'e1','/b','replace',True,'',100,20)), {})
check('saved-position-prune scenario 6', solve('saved-position-prune', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), {'/a':70})
check('anchor-layout-gate scenario 1', solve('anchor-layout-gate', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), None)
check('anchor-layout-gate scenario 2', solve('anchor-layout-gate', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'section')
check('anchor-layout-gate scenario 3', solve('anchor-layout-gate', ({},'e2','/a','pop',True,None,10,20)), None)
check('anchor-layout-gate scenario 4', solve('anchor-layout-gate', ({'e1':90},'e1','/a','pop',False,None,100,20)), None)
check('anchor-layout-gate scenario 5', solve('anchor-layout-gate', ({'e1':-5},'e1','/b','replace',True,'',100,20)), '')
check('anchor-layout-gate scenario 6', solve('anchor-layout-gate', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'section')
check('restore-command scenario 1', solve('restore-command', ({'e1':N*10,'e2':50},'e1','/a','pop',True,None,100,20)), 'saved')
check('restore-command scenario 2', solve('restore-command', ({'e1':0},'e1','/a','push',True,'section',100,20)), 'anchor')
check('restore-command scenario 3', solve('restore-command', ({},'e2','/a','pop',True,None,10,20)), 'saved')
check('restore-command scenario 4', solve('restore-command', ({'e1':90},'e1','/a','pop',False,None,100,20)), 'wait')
check('restore-command scenario 5', solve('restore-command', ({'e1':-5},'e1','/b','replace',True,'',100,20)), 'anchor')
check('restore-command scenario 6', solve('restore-command', ({'/a':70,'e1':15},'e1','/a','pop',True,'section',40,20)), 'anchor')
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 |
|---|---|---|---|
| entry-key-lookup scenario 1 | 10 | 10 | Passed |
| entry-key-lookup scenario 2 | 0 | 0 | Passed |
| entry-key-lookup scenario 3 | 0 | 0 | Passed |
| entry-key-lookup scenario 4 | 90 | 90 | Passed |
| entry-key-lookup scenario 5 | -5 | -5 | Passed |
| entry-key-lookup scenario 6 | 15 | 15 | Passed |
| push-resets-position scenario 1 | 10 | 10 | Passed |
| push-resets-position scenario 2 | 0 | 0 | Passed |
| push-resets-position scenario 3 | 0 | 0 | Passed |
| push-resets-position scenario 4 | 90 | 90 | Passed |
| push-resets-position scenario 5 | 0 | 0 | Passed |
| push-resets-position scenario 6 | 15 | 15 | Passed |
| layout-ready-deferral scenario 1 | 10 | 10 | Passed |
| layout-ready-deferral scenario 2 | 0 | 0 | Passed |
| layout-ready-deferral scenario 3 | 0 | 0 | Passed |
| layout-ready-deferral scenario 4 | None | None | Passed |
| layout-ready-deferral scenario 5 | -5 | -5 | Passed |
| layout-ready-deferral scenario 6 | 15 | 15 | Passed |
| clamp-restored-position scenario 1 | 10 | 10 | Passed |
| clamp-restored-position scenario 2 | 0 | 0 | Passed |
| clamp-restored-position scenario 3 | 0 | 0 | Passed |
| clamp-restored-position scenario 4 | 80 | 80 | Passed |
| clamp-restored-position scenario 5 | 0 | 0 | Passed |
| clamp-restored-position scenario 6 | 15 | 15 | Passed |
| anchor-precedes-saved-position scenario 1 | 10 | 10 | Passed |
| anchor-precedes-saved-position scenario 2 | section | section | Passed |
| anchor-precedes-saved-position scenario 3 | 0 | 0 | Passed |
| anchor-precedes-saved-position scenario 4 | 90 | 90 | Passed |
| anchor-precedes-saved-position scenario 5 | | | Passed |
| anchor-precedes-saved-position scenario 6 | section | section | Passed |
| missing-entry-detection scenario 1 | False | False | Passed |
| missing-entry-detection scenario 2 | False | False | Passed |
| missing-entry-detection scenario 3 | True | True | Passed |
| missing-entry-detection scenario 4 | False | False | Passed |
| missing-entry-detection scenario 5 | False | False | Passed |
| missing-entry-detection scenario 6 | False | False | Passed |
| restoration-mode scenario 1 | manual | manual | Passed |
| restoration-mode scenario 2 | auto | auto | Passed |
| restoration-mode scenario 3 | manual | manual | Passed |
| restoration-mode scenario 4 | manual | manual | Passed |
| restoration-mode scenario 5 | auto | auto | Passed |
| restoration-mode scenario 6 | manual | manual | Passed |
| saved-position-prune scenario 1 | {'e2': 50} | {'e2': 50} | Passed |
| saved-position-prune scenario 2 | {} | {} | Passed |
| saved-position-prune scenario 3 | {} | {} | Passed |
| saved-position-prune scenario 4 | {} | {} | Passed |
| saved-position-prune scenario 5 | {} | {} | Passed |
| saved-position-prune scenario 6 | {'/a': 70} | {'/a': 70} | Passed |
| anchor-layout-gate scenario 1 | None | None | Passed |
| anchor-layout-gate scenario 2 | section | section | Passed |
| anchor-layout-gate scenario 3 | None | None | Passed |
| anchor-layout-gate scenario 4 | None | None | Passed |
| anchor-layout-gate scenario 5 | | | Passed |
| anchor-layout-gate scenario 6 | section | section | Passed |
| restore-command scenario 1 | saved | saved | Passed |
| restore-command scenario 2 | anchor | anchor | Passed |
| restore-command scenario 3 | saved | saved | Passed |
| restore-command scenario 4 | wait | wait | Passed |
| restore-command scenario 5 | anchor | anchor | Passed |
| restore-command scenario 6 | anchor | anchor | Passed |
SHA-256 / cb71b5a554b5164393c32d7d3adaec784e19f354b0c1022e63d132cf52dd979a
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:50.545871+00:00.
Case digest / 7979c07be60c84f7f7ef004427a2bc9814d03980ddfe0b1ec6ce8e9e11fee357