audit(data): vehicles + customs duty provenance#39
Merged
Conversation
PART A — Vehicles All 18 records in lib/data/vehicles-ref.json carry per-record `provenance` (≥2 sources each: EU Directive 96/53/EC, UK gov.uk weights & licence categories, 49 CFR Part 393 / FMCSA 393.5 for US trailers, plus manufacturer published specs from Schmitz Cargobull, Krone, Faymonville, DAF, Mercedes-Benz, VW, Ford, Wabash National) plus `auditedAt: "2026-05-16"`, `verified: false`, and a record- specific `decisionRationale` citing the binding regulation and the manufacturer match. lib/calculations/vehicle-ref.ts gained a `VehicleProvenance` interface (snake_case `accessed_at` on source items, camelCase `auditedAt` / `decisionRationale` matching the container-capacity.ts pattern from PR #36). app/api/vehicles/route.ts now surfaces the provenance block snake- cased: `provenance.{sources, audited_at, verified, decision_rationale}`. Additive — no breaking change for existing callers. PART B — Customs duty lib/calculations/duty.ts gained a top-of-file methodology docstring + a structured `DUTY_METHODOLOGY` constant: the four-step formula (CIF → duty → VAT → totals), Trade Tariff measure-type resolution (103 third-country, 142 preferential, 305 VAT, 695 anti-dumping, 277 restrictions), 8 HMRC source URLs, `audited_at: "2026-05-16"`, `verified: false`, and decision rationale. app/api/duty/route.ts gained a GET handler: GET /api/duty?methodology=true → DUTY_METHODOLOGY Any other GET shape returns 400 with the api-docs link. POST is unchanged. lib/data/duty-sample-fixture.json anchors 10 high-volume HS headings (0901 coffee, 2204 wine, 6110 jerseys, 8471 computers, 8703 motor cars, 3004 medicaments, 7113 jewellery, 4011 tyres, 9504 game consoles, 0207 poultry) to expected description substrings + common origins + canonical Trade Tariff URLs. Data only this sprint — smoke assertions are a follow-up chore. DISCIPLINE Sandbox HTTPS allowlist did not include eur-lex.europa.eu, gov.uk, trade-tariff.service.gov.uk, the manufacturer domains, ecfr.gov, fmcsa.dot.gov, unece.org, or en.wikipedia.org on this audit pass. Per the rule "no field changes without primary-source backing", NO field values were mutated. Every record + the methodology carry `verified: false` until a future audit pass with HTTPS access can re-fetch and diff. DOCS - docs/audit/vehicles-customs-completeness-2026-05-16.md — per-field gap report (18 vehicles, methodology, fixture). - docs/audit/vehicles-customs-verification-2026-05-16.md — what was verified, what was deferred, runbook for flipping verified: false → verified: true once HTTPS access is restored. FAULT 5 — CHANGELOG.md + lib/changelog-data.ts entries added for 2026-05-16. No new public page, no sitemap entry needed, no MCP surface affected. Existing /api/vehicles + /api/duty routes still audit-wrapped (lint:audit confirms). lint:api-casing confirms 38 route files clean — snake_case throughout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Miscounted the source dataset; the live API meta.total flagged it (returned 17). Updates four files: - docs/audit/vehicles-customs-completeness-2026-05-16.md — total count, per-category breakdown (9 artic / 5 rigid / 3 van), EU/US split (15 / 2), eur-lex citation count (10 records, not 8). - docs/audit/vehicles-customs-verification-2026-05-16.md — "all 17 records" + the blocked-domains table count. - CHANGELOG.md and lib/changelog-data.ts entries — "17" not "18". No code change; no field-value change; provenance count unchanged (17/17 = 100% as already documented). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
SoapyRED
added a commit
that referenced
this pull request
May 16, 2026
The May 16 vehicles + duty changelog entry's title still said "18 vehicles" after PR #39 merged. The desc body was correct (17) since the count-correction follow-up commit on the audit branch only updated `desc`, not `title`. Fixes the visible /changelog title to match the actual dataset count. Co-authored-by: SoapyRED <soapyred@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
SoapyRED
added a commit
that referenced
this pull request
May 16, 2026
Bumps Last-updated 9 May → 16 May. Captures the 17 PRs landed across 2026-05-13..2026-05-16 (PR #25 through PR #41) plus the 14 May infra changes that didn't have their own PR (Cloudflare disconnect, Upstash PAYG, IndexNow live). Sections refreshed: - Sprint cadence 13–16 May (new): full PR list with one-liner per PR. - Platform: MCP v2.1.0 → v2.1.1; route count 36 → 38. - Infrastructure changes (new): CF Workers disconnected 14 May, CF DNS- only / Vercel firewall is sole edge security, Upstash PAYG $20 cap, CLAUDE.md at root encodes FAULT 5 + FAULT 14, IndexNow workflow live. - Data integrity status (new): table for ULD / Airlines / ADR / Containers / UN-LOCODE / HS / Vehicles / Customs-duty. ULD + Airlines + ADR verified: true; the other 5 verified: false pending allowlist extension (specific domains enumerated). - Scraper defence status (new): PR #31 / #32 / #33 / #38 live, Phases 3+4 deferred to runbook, Phase 2 skipped. - Edge firewall: scoped to Vercel-only (CF inert now). - Distribution surfaces: table with current download counts, Smithery score, MCP Registry STALE flag, Glama description STALE flag. - Weekly digest CLI (new): six FAULT 14 invariants summarised; points at scripts/weekly-digest/README.md for the full spec. - Vercel Analytics: 30-day baseline updated (3,311 visitors / 6,070 PV / 69% bounce / SG 73%). - First validated user signals: Tom (CEVA) preserved + Simon's team organic adoption added per 16 May report. - What's blocked / What's next / Red flags: updated to reflect today's reality — vehicles+customs SHIPPED (#39 #40), weekly digest SHIPPED (#41), Make.com Town Hall 21 May 4PM BST queued, CEVA→WFS transition complete with week 2 of induction pending. - Canonical references: added pointers to scripts/weekly-digest/ and the IndexNow workflow. No CHANGELOG entry — internal doc, not user-visible. Per the prompt. Co-authored-by: SoapyRED <soapyred@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <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.
Summary
Data-integrity Sprint E — vehicles reference dataset + customs duty methodology.
Part A — Vehicles
lib/data/vehicles-ref.jsoncarry per-recordprovenance(≥2 canonical sources each — EU Directive 96/53/EC, UK gov.uk vehicle weights & licence categories, 49 CFR Part 393 / FMCSA 393.5 for US, plus manufacturer specs from Schmitz Cargobull / Krone / Faymonville / DAF / Mercedes-Benz / VW / Ford / Wabash National) +auditedAt: "2026-05-16",verified: false,decisionRationale.lib/calculations/vehicle-ref.tsextendsVehicleSpecwith the mandatoryprovenance: VehicleProvenancefield (mirrors thecontainer-capacity.tspattern from PR #36).app/api/vehicles/route.tssurfaces provenance snake-cased —provenance.{sources, audited_at, verified, decision_rationale}. Additive; no breaking change.Part B — Customs duty
lib/calculations/duty.tsgains a top-of-file methodology docstring + a structuredDUTY_METHODOLOGYconstant — formula (CIF → duty → VAT → totals), Trade Tariff measure-type resolution (103 / 142 / 305 / 695 / 277), 8 HMRC source URLs,verified: false, decision rationale.app/api/duty/route.tsgains aGEThandler:GET /api/duty?methodology=true→DUTY_METHODOLOGY. Any otherGETshape returns 400 with the api-docs link.POSTis unchanged.lib/data/duty-sample-fixture.json— 10-code regression fixture (0901 coffee, 2204 wine, 6110 jerseys, 8471 computers, 8703 motor cars, 3004 medicaments, 7113 jewellery, 4011 tyres, 9504 game consoles, 0207 poultry). Anchors expected description substrings + common origins + canonical Trade Tariff URLs. Data-only this sprint; smoke assertions are a follow-up chore.Discipline
Sandbox HTTPS allowlist did not include
eur-lex.europa.eu,gov.uk,trade-tariff.service.gov.uk, manufacturer domains,ecfr.gov,fmcsa.dot.gov,unece.org, oren.wikipedia.orgthis audit pass. Per the rule "no field changes without primary-source backing", NO field values were mutated. Every record + the methodology carryverified: falseuntil a future audit pass with HTTPS access can re-fetch and diff per the runbook in the verification doc.Audit docs
docs/audit/vehicles-customs-completeness-2026-05-16.md— per-field gap report (18 vehicles, methodology, fixture).docs/audit/vehicles-customs-verification-2026-05-16.md— what was verified, what was deferred, runbook for flippingverified: false→verified: true.FAULT 5 checklist applied
lib/changelog-data.tsentry added so/changelogrenders itwithAuditRestwrap intact on /api/vehicles and /api/duty (lint:audit PASS — 20 in-scope routes wrapped)lint:api-casingPASS — 38 route files clean, snake_case throughoutlint:seo-titlesPASS — 4 detail templates + 4 index pages clean, builders pass 21 fixturesnpx tsc --noEmitexit 0)freightutils-mcpversion bump, no README update)Test plan
curl -s {preview}/api/vehicles?slug=standard-curtainsider | jq '.result.provenance.sources | length'→ expect ≥ 2curl -s {preview}/api/vehicles?slug=us-53ft-dry-van | jq '.result.provenance.verified'→ expectfalsecurl -s {preview}/api/vehicles?slug=luton-van | jq '.result.provenance.audited_at'→ expect"2026-05-16"curl -s {preview}/api/duty?methodology=true | jq '.sources | length'→ expect 8curl -s {preview}/api/duty?methodology=true | jq '.verified'→ expectfalsecurl -X POST {preview}/api/duty -H "content-type: application/json" -d '{"commodity_code":"0901","origin_country":"BR","customs_value":5000}' | jq '.commodity_description'→ expect substring match "Coffee"https://www.freightutils.com/changelogrenders the new May 16 vehicles + duty entry🤖 Generated with Claude Code