# Author: Sandeep Belgavi. Synthetic exercise; no network or provider calls. calls=[] def worker(): calls.append("invoked") return {"citations":["policy-1"]} def run(budget): if budget<1:return "BUDGET_DENIED" return "DELIVER" if worker()=={"citations":["policy-1"]} else "WITHHOLD" assert run(0)=="BUDGET_DENIED" and not calls assert run(1)=="DELIVER" and len(calls)==1 print("budget before worker; validation before delivery")