File size: 2,472 Bytes
fbc9e3f | 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | import argparse
import json
from pathlib import Path
def latest(pattern):
files = sorted(Path(".").glob(pattern), key=lambda p: p.stat().st_mtime, reverse=True)
return files[0] if files else None
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--latest", action="store_true")
args = ap.parse_args()
failed_json = latest("reports/failed_items_*.json")
repair_jsonl = latest("data/repair_dataset_from_failed_items_*.jsonl")
bench_json = latest("reports/bench_14b_champion*.json")
print("==== DECISION SUMMARY ====")
if bench_json:
obj = json.loads(bench_json.read_text(encoding="utf-8"))
print("LATEST_BENCH:", bench_json)
print("SUMMARY:", json.dumps(obj.get("summary", {}), ensure_ascii=False))
else:
print("LATEST_BENCH: not found")
print()
if failed_json:
obj = json.loads(failed_json.read_text(encoding="utf-8"))
n = obj.get("num_failed_or_issued", 0)
print("FAILED_JSON:", failed_json)
print("FAILED_COUNT:", n)
print("CATEGORY_COUNTS:", json.dumps(obj.get("category_counts", {}), ensure_ascii=False))
print("ISSUE_COUNTS:", json.dumps(obj.get("issue_counts", {}), ensure_ascii=False))
print()
issue_counts = obj.get("issue_counts", {})
if n == 0:
print("RECOMMENDATION: ์คํจ ํญ๋ชฉ์ด ์์ผ๋ฏ๋ก ์ฌํ์ตํ์ง ๋ง๊ณ ํ์ฌ ๋ชจ๋ธ์ ์ ์งํ์
๋ ๋ฉ๋๋ค.")
elif any("possible_chinese_leakage" in k for k in issue_counts):
print("RECOMMENDATION: ์ค๊ตญ์ด leakage๊ฐ ์์ผ๋ฏ๋ก safety repair๋ฅผ ์ฐ์ ํด์ผ ํฉ๋๋ค.")
elif set(obj.get("category_counts", {}).keys()).issubset({"systemd", "jsonl", "cuda"}):
print("RECOMMENDATION: ์ ์ฒด ์ฌํ์ต๋ณด๋ค systemd/jsonl/cuda low-item repair๋ง ๊ณ ๋ คํ์๋ฉด ๋ฉ๋๋ค.")
else:
print("RECOMMENDATION: ์คํจ ๋ฒ์๊ฐ ๋์ต๋๋ค. ์คํจ ํญ๋ชฉ ๋ด์ฉ์ ๋จผ์ ๊ฒํ ํ ๋ค repair ๋ฒ์๋ฅผ ์ ํ์๋ ๊ฒ ์ข์ต๋๋ค.")
else:
print("FAILED_JSON: not found")
print("RECOMMENDATION: ๋จผ์ 02_extract_failed_items.py๋ฅผ ์คํํด ์ฃผ์ธ์.")
print()
if repair_jsonl:
rows = sum(1 for _ in repair_jsonl.open("r", encoding="utf-8"))
print("REPAIR_DATASET:", repair_jsonl)
print("REPAIR_ROWS:", rows)
else:
print("REPAIR_DATASET: not created yet")
if __name__ == "__main__":
main()
|