broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return False
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return not dirty
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

prompt:
Same location noop.

The blocker asks only for dirty cross-location transitions without a one-shot bypass. Confirmation follows the captured pending destination, cancellation keeps current location and edits, and push versus replace is independent. Operation same-location-noop has the six explicit input/output oracles below.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return True
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

prompt:
One shot bypass consumption.

The blocker asks only for dirty cross-location transitions without a one-shot bypass. Confirmation follows the captured pending destination, cancellation keeps current location and edits, and push versus replace is independent. Operation one-shot-bypass-consumption has the six explicit input/output oracles below.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return dirty and decision!='confirm'
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty
    if operation == 'discard-only-after-confirm':
        return dirty and decision!='confirm'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

prompt:
Prompt visibility.

The blocker asks only for dirty cross-location transitions without a one-shot bypass. Confirmation follows the captured pending destination, cancellation keeps current location and edits, and push versus replace is independent. Operation prompt-visibility has the six explicit input/output oracles below.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return False
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(operation, s):
    dirty, target, current, pending, decision, bypass, replace = s
    if operation == 'dirty-transition-gate':
        return dirty and target!=current and not bypass
    if operation == 'cancel-retains-location':
        return current if decision=='cancel' else target
    if operation == 'confirm-original-destination':
        return pending if decision=='confirm' and pending is not None else current
    if operation == 'pending-request-replacement':
        return target if decision=='ask' and dirty and not bypass else None
    if operation == 'clear-on-cancel':
        return None if decision=='cancel' else pending
    if operation == 'replace-navigation-mode':
        return 'replace' if replace else 'push'
    if operation == 'same-location-noop':
        return target==current
    if operation == 'one-shot-bypass-consumption':
        return False if bypass and target!=current else bypass
    if operation == 'prompt-visibility':
        return decision=='ask' and dirty and not bypass and target!=current
    if operation == 'discard-only-after-confirm':
        return dirty and decision=='ask'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dirty-transition-gate scenario 1', solve('dirty-transition-gate', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('dirty-transition-gate scenario 2', solve('dirty-transition-gate', (False,'/a','/a','/old','ask',False,True)), False)
