Yesterday morning the first run of a new nightly job compared a few days of riders' measured rides with our timetable. Across nearly every pair of stops and every hour, the rides came out at about 60% of our times.
The pull request that explains it opens with the obvious: "Buses are not that fast." Switched on, the job "would have put every bus on the board too early." Worse, the check that grades it, judging against the same rides, "would have called that right." Nothing was switched on, so no rider saw it.
This post is about the week that got us there, and the eighteen months before it.
LIVE until the nightly rebuild
Part one explained why the timetable in the app is approximate. The schedule lists departures from the ends of each line, and everything in between is our guess. Every edge between two stops has one. The first lines were timed with a stopwatch from a bus seat. The network has been redrawn many times since, and many of the newer edges started from the car's driving time between the two stops, plus half a minute to a minute for the stop and the slower bus. Intercity lines are the easy case: their operators publish times for the stops in between, so we use those.
The bus company itself has never listened to us or answered us, not once. For them, as far as we can tell, we don't exist. So there is no GPS feed, and we don't expect one. If the app is going to know where a bus is, riders will have to tell it.
Since May 2025 they could, a little. The phone notices a ride between two stops and sends the trace, the server checks it four ways, the rider says which line it was, and the nearest scheduled run gets the measured times. The app shows those as LIVE. The flag for it had been in the database since January 2025; nothing set it for four months.


