Build
JSON schema
The UGP v1.0 record schema, JSON Schema 2020-12, at /schema/v1.0/record.json: identity, the eight axes, the derived result and the audit fields.
Schema: /schema/v1.0/record.json, JSON Schema 2020-12.
The shape of a record
ugp_version, profile, profile_status, record_scope
identity { make, model, …, blacklist { status, basis, source, checked_at } }
axes
cosmetic { value, basis, zones { AA, A, B, C, … } [defects], mapped_from? { scale, value, crosswalk } }
functional { status, faults[] }
battery { health_pct, basis, cells[], replaced }
locks { value, types[] }
operator { value, carrier }
data { value, method, technique, tool, certificate_id, standard_rev }
parts { value, manifest[] }
kit { value, components[] }
result { status, reasons[], grade, premium, core_code, ctia_derived? }
audit { grader_id, graded_at, method, verification_tier, conformance, tolerance_table }Three rules that matter in code
resultis derived. The grade, status and core code inresultmatch the derivation of §11 and §12; never accept them from user input. Recompute them fromaxesand compare. §4.4- Store raw observations. Keep the per-zone defect lists, fault codes, battery readings and part states, not only the roll-up values, so a record can be regraded when a tolerance changes. §4.3
- Every value has a basis. Measured, evidenced, declared or unknown. A declared battery and a measured one derive differently (only a measured 90% or more can be Premium). §4.2
Versions and profiles
ugp_versionpins the version the record was graded under; disputes are judged against it. §14.6profile_statusisprovisionalfor device classes whose profile pack is not published yet. §1.2audit.tolerance_tableisphone-1.0-provisionalwhile the A–D counts are provisional. §5.5record_scopeisunitorlot. §14.5identity.blacklist.statusisclear,reportedorunchecked;basissays howclearwas reached:measuredorevidenced(a check) ordeclared.uncheckedderives NOT GRADED with reasonlost_stolen_unchecked; a declaredclearadds the disclosurelost_stolen_declared. §9.3axes.cosmetic.mapped_from(scale,value,crosswalk) is set only on a supplier-mapped grade, with cosmetic basisdeclared. It adds the disclosuresupplier_mappedand the core-code extension~src:supplier. §13.6
Testing your implementation
Validate every record against the schema, then check that your derivation reproduces every golden example. The examples are published beside the schema at /schema/v1.0/golden/. Annex E