Sanhedrin 7: The First Judgement is on Torah

Reconciling this with Gemara in Shabbos that says that it is the 2nd question.