offline_fidelity_gate_v1_receipt.schema.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "offline_fidelity_gate_v1_receipt.schema.json",
  4. "title": "Offline fidelity gate v1 receipt",
  5. "type": "object",
  6. "required": ["schema", "status", "generated_at", "toolchain", "layers", "coverage_matrix", "safety", "authority_boundary"],
  7. "properties": {
  8. "schema": { "const": "offline-fidelity-gate-v1-receipt-v1" },
  9. "status": { "const": "pass" },
  10. "generated_at": { "type": "string" },
  11. "toolchain": {
  12. "type": "object",
  13. "required": ["status", "toolchain", "manifest", "cleanup_policy", "safety", "authority_boundary"],
  14. "properties": {
  15. "status": { "const": "pass" },
  16. "toolchain": {
  17. "type": "object",
  18. "required": ["status", "tools"],
  19. "properties": {
  20. "status": { "const": "pass" },
  21. "tools": {
  22. "type": "object",
  23. "required": ["python", "iverilog", "vvp", "verilator", "yosys", "sby", "cocotb", "td_cli"]
  24. }
  25. },
  26. "additionalProperties": true
  27. },
  28. "manifest": {
  29. "type": "object",
  30. "required": ["install_roots", "tools", "cleanup_plan", "safety"],
  31. "properties": {
  32. "install_roots": { "type": "object", "minProperties": 1 },
  33. "tools": { "type": "array", "minItems": 8 },
  34. "cleanup_plan": {
  35. "type": "object",
  36. "required": ["default", "requires_owner_marker", "allowed_root"],
  37. "properties": {
  38. "default": { "const": "dry_run" },
  39. "requires_owner_marker": { "const": true },
  40. "allowed_root": { "type": "string", "minLength": 1 }
  41. },
  42. "additionalProperties": true
  43. }
  44. },
  45. "additionalProperties": true
  46. },
  47. "cleanup_policy": {
  48. "type": "object",
  49. "required": ["default", "requires_owner_marker", "allowed_root"],
  50. "properties": {
  51. "default": { "const": "dry_run" },
  52. "requires_owner_marker": { "const": true },
  53. "allowed_root": { "type": "string", "minLength": 1 }
  54. },
  55. "additionalProperties": true
  56. },
  57. "safety": {
  58. "type": "object",
  59. "required": ["opens_com_ports", "toggles_dtr_rts", "installs_drivers", "programs_flash", "touches_ptc_fan_bmc"],
  60. "properties": {
  61. "opens_com_ports": { "const": false },
  62. "toggles_dtr_rts": { "const": false },
  63. "installs_drivers": { "const": false },
  64. "programs_flash": { "const": false },
  65. "touches_ptc_fan_bmc": { "const": false }
  66. },
  67. "additionalProperties": true
  68. },
  69. "authority_boundary": { "type": "string" }
  70. },
  71. "additionalProperties": true
  72. },
  73. "layers": {
  74. "type": "object",
  75. "required": [
  76. "static",
  77. "model",
  78. "replay",
  79. "protocol_fuzz",
  80. "hdl_sim",
  81. "cocotb_virtual_lab",
  82. "virtual_driver_lab",
  83. "formal",
  84. "detector_selftest",
  85. "mutation",
  86. "thermal_digital_twin",
  87. "coverage_matrix",
  88. "td_build",
  89. "debug_bundle"
  90. ],
  91. "properties": {
  92. "static": { "$ref": "#/$defs/staticLayer" },
  93. "model": { "$ref": "#/$defs/modelLayer" },
  94. "replay": { "$ref": "#/$defs/passLayer" },
  95. "protocol_fuzz": { "$ref": "#/$defs/scenarioLayer" },
  96. "hdl_sim": { "$ref": "#/$defs/hdlLayer" },
  97. "cocotb_virtual_lab": { "$ref": "#/$defs/cocotbLayer" },
  98. "virtual_driver_lab": { "$ref": "#/$defs/virtualDriverLayer" },
  99. "formal": { "$ref": "#/$defs/formalLayer" },
  100. "detector_selftest": { "$ref": "#/$defs/detectorLayer" },
  101. "mutation": { "$ref": "#/$defs/mutationLayer" },
  102. "thermal_digital_twin": { "$ref": "#/$defs/thermalLayer" },
  103. "coverage_matrix": { "$ref": "#/$defs/coverageLayer" },
  104. "td_build": { "$ref": "#/$defs/tdLayer" },
  105. "debug_bundle": { "$ref": "#/$defs/debugBundleLayer" }
  106. },
  107. "additionalProperties": false,
  108. "$comment": "hardware, board, uart_strict, chipwatcher, thermal_performance_pass, and any undeclared layer are rejected."
  109. },
  110. "coverage_matrix": { "$ref": "#/$defs/passLayer" },
  111. "safety": {
  112. "type": "object",
  113. "required": ["opens_com_ports", "toggles_dtr_rts", "programs_flash", "installs_drivers", "real_ptc_fan_bmc_action_attempted"],
  114. "properties": {
  115. "opens_com_ports": { "const": false },
  116. "toggles_dtr_rts": { "const": false },
  117. "programs_flash": { "const": false },
  118. "installs_drivers": { "const": false },
  119. "real_ptc_fan_bmc_action_attempted": { "const": false }
  120. },
  121. "additionalProperties": true
  122. },
  123. "authority_boundary": {
  124. "type": "string",
  125. "not": {
  126. "anyOf": [
  127. { "pattern": "thermal_performance_pass" },
  128. { "pattern": "thermal performance pass" },
  129. { "pattern": "hardware pass" },
  130. { "pattern": "board pass" },
  131. { "pattern": "uart_strict pass" },
  132. { "pattern": "chipwatcher pass" }
  133. ]
  134. }
  135. }
  136. },
  137. "not": {
  138. "anyOf": [
  139. { "required": ["hardware"] },
  140. { "required": ["board"] },
  141. { "required": ["uart_strict"] },
  142. { "required": ["chipwatcher"] },
  143. { "required": ["thermal_performance_pass"] }
  144. ]
  145. },
  146. "additionalProperties": true,
  147. "$defs": {
  148. "passLayer": {
  149. "type": "object",
  150. "required": ["status"],
  151. "properties": { "status": { "const": "pass" } },
  152. "additionalProperties": true
  153. },
  154. "staticLayer": {
  155. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  156. "required": ["status", "returncode"]
  157. },
  158. "modelLayer": {
  159. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  160. "required": ["status", "tests"]
  161. },
  162. "scenarioLayer": {
  163. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  164. "required": ["status", "scenarios"]
  165. },
  166. "hdlLayer": {
  167. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  168. "anyOf": [{ "required": ["tests"] }, { "required": ["backend_results"] }]
  169. },
  170. "cocotbLayer": {
  171. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  172. "required": ["status", "sim"]
  173. },
  174. "formalLayer": {
  175. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  176. "required": ["status", "targets"]
  177. },
  178. "detectorLayer": {
  179. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  180. "required": ["status", "results"]
  181. },
  182. "virtualDriverLayer": {
  183. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  184. "required": ["status", "user_mode_shims", "fault_contracts", "trace_hash"],
  185. "properties": {
  186. "user_mode_shims": {
  187. "type": "array",
  188. "minItems": 6,
  189. "allOf": [
  190. { "contains": { "type": "object", "properties": { "name": { "const": "pyserial_loopback_url" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
  191. { "contains": { "type": "object", "properties": { "name": { "const": "socket_pipe_transport" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
  192. { "contains": { "type": "object", "properties": { "name": { "const": "bmc_text_driver" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
  193. { "contains": { "type": "object", "properties": { "name": { "const": "host_register_plane" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
  194. { "contains": { "type": "object", "properties": { "name": { "const": "debug_uart_decoder" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
  195. { "contains": { "type": "object", "properties": { "name": { "const": "fault_injection_facade" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } }
  196. ]
  197. },
  198. "fault_contracts": {
  199. "type": "array",
  200. "minItems": 8,
  201. "allOf": [
  202. { "contains": { "const": "timeout" } },
  203. { "contains": { "const": "disconnect" } },
  204. { "contains": { "const": "partial_read" } },
  205. { "contains": { "const": "partial_write" } },
  206. { "contains": { "const": "permission_denied" } },
  207. { "contains": { "const": "buffer_overflow" } },
  208. { "contains": { "const": "tx_backpressure" } },
  209. { "contains": { "const": "rx_overflow" } }
  210. ]
  211. },
  212. "trace_hash": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
  213. },
  214. "additionalProperties": true
  215. },
  216. "mutationLayer": {
  217. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  218. "required": ["status", "mutants"],
  219. "properties": {
  220. "mutants": {
  221. "type": "array",
  222. "minItems": 6,
  223. "items": {
  224. "type": "object",
  225. "required": ["name", "status", "mutation_status", "artifact_sha256"],
  226. "properties": {
  227. "status": { "const": "pass" },
  228. "mutation_status": { "const": "killed" },
  229. "artifact_sha256": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
  230. },
  231. "additionalProperties": true
  232. }
  233. }
  234. },
  235. "additionalProperties": true
  236. },
  237. "thermalLayer": {
  238. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  239. "required": ["status", "models"],
  240. "properties": {
  241. "models": {
  242. "type": "array",
  243. "minItems": 7,
  244. "items": {
  245. "type": "object",
  246. "required": ["name", "status", "trace_hash"],
  247. "properties": {
  248. "status": { "const": "pass" },
  249. "trace_hash": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" },
  250. "violations": { "type": "array", "maxItems": 0 }
  251. },
  252. "additionalProperties": true
  253. }
  254. }
  255. },
  256. "additionalProperties": true
  257. },
  258. "coverageLayer": {
  259. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  260. "required": ["status", "items"],
  261. "properties": {
  262. "items": {
  263. "type": "array",
  264. "minItems": 12,
  265. "allOf": [
  266. { "contains": { "type": "object", "properties": { "category": { "const": "protocol" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  267. { "contains": { "type": "object", "properties": { "category": { "const": "uart_bit" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  268. { "contains": { "type": "object", "properties": { "category": { "const": "control" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  269. { "contains": { "type": "object", "properties": { "category": { "const": "safety" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  270. { "contains": { "type": "object", "properties": { "category": { "const": "debug" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  271. { "contains": { "type": "object", "properties": { "category": { "const": "virtual_driver_lab" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  272. { "contains": { "type": "object", "properties": { "category": { "const": "thermal" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  273. { "contains": { "type": "object", "properties": { "category": { "const": "fault_injection" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  274. { "contains": { "type": "object", "properties": { "category": { "const": "cocotb_virtual_lab" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  275. { "contains": { "type": "object", "properties": { "category": { "const": "formal" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  276. { "contains": { "type": "object", "properties": { "category": { "const": "mutation" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
  277. { "contains": { "type": "object", "properties": { "category": { "const": "td_toolchain" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } }
  278. ]
  279. }
  280. },
  281. "additionalProperties": true
  282. },
  283. "tdLayer": {
  284. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  285. "required": ["status", "elaboration"]
  286. },
  287. "debugBundleLayer": {
  288. "allOf": [{ "$ref": "#/$defs/passLayer" }],
  289. "anyOf": [{ "required": ["path"] }, { "required": ["bundle_dir"] }]
  290. }
  291. }
  292. }