from __future__ import annotations

import json
from pathlib import Path

predictions_path = Path("predictions.json")
payload = json.loads(predictions_path.read_text(encoding="utf-8"))

for index, prediction in enumerate(payload):
    prediction["runtime_ms"] = 120 + index
    prediction["cost_usd"] = round(0.01 + (index * 0.0025), 4)

predictions_path.with_name("predictions_with_meta.json").write_text(json.dumps(payload, indent=2), encoding="utf-8")
