File size: 1,092 Bytes
50f83f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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())