Repository navigation
Conversation
Reports showed IMAGIN.studio renders under an unlicensed demo customer id. The photos block now holds the test lab's photos of the car NHTSA tested (before the test, then after each crash test of that model year), chosen by file name, resized to WebP and served by mcp.vin itself. - scripts/nhtsa_photo_select.py: file-name rules, fail closed - scripts/nhtsa-photo-manifest.py, scripts/build-nhtsa-photos.py: manifest, one-time download and resize on a build server - scripts/import-tire-placards.py: photos table from data-src/test-vehicle-photos.jsonl - lib/test-photos.mjs + lib/tire-placards.mjs: which tested car (same body, cab, doors and generation), crash views per test kind - /api/vin/:vin/photo redirects to the first photo or answers 404 - site: photo strip with captions naming the test car and test; no photo area when there is none; IMAGIN removed from pages, docs and privacy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crash views are the whole car after each test (the impact-moment photos are mostly 222x127 web thumbnails); unknown struck side gives no view - newer NHTSA listings name files by the lab's long name: stems vNNNNNNnnn from the listing index, URL paths percent-encoded - tests: file-name rules on real names from five labs (2007-2025), choice per test, importer checks, image build stop rules; lookup tiers, shape and generation rules, null cases; the page script's URL and caption rules - /api/vin/:vin/photo answers 404 with photos null when there is no photo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
data-src/test-vehicle-photos.jsonl is built from the full image build (511.6 MB of WebP, kept outside git). 218 photos of 59 of the newest tests are not in it: NHTSA's photo host answered HTTP 502 for them and the build stopped as designed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the IMAGIN.studio photos. Reports were loading them under IMAGIN's
customer=demoid, which mcp.vin has no licence for, and they now show an "Access error" image. Reports now show NHTSA's own photos of the vehicle it crash-tested, served from mcp.vin.Base:
fast-first-report(#29, still open). Merge #29 first.What a report shows
photosisnulland the page has no photo area./api/vin/:vin/photoanswers 302 to the first photo, or a JSON 404 (photos: null).test_vehicle_specs, with stricter rules.How photos are chosen and built
scripts/nhtsa_photo_select.pyreads the test lab's file names and fails closed. Labels, dummies, interiors, underbody, close-ups and camera names (IMG_1234) are never used. I checked the rules on contact sheets of 57 tests from all 5 labs, model years 2007 to 2025.scripts/build-nhtsa-photos.pydownloaded each photo once on the storage server: one connection, 1 request per second, a generic client name. It stops on 429, 5xx, or three 403s in a row. Each photo becomes a WebP that fits 960x720 (q74) plus a 320x240 thumbnail, with metadata stripped.data-src/test-vehicle-photos.jsonlis the index: 1,840 tests and 7,308 photos. The importer puts it in tablephotosofdata/tire-placards.dband drops any photo whose files are missing.Coverage
Model years 2025 and 2026 are low because NHTSA's photo host answered HTTP 502 for the newest tests near the end of the build. 218 photos of 59 tests were left out. The build is resumable.
Deploy (owner only, not done)
/opt/vin-mcphas uncommitted edits. Then copy the changed files:git diff --name-status fast-first-report..nhtsa-photos. Deletelib/photo.mjs./root/nhtsa-photos/deploy/nhtsa-photos-2026-11-18.tar: 523.7 MB, 1,840 folders, 14,616 WebP files. sha256a07bfc1f8e42fa8629ed4280a2d3a3292c256f4523e25f087bd096cdc5b7f5e6. Unpack to/opt/vin-mcp/data/nhtsa-photos/, for example by streaming it through the phone:ssh root@104.37.188.237 cat /root/nhtsa-photos/deploy/nhtsa-photos-2026-11-18.tar | ssh root@192.210.135.200 'tar -xf - -C /opt/vin-mcp/data'The web server has 5.2 GB free (92% used), so this leaves about 4.7 GB.
cd /opt/vin-mcp && npm run import:test-vehiclesafter the folder is in place. Expectphotos.rows1840,photos.photos7308,photos_dir_verifiedtrue,photos_missing_files_left_out0.systemctl restart vin-mcp.BASE_URLis unset, so URLs usehttps://mcp.vin, which is correct./etc/nginx/sites-available/mcp.vinline 55, drophttps://cdn.imagin.studiofromimg-src. The header becomes:default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self'; frame-ancestors 'none'Then run
nginx -t && systemctl reload nginx..webpalready goes through the static location block to express.curl -I https://mcp.vin/nhtsa-photos/14086/v14086P014-960.webpanswers 200 image/webp.curl -sI https://mcp.vin/api/vin/5N1DR3BD8NC239595/photoanswers 302./1HGCM82633A004352shows no photo area.Tests
flock /tmp/vin-mcp-test.lock npm test: 277 node tests pass, 1 skipped (data/decode-evidence.dbis not built here); all Python suites pass. New tests:tests/nhtsa_photos_test.py(14) andtests/test-photos.test.mjs(7).show_photosoff, the area is hidden.🤖 Generated with Claude Code