from __future__ import annotations import argparse import json from pathlib import Path from .eval import evaluate_pack def main() -> int: parser = argparse.ArgumentParser(description='Run golden-scenario evaluation for the P3 field-repair demo') parser.add_argument( '--pack', default='data/demo_packs/p3_field_repair_logbook', help='Path to the P3 demo pack directory', ) parser.add_argument( '--db-path', default='artifacts/verification/p3_eval.sqlite3', help='SQLite database path for evaluation artifacts', ) parser.add_argument( '--json-only', action='store_true', help='Emit exactly one JSON object to stdout', ) args = parser.parse_args() report = evaluate_pack(Path(args.pack), db_path=Path(args.db_path)) if args.json_only: print(json.dumps(report, ensure_ascii=False)) else: print(json.dumps(report, indent=2, ensure_ascii=False)) return 0 if report.get('scenario_count', 0) else 1 if __name__ == '__main__': raise SystemExit(main())