Writing

Notes on building Hearso, the product decisions and the engineering ones, written as they happened. Every number in them comes from a run we can point at.

  1. reliability9 min readThe morning a July cron job stopped every container on my MacOne browser test out of seven came back 503. The code had not changed; the machine had, at 10:00:01Z, on a schedule I set two months earlier and forgot.
  2. engineering10 min readreq.nextUrl.origin vs the Host header: what a route handler may trustA browser check wanted 401 and got 403. The value our handlers compared against turned out to mean one thing on the platform it was written for, and something else everywhere else.
  3. testing8 min readOne outside read, 70 files, one finding: the page inside two framesReviewing locally before pushing worked: one finding on 70 files. It was still a real one, because every check I had written asked that page what it said, never how it was framed.
  4. testing6 min readWhat we got wrong about checks that pass when nothing happenedA smoke alarm with a dead battery is silent in the same way as a house that isn't on fire. Eleven real instances from one night, four of them mine.
  5. architecture11 min readHow an answer reaches every screen in Hearso, and where its points goOne tap on an answer, two transports, and a leaderboard on AWS. Here is every hop, what is live, and what is still only running on a laptop.
  6. testing6 min readBreak your own code on purpose before you trust its testsA test that passes the moment you write it is unproven. We spent a night breaking our own scripts one line at a time to find out which tests could actually fail.
  7. testing9 min readWe threw away 38 healthy minutes of a two-hour soak testA two-hour soak of our new Rust WebSocket service passed on the fifth attempt. The four before it failed on sizing, on ordering, and once on a message our own tool wrote.
  8. engineering6 min read7 rules for two agents writing to one shared fileTwo agents spent a night building two halves of one system, talking only through a shared append-only log under a directory lock. Here's what broke, and what I'd set up differently.
  9. reliability6 min readWhy did our Uptime Kuma check stall before it could log in?A monitoring check kept failing for exactly ten seconds and telling us nothing. Getting to the bottom of it took three corrections and one prediction written down in advance.
  10. testing6 min readLine coverage said done. Mutation testing disagreed.The four modules we were most afraid of score 100%. The three handlers we actually ship score 56%, 70% and 76%. Here is what survived, and why coverage never told us.
  11. testing6 min readA benchmark is only as trustworthy as its namespaceA benchmark that cannot be replayed is not a baseline. Our first run left 100 probe players on every board it measured, so we rejected it and moved isolation into the config.
  12. architecture7 min readReads, not writes: what our rank histogram really boundsOur rank query stops counting at 2,000 and falls back to 128 log-spaced counters. It bounds what a rank read costs; it does nothing for writes, and I want to be clear about that.
  13. architecture8 min readAnatomy of a score submission: every write it triggersOne score submission does not cause one write. We counted them, showed the cost arithmetic step by step, and then found the one number anyone has actually measured.
  14. architecture12 min readWe store every score backwards so DynamoDB never has to sortReading the top 25 of a leaderboard is one query with no sorting anywhere, because the sort key stores the score inverted. Here is the whole table design, the reasoning behind it, and the parts we still cannot do.
HearsoHEARSO · LOADING

Loading, 0%

Never goes backwards. Never lies about being done. Under a second on a good day.

ASSETS · STATE · HANDSHAKE
Help improve Hearso

With your permission, we measure basic game usage, safe button/link interactions, and IP-based traffic data. We do not send your email, name, country, answers, or sign-in tokens to analytics. You can change this in Settings after signing in. Hearso also keeps anonymous totals of rounds, players, and live rooms without this permission; see the player guide.