Circuit breaker, bounded retry and stale cache for the talent network API #6
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.37) × (1 − Review Confidence (0.33)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 214 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 25% · 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.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6"
general
weight: 0.35
cursor[bot]
Changes
lib/breaker.ts), covering every talent API call:- Opens after 5 outages within 60 s, where an outage is a network error, timeout, 5xx or 429.
- While open, it fails fast for 30 s, then allows one trial call.
- A 404 is treated as an answer, not an outage.
- the web search shows a note
-
search_rolesaddsstale_minutesand a sentence in its text-
/api/healthreports the breaker's state and countstalent_apilog line per call (op, status, attempts, duration, breaker state), plus a line for each breaker transition. Query text and job ids are never logged.docs/talent-api.md: the API is documented (developer page plus OpenAPI 3.1), needs no auth, and asks callers to identify themselves with?source=, which One Link does. The doc also covers caching, observed limits, failure modes, and the business dependency: there's no agreement with the speedrun team.Verification
- breaker state transitions, a single half-open trial, and the failure window
- 5xx retried once, 429 never retried, 404 doesn't trip the breaker
- logs contain no query text
- stale cache served on failure
🤖 Generated with Claude Code