"""Test fixture that mimics research_harness.py output."""

from __future__ import annotations

import argparse
import json
from pathlib import Path


def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument("query")
    parser.add_argument("--depth", default="quick")
    parser.add_argument("--output", type=Path, required=True)
    parser.add_argument("--pretty", action="store_true")
    return parser.parse_args()


def main() -> int:
    args = parse_args()
    payload = {
        "query": args.query,
        "depth": args.depth,
        "generated_at": "2026-04-01T00:00:00+00:00",
        "summary": {"total_evidence": 1},
        "validation": {"ok": True, "errors": []},
        "evidence": [
            {
                "query": args.query,
                "source_type": "docs",
                "url": "https://example.com/fake-harness",
                "title": "Fake Harness Result",
                "summary": "Generated by the fake harness fixture.",
                "retrieved_at": "2026-04-01T00:00:00+00:00",
                "retrieval_status": "succeeded",
            }
        ],
    }
    args.output.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
    return 0


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