This repository has been archived on 2026-09-16. You can view files and clone it, but cannot push or open issues or pull requests.
win-diagnostics-analysis/schemas/diagnostic.schema.json

270 lines
6.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Win Diagnostics artifact version 1",
"description": "Normalized evidence and technical findings; raw capture schema versions are separate.",
"type": "object",
"properties": {
"schema_version": {
"type": "integer",
"const": 1
},
"metadata": {
"type": "object",
"properties": {
"producer": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "\\S"
},
"version": {
"type": "string",
"pattern": "\\S"
}
},
"required": [
"name",
"version"
],
"additionalProperties": false
},
"collected_at": {
"type": "string",
"format": "date-time"
},
"analysis_reference_time": {
"type": "string",
"format": "date-time"
},
"source": {
"type": "object",
"properties": {
"artifact": {
"type": "string",
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\:\\x00-\\x1f]+$(?![\\s\\S])"
},
"schema_version": {
"type": "integer",
"enum": [
1,
2
]
},
"sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$(?![\\s\\S])"
}
},
"required": [
"artifact",
"schema_version",
"sha256"
],
"additionalProperties": false
}
},
"required": [
"producer",
"collected_at",
"analysis_reference_time",
"source"
],
"additionalProperties": false
},
"system": {
"type": "object"
},
"collection": {
"type": "object",
"properties": {
"mode": {
"enum": [
"Compact",
"Mid",
"Full"
]
},
"status": {
"enum": [
"complete",
"partial",
"unknown"
]
},
"sections": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"status": {
"enum": [
"ok",
"skipped",
"unavailable",
"missing"
]
},
"record_count": {
"type": [
"integer",
"null"
],
"minimum": 0
},
"truncated": {
"type": "boolean"
},
"reason": {
"type": "string",
"pattern": "\\S"
}
},
"required": [
"status",
"record_count",
"truncated"
],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"status": {
"enum": [
"skipped",
"unavailable",
"missing"
]
}
}
},
"then": {
"required": [
"reason"
]
}
}
]
}
}
},
"required": [
"mode",
"status",
"sections"
],
"additionalProperties": false
},
"observations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$(?![\\s\\S])"
},
"section": {
"type": "string",
"pattern": "\\S"
},
"source_pointer": {
"type": "string",
"pattern": "^(?:/(?:[^~/]|~[01])*)*$(?![\\s\\S])"
},
"value": {},
"observed_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"section",
"source_pointer",
"value"
],
"additionalProperties": false
}
},
"findings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$(?![\\s\\S])"
},
"severity": {
"enum": [
"critical",
"warning",
"info",
"unanalysed"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"relevance_weight": {
"type": "number",
"minimum": 0.5,
"maximum": 1
},
"age_days": {
"type": "integer",
"minimum": 0
},
"title": {
"type": "string",
"pattern": "\\S"
},
"description": {
"type": "string",
"pattern": "\\S"
},
"evidence": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$(?![\\s\\S])"
},
"minItems": 1,
"uniqueItems": true
}
},
"required": [
"id",
"severity",
"confidence",
"title",
"description",
"evidence"
],
"additionalProperties": false
}
},
"warnings": {
"type": "array",
"items": {
"type": "string",
"pattern": "\\S"
}
}
},
"required": [
"schema_version",
"metadata",
"system",
"collection",
"observations",
"findings",
"warnings"
],
"additionalProperties": false
}