109 lines
4.1 KiB
JSON
109 lines
4.1 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "lint-report.schema.json",
|
|
"title": "08_lint.json",
|
|
"type": "object",
|
|
"required": ["schema_version", "rules_version", "rules_sha256", "tool", "generated_at", "document", "fail_on", "verdict", "summary", "fidelity", "findings"],
|
|
"properties": {
|
|
"schema_version": {"const": "1.0"},
|
|
"rules_version": {"type": "string", "minLength": 1},
|
|
"rules_sha256": {
|
|
"oneOf": [
|
|
{"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
{"type": "null"}
|
|
]
|
|
},
|
|
"tool": {"const": "lint_document"},
|
|
"generated_at": {"type": "string", "format": "date-time"},
|
|
"document": {"$ref": "#/$defs/fileHash"},
|
|
"logic_map_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
"term_ledger_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
"reader_contract_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
"fail_on": {"enum": ["error", "warning"]},
|
|
"verdict": {"enum": ["pass", "fail", "input_error"]},
|
|
"summary": {
|
|
"type": "object",
|
|
"required": ["errors", "warnings", "info", "total"],
|
|
"properties": {
|
|
"errors": {"type": "integer", "minimum": 0},
|
|
"warnings": {"type": "integer", "minimum": 0},
|
|
"info": {"type": "integer", "minimum": 0},
|
|
"total": {"type": "integer", "minimum": 0}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"fidelity": {
|
|
"type": "object",
|
|
"properties": {
|
|
"baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
|
"draft_baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
|
"protected_total": {"type": "integer", "minimum": 0},
|
|
"preserved": {"type": "integer", "minimum": 0},
|
|
"missing": {"type": "integer", "minimum": 0},
|
|
"by_type": {
|
|
"type": "object",
|
|
"additionalProperties": {"$ref": "#/$defs/fidelityTypeSummary"}
|
|
},
|
|
"finalization_change_rate": {"type": ["number", "null"], "minimum": 0, "maximum": 1},
|
|
"max_finalization_change_rate": {"type": "number", "minimum": 0, "maximum": 1}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"limitations": {"type": "array", "items": {"type": "string"}},
|
|
"findings": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["rule_id", "severity", "message", "path", "line", "column"],
|
|
"properties": {
|
|
"rule_id": {"type": "string", "minLength": 1},
|
|
"severity": {"enum": ["error", "warning", "info"]},
|
|
"message": {"type": "string", "minLength": 1},
|
|
"path": {"type": "string", "minLength": 1},
|
|
"line": {"type": ["integer", "null"], "minimum": 1},
|
|
"column": {"type": ["integer", "null"], "minimum": 1},
|
|
"section_id": {"type": ["string", "null"]},
|
|
"context": {"type": ["string", "null"]}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {"properties": {"verdict": {"enum": ["pass", "fail"]}}},
|
|
"then": {
|
|
"required": ["logic_map_sha256", "term_ledger_sha256", "reader_contract_sha256", "limitations"],
|
|
"properties": {
|
|
"rules_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
"fidelity": {
|
|
"required": ["baseline", "draft_baseline", "protected_total", "preserved", "missing", "by_type", "finalization_change_rate", "max_finalization_change_rate"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"$defs": {
|
|
"fileHash": {
|
|
"type": "object",
|
|
"required": ["path", "sha256"],
|
|
"properties": {
|
|
"path": {"type": "string", "minLength": 1},
|
|
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"fidelityTypeSummary": {
|
|
"type": "object",
|
|
"required": ["total", "preserved", "missing"],
|
|
"properties": {
|
|
"total": {"type": "integer", "minimum": 0},
|
|
"preserved": {"type": "integer", "minimum": 0},
|
|
"missing": {"type": "integer", "minimum": 0}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|