feat(workbench): expose Apple UMA report route
This commit is contained in:
parent
0b4ee1928a
commit
cb41aedd66
3 changed files with 17 additions and 1 deletions
|
|
@ -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"])
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@ def _sha256_file(path: Path) -> str:
|
|||
|
||||
|
||||
def _relative(path: Path) -> str:
|
||||
return path.resolve().relative_to(REPO_ROOT.resolve()).as_posix()
|
||||
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]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue