Retain aircraft through native landing and qualify bounded input diagnostics
This commit is contained in:
@@ -7,7 +7,18 @@ from prison_approach_evidence import validate_approach_evidence, need, number, h
|
||||
|
||||
|
||||
def validate_alignment_evidence(content, nonce, look_proof, approach_proof, proof):
|
||||
return _validate(content,nonce,look_proof,approach_proof,proof)
|
||||
|
||||
|
||||
def validate_facing_evidence(content, nonce, look_proof, approach_proof, proof):
|
||||
return _validate(content,nonce,look_proof,approach_proof,proof,facing=True)
|
||||
|
||||
|
||||
def _validate(content, nonce, look_proof, approach_proof, proof, facing=False):
|
||||
result={'verified':False,'errors':[],'scope':'stationary yaw-only alignment and native selection of the original prison lock after a verified interior approach; no F hold, unlock, exit or multiplayer qualification','held_action_verified':False,'escape_verified':False}
|
||||
if facing:
|
||||
result['scope']='stationary yaw facing the original gate with exact disabled door and available lock diagnostics; lock selection, held action and escape remain unverified'
|
||||
result['lock_selection_verified']=False
|
||||
try:
|
||||
approach=validate_approach_evidence(content,nonce,look_proof,approach_proof)
|
||||
need(approach['verified'],'prior native approach is unverified: '+str(approach['errors']))
|
||||
@@ -16,12 +27,24 @@ def validate_alignment_evidence(content, nonce, look_proof, approach_proof, proo
|
||||
gain=calibration['response_yaw_degrees']/24
|
||||
need(.01<=abs(gain)<=.5,'native calibration gain outside alignment range')
|
||||
need(type(proof) is dict and not proof.get('events') and proof.get('requested') is True and proof.get('completed') is True and proof.get('nonce')==nonce and not proof.get('error'),'alignment did not complete under this nonce')
|
||||
if facing:
|
||||
need(set(proof)=={'requested','completed','nonce','geometry','started_monotonic','finished_monotonic','deadline_monotonic','initial_sample','final_sample','facing_samples','actions','motions','samples'},'unexpected facing proof fields or lock-selection claim')
|
||||
start=number(proof['started_monotonic']);finish=number(proof['finished_monotonic']);deadline=number(proof['deadline_monotonic'])
|
||||
need(approach_proof['finished_monotonic']<=start<finish<=deadline<=start+8,'alignment helper interval outside original stage bound')
|
||||
data=join_gate_snapshots(content,nonce);samples=data['snapshots'];first=proof['initial_sample'];last=proof['final_sample'];route_end=approach['last_sample']
|
||||
if facing:
|
||||
from ordinary_gate_choices import join_choice_snapshots,exact_prison_choices
|
||||
data=join_choice_snapshots(content,nonce)
|
||||
else:data=join_gate_snapshots(content,nonce)
|
||||
samples=data['snapshots'];first=proof['initial_sample'];last=proof['final_sample'];route_end=approach['last_sample']
|
||||
need(type(first) is int and type(last) is int and route_end<=first<last and first in samples and last in samples,'native alignment references invalid')
|
||||
geo=validate_gate_geometry(content,nonce,route_end,last)
|
||||
need(geo['verified'],'native alignment geometry invalid: '+str(geo['errors']))
|
||||
need(proof.get('geometry')==approach_proof.get('geometry'),'alignment geometry differs from accepted approach')
|
||||
measured=proof['geometry']
|
||||
need(type(measured) is dict and measured.get('nonce')==nonce and measured.get('basis')=='registered-prison-lock-native-interaction','alignment geometry binding missing')
|
||||
for field in ('prison','gate','context'):
|
||||
need(math.dist(measured[field],geo[field])<=.01,'alignment geometry differs from native '+field)
|
||||
need(math.dist(measured['gate_forward'],geo['gate_forward'])<=.001 and abs(number(measured['radius'])-geo['radius'])<=.001,'alignment orientation/radius differs from native')
|
||||
queued=re.findall(r'ERR INPUT OBSERVE: run='+re.escape(nonce)+r' sample=0 real=(\d+) world=[^ ]+ QUEUED(?:\r?$)',content,re.MULTILINE)
|
||||
need(len(queued)==1,'original native QUEUED clock missing or ambiguous')
|
||||
queued=int(queued[0]);ready=data['ready']['real_ms']
|
||||
@@ -33,7 +56,7 @@ def validate_alignment_evidence(content, nonce, look_proof, approach_proof, proo
|
||||
s=samples[index];g=s['geometry'];a=s['action']
|
||||
need(neutral(s) and math.dist(reference,s['input']['origin'])<=.05,'body moved during stationary alignment')
|
||||
need(queued<=s['real_ms']<queued+45000,'original native observation lifetime exceeded')
|
||||
need(g['door_state']==0 and g['door_control']==0 and a['pressed']==0 and not a['performing'] and a['progress']==0,'gate operated during alignment-only observation')
|
||||
need(g['door_state']==0 and g['door_control']==0 and a['pressed']==0 and not a['performing'] and a['progress']==0 and a['duration']==4,'gate operated during alignment-only observation')
|
||||
if last_real is not None:need(0<s['real_ms']-last_real<=500,'native alignment sample gap')
|
||||
last_real=s['real_ms']
|
||||
refs=proof['samples'];need(type(refs) is list and 2<=len(refs)<=450,'bounded alignment references missing')
|
||||
@@ -70,14 +93,24 @@ def validate_alignment_evidence(content, nonce, look_proof, approach_proof, proo
|
||||
need(samples[after]['real_ms']-samples[before]['real_ms']<=2500,'native turn response interval is unbounded')
|
||||
old_index=after;old_time=at;pixel_sum+=abs(dx)
|
||||
need(pixel_sum<=768,'alignment pixel budget exceeded')
|
||||
pair=proof['selection_samples'];need(type(pair) is list and len(pair)==2 and all(type(i) is int for i in pair) and first<=pair[0] and pair[1]==pair[0]+1 and pair[1]<=last,'selection lacks consecutive references')
|
||||
pair=proof['facing_samples' if facing else 'selection_samples'];need(type(pair) is list and len(pair)==2 and all(type(i) is int for i in pair) and first<=pair[0] and pair[1]==pair[0]+1 and pair[1]<=last,'selection lacks consecutive references')
|
||||
one,two=(samples[i] for i in pair)
|
||||
need(100<=two['real_ms']-one['real_ms']<=500 and abs(angle(yaw(two['look']['direction']),yaw(one['look']['direction'])))<=.2,'selection view did not settle')
|
||||
for i in range(pair[0],last+1):
|
||||
s=samples[i];a=s['action']
|
||||
need(a['selected'] and a['context_selected'] and a['cached_performable'] and a['progress_bound'] and a['duration']==4,'original native lock/context not selected and bound')
|
||||
if facing:
|
||||
c=exact_prison_choices(s)
|
||||
need(c['actions']==proof['actions'] and c['selected_class']=='ERR_PrisonDoorAction' and c['selected_id']==c['actions'][0]['id'] and not a['selected'] and not a['progress_bound'] and a['cached_performable'],'facing lacks exact disabled door and available original lock')
|
||||
else:need(a['selected'] and a['context_selected'] and a['cached_performable'] and a['progress_bound'] and a['duration']==4,'original native lock/context not selected and bound')
|
||||
need(abs(angle(heading(s),yaw(s['look']['direction'])))<=3,'view not aligned to actual handle bearing')
|
||||
if facing:
|
||||
for i in range(route_end,last+1):
|
||||
s=samples[i];a=s['action']
|
||||
if a['context_selected']:
|
||||
c=exact_prison_choices(s)
|
||||
need(c['actions']==proof['actions'] and c['selected_class']=='ERR_PrisonDoorAction' and not a['selected'] and not a['progress_bound'] and a['cached_performable'],'facing action identities/order changed or lock already selected')
|
||||
result.update(verified=True,first_sample=first,last_sample=last,selection_samples=pair,turn_count=len(motions),native_duration_ms=samples[last]['real_ms']-samples[first]['real_ms'],final_yaw_error_degrees=abs(angle(heading(samples[last]),yaw(samples[last]['look']['direction']))))
|
||||
if facing:result['facing_samples']=result.pop('selection_samples')
|
||||
except (ValueError,KeyError,TypeError,OverflowError,IndexError) as error:
|
||||
result['errors'].append(str(error))
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user