|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://github.com/egohygiene/aether/catalog/schemas/aether.diagnosis-record.v1.schema.json", |
| 4 | + "title": "Aether Diagnosis Record v1 Frontmatter", |
| 5 | + "type": "object", |
| 6 | + "additionalProperties": false, |
| 7 | + "required": [ |
| 8 | + "schema", |
| 9 | + "id", |
| 10 | + "title", |
| 11 | + "status", |
| 12 | + "created", |
| 13 | + "updated", |
| 14 | + "authors", |
| 15 | + "scope", |
| 16 | + "context", |
| 17 | + "symptom_summary", |
| 18 | + "reproduction", |
| 19 | + "root_cause", |
| 20 | + "remediation", |
| 21 | + "validation", |
| 22 | + "sensitivity", |
| 23 | + "redactions", |
| 24 | + "related", |
| 25 | + "supersedes", |
| 26 | + "superseded_by" |
| 27 | + ], |
| 28 | + "properties": { |
| 29 | + "schema": { |
| 30 | + "const": "aether.diagnosis-record/v1" |
| 31 | + }, |
| 32 | + "id": { |
| 33 | + "type": "string", |
| 34 | + "pattern": "^diag-[0-9]{8}-[a-z0-9]+(?:-[a-z0-9]+)*$" |
| 35 | + }, |
| 36 | + "title": { |
| 37 | + "type": "string", |
| 38 | + "minLength": 1 |
| 39 | + }, |
| 40 | + "status": { |
| 41 | + "enum": ["open", "monitoring", "resolved", "closed", "superseded"] |
| 42 | + }, |
| 43 | + "created": { |
| 44 | + "type": "string", |
| 45 | + "format": "date-time" |
| 46 | + }, |
| 47 | + "updated": { |
| 48 | + "type": "string", |
| 49 | + "format": "date-time" |
| 50 | + }, |
| 51 | + "authors": { |
| 52 | + "type": "array", |
| 53 | + "minItems": 1, |
| 54 | + "uniqueItems": true, |
| 55 | + "items": { |
| 56 | + "type": "string", |
| 57 | + "minLength": 1 |
| 58 | + } |
| 59 | + }, |
| 60 | + "scope": { |
| 61 | + "type": "array", |
| 62 | + "minItems": 1, |
| 63 | + "uniqueItems": true, |
| 64 | + "items": { |
| 65 | + "type": "string", |
| 66 | + "minLength": 1 |
| 67 | + } |
| 68 | + }, |
| 69 | + "context": { |
| 70 | + "type": "object", |
| 71 | + "additionalProperties": false, |
| 72 | + "required": ["repository", "environment", "component", "artifact_version", "correlation_ids"], |
| 73 | + "properties": { |
| 74 | + "repository": {"type": "string", "minLength": 1}, |
| 75 | + "environment": {"type": "string", "minLength": 1}, |
| 76 | + "component": {"type": "string", "minLength": 1}, |
| 77 | + "artifact_version": {"type": "string", "minLength": 1}, |
| 78 | + "correlation_ids": { |
| 79 | + "type": "array", |
| 80 | + "uniqueItems": true, |
| 81 | + "items": {"type": "string", "minLength": 1} |
| 82 | + } |
| 83 | + } |
| 84 | + }, |
| 85 | + "symptom_summary": { |
| 86 | + "type": "string", |
| 87 | + "minLength": 1 |
| 88 | + }, |
| 89 | + "reproduction": { |
| 90 | + "$ref": "#/$defs/reproductionState" |
| 91 | + }, |
| 92 | + "root_cause": { |
| 93 | + "type": "object", |
| 94 | + "additionalProperties": false, |
| 95 | + "required": ["status", "hypothesis_id"], |
| 96 | + "properties": { |
| 97 | + "status": {"enum": ["unknown", "suspected", "confirmed"]}, |
| 98 | + "hypothesis_id": { |
| 99 | + "type": ["string", "null"], |
| 100 | + "pattern": "^H-[0-9]{3,}$" |
| 101 | + } |
| 102 | + } |
| 103 | + }, |
| 104 | + "remediation": { |
| 105 | + "type": "object", |
| 106 | + "additionalProperties": false, |
| 107 | + "required": ["status"], |
| 108 | + "properties": { |
| 109 | + "status": { |
| 110 | + "enum": ["not-authorized", "not-planned", "planned", "in-progress", "implemented", "reverted", "not-applicable"] |
| 111 | + } |
| 112 | + } |
| 113 | + }, |
| 114 | + "validation": { |
| 115 | + "type": "object", |
| 116 | + "additionalProperties": false, |
| 117 | + "required": ["status"], |
| 118 | + "properties": { |
| 119 | + "status": {"enum": ["not-run", "partial", "passed", "failed", "blocked"]} |
| 120 | + } |
| 121 | + }, |
| 122 | + "sensitivity": { |
| 123 | + "enum": ["public", "internal", "restricted"] |
| 124 | + }, |
| 125 | + "redactions": { |
| 126 | + "enum": ["none", "present"] |
| 127 | + }, |
| 128 | + "related": {"$ref": "#/$defs/stringList"}, |
| 129 | + "supersedes": {"$ref": "#/$defs/stringList"}, |
| 130 | + "superseded_by": {"$ref": "#/$defs/stringList"} |
| 131 | + }, |
| 132 | + "$defs": { |
| 133 | + "reproductionState": { |
| 134 | + "type": "object", |
| 135 | + "additionalProperties": false, |
| 136 | + "required": ["status"], |
| 137 | + "properties": { |
| 138 | + "status": { |
| 139 | + "enum": ["not-attempted", "blocked", "not-reproduced", "reproduced", "intermittent"] |
| 140 | + } |
| 141 | + } |
| 142 | + }, |
| 143 | + "stringList": { |
| 144 | + "type": "array", |
| 145 | + "uniqueItems": true, |
| 146 | + "items": {"type": "string", "minLength": 1} |
| 147 | + } |
| 148 | + }, |
| 149 | + "allOf": [ |
| 150 | + { |
| 151 | + "if": { |
| 152 | + "properties": { |
| 153 | + "root_cause": { |
| 154 | + "properties": {"status": {"const": "confirmed"}}, |
| 155 | + "required": ["status"] |
| 156 | + } |
| 157 | + } |
| 158 | + }, |
| 159 | + "then": { |
| 160 | + "properties": { |
| 161 | + "root_cause": { |
| 162 | + "properties": { |
| 163 | + "hypothesis_id": {"type": "string", "pattern": "^H-[0-9]{3,}$"} |
| 164 | + } |
| 165 | + } |
| 166 | + } |
| 167 | + } |
| 168 | + } |
| 169 | + ] |
| 170 | +} |
0 commit comments