diff --git a/diagnostics/dashboard_routes.py b/diagnostics/dashboard_routes.py index 40eff47..f81c020 100644 --- a/diagnostics/dashboard_routes.py +++ b/diagnostics/dashboard_routes.py @@ -1309,3 +1309,18 @@ def register_dashboard_routes(app: web.Application, get_conn): app.router.add_get("/api/pr-lifecycle", handle_pr_lifecycle) app.router.add_get("/api/telegram-extractions", handle_telegram_extractions) app.router.add_get("/api/contributor-growth", handle_contributor_growth) + app.router.add_get("/api/digest/latest", handle_digest_latest) + + +async def handle_digest_latest(request): + """GET /api/digest/latest — return the most recent scoring digest.""" + import json as _json + digest_path = "/opt/teleo-eval/logs/scoring-digest-latest.json" + try: + with open(digest_path) as f: + data = _json.load(f) + return web.json_response(data) + except FileNotFoundError: + return web.json_response({"error": "No digest available yet"}, status=404) + except Exception as e: + return web.json_response({"error": str(e)}, status=500)