Download REPRODUCE.py from PureOne/neoryae-aegis: direct link, hf CLI and curl.
- Browser
- Download file 3.4 kB
-
https://huggingface.co/datasets/PureOne/neoryae-aegis/resolve/main/REPRODUCE.py
- Command line
-
hf download hf://datasets/PureOne/neoryae-aegis/REPRODUCE.py
-
curl -L -o REPRODUCE.py https://huggingface.co/datasets/PureOne/neoryae-aegis/resolve/main/REPRODUCE.py
3.4 kB
| """Run checks in a disposable copy, preserving the published records and hashes.""" | |
| from pathlib import Path | |
| import argparse | |
| import datetime | |
| import json | |
| import shutil | |
| import subprocess | |
| import sys | |
| import tempfile | |
| QUICK = ['verify_cap_packing.py', 'certify_rotation_bound.py', | |
| 'verify_rotation_bound.py', 'verify_rotation_reuse.py'] | |
| FULL = QUICK + ['certify_disk_bound.py', 'verify_disk_bound.py', | |
| 'verify_vector_realization.py', 'verify_sharp_augmentation.py', | |
| 'verify_affine_rounding.py', 'verify_complexity_frontier.py', | |
| 'verify_quantitative_repair.py', 'verify_finite_audit.py', | |
| 'verify_direction_repair.py', 'verify_soft_gap.py', 'verify_positional.py', | |
| 'verify_wulff.py', 'verify_intrinsic.py'] | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| mode = parser.add_mutually_exclusive_group() | |
| mode.add_argument('--quick', action='store_true', help='Run four standard-library certificate/packing/reuse checks (default).') | |
| mode.add_argument('--full', action='store_true', help='Run all 17 scripts; requires requirements.txt.') | |
| parser.add_argument('--output-dir', type=Path, help='Directory for regenerated reports and logs.') | |
| args = parser.parse_args() | |
| root = Path(__file__).resolve().parent | |
| if sys.version_info < (3, 10): | |
| parser.error('Use Python 3.10 or newer.') | |
| destination = (args.output_dir or Path(tempfile.mkdtemp(prefix='neoryae-verification-'))).resolve() | |
| if destination == root or destination.is_relative_to(root): | |
| parser.error('Choose an output directory outside this repository to preserve its published records.') | |
| destination.mkdir(parents=True, exist_ok=True) | |
| records = [] | |
| with tempfile.TemporaryDirectory(prefix='neoryae-check-work-') as temporary: | |
| work = Path(temporary) | |
| for source in root.glob('*.py'): | |
| if source.name != Path(__file__).name: | |
| shutil.copyfile(source, work/source.name) | |
| (work/'figures').mkdir() | |
| for script in FULL if args.full else QUICK: | |
| print(f'Running {script} ...', flush=True) | |
| with (destination/(script+'.log')).open('w', encoding='utf-8') as log: | |
| run = subprocess.run([sys.executable, '-u', str(work/script)], cwd=work, | |
| stdout=log, stderr=subprocess.STDOUT) | |
| records.append({'script': script, 'exit_code': run.returncode}) | |
| if run.returncode: | |
| print(f'FAILED: see {destination/(script+".log")}', flush=True) | |
| break | |
| for source in work.glob('*.json'): | |
| shutil.copyfile(source, destination/source.name) | |
| summary = {'status':'PASS' if all(x['exit_code']==0 for x in records) else 'FAIL', | |
| 'mode':'full' if args.full else 'quick', 'scripts':records, | |
| 'python':sys.version, 'created_at':datetime.datetime.now(datetime.timezone.utc).isoformat(), | |
| 'note':'Published source reports were preserved. Analytic proofs remain distinct from computational checks.'} | |
| (destination/'REPRODUCTION_RUN.json').write_text(json.dumps(summary,indent=2)+'\n', encoding='utf-8') | |
| print(summary['status'] + ': logs and regenerated JSON reports: ' + str(destination), flush=True) | |
| return 0 if summary['status']=='PASS' else 1 | |
| if __name__=='__main__': | |
| raise SystemExit(main()) | |