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 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!='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 dirty 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!='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:
Cancel retains location.

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 cancel-retains-location 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 target
    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!='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 or target
    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!='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:
Confirm original destination.

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 confirm-original-destination 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 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!='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 pending
    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!='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:
Pending request replacement.

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 pending-request-replacement 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 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!='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 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!='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:
Clear on cancel.

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 clear-on-cancel 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 '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!='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 dirty 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!='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:
Replace navigation mode.

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 replace-navigation-mode has the six explicit input/output oracles below.

split: open-access