check('dirty-transition-gate scenario 3', solve('dirty-transition-gate', (True,'/b','/a','/b','cancel',False,False)), True)
check('dirty-transition-gate scenario 4', solve('dirty-transition-gate', (True,'/c','/a','/b','confirm',False,True)), True)
check('dirty-transition-gate scenario 5', solve('dirty-transition-gate', (True,'/b','/a',None,'ask',True,False)), False)
check('dirty-transition-gate scenario 6', solve('dirty-transition-gate', (False,'/b','/a',None,'ask',False,False)), False)
check('cancel-retains-location scenario 1', solve('cancel-retains-location', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('cancel-retains-location scenario 2', solve('cancel-retains-location', (False,'/a','/a','/old','ask',False,True)), '/a')
check('cancel-retains-location scenario 3', solve('cancel-retains-location', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('cancel-retains-location scenario 4', solve('cancel-retains-location', (True,'/c','/a','/b','confirm',False,True)), '/c')
check('cancel-retains-location scenario 5', solve('cancel-retains-location', (True,'/b','/a',None,'ask',True,False)), '/b')
check('cancel-retains-location scenario 6', solve('cancel-retains-location', (False,'/b','/a',None,'ask',False,False)), '/b')
check('confirm-original-destination scenario 1', solve('confirm-original-destination', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/a')
check('confirm-original-destination scenario 2', solve('confirm-original-destination', (False,'/a','/a','/old','ask',False,True)), '/a')
check('confirm-original-destination scenario 3', solve('confirm-original-destination', (True,'/b','/a','/b','cancel',False,False)), '/a')
check('confirm-original-destination scenario 4', solve('confirm-original-destination', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('confirm-original-destination scenario 5', solve('confirm-original-destination', (True,'/b','/a',None,'ask',True,False)), '/a')
check('confirm-original-destination scenario 6', solve('confirm-original-destination', (False,'/b','/a',None,'ask',False,False)), '/a')
check('pending-request-replacement scenario 1', solve('pending-request-replacement', (True,'/b'+str(N),'/a',None,'ask',False,False)), '/b'+str(N))
check('pending-request-replacement scenario 2', solve('pending-request-replacement', (False,'/a','/a','/old','ask',False,True)), None)
check('pending-request-replacement scenario 3', solve('pending-request-replacement', (True,'/b','/a','/b','cancel',False,False)), None)
check('pending-request-replacement scenario 4', solve('pending-request-replacement', (True,'/c','/a','/b','confirm',False,True)), None)
check('pending-request-replacement scenario 5', solve('pending-request-replacement', (True,'/b','/a',None,'ask',True,False)), None)
check('pending-request-replacement scenario 6', solve('pending-request-replacement', (False,'/b','/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 1', solve('clear-on-cancel', (True,'/b'+str(N),'/a',None,'ask',False,False)), None)
check('clear-on-cancel scenario 2', solve('clear-on-cancel', (False,'/a','/a','/old','ask',False,True)), '/old')
check('clear-on-cancel scenario 3', solve('clear-on-cancel', (True,'/b','/a','/b','cancel',False,False)), None)
check('clear-on-cancel scenario 4', solve('clear-on-cancel', (True,'/c','/a','/b','confirm',False,True)), '/b')
check('clear-on-cancel scenario 5', solve('clear-on-cancel', (True,'/b','/a',None,'ask',True,False)), None)
check('clear-on-cancel scenario 6', solve('clear-on-cancel', (False,'/b','/a',None,'ask',False,False)), None)
check('replace-navigation-mode scenario 1', solve('replace-navigation-mode', (True,'/b'+str(N),'/a',None,'ask',False,False)), 'push')
check('replace-navigation-mode scenario 2', solve('replace-navigation-mode', (False,'/a','/a','/old','ask',False,True)), 'replace')
check('replace-navigation-mode scenario 3', solve('replace-navigation-mode', (True,'/b','/a','/b','cancel',False,False)), 'push')
check('replace-navigation-mode scenario 4', solve('replace-navigation-mode', (True,'/c','/a','/b','confirm',False,True)), 'replace')
check('replace-navigation-mode scenario 5', solve('replace-navigation-mode', (True,'/b','/a',None,'ask',True,False)), 'push')
check('replace-navigation-mode scenario 6', solve('replace-navigation-mode', (False,'/b','/a',None,'ask',False,False)), 'push')
check('same-location-noop scenario 1', solve('same-location-noop', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('same-location-noop scenario 2', solve('same-location-noop', (False,'/a','/a','/old','ask',False,True)), True)
check('same-location-noop scenario 3', solve('same-location-noop', (True,'/b','/a','/b','cancel',False,False)), False)
check('same-location-noop scenario 4', solve('same-location-noop', (True,'/c','/a','/b','confirm',False,True)), False)
check('same-location-noop scenario 5', solve('same-location-noop', (True,'/b','/a',None,'ask',True,False)), False)
check('same-location-noop scenario 6', solve('same-location-noop', (False,'/b','/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 1', solve('one-shot-bypass-consumption', (True,'/b'+str(N),'/a',None,'ask',False,False)), False)
check('one-shot-bypass-consumption scenario 2', solve('one-shot-bypass-consumption', (False,'/a','/a','/old','ask',False,True)), False)
check('one-shot-bypass-consumption scenario 3', solve('one-shot-bypass-consumption', (True,'/b','/a','/b','cancel',False,False)), False)
check('one-shot-bypass-consumption scenario 4', solve('one-shot-bypass-consumption', (True,'/c','/a','/b','confirm',False,True)), False)
check('one-shot-bypass-consumption scenario 5', solve('one-shot-bypass-consumption', (True,'/b','/a',None,'ask',True,False)), False)
check('one-shot-bypass-consumption scenario 6', solve('one-shot-bypass-consumption', (False,'/b','/a',None,'ask',False,False)), False)
check('prompt-visibility scenario 1', solve('prompt-visibility', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('prompt-visibility scenario 2', solve('prompt-visibility', (False,'/a','/a','/old','ask',False,True)), False)
check('prompt-visibility scenario 3', solve('prompt-visibility', (True,'/b','/a','/b','cancel',False,False)), False)
check('prompt-visibility scenario 4', solve('prompt-visibility', (True,'/c','/a','/b','confirm',False,True)), False)
check('prompt-visibility scenario 5', solve('prompt-visibility', (True,'/b','/a',None,'ask',True,False)), False)
check('prompt-visibility scenario 6', solve('prompt-visibility', (False,'/b','/a',None,'ask',False,False)), False)
check('discard-only-after-confirm scenario 1', solve('discard-only-after-confirm', (True,'/b'+str(N),'/a',None,'ask',False,False)), True)
check('discard-only-after-confirm scenario 2', solve('discard-only-after-confirm', (False,'/a','/a','/old','ask',False,True)), False)
check('discard-only-after-confirm scenario 3', solve('discard-only-after-confirm', (True,'/b','/a','/b','cancel',False,False)), True)
check('discard-only-after-confirm scenario 4', solve('discard-only-after-confirm', (True,'/c','/a','/b','confirm',False,True)), False)
check('discard-only-after-confirm scenario 5', solve('discard-only-after-confirm', (True,'/b','/a',None,'ask',True,False)), True)
check('discard-only-after-confirm scenario 6', solve('discard-only-after-confirm', (False,'/b','/a',None,'ask',False,False)), False)
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)

prompt:
Discard only after confirm.

The blocker asks only for dirty cross-location transitions without a one-shot bypass. Confirmation follows the captured pending destination, cancellation keeps current location and edits, and push versus replace is independent. Operation discard-only-after-confirm has the six explicit input/output oracles below.

split: open-access


broken_source:
"""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(path,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)

source:
"""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 next(iter(positions.values()),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)

prompt:
Entry key lookup.

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 entry-key-lookup has the six explicit input/output oracles below.

split: open-access