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

N = 1
observations = []
def solve(operation, s):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**stored,**defaults}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {k:stored.get(k,v) for k,v in defaults.items()}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Default overlay order.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation default-overlay-order 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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version!=current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>=current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Future version readonly.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation future-version-readonly 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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current+1))
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version+1,current))
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Migration step list.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation migration-step-list 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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return stored
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Transient exclusion.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation transient-exclusion 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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(defaults)
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in allowed}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(k for k in defaults if not stored.get(k))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Missing default identification.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation missing-default-identification has the six explicit input/output oracles below.

split: open-access