← Back to Pull requests

fix(admin): list a frequency trip's runs when no stop of it is measured #561

Closed
unknown closed this pull request without merging on Nov 22, 2026 15:12 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 11:27 UTC
Author

Since #558 the route day page leaves every frequencies.txt trip out of Scheduled trips and lists its runs in its direction's "Runs to" card instead.
That card's list was built only from the place each run is recorded at its trip's first measured stop. A frequency trip with no measured stop (its only timepoint is its last stop, and no other trip in the direction judges its earlier stops) was skipped, so its runs and their Replay links showed nowhere.
When no trip in a direction has a measured stop at all, routeGaps still keeps the direction, as it keeps any direction with a frequencies.txt trip. So the card and its "41 of 48 runs" line were there, with "No run in this direction." under them.

As the issue suggests, routeGaps now goes through each frequencies.txt trip's runs after the measured stops and adds any run that no stop placed. It shows when it left as not known, with no gap and nothing judged or bunched, and is placed by when it started, the same way a run that ended before leaving already is.
A run with a measured stop goes the same way as before, and a run is only added when it isn't listed yet, so each run appears once. Timetabled trips are left alone, since Scheduled trips lists them.
The change sits in routeGaps rather than directionStops, which keeps it clear of #559. The local runs map is renamed listed because it shadowed the runs parameter the new loop reads.
The report API, openapi.yaml, the CSV and the kept day totals don't change, because the run list isn't serialized and no gap is added or removed. The operator manual gets one sentence saying these runs show "not known".

TestRouteGaps_RunsOfATripWithNoStopMeasured puts GT, whose only timepoint is its last stop, beside GN measured at ST2. It checks that GT's runs come out between GN's by start time with nothing judged, and that GN's runs keep their passings.
TestReportsPage_RouteRunsWithNoStopMeasured makes GS's last stop its only timepoint through the feed's timepoint column, so route 5 south has no measured stop. It checks that the South card keeps its schedule line and lists all five runs with Replay links.
Both tests fail with the fix reverted, and all five mutants of the new lines were caught.
go fmt, go vet and go mod tidy are clean. go test ./... passes against Postgres 17: 1,747 tests, 204 of them database ones, with only TestWriteFeedSnapshots skipped because it needs FEED_SNAPSHOT_DIR. The branch also merges cleanly with #559, and the merged result passes go vet and the main package's tests.

Fixes #560

Diff: 316 lines (+237 / -79) across 3 files Reviewer: aaronbrethorst Review duration: 225m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 316 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.345
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #561"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.4% (MEDIUM) · Higher = larger blast radius
40.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.0% · Safe to merge
16.0%