118 lines
4.6 KiB
JSON
118 lines
4.6 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "quality-rules.schema.json",
|
|
"title": "Technical Document Flow quality rules",
|
|
"type": "object",
|
|
"required": ["schema_version", "rules_version", "thresholds", "patterns", "rules"],
|
|
"properties": {
|
|
"$schema": {"type": "string"},
|
|
"schema_version": {"const": "1.0"},
|
|
"rules_version": {"type": "string", "minLength": 1},
|
|
"thresholds": {
|
|
"type": "object",
|
|
"required": ["heading", "term", "paragraph", "logic", "route", "split", "finalization"],
|
|
"properties": {
|
|
"heading": {
|
|
"type": "object",
|
|
"required": ["required_h1_count", "max_level_jump"],
|
|
"additionalProperties": {"type": "integer", "minimum": 0}
|
|
},
|
|
"term": {
|
|
"type": "object",
|
|
"required": ["max_new_terms_per_sentence", "max_new_terms_per_paragraph", "max_new_terms_per_section", "definition_window_chars", "max_assumed_known", "max_assumed_per_prerequisite"],
|
|
"additionalProperties": {"type": "integer", "minimum": 0}
|
|
},
|
|
"paragraph": {
|
|
"type": "object",
|
|
"required": ["max_chars", "max_sentences"],
|
|
"additionalProperties": {"type": "integer", "minimum": 1}
|
|
},
|
|
"logic": {
|
|
"type": "object",
|
|
"required": ["core_claim_max_reader_paragraphs"],
|
|
"properties": {
|
|
"core_claim_max_reader_paragraphs": {"type": "integer", "minimum": 1}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"route": {
|
|
"type": "object",
|
|
"required": ["light", "standard", "deep"],
|
|
"properties": {
|
|
"light": {
|
|
"type": "object",
|
|
"required": ["requires_existing_draft", "max_input_chars", "max_sources", "max_headings"],
|
|
"properties": {
|
|
"requires_existing_draft": {"type": "boolean"},
|
|
"max_input_chars": {"type": "integer", "minimum": 1},
|
|
"max_sources": {"type": "integer", "minimum": 0},
|
|
"max_headings": {"type": "integer", "minimum": 0}
|
|
}
|
|
},
|
|
"standard": {
|
|
"type": "object",
|
|
"required": ["max_input_chars", "max_sources", "max_headings"],
|
|
"properties": {
|
|
"max_input_chars": {"type": "integer", "minimum": 1},
|
|
"max_sources": {"type": "integer", "minimum": 0},
|
|
"max_headings": {"type": "integer", "minimum": 0}
|
|
}
|
|
},
|
|
"deep": {
|
|
"type": "object",
|
|
"required": ["min_input_chars", "min_sources", "min_headings"],
|
|
"properties": {
|
|
"min_input_chars": {"type": "integer", "minimum": 1},
|
|
"min_sources": {"type": "integer", "minimum": 0},
|
|
"min_headings": {"type": "integer", "minimum": 0}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"split": {
|
|
"type": "object",
|
|
"required": ["default_max_chars", "minimum_h2_fill_ratio"],
|
|
"properties": {
|
|
"default_max_chars": {"type": "integer", "minimum": 1},
|
|
"minimum_h2_fill_ratio": {"type": "number", "minimum": 0, "maximum": 1}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"finalization": {
|
|
"type": "object",
|
|
"required": ["max_change_rate"],
|
|
"properties": {
|
|
"max_change_rate": {"type": "number", "minimum": 0, "maximum": 1}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patterns": {
|
|
"type": "object",
|
|
"required": ["placeholders", "evidence_markers", "technical_candidate_allowlist", "technical_lowercase_candidates"],
|
|
"properties": {
|
|
"placeholders": {"type": "array", "items": {"type": "string"}},
|
|
"evidence_markers": {"type": "array", "items": {"type": "string"}},
|
|
"technical_candidate_allowlist": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
|
"technical_lowercase_candidates": {"type": "array", "items": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$"}, "uniqueItems": true}
|
|
}
|
|
},
|
|
"rules": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "category", "severity", "description"],
|
|
"properties": {
|
|
"id": {"type": "string", "pattern": "^(?:DOC-[A-Z][0-9]{3}|FNL-[0-9]{3}|EVD-[0-9]{3}|RUN-[0-9]{3})$"},
|
|
"category": {"type": "string", "minLength": 1},
|
|
"severity": {"enum": ["error", "warning", "info"]},
|
|
"description": {"type": "string", "minLength": 1}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|