prod2u_p4_normal_v3_offline_gate_receipt.schema.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "prod2u-p4-normal-v3-strict-offline-gate-v1",
  4. "type": "object",
  5. "additionalProperties": false,
  6. "required": ["schema", "status", "verification_run_id", "commit", "source_state", "build_identity", "required_layers", "layers", "failures", "safety"],
  7. "properties": {
  8. "schema": {"const": "prod2u-p4-normal-v3-strict-offline-gate-v1"},
  9. "generated_at": {"type": "string", "minLength": 1},
  10. "status": {"enum": ["pass", "fail"]},
  11. "verification_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
  12. "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$|^$"},
  13. "source_state": {"type": "object"},
  14. "build_identity": {
  15. "type": ["object", "null"],
  16. "required": ["schema", "build_id", "build_epoch_utc", "generated_at_utc"],
  17. "properties": {
  18. "schema": {"const": "prod2u-p4-normal-v3-build-identity-v1"},
  19. "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
  20. "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
  21. "generated_at_utc": {"type": "string", "format": "date-time"}
  22. },
  23. "additionalProperties": false
  24. },
  25. "profile": {"const": "prod2u_p4_normal_v3"},
  26. "runtime_profile": {"const": "prod2u-p4-normal-actuator-trace-binary921-v3"},
  27. "required_layers": {
  28. "type": "array",
  29. "prefixItems": [
  30. {"const": "source_integrity"},
  31. {"const": "unit"},
  32. {"const": "hdl_sim"},
  33. {"const": "formal"}
  34. ],
  35. "minItems": 4,
  36. "maxItems": 4
  37. },
  38. "layers": {
  39. "type": "object",
  40. "required": ["source_integrity", "unit", "hdl_sim", "formal"],
  41. "properties": {
  42. "source_integrity": {
  43. "type": "object",
  44. "required": ["status", "returncode", "source_state"],
  45. "properties": {
  46. "status": {"type": "string"},
  47. "returncode": {"type": "integer"},
  48. "source_state": {"type": "object"}
  49. }
  50. },
  51. "unit": {
  52. "type": "object",
  53. "required": ["status", "returncode", "modules"],
  54. "properties": {
  55. "status": {"type": "string"},
  56. "returncode": {"type": "integer"},
  57. "modules": {"type": "array", "items": {"type": "string"}}
  58. }
  59. },
  60. "hdl_sim": {"type": "object"},
  61. "formal": {"type": "object"}
  62. },
  63. "additionalProperties": false
  64. },
  65. "failures": {"type": "array", "items": {"type": "string"}},
  66. "work_root": {"type": "string"},
  67. "child_receipt_dir": {"type": "string"},
  68. "safety": {
  69. "type": "object",
  70. "required": ["opens_serial", "programs_hardware", "installs_drivers"],
  71. "properties": {
  72. "opens_serial": {"const": false},
  73. "programs_hardware": {"const": false},
  74. "installs_drivers": {"const": false}
  75. },
  76. "additionalProperties": false
  77. },
  78. "authority_boundary": {"type": "string", "minLength": 40}
  79. },
  80. "$defs": {
  81. "targetManifestEvidence": {
  82. "type": "object",
  83. "required": ["schema", "version", "sha256", "layer", "status", "failures"],
  84. "properties": {
  85. "schema": {"const": "prod2u-p4-verification-target-manifest-v1"},
  86. "version": {"const": 1},
  87. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
  88. "layer": {"enum": ["unit", "icarus", "verilator", "cocotb", "formal", "all"]},
  89. "status": {"const": "pass"},
  90. "failures": {"type": "array", "maxItems": 0}
  91. },
  92. "additionalProperties": true
  93. },
  94. "sha256Path": {
  95. "type": "object",
  96. "required": ["path", "sha256"],
  97. "properties": {
  98. "path": {"type": "string", "minLength": 1},
  99. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
  100. },
  101. "additionalProperties": false
  102. },
  103. "formalInputEvidence": {
  104. "type": "object",
  105. "required": ["sby", "sources", "task_engines", "sha256"],
  106. "properties": {
  107. "sby": {"$ref": "#/$defs/sha256Path"},
  108. "sources": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/sha256Path"}},
  109. "task_engines": {
  110. "type": "object",
  111. "minProperties": 1,
  112. "additionalProperties": {
  113. "type": "array",
  114. "minItems": 1,
  115. "items": {"type": "string", "minLength": 1},
  116. "uniqueItems": true
  117. }
  118. },
  119. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
  120. },
  121. "additionalProperties": false
  122. },
  123. "formalToolEvidence": {
  124. "type": "object",
  125. "required": ["name", "path", "sha256", "version", "status", "failures"],
  126. "properties": {
  127. "name": {"type": "string", "minLength": 1},
  128. "path": {"type": "string", "minLength": 1},
  129. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
  130. "version": {"type": "string", "minLength": 1},
  131. "status": {"const": "pass"},
  132. "failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
  133. },
  134. "additionalProperties": true
  135. }
  136. },
  137. "allOf": [
  138. {
  139. "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
  140. "then": {
  141. "required": ["generated_at", "profile", "runtime_profile", "work_root", "child_receipt_dir", "authority_boundary"],
  142. "properties": {
  143. "build_identity": {"type": "object"},
  144. "failures": {"maxItems": 0},
  145. "layers": {
  146. "properties": {
  147. "source_integrity": {
  148. "properties": {
  149. "status": {"const": "pass"},
  150. "returncode": {"const": 0},
  151. "source_state": {
  152. "required": ["clean"],
  153. "properties": {"clean": {"const": true}}
  154. }
  155. }
  156. },
  157. "unit": {
  158. "required": ["target_manifest"],
  159. "properties": {
  160. "status": {"const": "pass"},
  161. "returncode": {"const": 0},
  162. "modules": {"minItems": 1},
  163. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
  164. }
  165. },
  166. "hdl_sim": {
  167. "required": ["schema", "status", "verification_layer", "profile", "backend", "tests", "backend_results", "target_manifest", "safety"],
  168. "properties": {
  169. "schema": {"const": "prod2u-p4-normal-v3-hdl-sim-receipt-v1"},
  170. "status": {"const": "pass"},
  171. "verification_layer": {"const": "hdl_sim"},
  172. "profile": {"const": "prod2u_p4_normal_v3"},
  173. "backend": {"const": "all"},
  174. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
  175. "tests": {
  176. "type": "array",
  177. "minItems": 1,
  178. "items": {
  179. "type": "object",
  180. "required": ["name", "status"],
  181. "properties": {"status": {"const": "pass"}}
  182. }
  183. },
  184. "backend_results": {
  185. "type": "object",
  186. "required": ["icarus", "verilator", "cocotb"],
  187. "properties": {
  188. "icarus": {
  189. "required": ["status", "target_manifest"],
  190. "properties": {
  191. "status": {"const": "pass"},
  192. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
  193. }
  194. },
  195. "verilator": {
  196. "required": ["status", "target_manifest"],
  197. "properties": {
  198. "status": {"const": "pass"},
  199. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
  200. }
  201. },
  202. "cocotb": {
  203. "required": ["status", "target_manifest"],
  204. "properties": {
  205. "status": {"const": "pass"},
  206. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
  207. }
  208. }
  209. },
  210. "additionalProperties": false
  211. },
  212. "safety": {"const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}}
  213. }
  214. },
  215. "formal": {
  216. "required": ["schema", "status", "verification_layer", "profile", "targets", "toolchain", "target_manifest", "safety"],
  217. "properties": {
  218. "schema": {"const": "prod2u-p4-normal-v3-formal-receipt-v1"},
  219. "status": {"const": "pass"},
  220. "verification_layer": {"const": "formal"},
  221. "profile": {"const": "prod2u_p4_normal_v3"},
  222. "toolchain": {
  223. "type": "object",
  224. "required": ["status", "sby", "yosys", "solvers", "failures"],
  225. "properties": {
  226. "status": {"const": "pass"},
  227. "sby": {"$ref": "#/$defs/formalToolEvidence"},
  228. "yosys": {"$ref": "#/$defs/formalToolEvidence"},
  229. "solvers": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/formalToolEvidence"}},
  230. "failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
  231. }
  232. },
  233. "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
  234. "targets": {
  235. "type": "array",
  236. "minItems": 1,
  237. "items": {
  238. "type": "object",
  239. "required": [
  240. "name", "status", "tasks", "trace_files", "assertion_count",
  241. "cover_count", "cover_required", "cover_hit_count", "cover_hit_ids",
  242. "input_evidence", "task_results", "evidence_failures"
  243. ],
  244. "properties": {
  245. "status": {"const": "pass"},
  246. "tasks": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  247. "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  248. "assertion_count": {"type": "integer", "minimum": 1},
  249. "cover_count": {"type": "integer", "minimum": 0},
  250. "cover_required": {"type": "boolean"},
  251. "cover_hit_count": {"type": "integer", "minimum": 0},
  252. "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  253. "input_evidence": {"$ref": "#/$defs/formalInputEvidence"},
  254. "task_results": {
  255. "type": "array",
  256. "minItems": 1,
  257. "items": {
  258. "type": "object",
  259. "required": [
  260. "name", "mode", "status", "status_raw", "status_file", "workdir",
  261. "trace_files", "cover_hit_ids", "configured_engines", "observed_engines",
  262. "solvers", "compiled_design_json", "compiled_design_sha256",
  263. "compiled_assertion_count", "compiled_assertion_ids",
  264. "compiled_cover_count", "compiled_cover_ids", "evidence_failures"
  265. ],
  266. "properties": {
  267. "name": {"type": "string", "minLength": 1},
  268. "mode": {"type": "string"},
  269. "status": {"const": "PASS"},
  270. "status_raw": {"type": "string"},
  271. "status_file": {"type": "string", "minLength": 1},
  272. "workdir": {"type": "string", "minLength": 1},
  273. "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  274. "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  275. "configured_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  276. "observed_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  277. "solvers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  278. "compiled_design_json": {"type": "string", "minLength": 1},
  279. "compiled_design_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
  280. "compiled_assertion_count": {"type": "integer", "minimum": 0},
  281. "compiled_assertion_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  282. "compiled_cover_count": {"type": "integer", "minimum": 0},
  283. "compiled_cover_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
  284. "evidence_failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
  285. },
  286. "allOf": [
  287. {
  288. "if": {"properties": {"mode": {"enum": ["prove", "bmc"]}}, "required": ["mode"]},
  289. "then": {
  290. "properties": {
  291. "compiled_assertion_count": {"minimum": 1},
  292. "compiled_assertion_ids": {"minItems": 1}
  293. }
  294. }
  295. },
  296. {
  297. "if": {"properties": {"mode": {"const": "cover"}}, "required": ["mode"]},
  298. "then": {
  299. "properties": {
  300. "compiled_cover_count": {"minimum": 1},
  301. "compiled_cover_ids": {"minItems": 1}
  302. }
  303. }
  304. }
  305. ]
  306. }
  307. },
  308. "evidence_failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
  309. }
  310. }
  311. },
  312. "safety": {"const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}}
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. }
  320. ]
  321. }