{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roboparts-cc/json-schema/roboparts-cc-rosruntime-profile-schema.json",
  "title": "ROSRuntimeProfile",
  "description": "单个模型的 ROS 2 运行时契约。三态诚实：默认 validated=false。",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/roboparts-cc-api-openapi.yml#/components/schemas/ROSRuntimeProfile",
  "type": "object",
  "required": [
    "profile_schema_version",
    "meta",
    "ros2",
    "qos",
    "validated",
    "validation_status",
    "evidence_gaps",
    "honest_limits"
  ],
  "properties": {
    "profile_schema_version": {
      "type": "string",
      "const": "1.0",
      "description": "profile schema 版本（1.0）"
    },
    "meta": {
      "type": "object",
      "description": "模型元数据",
      "required": [
        "id",
        "name",
        "robot_type",
        "license"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^URDF-\\\\d+$"
        },
        "name": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "robot_type": {
          "type": "string",
          "enum": [
            "humanoid",
            "quadruped",
            "arm",
            "hand",
            "gripper",
            "amr"
          ]
        },
        "license": {
          "type": "string"
        }
      }
    },
    "ros2": {
      "type": "object",
      "description": "ROS 2 兼容性",
      "required": [
        "compat_level",
        "supported_distros",
        "controllers",
        "message_types",
        "details"
      ],
      "properties": {
        "compat_level": {
          "type": "string",
          "enum": [
            "full",
            "partial",
            "community",
            "unknown"
          ],
          "description": "兼容性等级（full=原生支持 / partial=GPL 部分 / community=社区维护 / unknown=无已知路径）"
        },
        "supported_distros": {
          "type": "array",
          "description": "支持的 ROS 2 发行版",
          "items": {
            "type": "string",
            "enum": [
              "humble",
              "jazzy",
              "iron"
            ]
          }
        },
        "controllers": {
          "type": "array",
          "description": "推荐控制器（按 robot_type 推断）",
          "items": {
            "type": "string"
          }
        },
        "message_types": {
          "type": "array",
          "description": "涉及的消息类型（ROS 2 消息包/消息名）",
          "items": {
            "type": "string"
          }
        },
        "driver_package": {
          "type": [
            "string",
            "null"
          ],
          "description": "已知社区驱动包（可能为 null）"
        },
        "details": {
          "type": "string"
        }
      }
    },
    "qos": {
      "type": "object",
      "description": "QoS 建议值（command / state / telemetry 三档）",
      "required": [
        "command",
        "state",
        "telemetry"
      ],
      "properties": {
        "command": {
          "$ref": "#/$defs/QoSProfile"
        },
        "state": {
          "$ref": "#/$defs/QoSProfile"
        },
        "telemetry": {
          "$ref": "#/$defs/QoSProfile"
        }
      }
    },
    "validated": {
      "type": "boolean",
      "const": false,
      "description": "是否经过真环境验证（当前唯一路径永远为 false）"
    },
    "validation_status": {
      "type": "string",
      "enum": [
        "inferred_from_metadata",
        "community_verified",
        "tested"
      ],
      "description": "验证等级三态（当前唯一路径 inferred_from_metadata）"
    },
    "validation_evidence": {
      "type": [
        "object",
        "null"
      ],
      "description": "测试证据（如 docker 镜像 tag / 测试日志 URL），当前唯一路径为 null"
    },
    "evidence_gaps": {
      "type": "array",
      "minItems": 1,
      "description": "显式登记\"没有做过什么\"（三态诚实的核心：'不知道'必须可见）",
      "items": {
        "type": "string"
      }
    },
    "honest_limits": {
      "type": "object",
      "required": [
        "not_tested_in_docker",
        "not_tested_on_real_hardware",
        "schema_version"
      ],
      "properties": {
        "not_tested_in_docker": {
          "type": "boolean",
          "const": true
        },
        "not_tested_on_real_hardware": {
          "type": "boolean",
          "const": true
        },
        "schema_version": {
          "type": "string",
          "const": "1.0"
        }
      }
    }
  },
  "$defs": {
    "QoSProfile": {
      "type": "object",
      "required": [
        "reliability",
        "durability",
        "history",
        "depth"
      ],
      "properties": {
        "reliability": {
          "type": "string",
          "enum": [
            "RELIABLE",
            "BEST_EFFORT"
          ]
        },
        "durability": {
          "type": "string",
          "enum": [
            "VOLATILE",
            "TRANSIENT_LOCAL",
            "TRANSIENT_LOCAL_WITH_HISTORY"
          ]
        },
        "history": {
          "type": "string",
          "enum": [
            "KEEP_LAST",
            "KEEP_ALL"
          ]
        },
        "depth": {
          "type": "integer",
          "minimum": 1
        },
        "note": {
          "type": "string",
          "description": "QoS 策略说明（人类可读）"
        }
      }
    }
  }
}