Then look at how long anything lived. The request carrying a rider's measured time was kept for 24 hours. The corrections built from it lasted until 04:05 UTC, when the nightly rebuild threw them away. The proposal that replaces all this puts it plainly: "every leg time a rider ever measured is deleted within a day, and the corrections built from them within a night. Nothing can learn from it, nobody can audit it, and there is nothing to give the town hall." And while it lasted: "Last write wins. A second rider on the same run overwrites the first; one wrong rider beats three right ones."
It also barely worked, in the way part five would recognise:
- August 2026: "The feature shipped but was never seen in production." Since a migration in May 2026, every contribution had been refused before any check ran: the lookup of the road between its two stops found nothing.
- September 3: the endpoint answered "401 'Invalid signature' to every real ride." That included the Flutter app in the stores: "Contributions do not work in the shipping Flutter app either." And nobody could tell, by design: "A refused contribution is deliberately invisible to the rider … so the only symptom is an app that never asks about a bus."
- September 4: contributions "only ever worked on edges that came from the 2024 YAML import." The newer edges stored their shape in the other of the two encodings from part five. The same day, a fix titled "Three point eight metres decided a ride was not a contribution": two stops on opposite sides of a road, 33.1 and 36.9 metres from a rider, and on one real ride "four of seven legs failed this way."
- This Monday: when a rider rode on from stop A, their delay overwrote the timetable's leg into A instead of shifting the whole run, so "every stop from A onward was shown early by about one leg." The bug was from May 2025. Its test "asserted the buggy result."
Keep every leg
On Monday evening six proposals went in at once: keeping observations, intercity buses, leg times, trust, sightings and insights. The first one calls itself "the foundation the other five stand on": they all need "a durable record of what was observed, by whom, and how much it was believed." The pull request also recorded what learning is allowed to touch: learned leg times change the scheduled times "through the vector, never through the operator's departure times."
By Wednesday it was deployed: every measured leg goes through a Cloudflare pipeline into an Iceberg table in R2, append-only, and we can query it with R2 SQL. "Not D1." Everything that reads observations is a batch job scanning months, and it would "compete with the live board for the same database."
A record is one leg: the two stops, the times, the seconds it took, what the timetable said at the time, the delay, a random ID for the phone (linked to your account once the phone has sent anything while you were signed in), the account if you're signed in, and how much we believe it. Records are never updated: "a leg is events, not a row that is updated." Legs nobody confirmed are kept too: "Most riders never answer the question card", and those legs "are the bulk of the data." Legs the server rejected are kept without their trace, so the checks can be tuned. And recording never gets in a rider's way: "an observation that fails to land is a hole in the data, logged, never a failed request."
The raw traces are deleted after 90 days, "short enough not to become a location archive." The legs are to be kept for 400, because "a year-on-year comparison is the first thing a town hall asks for."
The first data file in the table, Wednesday's, held 248 legs from 37 phones, touching 115 of our 341 pairs of neighbouring stops. By Friday's first proper count it was 677 legs from 99 phones over two days, on 171 pairs. Reading it costs about a hundredth of a cent each time the readiness map in our dashboards loads.
Who said so
Data from strangers' phones needs to know whose it is. Since Wednesday every leg carries a weight: 0.5 for an anonymous phone, 1 for a signed-in rider, and 0 for anyone in shadow. Shadow is the quiet kind of block: "Shadow refuses nothing". The rider sees the same app and gets the same points, and their data counts for nothing. "Shadow is the default for suspected abuse: it gives the abuser nothing to adapt to." There are also kill switches, and real blocks for when quiet isn't enough.
For scale: on Wednesday riders confirmed somewhere between 100 and 200 rides a day, and none of them came with an account, because no app sent one yet. The app change that sends it went out in 3.0.4.
That changed what the app says. Its screens used to tell people "Only the route is sent, never who you are…" Now they spell out what goes with the route: "an anonymous ID for this phone, and your account if you are signed in. The route is deleted after 90 days; the stops and times are kept to improve the timetable." Signed in, a leg carries your account ID — not who you are.
Factors on our first guess
On Friday afternoon the first two phases of the leg-times proposal were merged, along with pins and the route planner.
The problem it states is that "every run of a line has the same leg times, at 02:00 and at 13:00 on market Friday." The goal is "a timetable that says what will happen rather than what was once estimated."
The method doesn't replace our guesses; it learns a factor on top of each: measured time divided by guessed time, for each pair of stops, by weekday and hour. Factors are kept by pair, not by line, so a new line over existing stops starts out corrected. And there's a second, town-wide factor, so something like "after midnight buses take 0.85× the guess" is learned from the whole network in days, and applies to legs nobody has ridden.
There's no minimum number of rides before anything counts. Each estimate starts from a broader one, the same pair at any hour, say, and moves towards what was measured by n ÷ (n + k), where n counts days with rides, not rides: "five riders on the same jammed bus are one piece of evidence." "One rider is enough." Our product owner's sketch became the test: one night bus 15% off moves that weekday-and-hour by 10% and the hour by 5%, and a second day makes them 12% and about 7%. The town's all-day factor is much more sceptical, "so one bus does not move every hour of the day." And for jams: "One jam is a small piece of evidence; a jam every time is the leg."
Then the brakes. Factors stay between 0.6 and 1.6. Old evidence halves in weight every 35 days. And every night, yesterday's rides are scored against the factors from the night before. If, over the last 14 days and at least 30 rides, the corrections miss by more than our plain guesses do, the nightly build stops applying them. "A person looks before it comes back on."
Each town has a switch: off, shadow or on. In shadow, everything is learned and scored and nothing is shown. If the switch can't be read, it counts as shadow, so an outage of our flag service never turns anything on. When it's on, the corrected times reach the departure board, the route card, the route planner, and the GTFS feed from part five, so Valhalla follows at its next rebuild. That feed stays private.
Every code pull request that afternoon said what it hadn't checked. Phase one's: "The job has not run against production rides. The first run after deploy is the first."
Buses are not that fast
That first run was Saturday morning, and it read 0.6 nearly everywhere.
The app times a ride "from the last fix inside the origin stop's 50 m radius to the first fix inside the destination's." That's the time between the two stops. Our guess, like any timetable, is the hop: from arriving at one stop to arriving at the next, with the time standing at the stop in it. Where a guess came from a driving time, part of the half a minute to a minute we added was for the stop, and the stop is exactly what a ride leaves out. Dividing one by the other reads every leg short.

