Something went wrong. Try again.
Native control, inspection, UI automation and evidence capture for a running Witcher 3 process.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132"""Post-exit cleanup/audit. Never clear live mutation uncertainty."""import jsonfrom pathlib import Path
from . import nativefrom .debug_journal import durable_json
def closed_cleanup(receipt): from . import game_settings from . import lifecycle from . import performance native.legacy.manage.ensure_game_closed() result=dict(ok=True,process_confirmed_closed=True,unknown_operations_preserved=True) failures={} def attempt(name,fn): try: value=fn(); result[name]=value if value is False or isinstance(value,dict) and value.get('ok') is False: failures[name]='audit/cleanup failed' except Exception as e: failures[name]=str(e) folder=native.legacy.ARTIFACTS/receipt['native_session'] attempt('saves_unchanged',lambda:json.loads((folder/'saves-before.json').read_text())==native.legacy.manage.files(native.legacy.manage.DOCS/'gamesaves')) attempt('performance_configuration',performance.restore) attempt('game_settings',game_settings.reset) attempt('installed_files',lifecycle.verify) baseline=Path(receipt['folder'])/'mods-before.json' if baseline.exists(): attempt('mods_unchanged',lambda:json.loads(baseline.read_text())==native.legacy.manage.files(native.legacy.manage.GAME/'mods')) else: result['mods_unchanged']=dict(availability='unavailable',reason='session predates persistent mod-baseline capture') result.update(ok=not failures,failures=failures) durable_json(Path(receipt['folder'])/'closed-recovery.json',result) return result