import json,re,sys
from pathlib import Path
p=Path(__file__).parent
data=json.loads((p/'input.json').read_text())
expected=json.loads((p/'expected.json').read_text())
config=json.loads((p/'config.json').read_text())
assert config['_material_kind']=='field-and-fixture-lesson-not-importable-workflow'
assert expected['_evidence']=='human-authored-expected-output-not-live-run'
for source,out in zip(data['events'],expected['rows']):
 e=source.get('execution',{}); t=source.get('trigger',{}); m=e.get('error',t.get('error',{})).get('message',''); m=re.sub(r'(Bearer )\S+',r'\1[REDACTED]',m); m=re.sub(r'(token=)\S+',r'\1[REDACTED]',m); assert m==out['message_redacted']; assert 'TEST_SECRET' not in m; assert out['execution_id']==e.get('id')
print('PASS: fixture and expected contract; no product or model execution')
