{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://local.invalid/schemas/board_viewer_data.schema.json", "title": "Generated board viewer data", "type": "object", "additionalProperties": false, "required": [ "schema", "board", "counts", "touchpoints", "resistors", "evidence_conflicts", "interfaces", "photo_overlay", "value_coverage", "component_value_source_status", "resistor_links" ], "properties": { "schema": { "const": "board-viewer-data-v2" }, "board": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "source_bounds", "view_box" ], "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "source_bounds": { "$ref": "#/$defs/bounds" }, "view_box": { "$ref": "#/$defs/bounds" } } }, "counts": { "type": "object", "additionalProperties": false, "required": [ "footprints", "touchpoints", "pads", "resistors", "resistor_pads", "resistor_electrical_pads", "connector_contacts", "connector_auxiliary_pads", "categories", "sides", "touchpoint_sides", "resistor_sides" ], "properties": { "footprints": { "type": "integer", "minimum": 0 }, "touchpoints": { "type": "integer", "minimum": 0 }, "pads": { "type": "integer", "minimum": 0, "description": "Touchpoint pin count (CON|J|PL|TP pads only). Not all PCB pads." }, "resistors": { "type": "integer", "minimum": 0 }, "resistor_pads": { "type": "integer", "minimum": 0 }, "connector_contacts": { "type": "integer", "minimum": 0 }, "connector_auxiliary_pads": { "type": "integer", "minimum": 0 }, "categories": { "$ref": "#/$defs/countMap" }, "sides": { "type": "object", "additionalProperties": false, "required": [ "front", "back" ], "properties": { "front": { "type": "integer", "minimum": 0 }, "back": { "type": "integer", "minimum": 0 } }, "description": "Legacy alias of touchpoint_sides only; NOT whole-board or resistor sides." }, "resistor_electrical_pads": { "type": "integer", "minimum": 0 }, "touchpoint_sides": { "type": "object", "additionalProperties": false, "required": [ "front", "back" ], "properties": { "front": { "type": "integer", "minimum": 0 }, "back": { "type": "integer", "minimum": 0 } }, "description": "Front/back counts for touchpoints only." }, "resistor_sides": { "type": "object", "additionalProperties": false, "required": [ "front", "back" ], "properties": { "front": { "type": "integer", "minimum": 0 }, "back": { "type": "integer", "minimum": 0 } }, "description": "Front/back counts for discrete resistors only." } } }, "touchpoints": { "type": "array", "items": { "$ref": "#/$defs/touchpoint" } }, "resistors": { "type": "array", "items": { "$ref": "#/$defs/resistor" } }, "interfaces": { "type": "array", "items": { "type": "object" } }, "photo_overlay": { "oneOf": [ { "type": "null" }, { "type": "object", "additionalProperties": false, "required": [ "asset", "sha256", "matrix", "control_point_count" ], "properties": { "asset": { "type": "string", "pattern": "^board-photo\\.(png|jpg|jpeg|webp)$" }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "matrix": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "type": "number" } }, "control_point_count": { "type": "integer", "minimum": 3 } } } ] }, "evidence_conflicts": { "type": "array", "items": { "$ref": "#/$defs/evidenceConflict" } }, "value_coverage": { "type": "object", "additionalProperties": true, "required": [ "resistors_total", "component_value_nonempty", "value_parsed", "value_missing_or_unparsed", "component_value_source_status" ], "properties": { "resistors_total": { "type": "integer", "minimum": 0 }, "component_value_nonempty": { "type": "integer", "minimum": 0 }, "value_parsed": { "type": "integer", "minimum": 0 }, "value_zero_ohm_fitted_or_unknown": { "type": "integer", "minimum": 0 }, "value_zero_ohm_not_fitted": { "type": "integer", "minimum": 0 }, "assembly_not_fitted": { "type": "integer", "minimum": 0 }, "value_missing_or_unparsed": { "type": "integer", "minimum": 0 }, "component_value_source_status": { "type": "string" }, "example_available_tokens": { "type": "array", "items": { "type": "string" } }, "note": { "type": "string" } } }, "component_value_source_status": { "type": "string", "minLength": 1 }, "resistor_links": { "type": "array", "items": { "$ref": "#/$defs/structuredResistorLink" } } }, "$defs": { "countMap": { "type": "object", "additionalProperties": false, "required": [ "CON", "J", "PL", "TP", "R" ], "properties": { "CON": { "type": "integer", "minimum": 0 }, "J": { "type": "integer", "minimum": 0 }, "PL": { "type": "integer", "minimum": 0 }, "TP": { "type": "integer", "minimum": 0 }, "R": { "type": "integer", "minimum": 0 } } }, "point": { "type": "object", "additionalProperties": false, "required": [ "x", "y" ], "properties": { "x": { "type": "number" }, "y": { "type": "number" } } }, "bounds": { "type": "object", "additionalProperties": false, "required": [ "x", "y", "width", "height" ], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "width": { "type": "number", "minimum": 0 }, "height": { "type": "number", "minimum": 0 } } }, "evidenceTier": { "enum": [ "board_database", "cross_verified", "name_inferred", "unknown" ] }, "ioEvidenceGrades": { "type": "object", "additionalProperties": false, "required": [ "physical_path", "product_polarity", "hardware_measurement" ], "properties": { "physical_path": { "enum": [ "confirmed_by_brd", "inferred", "blocked", "not_applicable", "unknown" ] }, "product_polarity": { "enum": [ "confirmed_by_electrical_staff", "inferred", "blocked", "not_applicable", "unknown" ] }, "hardware_measurement": { "enum": [ "not_run", "pass", "fail", "blocked", "not_applicable", "unknown" ] } } }, "fpga": { "type": "object", "additionalProperties": false, "required": [ "ball", "board_signal", "io_standard", "capabilities", "evidence_tier", "sources" ], "properties": { "ball": { "type": "string" }, "board_signal": { "type": "string" }, "io_standard": { "type": "string" }, "capabilities": { "type": "array", "items": { "type": "string" } }, "evidence_tier": { "$ref": "#/$defs/evidenceTier" }, "sources": { "type": "array", "items": { "type": "string" } } } }, "mcu": { "type": "object", "additionalProperties": false, "required": [ "device", "family", "pin", "signal", "capabilities", "evidence_tier", "sources" ], "properties": { "device": { "type": "string", "minLength": 1 }, "family": { "type": "string", "minLength": 1 }, "pin": { "type": "string", "minLength": 1 }, "signal": { "type": "string", "minLength": 1 }, "capabilities": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "evidence_tier": { "$ref": "#/$defs/evidenceTier" }, "sources": { "type": "array", "items": { "type": "string", "minLength": 1 } } } }, "pin": { "type": "object", "additionalProperties": false, "required": [ "id", "number", "pad_role", "row", "column", "board_order", "mechanical", "electrical", "net", "position", "view_position", "size", "rotation", "shape", "layers", "direction", "external_level", "function_category", "reserved", "fixed_load_conflict", "board_pull", "adc_pulltype", "active_level", "polarity", "external_components", "summary", "path", "evidence_tier", "evidence_sources", "fpga", "mcu", "programming", "recommendation" ], "properties": { "id": { "type": "string", "minLength": 1 }, "number": { "type": "string" }, "pad_role": { "enum": [ "contact", "shield", "mechanical", "unknown" ] }, "row": { "type": [ "integer", "null" ], "minimum": 1 }, "column": { "type": [ "integer", "null" ], "minimum": 1 }, "board_order": { "type": [ "integer", "null" ], "minimum": 1 }, "mechanical": { "type": "boolean" }, "electrical": { "type": "boolean" }, "net": { "type": [ "string", "null" ] }, "position": { "$ref": "#/$defs/point" }, "view_position": { "$ref": "#/$defs/point" }, "size": { "type": "object", "additionalProperties": false, "required": [ "width", "height", "drill_width", "drill_height" ], "properties": { "width": { "type": "number", "minimum": 0 }, "height": { "type": "number", "minimum": 0 }, "drill_width": { "type": "number", "minimum": 0 }, "drill_height": { "type": "number", "minimum": 0 } } }, "rotation": { "type": "number" }, "shape": { "type": "string" }, "layers": { "type": "array", "items": { "type": "string" } }, "direction": { "enum": [ "input", "output", "bidirectional", "passive", "unknown" ] }, "external_level": { "type": "string" }, "function_category": { "type": "string" }, "reserved": { "type": "boolean" }, "fixed_load_conflict": { "type": "boolean" }, "board_pull": { "type": [ "string", "null" ] }, "adc_pulltype": { "type": [ "string", "null" ], "pattern": "^[A-Z][A-Z0-9_]*$" }, "active_level": { "type": "string", "minLength": 1 }, "polarity": { "type": "string", "minLength": 1 }, "external_components": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "summary": { "type": "string" }, "path": { "type": "array", "items": { "type": "string" } }, "evidence_tier": { "$ref": "#/$defs/evidenceTier" }, "evidence_sources": { "type": "array", "items": { "type": "string" } }, "evidence_grades": { "$ref": "#/$defs/ioEvidenceGrades" }, "fpga": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/fpga" } ] }, "mcu": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/mcu" } ] }, "programming": { "$ref": "#/$defs/programming" }, "recommendation": { "type": "object", "additionalProperties": false, "required": [ "eligible", "reasons" ], "properties": { "eligible": { "type": "boolean" }, "reasons": { "type": "array", "items": { "type": "string" } } } }, "related_resistors": { "type": "array", "items": { "$ref": "#/$defs/relatedResistor" } } } }, "programming": { "type": "object", "additionalProperties": false, "required": [ "status", "conclusion", "network_explanation", "hdl_guidance", "connection_guidance", "constraints", "risks", "evidence_tier", "sources" ], "properties": { "status": { "enum": [ "verified_fpga", "verified_mcu", "board_only", "not_programmable", "unknown" ] }, "conclusion": { "type": "string", "minLength": 1 }, "network_explanation": { "type": "string", "minLength": 1 }, "hdl_guidance": { "type": "string", "minLength": 1 }, "connection_guidance": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "constraints": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "risks": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "evidence_tier": { "$ref": "#/$defs/evidenceTier" }, "sources": { "type": "array", "items": { "type": "string", "minLength": 1 } } } }, "connector": { "type": "object", "additionalProperties": false, "required": [ "profile", "review_status", "view", "contact_count", "auxiliary_pad_count", "rows", "columns", "contact_grid", "contact_order", "sources" ], "properties": { "profile": { "type": [ "string", "null" ] }, "review_status": { "$ref": "#/$defs/evidenceTier" }, "view": { "const": "board_front" }, "contact_count": { "type": "integer", "minimum": 0 }, "auxiliary_pad_count": { "type": "integer", "minimum": 0 }, "rows": { "type": "integer", "minimum": 0 }, "columns": { "type": "integer", "minimum": 0 }, "contact_grid": { "type": "array", "items": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "contact_order": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "sources": { "type": "array", "items": { "type": "string", "minLength": 1 } } } }, "touchpoint": { "type": "object", "additionalProperties": false, "required": [ "reference", "category", "component_value", "position", "view_position", "rotation", "bounds", "view_bounds", "side", "summary", "connector", "pins" ], "properties": { "reference": { "type": "string", "pattern": "^(CON|J|PL|TP)[0-9]+$" }, "category": { "enum": [ "CON", "J", "PL", "TP" ] }, "component_value": { "type": "string" }, "position": { "$ref": "#/$defs/point" }, "view_position": { "$ref": "#/$defs/point" }, "rotation": { "type": "number" }, "bounds": { "$ref": "#/$defs/bounds" }, "view_bounds": { "$ref": "#/$defs/bounds" }, "side": { "enum": [ "front", "back" ] }, "summary": { "type": "string" }, "connector": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/connector" } ] }, "pins": { "type": "array", "items": { "$ref": "#/$defs/pin" } } } }, "resistorPad": { "type": "object", "additionalProperties": false, "required": [ "id", "number", "net", "position", "view_position", "bounds", "view_bounds", "pad_role", "size", "rotation", "shape", "layers" ], "properties": { "number": { "type": "string" }, "net": { "type": [ "string", "null" ] }, "position": { "$ref": "#/$defs/point" }, "view_position": { "$ref": "#/$defs/point" }, "pad_role": { "enum": [ "electrical", "mechanical" ] }, "size": { "type": "object", "additionalProperties": false, "required": [ "width", "height", "drill_width", "drill_height" ], "properties": { "width": { "type": "number", "minimum": 0 }, "height": { "type": "number", "minimum": 0 }, "drill_width": { "type": "number", "minimum": 0 }, "drill_height": { "type": "number", "minimum": 0 } } }, "id": { "type": "string", "minLength": 1 }, "bounds": { "$ref": "#/$defs/bounds" }, "view_bounds": { "$ref": "#/$defs/bounds" }, "rotation": { "type": "number" }, "shape": { "type": "string", "minLength": 1 }, "layers": { "type": "array", "items": { "type": "string", "minLength": 1 } } } }, "resistor": { "type": "object", "additionalProperties": false, "required": [ "reference", "category", "component_value", "value_ohms", "value_tokens", "position", "view_position", "rotation", "bounds", "view_bounds", "side", "summary", "pads", "value_parse_status", "assembly_status" ], "properties": { "reference": { "type": "string", "pattern": "^R[0-9]+$" }, "category": { "const": "R" }, "component_value": { "type": "string" }, "value_ohms": { "type": [ "number", "null" ], "minimum": 0 }, "value_tokens": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "position": { "$ref": "#/$defs/point" }, "view_position": { "$ref": "#/$defs/point" }, "rotation": { "type": "number" }, "bounds": { "$ref": "#/$defs/bounds" }, "view_bounds": { "$ref": "#/$defs/bounds" }, "side": { "enum": [ "front", "back" ] }, "summary": { "type": "string" }, "pads": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/resistorPad" } }, "value_parse_status": { "enum": [ "parsed", "unparsed", "ambiguous" ] }, "assembly_status": { "enum": [ "unknown", "fitted", "not_fitted" ] } } }, "relatedResistor": { "type": "object", "additionalProperties": false, "required": [ "source_pin_id", "source_field", "resistor_reference", "pad_number", "raw_context", "status", "pcb_net", "claimed_net" ], "properties": { "source_pin_id": { "type": "string" }, "source_field": { "enum": [ "path", "external_components", "resistor_links" ] }, "resistor_reference": { "type": "string", "pattern": "^R[0-9]+$" }, "pad_number": { "type": [ "string", "null" ] }, "raw_context": { "type": "string" }, "status": { "enum": [ "resolved", "missing_reference", "missing_pad", "net_conflict" ] }, "pcb_net": { "type": [ "string", "null" ] }, "claimed_net": { "type": [ "string", "null" ] } } }, "evidenceConflict": { "type": "object", "additionalProperties": true, "required": [ "id", "subject_reference", "status", "kind", "primary_source" ], "properties": { "id": { "type": "string", "minLength": 1 }, "subject_reference": { "type": "string" }, "status": { "enum": [ "unresolved", "resolved", "info" ] }, "kind": { "type": "string", "minLength": 1 }, "summary": { "type": "string" }, "primary_source": { "type": "string", "minLength": 1 }, "claims": { "type": "array" }, "subject_in_pcb_index": { "type": "boolean" }, "pcb_pads": { "type": "array" } } }, "structuredResistorLink": { "type": "object", "additionalProperties": false, "required": [ "source_pin_id", "resistor_reference", "pad_number", "claimed_net", "pcb_net", "status", "evidence_source" ], "properties": { "source_pin_id": { "type": "string" }, "resistor_reference": { "type": "string", "pattern": "^R[0-9]+$" }, "pad_number": { "type": [ "string", "null" ] }, "claimed_net": { "type": [ "string", "null" ] }, "pcb_net": { "type": [ "string", "null" ] }, "status": { "enum": [ "resolved", "missing_reference", "missing_pad", "net_conflict" ] }, "evidence_source": { "type": "string" }, "note": { "type": "string" } } } } }