Statpro, a sports stats site, writes short sports facts automatically, so one question decides whether anyone trusts it: how do I know the numbers are right? My answer used to be "I check them," which is as convincing as it sounds. This week the system started grading its own homework.
Every claim has to win twice
A detector scans the stats for notable moments and writes claims like "his 12th career game with 3+ steals." Each claim is now replayed through Ask, the same plain-English question box that members use. If the numbers come back different, the claim is dropped. The scan metrics keep score: how many claims were checked, how many matched, how many failed.
The replay is a few lines, and the whole trust model rests on it:
// Replay each claim through the public Ask route before trusting it.
const answer = await ask(`Did ${player} record ${stat} last night?`);
if (numbers(answer) !== numbers(claim)) {
metrics.askReplayMismatch++;
return drop(claim, "disagreed with the live answer");
}
metrics.askReplayMatched++;
Shadow mode caught the first bug
A new group of related stats spent days generating in shadow mode, which means computed and stored but not shown to users. Nothing shipped, but every metric and replay check ran as if it did. Then a real scan with publishing switched on rolled back on a mismatch count of 27. The cause was embarrassing: the sentence parser compared one string that had spaces against one that didn't. The fix was one line.
Production had moved in stages: scan with the publisher off, turn it on for one group of stats, then let the web surfaces read it. Each step was its own commit with its own reason. By the time the bug arrived, a rollback was routine.
Two habits to copy
- Grade generated claims by replaying them through the product's own public question route. Two independent paths must agree before a reader sees anything.
- Run the whole pipeline in shadow with real metrics first, so the first production bug is a rollback instead of an apology.
Last week's cleanup handled answers going stale. This one keeps a wrong fact from shipping at all.