Legacy damage codes and external standards
The existing aiag_codes API field contains proprietary Verify legacy codes.
Strings such as DFR-SC-1 are not verified official AIAG M-22 codes. The field name,
values and deterministic transforms remain unchanged for compatibility.
Legacy fields
toAiagCodes() in lib/verify-ai/damage/grading.ts uses the version 1.0.0
legacy table. An area abbreviation, defect abbreviation and old severity rank
form the string. For example, a light scratch on car_door_fr produces
DFR-SC-1. The old bands are light=1, medium=2 and severe=3; none produces no
code. Identical strings are deduplicated and sorted. Unknown legacy panels or
types retain their historical OT fallback. This fallback does not authorize
an equivalent fallback in an external standard.
k_grade is a separate Verify legacy aggregate. It is not M-22 measured
severity, NAAA whole-vehicle condition or a universal European leasing grade.
The existing rule order and values are preserved:
| Grade | First matching legacy rule, evaluated K5 down to K1 |
|---|---|
| K5 | Two or more severe findings, or at least four findings with a severe maximum |
| K4 | Any severe finding, or at least four findings with a medium maximum |
| K3 | Any medium finding, or at least five light findings |
| K2 | Any light finding |
| K1 | No non-none findings |
K1 describes the input list. It does not establish complete visibility, roadworthiness or showroom condition. Existing stored labels are retained for compatibility. Do not rewrite historical grades or signed reports to adopt a new scheme; pin the new interpretation separately.
Keep the grading domains separate
| Record | Meaning |
|---|---|
| Legacy severity | none, light, medium, severe |
| Verify visible component grade | 1 through 5, higher means more visible damage; clear has no damage grade |
| Customer deduction matrix | Client-approved percentages and financial policy, independently versioned |
| M-22 | External damage classification under an exact licensed edition, errata and OEM context |
| NAAA | Whole-vehicle condition, 0 through 5 with higher numbers indicating better condition |
| ECG | Inspection procedure and exception-reporting context |
| CIECA BMS / CAPIS | Versioned XML / JSON message families and partner profiles |
| PCdb | Versioned aftermarket part terminology |
There is no automatic numeric conversion between these domains. A component may have several separate defects but one component-level visible grade. Bounding boxes belong to individual images and do not establish physical millimetres.
Optional standards supplement
For accounts explicitly enabled for the additive vehicle-damage-v1 contract:
GET /api/v1/inspection-sessions/{id}/standards
X-API-Key: vai_your_api_keyThe corresponding assessment route is
GET /api/v1/vehicle-assessments/{id}/standards. Add format=pdf for a separate,
unsigned supplement; revision=2 requires that exact source revision. A mismatch
returns 409, expired source evidence returns 410, and unavailable account access
returns 404. Capture tokens cannot access these endpoints. Dashboard access uses
the authenticated owner session.
The existing inspection and assessment GET responses can also include
damage_standards when explicitly requested with include=standards_v1 for an
enabled account. Default responses and historical webhooks keep their contract.
The supplement records the source revision and fingerprint, each physical-part
resolution, individual defects, evidence, measurements and separate grades.
No licensed external codebook or message-schema provider is installed by default.
M-22 outputs therefore use source_unavailable and null codes. Unknown editions,
ambiguous parts, missing measurements and unresolved context have explicit adapter
outcomes. A public schema definition or a successful fixture test is not industry
interoperability certification. See the OpenAPI contract.
Specification and acceptance gates
AIAG lists M-22 edition 6. Its February 2025 errata changes multi-damage panel handling, so a single length lookup is insufficient. Installing an adapter requires an authorized source, exact edition and errata, OEM rules, reviewed crosswalk and validated import/export fixtures.
The NAAA scale requires whole-vehicle considerations. Photos alone cannot establish every domain; no automatic NAAA grade is derived from a component score. Representative labels, customer rubric approval and physical measurement validation remain separate acceptance gates for any future automatic classification.