Skip to content

Find the car when the two databases call it different things, and stop waiting on a map server - #7

Merged
ralyodio merged 1 commit into
mainfrom
worktree-automotive-and-ai-incidents
Sep 6, 2026
Merged

Find the car when the two databases call it different things, and stop waiting on a map server#7
ralyodio merged 1 commit into
mainfrom
worktree-automotive-and-ai-incidents

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Two things the live deployment showed that the local one could not.

The two databases do not call a car the same thing

vPIC decodes a VIN to Outback. The EPA lists Outback AWD and Outback AWD Turbo for the same year. The exact-match lookup therefore found nothing, and a real request came back with no mpg, no engine and no fuel type:

GET /api/v1/automotive/vehicle/2019/Subaru/Outback   (before)
  recalls 3 · complaints 1033 · rating 5 · mpg undefined   ← economy section empty

When the exact name misses, ask the EPA what it calls that make's models that year and take the closest, in this order: ours-plus-a-qualifier (OutbackOutback AWD), then ours-minus-one (Civic HatchbackCivic), then a loose containment match, then null rather than the wrong car. The response carries matchedModel whenever it is not the name that was asked for, so the substitution is never silent.

This was not a rare edge: it affects any model whose EPA name carries a drivetrain or body qualifier, which is a large share of the catalogue.

A cold map server should not hold up an airbag recall

One cold profile took 49 seconds; the same profile warm was 0.2s, and without the places lookup it was 2.9s. The whole difference was a cold Overpass mirror.

Inside a vehicle profile the map now gets 9 seconds and two mirrors. The other five sections are already answered, and nobody should wait on repair-shop names to be told their airbag is recalled. Overpass is also told the same budget as its own server-side [timeout:], so it stops working on an answer no one is waiting for instead of grinding to completion.

/mechanics asked on its own is still patient (25s, all three mirrors) — it has nothing else to return. Either way the tile is cached for a week, so one caller waits and nobody after them does.

Verified

  • 114 tests pass (1 new, covering the matcher's four cases including the null), biome clean
  • Measured live before the change: cold-with-places 49.2s, cold-without 2.9s, warm 0.2s

🤖 Generated with Claude Code

https://claude.ai/code/session_012BzJdwiBGU9hmMGE5fBxjA

…p waiting on a map server

Two things the live deployment showed that the local one could not.

vPIC decodes a VIN to "Outback". The EPA lists "Outback AWD" and "Outback AWD
Turbo" for the same year, so an exact match found nothing and a 2019 Outback
came back with no mpg, no engine and no fuel type. When the exact name misses,
ask the EPA what it calls that make's models that year and take the closest:
ours-plus-a-qualifier first, then ours-minus-one, then the loose match, then
nothing rather than the wrong car. The answer says which name it matched on.

And a cold Overpass mirror turned a three-second profile into a forty-nine
second one. Inside a profile the map now gets nine seconds and two mirrors,
because the other five sections are already answered and nobody should wait
on repair-shop names to be told their airbag is recalled. Overpass is told the
same budget as its own server-side timeout, so it stops working on an answer
no one is waiting for. /mechanics on its own is still patient, and either way
the tile is cached for a week: one caller waits, nobody after them does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012BzJdwiBGU9hmMGE5fBxjA
@ralyodio
ralyodio force-pushed the worktree-automotive-and-ai-incidents branch from 798f3e2 to f30ce56 Compare September 6, 2026 08:22
@ralyodio
ralyodio merged commit 2850e66 into main Sep 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant