{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://scanwrench.com/spec/ev-evidence-v1.json",
  "title": "ScanWrench EV Evidence Interchange 1.0",
  "status": "public_draft",
  "publishedAt": "2026-07-28T00:00:00.000Z",
  "implementationPermission": "This public interface may be implemented for interoperable EV evidence software. ScanWrench trademarks and provider data rights are not granted.",
  "purpose": "Provider-neutral exchange of bounded EV observations, signed evidence passports, and non-causal before-and-after comparisons.",
  "notInScope": [
    "vehicle control",
    "immobilizer or key functions",
    "battery state of health certification",
    "warranty or safety determination",
    "automated repair diagnosis",
    "proprietary OEM signal definitions"
  ],
  "privacy": {
    "subjectBinding": "Provider-scoped keyed pseudonym matching ^ev:[a-z0-9][a-z0-9._-]{2,31}:[0-9a-f]{64}$",
    "rawVinAllowed": false,
    "reversibleVinAllowed": false,
    "preciseLocationAllowed": false,
    "savedPlacesAllowed": false,
    "mediaAllowed": false,
    "occupantDataAllowed": false,
    "publicIndividualBindingAllowed": false,
    "minimumPublicCohort": 10
  },
  "telemetrySample": {
    "type": "object",
    "additionalProperties": false,
    "required": ["schemaVersion", "subjectBinding", "observedAt", "source", "measurements", "invalidSignals"],
    "properties": {
      "schemaVersion": { "const": 1 },
      "subjectBinding": { "type": "string", "pattern": "^ev:[a-z0-9][a-z0-9._-]{2,31}:[0-9a-f]{64}$" },
      "observedAt": { "type": "string", "format": "date-time" },
      "source": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$" },
      "measurements": {
        "type": "object",
        "maxProperties": 128,
        "additionalProperties": {
          "type": "object",
          "additionalProperties": false,
          "required": ["value", "unit", "evidenceClass"],
          "properties": {
            "value": { "type": ["number", "integer", "boolean", "string"] },
            "unit": { "type": ["string", "null"], "maxLength": 24 },
            "evidenceClass": { "enum": ["observed", "derived"] },
            "recipeId": { "type": "string", "maxLength": 128 },
            "quality": { "enum": ["valid", "estimated_by_source", "limited_resolution"] }
          }
        }
      },
      "invalidSignals": { "type": "array", "maxItems": 128, "uniqueItems": true, "items": { "type": "string", "maxLength": 128 } }
    }
  },
  "evidencePassport": {
    "required": ["schemaVersion", "passportId", "createdAt", "subjectBinding", "custody", "provider", "observationWindow", "confidence", "observations", "unavailable", "invalidSignals", "interpretation", "boundaries", "lineage", "fingerprintSha256"],
    "custodyModes": ["account", "device_only", "save_nothing"],
    "confidenceValues": ["limited", "moderate", "strong"],
    "fingerprint": "SHA-256 over canonical unsigned payload",
    "signature": { "algorithm": "Ed25519", "detached": true, "keyIdRequired": true }
  },
  "beforeAfterComparison": {
    "sameSubjectBindingRequired": true,
    "nonOverlappingWindowsRequired": true,
    "metricStatus": ["changed", "unchanged"],
    "requiredNegativeClaims": {
      "improvementClaimed": false,
      "degradationClaimed": false,
      "causeClaimed": false,
      "batteryStateOfHealthClaimed": false
    }
  },
  "providerManifest": {
    "required": ["providerId", "version", "rightsBasis", "transport", "signals", "privacy", "verification", "signingKeys"],
    "rightsBasis": ["owned", "official_open", "licensed", "owner_authorized_runtime"],
    "transport": ["oem_cloud_api", "in_vehicle_api", "vci", "file_import", "simulator"],
    "signalAccess": "read_only",
    "verificationStatus": ["implemented", "simulated", "bench_tested", "vehicle_tested"]
  },
  "conformanceLevels": [
    { "level": 1, "name": "schema", "meaning": "Payload validates and contains no prohibited identity." },
    { "level": 2, "name": "simulator", "meaning": "Deterministic fixtures pass and remain labeled simulated." },
    { "level": 3, "name": "bench", "meaning": "A real provider runtime or VCI is exercised on a fixture." },
    { "level": 4, "name": "vehicle", "meaning": "An authorized physical vehicle returns the exact signal." },
    { "level": 5, "name": "published_cohort", "meaning": "At least ten distinct vehicle bindings support every public aggregate metric." }
  ],
  "semanticRules": [
    "Unavailable stays unavailable and is never imputed into a verified value.",
    "A changed value is not by itself evidence of improvement, degradation, defect, repair success, or cause.",
    "A returned range estimate is not battery capacity or battery state of health.",
    "Passing one conformance level never implies a higher level.",
    "Manufacturer thresholds require an authorized source and exact vehicle applicability."
  ]
}
