import joblib GATE_NAMES = [ "V1_authorization", "V2_target", "V3_reachability", "V4_availability", "V5_blast_radius", "V6_effectiveness", ] model = joblib.load("model.joblib") def verify_action(**gates): values = [int(bool(gates[name])) for name in GATE_NAMES] prediction = int(model.predict([values])[0]) failed = [name for name, value in zip(GATE_NAMES, values) if not value] return { "verified": bool(prediction), "decision": "VERIFIED" if prediction else "REJECTED", "failed_gates": failed, } if __name__ == "__main__": print(verify_action( V1_authorization=True, V2_target=True, V3_reachability=True, V4_availability=True, V5_blast_radius=False, V6_effectiveness=True, ))