microsoft/hve-core
Publicmirrored from https://github.com/microsoft/hve-coreAvailable
scripts/linting/schemas/adr-consistency-rules.schema.json
54lines · modecode
| 1 | { |
| 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | "$id": "https://github.com/microsoft/hve-core/schemas/adr-consistency-rules.schema.json", |
| 4 | "title": "ADR Consistency Rule Registry Schema", |
| 5 | "description": "Schema for the ADR consistency rule registry consumed by the PowerShell validator. Each rule names a check function dispatched by the implementation to produce findings against ADR markdown under docs/planning/adrs/.", |
| 6 | "type": "object", |
| 7 | "additionalProperties": false, |
| 8 | "required": ["rules"], |
| 9 | "properties": { |
| 10 | "rules": { |
| 11 | "type": "array", |
| 12 | "minItems": 1, |
| 13 | "description": "Ordered list of consistency rules. The validator imports this array and dispatches to the named check function.", |
| 14 | "items": { |
| 15 | "type": "object", |
| 16 | "additionalProperties": false, |
| 17 | "required": ["id", "severity", "scope", "check", "message"], |
| 18 | "properties": { |
| 19 | "id": { |
| 20 | "type": "string", |
| 21 | "pattern": "^ADR-CONSISTENCY-\\d{3}$", |
| 22 | "description": "Stable rule identifier in the form ADR-CONSISTENCY-NNN (zero-padded three-digit suffix)." |
| 23 | }, |
| 24 | "severity": { |
| 25 | "type": "string", |
| 26 | "enum": ["error", "warn"], |
| 27 | "description": "Violation severity. 'error' fails the Govern exit gate; 'warn' surfaces a remediation hint without blocking." |
| 28 | }, |
| 29 | "scope": { |
| 30 | "type": "string", |
| 31 | "enum": ["frontmatter", "body", "cross-region"], |
| 32 | "description": "Region of the ADR document the check inspects." |
| 33 | }, |
| 34 | "check": { |
| 35 | "type": "string", |
| 36 | "minLength": 1, |
| 37 | "pattern": "^[a-z][a-z0-9-]*$", |
| 38 | "description": "Kebab-case name of the check function dispatched by the validator. Must resolve to a callable in PowerShell (Test-<PascalCase>)." |
| 39 | }, |
| 40 | "message": { |
| 41 | "type": "string", |
| 42 | "minLength": 1, |
| 43 | "description": "Remediation-oriented message template surfaced to the author. May contain {placeholder} tokens substituted by the validator." |
| 44 | }, |
| 45 | "description": { |
| 46 | "type": "string", |
| 47 | "minLength": 1, |
| 48 | "description": "Optional human-readable summary of the invariant the rule enforces." |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |