prod2u_p4_evidence.schema.json 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "prod2u-p4-evidence-v2",
  4. "title": "Prod2U P4 offline evidence v2",
  5. "type": "object",
  6. "required": ["schema", "evidence_id", "campaign_id", "campaign_identity", "round", "identity", "bmc", "layers", "fan", "windows", "raw_samples", "correlation", "rpm", "ptc", "evidence_binding"],
  7. "properties": {
  8. "schema": {"const": "prod2u-p4-evidence-v2"},
  9. "evidence_id": {"type": "string", "minLength": 1},
  10. "campaign_id": {"type": "string", "minLength": 1},
  11. "campaign_identity": {"$ref": "#/$defs/identity"},
  12. "round": {"type": "integer", "minimum": 1, "maximum": 10},
  13. "identity": {"$ref": "#/$defs/identity"},
  14. "bmc": {"$ref": "#/$defs/bmc"},
  15. "layers": {"$ref": "#/$defs/layers"},
  16. "fan": {"$ref": "#/$defs/fan"},
  17. "windows": {"$ref": "#/$defs/windows"},
  18. "raw_samples": {"$ref": "#/$defs/rawSamples"},
  19. "correlation": {"$ref": "#/$defs/correlation"},
  20. "rpm": {"$ref": "#/$defs/rpm"},
  21. "ptc": {"$ref": "#/$defs/ptc"},
  22. "evidence_binding": {"$ref": "#/$defs/evidenceBinding"}
  23. },
  24. "additionalProperties": true,
  25. "$defs": {
  26. "identity": {
  27. "type": "object",
  28. "required": ["dut_id", "build_id", "bitstream_sha256", "profile"],
  29. "properties": {
  30. "dut_id": {"type": "string", "minLength": 1},
  31. "build_id": {"type": "string", "minLength": 1},
  32. "bitstream_sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"},
  33. "variant": {"enum": ["trace", "normal"]},
  34. "profile": {"type": "string", "minLength": 1},
  35. "source_manifest_sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"},
  36. "planned_rounds": {"const": 10}
  37. },
  38. "additionalProperties": true
  39. },
  40. "bmc": {
  41. "type": "object",
  42. "required": ["status", "reason"],
  43. "properties": {
  44. "status": {"const": "out_of_scope"},
  45. "reason": {"type": "string", "minLength": 1}
  46. },
  47. "additionalProperties": true
  48. },
  49. "layerStatus": {"enum": ["pass", "fail", "blocked", "not_run"]},
  50. "layers": {
  51. "type": "object",
  52. "required": ["required", "optional"],
  53. "properties": {
  54. "required": {
  55. "type": "object",
  56. "required": ["program_sram", "fresh_ready", "host_ack", "pwm_state", "fan3_tach_trend", "timeout_fallback", "disable", "ptc_command_path"],
  57. "properties": {
  58. "program_sram": {"$ref": "#/$defs/layerStatus"},
  59. "fresh_ready": {"$ref": "#/$defs/layerStatus"},
  60. "host_ack": {"$ref": "#/$defs/layerStatus"},
  61. "pwm_state": {"$ref": "#/$defs/layerStatus"},
  62. "fan3_tach_trend": {"$ref": "#/$defs/layerStatus"},
  63. "timeout_fallback": {"$ref": "#/$defs/layerStatus"},
  64. "disable": {"$ref": "#/$defs/layerStatus"},
  65. "ptc_command_path": {"$ref": "#/$defs/layerStatus"}
  66. },
  67. "additionalProperties": {"$ref": "#/$defs/layerStatus"}
  68. },
  69. "optional": {
  70. "type": "object",
  71. "additionalProperties": {"$ref": "#/$defs/layerStatus"}
  72. }
  73. },
  74. "additionalProperties": true
  75. },
  76. "fanStatus": {"enum": ["detected", "absent", "intermittent"]},
  77. "fan": {
  78. "type": "object",
  79. "required": ["FAN3"],
  80. "properties": {
  81. "FAN3": {
  82. "type": "object",
  83. "required": ["FG5", "FG6"],
  84. "properties": {
  85. "FG5": {"$ref": "#/$defs/fanStatus"},
  86. "FG6": {"$ref": "#/$defs/fanStatus"}
  87. },
  88. "anyOf": [
  89. {"properties": {"FG5": {"const": "detected"}}, "required": ["FG5"]},
  90. {"properties": {"FG6": {"const": "detected"}}, "required": ["FG6"]}
  91. ],
  92. "additionalProperties": true
  93. }
  94. },
  95. "additionalProperties": true
  96. },
  97. "window": {
  98. "type": "object",
  99. "required": ["index", "start_s", "end_s", "continuous", "snapshot_seq", "overflow_mask"],
  100. "properties": {
  101. "index": {"type": "integer", "minimum": 0},
  102. "start_s": {"type": "number"},
  103. "end_s": {"type": "number"},
  104. "continuous": {"const": true},
  105. "snapshot_seq": {"type": "integer", "minimum": 0, "maximum": 4294967295},
  106. "overflow_mask": {"type": "integer", "minimum": 0, "maximum": 255}
  107. },
  108. "additionalProperties": true
  109. },
  110. "windows": {"type": "array", "minItems": 42, "maxItems": 42, "items": {"$ref": "#/$defs/window"}},
  111. "fanSample": {
  112. "type": "object",
  113. "required": ["window_edges", "rpm"],
  114. "properties": {
  115. "window_edges": {"type": "integer", "minimum": 0},
  116. "rpm": {"type": "number", "minimum": 0}
  117. },
  118. "additionalProperties": true
  119. },
  120. "rawSample": {
  121. "type": "object",
  122. "required": ["fan_setting_percent", "snapshot_seq", "overflow_mask", "FG5", "FG6"],
  123. "properties": {
  124. "fan_setting_percent": {"enum": [0, 20, 40, 60, 80, 100]},
  125. "snapshot_seq": {"type": "integer", "minimum": 0, "maximum": 4294967295},
  126. "overflow_mask": {"type": "integer", "minimum": 0, "maximum": 255},
  127. "FG5": {"$ref": "#/$defs/fanSample"},
  128. "FG6": {"$ref": "#/$defs/fanSample"}
  129. },
  130. "additionalProperties": true
  131. },
  132. "rawSamples": {
  133. "type": "array",
  134. "minItems": 30,
  135. "maxItems": 30,
  136. "items": {"$ref": "#/$defs/rawSample"}
  137. },
  138. "correlation": {
  139. "type": "object",
  140. "required": ["spearman_rho", "low_mean_rpm", "high_mean_rpm", "high_significantly_higher", "samples"],
  141. "properties": {
  142. "spearman_rho": {"type": "number", "minimum": -1, "maximum": 1},
  143. "low_mean_rpm": {"type": "number", "minimum": 0},
  144. "high_mean_rpm": {"type": "number", "minimum": 0},
  145. "high_significantly_higher": {"const": true},
  146. "samples": {
  147. "type": "array",
  148. "minItems": 6,
  149. "maxItems": 6,
  150. "items": {
  151. "type": "object",
  152. "required": ["fan_setting_percent", "rpm"],
  153. "properties": {
  154. "fan_setting_percent": {"type": "number"},
  155. "rpm": {"type": "number", "minimum": 0}
  156. },
  157. "additionalProperties": true
  158. }
  159. }
  160. },
  161. "additionalProperties": true
  162. },
  163. "rpm": {
  164. "type": "object",
  165. "required": ["status", "reason"],
  166. "properties": {
  167. "status": {"const": "not_qualified"},
  168. "reason": {"type": "string", "minLength": 1}
  169. },
  170. "additionalProperties": true
  171. },
  172. "ptc": {
  173. "type": "object",
  174. "required": ["actuation", "measurement"],
  175. "properties": {
  176. "actuation": {"const": true},
  177. "measurement": {"const": "not_run"}
  178. },
  179. "additionalProperties": true
  180. },
  181. "artifactBinding": {
  182. "type": "object",
  183. "required": ["path", "sha256"],
  184. "properties": {
  185. "path": {"type": "string", "minLength": 1},
  186. "sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"},
  187. "status": {"type": "string"}
  188. },
  189. "additionalProperties": true
  190. },
  191. "receiptBinding": {
  192. "allOf": [
  193. {"$ref": "#/$defs/artifactBinding"},
  194. {"required": ["status"], "properties": {"status": {"const": "pass"}}}
  195. ]
  196. },
  197. "bindingIdentity": {
  198. "type": "object",
  199. "required": ["dut_id", "build_id", "bitstream_sha256", "variant", "profile", "source_manifest_sha256"],
  200. "properties": {
  201. "dut_id": {"type": "string", "minLength": 1},
  202. "build_id": {"type": "string", "minLength": 1},
  203. "bitstream_sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"},
  204. "variant": {"enum": ["trace", "normal"]},
  205. "profile": {"type": "string", "minLength": 1},
  206. "source_manifest_sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"}
  207. },
  208. "additionalProperties": true
  209. },
  210. "evidenceBinding": {
  211. "type": "object",
  212. "required": ["programmer_receipt", "pre_program_raw", "combined_rx_raw", "raw_transcript", "td_receipt", "source_manifest", "package_manifest", "package_inventory", "identity"],
  213. "properties": {
  214. "programmer_receipt": {"$ref": "#/$defs/receiptBinding"},
  215. "pre_program_raw": {"$ref": "#/$defs/artifactBinding"},
  216. "combined_rx_raw": {"$ref": "#/$defs/artifactBinding"},
  217. "raw_transcript": {"$ref": "#/$defs/artifactBinding"},
  218. "td_receipt": {"$ref": "#/$defs/artifactBinding"},
  219. "source_manifest": {"$ref": "#/$defs/artifactBinding"},
  220. "package_manifest": {"$ref": "#/$defs/artifactBinding"},
  221. "package_inventory": {"$ref": "#/$defs/artifactBinding"},
  222. "identity": {"$ref": "#/$defs/bindingIdentity"}
  223. },
  224. "additionalProperties": true
  225. }
  226. }
  227. }