{
	"$id": "https://archboard.local/schemas/model-manifest.schema.json",
	"title": "Canonical model manifest",
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"type": "object",
	"properties": {
		"schemaVersion": {
			"type": "number",
			"const": 1
		},
		"id": {
			"type": "string",
			"pattern": "^[A-Za-z0-9-]{1,8}$"
		},
		"name": {
			"type": "string",
			"minLength": 1,
			"maxLength": 120,
			"allOf": [
				{
					"pattern": "\\S"
				},
				{
					"pattern": "^[^\\n]*$"
				}
			]
		},
		"current": {
			"anyOf": [
				{
					"type": "object",
					"properties": {
						"id": {
							"type": "string",
							"pattern": "^[A-Za-z0-9-]{1,8}$"
						},
						"name": {
							"type": "string",
							"minLength": 1,
							"maxLength": 120,
							"allOf": [
								{
									"pattern": "\\S"
								},
								{
									"pattern": "^[^\\n]*$"
								}
							]
						},
						"formerNames": {
							"type": "array",
							"items": {
								"type": "string",
								"minLength": 1,
								"maxLength": 120,
								"allOf": [
									{
										"pattern": "\\S"
									},
									{
										"pattern": "^[^\\n]*$"
									}
								]
							}
						},
						"summary": {
							"type": "string",
							"minLength": 1,
							"maxLength": 2000,
							"pattern": "\\S"
						},
						"documents": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"repo": {
										"type": "string",
										"minLength": 1
									},
									"branch": {
										"type": "string",
										"minLength": 1
									},
									"commit": {
										"type": "string",
										"minLength": 1
									},
									"path": {
										"type": "string",
										"minLength": 1
									}
								},
								"required": [
									"repo",
									"path"
								],
								"additionalProperties": false
							}
						},
						"predecessor": {
							"anyOf": [
								{
									"type": "string",
									"pattern": "^[A-Za-z0-9-]{1,8}$"
								},
								{
									"type": "null"
								}
							]
						},
						"baseline": {
							"type": "string",
							"pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$"
						},
						"createdAt": {
							"type": "string",
							"format": "date-time",
							"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
						},
						"adoptedAt": {
							"type": "string",
							"format": "date-time",
							"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
						},
						"shelvedAt": {
							"type": "string",
							"format": "date-time",
							"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
						},
						"reason": {
							"type": "string",
							"minLength": 1
						},
						"previousCurrent": {
							"anyOf": [
								{
									"type": "string",
									"pattern": "^[A-Za-z0-9-]{1,8}$"
								},
								{
									"type": "null"
								}
							]
						}
					},
					"required": [
						"id",
						"name"
					],
					"additionalProperties": false
				},
				{
					"type": "null"
				}
			]
		},
		"retiredIds": {
			"type": "array",
			"items": {
				"type": "string",
				"pattern": "^[A-Za-z0-9-]{1,8}(?:\\/[A-Za-z0-9-]{1,8})?#[A-Za-z0-9-]{1,8}$"
			}
		}
	},
	"required": [
		"schemaVersion",
		"id",
		"name",
		"current"
	],
	"additionalProperties": false,
	"x-archboard": {
		"runtimeObligations": [
			"The complete canonical candidate must be coherent.",
			"Continuing identities remain stable.",
			"A write requires its complete revision, intent, and claim."
		]
	}
}
