feat(api): restore the explainer proxy NBA's site needs #9
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.49) × (1 − Review Confidence (0.50)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 1291 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.400
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
2 items
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
copilot-pull-request-reviewer[bot]
Kevocado
What and why
NBA's
/api/explainproxy was deleted on the strength of a refusal that was never checked. The reasoning: the shared explainer 404s fornba, so a proxy "had exactly one possible outcome: a 502 on every game detail". True — and it follows from a premise verified for F1 and assumed for NBA.NBA serves now. The refusal was a product decision about F1 (a win probability is the explanation there), and NBA's
/factscarries the samemoneyline/spread/totalthe panel draws.Without this proxy the ask is only half delivered: Caddy reverse-proxies this app and nothing else, so the browser has no route to the explainer.
Depends on the explainer's
SERVED_SPORTSchange (predictor-hubserve-nbabranch). The two must land together or NBA's panel shows its retry state.Not in this change
The frontend panel.
ExplainerPanel.tsxis vendored in NBA but unwired, and the v2 components it needs are still on predictor-hub#13. Separate work, not a gap here.Testing
tests/test_no_explain_proxy.pyasserted an absence, so it could only confirm nothing had been added. Replaced withtests/test_explain_proxy.py(34 tests) asserting what a live proxy must have.Three of those assertions were vacuous on first write and were caught by mutation, not by reading:
| Guard | Why the first test missed it |
|---|---|
| no upstream body echoed | fake raised
HTTPErrorwith no.response, soexc.response.texthad nothing to leak || non-2xx → 502 | fake raised instead of returning, so the proxy's own status check never ran |
|
quote()onsport| only reachable end-to-end forexplainer_id;sporttested by calling the route directly |Plus
timeout=/allow_redirectsreachrequests.get(per-call args, so the module constants prove nothing), and OpenAPI rather thanapp.routesfor the route table.Mutation check
tools/mutcheck_explain_proxy.py— 9 guards, 9 bites, with a canary that must stay silent so a misreporting harness can't look like a passing suite.Note for a follow-up
except ValueErroris removed here as unreachable (JSONDecodeErrorsubclassesRequestException; verified against requests 2.34.2). PL's proxy has the same dead branch — left alone to keep this one sport's change.377 passed, 17 skipped.