ariadne/contracts/iop-execution/v1/event.schema.json
2026-07-24 05:45:04 +09:00

372 lines
6.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.toki-labs.com/toki/ariadne/contracts/iop-execution/v1/event.schema.json",
"title": "Ariadne IOP execution event",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"execution_id",
"sequence",
"type",
"occurred_at"
],
"properties": {
"schema_version": {
"const": "ariadne.iop-execution-event.v1"
},
"execution_id": {
"type": "string",
"format": "uuid"
},
"sequence": {
"type": "integer",
"minimum": 0
},
"type": {
"type": "string",
"enum": [
"started",
"progress",
"analysis_result",
"change_result",
"validation_result",
"completed",
"failed",
"cancelled"
]
},
"message": {
"type": "string",
"maxLength": 20000
},
"analysis": {
"$ref": "#/$defs/analysis"
},
"change": {
"$ref": "#/$defs/change"
},
"validation": {
"$ref": "#/$defs/validation"
},
"failure": {
"$ref": "../../execution-failure/v1/schema.json"
},
"occurred_at": {
"type": "string",
"format": "date-time"
}
},
"$defs": {
"analysis": {
"type": "object",
"additionalProperties": false,
"required": [
"fixability",
"report"
],
"properties": {
"fixability": {
"type": "string",
"enum": [
"fixable",
"not_fixable",
"undetermined"
]
},
"report": {
"type": "string",
"minLength": 1,
"maxLength": 200000
},
"proposal_digest": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"allOf": [
{
"if": {
"properties": {
"fixability": {
"const": "fixable"
}
},
"required": [
"fixability"
]
},
"then": {
"required": [
"proposal_digest"
]
},
"else": {
"not": {
"required": [
"proposal_digest"
]
}
}
}
]
},
"change": {
"type": "object",
"additionalProperties": false,
"required": [
"changed"
],
"properties": {
"changed": {
"type": "boolean"
},
"branch": {
"type": "string",
"maxLength": 300
},
"patch_reference": {
"type": "string",
"maxLength": 1000
}
},
"allOf": [
{
"if": {
"properties": {
"changed": {
"const": true
}
},
"required": [
"changed"
]
},
"then": {
"required": [
"branch",
"patch_reference"
]
},
"else": {
"not": {
"anyOf": [
{
"required": [
"branch"
]
},
{
"required": [
"patch_reference"
]
}
]
}
}
}
]
},
"validation": {
"type": "object",
"additionalProperties": false,
"required": [
"passed",
"summary"
],
"properties": {
"passed": {
"type": "boolean"
},
"summary": {
"type": "string",
"minLength": 1,
"maxLength": 200000
},
"artifact_references": {
"type": "array",
"maxItems": 100,
"items": {
"type": "string",
"maxLength": 1000
}
}
}
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "failed"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"failure"
],
"not": {
"anyOf": [
{
"required": [
"analysis"
]
},
{
"required": [
"change"
]
},
{
"required": [
"validation"
]
}
]
}
},
"else": {
"not": {
"required": [
"failure"
]
}
}
},
{
"if": {
"properties": {
"type": {
"const": "analysis_result"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"analysis"
],
"not": {
"anyOf": [
{
"required": [
"change"
]
},
{
"required": [
"validation"
]
},
{
"required": [
"failure"
]
}
]
}
},
"else": {
"not": {
"required": [
"analysis"
]
}
}
},
{
"if": {
"properties": {
"type": {
"const": "change_result"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"change"
],
"not": {
"anyOf": [
{
"required": [
"analysis"
]
},
{
"required": [
"validation"
]
},
{
"required": [
"failure"
]
}
]
}
},
"else": {
"not": {
"required": [
"change"
]
}
}
},
{
"if": {
"properties": {
"type": {
"const": "validation_result"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"validation"
],
"not": {
"anyOf": [
{
"required": [
"analysis"
]
},
{
"required": [
"change"
]
},
{
"required": [
"failure"
]
}
]
}
},
"else": {
"not": {
"required": [
"validation"
]
}
}
}
]
}