- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard. - guardrail-cli: extracted pure helpers into util.rs (split in progress). - 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs. - dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
720 B
Python
30 lines
720 B
Python
"""Loaders for the Rust agent's JSON run report.
|
|
|
|
Standard-library only (json, pathlib).
|
|
"""
|
|
|
|
import json
|
|
from pathlib import Path
|
|
|
|
|
|
def load_run_report(path: str = "data/run_report.json") -> dict | None:
|
|
"""Load ``run_report.json`` produced by the agent.
|
|
|
|
Returns the parsed dict, or ``None`` when the file is missing or the
|
|
contents cannot be parsed as a JSON object.
|
|
"""
|
|
report_path = Path(path)
|
|
if not report_path.exists():
|
|
return None
|
|
|
|
try:
|
|
with report_path.open("r", encoding="utf-8") as handle:
|
|
data = json.load(handle)
|
|
except (json.JSONDecodeError, OSError):
|
|
return None
|
|
|
|
if not isinstance(data, dict):
|
|
return None
|
|
|
|
return data
|