Hailed as ‘a rare moment of justice’, judges’ decision sets out a roadmap for assessing the question of intent