board_viewer_annotations.schema.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://local.invalid/schemas/board_viewer_annotations.schema.json",
  4. "title": "Board viewer curated annotations",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "required": ["schema", "board_id", "connector_profiles", "touchpoints", "interfaces", "photo_overlay"],
  8. "properties": {
  9. "schema": {"const": "board-viewer-annotations-v1"},
  10. "board_id": {"type": "string", "minLength": 1},
  11. "io_evidence_policy": {"$ref": "#/$defs/ioEvidencePolicy"},
  12. "historical_note": {"type": "string", "minLength": 1},
  13. "connector_profiles": {
  14. "type": "object",
  15. "additionalProperties": {"$ref": "#/$defs/connectorProfile"}
  16. },
  17. "annotation_templates": {
  18. "type": "object",
  19. "additionalProperties": {"$ref": "#/$defs/touchpointAnnotation"}
  20. },
  21. "template_instances": {
  22. "type": "object",
  23. "additionalProperties": {"$ref": "#/$defs/templateInstance"}
  24. },
  25. "touchpoints": {
  26. "type": "object",
  27. "additionalProperties": {"$ref": "#/$defs/touchpointAnnotation"}
  28. },
  29. "interfaces": {
  30. "type": "array",
  31. "items": {"$ref": "#/$defs/interface"}
  32. },
  33. "photo_overlay": {
  34. "oneOf": [
  35. {"type": "null"},
  36. {"$ref": "#/$defs/photoOverlay"}
  37. ]
  38. }
  39. },
  40. "$defs": {
  41. "evidenceTier": {
  42. "enum": ["board_database", "cross_verified", "name_inferred", "unknown"]
  43. },
  44. "ioEvidenceGradePhysical": {
  45. "enum": ["confirmed_by_brd", "inferred", "blocked", "not_applicable", "unknown"]
  46. },
  47. "ioEvidenceGradePolarity": {
  48. "enum": [
  49. "confirmed_by_electrical_staff",
  50. "inferred",
  51. "blocked",
  52. "not_applicable",
  53. "unknown"
  54. ]
  55. },
  56. "ioEvidenceGradeMeasurement": {
  57. "enum": ["not_run", "pass", "fail", "blocked", "not_applicable", "unknown"]
  58. },
  59. "ioEvidenceGrades": {
  60. "type": "object",
  61. "additionalProperties": false,
  62. "required": ["physical_path", "product_polarity", "hardware_measurement"],
  63. "properties": {
  64. "physical_path": {"$ref": "#/$defs/ioEvidenceGradePhysical"},
  65. "product_polarity": {"$ref": "#/$defs/ioEvidenceGradePolarity"},
  66. "hardware_measurement": {"$ref": "#/$defs/ioEvidenceGradeMeasurement"}
  67. }
  68. },
  69. "ioEvidencePolicy": {
  70. "type": "object",
  71. "additionalProperties": false,
  72. "required": [
  73. "authoritative_order",
  74. "physical_path",
  75. "product_polarity",
  76. "hardware_measurement",
  77. "matrix_doc"
  78. ],
  79. "properties": {
  80. "authoritative_order": {
  81. "type": "array",
  82. "minItems": 3,
  83. "items": {"type": "string", "minLength": 1}
  84. },
  85. "physical_path": {"type": "string", "minLength": 1},
  86. "product_polarity": {"type": "string", "minLength": 1},
  87. "hardware_measurement": {"type": "string", "minLength": 1},
  88. "matrix_doc": {"type": "string", "minLength": 1},
  89. "historical_schematic_side_evidence": {"type": "string", "minLength": 1},
  90. "v1_2_schematic_pdf": {"type": "string", "minLength": 1},
  91. "must_not_override_connectors": {
  92. "type": "array",
  93. "items": {"type": "string", "minLength": 1}
  94. }
  95. }
  96. },
  97. "touchpointAnnotation": {
  98. "type": "object",
  99. "additionalProperties": false,
  100. "required": ["summary", "pins"],
  101. "properties": {
  102. "summary": {"type": "string", "minLength": 1},
  103. "pins": {
  104. "type": "object",
  105. "additionalProperties": {"$ref": "#/$defs/pinAnnotation"}
  106. }
  107. }
  108. },
  109. "templateInstance": {
  110. "type": "object",
  111. "additionalProperties": false,
  112. "required": ["template", "variables"],
  113. "properties": {
  114. "template": {"type": "string", "minLength": 1},
  115. "variables": {
  116. "type": "object",
  117. "additionalProperties": {"type": "string"}
  118. }
  119. }
  120. },
  121. "connectorProfile": {
  122. "type": "object",
  123. "additionalProperties": false,
  124. "required": ["references", "contact_pins", "shield_pads", "evidence_tier", "sources"],
  125. "properties": {
  126. "component_value": {"type": "string"},
  127. "references": {
  128. "type": "array",
  129. "minItems": 1,
  130. "uniqueItems": true,
  131. "items": {"type": "string", "pattern": "^(CON|J|PL)[0-9]+$"}
  132. },
  133. "contact_pins": {
  134. "type": "array",
  135. "minItems": 1,
  136. "uniqueItems": true,
  137. "items": {"type": "string", "minLength": 1}
  138. },
  139. "shield_pads": {
  140. "type": "array",
  141. "uniqueItems": true,
  142. "items": {"type": "string", "minLength": 1}
  143. },
  144. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  145. "sources": {
  146. "type": "array",
  147. "minItems": 1,
  148. "items": {"type": "string", "minLength": 1}
  149. }
  150. }
  151. },
  152. "pinAnnotation": {
  153. "type": "object",
  154. "additionalProperties": false,
  155. "required": ["summary", "path", "evidence_tier", "sources"],
  156. "properties": {
  157. "summary": {"type": "string", "minLength": 1},
  158. "path": {"type": "array", "items": {"type": "string", "minLength": 1}},
  159. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  160. "sources": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
  161. "direction": {"enum": ["input", "output", "bidirectional", "passive", "unknown"]},
  162. "external_level": {"type": "string", "minLength": 1},
  163. "function_category": {"type": "string", "minLength": 1},
  164. "reserved": {"type": "boolean"},
  165. "fixed_load_conflict": {"type": "boolean"},
  166. "board_pull": {"type": ["string", "null"]},
  167. "adc_pulltype": {"type": ["string", "null"], "pattern": "^[A-Z][A-Z0-9_]*$"},
  168. "active_level": {"type": "string", "minLength": 1},
  169. "polarity": {"type": "string", "minLength": 1},
  170. "evidence_grades": {"$ref": "#/$defs/ioEvidenceGrades"},
  171. "external_components": {
  172. "type": "array",
  173. "items": {"type": "string", "minLength": 1}
  174. },
  175. "fpga": {"$ref": "#/$defs/fpgaAnnotation"},
  176. "mcu": {"$ref": "#/$defs/mcuAnnotation"},
  177. "programming": {"$ref": "#/$defs/programmingAnnotation"}
  178. }
  179. },
  180. "fpgaAnnotation": {
  181. "type": "object",
  182. "additionalProperties": false,
  183. "required": ["ball", "board_signal", "io_standard", "capabilities", "evidence_tier", "sources"],
  184. "properties": {
  185. "ball": {"type": "string", "minLength": 1},
  186. "board_signal": {"type": "string", "minLength": 1},
  187. "io_standard": {"type": "string", "minLength": 1},
  188. "capabilities": {
  189. "type": "array",
  190. "minItems": 1,
  191. "items": {"type": "string", "minLength": 1}
  192. },
  193. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  194. "sources": {
  195. "type": "array",
  196. "minItems": 1,
  197. "items": {"type": "string", "minLength": 1}
  198. }
  199. }
  200. },
  201. "mcuAnnotation": {
  202. "type": "object",
  203. "additionalProperties": false,
  204. "required": ["device", "family", "pin", "signal", "capabilities", "evidence_tier", "sources"],
  205. "properties": {
  206. "device": {"type": "string", "minLength": 1},
  207. "family": {"type": "string", "minLength": 1},
  208. "pin": {"type": "string", "minLength": 1},
  209. "signal": {"type": "string", "minLength": 1},
  210. "capabilities": {
  211. "type": "array",
  212. "minItems": 1,
  213. "items": {"type": "string", "minLength": 1}
  214. },
  215. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  216. "sources": {
  217. "type": "array",
  218. "minItems": 1,
  219. "items": {"type": "string", "minLength": 1}
  220. }
  221. }
  222. },
  223. "programmingAnnotation": {
  224. "type": "object",
  225. "additionalProperties": false,
  226. "required": ["evidence_tier", "sources"],
  227. "properties": {
  228. "status": {"enum": ["verified_fpga", "verified_mcu", "board_only", "not_programmable", "unknown"]},
  229. "conclusion": {"type": "string", "minLength": 1},
  230. "network_explanation": {"type": "string", "minLength": 1},
  231. "hdl_guidance": {"type": "string", "minLength": 1},
  232. "connection_guidance": {
  233. "type": "array",
  234. "minItems": 1,
  235. "items": {"type": "string", "minLength": 1}
  236. },
  237. "constraints": {"type": "array", "items": {"type": "string", "minLength": 1}},
  238. "risks": {"type": "array", "items": {"type": "string", "minLength": 1}},
  239. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  240. "sources": {
  241. "type": "array",
  242. "minItems": 1,
  243. "items": {"type": "string", "minLength": 1}
  244. }
  245. }
  246. },
  247. "interface": {
  248. "type": "object",
  249. "additionalProperties": false,
  250. "required": ["id", "name", "touchpoint", "pins", "external_level", "evidence_tier", "sources"],
  251. "properties": {
  252. "id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
  253. "name": {"type": "string", "minLength": 1},
  254. "touchpoint": {"type": "string", "pattern": "^(CON|J|PL|TP)[0-9]+$"},
  255. "pins": {"type": "array", "minItems": 1, "items": {"type": "string"}},
  256. "external_level": {"type": "string", "minLength": 1},
  257. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  258. "sources": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
  259. }
  260. },
  261. "photoOverlay": {
  262. "type": "object",
  263. "additionalProperties": false,
  264. "required": ["path", "sha256", "control_points"],
  265. "properties": {
  266. "path": {"type": "string", "minLength": 1},
  267. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
  268. "control_points": {
  269. "type": "array",
  270. "minItems": 3,
  271. "items": {
  272. "type": "object",
  273. "additionalProperties": false,
  274. "required": ["image", "board"],
  275. "properties": {
  276. "image": {"$ref": "#/$defs/point"},
  277. "board": {"$ref": "#/$defs/point"}
  278. }
  279. }
  280. }
  281. }
  282. },
  283. "point": {
  284. "type": "object",
  285. "additionalProperties": false,
  286. "required": ["x", "y"],
  287. "properties": {
  288. "x": {"type": "number"},
  289. "y": {"type": "number"}
  290. }
  291. }
  292. }
  293. }