from pathlib import Path import sys,json R=Path(__file__).resolve().parent;sys.path.insert(0,str(R/'source')) from icl_native.offline_infer import OfflineModel from icl_native.execution import vm_verify m=OfflineModel(R/'model');checks=[] for name,expected in [('demo',{'tag':'Ok','value':-4}),('denied_journal',{'tag':'Err','error':'EFFECT_DENIED'}),('missing_witness',{'tag':'Err','error':'NON_IDENTIFIABLE'}),('wrong_observer',{'tag':'Err','error':'OBSERVER_MISMATCH'}),('missing_memory',{'tag':'Err','error':'MEMORY_MISSING'})]: p=json.loads((R/'examples'/f'{name}.json').read_text());pr=m.predict(p);v=vm_verify(p,pr);assert v['executed'] and v['runtime_consistency'] and v['result']['value']==expected;checks.append({'case':name,'result':v['result']['value']}) assert 'torch' not in sys.modules and 'numpy' not in sys.modules print(json.dumps({'status':'PASS','checks':checks,'n_checks':len(checks),'model_seed':17,'runtime':'Python standard library and bundled ICL VM','scope':'Five source examples, not a rerun of training/evaluation'},indent=2))