Distributed brief lock, Redis-native rate limits, health endpoint #5
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 286 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 55% · 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.339
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5"
general
weight: 0.35
cursor[bot]
Why
@upstash/ratelimit2.2.0 uses an Upstash-only Lua flag (allow-key-locking) that standard Redis rejects, so its behavior can't be verified outside Upstash.Changes
@upstash/ratelimitis removed.lib/lock.ts):-
SET NX PXwith an owner token, released by a compare-and-delete script so a stale worker can't release someone else's lock. Expires after 90 s.- Other instances wait for the saved brief, up to 40 s, then get a clear 409.
- A failed generation releases the lock. A crashed holder's lock expires.
- The holder checks for a saved brief after taking the lock, so it never pays twice.
/api/health.- Reports whether limits are global or per instance, Redis reachability and latency, budget use against the cap, and whether a model key is configured.
- No secret values. A
degradedlist names any fallback.- The smoke test checks it, and
EXPECT_GLOBAL_LIMITS=1makes the monitor fail if limits aren't global.distributedjob runs the cross-process tests against Redis plus theserverless-redis-httpemulator as service containers.Verification
- 8 instances, one caller: exactly 5 allowed
- 80 different callers across 4 instances: exactly 60 allowed
- 10 instances racing a budget of 3: exactly 3 reserved
- 6 instances asking for the same brief: 1 model call, and all 6 get the brief
global, 20 ms) and with Redis unreachable (per-instance, plus the reason).🤖 Generated with Claude Code