{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "prod2u-program-sram-receipt-v1", "title": "Prod2U PROGRAM_SRAM receipt", "type": "object", "required": [ "schema", "status", "run_id", "request", "bitstream", "staging", "execution", "parser", "safety", "tool", "mutex", "process_cleanup", "artifacts", "authority_boundary" ], "properties": { "schema": {"const": "prod2u-program-sram-receipt-v1"}, "status": {"enum": ["pass", "fail", "fail_forbidden_action"]}, "run_id": {"type": "string", "minLength": 1}, "request": { "type": "object", "required": ["operation", "target_chip", "cable_index", "speed_code", "speed_hz", "attempt_limit", "power_cycle_allowed"], "properties": { "operation": {"const": "PROGRAM_SRAM"}, "target_chip": {"const": "EF2L45"}, "cable_index": {"const": 0}, "speed_code": {"const": 2}, "speed_hz": {"const": 200000}, "attempt_limit": {"const": 1}, "power_cycle_allowed": {"const": false} }, "additionalProperties": true }, "bitstream": { "type": "object", "required": ["path", "sha256", "commit"], "properties": { "path": {"type": "string", "minLength": 1}, "sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"}, "commit": {"type": "string", "pattern": "^[0-9a-f]{8}$"} }, "additionalProperties": true }, "staging": { "type": "object", "required": ["expected_path", "observed_path", "matches_expected_path"], "properties": { "expected_path": {"type": "string"}, "observed_path": {"type": "string"}, "matches_expected_path": {"type": "boolean"} }, "additionalProperties": true }, "execution": { "type": "object", "required": ["exit_code", "timed_out", "attempt_count", "retry_count", "power_cycle_count", "command_execution_attempted", "timeout_seconds", "started_at", "finished_at", "duration_seconds"], "properties": { "exit_code": {"type": "integer"}, "timed_out": {"type": "boolean"}, "attempt_count": {"const": 1}, "retry_count": {"const": 0}, "power_cycle_count": {"const": 0}, "command_execution_attempted": {"type": "boolean"}, "timeout_seconds": {"const": 60}, "started_at": {"type": "string", "minLength": 1}, "finished_at": {"type": "string", "minLength": 1}, "duration_seconds": {"type": "number", "minimum": 0} }, "additionalProperties": true }, "parser": { "type": "object", "required": ["status", "exit_code_trusted", "ordered_markers", "ordered_markers_complete", "observed_markers", "observed_marker_lines", "error_markers", "failures", "transcript_sha256"], "properties": { "status": {"enum": ["pass", "fail"]}, "exit_code_trusted": {"const": false}, "ordered_markers": {"const": ["download_start", "chip_validation", "bit_to_vec_start", "bit_to_vec_finish", "program_start", "program_finish", "download_finish"]}, "ordered_markers_complete": {"type": "boolean"}, "observed_markers": {"type": "array", "items": {"type": "string"}}, "observed_marker_lines": {"type": "array", "items": {"type": "integer", "minimum": 1}}, "error_markers": {"type": "array", "items": {"type": "string"}}, "failures": {"type": "array", "items": {"type": "string"}}, "transcript_sha256": {"$ref": "#/$defs/nonEmptySha256"} }, "additionalProperties": true }, "safety": { "type": "object", "required": ["flash_attempted", "programs_nonvolatile", "power_cycle_attempted", "driver_install_attempted", "toggles_dtr_rts", "real_ptc_fan_action_attempted", "external_programming_command_executed"], "properties": { "flash_attempted": {"type": "boolean"}, "programs_nonvolatile": {"type": "boolean"}, "power_cycle_attempted": {"const": false}, "driver_install_attempted": {"const": false}, "toggles_dtr_rts": {"const": false}, "real_ptc_fan_action_attempted": {"const": false}, "external_programming_command_executed": {"type": "boolean"} }, "additionalProperties": true }, "tool": { "type": "object", "required": ["path", "td_root", "td_bin"], "properties": { "path": {"type": "string", "minLength": 1}, "td_root": {"type": "string", "minLength": 1}, "td_bin": {"type": "string", "minLength": 1} }, "additionalProperties": true }, "mutex": { "type": "object", "required": ["name", "acquired"], "properties": { "name": {"const": "Global\\Prod2UProgramSram"}, "acquired": {"const": true} }, "additionalProperties": true }, "process_cleanup": { "type": "object", "required": [ "status", "td_root", "identity_audit_completed_before_action", "ownership_policy", "discovered_processes", "harness_owned_processes", "blocking_processes", "graceful_close_requested", "forced_terminated", "wait_seconds", "remaining", "post_action_audit_completed", "post_action_discovered_processes", "post_action_harness_owned_processes", "post_action_blocking_processes", "residual_processes", "post_action_errors", "errors" ], "properties": { "status": {"enum": ["pass", "fail"]}, "td_root": {"type": "string", "minLength": 1}, "identity_audit_completed_before_action": {"const": true}, "ownership_policy": {"$ref": "#/$defs/processOwnershipPolicy"}, "discovered_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}}, "harness_owned_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}}, "blocking_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "graceful_close_requested": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}}, "forced_terminated": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}}, "wait_seconds": {"const": 5.0}, "remaining": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "post_action_audit_completed": {"const": true}, "post_action_discovered_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "post_action_harness_owned_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "post_action_blocking_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "residual_processes": {"type": "array", "items": {"$ref": "#/$defs/processIdentity"}, "maxItems": 0}, "post_action_errors": {"type": "array", "items": {"type": "string"}, "maxItems": 0}, "errors": {"type": "array", "items": {"type": "string"}, "maxItems": 0} }, "additionalProperties": true }, "artifacts": { "type": "object", "required": ["tcl", "stdout", "stderr", "log_delta", "log_delta_sources"], "properties": { "tcl": {"$ref": "#/$defs/artifact"}, "stdout": {"$ref": "#/$defs/artifact"}, "stderr": {"$ref": "#/$defs/artifact"}, "log_delta": {"$ref": "#/$defs/artifact"}, "log_delta_sources": { "type": "array", "items": { "type": "object", "required": ["path", "start_offset", "byte_count", "sha256"], "properties": { "path": {"type": "string", "minLength": 1, "pattern": "(^|[\\\\/])bw_[^\\\\/]+\\.log$"}, "start_offset": {"type": "integer", "minimum": 0}, "byte_count": {"type": "integer", "minimum": 1}, "sha256": {"$ref": "#/$defs/nonEmptySha256"} }, "additionalProperties": true } } }, "additionalProperties": true }, "authority_boundary": {"type": "string", "minLength": 1} }, "additionalProperties": true, "allOf": [ { "if": { "properties": {"status": {"const": "pass"}}, "required": ["status"] }, "then": { "properties": { "staging": { "properties": {"matches_expected_path": {"const": true}} }, "execution": { "properties": { "exit_code": {"const": 0}, "timed_out": {"const": false}, "attempt_count": {"const": 1}, "retry_count": {"const": 0}, "power_cycle_count": {"const": 0}, "command_execution_attempted": {"const": true}, "timeout_seconds": {"const": 60} } }, "parser": { "properties": { "status": {"const": "pass"}, "ordered_markers_complete": {"const": true}, "observed_markers": {"const": ["download_start", "chip_validation", "bit_to_vec_start", "bit_to_vec_finish", "program_start", "program_finish", "download_finish"]}, "error_markers": {"maxItems": 0}, "failures": {"maxItems": 0} } }, "artifacts": { "properties": { "log_delta": { "properties": { "size": {"type": "integer", "minimum": 1}, "sha256": {"$ref": "#/$defs/nonEmptySha256"} } }, "log_delta_sources": {"minItems": 1, "maxItems": 1} } }, "safety": { "properties": { "flash_attempted": {"const": false}, "programs_nonvolatile": {"const": false}, "power_cycle_attempted": {"const": false}, "driver_install_attempted": {"const": false}, "toggles_dtr_rts": {"const": false}, "real_ptc_fan_action_attempted": {"const": false}, "external_programming_command_executed": {"const": true} } }, "process_cleanup": { "properties": { "status": {"const": "pass"}, "identity_audit_completed_before_action": {"const": true}, "blocking_processes": {"maxItems": 0}, "remaining": {"maxItems": 0}, "post_action_audit_completed": {"const": true}, "residual_processes": {"maxItems": 0}, "post_action_errors": {"maxItems": 0}, "errors": {"maxItems": 0} } } } } } ], "$defs": { "processIdentity": { "type": "object", "required": ["pid", "name", "path", "user", "session_id", "parent_pid", "command_line", "start_time", "exe_sha256"], "properties": { "pid": {"type": "integer", "minimum": 1}, "name": {"enum": ["td.exe", "td_commands_prompt.exe", "bw.exe", "bw_commands_prompt.exe", "hwserver.exe"]}, "path": {"type": "string", "minLength": 1}, "user": {"type": "string", "minLength": 1}, "session_id": {"type": "integer", "minimum": 0}, "parent_pid": {"type": "integer", "minimum": 0}, "command_line": {"type": "string", "minLength": 1}, "start_time": {"type": "string", "minLength": 1}, "exe_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"} }, "additionalProperties": false }, "processOwnershipPolicy": { "type": "object", "required": ["owner", "session_id", "parent_pid", "approved_binaries", "command_line"], "properties": { "owner": {"type": "string", "minLength": 1}, "session_id": {"type": "integer", "minimum": 0}, "parent_pid": {"type": "integer", "minimum": 1}, "approved_binaries": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["name", "path", "exe_sha256"], "properties": { "name": {"enum": ["bw_commands_prompt.exe"]}, "path": {"type": "string", "minLength": 1}, "exe_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"} }, "additionalProperties": false } }, "command_line": {"type": "string", "minLength": 1} }, "additionalProperties": false }, "nonEmptySha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "not": {"const": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"} }, "artifact": { "type": "object", "required": ["path", "size", "sha256"], "properties": { "path": {"type": "string", "minLength": 1}, "size": {"type": "integer", "minimum": 0}, "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"} }, "additionalProperties": true } } }