Retain aircraft through native landing and qualify bounded input diagnostics

This commit is contained in:
2026-09-19 20:34:18 +02:00
parent f870443b9b
commit 2fba12f987
129 changed files with 50369 additions and 88 deletions
+54 -3
View File
@@ -637,6 +637,8 @@ def validate_input_observer(a):
def validate_input_exercise(a):
if getattr(a, 'exercise_prison_selection', False) and not (getattr(a, 'exercise_prison_alignment', False) and getattr(a, 'observe_prison_choices', False)):
refuse('Prison action selection requires explicit alignment and native choices')
if getattr(a, 'observe_prison_choices', False) and getattr(a, 'exercise_player_input', False) and not getattr(a, 'exercise_prison_approach', False):
refuse('Input exercise with gate choices requires explicit approach')
if getattr(a, 'exercise_prison_alignment', False) and not getattr(a, 'exercise_prison_approach', False):
@@ -868,7 +870,17 @@ def alignment_module_hashes(root):
return hashes
def input_exercise_command(command, root, compat, profile, executable, run_id, host_display, display_context, look=False, approach=False, alignment=False):
def selection_module_hashes(root):
hashes = {}
for name in ('ordinary_gate_choices.py', 'prison_action_selection_proof.py', 'prison_action_selection_evidence.py'):
path = root/'tools'/name
if path.is_symlink() or not path.is_file():
refuse('Action selection requires regular local proof modules')
hashes[name] = hashlib.sha256(path.read_bytes()).hexdigest()
return hashes
def input_exercise_command(command, root, compat, profile, executable, run_id, host_display, display_context, look=False, approach=False, alignment=False, selection=False):
"""Put the input supervisor around the display inspector, inside Gamescope."""
separator = command.index('--')
if command[:separator].count('--backend') != 1 or command[command.index('--backend')+1] != 'headless':
@@ -879,11 +891,15 @@ def input_exercise_command(command, root, compat, profile, executable, run_id, h
if (not display_context or len(child) < 3 or child[:2] != [sys.executable, str(ownership)]
or not re.fullmatch(r'[A-Za-z0-9]{1,32}', run_id)):
refuse('Input exercise requires the existing scoped display wrapper and observer nonce')
if type(selection) is not bool or (selection and not alignment):
refuse('Action selection requires explicit alignment')
if type(alignment) is not bool or (alignment and not approach):
refuse('Prison alignment requires explicit prior approach')
if type(approach) is not bool or (approach and not look):
refuse('Prison approach requires explicit relative look')
gate_tokens = [value for value in child if value.startswith('-errOrdinaryGate')]
if selection and '-errOrdinaryGateChoices' not in gate_tokens:
refuse('Action selection requires exact native choices')
if any(value not in {'-errOrdinaryGateObserve', '-errOrdinaryGateChoices'} for value in gate_tokens):
refuse('Unknown native gate observer option')
if approach and '-errOrdinaryGateObserve' not in gate_tokens:
@@ -923,6 +939,10 @@ def input_exercise_command(command, root, compat, profile, executable, run_id, h
context['alignment_requested'] = True
context['alignment_module_sha256'] = alignment_module_hashes(root)
wrapper.insert(-1, '--enable-private-alignment-proof')
if selection:
context['selection_requested'] = True
context['selection_module_sha256'] = selection_module_hashes(root)
wrapper.insert(-1, '--enable-private-selection-proof')
return command[:separator+1] + wrapper + child, context
@@ -944,6 +964,10 @@ def input_exercise_poll_failure(context):
for key in ('helper_sha256', 'ownership_helper_sha256', 'prefix', 'profile', 'game_executable', 'report', 'command', 'nonce'):
if report.get(key) != context[key]:
return False
if context.get('selection_requested') and report.get('selection_module_sha256') != context.get('selection_module_sha256'):
return False
if report.get('selection_requested', False) != context.get('selection_requested', False):
return False
if context.get('alignment_requested') and report.get('alignment_module_sha256') != context.get('alignment_module_sha256'):
return False
if report.get('alignment_requested', False) != context.get('alignment_requested', False):
@@ -995,6 +1019,17 @@ def input_exercise_result(result, context, session, observation, display_result)
for key in ('helper_sha256', 'ownership_helper_sha256', 'prefix', 'profile', 'game_executable', 'report', 'command', 'nonce'):
if report.get(key) != context[key]:
refuse('Input report binding mismatch: '+key)
selection_requested = context.get('selection_requested', False)
if type(report.get('selection_requested', False)) is not bool or report.get('selection_requested', False) != selection_requested:
refuse('Action selection request does not match launch context')
if selection_requested and (not context.get('alignment_requested') or report.get('selection_module_sha256') != context.get('selection_module_sha256') or context.get('selection_module_sha256') != selection_module_hashes(ROOT)):
refuse('Selection requires explicit alignment and unchanged module sources')
if not selection_requested and any(report.get(k) is not None for k in ('facing_proof', 'action_selection_proof')):
refuse('Unexpected action-selection proof')
if not selection_requested and report.get('wheel_events'):
refuse('Unexpected wheel input')
if report.get('unconfirmed_held_button') is not None or report.get('wheel_release_errors', []) != []:
refuse('Wheel release is unconfirmed')
alignment_requested = context.get('alignment_requested', False)
if type(report.get('alignment_requested', False)) is not bool or report.get('alignment_requested', False) != alignment_requested:
refuse('Prison alignment request does not match launch context')
@@ -1061,7 +1096,22 @@ def input_exercise_result(result, context, session, observation, display_result)
proof['scope'] = 'private relative mouse and W input with independently observed interior prison approach; no held action, gate exit, full escape or multiplayer qualification'
if proof['approach_proof'].get('verified') is not True:
refuse('Independent native prison approach evidence is incomplete')
if alignment_requested:
if selection_requested:
from prison_action_selection_evidence import validate_selection_evidence
selected = report.get('action_selection_proof', {})
wheel = selected.get('wheel', {})
buttons = report.get('wheel_events', [])
if not isinstance(buttons,list) or len(buttons) != 2:
refuse('Selection requires exactly one wheel pair')
for event, down, key in zip(buttons,(True,False),('down_monotonic','up_monotonic')):
if (not isinstance(event,dict) or type(event.get('button')) is not int or event['button'] != 5 or event.get('down') is not down or event.get('sent') is not True or event.get('finally')
or type(event.get('monotonic')) not in (int,float) or not math.isfinite(event['monotonic']) or type(wheel.get(key)) not in (int,float) or not math.isfinite(wheel[key]) or abs(event['monotonic']-wheel[key]) > .01):
refuse('Selection wheel adapter and policy pair disagree')
proof['action_selection_proof'] = validate_selection_evidence((session/'console.log').read_text(errors='replace'),context['nonce'],report.get('look_proof'),route,report.get('facing_proof'),selected)
proof['scope'] = 'ordinary private approach, stationary facing and one wheel pair with independent native original-lock selection; no F hold, unlock, exit or multiplayer qualification'
if proof['action_selection_proof'].get('verified') is not True:
refuse('Independent native action-selection evidence is incomplete')
elif alignment_requested:
from prison_alignment_evidence import validate_alignment_evidence
proof['alignment_proof'] = validate_alignment_evidence((session/'console.log').read_text(errors='replace'), context['nonce'], report.get('look_proof'), route, report.get('alignment_proof'))
proof['scope'] = 'private approach and stationary yaw alignment with independently observed native prison lock selection; no F hold, unlock, exit or multiplayer qualification'
@@ -1148,7 +1198,7 @@ def run_locked(a, steam, compat, profile, packed=None):
command, display_context = display_probe_command(command, ROOT, compat, profile, executable, run_id, os.environ.get('DISPLAY', ''))
exercise_context = None
if getattr(a, 'exercise_player_input', False):
command, exercise_context = input_exercise_command(command, ROOT, compat, profile, executable, run_id, os.environ.get('DISPLAY', ''), display_context, getattr(a, 'exercise_relative_look', False), getattr(a, 'exercise_prison_approach', False), getattr(a, 'exercise_prison_alignment', False))
command, exercise_context = input_exercise_command(command, ROOT, compat, profile, executable, run_id, os.environ.get('DISPLAY', ''), display_context, getattr(a, 'exercise_relative_look', False), getattr(a, 'exercise_prison_approach', False), getattr(a, 'exercise_prison_alignment', False), getattr(a, 'exercise_prison_selection', False))
silent_sink = 'erri_game_'+run_id
application_id = 'org.escapistsrereintroduced.game.'+run_id
env = os.environ.copy()
@@ -1313,6 +1363,7 @@ def main():
parser.add_argument('--capture-prison-view', action='store_true', help='Opt-in single genuine local prison screenshot; loose successor source only, no camera or input changes')
parser.add_argument('--observe-player-input', action='store_true', help='Read-only native local-input sampler; loose Core/Chat only, requires --settle >=50; sends no input')
parser.add_argument('--approach-wide-display', action='store_true', help='Use a disposable 2560x720 headless viewport for the explicit approach experiment; no physical display changes')
parser.add_argument('--exercise-prison-selection', action='store_true', help='Explicit facing and single wheel selection trial; requires alignment and native choice diagnostics; no F or gate operation')
parser.add_argument('--exercise-prison-alignment', action='store_true', help='Explicit stationary yaw-only alignment to native prison lock after verified approach; no F or gate operation')
parser.add_argument('--exercise-prison-approach', action='store_true', help='Explicit bounded relative-mouse/W approach inside prison; requires relative look and gate observer; never operates gate')
parser.add_argument('--observe-prison-choices', action='store_true', help='Read-only native selected/ordered gate action diagnostics; requires --observe-prison-gate')