{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://trinetrahq.com/schemas/sangam/1.0/track.schema.json",
  "title": "SANGAM Track",
  "description": "A fused estimate of one object over time, produced by the fusion engine from detections of one or more sensors. Tracks describe objects and their motion; they carry no personal identity.",
  "type": "object",
  "required": ["type", "schema_version", "id", "time", "status", "position", "velocity", "classification"],
  "properties": {
    "type": {"const": "track", "description": "Record type."},
    "schema_version": {"$ref": "common.schema.json#/$defs/schemaVersion"},
    "id": {"$ref": "common.schema.json#/$defs/id", "description": "Track id assigned by the engine. Never reused within a deployment."},
    "time": {"$ref": "common.schema.json#/$defs/time", "description": "Time the state refers to, UTC."},
    "status": {
      "description": "tentative: not yet confirmed; confirmed: passed M-of-N; coasting: confirmed but no recent update; deleted: final record.",
      "enum": ["tentative", "confirmed", "coasting", "deleted"]
    },
    "position": {"$ref": "common.schema.json#/$defs/positionWithCov"},
    "velocity": {"$ref": "common.schema.json#/$defs/velocity"},
    "speed_ms": {"type": "number", "minimum": 0},
    "course_deg": {"type": "number", "minimum": 0, "exclusiveMaximum": 360},
    "classification": {"$ref": "common.schema.json#/$defs/classification", "description": "Most probable class and its posterior probability."},
    "class_probs": {
      "description": "Posterior probability per object class after per-sensor reliability fusion.",
      "type": "object",
      "propertyNames": {"enum": ["small_boat", "large_vessel", "person", "animal", "debris"]},
      "additionalProperties": {"type": "number", "minimum": 0, "maximum": 1}
    },
    "sources": {
      "description": "Sensors that updated this track recently, most recent first.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["sensor_id", "sensor_type", "last_time"],
        "properties": {
          "sensor_id": {"$ref": "common.schema.json#/$defs/id"},
          "sensor_type": {"$ref": "common.schema.json#/$defs/sensorType"},
          "last_time": {"$ref": "common.schema.json#/$defs/time"}
        },
        "additionalProperties": false
      }
    },
    "transponder_id": {
      "description": "Transponder identity of a registered vessel when an AIS-like report has been associated, else null.",
      "type": ["string", "null"]
    },
    "created": {"$ref": "common.schema.json#/$defs/time", "description": "When the track was started."},
    "last_update": {"$ref": "common.schema.json#/$defs/time", "description": "Time of the last measurement absorbed."},
    "hits": {"type": "integer", "minimum": 0, "description": "Position updates absorbed so far."},
    "attributes": {"$ref": "common.schema.json#/$defs/attributes"},
    "simulated": {"type": "boolean"}
  },
  "additionalProperties": false,
  "examples": [
    {
      "type": "track",
      "schema_version": "1.0",
      "id": "T0042",
      "time": "2026-10-20T16:06:00.000Z",
      "status": "confirmed",
      "position": {"lat": 22.58844, "lon": 88.94112, "cov_m2": [[38.2, 4.1], [4.1, 55.0]]},
      "velocity": {"east_ms": -4.8, "north_ms": 0.9, "cov_m2s2": [[0.6, 0.0], [0.0, 0.7]]},
      "speed_ms": 4.88,
      "course_deg": 280.6,
      "classification": {"label": "small_boat", "confidence": 0.91},
      "class_probs": {"small_boat": 0.91, "large_vessel": 0.03, "person": 0.02, "animal": 0.02, "debris": 0.02},
      "sources": [
        {"sensor_id": "RDR-1", "sensor_type": "radar", "last_time": "2026-10-20T16:05:59.200Z"},
        {"sensor_id": "IR-N", "sensor_type": "ir", "last_time": "2026-10-20T16:05:59.000Z"}
      ],
      "transponder_id": null,
      "created": "2026-10-20T16:04:41.500Z",
      "last_update": "2026-10-20T16:05:59.200Z",
      "hits": 57,
      "simulated": true
    }
  ]
}
