fix: check a rider against a trip's vehicle only when it is the only one #832
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 267 lines diff across 3 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.334
Real PR Conversation Timeline
1 comments
"Review active on #832"
general
weight: 0.35
aaronbrethorst
A rider's points are checked against the agency's own position for their trip, and a ride the trusted position contradicts three times is ended, which scores -3 and blocks a new rider. For this server's own drivers,
trustedSources.Lookuptook that position fromTracker.VehicleOnTrip, the vehicle on the trip id that reported last. On a route run from frequencies.txt several vehicles run one trip id at once, so a rider aboard one was checked against whichever had reported last. In the test, two vehicles 880 m apart run T1 and the rider is on the one ahead: after three good points the ride was ended as contradicted and the rider blocked.Lookupnow gives a position only when exactly one vehicle reports the trip (Tracker.OnlyVehicleOnTrip). With two or more, nothing is checked, which leaves the rider's score as it was.Coverssays what it said before: a trip any driver here reports is covered, however many vehicles run it, so no rider estimate is published beside them.Left alone: a trusted external feed has the same shape, as it keeps one entity per trip id and service date. Fixing that means teaching
TrustedFeedthat a key is ambiguous, a bigger change to rider/trusted.go, which I can follow up with if you'd like.Tests: the ride above now ends neither contradicted nor blocked, and the trip still counts as covered; it fails on main.
OnlyVehicleOnTripwith one vehicle, two, one of them gone stale, and no trip id. The suite passes without the database tests, which nothing here touches, and the rider and tracker tests pass with -race.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Improved handling of trips reported by multiple vehicles. A rider’s trip can remain covered without being incorrectly marked as contradicted, while a local driver position is used only when a single active vehicle reports the trip.
* Stale vehicle reports no longer count when determining whether a trip has a single reporting vehicle.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->