"""Independently validate a single wheel trial from native input/choice records.""" import math import re from ordinary_gate_choices import join_choice_snapshots,exact_prison_choices from ordinary_gate_evidence import validate_gate_geometry from prison_alignment_evidence import validate_facing_evidence from prison_approach_evidence import need,number,neutral,yaw,angle,horizontal def validate_selection_evidence(content,nonce,look_proof,approach_proof,facing_proof,proof,*,facing_profile="standard"): result={'verified':False,'errors':[],'scope':'one guarded private wheel pair and native selection of the original prison lock after verified approach/facing; no F hold, unlock, exit or multiplayer qualification','held_action_verified':False,'escape_verified':False} try: facing=validate_facing_evidence(content,nonce,look_proof,approach_proof,facing_proof,profile=facing_profile) need(facing['verified'],'independent native facing prerequisite failed: '+str(facing['errors'])) need(type(proof) is dict and proof.get('requested') is True and proof.get('completed') is True and proof.get('nonce')==nonce and not proof.get('error') and not proof.get('events') and not proof.get('motions'),'selection did not complete under exact nonce without extra input') need(set(proof)=={'requested','completed','nonce','geometry','started_monotonic','finished_monotonic','deadline_monotonic','initial_sample','final_sample','selection_samples','actions','wheel','samples'},'unexpected selection proof fields or extra input') start=number(proof['started_monotonic']);finish=number(proof['finished_monotonic']);deadline=number(proof['deadline_monotonic']) need(facing_proof['finished_monotonic']<=start=1.5,'wheel request/release/acknowledgement outside original bounds') need(type(before) is int and first<=beforebefore and i in receipts and receipts[i]>=down,'lock selected before wheel request') if acquired is None:acquired=i else:need(acquired is None,'native lock selection dropped after acknowledgement') if previous is not None:need(0