from __future__ import annotations

import json
from pathlib import Path


def main() -> int:
    path = Path("runtime/lineage_events.jsonl")
    path.parent.mkdir(parents=True, exist_ok=True)
    event = {
        "artifact": "Temp/refactor_baseline_metrics_v1.json",
        "input_artifacts": [],
        "output_artifacts": ["Temp/refactor_baseline_metrics_v1.json"],
        "code_version_hash": "local",
        "status": "ok",
    }
    with path.open("a", encoding="utf-8") as fh:
        fh.write(json.dumps(event, ensure_ascii=False) + "\n")
    print(json.dumps(event, ensure_ascii=False))
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

