Files
EscapistsReintroduced/docs/evidence/rescue-factions-2026-10-13/summarize-runs.py
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

33 lines
3.3 KiB
Python

#!/usr/bin/env python3
"""Build audit data from complete frozen native runs, retaining every error."""
from pathlib import Path
import hashlib,json,re,sys
ROOT=Path(__file__).resolve().parents[3]
sys.path.insert(0,str(ROOT/'tools'))
from native_report import analyze,clean
HERE=Path(__file__).resolve().parent
runs=[]
for directory in sorted(HERE.glob('run-*')):
if not directory.is_dir(): continue
if not (directory/'console.log').exists():
runs.append({'run':directory.name,'status':'engine-not-started','diagnostics':'runner-output.log'})
continue
log=(directory/'console.log').read_text(errors='replace')
report=analyze(log,'console.log')
(directory/'native-report.json').write_text(json.dumps(report,indent=2)+'\n')
metadata=json.loads((directory/'runner.json').read_text())
inputs=json.loads((directory/'fixture-inputs.json').read_text())
runs.append({'run':directory.name,'behavior_complete':bool(report['smoke_completions'] and not report['script_or_runtime_failures']),'strict_native_report_passed':clean(report),'assertions_passed':report['assertions_passed'],'script_or_runtime_failures':report['script_or_runtime_failures'],'engine_error_count':len(report['engine_errors']),'native_report':'native-report.json','console_sha256':metadata['console_sha256'],'source_manifest_sha256':metadata['launch_source_sha256'],'source_unchanged_after_run':metadata['source_unchanged_after_run'],'external_addons_unchanged_after_run':metadata['external_addons_unchanged_after_run'],'cleanup_confirmed':metadata['cleanup_confirmed'],'fixture_sha256':inputs['fixture_sha256'],'scope':inputs.get('scope','full'),'matrix':[line.split('ERR RESCUE FACTION MATRIX ',1)[1].strip() for line in log.splitlines() if 'ERR RESCUE FACTION MATRIX ' in line],'arranged_inputs':[line.strip() for line in log.splitlines() if 'ERR RESCUE FACTION ARRANGED:' in line]})
notes={
'run-a01':'Sandbox blocked local Pulse socket before engine startup.',
'run-a02':'Superseded fixture: catalog changes did not update cached selected faction; all crew remained US. Matrix is unqualified. Immediate dispatch assertion failed at the legacy hillside pickup.',
'run-a03':'Qualified six-faction aircraft/crew/cargo matrix and arranged US dual-transport flight/boarding/departure. Earlier snapshot precedes final secondary-pad preparation validation.',
'run-a04':'Native compiler rejected modulo within new float angle expression; corrected with Math.Mod before the next run.',
'run-a05':'Flight-only fixture passed preparation, two landings, all8 native audited benches, PhysicalReason, AvailableSeat, wounded boarding and distributed departure hold. Its final sample was premature:6.3s after departure versus the controller10s zero-climb hold. Matrix intentionally skipped; no matrix coverage from the inherited generic completion label.',
'run-a06':'Final shortened-initial-approach fixture with actual production takeoff wake and bounded measured airborne/climbing departure check; matrix coverage remains run-a03.'
}
for entry in runs: entry['qualification_note']=notes.get(entry['run'],'See README for qualification scope.')
summary={'date':'2026-10-13','runs':runs}
(HERE/'run-summary.json').write_text(json.dumps(summary,indent=2)+'\n')
print(json.dumps([{k:r[k] for k in ['run','behavior_complete','strict_native_report_passed','assertions_passed','engine_error_count'] if k in r} for r in runs]))