Skip to content

No manufacturer requests, NHTSA crash-test photos and late-loading complaints, merged onto the tabbed report - #36

Open
keptlive wants to merge 21 commits into
mainfrom
integrate-safe
Open

keptlive wants to merge 21 commits into
mainfrom
integrate-safe

Conversation

@keptlive

Copy link
Copy Markdown
Owner

What this delivers

One branch with everything that is waiting, on top of what is live (main 430b32e: #31 tabs + Price, #32 Tires, #33 clean view, #34 VIN links):

Supersedes #29, #30 and #35 (stacked PRs whose bases are not main).

How the conflicts were resolved

  • lib/recall-status.mjs and its three test files (modify/delete): deleted. Official recall links open on the VIN where possible #34's verified VIN link forms (Honda/Acura, Subaru, Hyundai; Tesla, Ford) were already in lib/recall-links.mjs, now the one link table. Official recall links open on the VIN where possible #34's second copy of nhtsaRecallUrl in app.js is gone: one rendering path.
  • server.mjs: main's market import kept, the recall-status import dropped.
  • public/app.js: late-complaints follow-up kept; the ready line is main's "Report ready." when nothing is loading.
  • public/car-sheet.js: the link-only recall row (it already carries Official recall links open on the VIN where possible #34's NHTSA ?vin=).
  • public/index.html: main's tabs, Price and Tires panels and scripts, plus keep-state.js, test-photos.js, the photo figure, sources section and footer ("Prices from public dealer listings" kept).
  • Privacy page: Official recall links open on the VIN where possible #34's sentence on VIN links folded into the "We do not send VINs to vehicle manufacturers" paragraph. Both Sources lists now name the Price tab's dealer-listing source.

Two bugs that only appeared after the merge (fixed here)

  1. Page jump at desktop width. keep-state.js anchored on the element at the top of the viewport, which is now main's sticky tab bar. When complaints filled in, everything below the complaints card jumped by the card's growth (611 px at 1280 px). Sticky/fixed elements are now skipped (tests/keep-state.test.mjs).
  2. Recall links folded away. The clean view folds everything after "Related model names" under "Show". The "This VIN's recall repairs" block was appended after that, so it vanished for vehicles with related-name campaigns (2019 RAV4). The block now sits before the related section in every state (web test added).

Also: the recall block's paste line ("enter the VIN there" + Copy VIN) and print line are divs, so the clean view's Details fold leaves Copy VIN on screen.

No maker contact: what the new main features fetch

  • Price tab: browser → POST /api/market (same origin) → lib/market.mjs → MARKET_API_URL (default http://10.77.0.1:8791, mcp.vin's own price service on the storage server over WireGuard), GET /market?year&make&model[&trim&vin&zip&miles], 3.5 s timeout. Its data is mcp.vin's own index of dealer websites. The page shows outbound links to dealer listing pages only (no images, no third-party requests).
  • Tires tab, tabs, clean view: no requests (client-side only).
  • tests/no-maker-requests.test.mjs now also drives POST /api/market (price service pointed at a mock private host), /api/vin/{vin}/complaints and /api/vin/{vin}/photo for 11 VINs: outbound hosts must be government hosts or the price service. A maker fetch built at runtime inside lib/market.mjs makes it fail.

Tests

flock /tmp/vin-mcp-test.lock npm test: 243 node tests, 242 pass, 0 fail, 1 skip (decode-evidence.db not built locally); all 10 Python suites OK.

Browser (headless Chromium, 390 px and 1280 px; server allowed government hosts only, price service mocked with answers captured from mcp.vin): 2018 Ford F-150, 2019 Toyota RAV4, 2012 Toyota Camry, 2006 Volvo S40. Every tab (Overview, Price, Tires, Safety, Specs, All) selects and renders, no horizontal overflow. Recall card: campaigns, then the maker button (Ford, Toyota) and NHTSA, Copy VIN for Toyota, NHTSA only for Volvo, never "Checking with". Photos show for the covered VINs and the photo area is absent for the Volvo. Complaints arrive after the report and the card the reader is looking at moves at most 0.7 px. Car sheet prints on one Letter page. No console errors. The page requests nothing outside its own origin (main's page requested cdn.imagin.studio).

Not deployed

Deploy needs: code files, deletion of the six old modules on the server, data/nhtsa-photos/ (storage tar, 14,616 WebP), a rebuilt data/tire-placards.db with the photo table, and https://cdn.imagin.studio dropped from nginx img-src. Exact list in the hand-off notes.

🤖 Generated with Claude Code

root and others added 21 commits November 18, 2026 10:19
The maker's VIN recall lookup now starts right after the decode, beside
NHTSA's calls, and a report waits for it at most 2 s (website, REST) or
6 s (MCP decode_vin), counted from its start. Past that, recall_status is
{pending: true, reason: 'lookup_in_progress', status_url} (unknown, never
'no open recalls') and the lookup finishes in the background, filling its
15-minute cache. Concurrent requests share one lookup; a background
failure is contained. ?recall_wait=full (REST) and recall_wait 'full'
(MCP) wait for it; comparisons always wait.

/api/vin/{vin}/recall-status and MCP vin_recall_status resolve the make
from the decode when the WMI alone does not name the maker, so they join
the lookup a report started.

Also: related-name recall lookups start beside the exact one and run
three at a time; safety-rating details three at a time; the Transport
Canada generation check asks all years at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a report arrives with recall_status.pending, the recall card, the
car sheet's recall row and the decode-checks source line say "Checking
with <maker>..." on screen. The page then asks /api/vin/{vin}?recall_wait=full
(the same running lookup) and redraws only what changed: the status
block, the sheet's recall section and footer, and the decode-check line
(or the decode, engine, fuel and test-vehicle blocks if the maker's
record changed a checked value). keep-state.js keeps typed text, open
forms, focus, the transmission choice and the place on screen.

Printed while pending, the sheet says the maker had not answered when
it was printed (never a "checking" placeholder, never "no recalls").
If the follow-up fails twice, the status reads as not loaded (unknown).

Tests: pure-function budget tests with a gated stub maker lookup, a
server test with Ford's mock page delayed 2.6 s (REST, status_url,
recall_wait, MCP 6 s), and the page's pending, follow-up and print text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/data-sources.md: the budget, the pending shape, status_url, the
shared background lookup, recall_wait, the website's in-place update and
print wording, and why Ford's lookup is slow (Akamai holds each request
about 9-10 s). llms-full.txt: recall_status and recall_wait for REST and
MCP, the recall-status endpoint, manufacturer_record "pending", caching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NHTSA's complaintsByVehicle is the next slowest part of a first report:
measured from the web server on 2026-11-18, a 2020 Ford Escape took
17.3 s, a 2017 Honda CR-V 5.0 s and a 2003 Accord 6.4 s (1.4-2.0 MB).
With the 10 s timeout the Escape's list always failed, so its report
was never cached and every visit waited 10 s again.

- modelYearComplaints: one request per make/model/year at a time, shared
  by reports and /api/vin/{vin}/complaints; successes cached 6 h; the
  request may run 30 s (COMPLAINTS_TIMEOUT_MS).
- The report is assembled without waiting for it. If the list has not
  arrived within the caller's budget (2 s website/REST, 6 s MCP; compare
  waits), complaints is {pending: true, available: false, count: null,
  status_url: /api/vin/{vin}/complaints} - unknown, never zero. The
  complete report is built and cached when the list arrives. The VIN
  page (server-rendered) no longer waits for it either.
- Website: "Loading NHTSA's owner complaints..." then fills the card and
  the car sheet row in place; printed while pending it says the list had
  not arrived. MCP: a note to call decode_vin again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the browser's scroll anchoring (Safari), the shorter status line
moved the page 19 px after Ford's status arrived; inside the redraw it
is part of the measured correction (0 px in the 390 px check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Deletes every manufacturer VIN recall lookup (Ford, GM, Honda/Acura, Nissan, Mopar, Tesla, Subaru, VW, Audi,
Land Rover, Jaguar) and the manufacturer-description parser. recall_status keeps its key but now carries
links only (lib/recall-links.mjs): the maker's own recall page, VIN filled in only where shown, and NHTSA's
VIN recall page; open and completed counts stay null. Decode checks lose the manufacturer-record tier.
The pending/background machinery for maker lookups is gone; NHTSA complaints keep theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on dimensions

Recall card, car sheet row, decode-checks sources line and the comparison table no longer show or wait for a
manufacturer status. They list NHTSA's model-year campaigns, then 'Check this VIN on <maker>'s recall page' and
'Check on NHTSA', with a copy-VIN button where the maker's page does not take the VIN from a link. Print says
'Not checked by mcp.vin' and where to check. Transport Canada dimensions carry the Open Government Licence –
Canada statement with a licence link (car sheet, research page, REST/MCP vehicle_dimensions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d OGL credit

README, data-sources, llms.txt/llms-full.txt, MCP tool directory, FAQ, examples, API guide, api.json and the
printable sheets no longer say mcp.vin reports a VIN's open or completed recalls; they describe the links.
Footers and the Data coverage and privacy pages say mcp.vin is independent and not affiliated with or endorsed
by NHTSA, EPA, DOE, Transport Canada, the Federal Reserve or any manufacturer, list the sources with their
official addresses, and carry the Open Government Licence – Canada statement for Transport Canada data. The
privacy page says VINs are no longer sent to manufacturers. Asset versions and tool directory regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
import-aala, import-theft-rates, import-epa-test-cars, import-fueleconomy, build-nhtsa-photos and vpic-refresh
now send 'mcp.vin-importer/1.0 (+https://mcp.vin)'. One small request each on 2026-11-18: federalregister.gov,
epa.gov, fueleconomy.gov, nrd-static.nhtsa.dot.gov and vpic.nhtsa.dot.gov accept it; www.nhtsa.gov (AALA PDFs)
answers 403. Not worked around: import-aala stops with a clear message and reads files saved by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/mock-upstream.mjs no longer falls through to the network: anything it does not answer is refused and logged
(MOCK_OUTBOUND_LOG). tests/no-maker-requests.test.mjs fails if a maker hostname appears in server-side code outside
the link table, if the link table could make a request, or if any report path (REST report, recall-status,
comparison, VIN page, MCP decode_vin and vin_recall_status) asks a non-government host; an injected Ford fetch was
caught. New tests for the link table and the web recall block; maker-status tests and fixtures (including real
maker reply shapes in decode-checks.test.mjs) removed. Rule fix rf-008's served reason drops the quote of
Volkswagen's VIN record (stored data unchanged); links render only for https URLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… VIN button

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/data-sources.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's report tabs, Price tab, Tires tab, clean view and Details layout stay as built. From the stack:
NHTSA complaints load after the report, NHTSA crash-test photos replace IMAGIN, every manufacturer
recall lookup is gone (recall status = links to the maker's page and NHTSA's), sources and
independence statements, Transport Canada licence credit.

Conflicts:
- lib/recall-status.mjs and its three maker test files: deleted (safe-sources). #34's verified VIN
  link forms (Honda/Acura, Subaru, Hyundai; Tesla, Ford) already live in lib/recall-links.mjs, the
  one link table; #34's copy of nhtsaRecallUrl in app.js is dropped, one rendering path remains.
- server.mjs: main's market import kept, recall-status import gone, new report exports kept.
- public/app.js: the late-complaints follow-up kept; the ready line is main's "Report ready." when
  nothing is still loading. The recall block's paste line and print line are divs, so the clean
  view's Details fold (later <p> without a link) leaves "Copy VIN" on screen.
- public/car-sheet.js: the link-only recall row (carries #34's NHTSA ?vin=).
- public/index.html: main's tabs, panels and scripts plus keep-state.js, test-photos.js, the
  NHTSA photo figure, the sources section and footer ("Prices from public dealer listings" kept).
- Privacy: #34's sentence on VIN links folds into the "We do not send VINs to vehicle
  manufacturers" paragraph; both Sources lists name the Price tab's dealer-listing source.
- tests/no-maker-requests.test.mjs also drives POST /api/market (price service pointed at a mock
  private host), /complaints and /photo: government hosts and our own price service only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report's tab bar (#31) is sticky at the top of the viewport. keep-state.js anchored on the
element at the top of the viewport, which was now that bar: it never moves, so when NHTSA's
complaint list filled in, everything below the complaints card jumped down by the card's growth
(611 px in a 1280 px browser check). Sticky and fixed elements are skipped when choosing the
anchor, with one more probe point below the bar. tests/keep-state.test.mjs covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clean view (#33) folds everything after the "Related model names" heading under "Show". The
"This VIN's recall repairs" block was appended after that section, so for any vehicle with
related-name campaigns (a 2019 RAV4 in the browser check) the maker and NHTSA links were folded
away. The block now sits after this model name's campaigns and before the related ones, in every
campaign state (listed, none, NHTSA unavailable). Web test covers the order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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