Replace nhtsa_vin gem with a built-in NHTSA vPIC client

The nhtsa_vin gem is unmaintained (last release 2019, source repository
gone). VinDecoder now calls NHTSA's free vPIC DecodeVinValues endpoint
directly with Net::HTTP and JSON from the standard library.

- Same fields as before (year, make, model, trim, doors), plus body
  class, engine and NHTSA's warning text
- Sends the year on file as NHTSA's model-year hint
- Decodes NHTSA flags with a warning (e.g. wrong check digit) still count
  as decoded; no make/model is a final failure with NHTSA's explanation
- Network errors, timeouts, bad responses and HTTP 403/429/5xx raise
  TransientError, so the job retries
- Makes are title-cased from NHTSA's capitals, keeping short
  abbreviations (GMC, RAM, BMW)
- Removes the gem from the Gemfile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
Claude committed 2026-10-28 23:20:24 -04:00
1 parent 0a3c73482a
commit 3f0455c6d5
3 files changed
+134 -18

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
source 'https://rubygems.org'
gem 'nhtsa_vin'
# No extra gems: VIN decoding talks to NHTSA's vPIC service directly (app/services/vin_decoder.rb)