The fix was in by Saturday afternoon. A rider who stays on the bus gives us the missing part: "Their legs chain", and the gap between one ride ending at a stop and the next starting there is the time the bus stood at that stop. It only counts on the same phone, within ten minutes, and on the same line when both rides name one. "A stop resolved to its twin across the road … does not chain. That loses a sample; it never invents one." Stops and rides are learned apart, because different things move them: "a flight landing fills the bus … rain slows the road."
The same change restarted the scorecard, on hops. Nothing had been decided on it yet: every town was in shadow.
Tell other riders
Measuring needs a ride. Plenty of what people know at a bus stop doesn't: the bus is late, it's here, it never came. Since Wednesday on the server, and in the app since 3.0.4, a bus's card has a Tell other riders button: here now, late by 5 to 45 minutes, didn't come, left early, full or didn't stop.
It shows as a report, never as LIVE, in amber: "Reported 12 min late · 2 riders · 4 min ago." A signed-in rider counts alone. An anonymous one counts if they're at the stop, or once someone else agrees within ten minutes. "Didn't come" always needs two people. And a measured ride clears the reports for that bus, "because measured replaces hearsay." One small rule I like: "A report button never asks for permission."
Spot a bus
Rides only measure buses that have riders with the app on them. The proposal: "Intercity runs, early mornings and the edges of the network are exactly where that is rare." Its one-line pitch: "Pokémon Go for buses."
You point the phone at a bus. It reads the sign on the front, and the server matches that against the buses due nearby. The plan on Monday was a hosted vision model. What shipped is "The phone reads; the worker decides." Text recognition comes with the system on both: Apple's Vision on iOS, and Google's ML Kit, through Play services, on Android. "No model is in either bundle."
On 180 photos of buses in Spanish cities from Wikimedia Commons, with each true line hidden among five others, the iPhone's reader and our matcher pick the right line for 72% of the 111 readable signs, and a wrong one 0.2% of the time. Android's reader hasn't been scored on them yet. The test set's own warning: "Read this as an upper bound." Those are buses in daylight, square on, standing still, and not Torrevieja's fleet. On the first four real photos from Torrevieja "the bus was a street away and nothing was read." So now, when nothing that could be a line number was read, it goes over the photo again in twenty small tiles.
It's also a game. Points for a sighting, more for a line you haven't spotted before, a season per calendar month in Spanish time, and the top ten kept "so a prize can be sent." The proposal is candid that "the board can be climbed by tapping". For now, what holds that down is a cap of twenty a day, half points for a bus somebody has just confirmed, and a person looking at the top before any prize goes out.
Here it is on two photos from a street in Torrevieja, a bus a block away and one seen from behind, then on two close-ups from Wikimedia Commons, and the monthly board.
And sightings and rides together give live buses: a bus on the map where somebody has just seen it. No phone streams where the bus is. A confirmed ride puts the bus on everyone's map, and from there it follows its line on the timetable's clock. A rider who stays on carries it a stop further; past the last stop anybody vouched for, it runs on for a little as a dotted guess and fades out. Two rules: "It never shows a bus nobody saw." And "What is published is a timetable, not a position."
All of it is behind developer switches, off by default: for now it's "a way for us to collect the first photos."
Today I took it for its first walk, from TestFlight. I also pointed it at my laptop on the desk, and it locked on to a bus, three metres tall, about six metres away.
- A laptop is not a bus. The iPhone had been asking what it was looking at all along: "We were, and nothing read the answer." Now the biggest objects in the frame are each classified, and from the next build the screen says NOT A BUS · LAPTOP 88%. On the test photos, pictures with no bus that still got a bus outlined went from 76 of 104 to 20, and of the set's 173 photos that do show a bus, the same 168 are still found. Android's labeller called my laptop "a 'Musical instrument' at 95%", so on Android it just says NOT A BUS.
- Stricter rules, from my notes of that walk: no bus in the photo, no points; no more than five photos in ten minutes or one bus a quarter of an hour, on top of the old twenty a day; and anyone too lucky, or too often wrong, goes to review, which quietly puts them in shadow. "a second phone is not a second rider." There is no page for the reviews yet.
- Live buses now follow the road, easing through bends, and slowing for signals once our own Valhalla answers. Measured on two rides exported from the app, the road's shape alone puts the bus 43 metres off on average, against 40 for one constant speed: "for the eye, not for accuracy."
- Still true: learned leg times are in shadow everywhere, and Spot a bus and live buses are behind developer switches.