{
	"$id": "https://archboard.local/schemas/model-migrate.schema.json",
	"title": "Explicit legacy migration intent",
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"type": "object",
	"properties": {
		"expectedRevision": {
			"type": "object",
			"properties": {
				"digest": {
					"type": "string"
				},
				"files": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"path": {
								"type": "string"
							},
							"sha256": {
								"type": "string"
							}
						},
						"required": [
							"path",
							"sha256"
						],
						"additionalProperties": false
					}
				}
			},
			"required": [
				"digest",
				"files"
			],
			"additionalProperties": false
		},
		"expectedContext": {
			"type": "string",
			"pattern": "^[a-f0-9]{64}$"
		},
		"origin": {
			"type": "string",
			"pattern": "^[A-Za-z0-9-]{1,8}$"
		},
		"expectedSource": {
			"type": "object",
			"properties": {
				"digest": {
					"type": "string"
				},
				"files": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"path": {
								"type": "string"
							},
							"sha256": {
								"type": "string"
							}
						},
						"required": [
							"path",
							"sha256"
						],
						"additionalProperties": false
					}
				}
			},
			"required": [
				"digest",
				"files"
			],
			"additionalProperties": false
		},
		"expectedPlan": {
			"type": "string",
			"pattern": "^[a-f0-9]{64}$"
		},
		"previewRevision": {
			"type": "object",
			"properties": {
				"digest": {
					"type": "string"
				},
				"files": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"path": {
								"type": "string"
							},
							"sha256": {
								"type": "string"
							}
						},
						"required": [
							"path",
							"sha256"
						],
						"additionalProperties": false
					}
				}
			},
			"required": [
				"digest",
				"files"
			],
			"additionalProperties": false
		},
		"authorization": {
			"type": "string",
			"const": "owner"
		},
		"operationId": {
			"type": "string",
			"minLength": 1,
			"allOf": [
				{
					"pattern": "\\S"
				},
				{
					"pattern": "^[^\\n]*$"
				}
			]
		},
		"writer": {
			"type": "string",
			"minLength": 1,
			"allOf": [
				{
					"pattern": "\\S"
				},
				{
					"pattern": "^[^\\n]*$"
				}
			]
		},
		"doing": {
			"type": "string",
			"minLength": 1,
			"maxLength": 140,
			"allOf": [
				{
					"pattern": "\\S"
				},
				{
					"pattern": "^[^\\n]*$"
				}
			]
		}
	},
	"required": [
		"expectedRevision",
		"expectedContext",
		"origin",
		"expectedSource",
		"expectedPlan",
		"previewRevision",
		"authorization",
		"operationId",
		"writer",
		"doing"
	],
	"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."
		]
	}
}
