feat(workbench): expose Apple UMA report route

This commit is contained in:
Shay 2026-06-24 14:38:37 -07:00
parent 0b4ee1928a
commit cb41aedd66
3 changed files with 17 additions and 1 deletions

View file

@ -447,3 +447,13 @@ def test_trace_construction_route() -> None:
assert data["status"] == "missing_evidence"
assert data["diagnostic_only"] is True
assert data["serving_allowed"] is False
def test_apple_uma_report_route_returns_read_only_projection() -> None:
response = _request("GET", "/benchmarks/apple-uma/report")
assert response.status == 200
data = response.payload["data"]
assert data["read_only"] is True
assert data["report_id"] == "apple_uma_mechanical_sympathy_latest"
assert "backend_status" in data
assert "mlx_exact_cga_recall" in data["tracks"]
assert any("No MLX semantic-backend" in item for item in data["non_claims"])

View file

@ -25,6 +25,7 @@ from workbench.construction_endpoint import (
construction_evidence_response,
construction_turn_id_from_path,
)
from workbench.apple_uma_report import read_apple_uma_report
from workbench.tour import determinism_tour
from workbench.field_evidence import (
field_evidence_from_journal_entry,
@ -326,6 +327,8 @@ class WorkbenchApi:
return ApiResponse(400, error("bad_request", str(exc)))
if method == "GET" and path == "/evals":
return ApiResponse(200, ok({"lanes": readers.list_eval_lanes()}))
if method == "GET" and path == "/benchmarks/apple-uma/report":
return ApiResponse(200, ok(read_apple_uma_report()))
if method == "GET" and path.startswith("/evals/"):
lane = unquote(path.removeprefix("/evals/"))
return ApiResponse(200, ok(readers.read_eval_lane(lane)))

View file

@ -38,7 +38,10 @@ def _sha256_file(path: Path) -> str:
def _relative(path: Path) -> str:
try:
return path.resolve().relative_to(REPO_ROOT.resolve()).as_posix()
except ValueError:
return path.resolve().as_posix()
def _require_mapping(value: object, label: str) -> dict[str, Any]: