{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "version": "2.0.0",
  "$id": "https://schemas.ectropy.ai/resource/resource-pose.schema.json",
  "title": "Resource Pose Schema",
  "description": "Telemetry contract for a resource's live spatial position. Pose is transient wire data, not a stored entity, so it has no identity of its own: identity flows through resourceUrn (the resource described) and lastSeq (monotonic per-resource ordering for snapshot, delta and catch-up delivery). Availability, activity and resource type are the resource-status definitions; the point type is voxel-group's.",
  "type": "object",
  "required": [
    "$schema",
    "resourceUrn",
    "resourceType",
    "position",
    "lastUpdate",
    "lastSeq"
  ],
  "definitions": {
    "resourceType": {
      "$ref": "https://schemas.ectropy.ai/resource/resource-status.schema.json#/definitions/resourceType"
    },
    "availability": {
      "$ref": "https://schemas.ectropy.ai/resource/resource-status.schema.json#/definitions/availability",
      "description": "Optional here: a pose-only delta (position changed, status did not) may omit it, meaning unchanged from the last known value."
    },
    "activity": {
      "$ref": "https://schemas.ectropy.ai/resource/resource-status.schema.json#/definitions/activity",
      "description": "Optional here, with the same delta-omission meaning as availability."
    },
    "point3": {
      "$ref": "https://schemas.ectropy.ai/voxel/voxel-group.schema.json#/definitions/point3"
    }
  },
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "Schema declaration: the URI of the schema this instance follows."
    },
    "resourceUrn": {
      "$ref": "https://schemas.ectropy.ai/_definitions/urn.schema.json",
      "description": "The resource described, urn:luhtech:ectropy:resource:{id}."
    },
    "resourceType": {
      "$ref": "#/definitions/resourceType"
    },
    "voxelUrn": {
      "$ref": "https://schemas.ectropy.ai/_definitions/urn.schema.json",
      "description": "The voxel the resource is in (urn:luhtech:ectropy:voxel:{id}). Optional: a resource between zones or OFFLINE may have no current voxel anchor."
    },
    "position": {
      "$ref": "#/definitions/point3",
      "description": "World-space position (ROS geometry_msgs/Point)."
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Position confidence, 0 to 1."
    },
    "availability": {
      "$ref": "#/definitions/availability"
    },
    "activity": {
      "$ref": "#/definitions/activity"
    },
    "lastUpdate": {
      "type": "string",
      "format": "date-time",
      "description": "Observation time (ROS builtin_interfaces/Time)."
    },
    "lastSeq": {
      "type": "integer",
      "minimum": 0,
      "description": "Monotonic per-resource sequence number: a client resuming after a gap requests everything with lastSeq greater than its last-received value; a slow client's queue coalesces to the highest lastSeq per resource rather than replaying every intermediate frame."
    }
  },
  "additionalProperties": false
}
